- all typedefs in jsector.h and inv.h plus a bit of cleanup and #define removal.

This commit is contained in:
Christoph Oelckers 2021-12-31 15:10:37 +01:00
parent 6b50344417
commit f43f63adec
7 changed files with 59 additions and 70 deletions

View file

@ -493,7 +493,7 @@ void InventoryTimer(PLAYERp pp)
{
// called every time through loop
short inv = 0;
INVENTORY_DATAp id;
INVENTORY_DATA* id;
// if bar is up
if (pp->InventoryBarTics)
@ -569,7 +569,7 @@ void InventoryTimer(PLAYERp pp)
void InventoryUse(PLAYERp pp)
{
INVENTORY_DATAp id = &InventoryData[pp->InventoryNum];
INVENTORY_DATA* id = &InventoryData[pp->InventoryNum];
if (id->Init)
(*id->Init)(pp);
@ -577,7 +577,7 @@ void InventoryUse(PLAYERp pp)
void InventoryStop(PLAYERp pp, short InventoryNum)
{
INVENTORY_DATAp id = &InventoryData[InventoryNum];
INVENTORY_DATA* id = &InventoryData[InventoryNum];
if (id->Stop)
(*id->Stop)(pp, InventoryNum);

View file

@ -26,37 +26,37 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
enum InventoryNames
{
INVENTORY_MEDKIT,
INVENTORY_REPAIR_KIT,
INVENTORY_CLOAK, // de-cloak when firing
INVENTORY_NIGHT_VISION,
INVENTORY_CHEMBOMB,
INVENTORY_FLASHBOMB,
INVENTORY_CALTROPS,
MAX_INVENTORY
INVENTORY_MEDKIT,
INVENTORY_REPAIR_KIT,
INVENTORY_CLOAK, // de-cloak when firing
INVENTORY_NIGHT_VISION,
INVENTORY_CHEMBOMB,
INVENTORY_FLASHBOMB,
INVENTORY_CALTROPS,
MAX_INVENTORY
};
typedef struct
struct INVENTORY_DATA
{
const char *Name;
void (*Init)(PLAYERp);
void (*Stop)(PLAYERp, short);
short DecPerSec;
short MaxInv;
int Scale;
short Flags;
} INVENTORY_DATA, *INVENTORY_DATAp;
const char* Name;
void (*Init)(PLAYERp);
void (*Stop)(PLAYERp, short);
short DecPerSec;
short MaxInv;
int Scale;
short Flags;
};
extern INVENTORY_DATA InventoryData[MAX_INVENTORY+1];
extern INVENTORY_DATA InventoryData[MAX_INVENTORY + 1];
enum EInvFlags
{
INVF_AUTO_USE = 1,
INVF_TIMED = 2,
INVF_COUNT = 4
INVF_AUTO_USE = 1,
INVF_TIMED = 2,
INVF_COUNT = 4
};
void PlayerUpdateInventory(PLAYERp pp,short InventoryNum);
void PlayerUpdateInventory(PLAYERp pp, short InventoryNum);
void InventoryKeys(PLAYERp pp);
void UseInventoryRepairKit(PLAYERp pp);
void InventoryTimer(PLAYERp pp);

View file

@ -30,28 +30,31 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
BEGIN_SW_NS
#define MAXMIRRORDIST 3300 // At this distance, or less, the magic mirrors activate.
#define MAXMIRRORMONSTERS 4 // Max monsters any one magic mirror can spawn
typedef enum
enum
{
m_normal, m_viewon, m_pissed
} MIRRORSTATE;
MAXMIRRORDIST = 3300, // At this distance, or less, the magic mirrors activate.
MAXMIRRORMONSTERS = 4 // Max monsters any one magic mirror can spawn
};
typedef struct
enum
{
m_normal, m_viewon, m_pissed
};
struct MIRRORTYPE
{
TObjPtr<DSWActor*> cameraActor; // Contains number of ST1 sprite used as a camera
TObjPtr<DSWActor*> camspriteActor; // sprite pointing to campic
TObjPtr<DSWActor*> camspriteActor; // sprite pointing to campic
walltype* mirrorWall; // Wall number containing the mirror tile
sectortype* mirrorSector; // used internally to draw mirror rooms
short campic; // Editart tile number to draw a screen to
short numspawnspots; // Number of spawnspots used
short spawnspots[MAXMIRRORMONSTERS]; // One spot for each possible skill level for a max of up to 4 coolie ghosts to spawn.
bool ismagic; // Is this a magic mirror?
uint8_t mstate; // What state the mirror is currently in
int maxtics; // Tic count used to time mirror events
int tics; // How much viewing time has been used on mirror?
} MIRRORTYPE, *MIRRORTYPEp;
sectortype* mirrorSector; // used internally to draw mirror rooms
short campic; // Editart tile number to draw a screen to
short numspawnspots; // Number of spawnspots used
short spawnspots[MAXMIRRORMONSTERS]; // One spot for each possible skill level for a max of up to 4 coolie ghosts to spawn.
bool ismagic; // Is this a magic mirror?
uint8_t mstate; // What state the mirror is currently in
int maxtics; // Tic count used to time mirror events
int tics; // How much viewing time has been used on mirror?
};
extern MIRRORTYPE mirror[MAXMIRRORS];

