hedgewars/uStore.pas
changeset 2581 10f03732ea60
parent 2580 aeccc8f51d3f
child 2582 e16668bac20f
equal deleted inserted replaced
2580:aeccc8f51d3f 2581:10f03732ea60
   941 		OutError(msgFailedSize, (imageFlags and ifCritical) <> 0);
   941 		OutError(msgFailedSize, (imageFlags and ifCritical) <> 0);
   942 		//dummy surface to replace non-critical textures that failed to load due to their size
   942 		//dummy surface to replace non-critical textures that failed to load due to their size
   943 		exit(SDL_CreateRGBSurface(SDL_SWSURFACE, 32, 32, 32, RMask, GMask, BMask, AMask));
   943 		exit(SDL_CreateRGBSurface(SDL_SWSURFACE, 32, 32, 32, RMask, GMask, BMask, AMask));
   944 	end;
   944 	end;
   945 
   945 
   946 {$IFDEF DARWIN}
       
   947 //for more information http://www.idevgames.com/forum/showpost.php?p=85864&postcount=7
   946 //for more information http://www.idevgames.com/forum/showpost.php?p=85864&postcount=7
   948 if (tmpsurf^.format^.bitsperpixel = 24) or ((tmpsurf^.format^.bitsperpixel = 32) and (tmpsurf^.format^.rshift > tmpsurf^.format^.bshift)) then
   947 if (tmpsurf^.format^.bitsperpixel = 24) or ((tmpsurf^.format^.bitsperpixel = 32) and (tmpsurf^.format^.rshift > tmpsurf^.format^.bshift)) then
   949 begin
   948 begin
   950 	convertedSurf:= SDL_ConvertSurface(tmpsurf, @convFormat, SDL_SWSURFACE);
   949 	convertedSurf:= SDL_ConvertSurface(tmpsurf, @convFormat, SDL_SWSURFACE);
   951 	SDL_FreeSurface(tmpsurf);	
   950 	SDL_FreeSurface(tmpsurf);	
   952 	tmpsurf:= convertedSurf;
   951 	tmpsurf:= convertedSurf;
   953 end;
   952 end;
   954 {$ENDIF}
       
   955 
   953 
   956 if (imageFlags and ifTransparent) <> 0 then TryDo(SDL_SetColorKey(tmpsurf, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true);
   954 if (imageFlags and ifTransparent) <> 0 then TryDo(SDL_SetColorKey(tmpsurf, SDL_SRCCOLORKEY, 0) = 0, errmsgTransparentSet, true);
   957 //if (imageFlags and ifAlpha) <> 0 then Result:= SDL_DisplayFormatAlpha(tmpsurf) else Result:= SDL_DisplayFormat(tmpsurf);
   955 //if (imageFlags and ifAlpha) <> 0 then Result:= SDL_DisplayFormatAlpha(tmpsurf) else Result:= SDL_DisplayFormat(tmpsurf);
   958 WriteLnToConsole('(' + inttostr(tmpsurf^.w) + ',' + inttostr(tmpsurf^.h) + ') ');
   956 WriteLnToConsole('(' + inttostr(tmpsurf^.w) + ',' + inttostr(tmpsurf^.h) + ') ');
   959 WriteLnToConsole(msgOK);
   957 WriteLnToConsole(msgOK);