diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 2792f6756..3e6e0a2b2 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -127,8 +127,10 @@ static uint32_t templenrepquot=1; static int32_t duke3d_m32_globalflags; -enum { +// KEEPINSYNC global.h (used values only) +enum DUKE3D_GLOBALFLAGS { DUKE3D_NO_HARDCODED_FOGPALS = 1<<1, + DUKE3D_NO_PALETTE_CHANGES = 1<<2, }; //////////////////// Key stuff //////////////////// @@ -9976,10 +9978,13 @@ void ExtPostInit(void) { InitCustomColors(); - // Make base shade table at shade 0 into the identity map. - // (In the shade table of Duke3D's PALETTE.DAT, palookup[0][239]==143.) - // This makes it possible to sensibly use Lunatic's engine.saveLookupDat(). - palookup[0][239] = 239; + if (!(duke3d_m32_globalflags & DUKE3D_NO_PALETTE_CHANGES)) + { + // Make base shade table at shade 0 into the identity map. + // (In the shade table of Duke3D's PALETTE.DAT, palookup[0][239]==143.) + // This makes it possible to sensibly use Lunatic's engine.saveLookupDat(). + palookup[0][239] = 239; + } if (!(duke3d_m32_globalflags & DUKE3D_NO_HARDCODED_FOGPALS)) generatefogpals(); diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 0febae843..e5a2ae4c2 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -11002,18 +11002,24 @@ static inline void G_CheckGametype(void) static void G_PostLoadPalette(void) { - // Make color index 255 of default/water/slime palette black. - if (basepaltable[BASEPAL] != NULL) - Bmemset(&basepaltable[BASEPAL][255*3], 0, 3); - if (basepaltable[WATERPAL] != NULL) - Bmemset(&basepaltable[WATERPAL][255*3], 0, 3); - if (basepaltable[SLIMEPAL] != NULL) - Bmemset(&basepaltable[SLIMEPAL][255*3], 0, 3); + if (!(duke3d_globalflags & DUKE3D_NO_PALETTE_CHANGES)) + { + // Make color index 255 of default/water/slime palette black. + if (basepaltable[BASEPAL] != NULL) + Bmemset(&basepaltable[BASEPAL][255*3], 0, 3); + if (basepaltable[WATERPAL] != NULL) + Bmemset(&basepaltable[WATERPAL][255*3], 0, 3); + if (basepaltable[SLIMEPAL] != NULL) + Bmemset(&basepaltable[SLIMEPAL][255*3], 0, 3); + } if (!(duke3d_globalflags & DUKE3D_NO_HARDCODED_FOGPALS)) generatefogpals(); - E_ReplaceTransparentColorWithBlack(); + if (!(duke3d_globalflags & DUKE3D_NO_PALETTE_CHANGES)) + { + E_ReplaceTransparentColorWithBlack(); + } fillemptylookups(); } diff --git a/polymer/eduke32/source/global.h b/polymer/eduke32/source/global.h index 9d2d2f4fe..252ca353c 100644 --- a/polymer/eduke32/source/global.h +++ b/polymer/eduke32/source/global.h @@ -57,9 +57,11 @@ extern "C" { G_EXTERN int32_t duke3d_globalflags; -enum { +// KEEPINSYNC astub.c (used values only) +enum DUKE3D_GLOBALFLAGS { DUKE3D_NO_WIDESCREEN_PINNING = 1<<0, DUKE3D_NO_HARDCODED_FOGPALS = 1<<1, + DUKE3D_NO_PALETTE_CHANGES = 1<<2, }; G_EXTERN DukeStatus_t sbar;