Also add a hack for VID_SetPalette4()

This commit is contained in:
Steam Deck User 2023-03-15 19:29:02 -04:00
parent 9827c6667b
commit b35cf6969d
2 changed files with 9 additions and 1 deletions

View file

@ -110,6 +110,7 @@ void VID_InitPaleteLM()
}
qboolean last_palette_wasnt_tx;
qboolean last_palette_wasnt_clut4;
void VID_SetPaletteLM()
{
@ -119,6 +120,7 @@ void VID_SetPaletteLM()
sceGuClutLoad(palette_size / 8, d_8to24tableLM);
reloaded_pallete = 1;
last_palette_wasnt_tx = qtrue;
last_palette_wasnt_clut4 = qtrue;
}
void VID_SetPaletteTX()
@ -129,6 +131,7 @@ void VID_SetPaletteTX()
sceGuClutLoad(palette_size / 8, d_8to24table);
reloaded_pallete = 1;
last_palette_wasnt_tx = qfalse;
last_palette_wasnt_clut4 = qtrue;
}
void VID_SetPalette4(unsigned char* clut4pal) {
@ -136,6 +139,7 @@ void VID_SetPalette4(unsigned char* clut4pal) {
sceKernelDcacheWritebackRange(clut4pal, sizeof(clut4pal));
sceGuClutLoad(2, clut4pal);
last_palette_wasnt_tx = qtrue;
last_palette_wasnt_clut4 = qfalse;
}
void VID_SetPalette(unsigned char* palette)
@ -159,6 +163,7 @@ void VID_SetPalette(unsigned char* palette)
sceGuClutLoad(palette_size / 8, d_8to24table);
reloaded_pallete = 1;
last_palette_wasnt_tx = qtrue;
last_palette_wasnt_clut4 = qtrue;
}
void VID_ShiftPalette(unsigned char* palette)

View file

@ -190,6 +190,7 @@ void GL_Copy(int texture_index, int dx, int dy, int sx, int sy, int w, int h)
void VID_SetPaletteTX();
extern qboolean last_palette_wasnt_tx;
extern qboolean last_palette_wasnt_clut4;
void GL_Bind (int texture_index)
{
// Binding the currently bound texture?
@ -207,7 +208,9 @@ void GL_Bind (int texture_index)
// Set the palette (for CLUT4)
if (texture.format == GU_PSM_T4) {
VID_SetPalette4(texture.palette);
// HACK HACK HACK: avoid setting this all the time
if (last_palette_wasnt_clut4 == qtrue)
VID_SetPalette4(texture.palette);
vid_palmode = GU_PSM_T4;
} else {
// HACK HACK HACK: avoid setting this all the time