Skip to content

Commit

Permalink
Merge pull request #1974 from Sierraffinity/gbagfx-fix
Browse files Browse the repository at this point in the history
gbagfx bit depth upconversion fix
  • Loading branch information
GriffinRichards authored Jan 27, 2024
2 parents bcd5fc1 + e85750b commit 5e47049
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/gbagfx/convert_png.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ static unsigned char *ConvertBitDepth(unsigned char *src, int srcBitDepth, int d

for (j = 8 - srcBitDepth; j >= 0; j -= srcBitDepth)
{
unsigned char pixel = (srcByte >> j) % (1 << destBitDepth);
unsigned char pixel = ((srcByte >> j) % (1 << srcBitDepth)) % (1 << destBitDepth);
*dest |= pixel << destBit;
destBit -= destBitDepth;
if (destBit < 0)
Expand Down

0 comments on commit 5e47049

Please sign in to comment.