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;
63 gSaveStats
: Boolean = False;
64 gScreenshotStats
: Boolean = False;
71 gcTeamDamage
: Boolean;
73 gcWeaponStay
: Boolean;
82 gnTeamDamage
: Boolean;
84 gnWeaponStay
: Boolean;
87 gsSDLSampleRate
: Integer;
88 gsSDLBufferSize
: Integer;
89 gDefaultMegawadStart
: AnsiString;
90 gBerserkAutoswitch
: Boolean;
91 glNPOTOverride
: Boolean = false;
96 {$INCLUDE ../nogl/noGLuses.inc}
100 e_log
, e_input
, g_console
, g_window
, g_sound
, g_gfx
, g_player
, Math
,
101 g_map
, g_net
, g_netmaster
, SysUtils
, CONFIG
, g_game
, g_main
, e_texture
,
102 g_items
, wadreader
, e_graphics
, g_touch
, envvars
, g_system
;
107 function GenPlayerName (n
: Integer): String;
110 Result
:= GetUserName
;
112 Result
:= 'Player' + IntToStr(machine
MOD 10000);
114 Result
:= Copy(Result
, 1, 12) + ' '
116 Result
:= Copy(Result
, 1, 10) + ' ' + IntToStr(n
)
120 procedure g_Options_SetDefaultVideo
;
121 var display
: TSDL_DisplayMode
;
123 var target
, closest
: TSDL_DisplayMode
; percentage
: Integer;
126 (* Display 0 = Primary display *)
128 gScreenHeight
:= 480;
129 //gBPP := SDL_BITSPERPIXEL(dispaly.format);
132 gFullScreen
:= True; (* rotation not allowed? *)
134 gFullScreen
:= False;
136 if SDL_GetDesktopDisplayMode(0, @display
) = 0 then
139 gScreenWidth
:= display
.w
;
140 gScreenHeight
:= display
.h
;
142 (* Window must be smaller than display *)
143 closest
.w
:= display
.w
;
144 closest
.h
:= display
.h
;
146 while (display
.w
- closest
.w
< 48) or (display
.h
- closest
.h
< 48) do
148 if percentage
< 25 then
150 closest
.w
:= display
.w
* 75 div 100;
151 closest
.h
:= display
.h
* 75 div 100;
154 target
.w
:= display
.w
* percentage
div 100;
155 target
.h
:= display
.h
* percentage
div 100;
156 target
.format
:= 0; (* didn't care *)
157 target
.refresh_rate
:= 0; (* didn't care *)
158 target
.driverdata
:= nil; (* init *)
159 SDL_GetClosestDisplayMode(0, @target
, @closest
);
162 gScreenWidth
:= closest
.w
;
163 gScreenHeight
:= closest
.h
;
164 //gBPP := SDL_BITSPERPIXEL(closest.format); (* Resolution list didn't work for some reason *)
169 e_LogWritefln('SDL: Failed to get desktop display mode: %s', [SDL_GetError
])
171 (* Must be positioned on primary display *)
172 gWinMaximized
:= False;
174 gTextureFilter
:= True;
175 glLegacyNPOT
:= False;
176 gRC_Width
:= gScreenWidth
;
177 gRC_Height
:= gScreenHeight
;
178 gRC_FullScreen
:= gFullScreen
;
179 gRC_Maximized
:= gWinMaximized
;
180 e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gScreenWidth
) + ' h = ' + IntToStr(gScreenHeight
));
181 g_Console_ResetBinds
;
184 procedure g_Options_SetDefaultVideo
;
187 gScreenHeight
:= 480;
189 gFullScreen
:= False;
190 gWinMaximized
:= False;
192 gTextureFilter
:= True;
193 glLegacyNPOT
:= False;
194 gRC_Width
:= gScreenWidth
;
195 gRC_Height
:= gScreenHeight
;
196 gRC_FullScreen
:= gFullScreen
;
197 gRC_Maximized
:= gWinMaximized
;
198 e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gScreenWidth
) + ' h = ' + IntToStr(gScreenHeight
));
199 g_Console_ResetBinds
;
203 procedure g_Options_SetDefault();
212 gMuteWhenInactive
:= False;
213 gAnnouncer
:= ANNOUNCE_MEPLUS
;
214 gSoundEffectsDF
:= True;
215 gUseChatSounds
:= True;
216 gsSDLSampleRate
:= 44100;
217 gsSDLBufferSize
:= 2048;
219 g_Sound_SetupAllVolumes(gSoundLevel
, gMusicLevel
);
221 with gPlayer1Settings
do
223 Name
:= GenPlayerName(1);
224 Model
:= STD_PLAYER_MODEL
;
225 Color
.R
:= PLAYER1_DEF_COLOR
.R
;
226 Color
.G
:= PLAYER1_DEF_COLOR
.G
;
227 Color
.B
:= PLAYER1_DEF_COLOR
.B
;
231 with gPlayer2Settings
do
233 Name
:= GenPlayerName(2);
234 Model
:= STD_PLAYER_MODEL
;
235 Color
.R
:= PLAYER2_DEF_COLOR
.R
;
236 Color
.G
:= PLAYER2_DEF_COLOR
.G
;
237 Color
.B
:= PLAYER2_DEF_COLOR
.B
;
241 (* section Joysticks *)
242 for i
:= 0 to e_MaxJoys
- 1 do
244 e_JoystickDeadzones
[i
] := 8192
249 g_Shells_SetMax(300);
251 g_Corpses_SetMax(20);
253 ITEM_RESPAWNTIME
:= 60 * 36;
259 gDrawBackGround
:= True;
260 gShowMessages
:= True;
261 gRevertPlayers
:= False;
263 wadoptDebug
:= False;
265 e_FastScreenshots
:= True;
266 gDefaultMegawadStart
:= DF_Default_Megawad_Start
;
267 gBerserkAutoswitch
:= True;
271 gAskLanguage
:= True;
272 gLanguage
:= LANGUAGE_ENGLISH
;
274 (* section GameplayCustom *)
276 gcGameMode
:= _lc
[I_MENU_GAME_TYPE_DM
];
281 gcTeamDamage
:= False;
283 gcWeaponStay
:= False;
285 gcBotsVS
:= 'Everybody';
287 (* section GameplayNetwork *)
289 gnGameMode
:= _lc
[I_MENU_GAME_TYPE_DM
];
294 gnTeamDamage
:= False;
296 gnWeaponStay
:= False;
298 gnBotsVS
:= 'Everybody';
300 (* section MasterServer *)
301 NetSlistIP
:= 'mpms.doom2d.org';
302 NetSlistPort
:= 25665;
303 g_Net_Slist_Set(NetSlistIP
, NetSlistPort
, NetSlistList
);
306 NetServerName
:= 'Unnamed Server';
310 NetAllowRCON
:= False;
311 NetRCONPassword
:= 'default';
312 NetUseMaster
:= True;
315 NetMasterRate
:= 60000;
316 NetForwardPorts
:= False;
320 NetForcePlayerUpdate
:= False;
321 NetPredictSelf
:= True;
322 NetClientIP
:= '127.0.0.1';
323 NetClientPort
:= NetPort
;
326 procedure g_Options_Read(FileName
: String);
331 procedure ReadInteger (VAR v
: Integer; param
: String; minv
: Integer = Low(Integer); maxv
: Integer = High(Integer));
333 v
:= Max(Min(config
.ReadInt(section
, param
, v
), maxv
), minv
)
336 procedure ReadInteger (VAR v
: LongWord; param
: String; minv
: LongWord = Low(LongWord); maxv
: LongWord = High(LongWord)); overload
;
338 v
:= Max(Min(config
.ReadInt(section
, param
, v
), maxv
), minv
)
341 procedure ReadInteger (VAR v
: Word; param
: String; minv
: Word = Low(Word); maxv
: Word = High(Word)); overload
;
343 v
:= Max(Min(config
.ReadInt(section
, param
, v
), maxv
), minv
)
346 procedure ReadInteger (VAR v
: Byte; param
: String; minv
: Byte = Low(Byte); maxv
: Byte = High(Byte)); overload
;
348 v
:= Max(Min(config
.ReadInt(section
, param
, v
), maxv
), minv
)
351 procedure ReadBoolean (VAR v
: Boolean; param
: String);
353 v
:= config
.ReadBool(section
, param
, v
)
356 procedure ReadString (VAR v
: String; param
: String);
358 v
:= config
.ReadStr(section
, param
, v
)
362 gAskLanguage
:= True;
363 e_WriteLog('Reading config', TMsgType
.Notify
);
364 g_Options_SetDefault
;
366 if FileExists(FileName
) = False then
368 e_WriteLog('Config file '+FileName
+' not found', TMsgType
.Warning
);
369 g_Options_SetDefaultVideo
;
373 config
:= TConfig
.CreateFile(FileName
);
375 section
:= 'Player1';
376 with gPlayer1Settings
do
378 ReadString(Name
, 'name');
379 ReadString(Model
, 'model');
380 ReadInteger(Color
.R
, 'red', 0, 255);
381 ReadInteger(Color
.G
, 'green', 0, 255);
382 ReadInteger(Color
.B
, 'blue', 0, 255);
383 ReadInteger(Team
, 'team');
384 if (Team
< TEAM_RED
) or (Team
> TEAM_BLUE
) then
388 section
:= 'Player2';
389 with gPlayer2Settings
do
391 ReadString(Name
, 'name');
392 ReadString(Model
, 'model');
393 ReadInteger(Color
.R
, 'red', 0, 255);
394 ReadInteger(Color
.G
, 'green', 0, 255);
395 ReadInteger(Color
.B
, 'blue', 0, 255);
396 ReadInteger(Team
, 'team');
397 if (Team
< TEAM_RED
) or (Team
> TEAM_BLUE
) then
401 section
:= 'GameplayCustom';
402 ReadString(gcMap
, 'Map');
403 ReadString(gcGameMode
, 'GameMode');
404 ReadInteger(gcTimeLimit
, 'TimeLimit', 0, 65535);
405 ReadInteger(gcGoalLimit
, 'GoalLimit', 0, 65535);
406 ReadInteger(gcMaxLives
, 'MaxLives', 0, 255);
407 ReadInteger(gcPlayers
, 'Players', 0, 2);
408 ReadBoolean(gcTeamDamage
, 'TeamDamage');
409 ReadBoolean(gcAllowExit
, 'AllowExit');
410 ReadBoolean(gcWeaponStay
, 'WeaponStay');
411 ReadBoolean(gcMonsters
, 'Monsters');
412 ReadString(gcBotsVS
, 'BotsVS');
414 with gGameSettings
do
416 GameMode
:= g_Game_TextToMode(gcGameMode
);
417 if GameMode
= GM_NONE
then
419 if GameMode
= GM_SINGLE
then
421 TimeLimit
:= gcTimeLimit
;
422 GoalLimit
:= gcGoalLimit
;
423 MaxLives
:= gcMaxLives
;
427 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
429 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
431 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
433 Options
:= Options
or GAME_OPTION_MONSTERS
;
434 if gcBotsVS
= 'Everybody' then
435 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
436 if gcBotsVS
= 'Players' then
437 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
438 if gcBotsVS
= 'Monsters' then
439 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
442 section
:= 'GameplayNetwork';
443 ReadString(gnMap
, 'Map');
444 ReadString(gnGameMode
, 'GameMode');
445 ReadInteger(gnTimeLimit
, 'TimeLimit', 0, 65535);
446 ReadInteger(gnGoalLimit
, 'GoalLimit', 0, 65535);
447 ReadInteger(gnMaxLives
, 'MaxLives', 0, 255);
448 ReadInteger(gnPlayers
, 'Players', 0, 2);
449 ReadBoolean(gnTeamDamage
, 'TeamDamage');
450 ReadBoolean(gnAllowExit
, 'AllowExit');
451 ReadBoolean(gnWeaponStay
, 'WeaponStay');
452 ReadBoolean(gnMonsters
, 'Monsters');
453 ReadString(gnBotsVS
, 'BotsVS');
455 section
:= 'MasterServer';
456 ReadString(NetSlistIP
, 'IP');
457 ReadInteger(NetSlistPort
, 'Port', 0, 65535);
458 ReadString(NetSlistList
, 'List');
459 g_Net_Slist_Set(NetSlistIP
, NetSlistPort
, NetSlistList
);
462 ReadString(NetServerName
, 'Name');
463 ReadString(NetPassword
, 'Password');
464 ReadInteger(NetPort
, 'Port', 0, 65535);
465 ReadInteger(NetMaxClients
, 'MaxClients', 0, NET_MAXCLIENTS
);
466 ReadBoolean(NetAllowRCON
, 'RCON');
467 ReadString(NetRCONPassword
, 'RCONPassword');
468 ReadBoolean(NetUseMaster
, 'SyncWithMaster');
469 ReadInteger(NetUpdateRate
, 'UpdateInterval', 0);
470 ReadInteger(NetRelupdRate
, 'ReliableUpdateInterval', 0);
471 ReadInteger(NetMasterRate
, 'MasterSyncInterval', 1);
472 ReadBoolean(NetForwardPorts
, 'ForwardPorts');
475 ReadInteger(NetInterpLevel
, 'InterpolationSteps', 0);
476 ReadBoolean(NetForcePlayerUpdate
, 'ForcePlayerUpdate');
477 ReadBoolean(NetPredictSelf
, 'PredictSelf');
478 ReadString(NetClientIP
, 'LastIP');
479 ReadInteger(NetClientPort
, 'LastPort', 0, 65535);
483 //if gTextureFilter then TEXTUREFILTER := GL_LINEAR else TEXTUREFILTER := GL_NEAREST;
486 procedure g_Options_Write(FileName
: String);
489 e_WriteLog('Writing config', TMsgType
.Notify
);
491 config
:= TConfig
.CreateFile(FileName
);
493 with config
, gPlayer1Settings
do
495 WriteStr('Player1', 'Name', Name
);
496 WriteStr('Player1', 'model', Model
);
497 WriteInt('Player1', 'red', Color
.R
);
498 WriteInt('Player1', 'green', Color
.G
);
499 WriteInt('Player1', 'blue', Color
.B
);
500 WriteInt('Player1', 'team', Team
);
503 with config
, gPlayer2Settings
do
505 WriteStr('Player2', 'Name', Name
);
506 WriteStr('Player2', 'model', Model
);
507 WriteInt('Player2', 'red', Color
.R
);
508 WriteInt('Player2', 'green', Color
.G
);
509 WriteInt('Player2', 'blue', Color
.B
);
510 WriteInt('Player2', 'team', Team
);
513 config
.WriteStr ('GameplayCustom', 'Map', gcMap
);
514 config
.WriteStr ('GameplayCustom', 'GameMode', gcGameMode
);
515 config
.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit
);
516 config
.WriteInt ('GameplayCustom', 'GoalLimit', gcGoalLimit
);
517 config
.WriteInt ('GameplayCustom', 'MaxLives', gcMaxLives
);
518 config
.WriteInt ('GameplayCustom', 'Players', gcPlayers
);
519 config
.WriteBool('GameplayCustom', 'TeamDamage', gcTeamDamage
);
520 config
.WriteBool('GameplayCustom', 'AllowExit', gcAllowExit
);
521 config
.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay
);
522 config
.WriteBool('GameplayCustom', 'Monsters', gcMonsters
);
523 config
.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS
);
525 config
.WriteStr ('GameplayNetwork', 'Map', gnMap
);
526 config
.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode
);
527 config
.WriteInt ('GameplayNetwork', 'TimeLimit', gnTimeLimit
);
528 config
.WriteInt ('GameplayNetwork', 'GoalLimit', gnGoalLimit
);
529 config
.WriteInt ('GameplayNetwork', 'MaxLives', gnMaxLives
);
530 config
.WriteInt ('GameplayNetwork', 'Players', gnPlayers
);
531 config
.WriteBool('GameplayNetwork', 'TeamDamage', gnTeamDamage
);
532 config
.WriteBool('GameplayNetwork', 'AllowExit', gnAllowExit
);
533 config
.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay
);
534 config
.WriteBool('GameplayNetwork', 'Monsters', gnMonsters
);
535 config
.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS
);
537 config
.WriteStr('MasterServer', 'IP', NetSlistIP
);
538 config
.WriteInt('MasterServer', 'Port', NetSlistPort
);
539 config
.WriteStr('MasterServer', 'List', NetSlistList
);
541 config
.WriteStr ('Server', 'Name', NetServerName
);
542 config
.WriteStr ('Server', 'Password', NetPassword
);
543 config
.WriteInt ('Server', 'Port', NetPort
);
544 config
.WriteInt ('Server', 'MaxClients', NetMaxClients
);
545 config
.WriteBool('Server', 'RCON', NetAllowRCON
);
546 config
.WriteStr ('Server', 'RCONPassword', NetRCONPassword
);
547 config
.WriteBool('Server', 'SyncWithMaster', NetUseMaster
);
548 config
.WriteBool('Server', 'ForwardPorts', NetForwardPorts
);
549 config
.WriteInt ('Server', 'UpdateInterval', NetUpdateRate
);
550 config
.WriteInt ('Server', 'ReliableUpdateInterval', NetRelupdRate
);
551 config
.WriteInt ('Server', 'MasterSyncInterval', NetMasterRate
);
553 config
.WriteInt ('Client', 'InterpolationSteps', NetInterpLevel
);
554 config
.WriteBool ('Client', 'ForcePlayerUpdate', NetForcePlayerUpdate
);
555 config
.WriteBool ('Client', 'PredictSelf', NetPredictSelf
);
556 config
.WriteStr ('Client', 'LastIP', NetClientIP
);
557 config
.WriteInt ('Client', 'LastPort', NetClientPort
);
559 config
.SaveFile(FileName
);
563 procedure g_Options_Write_Gameplay_Custom(FileName
: String);
567 e_WriteLog('Writing custom gameplay config', TMsgType
.Notify
);
569 config
:= TConfig
.CreateFile(FileName
);
571 config
.WriteStr ('GameplayCustom', 'Map', gcMap
);
572 config
.WriteStr ('GameplayCustom', 'GameMode', gcGameMode
);
573 config
.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit
);
574 config
.WriteInt ('GameplayCustom', 'GoalLimit', gcGoalLimit
);
575 config
.WriteInt ('GameplayCustom', 'MaxLives', gcMaxLives
);
576 config
.WriteInt ('GameplayCustom', 'Players', gcPlayers
);
577 config
.WriteBool('GameplayCustom', 'TeamDamage', gcTeamDamage
);
578 config
.WriteBool('GameplayCustom', 'AllowExit', gcAllowExit
);
579 config
.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay
);
580 config
.WriteBool('GameplayCustom', 'Monsters', gcMonsters
);
581 config
.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS
);
583 config
.SaveFile(FileName
);
587 procedure g_Options_Write_Gameplay_Net(FileName
: String);
591 e_WriteLog('Writing network gameplay config', TMsgType
.Notify
);
593 config
:= TConfig
.CreateFile(FileName
);
595 config
.WriteStr ('GameplayNetwork', 'Map', gnMap
);
596 config
.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode
);
597 config
.WriteInt ('GameplayNetwork', 'TimeLimit', gnTimeLimit
);
598 config
.WriteInt ('GameplayNetwork', 'GoalLimit', gnGoalLimit
);
599 config
.WriteInt ('GameplayNetwork', 'MaxLives', gnMaxLives
);
600 config
.WriteInt ('GameplayNetwork', 'Players', gnPlayers
);
601 config
.WriteBool('GameplayNetwork', 'TeamDamage', gnTeamDamage
);
602 config
.WriteBool('GameplayNetwork', 'AllowExit', gnAllowExit
);
603 config
.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay
);
604 config
.WriteBool('GameplayNetwork', 'Monsters', gnMonsters
);
605 config
.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS
);
607 config
.SaveFile(FileName
);
611 procedure g_Options_Write_Net_Server(FileName
: String);
615 e_WriteLog('Writing server config', TMsgType
.Notify
);
617 config
:= TConfig
.CreateFile(FileName
);
619 config
.WriteStr ('Server', 'Name', NetServerName
);
620 config
.WriteStr ('Server', 'Password', NetPassword
);
621 config
.WriteInt ('Server', 'Port', NetPort
);
622 config
.WriteInt ('Server', 'MaxClients', NetMaxClients
);
623 config
.WriteBool('Server', 'SyncWithMaster', NetUseMaster
);
624 config
.WriteBool('Server', 'ForwardPorts', NetForwardPorts
);
626 config
.SaveFile(FileName
);
630 procedure g_Options_Write_Net_Client(FileName
: String);
634 e_WriteLog('Writing client config', TMsgType
.Notify
);
636 config
:= TConfig
.CreateFile(FileName
);
638 config
.WriteStr('Client', 'LastIP', NetClientIP
);
639 config
.WriteInt('Client', 'LastPort', NetClientPort
);
641 config
.SaveFile(FileName
);
645 procedure g_Options_Commands (p
: SSArray
);
646 var cmd
: AnsiString; i
: Integer;
648 cmd
:= LowerCase(p
[0]);
652 sys_EnableVSync(gVSync
);
653 gRC_Width
:= Max(1, gRC_Width
);
654 gRC_Height
:= Max(1, gRC_Height
);
655 gBPP
:= Max(1, gBPP
);
656 if sys_SetDisplayMode(gRC_Width
, gRC_Height
, gBPP
, gRC_FullScreen
, gRC_Maximized
) = True then
657 e_LogWriteln('resolution changed')
659 e_LogWriteln('resolution not changed')
663 if Length(p
) = 2 then
665 gAskLanguage
:= true;
666 gLanguage
:= LANGUAGE_ENGLISH
;
667 case LowerCase(p
[1]) of
670 gAskLanguage
:= false;
671 gLanguage
:= LANGUAGE_ENGLISH
;
675 gAskLanguage
:= false;
676 gLanguage
:= LANGUAGE_RUSSIAN
;
680 gAskLanguage
:= true;
681 gLanguage
:= LANGUAGE_ENGLISH
;
684 g_Language_Set(gLanguage
)
688 e_LogWritefln('usage: %s <English|Russian|Ask>', [cmd
])
693 if Length(p
) = 2 then
695 i
:= Max(0, StrToInt(p
[1]));
698 else if Length(p
) = 1 then
700 e_LogWritefln('%s', [g_GFX_GetMax()])
704 e_LogWritefln('usage: %s <n>', [cmd
])
709 if Length(p
) = 2 then
711 i
:= Max(0, StrToInt(p
[1]));
714 else if Length(p
) = 1 then
716 e_LogWritefln('%s', [g_Shells_GetMax()])
720 e_LogWritefln('usage: %s <n>', [cmd
])
725 if Length(p
) = 2 then
727 i
:= Max(0, StrToInt(p
[1]));
730 else if Length(p
) = 1 then
732 e_LogWritefln('%s', [g_Gibs_GetMax()])
736 e_LogWritefln('usage: %s <n>', [cmd
])
741 if Length(p
) = 2 then
743 i
:= Max(0, StrToInt(p
[1]));
746 else if Length(p
) = 1 then
748 e_LogWritefln('%s', [g_Corpses_GetMax()])
752 e_LogWritefln('usage: %s <n>', [cmd
])
755 'g_item_respawn_time':
757 if Length(p
) = 2 then
758 ITEM_RESPAWNTIME
:= Max(0, StrToInt(p
[1])) * 36
759 else if Length(p
) = 1 then
760 e_LogWritefln('%s', [ITEM_RESPAWNTIME
div 36])
762 e_LogWritefln('usage: %s <n>', [cmd
])
769 machine
:= Random(10000);
772 conRegVar('r_width', @gRC_Width
, '', '');
773 conRegVar('r_height', @gRC_Height
, '', '');
774 conRegVar('r_fullscreen', @gRC_FullScreen
, '', '');
775 conRegVar('r_maximized', @gRC_Maximized
, '', '');
776 conRegVar('r_bpp', @gBPP
, '', '');
777 conRegVar('r_vsync', @gVSync
, '', '');
778 conRegVar('r_texfilter', @gTextureFilter
, '', '');
779 conRegVar('r_npot', @glNPOTOverride
, '', '');
782 conRegVar('s_nosound', @gNoSound
, '', '');
783 conRegVar('s_soundvolume', @gSoundLevel
, '', '');
784 conRegVar('s_musicvolume', @gMusicLevel
, '', '');
785 conRegVar('s_maxsim', @gMaxSimSounds
, '', ''); // e_sound_fmod/sdl?
786 conRegVar('s_muteinactive', @gMuteWhenInactive
, '', '');
787 conRegVar('s_announcer', @gAnnouncer
, '', '');
788 conRegVar('s_sfx', @gSoundEffectsDF
, '', '');
789 conRegVar('s_chatsounds', @gUseChatSounds
, '', '');
790 {$IFDEF USE_SDLMIXER}
791 conRegVar('sdl_mixer_samplerate', @gsSDLSampleRate
, '', '');
792 conRegVar('sdl_mixer_buffersize', @gsSDLBufferSize
, '', '');
796 conRegVar('g_gibs_count', @gGibsCount
, '', '');
797 conRegVar('g_blood_count', @gBloodCount
, '', '');
798 conRegVar('g_adv_blood', @gAdvBlood
, '', '');
799 conRegVar('g_adv_corpses', @gAdvCorpses
, '', '');
800 conRegVar('g_adv_gibs', @gAdvGibs
, '', '');
801 conRegVar('r_flash', @gFlash
, '', '');
802 conRegVar('r_background', @gDrawBackGround
, '', '');
803 conRegVar('g_show_messages', @gShowMessages
, '', '');
804 conRegVar('r_revert_players', @gRevertPlayers
, '', '');
805 conRegVar('r_chat_bubble', @gChatBubble
, '', '');
806 conRegVar('sfs_debug', @wadoptDebug
, '', '');
807 conRegVar('sfs_fastmode', @wadoptFast
, '', '');
808 conRegVar('g_fast_screenshots', @e_FastScreenshots
, '', '');
809 conRegVar('g_default_megawad', @gDefaultMegawadStart
, '', '');
810 conRegVar('g_save_stats', @gSaveStats
, '', '');
811 conRegVar('g_screenshot_stats', @gScreenshotStats
, '', '');