Merge branch 'ogl-color-fix3' into 'master'

Ogl colormap fix third attempt

See merge request KartKrew/Kart-Public!184
This commit is contained in:
Sal 2020-07-01 18:36:19 -04:00
commit d2098c23fc

View file

@ -1494,17 +1494,16 @@ static void P_LoadRawSideDefs2(void *data)
color.s.red = (HEX2INT(col[1]) << 4) + HEX2INT(col[2]); color.s.red = (HEX2INT(col[1]) << 4) + HEX2INT(col[2]);
color.s.green = (HEX2INT(col[3]) << 4) + HEX2INT(col[4]); color.s.green = (HEX2INT(col[3]) << 4) + HEX2INT(col[4]);
color.s.blue = (HEX2INT(col[5]) << 4) + HEX2INT(col[6]); color.s.blue = (HEX2INT(col[5]) << 4) + HEX2INT(col[6]);
color.s.alpha = 0;
#ifdef GLENCORE #ifdef GLENCORE
if (encoremap) if (encoremap)
{ {
j = encoremap[NearestColor(color.s.red, color.s.green, color.s.blue)]; j = encoremap[NearestColor(color.s.red, color.s.green, color.s.blue)];
//CONS_Printf("R_CreateColormap: encoremap[%d] = %d\n", j, encoremap[j]); -- moved encoremap upwards for optimisation //CONS_Printf("R_CreateColormap: encoremap[%d] = %d\n", j, encoremap[j]); -- moved encoremap upwards for optimisation
color = pLocalPalette[j]; color = pLocalPalette[j]; // note: this sets alpha to 255, we will reset it below
} }
#endif #endif
color.s.alpha = 0; // reset/init the alpha, so the addition below will work correctly
sec->extra_colormap->rgba = color.rgba; sec->extra_colormap->rgba = color.rgba;
// alpha // alpha
@ -1536,17 +1535,16 @@ static void P_LoadRawSideDefs2(void *data)
color.s.red = (HEX2INT(col[1]) << 4) + HEX2INT(col[2]); color.s.red = (HEX2INT(col[1]) << 4) + HEX2INT(col[2]);
color.s.green = (HEX2INT(col[3]) << 4) + HEX2INT(col[4]); color.s.green = (HEX2INT(col[3]) << 4) + HEX2INT(col[4]);
color.s.blue = (HEX2INT(col[5]) << 4) + HEX2INT(col[6]); color.s.blue = (HEX2INT(col[5]) << 4) + HEX2INT(col[6]);
color.s.alpha = 0;
#ifdef GLENCORE #ifdef GLENCORE
if (encoremap) if (encoremap)
{ {
j = encoremap[NearestColor(color.s.red, color.s.green, color.s.blue)]; j = encoremap[NearestColor(color.s.red, color.s.green, color.s.blue)];
//CONS_Printf("R_CreateColormap: encoremap[%d] = %d\n", j, encoremap[j]); -- moved encoremap upwards for optimisation //CONS_Printf("R_CreateColormap: encoremap[%d] = %d\n", j, encoremap[j]); -- moved encoremap upwards for optimisation
color = pLocalPalette[j]; color = pLocalPalette[j]; // note: this sets alpha to 255, we will reset it below
} }
#endif #endif
color.s.alpha = 0; // reset/init the alpha, so the addition below will work correctly
sec->extra_colormap->fadergba = color.rgba; sec->extra_colormap->fadergba = color.rgba;
// alpha // alpha