Fix paused frame overflow, thanks Rye!
This commit is contained in:
@@ -162,7 +162,7 @@ public:
|
||||
void pauseAllMotions();
|
||||
void unpauseAllMotions();
|
||||
BOOL isPaused() const { return mPaused; }
|
||||
U32 getPausedFrame() const { return mPausedFrame; }
|
||||
U64 getPausedFrame() const { return mPausedFrame; }
|
||||
//<singu>
|
||||
void requestPause(std::vector<LLAnimPauseRequest>& avatar_pause_handles);
|
||||
void pauseAllSyncedCharacters(std::vector<LLAnimPauseRequest>& avatar_pause_handles);
|
||||
@@ -252,7 +252,7 @@ protected:
|
||||
F32 mLastTime;
|
||||
BOOL mHasRunOnce;
|
||||
BOOL mPaused;
|
||||
U32 mPausedFrame;
|
||||
U64 mPausedFrame;
|
||||
F32 mTimeStep;
|
||||
S32 mTimeStepCount;
|
||||
F32 mLastInterp;
|
||||
|
||||
@@ -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 <boost/io/ios_state.hpp>
|
||||
|
||||
//static
|
||||
U32 LLFrameTimer::sFrameCount;
|
||||
U64 LLFrameTimer::sFrameCount;
|
||||
|
||||
double innerloop_count = 0;
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -88,7 +88,7 @@ protected:
|
||||
}
|
||||
static U64 getFrame() // Return the current frame number
|
||||
{
|
||||
return (U64) LLFrameTimer::getFrameCount();
|
||||
return LLFrameTimer::getFrameCount();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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++;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -621,7 +621,7 @@ private:
|
||||
BOOL mAutoPilotUseRotation;
|
||||
LLVector3 mAutoPilotTargetFacing;
|
||||
F32 mAutoPilotTargetDist;
|
||||
S32 mAutoPilotNoProgressFrameCount;
|
||||
U64 mAutoPilotNoProgressFrameCount;
|
||||
F32 mAutoPilotRotationThreshold;
|
||||
std::string mAutoPilotBehaviorName;
|
||||
void (*mAutoPilotFinishedCallback)(BOOL, void *);
|
||||
|
||||
@@ -603,7 +603,7 @@ private:
|
||||
|
||||
LLViewerMediaImpl* mMediaImplp ;
|
||||
BOOL mIsPlaying ;
|
||||
U32 mUpdateVirtualSizeTime ;
|
||||
U64 mUpdateVirtualSizeTime ;
|
||||
|
||||
public:
|
||||
static void updateClass() ;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user