mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-12 09:09:47 +12:00
[PICA] Add A8 textures
This commit is contained in:
parent
0cd3f581d3
commit
c02cf794fe
1 changed files with 9 additions and 0 deletions
|
@ -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;
|
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: {
|
case Formats::I8: {
|
||||||
u32 offset = getSwizzledOffset(u, v, size.u(), 1);
|
u32 offset = getSwizzledOffset(u, v, size.u(), 1);
|
||||||
auto ptr = static_cast<const u8*>(data);
|
auto ptr = static_cast<const u8*>(data);
|
||||||
|
|
Loading…
Add table
Reference in a new issue