mirror of
https://github.com/ZDoom/Raze.git
synced 2025-06-04 11:11:04 +00:00
glsurface.h/.cpp: change how the palette is handled and fix tinting/fading
git-svn-id: https://svn.eduke32.com/eduke32@6932 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
a0faeaf8f6
commit
9e90b0633b
4 changed files with 24 additions and 32 deletions
|
@ -660,11 +660,7 @@ void paletteSetColorTable(int32_t id, uint8_t const * const table)
|
|||
Bmemcpy(basepaltable[id], table, 768);
|
||||
|
||||
#ifdef USE_OPENGL
|
||||
if (videoGetRenderMode() == REND_CLASSIC)
|
||||
{
|
||||
glsurface_setPalette(id, basepaltable[id]);
|
||||
}
|
||||
else if (videoGetRenderMode() >= REND_POLYMOST)
|
||||
if (videoGetRenderMode() >= REND_POLYMOST)
|
||||
{
|
||||
uploadbasepalette(id);
|
||||
}
|
||||
|
@ -746,6 +742,7 @@ void videoSetPalette(char dabrightness, uint8_t dapalid, uint8_t flags)
|
|||
|
||||
if (palsumdidchange || newpalettesum != g_lastpalettesum)
|
||||
{
|
||||
glsurface_setPalette(curpalettefaded);
|
||||
// if ((flags&1) == 0)
|
||||
videoUpdatePalette(0, 256);
|
||||
}
|
||||
|
@ -828,7 +825,10 @@ void videoFadePalette(uint8_t r, uint8_t g, uint8_t b, uint8_t offset)
|
|||
uint32_t newpalettesum = XXH32((uint8_t *) curpalettefaded, sizeof(curpalettefaded), sizeof(curpalettefaded));
|
||||
|
||||
if (newpalettesum != lastpalettesum || newpalettesum != g_lastpalettesum)
|
||||
{
|
||||
glsurface_setPalette(curpalettefaded);
|
||||
videoUpdatePalette(0, 256);
|
||||
}
|
||||
|
||||
g_lastpalettesum = lastpalettesum = newpalettesum;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue