Skip to content

Commit

Permalink
PlatformImage: Always create ARGB images from an int array
Browse files Browse the repository at this point in the history
Previously it created either ARGB or RGB based on the processAlpha
flag, and the alpha speedhack. However, this one is ALWAYS read as
ARGB, so creating it as RGB, even when "appropriate", will cause
issues, like in Asphalt 2's High-Speed Photo Shoots.
  • Loading branch information
AShiningRay committed Dec 23, 2024
1 parent e1e2164 commit e2e44ef
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/org/recompile/mobile/PlatformImage.java
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,7 @@ public PlatformImage(int[] rgb, int Width, int Height, boolean processAlpha)
if(width < 1) { width = 1; }
if(height < 1) { height = 1; }

/*
* We can also apply the alpha speedhack here too, assuming the game isn't trying to read
* from a non-alpha image (RGB) as ARGB anyway.
*/
if(!processAlpha && Mobile.noAlphaOnBlankImages) { canvas = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); }
else { canvas = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB); }
canvas = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);

createGraphics();

Expand Down

0 comments on commit e2e44ef

Please sign in to comment.