From 9b21233c9850faa79d189713d800374616d2db5c Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Thu, 11 Nov 2021 01:17:41 +0100 Subject: [PATCH] - little bit of cleanup --- source/games/blood/src/db.cpp | 6 +++--- source/games/duke/src/global.cpp | 3 ++- source/games/duke/src/global.h | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/source/games/blood/src/db.cpp b/source/games/blood/src/db.cpp index cb06d4b23..06925fd9a 100644 --- a/source/games/blood/src/db.cpp +++ b/source/games/blood/src/db.cpp @@ -518,9 +518,9 @@ void dbLoadMap(const char *pPath, int *pX, int *pY, int *pZ, short *pAngle, shor gModernMap = false; #endif - memset(sector, 0, sizeof(*sector) * MAXSECTORS); - memset(wall, 0, sizeof(*wall) * MAXWALLS); - memset(sprite, 0, sizeof(*sector) * MAXSPRITES); + memset(sector, 0, sizeof(sector)); + memset(wall, 0, sizeof(wall)); + memset(sprite, 0, sizeof(sprite)); #ifdef NOONE_EXTENSIONS for (auto& ctrl : gPlayerCtrl) ctrl.qavScene.initiator = nullptr; diff --git a/source/games/duke/src/global.cpp b/source/games/duke/src/global.cpp index 849756248..9a1ceaa70 100644 --- a/source/games/duke/src/global.cpp +++ b/source/games/duke/src/global.cpp @@ -91,11 +91,12 @@ bool sound445done; // used in checksectors_r. This was local state inside // serialized uint8_t sectorextra[MAXSECTORS]; // something about keys, all access through the haskey function. +uint8_t shadedsector[MAXSECTORS]; // display hackiness + DDukeActor hittype[MAXSPRITES + 1]; // +1 to have a blank entry for serialization, all access in game code through the iterators. int spriteqamount = 64; // internal sprite queue int spriteqloc; DDukeActor* spriteq[1024]; -uint8_t shadedsector[MAXSECTORS]; // display hackiness animwalltype animwall[MAXANIMWALLS]; // animated walls int numanimwalls; int animatecnt; // sector plane movement diff --git a/source/games/duke/src/global.h b/source/games/duke/src/global.h index c7142cb07..3a125611f 100644 --- a/source/games/duke/src/global.h +++ b/source/games/duke/src/global.h @@ -55,6 +55,7 @@ extern int screenpeek; // Variables that must be saved extern uint8_t sectorextra[MAXSECTORS]; // these hold fields that were formerly in sprite and sector. Move these back into the base structs! +extern uint8_t shadedsector[MAXSECTORS]; extern int rtsplaying; extern int tempwallptr; @@ -62,7 +63,6 @@ extern int tempwallptr; extern bool sound445done; extern player_struct ps[MAXPLAYERS]; extern int spriteqamount; -extern uint8_t shadedsector[MAXSECTORS]; extern int lastvisinc; extern animwalltype animwall[MAXANIMWALLS]; extern int numanimwalls;