1 (* Copyright (C) Doom 2D: Forever Developers
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, version 3 of the License ONLY.
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
12 * You should have received a copy of the GNU General Public License
13 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 {$INCLUDE ../shared/a_modes.inc}
21 g_language
, g_weapons
, utils
;
23 function GenPlayerName (n
: Integer): String;
25 procedure g_Options_SetDefault
;
26 procedure g_Options_SetDefaultVideo
;
27 procedure g_Options_Read(FileName
: String);
28 procedure g_Options_Write(FileName
: String);
29 procedure g_Options_Write_Gameplay_Custom(FileName
: String);
30 procedure g_Options_Write_Gameplay_Net(FileName
: String);
31 procedure g_Options_Write_Net_Server(FileName
: String);
32 procedure g_Options_Write_Net_Client(FileName
: String);
33 procedure g_Options_Commands (p
: SSArray
);
35 const DF_Default_Megawad_Start
= 'megawads/DOOM2D.WAD:\MAP01';
43 gWinMaximized
: Boolean;
45 glLegacyNPOT
: Boolean;
46 gTextureFilter
: Boolean;
50 gMaxSimSounds
: Integer;
51 gMuteWhenInactive
: Boolean;
58 gDrawBackGround
: Boolean;
59 gShowMessages
: Boolean;
60 gRevertPlayers
: Boolean;
62 gAskLanguage
: Boolean;
69 gcTeamDamage
: Boolean;
71 gcWeaponStay
: Boolean;
80 gnTeamDamage
: Boolean;
82 gnWeaponStay
: Boolean;
85 gsSDLSampleRate
: Integer;
86 gsSDLBufferSize
: Integer;
87 gDefaultMegawadStart
: AnsiString;
88 gBerserkAutoswitch
: Boolean;
89 glNPOTOverride
: Boolean = false;
94 {$INCLUDE ../nogl/noGLuses.inc}
98 e_log
, e_input
, g_console
, g_window
, g_sound
, g_gfx
, g_player
, Math
,
99 g_map
, g_net
, g_netmaster
, SysUtils
, CONFIG
, g_game
, g_main
, e_texture
,
100 g_items
, wadreader
, e_graphics
, g_touch
, envvars
, g_system
;
105 function GenPlayerName (n
: Integer): String;
108 Result
:= GetUserName
;
110 Result
:= 'Player' + IntToStr(machine
MOD 10000);
112 Result
:= Copy(Result
, 1, 12) + ' '
114 Result
:= Copy(Result
, 1, 10) + ' ' + IntToStr(n
)
118 procedure g_Options_SetDefaultVideo
;
119 var display
: TSDL_DisplayMode
;
121 var target
, closest
: TSDL_DisplayMode
; percentage
: Integer;
124 (* Display 0 = Primary display *)
126 gScreenHeight
:= 480;
127 //gBPP := SDL_BITSPERPIXEL(dispaly.format);
130 gFullScreen
:= True; (* rotation not allowed? *)
132 gFullScreen
:= False;
134 if SDL_GetDesktopDisplayMode(0, @display
) = 0 then
137 gScreenWidth
:= display
.w
;
138 gScreenHeight
:= display
.h
;
140 (* Window must be smaller than display *)
141 closest
.w
:= display
.w
;
142 closest
.h
:= display
.h
;
144 while (display
.w
- closest
.w
< 48) or (display
.h
- closest
.h
< 48) do
146 if percentage
< 25 then
148 closest
.w
:= display
.w
* 75 div 100;
149 closest
.h
:= display
.h
* 75 div 100;
152 target
.w
:= display
.w
* percentage
div 100;
153 target
.h
:= display
.h
* percentage
div 100;
154 target
.format
:= 0; (* didn't care *)
155 target
.refresh_rate
:= 0; (* didn't care *)
156 target
.driverdata
:= nil; (* init *)
157 SDL_GetClosestDisplayMode(0, @target
, @closest
);
160 gScreenWidth
:= closest
.w
;
161 gScreenHeight
:= closest
.h
;
162 //gBPP := SDL_BITSPERPIXEL(closest.format); (* Resolution list didn't work for some reason *)
167 e_LogWritefln('SDL: Failed to get desktop display mode: %s', [SDL_GetError
])
169 (* Must be positioned on primary display *)
170 gWinMaximized
:= False;
172 gTextureFilter
:= True;
173 glLegacyNPOT
:= False;
174 gRC_Width
:= gScreenWidth
;
175 gRC_Height
:= gScreenHeight
;
176 gRC_FullScreen
:= gFullScreen
;
177 e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gScreenWidth
) + ' h = ' + IntToStr(gScreenHeight
));
178 g_Console_ResetBinds
;
181 procedure g_Options_SetDefaultVideo
;
184 gScreenHeight
:= 480;
186 gFullScreen
:= False;
187 gWinMaximized
:= False;
189 gTextureFilter
:= True;
190 glLegacyNPOT
:= False;
191 gRC_Width
:= gScreenWidth
;
192 gRC_Height
:= gScreenHeight
;
193 gRC_FullScreen
:= gFullScreen
;
194 e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gScreenWidth
) + ' h = ' + IntToStr(gScreenHeight
));
195 g_Console_ResetBinds
;
199 procedure g_Options_SetDefault();
208 gMuteWhenInactive
:= False;
209 gAnnouncer
:= ANNOUNCE_MEPLUS
;
210 gSoundEffectsDF
:= True;
211 gUseChatSounds
:= True;
212 gsSDLSampleRate
:= 44100;
213 gsSDLBufferSize
:= 2048;
215 g_Sound_SetupAllVolumes(gSoundLevel
, gMusicLevel
);
217 with gPlayer1Settings
do
219 Name
:= GenPlayerName(1);
220 Model
:= STD_PLAYER_MODEL
;
221 Color
.R
:= PLAYER1_DEF_COLOR
.R
;
222 Color
.G
:= PLAYER1_DEF_COLOR
.G
;
223 Color
.B
:= PLAYER1_DEF_COLOR
.B
;
227 with gPlayer2Settings
do
229 Name
:= GenPlayerName(2);
230 Model
:= STD_PLAYER_MODEL
;
231 Color
.R
:= PLAYER2_DEF_COLOR
.R
;
232 Color
.G
:= PLAYER2_DEF_COLOR
.G
;
233 Color
.B
:= PLAYER2_DEF_COLOR
.B
;
237 (* section Joysticks *)
238 for i
:= 0 to e_MaxJoys
- 1 do
240 e_JoystickDeadzones
[i
] := 8192
245 g_Shells_SetMax(300);
247 g_Corpses_SetMax(20);
249 ITEM_RESPAWNTIME
:= 60 * 36;
255 gDrawBackGround
:= True;
256 gShowMessages
:= True;
257 gRevertPlayers
:= False;
259 wadoptDebug
:= False;
261 e_FastScreenshots
:= True;
262 gDefaultMegawadStart
:= DF_Default_Megawad_Start
;
263 gBerserkAutoswitch
:= True;
266 gAskLanguage
:= True;
267 gLanguage
:= LANGUAGE_ENGLISH
;
269 (* section GameplayCustom *)
271 gcGameMode
:= _lc
[I_MENU_GAME_TYPE_DM
];
276 gcTeamDamage
:= False;
278 gcWeaponStay
:= False;
280 gcBotsVS
:= 'Everybody';
282 (* section GameplayNetwork *)
284 gnGameMode
:= _lc
[I_MENU_GAME_TYPE_DM
];
289 gnTeamDamage
:= False;
291 gnWeaponStay
:= False;
293 gnBotsVS
:= 'Everybody';
295 (* section MasterServer *)
296 NetSlistIP
:= 'mpms.doom2d.org';
297 NetSlistPort
:= 25665;
298 g_Net_Slist_Set(NetSlistIP
, NetSlistPort
, NetSlistList
);
301 NetServerName
:= 'Unnamed Server';
305 NetAllowRCON
:= False;
306 NetRCONPassword
:= 'default';
307 NetUseMaster
:= True;
310 NetMasterRate
:= 60000;
311 NetForwardPorts
:= False;
315 NetForcePlayerUpdate
:= False;
316 NetPredictSelf
:= True;
317 NetClientIP
:= '127.0.0.1';
318 NetClientPort
:= NetPort
;
321 procedure g_Options_Read(FileName
: String);
326 procedure ReadInteger (VAR v
: Integer; param
: String; minv
: Integer = Low(Integer); maxv
: Integer = High(Integer));
328 v
:= Max(Min(config
.ReadInt(section
, param
, v
), maxv
), minv
)
331 procedure ReadInteger (VAR v
: LongWord; param
: String; minv
: LongWord = Low(LongWord); maxv
: LongWord = High(LongWord)); overload
;
333 v
:= Max(Min(config
.ReadInt(section
, param
, v
), maxv
), minv
)
336 procedure ReadInteger (VAR v
: Word; param
: String; minv
: Word = Low(Word); maxv
: Word = High(Word)); overload
;
338 v
:= Max(Min(config
.ReadInt(section
, param
, v
), maxv
), minv
)
341 procedure ReadInteger (VAR v
: Byte; param
: String; minv
: Byte = Low(Byte); maxv
: Byte = High(Byte)); overload
;
343 v
:= Max(Min(config
.ReadInt(section
, param
, v
), maxv
), minv
)
346 procedure ReadBoolean (VAR v
: Boolean; param
: String);
348 v
:= config
.ReadBool(section
, param
, v
)
351 procedure ReadString (VAR v
: String; param
: String);
353 v
:= config
.ReadStr(section
, param
, v
)
357 gAskLanguage
:= True;
358 e_WriteLog('Reading config', TMsgType
.Notify
);
359 g_Options_SetDefault
;
361 if FileExists(FileName
) = False then
363 e_WriteLog('Config file '+FileName
+' not found', TMsgType
.Warning
);
364 g_Options_SetDefaultVideo
;
368 config
:= TConfig
.CreateFile(FileName
);
370 section
:= 'Player1';
371 with gPlayer1Settings
do
373 ReadString(Name
, 'name');
374 ReadString(Model
, 'model');
375 ReadInteger(Color
.R
, 'red', 0, 255);
376 ReadInteger(Color
.G
, 'green', 0, 255);
377 ReadInteger(Color
.B
, 'blue', 0, 255);
378 ReadInteger(Team
, 'team');
379 if (Team
< TEAM_RED
) or (Team
> TEAM_BLUE
) then
383 section
:= 'Player2';
384 with gPlayer2Settings
do
386 ReadString(Name
, 'name');
387 ReadString(Model
, 'model');
388 ReadInteger(Color
.R
, 'red', 0, 255);
389 ReadInteger(Color
.G
, 'green', 0, 255);
390 ReadInteger(Color
.B
, 'blue', 0, 255);
391 ReadInteger(Team
, 'team');
392 if (Team
< TEAM_RED
) or (Team
> TEAM_BLUE
) then
396 section
:= 'GameplayCustom';
397 ReadString(gcMap
, 'Map');
398 ReadString(gcGameMode
, 'GameMode');
399 ReadInteger(gcTimeLimit
, 'TimeLimit', 0, 65535);
400 ReadInteger(gcGoalLimit
, 'GoalLimit', 0, 65535);
401 ReadInteger(gcMaxLives
, 'MaxLives', 0, 255);
402 ReadInteger(gcPlayers
, 'Players', 0, 2);
403 ReadBoolean(gcTeamDamage
, 'TeamDamage');
404 ReadBoolean(gcAllowExit
, 'AllowExit');
405 ReadBoolean(gcWeaponStay
, 'WeaponStay');
406 ReadBoolean(gcMonsters
, 'Monsters');
407 ReadString(gcBotsVS
, 'BotsVS');
409 with gGameSettings
do
411 GameMode
:= g_Game_TextToMode(gcGameMode
);
412 if GameMode
= GM_NONE
then
414 if GameMode
= GM_SINGLE
then
416 TimeLimit
:= gcTimeLimit
;
417 GoalLimit
:= gcGoalLimit
;
418 MaxLives
:= gcMaxLives
;
422 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
424 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
426 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
428 Options
:= Options
or GAME_OPTION_MONSTERS
;
429 if gcBotsVS
= 'Everybody' then
430 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
431 if gcBotsVS
= 'Players' then
432 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
433 if gcBotsVS
= 'Monsters' then
434 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
437 section
:= 'GameplayNetwork';
438 ReadString(gnMap
, 'Map');
439 ReadString(gnGameMode
, 'GameMode');
440 ReadInteger(gnTimeLimit
, 'TimeLimit', 0, 65535);
441 ReadInteger(gnGoalLimit
, 'GoalLimit', 0, 65535);
442 ReadInteger(gnMaxLives
, 'MaxLives', 0, 255);
443 ReadInteger(gnPlayers
, 'Players', 0, 2);
444 ReadBoolean(gnTeamDamage
, 'TeamDamage');
445 ReadBoolean(gnAllowExit
, 'AllowExit');
446 ReadBoolean(gnWeaponStay
, 'WeaponStay');
447 ReadBoolean(gnMonsters
, 'Monsters');
448 ReadString(gnBotsVS
, 'BotsVS');
450 section
:= 'MasterServer';
451 ReadString(NetSlistIP
, 'IP');
452 ReadInteger(NetSlistPort
, 'Port', 0, 65535);
453 ReadString(NetSlistList
, 'List');
454 g_Net_Slist_Set(NetSlistIP
, NetSlistPort
, NetSlistList
);
457 ReadString(NetServerName
, 'Name');
458 ReadString(NetPassword
, 'Password');
459 ReadInteger(NetPort
, 'Port', 0, 65535);
460 ReadInteger(NetMaxClients
, 'MaxClients', 0, NET_MAXCLIENTS
);
461 ReadBoolean(NetAllowRCON
, 'RCON');
462 ReadString(NetRCONPassword
, 'RCONPassword');
463 ReadBoolean(NetUseMaster
, 'SyncWithMaster');
464 ReadInteger(NetUpdateRate
, 'UpdateInterval', 0);
465 ReadInteger(NetRelupdRate
, 'ReliableUpdateInterval', 0);
466 ReadInteger(NetMasterRate
, 'MasterSyncInterval', 1);
467 ReadBoolean(NetForwardPorts
, 'ForwardPorts');
470 ReadInteger(NetInterpLevel
, 'InterpolationSteps', 0);
471 ReadBoolean(NetForcePlayerUpdate
, 'ForcePlayerUpdate');
472 ReadBoolean(NetPredictSelf
, 'PredictSelf');
473 ReadString(NetClientIP
, 'LastIP');
474 ReadInteger(NetClientPort
, 'LastPort', 0, 65535);
478 //if gTextureFilter then TEXTUREFILTER := GL_LINEAR else TEXTUREFILTER := GL_NEAREST;
481 procedure g_Options_Write(FileName
: String);
484 e_WriteLog('Writing config', TMsgType
.Notify
);
486 config
:= TConfig
.CreateFile(FileName
);
488 with config
, gPlayer1Settings
do
490 WriteStr('Player1', 'Name', Name
);
491 WriteStr('Player1', 'model', Model
);
492 WriteInt('Player1', 'red', Color
.R
);
493 WriteInt('Player1', 'green', Color
.G
);
494 WriteInt('Player1', 'blue', Color
.B
);
495 WriteInt('Player1', 'team', Team
);
498 with config
, gPlayer2Settings
do
500 WriteStr('Player2', 'Name', Name
);
501 WriteStr('Player2', 'model', Model
);
502 WriteInt('Player2', 'red', Color
.R
);
503 WriteInt('Player2', 'green', Color
.G
);
504 WriteInt('Player2', 'blue', Color
.B
);
505 WriteInt('Player2', 'team', Team
);
508 config
.WriteStr ('GameplayCustom', 'Map', gcMap
);
509 config
.WriteStr ('GameplayCustom', 'GameMode', gcGameMode
);
510 config
.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit
);
511 config
.WriteInt ('GameplayCustom', 'GoalLimit', gcGoalLimit
);
512 config
.WriteInt ('GameplayCustom', 'MaxLives', gcMaxLives
);
513 config
.WriteInt ('GameplayCustom', 'Players', gcPlayers
);
514 config
.WriteBool('GameplayCustom', 'TeamDamage', gcTeamDamage
);
515 config
.WriteBool('GameplayCustom', 'AllowExit', gcAllowExit
);
516 config
.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay
);
517 config
.WriteBool('GameplayCustom', 'Monsters', gcMonsters
);
518 config
.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS
);
520 config
.WriteStr ('GameplayNetwork', 'Map', gnMap
);
521 config
.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode
);
522 config
.WriteInt ('GameplayNetwork', 'TimeLimit', gnTimeLimit
);
523 config
.WriteInt ('GameplayNetwork', 'GoalLimit', gnGoalLimit
);
524 config
.WriteInt ('GameplayNetwork', 'MaxLives', gnMaxLives
);
525 config
.WriteInt ('GameplayNetwork', 'Players', gnPlayers
);
526 config
.WriteBool('GameplayNetwork', 'TeamDamage', gnTeamDamage
);
527 config
.WriteBool('GameplayNetwork', 'AllowExit', gnAllowExit
);
528 config
.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay
);
529 config
.WriteBool('GameplayNetwork', 'Monsters', gnMonsters
);
530 config
.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS
);
532 config
.WriteStr('MasterServer', 'IP', NetSlistIP
);
533 config
.WriteInt('MasterServer', 'Port', NetSlistPort
);
534 config
.WriteStr('MasterServer', 'List', NetSlistList
);
536 config
.WriteStr ('Server', 'Name', NetServerName
);
537 config
.WriteStr ('Server', 'Password', NetPassword
);
538 config
.WriteInt ('Server', 'Port', NetPort
);
539 config
.WriteInt ('Server', 'MaxClients', NetMaxClients
);
540 config
.WriteBool('Server', 'RCON', NetAllowRCON
);
541 config
.WriteStr ('Server', 'RCONPassword', NetRCONPassword
);
542 config
.WriteBool('Server', 'SyncWithMaster', NetUseMaster
);
543 config
.WriteBool('Server', 'ForwardPorts', NetForwardPorts
);
544 config
.WriteInt ('Server', 'UpdateInterval', NetUpdateRate
);
545 config
.WriteInt ('Server', 'ReliableUpdateInterval', NetRelupdRate
);
546 config
.WriteInt ('Server', 'MasterSyncInterval', NetMasterRate
);
548 config
.WriteInt ('Client', 'InterpolationSteps', NetInterpLevel
);
549 config
.WriteBool ('Client', 'ForcePlayerUpdate', NetForcePlayerUpdate
);
550 config
.WriteBool ('Client', 'PredictSelf', NetPredictSelf
);
551 config
.WriteStr ('Client', 'LastIP', NetClientIP
);
552 config
.WriteInt ('Client', 'LastPort', NetClientPort
);
554 config
.SaveFile(FileName
);
558 procedure g_Options_Write_Gameplay_Custom(FileName
: String);
562 e_WriteLog('Writing custom gameplay config', TMsgType
.Notify
);
564 config
:= TConfig
.CreateFile(FileName
);
566 config
.WriteStr ('GameplayCustom', 'Map', gcMap
);
567 config
.WriteStr ('GameplayCustom', 'GameMode', gcGameMode
);
568 config
.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit
);
569 config
.WriteInt ('GameplayCustom', 'GoalLimit', gcGoalLimit
);
570 config
.WriteInt ('GameplayCustom', 'MaxLives', gcMaxLives
);
571 config
.WriteInt ('GameplayCustom', 'Players', gcPlayers
);
572 config
.WriteBool('GameplayCustom', 'TeamDamage', gcTeamDamage
);
573 config
.WriteBool('GameplayCustom', 'AllowExit', gcAllowExit
);
574 config
.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay
);
575 config
.WriteBool('GameplayCustom', 'Monsters', gcMonsters
);
576 config
.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS
);
578 config
.SaveFile(FileName
);
582 procedure g_Options_Write_Gameplay_Net(FileName
: String);
586 e_WriteLog('Writing network gameplay config', TMsgType
.Notify
);
588 config
:= TConfig
.CreateFile(FileName
);
590 config
.WriteStr ('GameplayNetwork', 'Map', gnMap
);
591 config
.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode
);
592 config
.WriteInt ('GameplayNetwork', 'TimeLimit', gnTimeLimit
);
593 config
.WriteInt ('GameplayNetwork', 'GoalLimit', gnGoalLimit
);
594 config
.WriteInt ('GameplayNetwork', 'MaxLives', gnMaxLives
);
595 config
.WriteInt ('GameplayNetwork', 'Players', gnPlayers
);
596 config
.WriteBool('GameplayNetwork', 'TeamDamage', gnTeamDamage
);
597 config
.WriteBool('GameplayNetwork', 'AllowExit', gnAllowExit
);
598 config
.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay
);
599 config
.WriteBool('GameplayNetwork', 'Monsters', gnMonsters
);
600 config
.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS
);
602 config
.SaveFile(FileName
);
606 procedure g_Options_Write_Net_Server(FileName
: String);
610 e_WriteLog('Writing server config', TMsgType
.Notify
);
612 config
:= TConfig
.CreateFile(FileName
);
614 config
.WriteStr ('Server', 'Name', NetServerName
);
615 config
.WriteStr ('Server', 'Password', NetPassword
);
616 config
.WriteInt ('Server', 'Port', NetPort
);
617 config
.WriteInt ('Server', 'MaxClients', NetMaxClients
);
618 config
.WriteBool('Server', 'SyncWithMaster', NetUseMaster
);
619 config
.WriteBool('Server', 'ForwardPorts', NetForwardPorts
);
621 config
.SaveFile(FileName
);
625 procedure g_Options_Write_Net_Client(FileName
: String);
629 e_WriteLog('Writing client config', TMsgType
.Notify
);
631 config
:= TConfig
.CreateFile(FileName
);
633 config
.WriteStr('Client', 'LastIP', NetClientIP
);
634 config
.WriteInt('Client', 'LastPort', NetClientPort
);
636 config
.SaveFile(FileName
);
640 procedure g_Options_Commands (p
: SSArray
);
641 var cmd
: AnsiString; i
: Integer;
643 cmd
:= LowerCase(p
[0]);
647 sys_EnableVSync(gVSync
);
648 gRC_Width
:= Max(1, gRC_Width
);
649 gRC_Height
:= Max(1, gRC_Height
);
650 gBPP
:= Max(1, gBPP
);
651 if sys_SetDisplayMode(gRC_Width
, gRC_Height
, gBPP
, gRC_FullScreen
) = True then
652 e_LogWriteln('resolution changed')
654 e_LogWriteln('resolution not changed')
658 if Length(p
) = 2 then
660 gAskLanguage
:= true;
661 gLanguage
:= LANGUAGE_ENGLISH
;
662 case LowerCase(p
[1]) of
665 gAskLanguage
:= false;
666 gLanguage
:= LANGUAGE_ENGLISH
;
670 gAskLanguage
:= false;
671 gLanguage
:= LANGUAGE_RUSSIAN
;
675 gAskLanguage
:= true;
676 gLanguage
:= LANGUAGE_ENGLISH
;
679 g_Language_Set(gLanguage
)
683 e_LogWritefln('usage: %s <English|Russian|Ask>', [cmd
])
688 if Length(p
) = 2 then
690 i
:= Max(0, StrToInt(p
[1]));
693 else if Length(p
) = 1 then
695 e_LogWritefln('%s', [g_GFX_GetMax()])
699 e_LogWritefln('usage: %s <n>', [cmd
])
704 if Length(p
) = 2 then
706 i
:= Max(0, StrToInt(p
[1]));
709 else if Length(p
) = 1 then
711 e_LogWritefln('%s', [g_Shells_GetMax()])
715 e_LogWritefln('usage: %s <n>', [cmd
])
720 if Length(p
) = 2 then
722 i
:= Max(0, StrToInt(p
[1]));
725 else if Length(p
) = 1 then
727 e_LogWritefln('%s', [g_Gibs_GetMax()])
731 e_LogWritefln('usage: %s <n>', [cmd
])
736 if Length(p
) = 2 then
738 i
:= Max(0, StrToInt(p
[1]));
741 else if Length(p
) = 1 then
743 e_LogWritefln('%s', [g_Corpses_GetMax()])
747 e_LogWritefln('usage: %s <n>', [cmd
])
750 'g_item_respawn_time':
752 if Length(p
) = 2 then
753 ITEM_RESPAWNTIME
:= Max(0, StrToInt(p
[1])) * 36
754 else if Length(p
) = 1 then
755 e_LogWritefln('%s', [ITEM_RESPAWNTIME
div 36])
757 e_LogWritefln('usage: %s <n>', [cmd
])
764 machine
:= Random(10000);
767 conRegVar('r_width', @gRC_Width
, '', '');
768 conRegVar('r_height', @gRC_Height
, '', '');
769 conRegVar('r_fullscreen', @gRC_FullScreen
, '', '');
770 conRegVar('r_maximized', @gRC_Maximized
, '', '');
771 conRegVar('r_bpp', @gBPP
, '', '');
772 conRegVar('r_vsync', @gVSync
, '', '');
773 conRegVar('r_texfilter', @gTextureFilter
, '', '');
774 conRegVar('r_npot', @glNPOTOverride
, '', '');
777 conRegVar('s_nosound', @gNoSound
, '', '');
778 conRegVar('s_soundvolume', @gSoundLevel
, '', '');
779 conRegVar('s_musicvolume', @gMusicLevel
, '', '');
780 conRegVar('s_maxsim', @gMaxSimSounds
, '', ''); // e_sound_fmod/sdl?
781 conRegVar('s_muteinactive', @gMuteWhenInactive
, '', '');
782 conRegVar('s_announcer', @gAnnouncer
, '', '');
783 conRegVar('s_sfx', @gSoundEffectsDF
, '', '');
784 conRegVar('s_chatsounds', @gUseChatSounds
, '', '');
785 {$IFDEF USE_SDLMIXER}
786 conRegVar('sdl_mixer_samplerate', @gsSDLSampleRate
, '', '');
787 conRegVar('sdl_mixer_buffersize', @gsSDLBufferSize
, '', '');
791 conRegVar('g_gibs_count', @gGibsCount
, '', '');
792 conRegVar('g_blood_count', @gBloodCount
, '', '');
793 conRegVar('g_adv_blood', @gAdvBlood
, '', '');
794 conRegVar('g_adv_corpses', @gAdvCorpses
, '', '');
795 conRegVar('g_adv_gibs', @gAdvGibs
, '', '');
796 conRegVar('r_flash', @gFlash
, '', '');
797 conRegVar('r_background', @gDrawBackGround
, '', '');
798 conRegVar('g_show_messages', @gShowMessages
, '', '');
799 conRegVar('r_revert_players', @gRevertPlayers
, '', '');
800 conRegVar('r_chat_bubble', @gChatBubble
, '', '');
801 conRegVar('sfs_debug', @wadoptDebug
, '', '');
802 conRegVar('sfs_fastmode', @wadoptFast
, '', '');
803 conRegVar('g_fast_screenshots', @e_FastScreenshots
, '', '');
804 conRegVar('g_default_megawad', @gDefaultMegawadStart
, '', '');