Commit 4c71e46e authored by NY00123's avatar NY00123 Committed by Evan Ramos
Browse files

Add PedanticQ16AngleFloor to sw/src/game.h and use it in DoPlayerTurn

parent 0c6a86e0
......@@ -114,6 +114,8 @@ int krand1(void);
#include "pragmas.h"
extern SWBOOL PedanticMode;
extern SWBOOL InterpolateSectObj;
//
// Map directions/degrees
......@@ -388,6 +390,11 @@ static fix16_t FORCE_INLINE GetQ16AngleFromVect(int32_t xvect, int32_t yvect)
return (PedanticMode ? getq16angle : gethiq16angle)(xvect, yvect);
}
static fix16_t FORCE_INLINE PedanticQ16AngleFloor(fix16_t ang)
{
return PedanticMode ? fix16_floor(ang) : ang;
}
int StdRandomRange(int range);
#define STD_RANDOM_P2(pwr_of_2) (MOD_P2(rand(),(pwr_of_2)))
#define STD_RANDOM_RANGE(range) (StdRandomRange(range))
......@@ -826,9 +833,6 @@ extern int PlayerYellVocs[MAX_YELLSOUNDS];
void BossHealthMeter(void);
extern SWBOOL PedanticMode;
extern SWBOOL InterpolateSectObj;
// Global variables used for modifying variouse things from the Console
///////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -1630,9 +1630,7 @@ DoPlayerTurn(PLAYERp pp, fix16_t *pq16ang, fix16_t q16angvel)
q16angvel += fix16_sdiv(q16angvel, fix16_from_int(4));
*pq16ang += fix16_sdiv(fix16_mul(q16angvel, fix16_from_int(synctics)), fix16_from_int(32));
*pq16ang = NORM_Q16ANGLE(*pq16ang);
if (PedanticMode)
*pq16ang = fix16_floor(*pq16ang);
*pq16ang = PedanticQ16AngleFloor(NORM_Q16ANGLE(*pq16ang));
// update players sprite angle
// NOTE: It's also updated in UpdatePlayerSprite, but needs to be
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment