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 e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gScreenWidth
) + ' h = ' + IntToStr(gScreenHeight
));
175 g_Console_ResetBinds
;
178 procedure g_Options_SetDefaultVideo
;
181 gScreenHeight
:= 480;
183 gFullScreen
:= False;
184 gWinMaximized
:= False;
186 gTextureFilter
:= True;
187 glLegacyNPOT
:= False;
188 e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gScreenWidth
) + ' h = ' + IntToStr(gScreenHeight
));
189 g_Console_ResetBinds
;
193 procedure g_Options_SetDefault();
202 gMuteWhenInactive
:= False;
203 gAnnouncer
:= ANNOUNCE_MEPLUS
;
204 gSoundEffectsDF
:= True;
205 gUseChatSounds
:= True;
206 gsSDLSampleRate
:= 44100;
207 gsSDLBufferSize
:= 2048;
209 g_Sound_SetupAllVolumes(gSoundLevel
, gMusicLevel
);
211 with gPlayer1Settings
do
213 Name
:= GenPlayerName(1);
214 Model
:= STD_PLAYER_MODEL
;
215 Color
.R
:= PLAYER1_DEF_COLOR
.R
;
216 Color
.G
:= PLAYER1_DEF_COLOR
.G
;
217 Color
.B
:= PLAYER1_DEF_COLOR
.B
;
221 with gPlayer2Settings
do
223 Name
:= GenPlayerName(2);
224 Model
:= STD_PLAYER_MODEL
;
225 Color
.R
:= PLAYER2_DEF_COLOR
.R
;
226 Color
.G
:= PLAYER2_DEF_COLOR
.G
;
227 Color
.B
:= PLAYER2_DEF_COLOR
.B
;
231 (* section Joysticks *)
232 for i
:= 0 to e_MaxJoys
- 1 do
234 e_JoystickDeadzones
[i
] := 8192
239 g_Shells_SetMax(300);
241 g_Corpses_SetMax(20);
243 ITEM_RESPAWNTIME
:= 60 * 36;
249 gDrawBackGround
:= True;
250 gShowMessages
:= True;
251 gRevertPlayers
:= False;
253 wadoptDebug
:= False;
255 e_FastScreenshots
:= True;
256 gDefaultMegawadStart
:= DF_Default_Megawad_Start
;
257 gBerserkAutoswitch
:= True;
260 gAskLanguage
:= True;
261 gLanguage
:= LANGUAGE_ENGLISH
;
263 (* section GameplayCustom *)
265 gcGameMode
:= _lc
[I_MENU_GAME_TYPE_DM
];
270 gcTeamDamage
:= False;
272 gcWeaponStay
:= False;
274 gcBotsVS
:= 'Everybody';
276 (* section GameplayNetwork *)
278 gnGameMode
:= _lc
[I_MENU_GAME_TYPE_DM
];
283 gnTeamDamage
:= False;
285 gnWeaponStay
:= False;
287 gnBotsVS
:= 'Everybody';
289 (* section MasterServer *)
290 NetSlistIP
:= 'mpms.doom2d.org';
291 NetSlistPort
:= 25665;
292 g_Net_Slist_Set(NetSlistIP
, NetSlistPort
, NetSlistList
);
295 NetServerName
:= 'Unnamed Server';
299 NetAllowRCON
:= False;
300 NetRCONPassword
:= 'default';
301 NetUseMaster
:= True;
304 NetMasterRate
:= 60000;
305 NetForwardPorts
:= False;
309 NetForcePlayerUpdate
:= False;
310 NetPredictSelf
:= True;
311 NetClientIP
:= '127.0.0.1';
312 NetClientPort
:= NetPort
;
315 procedure g_Options_Read(FileName
: String);
320 procedure ReadInteger (VAR v
: Integer; param
: String; minv
: Integer = Low(Integer); maxv
: Integer = High(Integer));
322 v
:= Max(Min(config
.ReadInt(section
, param
, v
), maxv
), minv
)
325 procedure ReadInteger (VAR v
: LongWord
; param
: String; minv
: LongWord
= Low(LongWord
); maxv
: LongWord
= High(LongWord
)); overload
;
327 v
:= Max(Min(config
.ReadInt(section
, param
, v
), maxv
), minv
)
330 procedure ReadInteger (VAR v
: Word; param
: String; minv
: Word = Low(Word); maxv
: Word = High(Word)); overload
;
332 v
:= Max(Min(config
.ReadInt(section
, param
, v
), maxv
), minv
)
335 procedure ReadInteger (VAR v
: Byte; param
: String; minv
: Byte = Low(Byte); maxv
: Byte = High(Byte)); overload
;
337 v
:= Max(Min(config
.ReadInt(section
, param
, v
), maxv
), minv
)
340 procedure ReadBoolean (VAR v
: Boolean; param
: String);
342 v
:= config
.ReadBool(section
, param
, v
)
345 procedure ReadString (VAR v
: String; param
: String);
347 v
:= config
.ReadStr(section
, param
, v
)
351 gAskLanguage
:= True;
352 e_WriteLog('Reading config', TMsgType
.Notify
);
353 g_Options_SetDefault
;
355 if FileExists(FileName
) = False then
357 e_WriteLog('Config file '+FileName
+' not found', TMsgType
.Warning
);
358 g_Options_SetDefaultVideo
;
362 config
:= TConfig
.CreateFile(FileName
);
364 section
:= 'Player1';
365 with gPlayer1Settings
do
367 ReadString(Name
, 'name');
368 ReadString(Model
, 'model');
369 ReadInteger(Color
.R
, 'red', 0, 255);
370 ReadInteger(Color
.G
, 'green', 0, 255);
371 ReadInteger(Color
.B
, 'blue', 0, 255);
372 ReadInteger(Team
, 'team');
373 if (Team
< TEAM_RED
) or (Team
> TEAM_BLUE
) then
377 section
:= 'Player2';
378 with gPlayer2Settings
do
380 ReadString(Name
, 'name');
381 ReadString(Model
, 'model');
382 ReadInteger(Color
.R
, 'red', 0, 255);
383 ReadInteger(Color
.G
, 'green', 0, 255);
384 ReadInteger(Color
.B
, 'blue', 0, 255);
385 ReadInteger(Team
, 'team');
386 if (Team
< TEAM_RED
) or (Team
> TEAM_BLUE
) then
390 section
:= 'GameplayCustom';
391 ReadString(gcMap
, 'Map');
392 ReadString(gcGameMode
, 'GameMode');
393 ReadInteger(gcTimeLimit
, 'TimeLimit', 0, 65535);
394 ReadInteger(gcGoalLimit
, 'GoalLimit', 0, 65535);
395 ReadInteger(gcMaxLives
, 'MaxLives', 0, 255);
396 ReadInteger(gcPlayers
, 'Players', 0, 2);
397 ReadBoolean(gcTeamDamage
, 'TeamDamage');
398 ReadBoolean(gcAllowExit
, 'AllowExit');
399 ReadBoolean(gcWeaponStay
, 'WeaponStay');
400 ReadBoolean(gcMonsters
, 'Monsters');
401 ReadString(gcBotsVS
, 'BotsVS');
403 with gGameSettings
do
405 GameMode
:= g_Game_TextToMode(gcGameMode
);
406 if GameMode
= GM_NONE
then
408 if GameMode
= GM_SINGLE
then
410 TimeLimit
:= gcTimeLimit
;
411 GoalLimit
:= gcGoalLimit
;
412 MaxLives
:= gcMaxLives
;
416 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
418 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
420 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
422 Options
:= Options
or GAME_OPTION_MONSTERS
;
423 if gcBotsVS
= 'Everybody' then
424 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
425 if gcBotsVS
= 'Players' then
426 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
427 if gcBotsVS
= 'Monsters' then
428 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
431 section
:= 'GameplayNetwork';
432 ReadString(gnMap
, 'Map');
433 ReadString(gnGameMode
, 'GameMode');
434 ReadInteger(gnTimeLimit
, 'TimeLimit', 0, 65535);
435 ReadInteger(gnGoalLimit
, 'GoalLimit', 0, 65535);
436 ReadInteger(gnMaxLives
, 'MaxLives', 0, 255);
437 ReadInteger(gnPlayers
, 'Players', 0, 2);
438 ReadBoolean(gnTeamDamage
, 'TeamDamage');
439 ReadBoolean(gnAllowExit
, 'AllowExit');
440 ReadBoolean(gnWeaponStay
, 'WeaponStay');
441 ReadBoolean(gnMonsters
, 'Monsters');
442 ReadString(gnBotsVS
, 'BotsVS');
444 section
:= 'MasterServer';
445 ReadString(NetSlistIP
, 'IP');
446 ReadInteger(NetSlistPort
, 'Port', 0, 65535);
447 ReadString(NetSlistList
, 'List');
448 g_Net_Slist_Set(NetSlistIP
, NetSlistPort
, NetSlistList
);
451 ReadString(NetServerName
, 'Name');
452 ReadString(NetPassword
, 'Password');
453 ReadInteger(NetPort
, 'Port', 0, 65535);
454 ReadInteger(NetMaxClients
, 'MaxClients', 0, NET_MAXCLIENTS
);
455 ReadBoolean(NetAllowRCON
, 'RCON');
456 ReadString(NetRCONPassword
, 'RCONPassword');
457 ReadBoolean(NetUseMaster
, 'SyncWithMaster');
458 ReadInteger(NetUpdateRate
, 'UpdateInterval', 0);
459 ReadInteger(NetRelupdRate
, 'ReliableUpdateInterval', 0);
460 ReadInteger(NetMasterRate
, 'MasterSyncInterval', 1);
461 ReadBoolean(NetForwardPorts
, 'ForwardPorts');
464 ReadInteger(NetInterpLevel
, 'InterpolationSteps', 0);
465 ReadBoolean(NetForcePlayerUpdate
, 'ForcePlayerUpdate');
466 ReadBoolean(NetPredictSelf
, 'PredictSelf');
467 ReadString(NetClientIP
, 'LastIP');
468 ReadInteger(NetClientPort
, 'LastPort', 0, 65535);
472 //if gTextureFilter then TEXTUREFILTER := GL_LINEAR else TEXTUREFILTER := GL_NEAREST;
475 procedure g_Options_Write(FileName
: String);
478 e_WriteLog('Writing config', TMsgType
.Notify
);
480 config
:= TConfig
.CreateFile(FileName
);
482 with config
, gPlayer1Settings
do
484 WriteStr('Player1', 'Name', Name
);
485 WriteStr('Player1', 'model', Model
);
486 WriteInt('Player1', 'red', Color
.R
);
487 WriteInt('Player1', 'green', Color
.G
);
488 WriteInt('Player1', 'blue', Color
.B
);
489 WriteInt('Player1', 'team', Team
);
492 with config
, gPlayer2Settings
do
494 WriteStr('Player2', 'Name', Name
);
495 WriteStr('Player2', 'model', Model
);
496 WriteInt('Player2', 'red', Color
.R
);
497 WriteInt('Player2', 'green', Color
.G
);
498 WriteInt('Player2', 'blue', Color
.B
);
499 WriteInt('Player2', 'team', Team
);
502 config
.WriteStr ('GameplayCustom', 'Map', gcMap
);
503 config
.WriteStr ('GameplayCustom', 'GameMode', gcGameMode
);
504 config
.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit
);
505 config
.WriteInt ('GameplayCustom', 'GoalLimit', gcGoalLimit
);
506 config
.WriteInt ('GameplayCustom', 'MaxLives', gcMaxLives
);
507 config
.WriteInt ('GameplayCustom', 'Players', gcPlayers
);
508 config
.WriteBool('GameplayCustom', 'TeamDamage', gcTeamDamage
);
509 config
.WriteBool('GameplayCustom', 'AllowExit', gcAllowExit
);
510 config
.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay
);
511 config
.WriteBool('GameplayCustom', 'Monsters', gcMonsters
);
512 config
.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS
);
514 config
.WriteStr ('GameplayNetwork', 'Map', gnMap
);
515 config
.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode
);
516 config
.WriteInt ('GameplayNetwork', 'TimeLimit', gnTimeLimit
);
517 config
.WriteInt ('GameplayNetwork', 'GoalLimit', gnGoalLimit
);
518 config
.WriteInt ('GameplayNetwork', 'MaxLives', gnMaxLives
);
519 config
.WriteInt ('GameplayNetwork', 'Players', gnPlayers
);
520 config
.WriteBool('GameplayNetwork', 'TeamDamage', gnTeamDamage
);
521 config
.WriteBool('GameplayNetwork', 'AllowExit', gnAllowExit
);
522 config
.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay
);
523 config
.WriteBool('GameplayNetwork', 'Monsters', gnMonsters
);
524 config
.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS
);
526 config
.WriteStr('MasterServer', 'IP', NetSlistIP
);
527 config
.WriteInt('MasterServer', 'Port', NetSlistPort
);
528 config
.WriteStr('MasterServer', 'List', NetSlistList
);
530 config
.WriteStr ('Server', 'Name', NetServerName
);
531 config
.WriteStr ('Server', 'Password', NetPassword
);
532 config
.WriteInt ('Server', 'Port', NetPort
);
533 config
.WriteInt ('Server', 'MaxClients', NetMaxClients
);
534 config
.WriteBool('Server', 'RCON', NetAllowRCON
);
535 config
.WriteStr ('Server', 'RCONPassword', NetRCONPassword
);
536 config
.WriteBool('Server', 'SyncWithMaster', NetUseMaster
);
537 config
.WriteBool('Server', 'ForwardPorts', NetForwardPorts
);
538 config
.WriteInt ('Server', 'UpdateInterval', NetUpdateRate
);
539 config
.WriteInt ('Server', 'ReliableUpdateInterval', NetRelupdRate
);
540 config
.WriteInt ('Server', 'MasterSyncInterval', NetMasterRate
);
542 config
.WriteInt ('Client', 'InterpolationSteps', NetInterpLevel
);
543 config
.WriteBool ('Client', 'ForcePlayerUpdate', NetForcePlayerUpdate
);
544 config
.WriteBool ('Client', 'PredictSelf', NetPredictSelf
);
545 config
.WriteStr ('Client', 'LastIP', NetClientIP
);
546 config
.WriteInt ('Client', 'LastPort', NetClientPort
);
548 config
.SaveFile(FileName
);
552 procedure g_Options_Write_Gameplay_Custom(FileName
: String);
556 e_WriteLog('Writing custom gameplay config', TMsgType
.Notify
);
558 config
:= TConfig
.CreateFile(FileName
);
560 config
.WriteStr ('GameplayCustom', 'Map', gcMap
);
561 config
.WriteStr ('GameplayCustom', 'GameMode', gcGameMode
);
562 config
.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit
);
563 config
.WriteInt ('GameplayCustom', 'GoalLimit', gcGoalLimit
);
564 config
.WriteInt ('GameplayCustom', 'MaxLives', gcMaxLives
);
565 config
.WriteInt ('GameplayCustom', 'Players', gcPlayers
);
566 config
.WriteBool('GameplayCustom', 'TeamDamage', gcTeamDamage
);
567 config
.WriteBool('GameplayCustom', 'AllowExit', gcAllowExit
);
568 config
.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay
);
569 config
.WriteBool('GameplayCustom', 'Monsters', gcMonsters
);
570 config
.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS
);
572 config
.SaveFile(FileName
);
576 procedure g_Options_Write_Gameplay_Net(FileName
: String);
580 e_WriteLog('Writing network gameplay config', TMsgType
.Notify
);
582 config
:= TConfig
.CreateFile(FileName
);
584 config
.WriteStr ('GameplayNetwork', 'Map', gnMap
);
585 config
.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode
);
586 config
.WriteInt ('GameplayNetwork', 'TimeLimit', gnTimeLimit
);
587 config
.WriteInt ('GameplayNetwork', 'GoalLimit', gnGoalLimit
);
588 config
.WriteInt ('GameplayNetwork', 'MaxLives', gnMaxLives
);
589 config
.WriteInt ('GameplayNetwork', 'Players', gnPlayers
);
590 config
.WriteBool('GameplayNetwork', 'TeamDamage', gnTeamDamage
);
591 config
.WriteBool('GameplayNetwork', 'AllowExit', gnAllowExit
);
592 config
.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay
);
593 config
.WriteBool('GameplayNetwork', 'Monsters', gnMonsters
);
594 config
.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS
);
596 config
.SaveFile(FileName
);
600 procedure g_Options_Write_Net_Server(FileName
: String);
604 e_WriteLog('Writing server config', TMsgType
.Notify
);
606 config
:= TConfig
.CreateFile(FileName
);
608 config
.WriteStr ('Server', 'Name', NetServerName
);
609 config
.WriteStr ('Server', 'Password', NetPassword
);
610 config
.WriteInt ('Server', 'Port', NetPort
);
611 config
.WriteInt ('Server', 'MaxClients', NetMaxClients
);
612 config
.WriteBool('Server', 'SyncWithMaster', NetUseMaster
);
613 config
.WriteBool('Server', 'ForwardPorts', NetForwardPorts
);
615 config
.SaveFile(FileName
);
619 procedure g_Options_Write_Net_Client(FileName
: String);
623 e_WriteLog('Writing client config', TMsgType
.Notify
);
625 config
:= TConfig
.CreateFile(FileName
);
627 config
.WriteStr('Client', 'LastIP', NetClientIP
);
628 config
.WriteInt('Client', 'LastPort', NetClientPort
);
630 config
.SaveFile(FileName
);
634 procedure g_Options_Commands (p
: SSArray
);
635 var cmd
: AnsiString
; i
: Integer;
637 cmd
:= LowerCase(p
[0]);
641 sys_EnableVSync(gVSync
);
642 gRC_Width
:= Max(1, gRC_Width
);
643 gRC_Height
:= Max(1, gRC_Height
);
644 gBPP
:= Max(1, gBPP
);
645 if sys_SetDisplayMode(gRC_Width
, gRC_Height
, gBPP
, gRC_FullScreen
) = True then
646 e_LogWriteln('resolution changed')
648 e_LogWriteln('resolution not changed')
652 if Length(p
) = 2 then
654 gAskLanguage
:= true;
655 gLanguage
:= LANGUAGE_ENGLISH
;
656 case LowerCase(p
[1]) of
659 gAskLanguage
:= false;
660 gLanguage
:= LANGUAGE_ENGLISH
;
664 gAskLanguage
:= false;
665 gLanguage
:= LANGUAGE_RUSSIAN
;
669 gAskLanguage
:= true;
670 gLanguage
:= LANGUAGE_ENGLISH
;
673 g_Language_Set(gLanguage
)
677 e_LogWritefln('usage: %s <English|Russian|Ask>', [cmd
])
682 if Length(p
) = 2 then
684 i
:= Max(0, StrToInt(p
[1]));
687 else if Length(p
) = 1 then
689 e_LogWritefln('%s', [g_GFX_GetMax()])
693 e_LogWritefln('usage: %s <n>', [cmd
])
698 if Length(p
) = 2 then
700 i
:= Max(0, StrToInt(p
[1]));
703 else if Length(p
) = 1 then
705 e_LogWritefln('%s', [g_Shells_GetMax()])
709 e_LogWritefln('usage: %s <n>', [cmd
])
714 if Length(p
) = 2 then
716 i
:= Max(0, StrToInt(p
[1]));
719 else if Length(p
) = 1 then
721 e_LogWritefln('%s', [g_Gibs_GetMax()])
725 e_LogWritefln('usage: %s <n>', [cmd
])
730 if Length(p
) = 2 then
732 i
:= Max(0, StrToInt(p
[1]));
735 else if Length(p
) = 1 then
737 e_LogWritefln('%s', [g_Corpses_GetMax()])
741 e_LogWritefln('usage: %s <n>', [cmd
])
744 'g_item_respawn_time':
746 if Length(p
) = 2 then
747 ITEM_RESPAWNTIME
:= Max(0, StrToInt(p
[1])) * 36
748 else if Length(p
) = 1 then
749 e_LogWritefln('%s', [ITEM_RESPAWNTIME
div 36])
751 e_LogWritefln('usage: %s <n>', [cmd
])
758 machine
:= Random(10000);
761 conRegVar('r_width', @gRC_Width
, '', '');
762 conRegVar('r_height', @gRC_Height
, '', '');
763 conRegVar('r_fullscreen', @gRC_FullScreen
, '', '');
764 conRegVar('r_maximized', @gRC_Maximized
, '', '');
765 conRegVar('r_bpp', @gBPP
, '', '');
766 conRegVar('r_vsync', @gVSync
, '', '');
767 conRegVar('r_texfilter', @gTextureFilter
, '', '');
768 conRegVar('r_npot', @glNPOTOverride
, '', '');
771 conRegVar('s_nosound', @gNoSound
, '', '');
772 conRegVar('s_soundvolume', @gSoundLevel
, '', '');
773 conRegVar('s_musicvolume', @gMusicLevel
, '', '');
774 conRegVar('s_maxsim', @gMaxSimSounds
, '', ''); // e_sound_fmod/sdl?
775 conRegVar('s_muteinactive', @gMuteWhenInactive
, '', '');
776 conRegVar('s_announcer', @gAnnouncer
, '', '');
777 conRegVar('s_sfx', @gSoundEffectsDF
, '', '');
778 conRegVar('s_chatsounds', @gUseChatSounds
, '', '');
779 {$IFDEF USE_SDLMIXER}
780 conRegVar('sdl_mixer_samplerate', @gsSDLSampleRate
, '', '');
781 conRegVar('sdl_mixer_buffersize', @gsSDLBufferSize
, '', '');
785 conRegVar('g_gibs_count', @gGibsCount
, '', '');
786 conRegVar('g_blood_count', @gBloodCount
, '', '');
787 conRegVar('g_adv_blood', @gAdvBlood
, '', '');
788 conRegVar('g_adv_corpses', @gAdvCorpses
, '', '');
789 conRegVar('g_adv_gibs', @gAdvGibs
, '', '');
790 conRegVar('r_flash', @gFlash
, '', '');
791 conRegVar('r_background', @gDrawBackGround
, '', '');
792 conRegVar('g_show_messages', @gShowMessages
, '', '');
793 conRegVar('r_revert_players', @gRevertPlayers
, '', '');
794 conRegVar('r_chat_bubble', @gChatBubble
, '', '');
795 conRegVar('sfs_debug', @wadoptDebug
, '', '');
796 conRegVar('sfs_fastmode', @wadoptFast
, '', '');
797 conRegVar('g_fast_screenshots', @e_FastScreenshots
, '', '');
798 conRegVar('g_default_megawad', @gDefaultMegawadStart
, '', '');