only do this when were running the palette shader

This commit is contained in:
alufolie91 committed 2023-09-12 17:07:19 +02:00
1 parent 5bf722a1fb
commit e2acb4c3fc
1 file changed
+20 -18
+20 -18
View File
@@ -470,27 +470,30 @@ void HWR_Lighting(FSurfaceInfo *Surface, INT32 light_level, extracolormap_t *col
Surface->LightInfo.fade_start = (colormap != NULL) ? colormap->fadestart : 0;
Surface->LightInfo.fade_end = (colormap != NULL) ? colormap->fadeend : 31;
if (!colormap)
if (gr_use_palette_shader)
{
colormap = &extra_colormaps[num_extra_colormaps];
default_colormap = true;
}
if (!colormap->gl_lighttable_id)
if (!colormap)
{
UINT8 *colormap_pointer;
if (default_colormap)
{
colormap_pointer = colormaps;
colormap = &extra_colormaps[num_extra_colormaps];
default_colormap = true;
}
else
{
colormap_pointer = colormap->colormap;
}
colormap->gl_lighttable_id = HWD.pfnAddLightTable(colormap_pointer);
}
if (!colormap->gl_lighttable_id)
{
UINT8 *colormap_pointer;
Surface->LightTableId = colormap->gl_lighttable_id;
if (default_colormap)
{
colormap_pointer = colormaps;
}
else
{
colormap_pointer = colormap->colormap;
}
colormap->gl_lighttable_id = HWD.pfnAddLightTable(colormap_pointer);
}
Surface->LightTableId = colormap->gl_lighttable_id;
}
}
void HWR_ClearLightTableCache()
@@ -6118,7 +6121,6 @@ void HWR_Startup(void)
}
}
// --------------------------------------------------------------------------
// Free resources allocated by the hardware renderer
// --------------------------------------------------------------------------