X-Git-Url: https://deadsoftware.ru/gitweb?a=blobdiff_plain;f=src%2Fgame%2Fg_options.pas;h=116e6474fd136810e16de5b09963901a06c7b65b;hb=ff17260e083bdf4461154b916a716cd9b61126b1;hp=ac80a1b1f786cd8d11f7356510ca1c743b344b6a;hpb=0e101bd452c40da601236aaa2dd4106be47ddce1;p=d2df-sdl.git diff --git a/src/game/g_options.pas b/src/game/g_options.pas index ac80a1b..116e647 100644 --- a/src/game/g_options.pas +++ b/src/game/g_options.pas @@ -125,13 +125,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 +163,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 +182,6 @@ end; {$ELSE} procedure g_Options_SetDefaultVideo; begin - {$WARNING stub} gScreenWidth := 640; gScreenHeight := 480; gBPP := 32;