From 07a2ccd79bf8971bda22f7a69ea44710d2a04041 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Sat, 3 Oct 2015 11:53:19 +0000 Subject: [PATCH] Duke: Add globalgameflag DUKE3D_NO_HARDCODED_FOGPALS, which prevents the game from automatically defining white, red, green, and blue fogpals in the first four adjacent empty palookup slots it finds. git-svn-id: https://svn.eduke32.com/eduke32@5375 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/source/astub.c | 7 ++++++- polymer/eduke32/source/game.c | 3 ++- polymer/eduke32/source/global.h | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/source/astub.c b/polymer/eduke32/source/astub.c index 7b8852ddf..6478ff627 100644 --- a/polymer/eduke32/source/astub.c +++ b/polymer/eduke32/source/astub.c @@ -127,6 +127,10 @@ static uint32_t templenrepquot=1; static int32_t duke3d_m32_globalflags; +enum { + DUKE3D_NO_HARDCODED_FOGPALS = 1<<1, +}; + //////////////////// Key stuff //////////////////// #define eitherALT (keystatus[KEYSC_LALT] || keystatus[KEYSC_RALT]) @@ -9937,7 +9941,8 @@ void ExtPostInit(void) // This makes it possible to sensibly use Lunatic's engine.saveLookupDat(). palookup[0][239] = 239; - generatefogpals(); + if (!(duke3d_m32_globalflags & DUKE3D_NO_HARDCODED_FOGPALS)) + generatefogpals(); fillemptylookups(); } diff --git a/polymer/eduke32/source/game.c b/polymer/eduke32/source/game.c index 2e6601d68..26d85e378 100644 --- a/polymer/eduke32/source/game.c +++ b/polymer/eduke32/source/game.c @@ -10986,7 +10986,8 @@ static void G_PostLoadPalette(void) if (basepaltable[SLIMEPAL] != NULL) Bmemset(&basepaltable[SLIMEPAL][255*3], 0, 3); - generatefogpals(); + if (!(duke3d_globalflags & DUKE3D_NO_HARDCODED_FOGPALS)) + generatefogpals(); E_ReplaceTransparentColorWithBlack(); diff --git a/polymer/eduke32/source/global.h b/polymer/eduke32/source/global.h index 8d28c778e..9d2d2f4fe 100644 --- a/polymer/eduke32/source/global.h +++ b/polymer/eduke32/source/global.h @@ -59,6 +59,7 @@ G_EXTERN int32_t duke3d_globalflags; enum { DUKE3D_NO_WIDESCREEN_PINNING = 1<<0, + DUKE3D_NO_HARDCODED_FOGPALS = 1<<1, }; G_EXTERN DukeStatus_t sbar;