diff --git a/src/game/g_options.pas b/src/game/g_options.pas
index 7aea70fc0a5f9add839ce28ab3bfe334a975fc9f..e89521ddaab4800819bc475058c861fc2bf01c02 100644 (file)
--- a/src/game/g_options.pas
+++ b/src/game/g_options.pas
interface
uses
interface
uses
- g_language, g_weapons;
+ g_language, g_weapons, utils;
function GenPlayerName (n: Integer): String;
function GenPlayerName (n: Integer): String;
procedure g_Options_SetDefaultVideo;
procedure g_Options_Read(FileName: String);
procedure g_Options_Write(FileName: String);
procedure g_Options_SetDefaultVideo;
procedure g_Options_Read(FileName: String);
procedure g_Options_Write(FileName: String);
-procedure g_Options_Write_Language(FileName: String);
-procedure g_Options_Write_Video(FileName: String);
procedure g_Options_Write_Gameplay_Custom(FileName: String);
procedure g_Options_Write_Gameplay_Net(FileName: String);
procedure g_Options_Write_Net_Server(FileName: String);
procedure g_Options_Write_Net_Client(FileName: String);
procedure g_Options_Write_Gameplay_Custom(FileName: String);
procedure g_Options_Write_Gameplay_Net(FileName: String);
procedure g_Options_Write_Net_Server(FileName: String);
procedure g_Options_Write_Net_Client(FileName: String);
+procedure g_Options_Commands (p: SSArray);
const DF_Default_Megawad_Start = 'megawads/DOOM2D.WAD:\MAP01';
var
const DF_Default_Megawad_Start = 'megawads/DOOM2D.WAD:\MAP01';
var
-// gGameControls: TControls;
- gScreenWidth: Word;
- gScreenHeight: Word;
- gWinRealPosX: Integer;
- gWinRealPosY: Integer;
- gBPP: Byte;
+ gBPP: Integer;
gFreq: Byte;
gFullscreen: Boolean;
gFreq: Byte;
gFullscreen: Boolean;
+ gWinSizeX, gWinSizeY: Integer;
gWinMaximized: Boolean;
gVSync: Boolean;
glLegacyNPOT: Boolean;
gWinMaximized: Boolean;
gVSync: Boolean;
glLegacyNPOT: Boolean;
+ glRenderToFBO: Boolean = True;
gTextureFilter: Boolean;
gNoSound: Boolean;
gTextureFilter: Boolean;
gNoSound: Boolean;
- gSoundLevel: Byte;
- gMusicLevel: Byte;
- gMaxSimSounds: Byte;
+ gSoundLevel: Integer;
+ gMusicLevel: Integer;
+ gMaxSimSounds: Integer;
gMuteWhenInactive: Boolean;
gAdvCorpses: Boolean;
gAdvBlood: Boolean;
gAdvGibs: Boolean;
gGibsCount: Integer;
gMuteWhenInactive: Boolean;
gAdvCorpses: Boolean;
gAdvBlood: Boolean;
gAdvGibs: Boolean;
gGibsCount: Integer;
- gBloodCount: Byte;
- gFlash: Byte;
+ gBloodCount: Integer;
+ gFlash: Integer;
gDrawBackGround: Boolean;
gShowMessages: Boolean;
gRevertPlayers: Boolean;
gLanguage: String;
gAskLanguage: Boolean;
gDrawBackGround: Boolean;
gShowMessages: Boolean;
gRevertPlayers: Boolean;
gLanguage: String;
gAskLanguage: Boolean;
+ gSaveStats: Boolean = False;
+ gScreenshotStats: Boolean = False;
gcMap: String;
gcGameMode: String;
gcTimeLimit: Word;
gcMap: String;
gcGameMode: String;
gcTimeLimit: Word;
gcWeaponStay: Boolean;
gcMonsters: Boolean;
gcBotsVS: String;
gcWeaponStay: Boolean;
gcMonsters: Boolean;
gcBotsVS: String;
+ gcDeathmatchKeys: Boolean = True;
+ gcRespawnItems: Boolean = True;
+ gcSpawnInvul: Integer = 0;
gnMap: String;
gnGameMode: String;
gnTimeLimit: Word;
gnMap: String;
gnGameMode: String;
gnTimeLimit: Word;
gnWeaponStay: Boolean;
gnMonsters: Boolean;
gnBotsVS: String;
gnWeaponStay: Boolean;
gnMonsters: Boolean;
gnBotsVS: String;
+ gnDeathmatchKeys: Boolean = True;
+ gnRespawnItems: Boolean = True;
+ gnSpawnInvul: Integer = 0;
gsSDLSampleRate: Integer;
gsSDLBufferSize: Integer;
gsSDLSampleRate: Integer;
gsSDLBufferSize: Integer;
- gSFSDebug: Boolean;
- gSFSFastMode: Boolean;
gDefaultMegawadStart: AnsiString;
gBerserkAutoswitch: Boolean;
glNPOTOverride: Boolean = false;
gDefaultMegawadStart: AnsiString;
gBerserkAutoswitch: Boolean;
glNPOTOverride: Boolean = false;
{$ENDIF}
e_log, e_input, g_console, g_window, g_sound, g_gfx, g_player, Math,
g_map, g_net, g_netmaster, SysUtils, CONFIG, g_game, g_main, e_texture,
{$ENDIF}
e_log, e_input, g_console, g_window, g_sound, g_gfx, g_player, Math,
g_map, g_net, g_netmaster, SysUtils, CONFIG, g_game, g_main, e_texture,
- g_items, wadreader, e_graphics, g_touch, envvars;
+ g_items, wadreader, e_graphics, g_touch, envvars, g_system;
var
machine: Integer;
var
machine: Integer;
(* Display 0 = Primary display *)
gScreenWidth := 640;
gScreenHeight := 480;
(* Display 0 = Primary display *)
gScreenWidth := 640;
gScreenHeight := 480;
+ gWinSizeX := 640;
+ gWinSizeY := 480;
//gBPP := SDL_BITSPERPIXEL(dispaly.format);
gBPP := 32;
{$IFDEF ANDROID}
//gBPP := SDL_BITSPERPIXEL(dispaly.format);
gBPP := 32;
{$IFDEF ANDROID}
if SDL_GetDesktopDisplayMode(0, @display) = 0 then
begin
{$IFDEF ANDROID}
if SDL_GetDesktopDisplayMode(0, @display) = 0 then
begin
{$IFDEF ANDROID}
- gScreenWidth := display.w;
- gScreenHeight := display.h;
+ gWinSizeX := display.w;
+ gWinSizeY := display.h;
{$ELSE}
(* Window must be smaller than display *)
closest.w := display.w;
{$ELSE}
(* Window must be smaller than display *)
closest.w := display.w;
SDL_GetClosestDisplayMode(0, @target, @closest);
Dec(percentage);
end;
SDL_GetClosestDisplayMode(0, @target, @closest);
Dec(percentage);
end;
- gScreenWidth := closest.w;
- gScreenHeight := closest.h;
+ gWinSizeX := closest.w;
+ gWinSizeY := closest.h;
//gBPP := SDL_BITSPERPIXEL(closest.format); (* Resolution list didn't work for some reason *)
{$ENDIF}
end
//gBPP := SDL_BITSPERPIXEL(closest.format); (* Resolution list didn't work for some reason *)
{$ENDIF}
end
e_LogWritefln('SDL: Failed to get desktop display mode: %s', [SDL_GetError])
end;
(* Must be positioned on primary display *)
e_LogWritefln('SDL: Failed to get desktop display mode: %s', [SDL_GetError])
end;
(* Must be positioned on primary display *)
- gWinRealPosX := SDL_WINDOWPOS_CENTERED;
- gWinRealPosY := SDL_WINDOWPOS_CENTERED;
gWinMaximized := False;
gVSync := True;
gTextureFilter := True;
glLegacyNPOT := False;
gWinMaximized := False;
gVSync := True;
gTextureFilter := True;
glLegacyNPOT := False;
- e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gScreenWidth) + ' h = ' + IntToStr(gScreenHeight));
+ gRC_Width := gWinSizeX;
+ gRC_Height := gWinSizeY;
+ gRC_FullScreen := gFullScreen;
+ gRC_Maximized := gWinMaximized;
+ e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gWinSizeX) + ' h = ' + IntToStr(gWinSizeY));
g_Console_ResetBinds;
end;
{$ELSE}
procedure g_Options_SetDefaultVideo;
begin
g_Console_ResetBinds;
end;
{$ELSE}
procedure g_Options_SetDefaultVideo;
begin
- gScreenWidth := 640;
- gScreenHeight := 480;
+ gWinSizeX := 640;
+ gWinSizeY := 480;
gBPP := 32;
gFullScreen := False;
gBPP := 32;
gFullScreen := False;
- gWinRealPosX := 0;
- gWinRealPosY := 0;
gWinMaximized := False;
gVSync := True;
gTextureFilter := True;
glLegacyNPOT := False;
gWinMaximized := False;
gVSync := True;
gTextureFilter := True;
glLegacyNPOT := False;
- e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gScreenWidth) + ' h = ' + IntToStr(gScreenHeight));
+ gScreenWidth := gWinSizeX;
+ gScreenHeight := gWinSizeY;
+ gRC_Width := gWinSizeX;
+ gRC_Height := gWinSizeY;
+ gRC_FullScreen := gFullScreen;
+ gRC_Maximized := gWinMaximized;
+ e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gWinSizeX) + ' h = ' + IntToStr(gWinSizeY));
g_Console_ResetBinds;
end;
{$ENDIF}
g_Console_ResetBinds;
end;
{$ENDIF}
gShowMessages := True;
gRevertPlayers := False;
gChatBubble := 4;
gShowMessages := True;
gRevertPlayers := False;
gChatBubble := 4;
- gSFSDebug := False;
- gSFSFastMode := False;
+ wadoptDebug := False;
+ wadoptFast := False;
e_FastScreenshots := True;
gDefaultMegawadStart := DF_Default_Megawad_Start;
gBerserkAutoswitch := True;
g_dbg_scale := 1.0;
e_FastScreenshots := True;
gDefaultMegawadStart := DF_Default_Megawad_Start;
gBerserkAutoswitch := True;
g_dbg_scale := 1.0;
+ gSaveStats := False;
gAskLanguage := True;
gLanguage := LANGUAGE_ENGLISH;
gAskLanguage := True;
gLanguage := LANGUAGE_ENGLISH;
gcWeaponStay := False;
gcMonsters := False;
gcBotsVS := 'Everybody';
gcWeaponStay := False;
gcMonsters := False;
gcBotsVS := 'Everybody';
+ gcDeathmatchKeys := True;
+ gcRespawnItems := True;
+ gcSpawnInvul := 0;
(* section GameplayNetwork *)
gnMap := '';
(* section GameplayNetwork *)
gnMap := '';
gnWeaponStay := False;
gnMonsters := False;
gnBotsVS := 'Everybody';
gnWeaponStay := False;
gnMonsters := False;
gnBotsVS := 'Everybody';
+ gnDeathmatchKeys := True;
+ gnRespawnItems := True;
+ gnSpawnInvul := 0;
(* section MasterServer *)
NetSlistIP := 'mpms.doom2d.org';
(* section MasterServer *)
NetSlistIP := 'mpms.doom2d.org';
procedure g_Options_Read(FileName: String);
var
procedure g_Options_Read(FileName: String);
var
- i: Integer;
config: TConfig;
section: String;
config: TConfig;
section: String;
config := TConfig.CreateFile(FileName);
config := TConfig.CreateFile(FileName);
- section := 'Video';
- ReadInteger(gScreenWidth, 'ScreenWidth', 0);
- ReadInteger(gScreenHeight, 'ScreenHeight', 0);
- ReadInteger(gWinRealPosX, 'WinPosX', 60);
- ReadInteger(gWinRealPosY, 'WinPosY', 60);
- ReadBoolean(gFullScreen, 'Fullscreen');
- ReadBoolean(gWinMaximized, 'Maximized');
- ReadInteger(gBPP, 'BPP', 0);
- ReadInteger(gFreq, 'Freq', 0);
- ReadBoolean(gVSync, 'VSync');
- ReadBoolean(gTextureFilter, 'TextureFilter');
- ReadBoolean(glNPOTOverride, 'LegacyCompatibleForce');
-
- section := 'Sound';
- ReadBoolean(gNoSound, 'NoSound');
- ReadInteger(gSoundLevel, 'SoundLevel', 0, 255);
- ReadInteger(gMusicLevel, 'MusicLevel', 0, 255);
- ReadInteger(gMaxSimSounds, 'MaxSimSounds', 2, 66);
- ReadBoolean(gMuteWhenInactive, 'MuteInactive');
- ReadInteger(gAnnouncer, 'Announcer', ANNOUNCE_NONE, ANNOUNCE_ALL);
- ReadBoolean(gSoundEffectsDF, 'SoundEffectsDF');
- ReadBoolean(gUseChatSounds, 'ChatSounds');
- ReadInteger(gsSDLSampleRate, 'SDLSampleRate', 11025, 96000);
- ReadInteger(gsSDLBufferSize, 'SDLBufferSize', 64, 16384);
-
section := 'Player1';
with gPlayer1Settings do
begin
section := 'Player1';
with gPlayer1Settings do
begin
Team := TEAM_RED;
end;
Team := TEAM_RED;
end;
- section := 'Joysticks';
- for i := 0 to e_MaxJoys - 1 do
- begin
- ReadInteger(e_JoystickDeadzones[i], 'Deadzone' + IntToStr(i))
- end;
-
- section := 'Game';
- ReadInteger(i, 'MaxParticles', 0, 50000); g_GFX_SetMax(i);
- ReadInteger(i, 'MaxShells', 0, 600); g_Shells_SetMax(i);
- ReadInteger(i, 'MaxGibs', 0, 500); g_Gibs_SetMax(i);
- ReadInteger(i, 'MaxCorpses', 0, 100); g_Corpses_SetMax(i);
- ReadInteger(i, 'GibsCount');
- case i of
- 0: gGibsCount := 0;
- 1: gGibsCount := 8;
- 2: gGibsCount := 16;
- 3: gGibsCount := 32;
- else gGibsCount := 48;
- end;
- i := ITEM_RESPAWNTIME div 36; ReadInteger(i, 'ItemRespawnTime', 0); ITEM_RESPAWNTIME := i * 36;
- ReadInteger(gBloodCount, 'BloodCount', 0, 4);
- ReadBoolean(gAdvBlood, 'AdvancesBlood');
- ReadBoolean(gAdvCorpses, 'AdvancesCorpses');
- ReadBoolean(gAdvGibs, 'AdvancesGibs');
- ReadInteger(gFlash, 'Flash', 0, 2);
- ReadBoolean(gDrawBackGround, 'BackGround');
- ReadBoolean(gShowMessages, 'Messages');
- ReadBoolean(gRevertPlayers, 'RevertPlayers');
- ReadInteger(gChatBubble, 'ChatBubble', 0, 4);
- ReadBoolean(gSFSDebug, 'SFSDebug'); wadoptDebug := gSFSDebug;
- ReadBoolean(gSFSFastMode, 'SFSFastMode'); wadoptFast := gSFSFastMode;
- ReadBoolean(e_FastScreenshots, 'FastScreenshots');
- ReadString(gDefaultMegawadStart, 'DefaultMegawadStart');
- ReadBoolean(gBerserkAutoswitch, 'BerserkAutoswitching');
- i := Trunc(g_dbg_scale * 100); ReadInteger(i, 'Scale', 100); g_dbg_scale := i / 100;
- ReadString(gLanguage, 'Language');
- if (gLanguage = LANGUAGE_RUSSIAN) or (gLanguage = LANGUAGE_ENGLISH) then
- gAskLanguage := False
- else
- gLanguage := LANGUAGE_ENGLISH;
-
section := 'GameplayCustom';
ReadString(gcMap, 'Map');
ReadString(gcGameMode, 'GameMode');
section := 'GameplayCustom';
ReadString(gcMap, 'Map');
ReadString(gcGameMode, 'GameMode');
ReadBoolean(gcWeaponStay, 'WeaponStay');
ReadBoolean(gcMonsters, 'Monsters');
ReadString(gcBotsVS, 'BotsVS');
ReadBoolean(gcWeaponStay, 'WeaponStay');
ReadBoolean(gcMonsters, 'Monsters');
ReadString(gcBotsVS, 'BotsVS');
+ ReadBoolean(gcDeathmatchKeys, 'DeathmatchKeys');
+ ReadBoolean(gcRespawnItems, 'RespawnItems');
+ ReadInteger(gcSpawnInvul, 'SpawnInvul');
with gGameSettings do
begin
with gGameSettings do
begin
Options := Options or GAME_OPTION_BOTVSPLAYER;
if gcBotsVS = 'Monsters' then
Options := Options or GAME_OPTION_BOTVSMONSTER;
Options := Options or GAME_OPTION_BOTVSPLAYER;
if gcBotsVS = 'Monsters' then
Options := Options or GAME_OPTION_BOTVSMONSTER;
+ if gcDeathmatchKeys then
+ Options := Options or GAME_OPTION_DMKEYS;
+ if gcRespawnItems then
+ Options := Options or GAME_OPTION_RESPAWNITEMS;
end;
section := 'GameplayNetwork';
end;
section := 'GameplayNetwork';
ReadBoolean(gnWeaponStay, 'WeaponStay');
ReadBoolean(gnMonsters, 'Monsters');
ReadString(gnBotsVS, 'BotsVS');
ReadBoolean(gnWeaponStay, 'WeaponStay');
ReadBoolean(gnMonsters, 'Monsters');
ReadString(gnBotsVS, 'BotsVS');
+ ReadBoolean(gnDeathmatchKeys, 'DeathmatchKeys');
+ ReadBoolean(gnRespawnItems, 'RespawnItems');
+ ReadInteger(gnSpawnInvul, 'SpawnInvul');
section := 'MasterServer';
ReadString(NetSlistIP, 'IP');
section := 'MasterServer';
ReadString(NetSlistIP, 'IP');
end;
procedure g_Options_Write(FileName: String);
end;
procedure g_Options_Write(FileName: String);
-var
- config: TConfig;
- i: Integer;
+ var config: TConfig;
begin
e_WriteLog('Writing config', TMsgType.Notify);
config := TConfig.CreateFile(FileName);
begin
e_WriteLog('Writing config', TMsgType.Notify);
config := TConfig.CreateFile(FileName);
- config.WriteInt('Video', 'ScreenWidth', gScreenWidth);
- config.WriteInt('Video', 'ScreenHeight', gScreenHeight);
- config.WriteInt('Video', 'WinPosX', gWinRealPosX);
- config.WriteInt('Video', 'WinPosY', gWinRealPosY);
- config.WriteBool('Video', 'Fullscreen', gFullScreen);
- config.WriteBool('Video', 'Maximized', gWinMaximized);
- config.WriteInt('Video', 'BPP', gBPP);
- config.WriteBool('Video', 'VSync', gVSync);
- config.WriteBool('Video', 'TextureFilter', gTextureFilter);
- config.WriteBool('Video', 'LegacyCompatibleForce', glNPOTOverride);
-
- config.WriteBool('Sound', 'NoSound', gNoSound);
- config.WriteInt('Sound', 'SoundLevel', gSoundLevel);
- config.WriteInt('Sound', 'MusicLevel', gMusicLevel);
- config.WriteInt('Sound', 'MaxSimSounds', gMaxSimSounds);
- config.WriteBool('Sound', 'MuteInactive', gMuteWhenInactive);
- config.WriteInt('Sound', 'Announcer', gAnnouncer);
- config.WriteBool('Sound', 'SoundEffectsDF', gSoundEffectsDF);
- config.WriteBool('Sound', 'ChatSounds', gUseChatSounds);
- config.WriteInt('Sound', 'SDLSampleRate', gsSDLSampleRate);
- config.WriteInt('Sound', 'SDLBufferSize', gsSDLBufferSize);
-
with config, gPlayer1Settings do
begin
WriteStr('Player1', 'Name', Name);
with config, gPlayer1Settings do
begin
WriteStr('Player1', 'Name', Name);
WriteInt('Player2', 'team', Team);
end;
WriteInt('Player2', 'team', Team);
end;
- for i := 0 to e_MaxJoys-1 do
- config.WriteInt('Joysticks', 'Deadzone' + IntToStr(i), e_JoystickDeadzones[i]);
-
- with config do
- case gGibsCount of
- 0: config.WriteInt('Game', 'GibsCount', 0);
- 8: config.WriteInt('Game', 'GibsCount', 1);
- 16: config.WriteInt('Game', 'GibsCount', 2);
- 32: config.WriteInt('Game', 'GibsCount', 3);
- else config.WriteInt('Game', 'GibsCount', 4);
- end;
-
- config.WriteInt('Game', 'ItemRespawnTime', ITEM_RESPAWNTIME div 36);
- config.WriteInt('Game', 'MaxParticles', g_GFX_GetMax());
- config.WriteInt('Game', 'MaxShells', g_Shells_GetMax());
- config.WriteInt('Game', 'MaxGibs', g_Gibs_GetMax());
- config.WriteInt('Game', 'MaxCorpses', g_Corpses_GetMax());
- config.WriteInt('Game', 'BloodCount', gBloodCount);
- config.WriteBool('Game', 'AdvancesBlood', gAdvBlood);
- config.WriteBool('Game', 'AdvancesCorpses', gAdvCorpses);
- config.WriteBool('Game', 'AdvancesGibs', gAdvGibs);
- config.WriteInt('Game', 'Flash', gFlash);
- config.WriteBool('Game', 'BackGround', gDrawBackGround);
- config.WriteBool('Game', 'Messages', gShowMessages);
- config.WriteBool('Game', 'RevertPlayers', gRevertPlayers);
- config.WriteInt('Game', 'ChatBubble', gChatBubble);
- config.WriteBool('Game', 'SFSDebug', gSFSDebug);
- config.WriteBool('Game', 'SFSFastMode', gSFSFastMode);
- config.WriteBool('Game', 'FastScreenshots', e_FastScreenshots);
- config.WriteStr('Game', 'DefaultMegawadStart', gDefaultMegawadStart);
- config.WriteBool('Game', 'BerserkAutoswitching', gBerserkAutoswitch);
- config.WriteInt('Game', 'Scale', Round(g_dbg_scale * 100));
-
config.WriteStr ('GameplayCustom', 'Map', gcMap);
config.WriteStr ('GameplayCustom', 'GameMode', gcGameMode);
config.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit);
config.WriteStr ('GameplayCustom', 'Map', gcMap);
config.WriteStr ('GameplayCustom', 'GameMode', gcGameMode);
config.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit);
config.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay);
config.WriteBool('GameplayCustom', 'Monsters', gcMonsters);
config.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS);
config.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay);
config.WriteBool('GameplayCustom', 'Monsters', gcMonsters);
config.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS);
+ config.WriteBool('GameplayCustom', 'DeathmatchKeys', gcDeathmatchKeys);
+ config.WriteBool('GameplayCustom', 'RespawnItems', gcRespawnItems);
+ config.WriteInt ('GameplayCustom', 'SpawnInvul', gcSpawnInvul);
config.WriteStr ('GameplayNetwork', 'Map', gnMap);
config.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode);
config.WriteStr ('GameplayNetwork', 'Map', gnMap);
config.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode);
config.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay);
config.WriteBool('GameplayNetwork', 'Monsters', gnMonsters);
config.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS);
config.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay);
config.WriteBool('GameplayNetwork', 'Monsters', gnMonsters);
config.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS);
+ config.WriteBool('GameplayNetwork', 'DeathmatchKeys', gnDeathmatchKeys);
+ config.WriteBool('GameplayNetwork', 'RespawnItems', gnRespawnItems);
+ config.WriteInt ('GameplayNetwork', 'SpawnInvul', gnSpawnInvul);
config.WriteStr('MasterServer', 'IP', NetSlistIP);
config.WriteInt('MasterServer', 'Port', NetSlistPort);
config.WriteStr('MasterServer', 'IP', NetSlistIP);
config.WriteInt('MasterServer', 'Port', NetSlistPort);
config.Free();
end;
config.Free();
end;
-procedure g_Options_Write_Language(FileName: String);
-var
- config: TConfig;
-begin
- e_WriteLog('Writing language config', TMsgType.Notify);
-
- config := TConfig.CreateFile(FileName);
- config.WriteStr('Game', 'Language', gLanguage);
- config.SaveFile(FileName);
- config.Free();
-end;
-
-procedure g_Options_Write_Video(FileName: String);
-var
- config: TConfig;
- sW, sH: Integer;
-begin
- e_WriteLog('Writing resolution to config', TMsgType.Notify);
-
- config := TConfig.CreateFile(FileName);
-
- if gWinMaximized and (not gFullscreen) then
- begin
- sW := gWinSizeX;
- sH := gWinSizeY;
- end
- else
- begin
- sW := gScreenWidth;
- sH := gScreenHeight;
- end;
- e_LogWritefln(' (ws=%dx%d) (ss=%dx%d)', [gWinSizeX, gWinSizeY, gScreenWidth, gScreenHeight]);
-
- config.WriteInt('Video', 'ScreenWidth', sW);
- config.WriteInt('Video', 'ScreenHeight', sH);
- config.WriteInt('Video', 'WinPosX', gWinRealPosX);
- config.WriteInt('Video', 'WinPosY', gWinRealPosY);
- config.WriteBool('Video', 'Fullscreen', gFullscreen);
- config.WriteBool('Video', 'Maximized', gWinMaximized);
-
- config.WriteStr('Player1', 'Name', gPlayer1Settings.Name);
- config.WriteStr('Player2', 'Name', gPlayer2Settings.Name);
-
- config.SaveFile(FileName);
- config.Free();
-end;
-
procedure g_Options_Write_Gameplay_Custom(FileName: String);
var
config: TConfig;
procedure g_Options_Write_Gameplay_Custom(FileName: String);
var
config: TConfig;
config.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay);
config.WriteBool('GameplayCustom', 'Monsters', gcMonsters);
config.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS);
config.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay);
config.WriteBool('GameplayCustom', 'Monsters', gcMonsters);
config.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS);
+ config.WriteBool('GameplayCustom', 'DeathmatchKeys', gcDeathmatchKeys);
+ config.WriteBool('GameplayCustom', 'RespawnItems', gcRespawnItems);
+ config.WriteInt ('GameplayCustom', 'SpawnInvul', gcSpawnInvul);
config.SaveFile(FileName);
config.Free();
config.SaveFile(FileName);
config.Free();
config.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay);
config.WriteBool('GameplayNetwork', 'Monsters', gnMonsters);
config.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS);
config.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay);
config.WriteBool('GameplayNetwork', 'Monsters', gnMonsters);
config.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS);
+ config.WriteBool('GameplayNetwork', 'DeathmatchKeys', gnDeathmatchKeys);
+ config.WriteBool('GameplayNetwork', 'RespawnItems', gnRespawnItems);
+ config.WriteInt ('GameplayNetwork', 'SpawnInvul', gnSpawnInvul);
config.SaveFile(FileName);
config.Free();
config.SaveFile(FileName);
config.Free();
config.Free();
end;
config.Free();
end;
+procedure g_Options_Commands (p: SSArray);
+ var cmd: AnsiString; i: Integer;
+begin
+ cmd := LowerCase(p[0]);
+ case cmd of
+ 'r_reset':
+ begin
+ sys_EnableVSync(gVSync);
+ gRC_Width := Max(1, gRC_Width);
+ gRC_Height := Max(1, gRC_Height);
+ gBPP := Max(1, gBPP);
+ if sys_SetDisplayMode(gRC_Width, gRC_Height, gBPP, gRC_FullScreen, gRC_Maximized) = True then
+ e_LogWriteln('resolution changed')
+ else
+ e_LogWriteln('resolution not changed')
+ end;
+ 'g_language':
+ begin
+ if Length(p) = 2 then
+ begin
+ gAskLanguage := true;
+ gLanguage := LANGUAGE_ENGLISH;
+ case LowerCase(p[1]) of
+ 'english':
+ begin
+ gAskLanguage := false;
+ gLanguage := LANGUAGE_ENGLISH;
+ end;
+ 'russian':
+ begin
+ gAskLanguage := false;
+ gLanguage := LANGUAGE_RUSSIAN;
+ end;
+ 'ask':
+ begin
+ gAskLanguage := true;
+ gLanguage := LANGUAGE_ENGLISH;
+ end;
+ end;
+ g_Language_Set(gLanguage)
+ end
+ else
+ begin
+ e_LogWritefln('usage: %s <English|Russian|Ask>', [cmd])
+ end
+ end;
+ 'g_max_particles':
+ begin
+ if Length(p) = 2 then
+ begin
+ i := Max(0, StrToInt(p[1]));
+ g_GFX_SetMax(i)
+ end
+ else if Length(p) = 1 then
+ begin
+ e_LogWritefln('%s', [g_GFX_GetMax()])
+ end
+ else
+ begin
+ e_LogWritefln('usage: %s <n>', [cmd])
+ end
+ end;
+ 'g_max_shells':
+ begin
+ if Length(p) = 2 then
+ begin
+ i := Max(0, StrToInt(p[1]));
+ g_Shells_SetMax(i)
+ end
+ else if Length(p) = 1 then
+ begin
+ e_LogWritefln('%s', [g_Shells_GetMax()])
+ end
+ else
+ begin
+ e_LogWritefln('usage: %s <n>', [cmd])
+ end
+ end;
+ 'g_max_gibs':
+ begin
+ if Length(p) = 2 then
+ begin
+ i := Max(0, StrToInt(p[1]));
+ g_Gibs_SetMax(i)
+ end
+ else if Length(p) = 1 then
+ begin
+ e_LogWritefln('%s', [g_Gibs_GetMax()])
+ end
+ else
+ begin
+ e_LogWritefln('usage: %s <n>', [cmd])
+ end
+ end;
+ 'g_max_corpses':
+ begin
+ if Length(p) = 2 then
+ begin
+ i := Max(0, StrToInt(p[1]));
+ g_Corpses_SetMax(i)
+ end
+ else if Length(p) = 1 then
+ begin
+ e_LogWritefln('%s', [g_Corpses_GetMax()])
+ end
+ else
+ begin
+ e_LogWritefln('usage: %s <n>', [cmd])
+ end
+ end;
+ 'g_item_respawn_time':
+ begin
+ if Length(p) = 2 then
+ ITEM_RESPAWNTIME := Max(0, StrToInt(p[1])) * 36
+ else if Length(p) = 1 then
+ e_LogWritefln('%s', [ITEM_RESPAWNTIME div 36])
+ else
+ e_LogWritefln('usage: %s <n>', [cmd])
+ end;
+ end;
+end;
+
initialization
Randomize;
initialization
Randomize;
- machine := Random(10000)
+ machine := Random(10000);
+
+ (* Video *)
+ conRegVar('r_width', @gRC_Width, '', '');
+ conRegVar('r_height', @gRC_Height, '', '');
+ conRegVar('r_fullscreen', @gRC_FullScreen, '', '');
+ conRegVar('r_maximized', @gRC_Maximized, '', '');
+ conRegVar('r_bpp', @gBPP, '', '');
+ conRegVar('r_vsync', @gVSync, '', '');
+ conRegVar('r_texfilter', @gTextureFilter, '', '');
+ conRegVar('r_npot', @glNPOTOverride, '', '');
+
+ (* Sound *)
+ conRegVar('s_nosound', @gNoSound, '', '');
+ conRegVar('s_soundvolume', @gSoundLevel, '', '');
+ conRegVar('s_musicvolume', @gMusicLevel, '', '');
+ conRegVar('s_maxsim', @gMaxSimSounds, '', ''); // e_sound_fmod/sdl?
+ conRegVar('s_muteinactive', @gMuteWhenInactive, '', '');
+ conRegVar('s_announcer', @gAnnouncer, '', '');
+ conRegVar('s_sfx', @gSoundEffectsDF, '', '');
+ conRegVar('s_chatsounds', @gUseChatSounds, '', '');
+ {$IFDEF USE_SDLMIXER}
+ conRegVar('sdl_mixer_samplerate', @gsSDLSampleRate, '', '');
+ conRegVar('sdl_mixer_buffersize', @gsSDLBufferSize, '', '');
+ {$ENDIF}
+
+ (* Game *)
+ conRegVar('g_gibs_count', @gGibsCount, '', '');
+ conRegVar('g_blood_count', @gBloodCount, '', '');
+ conRegVar('g_adv_blood', @gAdvBlood, '', '');
+ conRegVar('g_adv_corpses', @gAdvCorpses, '', '');
+ conRegVar('g_adv_gibs', @gAdvGibs, '', '');
+ conRegVar('r_flash', @gFlash, '', '');
+ conRegVar('r_background', @gDrawBackGround, '', '');
+ conRegVar('g_show_messages', @gShowMessages, '', '');
+ conRegVar('r_revert_players', @gRevertPlayers, '', '');
+ conRegVar('r_chat_bubble', @gChatBubble, '', '');
+ conRegVar('sfs_debug', @wadoptDebug, '', '');
+ conRegVar('sfs_fastmode', @wadoptFast, '', '');
+ conRegVar('g_fast_screenshots', @e_FastScreenshots, '', '');
+ conRegVar('g_default_megawad', @gDefaultMegawadStart, '', '');
+ conRegVar('g_save_stats', @gSaveStats, '', '');
+ conRegVar('g_screenshot_stats', @gScreenshotStats, '', '');
end.
end.