From b878bf8aac0c189ed466698b8245e423941c9c1e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Tue, 16 Nov 2021 18:51:15 +0100 Subject: [PATCH] - SW: renamed all unsigned chars to uint8_t Also deletes some unused declarations --- source/games/sw/src/ai.cpp | 2 +- source/games/sw/src/draw.cpp | 1 - source/games/sw/src/game.h | 49 +++++++++++++--------------------- source/games/sw/src/menus.cpp | 8 +++--- source/games/sw/src/player.cpp | 2 +- source/games/sw/src/track.cpp | 2 +- source/games/sw/src/weapon.cpp | 2 +- 7 files changed, 26 insertions(+), 40 deletions(-) diff --git a/source/games/sw/src/ai.cpp b/source/games/sw/src/ai.cpp index ba3e2324f..c8598275d 100644 --- a/source/games/sw/src/ai.cpp +++ b/source/games/sw/src/ai.cpp @@ -1579,7 +1579,7 @@ enum AWAY = -1 }; -int FindNewAngle(DSWActor* actor, signed char dir, int DistToMove) +int FindNewAngle(DSWActor* actor, int dir, int DistToMove) { USERp u = actor->u(); SPRITEp sp = &actor->s(); diff --git a/source/games/sw/src/draw.cpp b/source/games/sw/src/draw.cpp index c2ecd25ec..73b4bc3e0 100644 --- a/source/games/sw/src/draw.cpp +++ b/source/games/sw/src/draw.cpp @@ -65,7 +65,6 @@ int display_mirror; static int OverlapDraw = false; extern bool QuitFlag, SpriteInfo; extern bool Voxel; -extern char buffer[]; bool DrawScreen; extern short f_c; diff --git a/source/games/sw/src/game.h b/source/games/sw/src/game.h index e9f17f569..91bf2412a 100644 --- a/source/games/sw/src/game.h +++ b/source/games/sw/src/game.h @@ -600,19 +600,6 @@ void BossHealthMeter(void); // Global variables used for modifying variouse things from the Console -/////////////////////////////////////////////////////////////////////////////////////////// -// -// CALLER - DLL handler -// -/////////////////////////////////////////////////////////////////////////////////////////// -extern unsigned char DLL_Loaded; -extern int DLL_Handle; // Global DLL handle -extern char *DLL_path; // DLL path name - -int DLL_Load(char *DLLpathname); -bool DLL_Unload(int procHandle); -bool DLL_ExecFunc(int procHandle, char *fName); - /////////////////////////////////////////////////////////////////////////////////////////// // // JPlayer @@ -863,7 +850,7 @@ struct PLAYERstruct } // Key stuff - unsigned char HasKey[8]; + uint8_t HasKey[8]; // Weapon stuff short SwordAng; @@ -874,12 +861,12 @@ struct PLAYERstruct PANEL_SPRITEp CurWpn; PANEL_SPRITEp Wpn[MAX_WEAPONS]; PANEL_SPRITEp Chops; - unsigned char WpnRocketType; // rocket type - unsigned char WpnRocketHeat; // 5 to 0 range - unsigned char WpnRocketNuke; // 1, you have it, or you don't - unsigned char WpnFlameType; // Guardian weapons fire - unsigned char WpnFirstType; // First weapon type - Sword/Shuriken - unsigned char WeaponType; // for weapons with secondary functions + uint8_t WpnRocketType; // rocket type + uint8_t WpnRocketHeat; // 5 to 0 range + uint8_t WpnRocketNuke; // 1, you have it, or you don't + uint8_t WpnFlameType; // Guardian weapons fire + uint8_t WpnFirstType; // First weapon type - Sword/Shuriken + uint8_t WeaponType; // for weapons with secondary functions short FirePause; // for sector objects - limits rapid firing // // Inventory Vars @@ -907,30 +894,30 @@ struct PLAYERstruct //char RocketBarrel; char PlayerName[32]; - unsigned char UziShellLeftAlt; - unsigned char UziShellRightAlt; - unsigned char TeamColor; // used in team play and also used in regular mulit-play for show + uint8_t UziShellLeftAlt; + uint8_t UziShellRightAlt; + uint8_t TeamColor; // used in team play and also used in regular mulit-play for show // palette fading up and down for player hit and get items short FadeTics; // Tics between each fade cycle short FadeAmt; // Current intensity of fade bool NightVision; // Is player's night vision active? - unsigned char StartColor; // Darkest color in color range being used + uint8_t StartColor; // Darkest color in color range being used //short electro[64]; bool IsAI; // Is this and AI character? short fta,ftq; // First time active and first time quote, for talking in multiplayer games short NumFootPrints; // Number of foot prints left to lay down - unsigned char WpnUziType; // Toggle between single or double uzi's if you own 2. - unsigned char WpnShotgunType; // Shotgun has normal or fully automatic fire - unsigned char WpnShotgunAuto; // 50-0 automatic shotgun rounds - unsigned char WpnShotgunLastShell; // Number of last shell fired - unsigned char WpnRailType; // Normal Rail Gun or EMP Burst Mode + uint8_t WpnUziType; // Toggle between single or double uzi's if you own 2. + uint8_t WpnShotgunType; // Shotgun has normal or fully automatic fire + uint8_t WpnShotgunAuto; // 50-0 automatic shotgun rounds + uint8_t WpnShotgunLastShell; // Number of last shell fired + uint8_t WpnRailType; // Normal Rail Gun or EMP Burst Mode bool Bloody; // Is player gooey from the slaughter? bool InitingNuke; bool TestNukeInit; bool NukeInitialized; // Nuke already has counted down short FistAng; // KungFu attack angle - unsigned char WpnKungFuMove; // KungFu special moves + uint8_t WpnKungFuMove; // KungFu special moves short HitBy; // SpriteNum of whatever player was last hit by short Reverb; // Player's current reverb setting short Heads; // Number of Accursed Heads orbiting player @@ -2061,7 +2048,7 @@ extern int16_t StatDamageList[STAT_DAMAGE_LIST_SIZE]; /////////////////////////////////////////////////////////////// #define COLOR_PAIN 128 // Light red range -extern void SetFadeAmt(PLAYERp pp, short damage, unsigned char startcolor); +extern void SetFadeAmt(PLAYERp pp, short damage, uint8_t startcolor); extern void DoPaletteFlash(PLAYERp pp); extern bool NightVision; diff --git a/source/games/sw/src/menus.cpp b/source/games/sw/src/menus.cpp index 4bf74c606..52a6f2415 100644 --- a/source/games/sw/src/menus.cpp +++ b/source/games/sw/src/menus.cpp @@ -78,9 +78,9 @@ static int faderamp[32] = typedef struct RGB_color_typ { - unsigned char red; - unsigned char green; - unsigned char blue; + uint8_t red; + uint8_t green; + uint8_t blue; } RGB_color, * RGB_color_ptr; @@ -88,7 +88,7 @@ typedef struct RGB_color_typ // Set the amount of redness for damage // the player just took ////////////////////////////////////////// -void SetFadeAmt(PLAYERp pp, short damage, unsigned char startcolor) +void SetFadeAmt(PLAYERp pp, short damage, uint8_t startcolor) { const int FADE_DAMAGE_FACTOR = 3; // 100 health / 32 shade cycles = 3.125 diff --git a/source/games/sw/src/player.cpp b/source/games/sw/src/player.cpp index d5a8ea7d3..672fcebbb 100644 --- a/source/games/sw/src/player.cpp +++ b/source/games/sw/src/player.cpp @@ -124,7 +124,7 @@ bool ToggleFlyMode = false; extern bool DebugOperate; -//unsigned char synctics, lastsynctics; +//uint8_t synctics, lastsynctics; int ChopTics; diff --git a/source/games/sw/src/track.cpp b/source/games/sw/src/track.cpp index 2db87c8cb..86c7e9ff3 100644 --- a/source/games/sw/src/track.cpp +++ b/source/games/sw/src/track.cpp @@ -731,7 +731,7 @@ SectorObjectSetupBounds(SECTOR_OBJECTp sop) SECTORp *sectp; USERp u = sop->sp_child->u(); - static unsigned char StatList[] = + static uint8_t StatList[] = { STAT_DEFAULT, STAT_MISC, STAT_ITEM, STAT_TRAP, STAT_SPAWN_SPOT, STAT_SOUND_SPOT, STAT_WALL_MOVE, diff --git a/source/games/sw/src/weapon.cpp b/source/games/sw/src/weapon.cpp index 77917d8fd..3a0fada6f 100644 --- a/source/games/sw/src/weapon.cpp +++ b/source/games/sw/src/weapon.cpp @@ -14174,7 +14174,7 @@ InitStar(PLAYERp pp) static short dang[] = {-12, 12}; // static short dang[] = {-0, 0}; - unsigned char i; + uint8_t i; SPRITEp np; USERp nu; short nw;