X-Git-Url: http://deadsoftware.ru/gitweb?p=d2df-sdl.git;a=blobdiff_plain;f=src%2Fgame%2Fg_options.pas;h=f889ea36e6e63f42154783ab7de5d3ae21145ad4;hp=ac80a1b1f786cd8d11f7356510ca1c743b344b6a;hb=4171d8dd0b8d733da27c584616e431811bf0fdcf;hpb=dbf81afaefeb52e53d2b8af3a782277229c5adaa diff --git a/src/game/g_options.pas b/src/game/g_options.pas index ac80a1b..f889ea3 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;