From ac3925f64d4c4fe2075798fb064c43a94237302f Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sat, 18 Jul 2020 01:40:18 +0200 Subject: [PATCH] - cleanup --- source/games/duke/src/player.h | 1 - source/games/duke/src/zz_game.cpp | 4 ++++ source/games/duke/src/zz_player.cpp | 31 ++++++++++------------------- 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/source/games/duke/src/player.h b/source/games/duke/src/player.h index c7edceced..ee4db2714 100644 --- a/source/games/duke/src/player.h +++ b/source/games/duke/src/player.h @@ -61,7 +61,6 @@ extern input_t sync[MAXPLAYERS]; # define PWEAPON(Player, Weapon, Wmember) (aplWeapon ## Wmember [Weapon][Player]) extern playerdata_t *const g_player; -extern int32_t mouseyaxismode; void P_GetInput(int playerNum); diff --git a/source/games/duke/src/zz_game.cpp b/source/games/duke/src/zz_game.cpp index 6e790df2f..a04a37eed 100644 --- a/source/games/duke/src/zz_game.cpp +++ b/source/games/duke/src/zz_game.cpp @@ -68,6 +68,10 @@ weaponhit hittype[MAXSPRITES]; ActorInfo actorinfo[MAXTILES]; player_struct ps[MAXPLAYERS]; +int32_t PHEIGHT = PHEIGHT_DUKE; + +int32_t lastvisinc; + void app_loop() { diff --git a/source/games/duke/src/zz_player.cpp b/source/games/duke/src/zz_player.cpp index 8b5fb28c6..9b596f25c 100644 --- a/source/games/duke/src/zz_player.cpp +++ b/source/games/duke/src/zz_player.cpp @@ -27,26 +27,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. BEGIN_DUKE_NS +enum +{ + NORMALKEYMOVE = 40, + MAXVEL = ((NORMALKEYMOVE * 2) + 10), + MAXSVEL = ((NORMALKEYMOVE * 2) + 10), + MAXANGVEL = 1024, + MAXHORIZVEL = 256, -int32_t PHEIGHT = PHEIGHT_DUKE; - -int32_t lastvisinc; - -#define TURBOTURNTIME (TICRATE/8) // 7 -#define NORMALTURN 15 -#define PREAMBLETURN 5 -#define NORMALKEYMOVE 40 -#define MAXVEL ((NORMALKEYMOVE*2)+10) -#define MAXSVEL ((NORMALKEYMOVE*2)+10) -#define MAXANGVEL 1024 -#define MAXHORIZVEL 256 -#define ONEEIGHTYSCALE 4 - -#define MOTOTURN 20 -#define MAXVELMOTO 120 - -int32_t g_myAimStat = 0, g_oldAimStat = 0; -int32_t mouseyaxismode = -1; + MOTOTURN = 20, + MAXVELMOTO = 120, +}; enum inputlock_t { @@ -158,7 +149,7 @@ void FinalizeInput(int playerNum, input_t &input, bool vehicle) { loc.q16horz = fix16_clamp(fix16_sadd(loc.q16horz, input.q16horz), F16(-MAXHORIZVEL), F16(MAXHORIZVEL)); if (!synchronized_input) - p->q16horiz += input.q16horz; // will be clamped below in sethorizon. + p->q16horiz += input.q16horz; // will be clamped by the caller because further operations on q16horiz follow. } } }