diff --git a/src/game/g_options.pas b/src/game/g_options.pas
index c923a6771fdb120124f71ef6a778720633af8ffc..79da12ec4439c1e57f490e504481e15ce2bf730a 100644 (file)
--- a/src/game/g_options.pas
+++ b/src/game/g_options.pas
interface
uses
interface
uses
- g_language, g_weapons, utils;
+ g_language, g_game, g_weapons, utils;
function GenPlayerName (n: Integer): String;
procedure g_Options_SetDefault;
procedure g_Options_SetDefaultVideo;
function GenPlayerName (n: Integer): String;
procedure g_Options_SetDefault;
procedure g_Options_SetDefaultVideo;
-procedure g_Options_Read(FileName: String);
-procedure g_Options_Write(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);
+procedure g_Options_ApplyGameSettings;
const DF_Default_Megawad_Start = 'megawads/DOOM2D.WAD:\MAP01';
var
const DF_Default_Megawad_Start = 'megawads/DOOM2D.WAD:\MAP01';
var
- gScreenWidth: Word;
- gScreenHeight: Word;
gBPP: Integer;
gFreq: Byte;
gFullscreen: Boolean;
gBPP: Integer;
gFreq: Byte;
gFullscreen: Boolean;
+ gWinSizeX, gWinSizeY: Integer;
gWinMaximized: Boolean;
gVSync: Boolean;
glLegacyNPOT: Boolean;
gWinMaximized: Boolean;
gVSync: Boolean;
glLegacyNPOT: Boolean;
+ glRenderToFBO: Boolean = True;
gTextureFilter: Boolean;
gTextureFilter: Boolean;
+ gLerpActors: Boolean = True;
+ gFrameTime: Integer = 5;
+ gMaxFPS: Integer = 200;
gNoSound: Boolean;
gSoundLevel: Integer;
gMusicLevel: Integer;
gNoSound: Boolean;
gSoundLevel: Integer;
gMusicLevel: Integer;
gAskLanguage: Boolean;
gSaveStats: Boolean = False;
gScreenshotStats: Boolean = False;
gAskLanguage: Boolean;
gSaveStats: Boolean = False;
gScreenshotStats: Boolean = False;
- gcMap: String;
- gcGameMode: String;
- gcTimeLimit: Word;
- gcGoalLimit: Word;
- gcMaxLives: Byte;
- gcPlayers: Byte;
- gcTeamDamage: Boolean;
- gcAllowExit: Boolean;
- gcWeaponStay: Boolean;
- gcMonsters: Boolean;
- gcBotsVS: String;
- gcDeathmatchKeys: Boolean = True;
- gcSpawnInvul: Integer = 0;
- gnMap: String;
- gnGameMode: String;
- gnTimeLimit: Word;
- gnGoalLimit: Word;
- gnMaxLives: Byte;
- gnPlayers: Byte;
- gnTeamDamage: Boolean;
- gnAllowExit: Boolean;
- gnWeaponStay: Boolean;
- gnMonsters: Boolean;
- gnBotsVS: String;
- gnDeathmatchKeys: Boolean = True;
- gnSpawnInvul: Integer = 0;
gsSDLSampleRate: Integer;
gsSDLBufferSize: Integer;
gDefaultMegawadStart: AnsiString;
gsSDLSampleRate: Integer;
gsSDLBufferSize: Integer;
gDefaultMegawadStart: AnsiString;
- gBerserkAutoswitch: Boolean;
glNPOTOverride: Boolean = false;
glNPOTOverride: Boolean = false;
+ (* Latched game settings *)
+ gsMap: String;
+ gsGameMode: String;
+ gsTimeLimit: Word;
+ gsScoreLimit: Word;
+ gsMaxLives: Byte;
+ gsPlayers: Byte;
+ gsGameFlags: TGameOptions;
+ gsSpawnInvul: Integer = 0;
+ gsItemRespawnTime: Word = 60;
+ gsItemRespawnRandom: Word = 0;
+ gsPowerupRespawnTime: Word = 60;
+ gsPowerupRespawnRandom: Word = 0;
+ gsWarmupTime: Word = 30;
+
implementation
uses
implementation
uses
SDL2,
{$ENDIF}
e_log, e_input, g_console, g_window, g_sound, g_gfx, g_player, Math,
SDL2,
{$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_map, g_net, g_netmaster, SysUtils, CONFIG, g_main, e_texture,
g_items, wadreader, e_graphics, g_touch, envvars, g_system;
var
g_items, wadreader, e_graphics, g_touch, envvars, g_system;
var
if Result = '' then
Result := 'Player' + IntToStr(machine MOD 10000);
if n = 1 then
if Result = '' then
Result := 'Player' + IntToStr(machine MOD 10000);
if n = 1 then
- Result := Copy(Result, 1, 12) + ' '
+ Result := Copy(Result, 1, 12)
else
Result := Copy(Result, 1, 10) + ' ' + IntToStr(n)
end;
else
Result := Copy(Result, 1, 10) + ' ' + IntToStr(n)
end;
(* Display 0 = Primary display *)
gScreenWidth := 640;
gScreenHeight := 480;
(* Display 0 = Primary display *)
gScreenWidth := 640;
gScreenHeight := 480;
- //gBPP := SDL_BITSPERPIXEL(dispaly.format);
+ gWinSizeX := 640;
+ gWinSizeY := 480;
+ //gBPP := SDL_BITSPERPIXEL(display.format);
gBPP := 32;
{$IFDEF ANDROID}
gFullScreen := True; (* rotation not allowed? *)
gBPP := 32;
{$IFDEF ANDROID}
gFullScreen := True; (* rotation not allowed? *)
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
gVSync := True;
gTextureFilter := True;
glLegacyNPOT := False;
gVSync := True;
gTextureFilter := True;
glLegacyNPOT := False;
- gRC_Width := gScreenWidth;
- gRC_Height := gScreenHeight;
+ gRC_Width := gWinSizeX;
+ gRC_Height := gWinSizeY;
gRC_FullScreen := gFullScreen;
gRC_Maximized := gWinMaximized;
gRC_FullScreen := gFullScreen;
gRC_Maximized := gWinMaximized;
- e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gScreenWidth) + ' h = ' + IntToStr(gScreenHeight));
+ 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;
gWinMaximized := False;
gVSync := True;
gTextureFilter := True;
glLegacyNPOT := False;
gBPP := 32;
gFullScreen := False;
gWinMaximized := False;
gVSync := True;
gTextureFilter := True;
glLegacyNPOT := False;
- gRC_Width := gScreenWidth;
- gRC_Height := gScreenHeight;
+ gScreenWidth := gWinSizeX;
+ gScreenHeight := gWinSizeY;
+ gRC_Width := gWinSizeX;
+ gRC_Height := gWinSizeY;
gRC_FullScreen := gFullScreen;
gRC_Maximized := gWinMaximized;
gRC_FullScreen := gFullScreen;
gRC_Maximized := gWinMaximized;
- e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gScreenWidth) + ' h = ' + IntToStr(gScreenHeight));
+ e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gWinSizeX) + ' h = ' + IntToStr(gWinSizeY));
g_Console_ResetBinds;
end;
{$ENDIF}
g_Console_ResetBinds;
end;
{$ENDIF}
g_Gibs_SetMax(150);
g_Corpses_SetMax(20);
gGibsCount := 32;
g_Gibs_SetMax(150);
g_Corpses_SetMax(20);
gGibsCount := 32;
- ITEM_RESPAWNTIME := 60 * 36;
gBloodCount := 4;
gAdvBlood := True;
gAdvCorpses := True;
gBloodCount := 4;
gAdvBlood := True;
gAdvCorpses := True;
wadoptFast := False;
e_FastScreenshots := True;
gDefaultMegawadStart := DF_Default_Megawad_Start;
wadoptFast := False;
e_FastScreenshots := True;
gDefaultMegawadStart := DF_Default_Megawad_Start;
- gBerserkAutoswitch := True;
g_dbg_scale := 1.0;
gSaveStats := False;
gAskLanguage := True;
gLanguage := LANGUAGE_ENGLISH;
g_dbg_scale := 1.0;
gSaveStats := False;
gAskLanguage := True;
gLanguage := LANGUAGE_ENGLISH;
- (* section GameplayCustom *)
- gcMap := '';
- gcGameMode := _lc[I_MENU_GAME_TYPE_DM];
- gcTimeLimit := 0;
- gcGoalLimit := 0;
- gcMaxLives := 0;
- gcPlayers := 1;
- gcTeamDamage := False;
- gcAllowExit := True;
- gcWeaponStay := False;
- gcMonsters := False;
- gcBotsVS := 'Everybody';
- gcDeathmatchKeys := True;
- gcSpawnInvul := 0;
-
- (* section GameplayNetwork *)
- gnMap := '';
- gnGameMode := _lc[I_MENU_GAME_TYPE_DM];
- gnTimeLimit := 0;
- gnGoalLimit := 0;
- gnMaxLives := 0;
- gnPlayers := 1;
- gnTeamDamage := False;
- gnAllowExit := True;
- gnWeaponStay := False;
- gnMonsters := False;
- gnBotsVS := 'Everybody';
- gnDeathmatchKeys := True;
- gnSpawnInvul := 0;
+ gsMap := '';
+ gsGameMode := _lc[I_MENU_GAME_TYPE_DM];
+ gsTimeLimit := 0;
+ gsScoreLimit := 0;
+ gsMaxLives := 0;
+ gsPlayers := 1;
+ gsSpawnInvul := 0;
+ gsItemRespawnTime := 60;
+ gsItemRespawnRandom := 0;
+ gsPowerupRespawnTime := 60;
+ gsPowerupRespawnRandom := 0;
+ gsGameFlags := [TGameOption.ALLOW_EXIT, TGameOption.DM_KEYS, TGameOption.BOTS_VS_PLAYERS,
+ TGameOption.BOTS_VS_MONSTERS, TGameOption.TEAM_HIT_TRACE, TGameOption.TEAM_HIT_PROJECTILE,
+ TGameOption.ALLOW_DROP_FLAG];
+ gsPlayers := 1;
+
+ if not gGameOn then
+ g_Options_ApplyGameSettings;
(* section MasterServer *)
(* section MasterServer *)
- NetSlistIP := 'mpms.doom2d.org';
- NetSlistPort := 25665;
- g_Net_Slist_Set(NetSlistIP, NetSlistPort, NetSlistList);
+ NetMasterList := 'mpms.doom2d.org:25665, deadsoftware.ru:25665, terminalcorner.ru:25665';
+ g_Net_Slist_Set(NetMasterList);
(* section Server *)
NetServerName := 'Unnamed Server';
(* section Server *)
NetServerName := 'Unnamed Server';
NetClientPort := NetPort;
end;
NetClientPort := NetPort;
end;
-procedure g_Options_Read(FileName: String);
-var
- config: TConfig;
- section: String;
-
- procedure ReadInteger (VAR v: Integer; param: String; minv: Integer = Low(Integer); maxv: Integer = High(Integer));
- begin
- v := Max(Min(config.ReadInt(section, param, v), maxv), minv)
- end;
-
- procedure ReadInteger (VAR v: LongWord; param: String; minv: LongWord = Low(LongWord); maxv: LongWord = High(LongWord)); overload;
- begin
- v := Max(Min(config.ReadInt(section, param, v), maxv), minv)
- end;
-
- procedure ReadInteger (VAR v: Word; param: String; minv: Word = Low(Word); maxv: Word = High(Word)); overload;
- begin
- v := Max(Min(config.ReadInt(section, param, v), maxv), minv)
- end;
-
- procedure ReadInteger (VAR v: Byte; param: String; minv: Byte = Low(Byte); maxv: Byte = High(Byte)); overload;
- begin
- v := Max(Min(config.ReadInt(section, param, v), maxv), minv)
- end;
-
- procedure ReadBoolean (VAR v: Boolean; param: String);
- begin
- v := config.ReadBool(section, param, v)
- end;
-
- procedure ReadString (VAR v: String; param: String);
- begin
- v := config.ReadStr(section, param, v)
- end;
-
+procedure g_Options_ApplyGameSettings;
begin
begin
- gAskLanguage := True;
- e_WriteLog('Reading config', TMsgType.Notify);
- g_Options_SetDefault;
-
- if FileExists(FileName) = False then
- begin
- e_WriteLog('Config file '+FileName+' not found', TMsgType.Warning);
- g_Options_SetDefaultVideo;
- Exit
- end;
-
- config := TConfig.CreateFile(FileName);
-
- section := 'Player1';
- with gPlayer1Settings do
- begin
- ReadString(Name, 'name');
- ReadString(Model, 'model');
- ReadInteger(Color.R, 'red', 0, 255);
- ReadInteger(Color.G, 'green', 0, 255);
- ReadInteger(Color.B, 'blue', 0, 255);
- ReadInteger(Team, 'team');
- if (Team < TEAM_RED) or (Team > TEAM_BLUE) then
- Team := TEAM_RED;
- end;
-
- section := 'Player2';
- with gPlayer2Settings do
- begin
- ReadString(Name, 'name');
- ReadString(Model, 'model');
- ReadInteger(Color.R, 'red', 0, 255);
- ReadInteger(Color.G, 'green', 0, 255);
- ReadInteger(Color.B, 'blue', 0, 255);
- ReadInteger(Team, 'team');
- if (Team < TEAM_RED) or (Team > TEAM_BLUE) then
- Team := TEAM_RED;
- end;
-
- section := 'GameplayCustom';
- ReadString(gcMap, 'Map');
- ReadString(gcGameMode, 'GameMode');
- ReadInteger(gcTimeLimit, 'TimeLimit', 0, 65535);
- ReadInteger(gcGoalLimit, 'GoalLimit', 0, 65535);
- ReadInteger(gcMaxLives, 'MaxLives', 0, 255);
- ReadInteger(gcPlayers, 'Players', 0, 2);
- ReadBoolean(gcTeamDamage, 'TeamDamage');
- ReadBoolean(gcAllowExit, 'AllowExit');
- ReadBoolean(gcWeaponStay, 'WeaponStay');
- ReadBoolean(gcMonsters, 'Monsters');
- ReadString(gcBotsVS, 'BotsVS');
- ReadBoolean(gcDeathmatchKeys, 'DeathmatchKeys');
- ReadInteger(gcSpawnInvul, 'SpawnInvul');
-
with gGameSettings do
begin
with gGameSettings do
begin
- GameMode := g_Game_TextToMode(gcGameMode);
+ GameMode := g_Game_TextToMode(gsGameMode);
if GameMode = GM_NONE then
GameMode := GM_DM;
if GameMode = GM_SINGLE then
GameMode := GM_COOP;
if GameMode = GM_NONE then
GameMode := GM_DM;
if GameMode = GM_SINGLE then
GameMode := GM_COOP;
- TimeLimit := gcTimeLimit;
- GoalLimit := gcGoalLimit;
- MaxLives := gcMaxLives;
-
- Options := 0;
- if gcTeamDamage then
- Options := Options or GAME_OPTION_TEAMDAMAGE;
- if gcAllowExit then
- Options := Options or GAME_OPTION_ALLOWEXIT;
- if gcWeaponStay then
- Options := Options or GAME_OPTION_WEAPONSTAY;
- if gcMonsters then
- Options := Options or GAME_OPTION_MONSTERS;
- if gcBotsVS = 'Everybody' then
- Options := Options or GAME_OPTION_BOTVSPLAYER or GAME_OPTION_BOTVSMONSTER;
- if gcBotsVS = 'Players' then
- 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;
- end;
-
- section := 'GameplayNetwork';
- ReadString(gnMap, 'Map');
- ReadString(gnGameMode, 'GameMode');
- ReadInteger(gnTimeLimit, 'TimeLimit', 0, 65535);
- ReadInteger(gnGoalLimit, 'GoalLimit', 0, 65535);
- ReadInteger(gnMaxLives, 'MaxLives', 0, 255);
- ReadInteger(gnPlayers, 'Players', 0, 2);
- ReadBoolean(gnTeamDamage, 'TeamDamage');
- ReadBoolean(gnAllowExit, 'AllowExit');
- ReadBoolean(gnWeaponStay, 'WeaponStay');
- ReadBoolean(gnMonsters, 'Monsters');
- ReadString(gnBotsVS, 'BotsVS');
- ReadBoolean(gnDeathmatchKeys, 'DeathmatchKeys');
- ReadInteger(gnSpawnInvul, 'SpawnInvul');
-
- section := 'MasterServer';
- ReadString(NetSlistIP, 'IP');
- ReadInteger(NetSlistPort, 'Port', 0, 65535);
- ReadString(NetSlistList, 'List');
- g_Net_Slist_Set(NetSlistIP, NetSlistPort, NetSlistList);
-
- section := 'Server';
- ReadString(NetServerName, 'Name');
- ReadString(NetPassword, 'Password');
- ReadInteger(NetPort, 'Port', 0, 65535);
- ReadInteger(NetMaxClients, 'MaxClients', 0, NET_MAXCLIENTS);
- ReadBoolean(NetAllowRCON, 'RCON');
- ReadString(NetRCONPassword, 'RCONPassword');
- ReadBoolean(NetUseMaster, 'SyncWithMaster');
- ReadInteger(NetUpdateRate, 'UpdateInterval', 0);
- ReadInteger(NetRelupdRate, 'ReliableUpdateInterval', 0);
- ReadInteger(NetMasterRate, 'MasterSyncInterval', 1);
- ReadBoolean(NetForwardPorts, 'ForwardPorts');
-
- section := 'Client';
- ReadInteger(NetInterpLevel, 'InterpolationSteps', 0);
- ReadBoolean(NetForcePlayerUpdate, 'ForcePlayerUpdate');
- ReadBoolean(NetPredictSelf, 'PredictSelf');
- ReadString(NetClientIP, 'LastIP');
- ReadInteger(NetClientPort, 'LastPort', 0, 65535);
-
- config.Free();
-
- //if gTextureFilter then TEXTUREFILTER := GL_LINEAR else TEXTUREFILTER := GL_NEAREST;
-end;
-
-procedure g_Options_Write(FileName: String);
- var config: TConfig;
-begin
- e_WriteLog('Writing config', TMsgType.Notify);
-
- config := TConfig.CreateFile(FileName);
-
- with config, gPlayer1Settings do
- begin
- WriteStr('Player1', 'Name', Name);
- WriteStr('Player1', 'model', Model);
- WriteInt('Player1', 'red', Color.R);
- WriteInt('Player1', 'green', Color.G);
- WriteInt('Player1', 'blue', Color.B);
- WriteInt('Player1', 'team', Team);
- end;
-
- with config, gPlayer2Settings do
- begin
- WriteStr('Player2', 'Name', Name);
- WriteStr('Player2', 'model', Model);
- WriteInt('Player2', 'red', Color.R);
- WriteInt('Player2', 'green', Color.G);
- WriteInt('Player2', 'blue', Color.B);
- WriteInt('Player2', 'team', Team);
- end;
-
- config.WriteStr ('GameplayCustom', 'Map', gcMap);
- config.WriteStr ('GameplayCustom', 'GameMode', gcGameMode);
- config.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit);
- config.WriteInt ('GameplayCustom', 'GoalLimit', gcGoalLimit);
- config.WriteInt ('GameplayCustom', 'MaxLives', gcMaxLives);
- config.WriteInt ('GameplayCustom', 'Players', gcPlayers);
- config.WriteBool('GameplayCustom', 'TeamDamage', gcTeamDamage);
- config.WriteBool('GameplayCustom', 'AllowExit', gcAllowExit);
- config.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay);
- config.WriteBool('GameplayCustom', 'Monsters', gcMonsters);
- config.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS);
- config.WriteBool('GameplayCustom', 'DeathmatchKeys', gcDeathmatchKeys);
- config.WriteInt ('GameplayCustom', 'SpawnInvul', gcSpawnInvul);
-
- config.WriteStr ('GameplayNetwork', 'Map', gnMap);
- config.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode);
- config.WriteInt ('GameplayNetwork', 'TimeLimit', gnTimeLimit);
- config.WriteInt ('GameplayNetwork', 'GoalLimit', gnGoalLimit);
- config.WriteInt ('GameplayNetwork', 'MaxLives', gnMaxLives);
- config.WriteInt ('GameplayNetwork', 'Players', gnPlayers);
- config.WriteBool('GameplayNetwork', 'TeamDamage', gnTeamDamage);
- config.WriteBool('GameplayNetwork', 'AllowExit', gnAllowExit);
- config.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay);
- config.WriteBool('GameplayNetwork', 'Monsters', gnMonsters);
- config.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS);
- config.WriteBool('GameplayNetwork', 'DeathmatchKeys', gnDeathmatchKeys);
- config.WriteInt ('GameplayNetwork', 'SpawnInvul', gnSpawnInvul);
-
- config.WriteStr('MasterServer', 'IP', NetSlistIP);
- config.WriteInt('MasterServer', 'Port', NetSlistPort);
- config.WriteStr('MasterServer', 'List', NetSlistList);
-
- config.WriteStr ('Server', 'Name', NetServerName);
- config.WriteStr ('Server', 'Password', NetPassword);
- config.WriteInt ('Server', 'Port', NetPort);
- config.WriteInt ('Server', 'MaxClients', NetMaxClients);
- config.WriteBool('Server', 'RCON', NetAllowRCON);
- config.WriteStr ('Server', 'RCONPassword', NetRCONPassword);
- config.WriteBool('Server', 'SyncWithMaster', NetUseMaster);
- config.WriteBool('Server', 'ForwardPorts', NetForwardPorts);
- config.WriteInt ('Server', 'UpdateInterval', NetUpdateRate);
- config.WriteInt ('Server', 'ReliableUpdateInterval', NetRelupdRate);
- config.WriteInt ('Server', 'MasterSyncInterval', NetMasterRate);
-
- config.WriteInt ('Client', 'InterpolationSteps', NetInterpLevel);
- config.WriteBool ('Client', 'ForcePlayerUpdate', NetForcePlayerUpdate);
- config.WriteBool ('Client', 'PredictSelf', NetPredictSelf);
- config.WriteStr ('Client', 'LastIP', NetClientIP);
- config.WriteInt ('Client', 'LastPort', NetClientPort);
-
- config.SaveFile(FileName);
- config.Free();
-end;
-
-procedure g_Options_Write_Gameplay_Custom(FileName: String);
-var
- config: TConfig;
-begin
- e_WriteLog('Writing custom gameplay config', TMsgType.Notify);
-
- config := TConfig.CreateFile(FileName);
-
- config.WriteStr ('GameplayCustom', 'Map', gcMap);
- config.WriteStr ('GameplayCustom', 'GameMode', gcGameMode);
- config.WriteInt ('GameplayCustom', 'TimeLimit', gcTimeLimit);
- config.WriteInt ('GameplayCustom', 'GoalLimit', gcGoalLimit);
- config.WriteInt ('GameplayCustom', 'MaxLives', gcMaxLives);
- config.WriteInt ('GameplayCustom', 'Players', gcPlayers);
- config.WriteBool('GameplayCustom', 'TeamDamage', gcTeamDamage);
- config.WriteBool('GameplayCustom', 'AllowExit', gcAllowExit);
- config.WriteBool('GameplayCustom', 'WeaponStay', gcWeaponStay);
- config.WriteBool('GameplayCustom', 'Monsters', gcMonsters);
- config.WriteStr ('GameplayCustom', 'BotsVS', gcBotsVS);
- config.WriteBool('GameplayCustom', 'DeathmatchKeys', gcDeathmatchKeys);
- config.WriteInt ('GameplayCustom', 'SpawnInvul', gcSpawnInvul);
-
- config.SaveFile(FileName);
- config.Free();
-end;
-
-procedure g_Options_Write_Gameplay_Net(FileName: String);
-var
- config: TConfig;
-begin
- e_WriteLog('Writing network gameplay config', TMsgType.Notify);
-
- config := TConfig.CreateFile(FileName);
-
- config.WriteStr ('GameplayNetwork', 'Map', gnMap);
- config.WriteStr ('GameplayNetwork', 'GameMode', gnGameMode);
- config.WriteInt ('GameplayNetwork', 'TimeLimit', gnTimeLimit);
- config.WriteInt ('GameplayNetwork', 'GoalLimit', gnGoalLimit);
- config.WriteInt ('GameplayNetwork', 'MaxLives', gnMaxLives);
- config.WriteInt ('GameplayNetwork', 'Players', gnPlayers);
- config.WriteBool('GameplayNetwork', 'TeamDamage', gnTeamDamage);
- config.WriteBool('GameplayNetwork', 'AllowExit', gnAllowExit);
- config.WriteBool('GameplayNetwork', 'WeaponStay', gnWeaponStay);
- config.WriteBool('GameplayNetwork', 'Monsters', gnMonsters);
- config.WriteStr ('GameplayNetwork', 'BotsVS', gnBotsVS);
- config.WriteBool('GameplayNetwork', 'DeathmatchKeys', gnDeathmatchKeys);
- config.WriteInt ('GameplayNetwork', 'SpawnInvul', gnSpawnInvul);
-
- config.SaveFile(FileName);
- config.Free();
-end;
-
-procedure g_Options_Write_Net_Server(FileName: String);
-var
- config: TConfig;
-begin
- e_WriteLog('Writing server config', TMsgType.Notify);
-
- config := TConfig.CreateFile(FileName);
-
- config.WriteStr ('Server', 'Name', NetServerName);
- config.WriteStr ('Server', 'Password', NetPassword);
- config.WriteInt ('Server', 'Port', NetPort);
- config.WriteInt ('Server', 'MaxClients', NetMaxClients);
- config.WriteBool('Server', 'SyncWithMaster', NetUseMaster);
- config.WriteBool('Server', 'ForwardPorts', NetForwardPorts);
-
- config.SaveFile(FileName);
- config.Free();
-end;
-
-procedure g_Options_Write_Net_Client(FileName: String);
-var
- config: TConfig;
-begin
- e_WriteLog('Writing client config', TMsgType.Notify);
-
- config := TConfig.CreateFile(FileName);
-
- config.WriteStr('Client', 'LastIP', NetClientIP);
- config.WriteInt('Client', 'LastPort', NetClientPort);
-
- config.SaveFile(FileName);
- 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;
+ TimeLimit := gsTimeLimit;
+ ScoreLimit := gsScoreLimit;
+ MaxLives := gsMaxLives;
+ SpawnInvul := gsSpawnInvul;
+ ItemRespawnTime := gsItemRespawnTime;
+ ItemRespawnRandom := gsItemRespawnRandom;
+ PowerupRespawnTime := gsPowerupRespawnTime;
+ PowerupRespawnRandom := gsPowerupRespawnRandom;
+ WarmupTime := gsWarmupTime;
+ Options := gsGameFlags;
end;
end;
end;
end;
conRegVar('r_vsync', @gVSync, '', '');
conRegVar('r_texfilter', @gTextureFilter, '', '');
conRegVar('r_npot', @glNPOTOverride, '', '');
conRegVar('r_vsync', @gVSync, '', '');
conRegVar('r_texfilter', @gTextureFilter, '', '');
conRegVar('r_npot', @glNPOTOverride, '', '');
+ conRegVar('r_interp', @gLerpActors, '', 'interpolate actors');
(* Sound *)
conRegVar('s_nosound', @gNoSound, '', '');
(* Sound *)
conRegVar('s_nosound', @gNoSound, '', '');
conRegVar('g_default_megawad', @gDefaultMegawadStart, '', '');
conRegVar('g_save_stats', @gSaveStats, '', '');
conRegVar('g_screenshot_stats', @gScreenshotStats, '', '');
conRegVar('g_default_megawad', @gDefaultMegawadStart, '', '');
conRegVar('g_save_stats', @gSaveStats, '', '');
conRegVar('g_screenshot_stats', @gScreenshotStats, '', '');
+ conRegVar('g_lastmap', @gsMap, '', '');
end.
end.