X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_options.pas;h=23ddc36a259a6a5d04531e64b3ff5243253b8e5a;hb=0b34f8195a84d9aecc7cd9f17fd1902b7723e3b8;hp=d523da8c511b83be4d6d6bc68af001e49598654d;hpb=91448a18a3dad8151acb610601f79bf82bca6c91;p=d2df-sdl.git diff --git a/src/game/g_options.pas b/src/game/g_options.pas index d523da8..23ddc36 100644 --- a/src/game/g_options.pas +++ b/src/game/g_options.pas @@ -35,14 +35,14 @@ procedure g_Options_Commands (p: SSArray); const DF_Default_Megawad_Start = 'megawads/DOOM2D.WAD:\MAP01'; var - gScreenWidth: Word; - gScreenHeight: Word; gBPP: Integer; gFreq: Byte; gFullscreen: Boolean; + gWinSizeX, gWinSizeY: Integer; gWinMaximized: Boolean; gVSync: Boolean; glLegacyNPOT: Boolean; + glRenderToFBO: Boolean = True; gTextureFilter: Boolean; gNoSound: Boolean; gSoundLevel: Integer; @@ -60,6 +60,8 @@ var gRevertPlayers: Boolean; gLanguage: String; gAskLanguage: Boolean; + gSaveStats: Boolean = False; + gScreenshotStats: Boolean = False; gcMap: String; gcGameMode: String; gcTimeLimit: Word; @@ -71,6 +73,8 @@ var gcWeaponStay: Boolean; gcMonsters: Boolean; gcBotsVS: String; + gcDeathmatchKeys: Boolean = True; + gcSpawnInvul: Integer = 0; gnMap: String; gnGameMode: String; gnTimeLimit: Word; @@ -82,6 +86,8 @@ var gnWeaponStay: Boolean; gnMonsters: Boolean; gnBotsVS: String; + gnDeathmatchKeys: Boolean = True; + gnSpawnInvul: Integer = 0; gsSDLSampleRate: Integer; gsSDLBufferSize: Integer; gDefaultMegawadStart: AnsiString; @@ -124,6 +130,8 @@ begin (* Display 0 = Primary display *) gScreenWidth := 640; gScreenHeight := 480; + gWinSizeX := 640; + gWinSizeY := 480; //gBPP := SDL_BITSPERPIXEL(dispaly.format); gBPP := 32; {$IFDEF ANDROID} @@ -134,8 +142,8 @@ begin 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; @@ -157,8 +165,8 @@ begin 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 @@ -171,29 +179,31 @@ begin gVSync := True; gTextureFilter := True; glLegacyNPOT := False; - gRC_Width := gScreenWidth; - gRC_Height := gScreenHeight; + gRC_Width := gWinSizeX; + gRC_Height := gWinSizeY; 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 - gScreenWidth := 640; - gScreenHeight := 480; + gWinSizeX := 640; + gWinSizeY := 480; 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; - 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} @@ -264,6 +274,7 @@ begin gDefaultMegawadStart := DF_Default_Megawad_Start; gBerserkAutoswitch := True; g_dbg_scale := 1.0; + gSaveStats := False; gAskLanguage := True; gLanguage := LANGUAGE_ENGLISH; @@ -280,6 +291,8 @@ begin gcWeaponStay := False; gcMonsters := False; gcBotsVS := 'Everybody'; + gcDeathmatchKeys := True; + gcSpawnInvul := 0; (* section GameplayNetwork *) gnMap := ''; @@ -293,6 +306,8 @@ begin gnWeaponStay := False; gnMonsters := False; gnBotsVS := 'Everybody'; + gnDeathmatchKeys := True; + gnSpawnInvul := 0; (* section MasterServer *) NetSlistIP := 'mpms.doom2d.org'; @@ -407,6 +422,8 @@ begin ReadBoolean(gcWeaponStay, 'WeaponStay'); ReadBoolean(gcMonsters, 'Monsters'); ReadString(gcBotsVS, 'BotsVS'); + ReadBoolean(gcDeathmatchKeys, 'DeathmatchKeys'); + ReadInteger(gcSpawnInvul, 'SpawnInvul'); with gGameSettings do begin @@ -434,6 +451,8 @@ begin 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'; @@ -448,6 +467,8 @@ begin ReadBoolean(gnWeaponStay, 'WeaponStay'); ReadBoolean(gnMonsters, 'Monsters'); ReadString(gnBotsVS, 'BotsVS'); + ReadBoolean(gnDeathmatchKeys, 'DeathmatchKeys'); + ReadInteger(gnSpawnInvul, 'SpawnInvul'); section := 'MasterServer'; ReadString(NetSlistIP, 'IP'); @@ -518,6 +539,8 @@ begin 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); @@ -530,6 +553,8 @@ begin 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); @@ -576,6 +601,8 @@ begin 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(); @@ -600,6 +627,8 @@ begin 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(); @@ -804,5 +833,6 @@ initialization 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.