mirror of
https://github.com/nzp-team/dquakeplus.git
synced 2025-02-21 10:51:06 +00:00
Remove CLUT4 palette swapping
This commit is contained in:
parent
6085a20fc9
commit
c111883fde
2 changed files with 7 additions and 18 deletions
|
@ -110,7 +110,6 @@ void VID_InitPaleteLM()
|
||||||
}
|
}
|
||||||
|
|
||||||
qboolean last_palette_wasnt_tx;
|
qboolean last_palette_wasnt_tx;
|
||||||
qboolean last_palette_wasnt_clut4;
|
|
||||||
|
|
||||||
void VID_SetPaletteLM()
|
void VID_SetPaletteLM()
|
||||||
{
|
{
|
||||||
|
@ -120,7 +119,6 @@ void VID_SetPaletteLM()
|
||||||
sceGuClutLoad(palette_size / 8, d_8to24tableLM);
|
sceGuClutLoad(palette_size / 8, d_8to24tableLM);
|
||||||
reloaded_pallete = 1;
|
reloaded_pallete = 1;
|
||||||
last_palette_wasnt_tx = qtrue;
|
last_palette_wasnt_tx = qtrue;
|
||||||
last_palette_wasnt_clut4 = qtrue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VID_SetPaletteTX()
|
void VID_SetPaletteTX()
|
||||||
|
@ -131,7 +129,6 @@ void VID_SetPaletteTX()
|
||||||
sceGuClutLoad(palette_size / 8, d_8to24table);
|
sceGuClutLoad(palette_size / 8, d_8to24table);
|
||||||
reloaded_pallete = 1;
|
reloaded_pallete = 1;
|
||||||
last_palette_wasnt_tx = qfalse;
|
last_palette_wasnt_tx = qfalse;
|
||||||
last_palette_wasnt_clut4 = qtrue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VID_SetPalette4(unsigned char* clut4pal) {
|
void VID_SetPalette4(unsigned char* clut4pal) {
|
||||||
|
@ -139,7 +136,6 @@ void VID_SetPalette4(unsigned char* clut4pal) {
|
||||||
sceKernelDcacheWritebackRange(clut4pal, sizeof(clut4pal));
|
sceKernelDcacheWritebackRange(clut4pal, sizeof(clut4pal));
|
||||||
sceGuClutLoad(2, clut4pal);
|
sceGuClutLoad(2, clut4pal);
|
||||||
last_palette_wasnt_tx = qtrue;
|
last_palette_wasnt_tx = qtrue;
|
||||||
last_palette_wasnt_clut4 = qfalse;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VID_SetPalette(unsigned char* palette)
|
void VID_SetPalette(unsigned char* palette)
|
||||||
|
@ -163,7 +159,6 @@ void VID_SetPalette(unsigned char* palette)
|
||||||
sceGuClutLoad(palette_size / 8, d_8to24table);
|
sceGuClutLoad(palette_size / 8, d_8to24table);
|
||||||
reloaded_pallete = 1;
|
reloaded_pallete = 1;
|
||||||
last_palette_wasnt_tx = qtrue;
|
last_palette_wasnt_tx = qtrue;
|
||||||
last_palette_wasnt_clut4 = qtrue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void VID_ShiftPalette(unsigned char* palette)
|
void VID_ShiftPalette(unsigned char* palette)
|
||||||
|
|
|
@ -190,7 +190,6 @@ void GL_Copy(int texture_index, int dx, int dy, int sx, int sy, int w, int h)
|
||||||
|
|
||||||
void VID_SetPaletteTX();
|
void VID_SetPaletteTX();
|
||||||
extern qboolean last_palette_wasnt_tx;
|
extern qboolean last_palette_wasnt_tx;
|
||||||
extern qboolean last_palette_wasnt_clut4;
|
|
||||||
void GL_Bind (int texture_index)
|
void GL_Bind (int texture_index)
|
||||||
{
|
{
|
||||||
// Binding the currently bound texture?
|
// Binding the currently bound texture?
|
||||||
|
@ -206,18 +205,13 @@ void GL_Bind (int texture_index)
|
||||||
// Which texture is it?
|
// Which texture is it?
|
||||||
const gltexture_t& texture = gltextures[texture_index];
|
const gltexture_t& texture = gltextures[texture_index];
|
||||||
|
|
||||||
// Set the palette (for CLUT4)
|
|
||||||
if (texture.format == GU_PSM_T4) {
|
// HACK HACK HACK: avoid setting this all the time
|
||||||
VID_SetPalette4(texture.palette);
|
if (last_palette_wasnt_tx == qtrue)
|
||||||
vid_palmode = GU_PSM_T4;
|
VID_SetPaletteTX();
|
||||||
sceGuTexMode(texture.format, texture.mipmaps , 0, GU_TRUE);
|
|
||||||
} else {
|
vid_palmode = GU_PSM_T8;
|
||||||
// HACK HACK HACK: avoid setting this all the time
|
sceGuTexMode(texture.format, texture.mipmaps , 0, texture.swizzle);
|
||||||
if (last_palette_wasnt_tx == qtrue)
|
|
||||||
VID_SetPaletteTX();
|
|
||||||
vid_palmode = GU_PSM_T8;
|
|
||||||
sceGuTexMode(texture.format, texture.mipmaps , 0, texture.swizzle);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Set the Texture filter.
|
// Set the Texture filter.
|
||||||
if (r_retro.value)
|
if (r_retro.value)
|
||||||
|
|
Loading…
Reference in a new issue