Merge pull request #4657 from lioncash/color
ColorUtil: Make decodeCI8image's pal parameter const
This commit is contained in:
commit
c8a054d234
|
@ -58,7 +58,7 @@ void decode5A3image(u32* dst, const u16* src, int width, int height)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void decodeCI8image(u32* dst, const u8* src, u16* pal, int width, int height)
|
void decodeCI8image(u32* dst, const u8* src, const u16* pal, int width, int height)
|
||||||
{
|
{
|
||||||
for (int y = 0; y < height; y += 4)
|
for (int y = 0; y < height; y += 4)
|
||||||
{
|
{
|
||||||
|
|
|
@ -9,6 +9,6 @@
|
||||||
namespace ColorUtil
|
namespace ColorUtil
|
||||||
{
|
{
|
||||||
void decode5A3image(u32* dst, const u16* src, int width, int height);
|
void decode5A3image(u32* dst, const u16* src, int width, int height);
|
||||||
void decodeCI8image(u32* dst, const u8* src, u16* pal, int width, int height);
|
void decodeCI8image(u32* dst, const u8* src, const u16* pal, int width, int height);
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
|
@ -1160,8 +1160,7 @@ u32 GCMemcard::ReadAnimRGBA8(u8 index, u32* buffer, u8* delays) const
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
u16* sharedPal = (u16*)(animData);
|
const u16* sharedPal = reinterpret_cast<u16*>(animData);
|
||||||
int j = 0;
|
|
||||||
|
|
||||||
for (int i = 0; i < 8; i++)
|
for (int i = 0; i < 8; i++)
|
||||||
{
|
{
|
||||||
|
@ -1183,7 +1182,7 @@ u32 GCMemcard::ReadAnimRGBA8(u8 index, u32* buffer, u8* delays) const
|
||||||
buffer += 32 * 32;
|
buffer += 32 * 32;
|
||||||
break;
|
break;
|
||||||
case CI8: // CI8 with own palette
|
case CI8: // CI8 with own palette
|
||||||
u16* paldata = (u16*)(data[i] + 32 * 32);
|
const u16* paldata = reinterpret_cast<u16*>(data[i] + 32 * 32);
|
||||||
ColorUtil::decodeCI8image(buffer, data[i], paldata, 32, 32);
|
ColorUtil::decodeCI8image(buffer, data[i], paldata, 32, 32);
|
||||||
buffer += 32 * 32;
|
buffer += 32 * 32;
|
||||||
break;
|
break;
|
||||||
|
@ -1194,7 +1193,7 @@ u32 GCMemcard::ReadAnimRGBA8(u8 index, u32* buffer, u8* delays) const
|
||||||
// Speed is set but there's no actual icon
|
// Speed is set but there's no actual icon
|
||||||
// This is used to reduce animation speed in Pikmin and Luigi's Mansion for example
|
// This is used to reduce animation speed in Pikmin and Luigi's Mansion for example
|
||||||
// These "blank frames" show the next icon
|
// These "blank frames" show the next icon
|
||||||
for (j = i; j < 8; ++j)
|
for (int j = i; j < 8; ++j)
|
||||||
{
|
{
|
||||||
if (fmts[j] != 0)
|
if (fmts[j] != 0)
|
||||||
{
|
{
|
||||||
|
@ -1208,7 +1207,7 @@ u32 GCMemcard::ReadAnimRGBA8(u8 index, u32* buffer, u8* delays) const
|
||||||
buffer += 32 * 32;
|
buffer += 32 * 32;
|
||||||
break;
|
break;
|
||||||
case CI8: // CI8 with own palette
|
case CI8: // CI8 with own palette
|
||||||
u16* paldata = (u16*)(data[j] + 32 * 32);
|
const u16* paldata = reinterpret_cast<u16*>(data[j] + 32 * 32);
|
||||||
ColorUtil::decodeCI8image(buffer, data[j], paldata, 32, 32);
|
ColorUtil::decodeCI8image(buffer, data[j], paldata, 32, 32);
|
||||||
buffer += 32 * 32;
|
buffer += 32 * 32;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue