From 7f3c0ef16c0e63447068ee8746f160c0667e4f30 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 7 Jul 2020 09:39:33 +0200 Subject: [PATCH] - safety commit --- source/games/duke/src/funct.h | 7 +++++++ source/games/duke/src/render.cpp | 2 ++ source/games/duke/src/zz_premap.cpp | 13 +------------ 3 files changed, 10 insertions(+), 12 deletions(-) diff --git a/source/games/duke/src/funct.h b/source/games/duke/src/funct.h index 1451d0f31..dcf666206 100644 --- a/source/games/duke/src/funct.h +++ b/source/games/duke/src/funct.h @@ -6,6 +6,13 @@ BEGIN_DUKE_NS // dumping ground for all external function prototypes to keep them out of the important headers. +// This list is not sorted in any way. + +void lava_cleararrays(); +void addjaildoor(int p1, int p2, int iht, int jlt, int p3, int h); +void addminecart(int p1, int p2, int i, int iht, int p3, int childsectnum); +void addtorch(int i); +void addlightning(int i); void movecyclers(void); void movedummyplayers(void); diff --git a/source/games/duke/src/render.cpp b/source/games/duke/src/render.cpp index 8f4c8ab10..773806dd7 100644 --- a/source/games/duke/src/render.cpp +++ b/source/games/duke/src/render.cpp @@ -501,6 +501,8 @@ void displayrooms(int snum, int smoothratio) setgamepalette(BASEPAL); animatecamsprite(smoothratio); + // The camera texture must be rendered with the base palette, so this is the only place where the current global can be set. + // The setting here will be carried over to the rendering of the weapon sprites, but other 2D content will always default to the main palette. setgamepalette(p->palette); if (ud.camerasprite >= 0) { diff --git a/source/games/duke/src/zz_premap.cpp b/source/games/duke/src/zz_premap.cpp index c18e205d6..c2a829d00 100644 --- a/source/games/duke/src/zz_premap.cpp +++ b/source/games/duke/src/zz_premap.cpp @@ -34,22 +34,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_DUKE_NS -void lava_cleararrays(); -void addjaildoor(int p1, int p2, int iht, int jlt, int p3, int h); -void addminecart(int p1, int p2, int i, int iht, int p3, int childsectnum); -void addtorch(int i); -void addlightning(int i); - - extern int which_palookup; -static uint8_t precachehightile[2][MAXTILES>>3]; static int32_t g_precacheCount; int32_t g_skillSoundVoice = -1; -static inline int G_CheckExitSprite(int spriteNum) { return ((uint16_t)sprite[spriteNum].lotag == UINT16_MAX && (sprite[spriteNum].cstat & 16)); } - void G_InitRRRASkies(void) { if (!isRRRA()) @@ -274,8 +264,7 @@ static int LoadTheMap(MapRecord &mi, struct player_struct *pPlayer, int gameMode g_precacheCount = 0; Bmemset(gotpic, 0, sizeof(gotpic)); - Bmemset(precachehightile, 0, sizeof(precachehightile)); - + if (isRR()) prelevel_r(gameMode); else prelevel_d(gameMode);