hedgewars/uMisc.pas
changeset 4578 f3cf226fad16
parent 4413 46caab3a8f84
child 4812 f924be23ffb4
equal deleted inserted replaced
4576:d85062310790 4578:f3cf226fad16
   120 function doSurfaceConversion(tmpsurf: PSDL_Surface): PSDL_Surface;
   120 function doSurfaceConversion(tmpsurf: PSDL_Surface): PSDL_Surface;
   121 {* for more information http://www.idevgames.com/forum/showpost.php?p=85864&postcount=7 *}
   121 {* for more information http://www.idevgames.com/forum/showpost.php?p=85864&postcount=7 *}
   122 var convertedSurf: PSDL_Surface = nil;
   122 var convertedSurf: PSDL_Surface = nil;
   123 begin
   123 begin
   124     if (tmpsurf^.format^.bitsperpixel = 24) or ((tmpsurf^.format^.bitsperpixel = 32) and (tmpsurf^.format^.rshift > tmpsurf^.format^.bshift)) then
   124     if (tmpsurf^.format^.bitsperpixel = 24) or ((tmpsurf^.format^.bitsperpixel = 32) and (tmpsurf^.format^.rshift > tmpsurf^.format^.bshift)) then
   125     begin
   125         begin
   126         convertedSurf:= SDL_ConvertSurface(tmpsurf, @conversionFormat, SDL_SWSURFACE);
   126         convertedSurf:= SDL_ConvertSurface(tmpsurf, @conversionFormat, SDL_SWSURFACE);
   127         SDL_FreeSurface(tmpsurf);
   127         SDL_FreeSurface(tmpsurf);
   128         exit(convertedSurf);
   128         exit(convertedSurf);
   129     end;
   129         end;
   130 
   130 
   131     exit(tmpsurf);
   131     exit(tmpsurf);
   132 end;
   132 end;
   133 
   133 
   134 
   134