mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-01-11 18:50:46 +00:00
Generate editorcolors[] from vgapal16[] at a better point in the startup process
git-svn-id: https://svn.eduke32.com/eduke32@8490 1a8010ca-5511-0410-912e-c29ae57300e0 # Conflicts: # source/build/src/build.cpp # source/build/src/palette.cpp
This commit is contained in:
parent
221e7a6b85
commit
34ef03185d
3 changed files with 13 additions and 6 deletions
|
@ -618,6 +618,7 @@ EXTERN uint8_t gotpic[(MAXTILES+7)>>3];
|
|||
EXTERN char gotsector[(MAXSECTORS+7)>>3];
|
||||
|
||||
EXTERN char editorcolors[256];
|
||||
EXTERN char editorcolorsdef[256];
|
||||
|
||||
EXTERN char editwall[(MAXWALLS+7)>>3];
|
||||
|
||||
|
|
|
@ -467,7 +467,10 @@ static int32_t defsparser(scriptfile *script)
|
|||
if (scriptfile_getnumber(script,&idxend)) break;
|
||||
|
||||
while ((unsigned)col < 256 && idx <= idxend)
|
||||
{
|
||||
editorcolorsdef[col] = 1;
|
||||
editorcolors[col++] = idx++;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case T_FOGPAL:
|
||||
|
|
|
@ -358,12 +358,6 @@ void palettePostLoadTables(void)
|
|||
whitecol = paletteGetClosestColor(255, 255, 255);
|
||||
redcol = paletteGetClosestColor(255, 0, 0);
|
||||
|
||||
for (size_t i = 0; i<16; i++)
|
||||
{
|
||||
palette_t *edcol = (palette_t *) &vgapal16[4*i];
|
||||
editorcolors[i] = paletteGetClosestColorUpToIndex(edcol->b, edcol->g, edcol->r, playing_blood ? 254 : 239);
|
||||
}
|
||||
|
||||
// Bmemset(PaletteIndexFullbrights, 0, sizeof(PaletteIndexFullbrights));
|
||||
for (bssize_t c = 0; c < 255; ++c) // skipping transparent color
|
||||
{
|
||||
|
@ -400,6 +394,15 @@ void palettePostLoadTables(void)
|
|||
PostLoad_FoundShade: ;
|
||||
frealmaxshade = (float)(realmaxshade = s+1);
|
||||
}
|
||||
|
||||
for (size_t i = 0; i<256; i++)
|
||||
{
|
||||
if (editorcolorsdef[i])
|
||||
continue;
|
||||
|
||||
palette_t *edcol = (palette_t *) &vgapal16[4*i];
|
||||
editorcolors[i] = paletteGetClosestColorUpToIndex(edcol->b, edcol->g, edcol->r, 239);
|
||||
}
|
||||
}
|
||||
|
||||
void paletteFixTranslucencyMask(void)
|
||||
|
|
Loading…
Reference in a new issue