From 7db49ea20acb17a1d36d0dc09f21e4b2501f17b0 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 23 Dec 2019 07:03:36 +0000 Subject: [PATCH 1/6] Change PaletteIndexFullbrights from uint32_t[8] to uint8_t[32] git-svn-id: https://svn.eduke32.com/eduke32@8487 1a8010ca-5511-0410-912e-c29ae57300e0 # Conflicts: # source/build/include/palette.h --- source/build/include/palette.h | 7 ++++--- source/build/src/palette.cpp | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/source/build/include/palette.h b/source/build/include/palette.h index d8b6f0c21..b92140a3a 100644 --- a/source/build/include/palette.h +++ b/source/build/include/palette.h @@ -28,16 +28,17 @@ extern uint8_t curbasepal; #define paletteGetBlendTable(blend) (blendtable[blend]) -extern uint32_t PaletteIndexFullbrights[8]; +extern uint8_t PaletteIndexFullbrights[32]; + inline bool IsPaletteIndexFullbright(uint8_t col) { - return (PaletteIndexFullbrights[col >> 5] & (1u << (col & 31))); + return (PaletteIndexFullbrights[col >> 3] & (1u << (col & 7))); } inline void SetPaletteIndexFullbright(int col) { - PaletteIndexFullbrights[col >> 5] |= (1u << (col & 31)); + PaletteIndexFullbrights[col >> 3] |= (1u << (col & 7)); } struct palette_t diff --git a/source/build/src/palette.cpp b/source/build/src/palette.cpp index 569ffef40..d719f4811 100644 --- a/source/build/src/palette.cpp +++ b/source/build/src/palette.cpp @@ -335,7 +335,7 @@ void paletteLoadFromDisk(void) } } -uint32_t PaletteIndexFullbrights[8]; +uint8_t PaletteIndexFullbrights[32]; void palettePostLoadTables(void) { From 0a7f5f558a1a8cd0ec794bde3e6e319077dcb20e Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 23 Dec 2019 07:03:42 +0000 Subject: [PATCH 2/6] Rename colmatch functions git-svn-id: https://svn.eduke32.com/eduke32@8488 1a8010ca-5511-0410-912e-c29ae57300e0 # Conflicts: # source/build/include/colmatch.h # source/build/src/build.cpp # source/build/src/defs.cpp # source/build/src/palette.cpp # source/duke3d/src/lunatic/dynsymlist_editor.lds # source/duke3d/src/lunatic/dynsymlist_game.lds # source/duke3d/src/lunatic/engine.lua # source/tools/src/transpal.cpp --- source/build/include/colmatch.h | 14 ++++----- source/build/src/colmatch.cpp | 50 ++++++++++++++++----------------- source/build/src/defs.cpp | 2 +- source/build/src/palette.cpp | 8 +++--- source/duke3d/src/gameexec.cpp | 2 +- 5 files changed, 38 insertions(+), 38 deletions(-) diff --git a/source/build/include/colmatch.h b/source/build/include/colmatch.h index 751ba1a68..f0ab75529 100644 --- a/source/build/include/colmatch.h +++ b/source/build/include/colmatch.h @@ -1,15 +1,15 @@ #include "compat.h" -extern void initfastcolorlookup_scale(int32_t rscale, int32_t gscale, int32_t bscale); -extern void initfastcolorlookup_palette(uint8_t const * pal) ATTRIBUTE((nonnull(1))); -extern void initfastcolorlookup_gridvectors(void); +extern void paletteInitClosestColorScale(int32_t rscale, int32_t gscale, int32_t bscale); +extern void paletteInitClosestColorMap(uint8_t const * pal) ATTRIBUTE((nonnull(1))); +extern void paletteInitClosestColorGrid(void); -extern int32_t getclosestcol_lim(int32_t r, int32_t g, int32_t b, int32_t lastokcol); -extern int32_t getclosestcol_nocache_lim(int32_t r, int32_t g, int32_t b, int32_t lastokcol); -extern void getclosestcol_flush(void); +extern int32_t paletteGetClosestColorUpToIndex(int32_t r, int32_t g, int32_t b, int32_t lastokcol); +extern int32_t paletteGetClosestColorUpToIndexNoCache(int32_t r, int32_t g, int32_t b, int32_t lastokcol); +extern void paletteFlushClosestColor(void); static FORCE_INLINE int32_t paletteGetClosestColor(int32_t r, int32_t g, int32_t b) { - return getclosestcol_lim(r, g, b, 255); + return paletteGetClosestColorUpToIndex(r, g, b, 255); } diff --git a/source/build/src/colmatch.cpp b/source/build/src/colmatch.cpp index d6c40feeb..89f4c2b50 100644 --- a/source/build/src/colmatch.cpp +++ b/source/build/src/colmatch.cpp @@ -19,9 +19,9 @@ static uint8_t const * colmatch_palette; #define pow2char(x) (1u << (x)) // -// initfastcolorlookup +// paletteInitClosestColor // -void initfastcolorlookup_scale(int32_t rscale, int32_t gscale, int32_t bscale) +void paletteInitClosestColorScale(int32_t rscale, int32_t gscale, int32_t bscale) { int32_t j = 0; for (bssize_t i=256; i>=0; i--) @@ -33,7 +33,7 @@ void initfastcolorlookup_scale(int32_t rscale, int32_t gscale, int32_t bscale) j += FASTPALRGBDIST-(i<<1); } } -void initfastcolorlookup_palette(uint8_t const * const pal) +void paletteInitClosestColorMap(uint8_t const * const pal) { Bmemset(colhere,0,sizeof(colhere)); Bmemset(colhead,0,sizeof(colhead)); @@ -51,9 +51,9 @@ void initfastcolorlookup_palette(uint8_t const * const pal) colhere[j>>3] |= pow2char(j&7); } - getclosestcol_flush(); + paletteFlushClosestColor(); } -void initfastcolorlookup_gridvectors(void) +void paletteInitClosestColorGrid(void) { int i = 0; int32_t x, y, z; @@ -71,18 +71,18 @@ void initfastcolorlookup_gridvectors(void) #define COLRESULTSIZ 4096 -static uint32_t getclosestcol_results[COLRESULTSIZ]; -static int32_t numclosestcolresults; +static uint32_t colmatchresults[COLRESULTSIZ]; +static int32_t numcolmatchresults; -void getclosestcol_flush(void) +void paletteFlushClosestColor(void) { - Bmemset(getclosestcol_results, 0, COLRESULTSIZ * sizeof(uint32_t)); - numclosestcolresults = 0; + Bmemset(colmatchresults, 0, COLRESULTSIZ * sizeof(uint32_t)); + numcolmatchresults = 0; } // Finds a color index in [0 .. lastokcol] closest to (r, g, b). // must be in [0 .. 255]. -int32_t getclosestcol_lim(int32_t const r, int32_t const g, int32_t const b, int32_t const lastokcol) +int32_t paletteGetClosestColorUpToIndex(int32_t const r, int32_t const g, int32_t const b, int32_t const lastokcol) { #ifdef DEBUGGINGAIDS Bassert(lastokcol >= 0 && lastokcol <= 255); @@ -92,37 +92,37 @@ int32_t getclosestcol_lim(int32_t const r, int32_t const g, int32_t const b, int int mindist = -1; - int const k = (numclosestcolresults > COLRESULTSIZ) ? COLRESULTSIZ : numclosestcolresults; + int const k = (numcolmatchresults > COLRESULTSIZ) ? COLRESULTSIZ : numcolmatchresults; - if (!numclosestcolresults) goto skip; + if (!numcolmatchresults) goto skip; - if (col == (getclosestcol_results[(numclosestcolresults-1) & (COLRESULTSIZ-1)] & 0x00ffffff)) - return getclosestcol_results[(numclosestcolresults-1) & (COLRESULTSIZ-1)]>>24; + if (col == (colmatchresults[(numcolmatchresults-1) & (COLRESULTSIZ-1)] & 0x00ffffff)) + return colmatchresults[(numcolmatchresults-1) & (COLRESULTSIZ-1)]>>24; int i; for (i = 0; i <= k-4; i+=4) { - if (col == (getclosestcol_results[i] & 0x00ffffff)) { mindist = i; break; } - if (col == (getclosestcol_results[i+1] & 0x00ffffff)) { mindist = i+1; break; } - if (col == (getclosestcol_results[i+2] & 0x00ffffff)) { mindist = i+2; break; } - if (col == (getclosestcol_results[i+3] & 0x00ffffff)) { mindist = i+3; break; } + if (col == (colmatchresults[i] & 0x00ffffff)) { mindist = i; break; } + if (col == (colmatchresults[i+1] & 0x00ffffff)) { mindist = i+1; break; } + if (col == (colmatchresults[i+2] & 0x00ffffff)) { mindist = i+2; break; } + if (col == (colmatchresults[i+3] & 0x00ffffff)) { mindist = i+3; break; } } if (mindist == -1) for (; i < k; i++) - if (col == (getclosestcol_results[i] & 0x00ffffff)) { mindist = i; break; } + if (col == (colmatchresults[i] & 0x00ffffff)) { mindist = i; break; } - if (mindist != -1 && getclosestcol_results[mindist]>>24 < (unsigned)lastokcol) - return getclosestcol_results[mindist]>>24; + if (mindist != -1 && colmatchresults[mindist]>>24 < (unsigned)lastokcol) + return colmatchresults[mindist]>>24; skip: - i = getclosestcol_nocache_lim(r, g, b, lastokcol); - getclosestcol_results[numclosestcolresults++ & (COLRESULTSIZ-1)] = col | (i << 24); + i = paletteGetClosestColorUpToIndexNoCache(r, g, b, lastokcol); + colmatchresults[numcolmatchresults++ & (COLRESULTSIZ-1)] = col | (i << 24); return i; } -int32_t getclosestcol_nocache_lim(int32_t r, int32_t g, int32_t b, int32_t const lastokcol) +int32_t paletteGetClosestColorUpToIndexNoCache(int32_t r, int32_t g, int32_t b, int32_t const lastokcol) { #ifdef DEBUGGINGAIDS Bassert(lastokcol >= 0 && lastokcol <= 255); diff --git a/source/build/src/defs.cpp b/source/build/src/defs.cpp index 4642b214d..7f02ee18d 100644 --- a/source/build/src/defs.cpp +++ b/source/build/src/defs.cpp @@ -2713,7 +2713,7 @@ static int32_t defsparser(scriptfile *script) if (didLoadPal && id == 0) { - initfastcolorlookup_palette(palette); + paletteInitClosestColorMap(palette); paletteloaded |= PALETTE_MAIN; } diff --git a/source/build/src/palette.cpp b/source/build/src/palette.cpp index d719f4811..7da23fa12 100644 --- a/source/build/src/palette.cpp +++ b/source/build/src/palette.cpp @@ -164,8 +164,8 @@ inline bool read_and_test(FileReader& handle, void* buffer, int32_t leng) // void paletteLoadFromDisk(void) { - initfastcolorlookup_scale(30, 59, 11); - initfastcolorlookup_gridvectors(); + paletteInitClosestColorScale(30, 59, 11); + paletteInitClosestColorGrid(); #ifdef USE_OPENGL for (auto & x : glblend) @@ -191,7 +191,7 @@ void paletteLoadFromDisk(void) for (unsigned char & k : palette) k <<= 2; - initfastcolorlookup_palette(palette); + paletteInitClosestColorMap(palette); paletteloaded |= PALETTE_MAIN; @@ -361,7 +361,7 @@ void palettePostLoadTables(void) for (size_t i = 0; i<16; i++) { palette_t *edcol = (palette_t *) &vgapal16[4*i]; - editorcolors[i] = getclosestcol_lim(edcol->b, edcol->g, edcol->r, playing_blood ? 254 : 239); + editorcolors[i] = paletteGetClosestColorUpToIndex(edcol->b, edcol->g, edcol->r, playing_blood ? 254 : 239); } // Bmemset(PaletteIndexFullbrights, 0, sizeof(PaletteIndexFullbrights)); diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index ac814d405..a6a570d84 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -5829,7 +5829,7 @@ badindex: { tw = *insptr++; int32_t const rgb = Gv_GetVar(*insptr++); - Gv_SetVar(tw, getclosestcol_lim(rgb & 0xFF, (rgb >> 8) & 0xFF, (rgb >> 16) & 0xFF, Gv_GetVar(*insptr++))); + Gv_SetVar(tw, paletteGetClosestColorUpToIndex(rgb & 0xFF, (rgb >> 8) & 0xFF, (rgb >> 16) & 0xFF, Gv_GetVar(*insptr++))); } dispatch(); From 221e7a6b85d2f37983a33a837c9ae1cb40199b87 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 23 Dec 2019 07:03:46 +0000 Subject: [PATCH 3/6] paletteGetClosestColor: I think these < should be <= git-svn-id: https://svn.eduke32.com/eduke32@8489 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/src/colmatch.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/build/src/colmatch.cpp b/source/build/src/colmatch.cpp index 89f4c2b50..3e5ab9aca 100644 --- a/source/build/src/colmatch.cpp +++ b/source/build/src/colmatch.cpp @@ -113,7 +113,7 @@ int32_t paletteGetClosestColorUpToIndex(int32_t const r, int32_t const g, int32_ for (; i < k; i++) if (col == (colmatchresults[i] & 0x00ffffff)) { mindist = i; break; } - if (mindist != -1 && colmatchresults[mindist]>>24 < (unsigned)lastokcol) + if (mindist != -1 && colmatchresults[mindist]>>24 <= (unsigned)lastokcol) return colmatchresults[mindist]>>24; skip: @@ -173,7 +173,7 @@ int32_t paletteGetClosestColorUpToIndexNoCache(int32_t r, int32_t g, int32_t b, mindist = INT32_MAX; - for (bssize_t i = 0; i < lastokcol; ++i) + for (bssize_t i = 0; i <= lastokcol; ++i) { char const * const pal1 = (char const *)&colmatch_palette[i*3]; int dist = gdist[pal1[1]+g]; From 34ef03185dc7db0fddecd96d8358e4ec7e3689b2 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 23 Dec 2019 07:03:51 +0000 Subject: [PATCH 4/6] 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 --- source/build/include/build.h | 1 + source/build/src/defs.cpp | 3 +++ source/build/src/palette.cpp | 15 +++++++++------ 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/source/build/include/build.h b/source/build/include/build.h index 9439f5e21..d745a7c98 100644 --- a/source/build/include/build.h +++ b/source/build/include/build.h @@ -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]; diff --git a/source/build/src/defs.cpp b/source/build/src/defs.cpp index 7f02ee18d..3eff02ce5 100644 --- a/source/build/src/defs.cpp +++ b/source/build/src/defs.cpp @@ -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: diff --git a/source/build/src/palette.cpp b/source/build/src/palette.cpp index 7da23fa12..ce571eb46 100644 --- a/source/build/src/palette.cpp +++ b/source/build/src/palette.cpp @@ -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) From 56e88b33a81a150b8355d6110e3ec3f4c6b49bfb Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Mon, 23 Dec 2019 07:03:55 +0000 Subject: [PATCH 5/6] Replace color matching up to index 239 with the engine's fullbright mask Should improve the color range available to non-Duke editors. git-svn-id: https://svn.eduke32.com/eduke32@8491 1a8010ca-5511-0410-912e-c29ae57300e0 --- source/build/include/colmatch.h | 13 +++++++++++-- source/build/src/colmatch.cpp | 21 +++++++++++++++------ source/build/src/palette.cpp | 2 +- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/source/build/include/colmatch.h b/source/build/include/colmatch.h index f0ab75529..7a9077737 100644 --- a/source/build/include/colmatch.h +++ b/source/build/include/colmatch.h @@ -5,10 +5,19 @@ extern void paletteInitClosestColorScale(int32_t rscale, int32_t gscale, int32_t extern void paletteInitClosestColorMap(uint8_t const * pal) ATTRIBUTE((nonnull(1))); extern void paletteInitClosestColorGrid(void); -extern int32_t paletteGetClosestColorUpToIndex(int32_t r, int32_t g, int32_t b, int32_t lastokcol); -extern int32_t paletteGetClosestColorUpToIndexNoCache(int32_t r, int32_t g, int32_t b, int32_t lastokcol); +extern int32_t paletteGetClosestColorWithBlacklist(int32_t r, int32_t g, int32_t b, int32_t lastokcol, uint8_t const * blacklist); +extern int32_t paletteGetClosestColorWithBlacklistNoCache(int32_t r, int32_t g, int32_t b, int32_t lastokcol, uint8_t const * blacklist); extern void paletteFlushClosestColor(void); +static FORCE_INLINE int32_t paletteGetClosestColorUpToIndex(int32_t r, int32_t g, int32_t b, int32_t lastokcol) +{ + return paletteGetClosestColorWithBlacklist(r, g, b, lastokcol, NULL); +} +static FORCE_INLINE int32_t paletteGetClosestColorUpToIndexNoCache(int32_t r, int32_t g, int32_t b, int32_t lastokcol) +{ + return paletteGetClosestColorWithBlacklistNoCache(r, g, b, lastokcol, NULL); +} + static FORCE_INLINE int32_t paletteGetClosestColor(int32_t r, int32_t g, int32_t b) { return paletteGetClosestColorUpToIndex(r, g, b, 255); diff --git a/source/build/src/colmatch.cpp b/source/build/src/colmatch.cpp index 3e5ab9aca..401c532f5 100644 --- a/source/build/src/colmatch.cpp +++ b/source/build/src/colmatch.cpp @@ -80,9 +80,11 @@ void paletteFlushClosestColor(void) numcolmatchresults = 0; } +#define checkbitfield(field, idx) ((field)[(idx)>>3] & (1u<<((idx)&7))) + // Finds a color index in [0 .. lastokcol] closest to (r, g, b). // must be in [0 .. 255]. -int32_t paletteGetClosestColorUpToIndex(int32_t const r, int32_t const g, int32_t const b, int32_t const lastokcol) +int32_t paletteGetClosestColorWithBlacklist(int32_t const r, int32_t const g, int32_t const b, int32_t const lastokcol, uint8_t const * const blacklist) { #ifdef DEBUGGINGAIDS Bassert(lastokcol >= 0 && lastokcol <= 255); @@ -113,16 +115,20 @@ int32_t paletteGetClosestColorUpToIndex(int32_t const r, int32_t const g, int32_ for (; i < k; i++) if (col == (colmatchresults[i] & 0x00ffffff)) { mindist = i; break; } - if (mindist != -1 && colmatchresults[mindist]>>24 <= (unsigned)lastokcol) - return colmatchresults[mindist]>>24; + if (mindist != -1) + { + uint32_t const idx = colmatchresults[mindist]>>24; + if (idx <= (unsigned)lastokcol && (blacklist == nullptr || !checkbitfield(blacklist, idx))) + return idx; + } skip: - i = paletteGetClosestColorUpToIndexNoCache(r, g, b, lastokcol); + i = paletteGetClosestColorWithBlacklistNoCache(r, g, b, lastokcol, blacklist); colmatchresults[numcolmatchresults++ & (COLRESULTSIZ-1)] = col | (i << 24); return i; } -int32_t paletteGetClosestColorUpToIndexNoCache(int32_t r, int32_t g, int32_t b, int32_t const lastokcol) +int32_t paletteGetClosestColorWithBlacklistNoCache(int32_t r, int32_t g, int32_t b, int32_t const lastokcol, uint8_t const * const blacklist) { #ifdef DEBUGGINGAIDS Bassert(lastokcol >= 0 && lastokcol <= 255); @@ -158,7 +164,7 @@ int32_t paletteGetClosestColorUpToIndexNoCache(int32_t r, int32_t g, int32_t b, char const * const pal1 = (char const *)&colmatch_palette[i*3]; int dist = gdist[pal1[1]+g]; - if (dist >= mindist || i > lastokcol) continue; + if (dist >= mindist || i > lastokcol || (blacklist != nullptr && checkbitfield(blacklist, i))) continue; if ((dist += rdist[pal1[0]+r]) >= mindist) continue; if ((dist += bdist[pal1[2]+b]) >= mindist) continue; @@ -175,6 +181,9 @@ int32_t paletteGetClosestColorUpToIndexNoCache(int32_t r, int32_t g, int32_t b, for (bssize_t i = 0; i <= lastokcol; ++i) { + if (blacklist != nullptr && checkbitfield(blacklist, i)) + continue; + char const * const pal1 = (char const *)&colmatch_palette[i*3]; int dist = gdist[pal1[1]+g]; diff --git a/source/build/src/palette.cpp b/source/build/src/palette.cpp index ce571eb46..cc9fa9bf3 100644 --- a/source/build/src/palette.cpp +++ b/source/build/src/palette.cpp @@ -401,7 +401,7 @@ void palettePostLoadTables(void) continue; palette_t *edcol = (palette_t *) &vgapal16[4*i]; - editorcolors[i] = paletteGetClosestColorUpToIndex(edcol->b, edcol->g, edcol->r, 239); + editorcolors[i] = paletteGetClosestColorWithBlacklist(edcol->b, edcol->g, edcol->r, 254, PaletteIndexFullbrights); } } From 5c62e9776f41c381f5850f6fb4d7d74778c1913d Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 23 Dec 2019 14:30:10 +0100 Subject: [PATCH 6/6] - fix for cherry picks. --- source/blood/src/screen.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blood/src/screen.cpp b/source/blood/src/screen.cpp index d393245d7..de3cb35ba 100644 --- a/source/blood/src/screen.cpp +++ b/source/blood/src/screen.cpp @@ -137,8 +137,8 @@ void scrLoadPalette(void) x = bloodglblend; #endif - initfastcolorlookup_scale(30, 59, 11); - initfastcolorlookup_gridvectors(); + paletteInitClosestColorScale(30, 59, 11); + paletteInitClosestColorGrid(); paletteloaded = 0; initprintf("Loading palettes\n"); for (int i = 0; i < 5; i++) @@ -161,7 +161,7 @@ void scrLoadPalette(void) blendtable[0] = (char*)gSysRes.Lock(pTrans); paletteloaded |= PALETTE_TRANSLUC; - initfastcolorlookup_palette(palette); + paletteInitClosestColorMap(palette); palettePostLoadTables(); }