From 2580ca7afdf981b99fcc833e0aa67c33c6fc4102 Mon Sep 17 00:00:00 2001 From: Lirusaito Date: Wed, 31 Jul 2019 14:22:27 -0400 Subject: [PATCH] Fix paused frame overflow, thanks Rye! --- indra/llcharacter/llmotioncontroller.h | 4 ++-- indra/llcommon/aisyncclient.cpp | 4 ++-- indra/llcommon/aisyncclient.h | 6 +++--- indra/llcommon/llframetimer.cpp | 2 +- indra/llcommon/llframetimer.h | 6 +++--- indra/llcommon/llkeythrottle.h | 2 +- indra/llmessage/llxfermanager.cpp | 4 ++-- indra/llui/llbutton.cpp | 4 ++-- indra/llui/llbutton.h | 2 +- indra/newview/llagent.h | 2 +- indra/newview/llviewertexture.h | 2 +- indra/newview/llvovolume.cpp | 2 +- indra/newview/llvovolume.h | 2 +- 13 files changed, 21 insertions(+), 21 deletions(-) diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h index e26d5d088..843cac425 100644 --- a/indra/llcharacter/llmotioncontroller.h +++ b/indra/llcharacter/llmotioncontroller.h @@ -162,7 +162,7 @@ public: void pauseAllMotions(); void unpauseAllMotions(); BOOL isPaused() const { return mPaused; } - U32 getPausedFrame() const { return mPausedFrame; } + U64 getPausedFrame() const { return mPausedFrame; } // void requestPause(std::vector& avatar_pause_handles); void pauseAllSyncedCharacters(std::vector& avatar_pause_handles); @@ -252,7 +252,7 @@ protected: F32 mLastTime; BOOL mHasRunOnce; BOOL mPaused; - U32 mPausedFrame; + U64 mPausedFrame; F32 mTimeStep; S32 mTimeStepCount; F32 mLastInterp; diff --git a/indra/llcommon/aisyncclient.cpp b/indra/llcommon/aisyncclient.cpp index c62d88efb..926197338 100644 --- a/indra/llcommon/aisyncclient.cpp +++ b/indra/llcommon/aisyncclient.cpp @@ -90,7 +90,7 @@ bool operator==(AISyncKey const& key1, AISyncKey const& key2) { // Test if these keys match based on time. - if (std::abs((S32)(key1.mStartFrameCount - key2.mStartFrameCount)) > 1 && + if (std::abs((key1.mStartFrameCount - key2.mStartFrameCount)) > 1 && std::abs(key1.mFrameTimer.getStartTime() - key2.mFrameTimer.getStartTime()) >= sSyncKeyExpirationTime) { return false; @@ -420,7 +420,7 @@ void AISyncServerMap::remove_server(AISyncServer* server) #include //static -U32 LLFrameTimer::sFrameCount; +U64 LLFrameTimer::sFrameCount; double innerloop_count = 0; diff --git a/indra/llcommon/aisyncclient.h b/indra/llcommon/aisyncclient.h index 0f5237f99..eecad2924 100644 --- a/indra/llcommon/aisyncclient.h +++ b/indra/llcommon/aisyncclient.h @@ -56,8 +56,8 @@ struct LLFrameTimer double mStartTime; double mExpiry; static double getCurrentTime(void); - static U32 sFrameCount; - static U32 getFrameCount() { return sFrameCount; } + static U64 sFrameCount; + static U64 getFrameCount() { return sFrameCount; } F64 getStartTime() const { return mStartTime; } void reset(double expiration) { mStartTime = getCurrentTime(); mExpiry = mStartTime + expiration; } bool hasExpired(void) const { return getCurrentTime() > mExpiry; } @@ -114,7 +114,7 @@ class LL_COMMON_API AISyncKey { private: LLFrameTimer mFrameTimer; // This timer is started at the moment the sync key is created. - U32 mStartFrameCount; // The frame count at which the timer was started. + U64 mStartFrameCount; // The frame count at which the timer was started. public: // Constructor. diff --git a/indra/llcommon/llframetimer.cpp b/indra/llcommon/llframetimer.cpp index 94f0c1dee..a79c47081 100644 --- a/indra/llcommon/llframetimer.cpp +++ b/indra/llcommon/llframetimer.cpp @@ -43,7 +43,7 @@ F64 LLFrameTimer::sTotalSeconds = // Current time in seconds since epoch U64_to_F64(LLFrameTimer::sTotalTime) * USEC_TO_SEC_F64; F64 LLFrameTimer::sFrameTime = 0.0; // Current time in seconds since application start, updated together with LLFrameTimer::sTotalTime. // Updated exactly once per frame: -S32 LLFrameTimer::sFrameCount = 0; // Current frame number (number of frames since application start). +U64 LLFrameTimer::sFrameCount = 0; // Current frame number (number of frames since application start). U64 LLFrameTimer::sPrevTotalTime = LLFrameTimer::sStartTotalTime; // Previous (frame) time in microseconds since epoch, updated once per frame. U64 LLFrameTimer::sFrameDeltaTime = 0; // Microseconds between last two calls to LLFrameTimer::updateFrameTimeAndCount. // Mutex for the above. diff --git a/indra/llcommon/llframetimer.h b/indra/llcommon/llframetimer.h index a2b3ffa39..d0787e9bb 100644 --- a/indra/llcommon/llframetimer.h +++ b/indra/llcommon/llframetimer.h @@ -84,12 +84,12 @@ public: } // Return current frame number (the number of frames since application start). - static U32 getFrameCount(void) + static U64 getFrameCount(void) { // sFrameCount is only accessed by the main thread, so no locking is necessary. llassert(is_main_thread()); //sGlobalMutex.lock(); - U32 res = sFrameCount; + U64 res = sFrameCount; //sGlobalMutex.unlock(); return res; } @@ -185,7 +185,7 @@ protected: static F64 sTotalSeconds; // Current frame number (number of frames since application start). - static S32 sFrameCount; + static U64 sFrameCount; static bool sFirstFrameTimerCreated; diff --git a/indra/llcommon/llkeythrottle.h b/indra/llcommon/llkeythrottle.h index 7544ab1d1..3271a5e33 100644 --- a/indra/llcommon/llkeythrottle.h +++ b/indra/llcommon/llkeythrottle.h @@ -88,7 +88,7 @@ protected: } static U64 getFrame() // Return the current frame number { - return (U64) LLFrameTimer::getFrameCount(); + return LLFrameTimer::getFrameCount(); } }; diff --git a/indra/llmessage/llxfermanager.cpp b/indra/llmessage/llxfermanager.cpp index 4cea886c8..3ae02b9f7 100644 --- a/indra/llmessage/llxfermanager.cpp +++ b/indra/llmessage/llxfermanager.cpp @@ -198,7 +198,7 @@ void LLXferManager::updateHostStatus() << " is " << xferp->mXferSize << " bytes" << ", status " << (S32)(xferp->mStatus) << ", waiting for ACK: " << (S32)(xferp->mWaitingForACK) - << " in frame " << (S32) LLFrameTimer::getFrameCount() + << " in frame " << LLFrameTimer::getFrameCount() << LL_ENDL; } @@ -209,7 +209,7 @@ void LLXferManager::updateHostStatus() << " has " << (*iter)->mNumActive << " active, " << (*iter)->mNumPending << " pending" - << " in frame " << (S32) LLFrameTimer::getFrameCount() + << " in frame " << LLFrameTimer::getFrameCount() << LL_ENDL; } #endif // LL_XFER_DIAGNOISTIC_LOGGING diff --git a/indra/llui/llbutton.cpp b/indra/llui/llbutton.cpp index 60eae831c..120c378df 100644 --- a/indra/llui/llbutton.cpp +++ b/indra/llui/llbutton.cpp @@ -461,7 +461,7 @@ BOOL LLButton::handleMouseDown(S32 x, S32 y, MASK mask) if(mMouseDownSignal) (*mMouseDownSignal)(this, LLSD()); mMouseDownTimer.start(); - mMouseDownFrame = (S32) LLFrameTimer::getFrameCount(); + mMouseDownFrame = LLFrameTimer::getFrameCount(); mMouseHeldDownCount = 0; @@ -589,7 +589,7 @@ BOOL LLButton::handleHover(S32 x, S32 y, MASK mask) if (mMouseDownTimer.getStarted()) { F32 elapsed = getHeldDownTime(); - if( mHeldDownDelay <= elapsed && mHeldDownFrameDelay <= (S32)LLFrameTimer::getFrameCount() - mMouseDownFrame) + if( mHeldDownDelay <= elapsed && mHeldDownFrameDelay <= LLFrameTimer::getFrameCount() - mMouseDownFrame) { LLSD param; param["count"] = mMouseHeldDownCount++; diff --git a/indra/llui/llbutton.h b/indra/llui/llbutton.h index 812ea6de1..dfa405f63 100644 --- a/indra/llui/llbutton.h +++ b/indra/llui/llbutton.h @@ -319,7 +319,7 @@ protected: const LLFontGL *mGLFont; - S32 mMouseDownFrame; + U64 mMouseDownFrame; S32 mMouseHeldDownCount; // Counter for parameter passed to held-down callback F32 mHeldDownDelay; // seconds, after which held-down callbacks get called S32 mHeldDownFrameDelay; // frames, after which held-down callbacks get called diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index c31e758e1..17042fd45 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -621,7 +621,7 @@ private: BOOL mAutoPilotUseRotation; LLVector3 mAutoPilotTargetFacing; F32 mAutoPilotTargetDist; - S32 mAutoPilotNoProgressFrameCount; + U64 mAutoPilotNoProgressFrameCount; F32 mAutoPilotRotationThreshold; std::string mAutoPilotBehaviorName; void (*mAutoPilotFinishedCallback)(BOOL, void *); diff --git a/indra/newview/llviewertexture.h b/indra/newview/llviewertexture.h index 5e77c8900..7a04528f3 100644 --- a/indra/newview/llviewertexture.h +++ b/indra/newview/llviewertexture.h @@ -603,7 +603,7 @@ private: LLViewerMediaImpl* mMediaImplp ; BOOL mIsPlaying ; - U32 mUpdateVirtualSizeTime ; + U64 mUpdateVirtualSizeTime ; public: static void updateClass() ; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 3ad3c2565..45ddddf74 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4576,7 +4576,7 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons } } - U32 frame = LLFrameTimer::getFrameCount(); + U64 frame = LLFrameTimer::getFrameCount(); if (copy) { copyVolumeFaces(volume); diff --git a/indra/newview/llvovolume.h b/indra/newview/llvovolume.h index 7fe018940..b76620d24 100644 --- a/indra/newview/llvovolume.h +++ b/indra/newview/llvovolume.h @@ -61,7 +61,7 @@ enum LLVolumeInterfaceType class LLRiggedVolume : public LLVolume { - U32 mFrame; + U64 mFrame; public: LLRiggedVolume(const LLVolumeParams& params) : LLVolume(params, 0.f), mFrame(-1)