hedgewars/uMisc.pas
changeset 7049 35d762458d66
parent 7043 7c080e5ac8d0
child 7306 3cff5c769509
equal deleted inserted replaced
7048:0a4c88935902 7049:35d762458d66
    46          buffer: PByte;
    46          buffer: PByte;
    47          filename: shortstring;
    47          filename: shortstring;
    48          width, height: LongInt;
    48          width, height: LongInt;
    49          size: QWord;
    49          size: QWord;
    50          end;
    50          end;
       
    51 
       
    52 var conversionFormat: PSDL_PixelFormat;
    51 
    53 
    52 procedure movecursor(dx, dy: LongInt);
    54 procedure movecursor(dx, dy: LongInt);
    53 var x, y: LongInt;
    55 var x, y: LongInt;
    54 begin
    56 begin
    55 if (dx = 0) and (dy = 0) then exit;
    57 if (dx = 0) and (dy = 0) then exit;
   240 var convertedSurf: PSDL_Surface;
   242 var convertedSurf: PSDL_Surface;
   241 begin
   243 begin
   242     doSurfaceConversion:= tmpsurf;
   244     doSurfaceConversion:= tmpsurf;
   243     if ((tmpsurf^.format^.bitsperpixel = 32) and (tmpsurf^.format^.rshift > tmpsurf^.format^.bshift)) or
   245     if ((tmpsurf^.format^.bitsperpixel = 32) and (tmpsurf^.format^.rshift > tmpsurf^.format^.bshift)) or
   244        (tmpsurf^.format^.bitsperpixel = 24) then
   246        (tmpsurf^.format^.bitsperpixel = 24) then
   245         begin
   247     begin
   246         convertedSurf:= SDL_ConvertSurface(tmpsurf, conversionFormat, SDL_SWSURFACE);
   248         convertedSurf:= SDL_ConvertSurface(tmpsurf, conversionFormat, SDL_SWSURFACE);
   247         SDL_FreeSurface(tmpsurf);
   249         SDL_FreeSurface(tmpsurf);
   248         doSurfaceConversion:= convertedSurf;
   250         doSurfaceConversion:= convertedSurf;
   249         end;
   251     end;
   250 end;
   252 end;
   251 
   253 
   252 {$IFDEF SDL13}
   254 {$IFDEF SDL13}
   253 function SDL_RectMake(x, y, width, height: LongInt): TSDL_Rect; inline;
   255 function SDL_RectMake(x, y, width, height: LongInt): TSDL_Rect; inline;
   254 {$ELSE}
   256 {$ELSE}