From 3b6df6a1069b012c941372c94efa321cb5f59287 Mon Sep 17 00:00:00 2001
From: Rye Mutt <rye@bred.dog>
Date: Tue, 30 Jul 2019 16:16:21 -0400
Subject: [PATCH] Fix paused frame overflow(Yes I really was logged in that
 long.)

---
 indra/llcharacter/llmotioncontroller.h | 4 ++--
 indra/llcommon/llframetimer.cpp        | 2 +-
 indra/llcommon/llframetimer.h          | 4 ++--
 indra/llcommon/llkeythrottle.h         | 2 +-
 indra/llmessage/llxfermanager.cpp      | 4 ++--
 indra/llui/llbutton.cpp                | 4 ++--
 indra/llui/llbutton.h                  | 2 +-
 indra/newview/llviewertexture.h        | 2 +-
 indra/newview/llvovolume.cpp           | 2 +-
 9 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/indra/llcharacter/llmotioncontroller.h b/indra/llcharacter/llmotioncontroller.h
index 6e31923ad7..13130f3fa1 100644
--- a/indra/llcharacter/llmotioncontroller.h
+++ b/indra/llcharacter/llmotioncontroller.h
@@ -144,7 +144,7 @@ public:
 	void pauseAllMotions();
 	void unpauseAllMotions();
 	BOOL isPaused() const { return mPaused; }
-    S32 getPausedFrame() const { return mPausedFrame; }
+    U64 getPausedFrame() const { return mPausedFrame; }
 
 	void setTimeStep(F32 step);
     F32 getTimeStep() const { return mTimeStep; }
@@ -218,7 +218,7 @@ protected:
 	F32					mLastTime;
 	BOOL				mHasRunOnce;
 	BOOL				mPaused;
-	S32					mPausedFrame;
+	U64					mPausedFrame;
 	F32					mTimeStep;
 	S32					mTimeStepCount;
 	F32					mLastInterp;
diff --git a/indra/llcommon/llframetimer.cpp b/indra/llcommon/llframetimer.cpp
index b9a7ede28d..57c612703d 100644
--- a/indra/llcommon/llframetimer.cpp
+++ b/indra/llcommon/llframetimer.cpp
@@ -37,7 +37,7 @@ U64 LLFrameTimer::sStartTotalTime = totalTime();
 F64 LLFrameTimer::sFrameTime = 0.0;
 U64 LLFrameTimer::sTotalTime = 0;
 F64 LLFrameTimer::sTotalSeconds = 0.0;
-S32 LLFrameTimer::sFrameCount = 0;
+U64 LLFrameTimer::sFrameCount = 0;
 U64 LLFrameTimer::sFrameDeltaTime = 0;
 const F64 USEC_TO_SEC_F64 = 0.000001;
 
diff --git a/indra/llcommon/llframetimer.h b/indra/llcommon/llframetimer.h
index 81bd5da8a3..001268a513 100644
--- a/indra/llcommon/llframetimer.h
+++ b/indra/llcommon/llframetimer.h
@@ -68,7 +68,7 @@ public:
 	// Call this method once, and only once, per frame to update the current frame count.
 	static void updateFrameCount()					{ sFrameCount++; }
 
-	static U32  getFrameCount()						{ return sFrameCount; }
+	static U64  getFrameCount()						{ return sFrameCount; }
 
 	static F32	getFrameDeltaTimeF32();
 
@@ -127,7 +127,7 @@ protected:
 	static F64 sTotalSeconds;
 
 	// Total number of frames elapsed in application
-	static S32 sFrameCount;
+	static U64 sFrameCount;
 
 	//
 	// Member data
diff --git a/indra/llcommon/llkeythrottle.h b/indra/llcommon/llkeythrottle.h
index 41eb0e6664..a6995b87af 100644
--- a/indra/llcommon/llkeythrottle.h
+++ b/indra/llcommon/llkeythrottle.h
@@ -82,7 +82,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 e962c53576..ffc20bfe51 100644
--- a/indra/llmessage/llxfermanager.cpp
+++ b/indra/llmessage/llxfermanager.cpp
@@ -200,7 +200,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;
 	}
 
@@ -211,7 +211,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 883733ee93..608812643b 100644
--- a/indra/llui/llbutton.cpp
+++ b/indra/llui/llbutton.cpp
@@ -453,7 +453,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 007f2405e8..f2a9031ff5 100644
--- a/indra/llui/llbutton.h
+++ b/indra/llui/llbutton.h
@@ -300,7 +300,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/llviewertexture.h b/indra/newview/llviewertexture.h
index a554f2fd07..ac698c1447 100644
--- a/indra/newview/llviewertexture.h
+++ b/indra/newview/llviewertexture.h
@@ -607,7 +607,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 5547cd180a..4c304cee50 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4781,7 +4781,7 @@ void LLRiggedVolume::update(const LLMeshSkinInfo* skin, LLVOAvatar* avatar, cons
         bool is_paused = avatar && avatar->areAnimationsPaused();
 		if (is_paused)
 		{
-            S32 frames_paused = LLFrameTimer::getFrameCount() - avatar->getMotionController().getPausedFrame();
+            U64 frames_paused = LLFrameTimer::getFrameCount() - avatar->getMotionController().getPausedFrame();
             if (frames_paused > 2)
             {
                 return;
-- 
GitLab