From 91d6935c888c3d61c01fd4baf1b3db1d26184179 Mon Sep 17 00:00:00 2001 From: hendricks266 Date: Tue, 19 May 2015 22:04:38 +0000 Subject: [PATCH] Add uint32_t PaletteIndexFullbrights[8] so that Polymost can respect the lack of fullbrights in KenBuild and Shadow Warrior. git-svn-id: https://svn.eduke32.com/eduke32@5210 1a8010ca-5511-0410-912e-c29ae57300e0 --- polymer/eduke32/build/include/build.h | 2 ++ polymer/eduke32/build/src/polymost.c | 4 ++-- polymer/eduke32/source/common.c | 2 ++ polymer/eduke32/source/sw/src/colormap.c | 2 ++ polymer/eduke32/source/testgame/src/common.c | 2 ++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/polymer/eduke32/build/include/build.h b/polymer/eduke32/build/include/build.h index a94c7d385..36190b16a 100644 --- a/polymer/eduke32/build/include/build.h +++ b/polymer/eduke32/build/include/build.h @@ -87,6 +87,8 @@ enum rendmode_t { #define MAXSPRITESONSCREEN 4096 #define MAXUNIQHUDID 256 //Extra slots so HUD models can store animation state without messing game sprites +extern uint32_t PaletteIndexFullbrights[8]; + #define RESERVEDPALS 4 // don't forget to increment this when adding reserved pals #define DETAILPAL (MAXPALOOKUPS - 1) #define GLOWPAL (MAXPALOOKUPS - 2) diff --git a/polymer/eduke32/build/src/polymost.c b/polymer/eduke32/build/src/polymost.c index 3e485c06a..65f383418 100644 --- a/polymer/eduke32/build/src/polymost.c +++ b/polymer/eduke32/build/src/polymost.c @@ -849,7 +849,7 @@ void gloadtile_art(int32_t dapic, int32_t dapal, int32_t tintpalnum, int32_t das if (!fullbrightloadingpass) { // regular texture - if (dacol > 239 && dacol != 255 && dofullbright) + if ((PaletteIndexFullbrights[dacol>>5] & (1<<(dacol&31))) && dofullbright) hasfullbright = 1; wpptr->a = 255; @@ -857,7 +857,7 @@ void gloadtile_art(int32_t dapic, int32_t dapal, int32_t tintpalnum, int32_t das else { // texture with only fullbright areas - if (dacol < 240) // regular colors + if (!(PaletteIndexFullbrights[dacol>>5] & (1<<(dacol&31)))) // regular colors { wpptr->a = 0; hasalpha = 1; diff --git a/polymer/eduke32/source/common.c b/polymer/eduke32/source/common.c index e639df883..3bb22142b 100644 --- a/polymer/eduke32/source/common.c +++ b/polymer/eduke32/source/common.c @@ -1017,6 +1017,8 @@ void G_DoAutoload(const char *dirname) ////////// +uint32_t PaletteIndexFullbrights[8] = { 0, 0, 0, 0, 0, 0, 0, 2147418112 }; + static uint8_t water_pal[768], slime_pal[768], title_pal[768], dre_alms[768], ending_pal[768]; uint8_t *basepaltable[BASEPALCOUNT] = { diff --git a/polymer/eduke32/source/sw/src/colormap.c b/polymer/eduke32/source/sw/src/colormap.c index e66b5287b..92f2b63ef 100644 --- a/polymer/eduke32/source/sw/src/colormap.c +++ b/polymer/eduke32/source/sw/src/colormap.c @@ -29,6 +29,8 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms #include "pal.h" #include "game.h" +uint32_t PaletteIndexFullbrights[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + short f_c = 3; static unsigned char tempbuf[256]; unsigned char DefaultPalette[256 * 32]; diff --git a/polymer/eduke32/source/testgame/src/common.c b/polymer/eduke32/source/testgame/src/common.c index 7550518d6..d5af1a98a 100644 --- a/polymer/eduke32/source/testgame/src/common.c +++ b/polymer/eduke32/source/testgame/src/common.c @@ -30,6 +30,8 @@ uint8_t *basepaltable[1] = { palette }; +uint32_t PaletteIndexFullbrights[8] = { 0, 0, 0, 0, 0, 0, 0, 0 }; + #define NUMPSKYMULTIS 3 EDUKE32_STATIC_ASSERT(NUMPSKYMULTIS <= MAXPSKYMULTIS); EDUKE32_STATIC_ASSERT(PSKYOFF_MAX <= MAXPSKYTILES);