- All Games: Remove use of ClockTicks and replace with int.

This commit is contained in:
Mitchell Richters 2020-08-26 09:33:40 +10:00
parent 1c8b0a20fb
commit 76776d24d7
21 changed files with 34 additions and 35 deletions

View file

@ -56,7 +56,7 @@ void CChoke::sub_84110(int x, int y)
{
if (!at8)
return;
ClockTicks v4 = gFrameClock;
int v4 = gFrameClock;
gFrameClock = gameclock;
at8->x = x;
at8->y = y;

View file

@ -86,7 +86,7 @@ void CGameMenuItemQAV::Draw(void)
if (raw.Size() > 0)
{
auto data = (QAV*)raw.Data();
ClockTicks backFC = gFrameClock;
int backFC = gFrameClock;
int currentclock = I_GetBuildTime();
gFrameClock = currentclock;
int nTicks = currentclock - lastTick;

View file

@ -98,7 +98,7 @@ void FireInit(void)
void FireProcess(void)
{
static ClockTicks lastUpdate;
static int lastUpdate;
if (gameclock < lastUpdate || lastUpdate + 2 < gameclock)
{
DoFireFrame();

View file

@ -33,8 +33,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
bool bVanilla = false;
ClockTicks gFrameClock;
ClockTicks gFrameTicks;
int gFrameClock;
int gFrameTicks;
int gameclock;
int lastTic;
int gFrame;

View file

@ -30,12 +30,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS
extern ClockTicks gFrameClock;
extern ClockTicks gFrameTicks;
extern int gFrameClock;
extern int gFrameTicks;
extern int gameclock;
extern int lastTic;
extern int gFrame;
//extern ClockTicks gGameClock;
//extern int gGameClock;
extern int gFrameRate;
extern bool bVanilla;

View file

@ -710,7 +710,7 @@ void MyLoadSave::Save(void)
Write(&gFrameClock, sizeof(gFrameClock));
Write(&gFrameTicks, sizeof(gFrameTicks));
Write(&gFrame, sizeof(gFrame));
ClockTicks nGameClock = gameclock;
int nGameClock = gameclock;
Write(&nGameClock, sizeof(nGameClock));
Write(&gLevelTime, sizeof(gLevelTime));
Write(&paused, sizeof(paused));

View file

@ -40,7 +40,7 @@ BEGIN_BLD_NS
MapRecord *gStartNewGame = 0;
PACKETMODE gPacketMode = PACKETMODE_1;
ClockTicks gNetFifoClock = 0;
int gNetFifoClock = 0;
int gNetFifoTail = 0;
int gNetFifoHead[8];
int gPredictTail = 0;

View file

@ -45,7 +45,7 @@ enum NETWORKMODE {
extern MapRecord *gStartNewGame;
extern PACKETMODE gPacketMode;
extern ClockTicks gNetFifoClock;
extern int gNetFifoClock;
extern int gNetFifoTail;
extern int gNetFifoHead[8];
extern int gPredictTail;

View file

@ -856,7 +856,7 @@ void playerReset(PLAYER *pPlayer)
}
int dword_21EFB0[8];
ClockTicks dword_21EFD0[8];
int dword_21EFD0[8];
void playerInit(int nPlayer, unsigned int a2)
{

View file

@ -230,7 +230,7 @@ extern bool gRedFlagDropped;
extern PROFILE gProfile[kMaxPlayers];
extern int dword_21EFB0[kMaxPlayers];
extern ClockTicks dword_21EFD0[kMaxPlayers];
extern int dword_21EFD0[kMaxPlayers];
extern AMMOINFO gAmmoInfo[];
extern POWERUPINFO gPowerUpInfo[kMaxPowerUps];

View file

@ -446,7 +446,7 @@ private:
//
//---------------------------------------------------------------------------
void viewDrawCtfHudVanilla(ClockTicks arg)
void viewDrawCtfHudVanilla(int arg)
{
FString gTempStr;
int x = 1, y = 1;
@ -477,7 +477,7 @@ private:
//
//---------------------------------------------------------------------------
void flashTeamScore(ClockTicks arg, int team, bool show)
void flashTeamScore(int arg, int team, bool show)
{
dassert(0 == team || 1 == team); // 0: blue, 1: red
@ -498,7 +498,7 @@ private:
//
//---------------------------------------------------------------------------
void viewDrawCtfHud(ClockTicks arg)
void viewDrawCtfHud(int arg)
{
if (hud_size == Hud_Nothing)
{
@ -744,7 +744,7 @@ private:
//
//---------------------------------------------------------------------------
public:
void UpdateStatusBar(ClockTicks arg)
void UpdateStatusBar(int arg)
{
PLAYER* pPlayer = gView;
XSPRITE* pXSprite = pPlayer->pXSprite;
@ -822,7 +822,7 @@ static void UpdateFrame(void)
twod->AddFlatFill(windowxy1.x - 3, windowxy2.y + 1, windowxy2.x + 1, windowxy2.y + 4, tex, 0, 1, 0xff2a2a2a);
}
void UpdateStatusBar(ClockTicks arg)
void UpdateStatusBar(int arg)
{
DBloodStatusBar sbar;

View file

@ -346,7 +346,7 @@ void viewInit(void)
gViewMap.sub_25C38(0, 0, gZoom, 0);
}
void viewDrawInterface(ClockTicks arg)
void viewDrawInterface(int arg)
{
UpdateStatusBar(arg);
}
@ -647,13 +647,13 @@ int32_t g_frameRate;
void viewDrawScreen(bool sceneonly)
{
int nPalette = 0;
static ClockTicks lastUpdate;
static int lastUpdate;
int defaultHoriz = r_horizcenter ? 100 : 90;
#ifdef USE_OPENGL
polymostcenterhoriz = defaultHoriz;
#endif
ClockTicks delta = gameclock - lastUpdate;
int delta = gameclock - lastUpdate;
if (delta < 0)
delta = 0;
lastUpdate = gameclock;

View file

@ -154,9 +154,9 @@ void CalcInterpolations(void);
void RestoreInterpolations(void);
void viewDrawText(int nFont, const char *pString, int x, int y, int nShade, int nPalette, int position, char shadow, unsigned int nStat = 0, uint8_t alpha = 255);
void InitStatusBar(void);
void UpdateStatusBar(ClockTicks arg);
void UpdateStatusBar(int arg);
void viewInit(void);
void viewDrawInterface(ClockTicks arg);
void viewDrawInterface(int arg);
void viewProcessSprites(int32_t cX, int32_t cY, int32_t cZ, int32_t cA, int32_t smooth);
void CalcOtherPosition(spritetype *pSprite, int *pX, int *pY, int *pZ, int *vsectnum, int nAng, int zm);
void CalcPosition(spritetype *pSprite, int *pX, int *pY, int *pZ, int *vsectnum, int nAng, int zm);

View file

@ -950,7 +950,6 @@ static FORCE_INLINE char *Bstrncpyz(char *dst, const char *src, bsize_t n)
#include "fix16.h"
#include "vectors.h"
using ClockTicks = int;
inline FVector3 GetSoundPos(const vec3_t *pos)
{

View file

@ -97,7 +97,7 @@ int myconnectindex, numplayers;
int connecthead, connectpoint2[MAXMULTIPLAYERS];
int32_t xres = -1, yres = -1, bpp = 0;
auto vsnprintfptr = vsnprintf; // This is an inline in Visual Studio but we need an address for it to satisfy the MinGW compiled libraries.
static ClockTicks lastototalclk;
static int lastototalclk;
static uint64_t elapsedTime;
static uint64_t lastTime;
@ -1125,7 +1125,7 @@ void S_SetSoundPaused(int state)
}
}
double CalcSmoothRatio(ClockTicks totalclk, ClockTicks ototalclk, int realgameticspersec)
double CalcSmoothRatio(int totalclk, int ototalclk, int realgameticspersec)
{
double ratio, result;

View file

@ -192,7 +192,7 @@ void S_ResumeSound(bool notsfx);
void S_SetSoundPaused(int state);
void G_FatalEngineError(void);
double CalcSmoothRatio(ClockTicks totalclk, ClockTicks ototalclk, int realgameticspersec);
double CalcSmoothRatio(int totalclk, int ototalclk, int realgameticspersec);
enum
{
MaxSmoothRatio = FRACUNIT

View file

@ -110,14 +110,14 @@ int animatevel[MAXANIMATES];
int16_t clouds[256];
int16_t cloudx;
int16_t cloudy;
ClockTicks cloudclock;
int cloudclock;
int16_t spriteq[1024];
int16_t cyclers[MAXCYCLERS][6];
int16_t mirrorsector[64];
int16_t mirrorwall[64];
ClockTicks lockclock;
int lockclock;
// Redneck Rampage
int wupass;

View file

@ -103,14 +103,14 @@ extern int animatevel[MAXANIMATES];
extern int16_t clouds[256];
extern int16_t cloudx;
extern int16_t cloudy;
extern ClockTicks cloudclock;
extern int cloudclock;
extern int16_t spriteq[1024];
extern int16_t cyclers[MAXCYCLERS][6];
extern int16_t mirrorsector[64];
extern int16_t mirrorwall[64];
extern ClockTicks lockclock;
extern int lockclock;
extern int wupass;
extern int chickenplant;

View file

@ -169,7 +169,7 @@ inline bool playrunning()
return (paused == 0 || (paused == 1 && (ud.recstat == 2 || ud.multimode > 1)));
}
inline double calc_smoothratio(ClockTicks totalclk, ClockTicks ototalclk)
inline double calc_smoothratio(int totalclk, int ototalclk)
{
double smoothratio = CalcSmoothRatio(totalclk, ototalclk, REALGAMETICSPERSEC);
return (playrunning() ? smoothratio : MaxSmoothRatio);

View file

@ -2317,7 +2317,7 @@ void AudioUpdate(void); // stupid
extern short LastSaveNum;
void LoadSaveMsg(const char *msg);
void UpdateStatusBar(ClockTicks arg);
void UpdateStatusBar(int arg);
void InitFonts();
int32_t registerosdcommands(void);
void registerinputcommands();

View file

@ -940,7 +940,7 @@ private:
//
//---------------------------------------------------------------------------
public:
void UpdateStatusBar(ClockTicks arg)
void UpdateStatusBar(int arg)
{
int nPalette = 0;
double inv_x, inv_y;
@ -1007,7 +1007,7 @@ static void UpdateFrame(void)
//
//---------------------------------------------------------------------------
void UpdateStatusBar(ClockTicks arg)
void UpdateStatusBar(int arg)
{
DSWStatusBar sbar;