[PICA] Add A8 textures

This commit is contained in:
wheremyfoodat 2023-03-02 23:19:03 +02:00
parent 0cd3f581d3
commit c02cf794fe

View file

@ -147,6 +147,15 @@ u32 Texture::decodeTexel(u32 u, u32 v, Texture::Formats fmt, const void* data) {
return (alpha << 24) | (intensity << 16) | (intensity << 8) | intensity;
}
case Formats::A8: {
u32 offset = getSwizzledOffset(u, v, size.u(), 1);
auto ptr = static_cast<const u8*>(data);
const u8 alpha = ptr[offset];
// A8 sets RGB to 0
return (alpha << 24) | (0 << 16) | (0 << 8) | 0;
}
case Formats::I8: {
u32 offset = getSwizzledOffset(u, v, size.u(), 1);
auto ptr = static_cast<const u8*>(data);