DEADSOFTWARE

Android: fix bad screen size when config not found
[d2df-sdl.git] / src / game / g_options.pas
index 54acb699e1be8cecfc7e402a00589f8895e1d97b..493e07cb48c9475bd4043c04ddbc253a1756cf3b 100644 (file)
@@ -134,11 +134,7 @@ var
 implementation
 
 uses
-{$IFDEF USE_NANOGL}
-  nanoGL,
-{$ELSE}
-  GL, GLExt,
-{$ENDIF}
+  {$INCLUDE ../nogl/noGLuses.inc}
   e_log, e_input, g_window, g_sound, g_gfx, g_player, Math,
   g_map, g_net, g_netmaster, SysUtils, CONFIG, g_game, g_main, e_texture,
   g_items, wadreader, e_graphics, g_touch, SDL2;
@@ -146,12 +142,12 @@ uses
 procedure g_Options_SetDefaultVideo;
 {$IF DEFINED(ANDROID)}
 var
-  display: PSDL_DisplayMode;
+  display: TSDL_DisplayMode;
 {$ENDIF}
 begin
   {$IF DEFINED(ANDROID)}
     (* On android set max screen size *)
-    SDL_GetCurrentDisplayMode(0, display);
+    SDL_GetCurrentDisplayMode(0, @display);
     gScreenWidth := display.w;
     gScreenHeight := display.h;
     gWinRealPosX := 0;
@@ -175,6 +171,7 @@ begin
     gTextureFilter := True;
     glLegacyNPOT := False;
   {$ENDIF}
+  e_LogWriteLn('g_Options_SetDefaultVideo: w = ' + IntToStr(gScreenWidth) + ' h = ' + IntToStr(gScreenHeight));
 end;
 
 procedure g_Options_SetDefault();