X-Git-Url: http://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_options.pas;h=f15e7c7718e8568906c3afea23ba9ed108daf5d6;hb=414f2873efa0cce84499f64774db7000e6268971;hp=ac80a1b1f786cd8d11f7356510ca1c743b344b6a;hpb=0e101bd452c40da601236aaa2dd4106be47ddce1;p=d2df-sdl.git diff --git a/src/game/g_options.pas b/src/game/g_options.pas index ac80a1b..f15e7c7 100644 --- a/src/game/g_options.pas +++ b/src/game/g_options.pas @@ -22,7 +22,8 @@ uses function GenPlayerName (n: Integer): String; -procedure g_Options_SetDefault(); +procedure g_Options_SetDefault; +procedure g_Options_SetDefaultVideo; procedure g_Options_Read(FileName: String); procedure g_Options_Write(FileName: String); procedure g_Options_Write_Language(FileName: String); @@ -91,6 +92,7 @@ var gSFSFastMode: Boolean; gDefaultMegawadStart: AnsiString; gBerserkAutoswitch: Boolean; + glNPOTOverride: Boolean = false; implementation @@ -125,13 +127,20 @@ var percentage: Integer; begin (* Display 0 = Primary display *) - SDL_GetDesktopDisplayMode(0, @display); - {$IF DEFINED(ANDROID)} + gScreenWidth := 640; + gScreenHeight := 480; + //gBPP := SDL_BITSPERPIXEL(dispaly.format); + gBPP := 32; + {$IFDEF ANDROID} + gFullScreen := True; (* rotation not allowed? *) + {$ELSE} + gFullScreen := False; + {$ENDIF} + if SDL_GetDesktopDisplayMode(0, @display) = 0 then + begin + {$IFDEF ANDROID} gScreenWidth := display.w; gScreenHeight := display.h; - //gBPP := SDL_BITSPERPIXEL(dispaly.format); - gBPP := 32; - gFullScreen := True; (* rotation not allowed? *) {$ELSE} (* Window must be smaller than display *) closest.w := display.w; @@ -156,9 +165,12 @@ begin gScreenWidth := closest.w; gScreenHeight := closest.h; //gBPP := SDL_BITSPERPIXEL(closest.format); (* Resolution list didn't work for some reason *) - gBPP := 32; - gFullScreen := False; {$ENDIF} + end + else + begin + 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; @@ -172,7 +184,6 @@ end; {$ELSE} procedure g_Options_SetDefaultVideo; begin - {$WARNING stub} gScreenWidth := 640; gScreenHeight := 480; gBPP := 32; @@ -287,7 +298,7 @@ begin (* section MasterServer *) NetSlistIP := 'mpms.doom2d.org'; NetSlistPort := 25665; - g_Net_Slist_Set(NetSlistIP, NetSlistPort); + g_Net_Slist_Set(NetSlistIP, NetSlistPort, NetSlistList); (* section Server *) NetServerName := 'Unnamed Server'; @@ -371,7 +382,7 @@ begin ReadInteger(gFreq, 'Freq', 0); ReadBoolean(gVSync, 'VSync'); ReadBoolean(gTextureFilter, 'TextureFilter'); - ReadBoolean(glLegacyNPOT, 'LegacyCompatible'); + ReadBoolean(glNPOTOverride, 'LegacyCompatibleForce'); section := 'Sound'; ReadBoolean(gNoSound, 'NoSound'); @@ -509,7 +520,8 @@ begin section := 'MasterServer'; ReadString(NetSlistIP, 'IP'); ReadInteger(NetSlistPort, 'Port', 0, 65535); - g_Net_Slist_Set(NetSlistIP, NetSlistPort); + ReadString(NetSlistList, 'List'); + g_Net_Slist_Set(NetSlistIP, NetSlistPort, NetSlistList); section := 'Server'; ReadString(NetServerName, 'Name'); @@ -554,7 +566,7 @@ begin config.WriteInt('Video', 'BPP', gBPP); config.WriteBool('Video', 'VSync', gVSync); config.WriteBool('Video', 'TextureFilter', gTextureFilter); - config.WriteBool('Video', 'LegacyCompatible', glLegacyNPOT); + config.WriteBool('Video', 'LegacyCompatibleForce', glNPOTOverride); config.WriteBool('Sound', 'NoSound', gNoSound); config.WriteInt('Sound', 'SoundLevel', gSoundLevel); @@ -646,6 +658,7 @@ begin 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);