View file

@ -76,14 +76,6 @@ static int faderamp[32] =
};
typedef struct RGB_color_typ
{
uint8_t red;
uint8_t green;
uint8_t blue;
} RGB_color, * RGB_color_ptr;
//////////////////////////////////////////
// Set the amount of redness for damage
// the player just took
@ -93,7 +85,6 @@ void SetFadeAmt(PLAYERp pp, short damage, uint8_t startcolor)
const int FADE_DAMAGE_FACTOR = 3; // 100 health / 32 shade cycles = 3.125
short fadedamage = 0;
RGB_color color;
//Printf("SetAmt: fadeamt = %d, startcolor = %d, pp = %d",pp->FadeAmt,startcolor,pp->StartColor);
@ -138,14 +129,12 @@ void SetFadeAmt(PLAYERp pp, short damage, uint8_t startcolor)
pp->FadeTics = 0;
color.red = GPalette.BaseColors[pp->StartColor].r;
color.green = GPalette.BaseColors[pp->StartColor].g;
color.blue = GPalette.BaseColors[pp->StartColor].b;
auto color = GPalette.BaseColors[pp->StartColor];
// Do initial palette set
if (pp == Player + screenpeek)
{
videoFadePalette(color.red, color.green, color.blue, faderamp[min(31, max(0, 32 - abs(pp->FadeAmt)))]);
videoFadePalette(color.r, color.g, color.b, faderamp[min(31, max(0, 32 - abs(pp->FadeAmt)))]);
if (damage < -1000)
pp->FadeAmt = 1000; // Don't call DoPaletteFlash for underwater stuff
}

View file

@ -26,9 +26,11 @@ Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
//-------------------------------------------------------------------------
BEGIN_SW_NS
#define SYNC_TEST 0
#define MAXSYNCBYTES 16
enum
{
SYNC_TEST = 0,
MAXSYNCBYTES = 16
};
extern bool PredictionOn;
extern PLAYER PredictPlayer;
extern PLAYERp ppp;
@ -55,7 +57,7 @@ enum MultiGameTypes
// global net vars
// not saved in .CFG file
// used for current game
typedef struct
struct gNET
{
int32_t KillLimit;
int32_t TimeLimit;
@ -67,7 +69,7 @@ typedef struct
bool AutoAim;
bool NoRespawn; // for commbat type games
bool Nuke;
} gNET,*gNETp;
};
extern gNET gNet;

View file

@ -58,17 +58,12 @@ int InitGrenade(PLAYERp pp);
int InitMine(PLAYERp pp);
int InitFistAttack(PLAYERp pp);
#define PANF_UZI_XFLIP (BIT(21))
#define XDIM 320
#define YDIM 200
typedef struct
struct PANEL_SHRAP
{
short xoff, yoff, skip;
int lo_jump_speed, hi_jump_speed, lo_xspeed, hi_xspeed;
PANEL_STATE* state[2];
} PANEL_SHRAP, *PANEL_SHRAPp;
};
void PanelInvTestSuicide(PANEL_SPRITEp psp);
@ -4590,7 +4585,7 @@ void SpawnHeartBlood(PANEL_SPRITEp psp)
{
PLAYERp pp = psp->PlayerP;
PANEL_SPRITEp blood;
PANEL_SHRAPp hsp;
PANEL_SHRAP* hsp;
static PANEL_SHRAP HeartShrap[] =
{
@ -4629,7 +4624,7 @@ void SpawnSmallHeartBlood(PANEL_SPRITEp psp)
{
PLAYERp pp = psp->PlayerP;
PANEL_SPRITEp blood;
PANEL_SHRAPp hsp;
PANEL_SHRAP* hsp;
static PANEL_SHRAP HeartShrap[] =
{

View file

@ -7217,7 +7217,7 @@ DEFINE_ACTION_FUNCTION(_SW, InventoryFlags)
{
PARAM_PROLOGUE;
PARAM_INT(inv);
INVENTORY_DATAp id = &InventoryData[inv];
INVENTORY_DATA* id = &InventoryData[inv];
ACTION_RETURN_INT(id->Flags);
}