- removed the indirection for the global arrays.

No idea what part of EDuke32 needed this, but it is not necessary.
This commit is contained in:
Christoph Oelckers 2021-05-21 12:53:31 +02:00
parent 75ecd173b6
commit d572e56839
4 changed files with 13 additions and 31 deletions

View file

@ -145,12 +145,12 @@ struct usermaphack_t
uint8_t md4[16]{};
};
EXTERN spriteext_t *spriteext;
EXTERN spritesmooth_t *spritesmooth;
extern spriteext_t spriteext[MAXSPRITES];
extern spritesmooth_t spritesmooth[MAXSPRITES];
EXTERN sectortype *sector;
EXTERN walltype *wall;
EXTERN spritetype *sprite;
extern sectortype sector[MAXSECTORS];
extern walltype wall[MAXWALLS];
extern spritetype sprite[MAXSPRITES];
EXTERN int leveltimer;
extern sectortype sectorbackup[MAXSECTORS];
@ -337,7 +337,6 @@ typedef struct artheader_t {
} artheader_t;
#define ARTv1_UNITOFFSET 24 // using sizeof does not work because picanm_t is not the in-file format.
int32_t enginePreInit(void); // a partial setup of the engine used for launch windows
int32_t engineInit(void);
void engineUnInit(void);
void initspritelists(void);

View file

@ -41,6 +41,13 @@
#include "gl_renderer.h"
#endif
spriteext_t spriteext[MAXSPRITES];
spritesmooth_t spritesmooth[MAXSPRITES];
sectortype sector[MAXSECTORS];
walltype wall[MAXWALLS];
spritetype sprite[MAXSPRITES];
int32_t r_rortexture = 0;
int32_t r_rortexturerange = 0;
int32_t r_rorphase = 0;
@ -625,27 +632,6 @@ const int16_t* getpsky(int32_t picnum, int32_t* dapyscale, int32_t* dapskybits,
}
//
// preinitengine
//
static spriteext_t spriteext_s[MAXSPRITES+MAXUNIQHUDID];
static spritesmooth_t spritesmooth_s[MAXSPRITES+MAXUNIQHUDID];
static sectortype sector_s[MAXSECTORS];
static walltype wall_s[MAXWALLS];
spritetype sprite_s[MAXSPRITES];
int32_t enginePreInit(void)
{
sector = sector_s;
wall = wall_s;
sprite = sprite_s;
spriteext = spriteext_s;
spritesmooth = spritesmooth_s;
return 0;
}
//
// initengine
//

View file

@ -986,7 +986,6 @@ int RunGame()
if (Args->CheckParm("-sounddebug"))
C_DoCommand("stat sounddebug");
enginePreInit();
SetupGameButtons();
gameinfo.mBackButton = "engine/graphics/m_back.png";
StartScreen->Progress();

View file

@ -4,8 +4,6 @@
#include "d_net.h"
#include "gameinput.h"
extern spritetype sprite_s[];
BEGIN_DUKE_NS
@ -41,7 +39,7 @@ struct weaponhit
static weaponhit* array(); // this is necessary to allow define inline functions referencing the global array inside the definition itself.
weaponhit() : s(&sprite_s[this - array()]) {} // little trick to initialize the reference automatically. ;)
weaponhit() : s(&sprite[this - array()]) {} // little trick to initialize the reference automatically. ;)
weaponhit(const weaponhit& other) = delete; // we also do not want to allow copies.
weaponhit& operator=(const weaponhit& other) = delete;
void clear()