Commit 96c0005a authored by NY00123's avatar NY00123
Browse files

SW: Trim q16 angle and horiz during demo playback/recording.

This uses the newly introduced PEDANTIC_MODE macro.
parent fe5db301
......@@ -5244,6 +5244,11 @@ getinput(SW_PACKET *loc)
q16avel = fix16_clamp(q16avel, -fix16_from_int(MAXANGVEL), fix16_from_int(MAXANGVEL));
q16horz = fix16_clamp(q16horz, -fix16_from_int(MAXHORIZVEL), fix16_from_int(MAXHORIZVEL));
if (PEDANTIC_MODE)
{
q16avel = fix16_floor(q16avel);
q16horz = fix16_floor(q16horz);
}
momx = mulscale9(vel, sintable[NORM_ANGLE(fix16_to_int(newpp->q16ang) + 512)]);
momy = mulscale9(vel, sintable[NORM_ANGLE(fix16_to_int(newpp->q16ang))]);
......
......@@ -112,6 +112,10 @@ int krand1(void);
#define PRINT(line,str) DebugPrint(line,str)
// Demo compatibility mode
extern SWBOOL DemoPlaying, DemoRecording, DemoEdit, DemoMode;
#define PEDANTIC_MODE (DemoPlaying || DemoRecording || DemoEdit || DemoMode)
#include "pragmas.h"
......
......@@ -1607,6 +1607,8 @@ DoPlayerTurn(PLAYERp pp)
pp->q16ang += fix16_sdiv(fix16_mul(q16avel, fix16_from_int(synctics)), fix16_from_int(32));
pp->q16ang = NORM_Q16ANGLE(pp->q16ang);
if (PEDANTIC_MODE)
pp->q16ang = fix16_floor(pp->q16ang);
// update players sprite angle
// NOTE: It's also updated in UpdatePlayerSprite, but needs to be
......
Markdown is supported
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