Skip to content

Commit

Permalink
PlatformImage: Take canvas' width into account on getRGB()
Browse files Browse the repository at this point in the history
Serves me right for swapping WritableRasters for dataBuffers
without double-checking if the actual data copy needs any further
adjustments. Fixes smoke in Asphalt 4's SE K800i version, and
probably quite a few others games that rely on this function.
  • Loading branch information
AShiningRay committed Dec 7, 2024
1 parent d2e2ffb commit 4434f67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/org/recompile/mobile/PlatformImage.java
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ public void getRGB(int[] rgbData, int offset, int scanlength, int x, int y, int
// Copy the data into rgbData, taking scanlength into account
for (int row = 0; row < height; row++)
{
int sourceIndex = row * width;
int sourceIndex = (y + row) * canvas.getWidth() + x;
int destIndex = offset + row * scanlength;

System.arraycopy(tempData, sourceIndex, rgbData, destIndex, width);
Expand Down

0 comments on commit 4434f67

Please sign in to comment.