diff --git a/src/d_main.cpp b/src/d_main.cpp index 540b002b3..4e1655747 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -938,7 +938,7 @@ void D_Display () else { // wipe update - unsigned int wipestart, nowtime, diff; + uint64_t wipestart, nowtime, diff; bool done; GSnd->SetSfxPaused(true, 1); @@ -1053,10 +1053,10 @@ void D_DoomLoop () } else { + I_StartTic (); TryRunTics (); // will run at least one tic } // Update display, next frame, with current state. - I_StartTic (); D_Display (); if (wantToRestart) { diff --git a/src/d_net.cpp b/src/d_net.cpp index ba1262025..e8711bda5 100644 --- a/src/d_net.cpp +++ b/src/d_net.cpp @@ -113,9 +113,9 @@ bool remoteresend[MAXNETNODES]; // set when local needs tics int resendto[MAXNETNODES]; // set when remote needs tics int resendcount[MAXNETNODES]; -unsigned int lastrecvtime[MAXPLAYERS]; // [RH] Used for pings -unsigned int currrecvtime[MAXPLAYERS]; -unsigned int lastglobalrecvtime; // Identify the last time a packet was received. +uint64_t lastrecvtime[MAXPLAYERS]; // [RH] Used for pings +uint64_t currrecvtime[MAXPLAYERS]; +uint64_t lastglobalrecvtime; // Identify the last time a packet was received. bool hadlate; int netdelay[MAXNETNODES][BACKUPTICS]; // Used for storing network delay times. int lastaverage; diff --git a/src/dobject.cpp b/src/dobject.cpp index 9046d7337..df8bb1acb 100644 --- a/src/dobject.cpp +++ b/src/dobject.cpp @@ -615,7 +615,7 @@ void DObject::CheckIfSerialized () const DEFINE_ACTION_FUNCTION(DObject, MSTime) { - ACTION_RETURN_INT(I_msTime()); + ACTION_RETURN_INT((uint32_t)I_msTime()); } void *DObject::ScriptVar(FName field, PType *type) diff --git a/src/gl/utility/gl_clock.cpp b/src/gl/utility/gl_clock.cpp index 8ad3b1cc8..df96fb6b8 100644 --- a/src/gl/utility/gl_clock.cpp +++ b/src/gl/utility/gl_clock.cpp @@ -187,8 +187,8 @@ static void AppendLightStats(FString &out) ADD_STAT(rendertimes) { static FString buff; - static int lasttime=0; - int t=I_msTime(); + static int64_t lasttime=0; + int64_t t=I_msTime(); if (t-lasttime>1000) { buff.Truncate(0); @@ -217,7 +217,7 @@ void AppendMissingTextureStats(FString &out); static int printstats; static bool switchfps; -static unsigned int waitstart; +static uint64_t waitstart; EXTERN_CVAR(Bool, vid_fps) void CheckBench() diff --git a/src/p_glnodes.cpp b/src/p_glnodes.cpp index bac573565..e1510145e 100644 --- a/src/p_glnodes.cpp +++ b/src/p_glnodes.cpp @@ -955,7 +955,7 @@ bool P_CheckNodes(MapData * map, bool rebuilt, int buildtime) if (!loaded) { // none found - we have to build new ones! - unsigned int startTime, endTime; + uint64_t startTime, endTime; startTime = I_msTime (); TArray polyspots, anchors; @@ -973,7 +973,7 @@ bool P_CheckNodes(MapData * map, bool rebuilt, int buildtime) builder.Extract (level); endTime = I_msTime (); DPrintf (DMSG_NOTIFY, "BSP generation took %.3f sec (%u segs)\n", (endTime - startTime) * 0.001, level.segs.Size()); - buildtime = endTime - startTime; + buildtime = (int32_t)(endTime - startTime); } } diff --git a/src/p_setup.cpp b/src/p_setup.cpp index 336d4452e..dfa7ecb26 100644 --- a/src/p_setup.cpp +++ b/src/p_setup.cpp @@ -3933,7 +3933,7 @@ void P_SetupLevel (const char *lumpname, int position) } else reloop = true; - unsigned int startTime=0, endTime=0; + uint64_t startTime=0, endTime=0; bool BuildGLNodes; if (ForceNodeBuild) @@ -3990,7 +3990,7 @@ void P_SetupLevel (const char *lumpname, int position) // If the original nodes being loaded are not GL nodes they will be kept around for // use in P_PointInSubsector to avoid problems with maps that depend on the specific // nodes they were built with (P:AR E1M3 is a good example for a map where this is the case.) - reloop |= P_CheckNodes(map, BuildGLNodes, endTime - startTime); + reloop |= P_CheckNodes(map, BuildGLNodes, (uint32_t)(endTime - startTime)); hasglnodes = true; } else diff --git a/src/r_sky.cpp b/src/r_sky.cpp index eb31e2064..cc84f9fbb 100644 --- a/src/r_sky.cpp +++ b/src/r_sky.cpp @@ -165,7 +165,7 @@ void R_InitSkyMap () // //========================================================================== -void R_UpdateSky (uint32_t mstime) +void R_UpdateSky (uint64_t mstime) { // Scroll the sky double ms = (double)mstime * FRACUNIT; diff --git a/src/r_sky.h b/src/r_sky.h index 39ac77f27..e186ad3ae 100644 --- a/src/r_sky.h +++ b/src/r_sky.h @@ -44,6 +44,6 @@ extern int freelookviewheight; // Called whenever the sky changes. void R_InitSkyMap (); -void R_UpdateSky (uint32_t mstime); +void R_UpdateSky (uint64_t mstime); #endif //__R_SKY_H__ diff --git a/src/textures/animations.cpp b/src/textures/animations.cpp index 7b2aab98b..a9fa4c1bf 100644 --- a/src/textures/animations.cpp +++ b/src/textures/animations.cpp @@ -876,7 +876,7 @@ FDoorAnimation *FTextureManager::FindAnimatedDoor (FTextureID picnum) // //========================================================================== -void FAnimDef::SetSwitchTime (uint32_t mstime) +void FAnimDef::SetSwitchTime (uint64_t mstime) { int speedframe = bDiscrete ? CurFrame : 0; @@ -917,7 +917,7 @@ void FTextureManager::SetTranslation (FTextureID fromtexnum, FTextureID totexnum // //========================================================================== -void FTextureManager::UpdateAnimations (uint32_t mstime) +void FTextureManager::UpdateAnimations (uint64_t mstime) { for (unsigned int j = 0; j < mAnimations.Size(); ++j) { diff --git a/src/textures/textures.h b/src/textures/textures.h index 96bd8d3ca..539d38c43 100644 --- a/src/textures/textures.h +++ b/src/textures/textures.h @@ -90,7 +90,7 @@ struct FAnimDef uint16_t CurFrame; uint8_t AnimType; bool bDiscrete; // taken out of AnimType to have better control - uint32_t SwitchTime; // Time to advance to next frame + uint64_t SwitchTime; // Time to advance to next frame struct FAnimFrame { uint32_t SpeedMin; // Speeds are in ms, not tics @@ -106,7 +106,7 @@ struct FAnimDef ANIM_Random }; - void SetSwitchTime (uint32_t mstime); + void SetSwitchTime (uint64_t mstime); }; struct FSwitchDef @@ -505,7 +505,7 @@ public: int NumTextures () const { return (int)Textures.Size(); } - void UpdateAnimations (uint32_t mstime); + void UpdateAnimations (uint64_t mstime); int GuesstimateNumTextures (); FSwitchDef *FindSwitch (FTextureID texture); @@ -604,8 +604,8 @@ public: void SetSpeed(float fac) { Speed = fac; } FTexture *GetRedirect(bool wantwarped); - uint32_t GenTime; - uint32_t GenTimeBgra; + uint64_t GenTime; + uint64_t GenTimeBgra; float Speed; int WidthOffsetMultiplier, HeightOffsetMultiplier; // [mxd] protected: @@ -613,7 +613,7 @@ protected: uint8_t *Pixels; Span **Spans; - virtual void MakeTexture (uint32_t time); + virtual void MakeTexture (uint64_t time); int NextPo2 (int v); // [mxd] void SetupMultipliers (int width, int height); // [mxd] }; diff --git a/src/textures/warpbuffer.h b/src/textures/warpbuffer.h index 668c40aeb..62b0db13d 100644 --- a/src/textures/warpbuffer.h +++ b/src/textures/warpbuffer.h @@ -35,7 +35,7 @@ #include "textures/textures.h" template -void WarpBuffer(TYPE *Pixels, const TYPE *source, int width, int height, int xmul, int ymul, unsigned time, float Speed, int warptype) +void WarpBuffer(TYPE *Pixels, const TYPE *source, int width, int height, int xmul, int ymul, uint64_t time, float Speed, int warptype) { int ymask = height - 1; int x, y; diff --git a/src/textures/warptexture.cpp b/src/textures/warptexture.cpp index 43a215a2b..2e073c186 100644 --- a/src/textures/warptexture.cpp +++ b/src/textures/warptexture.cpp @@ -86,7 +86,7 @@ bool FWarpTexture::CheckModified () const uint8_t *FWarpTexture::GetPixels () { - uint32_t time = screen->FrameTime; + uint64_t time = screen->FrameTime; if (Pixels == NULL || time != GenTime) { @@ -97,7 +97,7 @@ const uint8_t *FWarpTexture::GetPixels () const uint32_t *FWarpTexture::GetPixelsBgra() { - uint32_t time = screen->FrameTime; + uint64_t time = screen->FrameTime; if (Pixels == NULL || time != GenTime) MakeTexture(time); @@ -119,7 +119,7 @@ const uint32_t *FWarpTexture::GetPixelsBgra() const uint8_t *FWarpTexture::GetColumn (unsigned int column, const Span **spans_out) { - uint32_t time =screen->FrameTime; + uint64_t time =screen->FrameTime; if (Pixels == NULL || time != GenTime) { @@ -148,7 +148,7 @@ const uint8_t *FWarpTexture::GetColumn (unsigned int column, const Span **spans_ } -void FWarpTexture::MakeTexture(uint32_t time) +void FWarpTexture::MakeTexture(uint64_t time) { const uint8_t *otherpix = SourcePic->GetPixels(); diff --git a/src/v_video.cpp b/src/v_video.cpp index 5f774a648..01ae8b428 100644 --- a/src/v_video.cpp +++ b/src/v_video.cpp @@ -870,8 +870,8 @@ void DFrameBuffer::DrawRateStuff () // Draws frame time and cumulative fps if (vid_fps) { - uint32_t ms = screen->FrameTime; - uint32_t howlong = ms - LastMS; + uint64_t ms = screen->FrameTime; + uint64_t howlong = ms - LastMS; if ((signed)howlong >= 0) { char fpsbuff[40]; @@ -888,7 +888,7 @@ void DFrameBuffer::DrawRateStuff () DTA_VirtualHeight, screen->GetHeight() / textScale, DTA_KeepRatio, true, TAG_DONE); - uint32_t thisSec = ms/1000; + uint32_t thisSec = (uint32_t)(ms/1000); if (LastSec < thisSec) { LastCount = FrameCount / (thisSec - LastSec); @@ -903,8 +903,8 @@ void DFrameBuffer::DrawRateStuff () // draws little dots on the bottom of the screen if (ticker) { - int i = I_GetTime(); - int tics = i - LastTic; + int64_t i = I_GetTime(); + int64_t tics = i - LastTic; uint8_t *buffer = GetBuffer(); LastTic = i; @@ -931,6 +931,7 @@ void DFrameBuffer::DrawRateStuff () } else { + int i; for (i = 0; i < tics*2; i += 2) Clear(i, Height-1, i+1, Height, 255, 0); for ( ; i < 20*2; i += 2) Clear(i, Height-1, i+1, Height, 0, 0); } diff --git a/src/v_video.h b/src/v_video.h index 4fae94198..1cbf565af 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -442,7 +442,7 @@ public: virtual void ScaleCoordsFromWindow(int16_t &x, int16_t &y) {} - uint32_t GetLastFPS() const { return LastCount; } + uint64_t GetLastFPS() const { return LastCount; } #ifdef _WIN32 virtual void PaletteChanged () = 0; @@ -463,7 +463,7 @@ protected: DFrameBuffer () {} private: - uint32_t LastMS, LastSec, FrameCount, LastCount, LastTic; + uint64_t LastMS, LastSec, FrameCount, LastCount, LastTic; bool isIn2D = false; };