hedgewars/uMisc.pas
branchqmlfrontend
changeset 11408 b894922d58cc
parent 11071 3851ce4f2061
parent 11358 a91c4c4fd85c
child 11833 a69124eb7ce7
--- a/hedgewars/uMisc.pas	Tue Sep 08 19:20:58 2015 +0300
+++ b/hedgewars/uMisc.pas	Mon Nov 16 22:57:24 2015 +0300
@@ -30,11 +30,7 @@
 function  doSurfaceConversion(tmpsurf: PSDL_Surface): PSDL_Surface;
 function MakeScreenshot(filename: shortstring; k: LongInt; dump: LongWord): boolean;
 function  GetTeamStatString(p: PTeam): shortstring;
-{$IFDEF SDL2}
 function  SDL_RectMake(x, y, width, height: LongInt): TSDL_Rect; inline;
-{$ELSE}
-function  SDL_RectMake(x, y: SmallInt; width, height: Word): TSDL_Rect; inline;
-{$ENDIF}
 
 implementation
 uses SysUtils, uVariables, uUtils
@@ -304,7 +300,7 @@
 image^.size:= size;
 image^.buffer:= p;
 
-SDL_CreateThread(@SaveScreenshot{$IFDEF SDL2}, 'snapshot'{$ENDIF}, image);
+SDL_CreateThread(@SaveScreenshot, PChar('snapshot'), image);
 MakeScreenshot:= true; // possibly it is not true but we will not wait for thread to terminate
 end;
 
@@ -322,11 +318,7 @@
     end;
 end;
 
-{$IFDEF SDL2}
 function SDL_RectMake(x, y, width, height: LongInt): TSDL_Rect; inline;
-{$ELSE}
-function SDL_RectMake(x, y: SmallInt; width, height: Word): TSDL_Rect; inline;
-{$ENDIF}
 begin
     SDL_RectMake.x:= x;
     SDL_RectMake.y:= y;
@@ -341,32 +333,15 @@
     GetTeamStatString:= s;
 end;
 
-{$IFDEF SDL2}
-// FIXME - pretty sure this is not handling endianness correctly like the SDL1 is
+procedure initModule;
 const SDL_PIXELFORMAT_ABGR8888 = (1 shl 28) or (6 shl 24) or (7 shl 20) or (6 shl 16) or (32 shl 8) or 4;
-{$ELSE}
-const format: TSDL_PixelFormat = (
-        palette: nil; BitsPerPixel: 32; BytesPerPixel: 4;
-        Rloss: 0; Gloss: 0; Bloss: 0; Aloss: 0;
-        Rshift: RShift; Gshift: GShift; Bshift: BShift; Ashift: AShift;
-        RMask: RMask; GMask: GMask; BMask: BMask; AMask: AMask;
-        colorkey: 0; alpha: 255);
-{$ENDIF}
-
-procedure initModule;
 begin
-{$IFDEF SDL2}
     conversionFormat:= SDL_AllocFormat(SDL_PIXELFORMAT_ABGR8888);
-{$ELSE}
-    conversionFormat:= @format;
-{$ENDIF}
 end;
 
 procedure freeModule;
 begin
-{$IFDEF SDL2}
     SDL_FreeFormat(conversionFormat);
-{$ENDIF}
 end;
 
 end.