index 9f146dd5b9a9e6c85663cb90c21ecac6a0bdd7a4..a1f73934c7c901be5ae95760a0b7ccddcc8f4bb1 100644 (file)
{$I sdlpixels.inc}
{$I sdlscancode.inc}
- const
- DEFAULT_DEPTH = 8;
-
const
SDL_HAT_CENTERED = $00;
SDL_HAT_UP = $01;
var
sdl2allegro_screen: PBITMAP;
+ sdl2allegro_bpp: Integer;
/// FUNCTIONS ///
{$IFDEF GO32V2}
go32,
{$ENDIF}
- e_Log, SysUtils, ctypes;
+ e_Log, g_options, SysUtils, ctypes;
const
maxKeyBuffer = 64;
mode := GFX_AUTODETECT_WINDOWED;
{$ENDIF}
- set_color_depth(DEFAULT_DEPTH);
+ sdl2allegro_bpp := gBPP;
+ set_color_depth(sdl2allegro_bpp);
if set_gfx_mode(mode, w, h, 0, 0) = 0 then
begin
new(window);
mode := GFX_AUTODETECT_WINDOWED;
{$ENDIF}
- set_color_depth(DEFAULT_DEPTH);
+ set_color_depth(sdl2allegro_bpp);
if set_gfx_mode(mode, window.w, window.h, 0, 0) = 0 then
begin
if sdl2allegro_screen <> nil then
begin
e_LogWritefln('SDL_SetWindowSize %s %s', [w, h]);
if window = nil then exit;
- set_color_depth(DEFAULT_DEPTH);
+
+ set_color_depth(sdl2allegro_bpp);
if set_gfx_mode(window.mode, w, h, 0, 0) = 0 then
begin
if sdl2allegro_screen <> nil then