Skip to content

Commit

Permalink
Fix RGB5A3 Alpha Decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
gamemasterplc authored Feb 20, 2021
1 parent 88099b7 commit e5a2a6d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions texdecode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static void WriteRGB5A3Pixel(uint8_t *dst, int16_t w, int16_t x, int16_t y, uint
r = color_4_to_8[(value >> 8) & 0xF];
g = color_4_to_8[(value >> 4) & 0xF];
b = color_4_to_8[value & 0xF];
a = color_4_to_8[(value >> 12) & 0x7];
a = color_3_to_8[(value >> 12) & 0x7];
}
dst[(((y * w) + x) * 4) + 0] = r;
dst[(((y * w) + x) * 4) + 1] = g;
Expand Down Expand Up @@ -300,4 +300,4 @@ uint8_t *DecodeTexture(uint8_t *data, uint8_t *pal_data, int16_t w, int16_t h, u
PrintError("Texture format %d unimplemented.", format);
return nullptr;
}
}
}

0 comments on commit e5a2a6d

Please sign in to comment.