Rename STRUCT_TRACKERS_ENABLED preprocessor definition to USE_STRUCT_TRACKERS

This may also fix a minor performance regression introduced in Polymer sometime after we switched to building as C++, caused by confusion between STRUCT_TRACKERS_ENABLED and UNTRACKED_STRUCTS. UNTRACKED_STRUCTS is now named UNTRACT_STRUCTS__ to dissuade use outside of buildtypes.h.

git-svn-id: https://svn.eduke32.com/eduke32@7695 1a8010ca-5511-0410-912e-c29ae57300e0

# Conflicts:
#	source/build/src/polymer.cpp
This commit is contained in:
terminx 2019-06-25 11:28:14 +00:00 committed by Christoph Oelckers
parent 33b122d88a
commit 26a266dfe5
4 changed files with 15 additions and 15 deletions

View file

@ -274,10 +274,10 @@ enum {
#endif
#if defined __cplusplus && (defined USE_OPENGL || defined POLYMER)
# define STRUCT_TRACKERS_ENABLED
# define USE_STRUCT_TRACKERS
#endif
#ifdef STRUCT_TRACKERS_ENABLED
#ifdef USE_STRUCT_TRACKERS
extern "C" {
static FORCE_INLINE void sector_tracker_hook__(intptr_t address);
@ -336,9 +336,9 @@ enum {
SPR_ALIGN_MASK = 32+16,
};
#define UNTRACKED_STRUCTS
#define UNTRACKED_STRUCTS__
#include "buildtypes.h"
#undef UNTRACKED_STRUCTS
#undef UNTRACKED_STRUCTS__
#undef buildtypes_h__
#include "buildtypes.h"
@ -608,7 +608,7 @@ EXTERN spritetype sprite[MAXSPRITES];
EXTERN uspritetype tsprite[MAXSPRITESONSCREEN];
#endif
#ifdef STRUCT_TRACKERS_ENABLED
#ifdef USE_STRUCT_TRACKERS
EXTERN uint32_t sectorchanged[MAXSECTORS + M32_FIXME_SECTORS];
EXTERN uint32_t wallchanged[MAXWALLS + M32_FIXME_WALLS];
EXTERN uint32_t spritechanged[MAXSPRITES];
@ -637,7 +637,7 @@ static FORCE_INLINE void yax_setnextwall(int16_t wal, int16_t cf, int16_t thenex
}
#endif
#ifdef STRUCT_TRACKERS_ENABLED
#ifdef USE_STRUCT_TRACKERS
static FORCE_INLINE void sector_tracker_hook__(intptr_t const address)
{
intptr_t const sectnum = (address - (intptr_t)sector) / sizeof(sectortype);
@ -665,7 +665,7 @@ static FORCE_INLINE void sprite_tracker_hook__(intptr_t const address)
intptr_t const spritenum = (address - (intptr_t)sprite) / sizeof(spritetype);
#if DEBUGGINGAIDS
Bassert((unsigned)spritenum < MAXSPRITES));
Bassert((unsigned)spritenum < MAXSPRITES);
#endif
++spritechanged[spritenum];

View file

@ -5,7 +5,7 @@
#undef SECTORTYPE
#undef SPRITETYPE
#ifdef UNTRACKED_STRUCTS
#ifdef UNTRACKED_STRUCTS__
#define StructTracker(tracker, type) type
#define StructName(name) u ## name

View file

@ -9145,7 +9145,7 @@ static void enginePrepareLoadBoard(buildvfs_kfd fil, vec3_t *dapos, int16_t *daa
Bmemset(show2dsector, 0, sizeof(show2dsector));
Bmemset(show2dsprite, 0, sizeof(show2dsprite));
Bmemset(show2dwall, 0, sizeof(show2dwall));
#ifdef STRUCT_TRACKERS_ENABLED
#ifdef USE_STRUCT_TRACKERS
Bmemset(sectorchanged, 0, sizeof(sectorchanged));
Bmemset(spritechanged, 0, sizeof(spritechanged));
Bmemset(wallchanged, 0, sizeof(wallchanged));

View file

@ -2928,7 +2928,7 @@ dodefault:
X_ERROR_INVALIDSP();
vm.pSprite->xrepeat = (uint8_t) Gv_GetVar(*(insptr-2));
vm.pSprite->yrepeat = (uint8_t) Gv_GetVar(*(insptr-1));
#ifdef STRUCT_TRACKERS_ENABLED
#ifdef USE_STRUCT_TRACKERS
if (vm.spriteNum != -1) spritechanged[vm.spriteNum]++;
#endif
continue;
@ -2937,7 +2937,7 @@ dodefault:
insptr += 2;
X_ERROR_INVALIDSP();
vm.pSprite->cstat = (int16_t) *(insptr-1);
#ifdef STRUCT_TRACKERS_ENABLED
#ifdef USE_STRUCT_TRACKERS
if (vm.spriteNum != -1) spritechanged[vm.spriteNum]++;
#endif
continue;
@ -2946,7 +2946,7 @@ dodefault:
insptr += 2;
X_ERROR_INVALIDSP();
vm.pSprite->cstat |= (int16_t) Gv_GetVar(*(insptr-1));
#ifdef STRUCT_TRACKERS_ENABLED
#ifdef USE_STRUCT_TRACKERS
if (vm.spriteNum != -1) spritechanged[vm.spriteNum]++;
#endif
continue;
@ -2955,7 +2955,7 @@ dodefault:
insptr += 2;
X_ERROR_INVALIDSP();
vm.pSprite->clipdist = (uint8_t) Gv_GetVar(*(insptr-1));
#ifdef STRUCT_TRACKERS_ENABLED
#ifdef USE_STRUCT_TRACKERS
if (vm.spriteNum != -1) spritechanged[vm.spriteNum]++;
#endif
continue;
@ -2964,7 +2964,7 @@ dodefault:
insptr += 2;
X_ERROR_INVALIDSP();
vm.pSprite->pal = Gv_GetVar(*(insptr-1));
#ifdef STRUCT_TRACKERS_ENABLED
#ifdef USE_STRUCT_TRACKERS
if (vm.spriteNum != -1) spritechanged[vm.spriteNum]++;
#endif
continue;
@ -2973,7 +2973,7 @@ dodefault:
insptr += 2;
X_ERROR_INVALIDSP();
vm.pSprite->picnum = Gv_GetVar(*(insptr-1));
#ifdef STRUCT_TRACKERS_ENABLED
#ifdef USE_STRUCT_TRACKERS
if (vm.spriteNum != -1) spritechanged[vm.spriteNum]++;
#endif
continue;