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 gRC_Maximized
:= gWinMaximized
;
178 e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gScreenWidth
) + ' h = ' + IntToStr(gScreenHeight
));
179 g_Console_ResetBinds
;
182 procedure g_Options_SetDefaultVideo
;
185 gScreenHeight
:= 480;
187 gFullScreen
:= False;
188 gWinMaximized
:= False;
190 gTextureFilter
:= True;
191 glLegacyNPOT
:= False;
192 gRC_Width
:= gScreenWidth
;
193 gRC_Height
:= gScreenHeight
;
194 gRC_FullScreen
:= gFullScreen
;
195 gRC_Maximized
:= gWinMaximized
;
196 e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gScreenWidth
) + ' h = ' + IntToStr(gScreenHeight
));
197 g_Console_ResetBinds
;
201 procedure g_Options_SetDefault();
210 gMuteWhenInactive
:= False;
211 gAnnouncer
:= ANNOUNCE_MEPLUS
;
212 gSoundEffectsDF
:= True;
213 gUseChatSounds
:= True;
214 gsSDLSampleRate
:= 44100;
215 gsSDLBufferSize
:= 2048;
217 g_Sound_SetupAllVolumes(gSoundLevel
, gMusicLevel
);
219 with gPlayer1Settings
do
221 Name
:= GenPlayerName(1);
222 Model
:= STD_PLAYER_MODEL
;
223 Color
.R
:= PLAYER1_DEF_COLOR
.R
;
224 Color
.G
:= PLAYER1_DEF_COLOR
.G
;
225 Color
.B
:= PLAYER1_DEF_COLOR
.B
;
229 with gPlayer2Settings
do
231 Name
:= GenPlayerName(2);
232 Model
:= STD_PLAYER_MODEL
;
233 Color
.R
:= PLAYER2_DEF_COLOR
.R
;
234 Color
.G
:= PLAYER2_DEF_COLOR
.G
;
235 Color
.B
:= PLAYER2_DEF_COLOR
.B
;
239 (* section Joysticks *)
240 for i
:= 0 to e_MaxJoys
- 1 do
242 e_JoystickDeadzones
[i
] := 8192
247 g_Shells_SetMax(300);
249 g_Corpses_SetMax(20);
251 ITEM_RESPAWNTIME
:= 60 * 36;
257 gDrawBackGround
:= True;
258 gShowMessages
:= True;
259 gRevertPlayers
:= False;
261 wadoptDebug
:= False;
263 e_FastScreenshots
:= True;
264 gDefaultMegawadStart
:= DF_Default_Megawad_Start
;
265 gBerserkAutoswitch
:= True;
268 gAskLanguage
:= True;
269 gLanguage
:= LANGUAGE_ENGLISH
;
271 (* section GameplayCustom *)
273 gcGameMode
:= _lc
[I_MENU_GAME_TYPE_DM
];
278 gcTeamDamage
:= False;
280 gcWeaponStay
:= False;
282 gcBotsVS
:= 'Everybody';
284 (* section GameplayNetwork *)
286 gnGameMode
:= _lc
[I_MENU_GAME_TYPE_DM
];
291 gnTeamDamage
:= False;
293 gnWeaponStay
:= False;
295 gnBotsVS
:= 'Everybody';
297 (* section MasterServer *)
298 NetSlistIP
:= 'mpms.doom2d.org';
299 NetSlistPort
:= 25665;
300 g_Net_Slist_Set(NetSlistIP
, NetSlistPort
, NetSlistList
);
303 NetServerName
:= 'Unnamed Server';
307 NetAllowRCON
:= False;
308 NetRCONPassword
:= 'default';
309 NetUseMaster
:= True;
312 NetMasterRate
:= 60000;
313 NetForwardPorts
:= False;
317 NetForcePlayerUpdate
:= False;
318 NetPredictSelf
:= True;
319 NetClientIP
:= '127.0.0.1';
320 NetClientPort
:= NetPort
;
323 procedure g_Options_Read(FileName
: String);
328 procedure ReadInteger (VAR v
: Integer; param
: String; minv
: Integer = Low(Integer); maxv
: Integer = High(Integer));
330 v
:= Max(Min(config
.ReadInt(section
, param
, v
), maxv
), minv
)
333 procedure ReadInteger (VAR v
: LongWord; param
: String; minv
: LongWord = Low(LongWord); maxv
: LongWord = High(LongWord)); overload
;
335 v
:= Max(Min(config
.ReadInt(section
, param
, v
), maxv
), minv
)
338 procedure ReadInteger (VAR v
: Word; param
: String; minv
: Word = Low(Word); maxv
: Word = High(Word)); overload
;
340 v
:= Max(Min(config
.ReadInt(section
, param
, v
), maxv
), minv
)
343 procedure ReadInteger (VAR v
: Byte; param
: String; minv
: Byte = Low(Byte); maxv
: Byte = High(Byte)); overload
;
345 v
:= Max(Min(config
.ReadInt(section
, param
, v
), maxv
), minv
)
348 procedure ReadBoolean (VAR v
: Boolean; param
: String);
350 v
:= config
.ReadBool(section
, param
, v
)
353 procedure ReadString (VAR v
: String; param
: String);
355 v
:= config
.ReadStr(section
, param
, v
)
359 gAskLanguage
:= True;
360 e_WriteLog('Reading config', TMsgType
.Notify
);
361 g_Options_SetDefault
;
363 if FileExists(FileName
) = False then
365 e_WriteLog('Config file '+FileName
+' not found', TMsgType
.Warning
);
366 g_Options_SetDefaultVideo
;
370 config
:= TConfig
.CreateFile(FileName
);
372 section
:= 'Player1';
373 with gPlayer1Settings
do
375 ReadString(Name
, 'name');
376 ReadString(Model
, 'model');
377 ReadInteger(Color
.R
, 'red', 0, 255);
378 ReadInteger(Color
.G
, 'green', 0, 255);
379 ReadInteger(Color
.B
, 'blue', 0, 255);
380 ReadInteger(Team
, 'team');
381 if (Team
< TEAM_RED
) or (Team
> TEAM_BLUE
) then
385 section
:= 'Player2';
386 with gPlayer2Settings
do
388 ReadString(Name
, 'name');
389 ReadString(Model
, 'model');
390 ReadInteger(Color
.R
, 'red', 0, 255);
391 ReadInteger(Color
.G
, 'green', 0, 255);
392 ReadInteger(Color
.B
, 'blue', 0, 255);
393 ReadInteger(Team
, 'team');
394 if (Team
< TEAM_RED
) or (Team
> TEAM_BLUE
) then
398 section
:= 'GameplayCustom';
399 ReadString(gcMap
, 'Map');
400 ReadString(gcGameMode
, 'GameMode');
401 ReadInteger(gcTimeLimit
, 'TimeLimit', 0, 65535);
402 ReadInteger(gcGoalLimit
, 'GoalLimit', 0, 65535);
403 ReadInteger(gcMaxLives
, 'MaxLives', 0, 255);
404 ReadInteger(gcPlayers
, 'Players', 0, 2);
405 ReadBoolean(gcTeamDamage
, 'TeamDamage');
406 ReadBoolean(gcAllowExit
, 'AllowExit');
407 ReadBoolean(gcWeaponStay
, 'WeaponStay');
408 ReadBoolean(gcMonsters
, 'Monsters');
409 ReadString(gcBotsVS
, 'BotsVS');
411 with gGameSettings
do
413 GameMode
:= g_Game_TextToMode(gcGameMode
);
414 if GameMode
= GM_NONE
then
416 if GameMode
= GM_SINGLE
then
418 TimeLimit
:= gcTimeLimit
;
419 GoalLimit
:= gcGoalLimit
;
420 MaxLives
:= gcMaxLives
;
424 Options
:= Options
or GAME_OPTION_TEAMDAMAGE
;
426 Options
:= Options
or GAME_OPTION_ALLOWEXIT
;
428 Options
:= Options
or GAME_OPTION_WEAPONSTAY
;
430 Options
:= Options
or GAME_OPTION_MONSTERS
;
431 if gcBotsVS
= 'Everybody' then
432 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
or GAME_OPTION_BOTVSMONSTER
;
433 if gcBotsVS
= 'Players' then
434 Options
:= Options
or GAME_OPTION_BOTVSPLAYER
;
435 if gcBotsVS
= 'Monsters' then
436 Options
:= Options
or GAME_OPTION_BOTVSMONSTER
;
439 section
:= 'GameplayNetwork';
440 ReadString(gnMap
, 'Map');
441 ReadString(gnGameMode
, 'GameMode');
442 ReadInteger(gnTimeLimit
, 'TimeLimit', 0, 65535);
443 ReadInteger(gnGoalLimit
, 'GoalLimit', 0, 65535);
444 ReadInteger(gnMaxLives
, 'MaxLives', 0, 255);
445 ReadInteger(gnPlayers
, 'Players', 0, 2);
446 ReadBoolean(gnTeamDamage
, 'TeamDamage');
447 ReadBoolean(gnAllowExit
, 'AllowExit');
448 ReadBoolean(gnWeaponStay
, 'WeaponStay');
449 ReadBoolean(gnMonsters
, 'Monsters');
450 ReadString(gnBotsVS
, 'BotsVS');
452 section
:= 'MasterServer';
453 ReadString(NetSlistIP
, 'IP');
454 ReadInteger(NetSlistPort
, 'Port', 0, 65535);
455 ReadString(NetSlistList
, 'List');
456 g_Net_Slist_Set(NetSlistIP
, NetSlistPort
, NetSlistList
);
459 ReadString(NetServerName
, 'Name');
460 ReadString(NetPassword
, 'Password');
461 ReadInteger(NetPort
, 'Port', 0, 65535);
462 ReadInteger(NetMaxClients
, 'MaxClients', 0, NET_MAXCLIENTS
);
463 ReadBoolean(NetAllowRCON
, 'RCON');
464 ReadString(NetRCONPassword
, 'RCONPassword');
465 ReadBoolean(NetUseMaster
, 'SyncWithMaster');
466 ReadInteger(NetUpdateRate
, 'UpdateInterval', 0);
467 ReadInteger(NetRelupdRate
, 'ReliableUpdateInterval', 0);
468 ReadInteger(NetMasterRate
, 'MasterSyncInterval', 1);
469 ReadBoolean(NetForwardPorts
, 'ForwardPorts');
472 ReadInteger(NetInterpLevel
, 'InterpolationSteps', 0);
473 ReadBoolean(NetForcePlayerUpdate
, 'ForcePlayerUpdate');
474 ReadBoolean(NetPredictSelf
, 'PredictSelf');
475 ReadString(NetClientIP
, 'LastIP');
476 ReadInteger(NetClientPort
, 'LastPort', 0, 65535);
480 //if gTextureFilter then TEXTUREFILTER := GL_LINEAR else TEXTUREFILTER := GL_NEAREST;
483 procedure g_Options_Write(FileName
: String);
486 e_WriteLog('Writing config', TMsgType
.Notify
);
488 config
:= TConfig
.CreateFile(FileName
);
490 with config
, gPlayer1Settings
do
492 WriteStr('Player1', 'Name', Name
);
493 WriteStr('Player1', 'model', Model
);
494 WriteInt('Player1', 'red', Color
.R
);
495 WriteInt('Player1', 'green', Color
.G
);
496 WriteInt('Player1', 'blue', Color
.B
);
497 WriteInt('Player1', 'team', Team
);
500 with config
, gPlayer2Settings
do
502 WriteStr('Player2', 'Name', Name
);
503 WriteStr('Player2', 'model', Model
);
504 WriteInt('Player2', 'red', Color
.R
);
505 WriteInt('Player2', 'green', Color
.G
);
506 WriteInt('Player2', 'blue', Color
.B
);
507 WriteInt('Player2', 'team', Team
);
510 config
.WriteStr ('GameplayCustom', 'Map', gcMap
);
511 config
.WriteStr ('GameplayCustom', 'GameMode', gcGameMode
);
512 config
.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit
);
513 config
.WriteInt ('GameplayCustom', 'GoalLimit', gcGoalLimit
);
514 config
.WriteInt ('GameplayCustom', 'MaxLives', gcMaxLives
);
515 config
.WriteInt ('GameplayCustom', 'Players', gcPlayers
);
516 config
.WriteBool('GameplayCustom', 'TeamDamage', gcTeamDamage
);
517 config
.WriteBool('GameplayCustom', 'AllowExit', gcAllowExit
);
518 config
.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay
);
519 config
.WriteBool('GameplayCustom', 'Monsters', gcMonsters
);
520 config
.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS
);
522 config
.WriteStr ('GameplayNetwork', 'Map', gnMap
);
523 config
.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode
);
524 config
.WriteInt ('GameplayNetwork', 'TimeLimit', gnTimeLimit
);
525 config
.WriteInt ('GameplayNetwork', 'GoalLimit', gnGoalLimit
);
526 config
.WriteInt ('GameplayNetwork', 'MaxLives', gnMaxLives
);
527 config
.WriteInt ('GameplayNetwork', 'Players', gnPlayers
);
528 config
.WriteBool('GameplayNetwork', 'TeamDamage', gnTeamDamage
);
529 config
.WriteBool('GameplayNetwork', 'AllowExit', gnAllowExit
);
530 config
.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay
);
531 config
.WriteBool('GameplayNetwork', 'Monsters', gnMonsters
);
532 config
.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS
);
534 config
.WriteStr('MasterServer', 'IP', NetSlistIP
);
535 config
.WriteInt('MasterServer', 'Port', NetSlistPort
);
536 config
.WriteStr('MasterServer', 'List', NetSlistList
);
538 config
.WriteStr ('Server', 'Name', NetServerName
);
539 config
.WriteStr ('Server', 'Password', NetPassword
);
540 config
.WriteInt ('Server', 'Port', NetPort
);
541 config
.WriteInt ('Server', 'MaxClients', NetMaxClients
);
542 config
.WriteBool('Server', 'RCON', NetAllowRCON
);
543 config
.WriteStr ('Server', 'RCONPassword', NetRCONPassword
);
544 config
.WriteBool('Server', 'SyncWithMaster', NetUseMaster
);
545 config
.WriteBool('Server', 'ForwardPorts', NetForwardPorts
);
546 config
.WriteInt ('Server', 'UpdateInterval', NetUpdateRate
);
547 config
.WriteInt ('Server', 'ReliableUpdateInterval', NetRelupdRate
);
548 config
.WriteInt ('Server', 'MasterSyncInterval', NetMasterRate
);
550 config
.WriteInt ('Client', 'InterpolationSteps', NetInterpLevel
);
551 config
.WriteBool ('Client', 'ForcePlayerUpdate', NetForcePlayerUpdate
);
552 config
.WriteBool ('Client', 'PredictSelf', NetPredictSelf
);
553 config
.WriteStr ('Client', 'LastIP', NetClientIP
);
554 config
.WriteInt ('Client', 'LastPort', NetClientPort
);
556 config
.SaveFile(FileName
);
560 procedure g_Options_Write_Gameplay_Custom(FileName
: String);
564 e_WriteLog('Writing custom gameplay config', TMsgType
.Notify
);
566 config
:= TConfig
.CreateFile(FileName
);
568 config
.WriteStr ('GameplayCustom', 'Map', gcMap
);
569 config
.WriteStr ('GameplayCustom', 'GameMode', gcGameMode
);
570 config
.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit
);
571 config
.WriteInt ('GameplayCustom', 'GoalLimit', gcGoalLimit
);
572 config
.WriteInt ('GameplayCustom', 'MaxLives', gcMaxLives
);
573 config
.WriteInt ('GameplayCustom', 'Players', gcPlayers
);
574 config
.WriteBool('GameplayCustom', 'TeamDamage', gcTeamDamage
);
575 config
.WriteBool('GameplayCustom', 'AllowExit', gcAllowExit
);
576 config
.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay
);
577 config
.WriteBool('GameplayCustom', 'Monsters', gcMonsters
);
578 config
.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS
);
580 config
.SaveFile(FileName
);
584 procedure g_Options_Write_Gameplay_Net(FileName
: String);
588 e_WriteLog('Writing network gameplay config', TMsgType
.Notify
);
590 config
:= TConfig
.CreateFile(FileName
);
592 config
.WriteStr ('GameplayNetwork', 'Map', gnMap
);
593 config
.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode
);
594 config
.WriteInt ('GameplayNetwork', 'TimeLimit', gnTimeLimit
);
595 config
.WriteInt ('GameplayNetwork', 'GoalLimit', gnGoalLimit
);
596 config
.WriteInt ('GameplayNetwork', 'MaxLives', gnMaxLives
);
597 config
.WriteInt ('GameplayNetwork', 'Players', gnPlayers
);
598 config
.WriteBool('GameplayNetwork', 'TeamDamage', gnTeamDamage
);
599 config
.WriteBool('GameplayNetwork', 'AllowExit', gnAllowExit
);
600 config
.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay
);
601 config
.WriteBool('GameplayNetwork', 'Monsters', gnMonsters
);
602 config
.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS
);
604 config
.SaveFile(FileName
);
608 procedure g_Options_Write_Net_Server(FileName
: String);
612 e_WriteLog('Writing server config', TMsgType
.Notify
);
614 config
:= TConfig
.CreateFile(FileName
);
616 config
.WriteStr ('Server', 'Name', NetServerName
);
617 config
.WriteStr ('Server', 'Password', NetPassword
);
618 config
.WriteInt ('Server', 'Port', NetPort
);
619 config
.WriteInt ('Server', 'MaxClients', NetMaxClients
);
620 config
.WriteBool('Server', 'SyncWithMaster', NetUseMaster
);
621 config
.WriteBool('Server', 'ForwardPorts', NetForwardPorts
);
623 config
.SaveFile(FileName
);
627 procedure g_Options_Write_Net_Client(FileName
: String);
631 e_WriteLog('Writing client config', TMsgType
.Notify
);
633 config
:= TConfig
.CreateFile(FileName
);
635 config
.WriteStr('Client', 'LastIP', NetClientIP
);
636 config
.WriteInt('Client', 'LastPort', NetClientPort
);
638 config
.SaveFile(FileName
);
642 procedure g_Options_Commands (p
: SSArray
);
643 var cmd
: AnsiString; i
: Integer;
645 cmd
:= LowerCase(p
[0]);
649 sys_EnableVSync(gVSync
);
650 gRC_Width
:= Max(1, gRC_Width
);
651 gRC_Height
:= Max(1, gRC_Height
);
652 gBPP
:= Max(1, gBPP
);
653 if sys_SetDisplayMode(gRC_Width
, gRC_Height
, gBPP
, gRC_FullScreen
, gRC_Maximized
) = True then
654 e_LogWriteln('resolution changed')
656 e_LogWriteln('resolution not changed')
660 if Length(p
) = 2 then
662 gAskLanguage
:= true;
663 gLanguage
:= LANGUAGE_ENGLISH
;
664 case LowerCase(p
[1]) of
667 gAskLanguage
:= false;
668 gLanguage
:= LANGUAGE_ENGLISH
;
672 gAskLanguage
:= false;
673 gLanguage
:= LANGUAGE_RUSSIAN
;
677 gAskLanguage
:= true;
678 gLanguage
:= LANGUAGE_ENGLISH
;
681 g_Language_Set(gLanguage
)
685 e_LogWritefln('usage: %s <English|Russian|Ask>', [cmd
])
690 if Length(p
) = 2 then
692 i
:= Max(0, StrToInt(p
[1]));
695 else if Length(p
) = 1 then
697 e_LogWritefln('%s', [g_GFX_GetMax()])
701 e_LogWritefln('usage: %s <n>', [cmd
])
706 if Length(p
) = 2 then
708 i
:= Max(0, StrToInt(p
[1]));
711 else if Length(p
) = 1 then
713 e_LogWritefln('%s', [g_Shells_GetMax()])
717 e_LogWritefln('usage: %s <n>', [cmd
])
722 if Length(p
) = 2 then
724 i
:= Max(0, StrToInt(p
[1]));
727 else if Length(p
) = 1 then
729 e_LogWritefln('%s', [g_Gibs_GetMax()])
733 e_LogWritefln('usage: %s <n>', [cmd
])
738 if Length(p
) = 2 then
740 i
:= Max(0, StrToInt(p
[1]));
743 else if Length(p
) = 1 then
745 e_LogWritefln('%s', [g_Corpses_GetMax()])
749 e_LogWritefln('usage: %s <n>', [cmd
])
752 'g_item_respawn_time':
754 if Length(p
) = 2 then
755 ITEM_RESPAWNTIME
:= Max(0, StrToInt(p
[1])) * 36
756 else if Length(p
) = 1 then
757 e_LogWritefln('%s', [ITEM_RESPAWNTIME
div 36])
759 e_LogWritefln('usage: %s <n>', [cmd
])
766 machine
:= Random(10000);
769 conRegVar('r_width', @gRC_Width
, '', '');
770 conRegVar('r_height', @gRC_Height
, '', '');
771 conRegVar('r_fullscreen', @gRC_FullScreen
, '', '');
772 conRegVar('r_maximized', @gRC_Maximized
, '', '');
773 conRegVar('r_bpp', @gBPP
, '', '');
774 conRegVar('r_vsync', @gVSync
, '', '');
775 conRegVar('r_texfilter', @gTextureFilter
, '', '');
776 conRegVar('r_npot', @glNPOTOverride
, '', '');
779 conRegVar('s_nosound', @gNoSound
, '', '');
780 conRegVar('s_soundvolume', @gSoundLevel
, '', '');
781 conRegVar('s_musicvolume', @gMusicLevel
, '', '');
782 conRegVar('s_maxsim', @gMaxSimSounds
, '', ''); // e_sound_fmod/sdl?
783 conRegVar('s_muteinactive', @gMuteWhenInactive
, '', '');
784 conRegVar('s_announcer', @gAnnouncer
, '', '');
785 conRegVar('s_sfx', @gSoundEffectsDF
, '', '');
786 conRegVar('s_chatsounds', @gUseChatSounds
, '', '');
787 {$IFDEF USE_SDLMIXER}
788 conRegVar('sdl_mixer_samplerate', @gsSDLSampleRate
, '', '');
789 conRegVar('sdl_mixer_buffersize', @gsSDLBufferSize
, '', '');
793 conRegVar('g_gibs_count', @gGibsCount
, '', '');
794 conRegVar('g_blood_count', @gBloodCount
, '', '');
795 conRegVar('g_adv_blood', @gAdvBlood
, '', '');
796 conRegVar('g_adv_corpses', @gAdvCorpses
, '', '');
797 conRegVar('g_adv_gibs', @gAdvGibs
, '', '');
798 conRegVar('r_flash', @gFlash
, '', '');
799 conRegVar('r_background', @gDrawBackGround
, '', '');
800 conRegVar('g_show_messages', @gShowMessages
, '', '');
801 conRegVar('r_revert_players', @gRevertPlayers
, '', '');
802 conRegVar('r_chat_bubble', @gChatBubble
, '', '');
803 conRegVar('sfs_debug', @wadoptDebug
, '', '');
804 conRegVar('sfs_fastmode', @wadoptFast
, '', '');
805 conRegVar('g_fast_screenshots', @e_FastScreenshots
, '', '');
806 conRegVar('g_default_megawad', @gDefaultMegawadStart
, '', '');