mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-08 07:05:40 +12:00
[PICA] Add IA4 texture format
This commit is contained in:
parent
19c55b3967
commit
93ba95483b
1 changed files with 12 additions and 0 deletions
|
@ -136,6 +136,18 @@ u32 Texture::decodeTexel(u32 u, u32 v, Texture::Formats fmt, const void* data) {
|
||||||
return (alpha << 24) | (b << 16) | (g << 8) | r;
|
return (alpha << 24) | (b << 16) | (g << 8) | r;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case Formats::IA4: {
|
||||||
|
u32 offset = getSwizzledOffset(u, v, size.u(), 1);
|
||||||
|
auto ptr = static_cast<const u8*>(data);
|
||||||
|
|
||||||
|
const u8 texel = ptr[offset];
|
||||||
|
const u8 alpha = Colour::convert4To8Bit(texel & 0xf);
|
||||||
|
const u8 intensity = Colour::convert4To8Bit(texel >> 4);
|
||||||
|
|
||||||
|
// Intensity formats just copy the intensity value to every colour channel
|
||||||
|
return (alpha << 24) | (intensity << 16) | (intensity << 8) | intensity;
|
||||||
|
}
|
||||||
|
|
||||||
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