From 7dc8d8a344c3833bd254492d271bdf442a869311 Mon Sep 17 00:00:00 2001 From: phr0z3nt04st Date: Tue, 10 Aug 2010 01:10:03 -0500 Subject: [PATCH] Windows compile fixed and ao fixed I think... --- indra/llimage/aes.cpp | 12 ++++++------ indra/llimage/llimagemetadatareader.cpp | 8 ++++---- indra/newview/llao.cpp | 19 +++++++++++++++++++ indra/newview/llao.h | 1 + indra/newview/llvoavatar.cpp | 10 +++++++--- 5 files changed, 37 insertions(+), 13 deletions(-) diff --git a/indra/llimage/aes.cpp b/indra/llimage/aes.cpp index 7a8c874e3..aa8a7dbf8 100644 --- a/indra/llimage/aes.cpp +++ b/indra/llimage/aes.cpp @@ -1304,7 +1304,7 @@ void CRijndael::Encrypt(char const* in, char* result, size_t n, int iMode) char* presult; if(CBC == iMode) //CBC mode, using the Chain { - for(i=0,pin=in,presult=result; i(EMKDU_AES_KEY),"", 24, 16); } catch(std::string error) { llinfos << error << llendl; diff --git a/indra/newview/llao.cpp b/indra/newview/llao.cpp index 0018784e8..8616d9303 100644 --- a/indra/newview/llao.cpp +++ b/indra/newview/llao.cpp @@ -8,13 +8,17 @@ #include "llsdserialize.h" #include "llagent.h" #include "llvoavatar.h" +//this is for debugging ;D +//#define AO_DEBUG +//static variables std::list LLAO::mStandOverrides; std::map LLAO::mOverrides; LLFloaterAO* LLFloaterAO::sInstance; BOOL LLAO::mEnabled = FALSE; F32 LLAO::mPeriod; LLAOStandTimer* LLAO::mTimer = NULL; +S32 LLAO::playingStands = 0; LLAOStandTimer::LLAOStandTimer(F32 period) : LLEventTimer(period) { @@ -23,6 +27,9 @@ BOOL LLAOStandTimer::tick() { if(!mPaused && LLAO::isEnabled() && !LLAO::mStandOverrides.empty()) { +#ifdef AO_DEBUG + llinfos << "tick" << llendl; +#endif LLVOAvatar* avatarp = gAgent.getAvatarObject(); if (avatarp) { @@ -35,7 +42,13 @@ BOOL LLAOStandTimer::tick() { //back is always last played, front is next avatarp->stopMotion(LLAO::mStandOverrides.back()); +#ifdef AO_DEBUG + llinfos << "Stopping " << LLAO::mStandOverrides.back().asString() << llendl; +#endif avatarp->startMotion(LLAO::mStandOverrides.front()); +#ifdef AO_DEBUG + llinfos << "Starting " << LLAO::mStandOverrides.front().asString() << llendl; +#endif LLAO::mStandOverrides.push_back(LLAO::mStandOverrides.front()); LLAO::mStandOverrides.pop_front(); LLFloaterAO* ao = LLFloaterAO::sInstance; @@ -54,6 +67,9 @@ BOOL LLAOStandTimer::tick() void LLAOStandTimer::pause() { if(mPaused) return; +#ifdef AO_DEBUG + llinfos << "Pausing AO Timer...." << llendl; +#endif LLVOAvatar* avatarp = gAgent.getAvatarObject(); if (avatarp) { @@ -68,6 +84,9 @@ void LLAOStandTimer::pause() void LLAOStandTimer::resume() { if(!mPaused) return; +#ifdef AO_DEBUG + llinfos << "Unpausing AO Timer...." << llendl; +#endif LLVOAvatar* avatarp = gAgent.getAvatarObject(); if (avatarp) { diff --git a/indra/newview/llao.h b/indra/newview/llao.h index dd3576cad..2100402ea 100644 --- a/indra/newview/llao.h +++ b/indra/newview/llao.h @@ -21,6 +21,7 @@ class LLAO { public: static void setup(); + static S32 playingStands; static std::map mOverrides; static std::list mStandOverrides; static BOOL isEnabled(){ return mEnabled; } diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 89c5da387..5bccdad4f 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5163,7 +5163,9 @@ BOOL LLVOAvatar::startMotion(const LLUUID& id, F32 time_offset) { if(LLAO::isStand(id)) { - LLAO::mTimer->resume(); + if(LLAO::playingStands == 0) + LLAO::mTimer->resume();//Timer only resumes if its paused, check is inside function. + LLAO::playingStands++; } if(LLAO::mOverrides.find(id) != LLAO::mOverrides.end()) { @@ -5211,10 +5213,12 @@ BOOL LLVOAvatar::stopMotion(const LLUUID& id, BOOL stop_immediate) // if(LLAO::isEnabled()) { - if(LLAO::isStand(id)) + if(LLAO::isStand(id) && LLAO::playingStands > 0) //LLAO::playingStands > 0 stops it from going negative { //help the timer get started again - LLAO::mTimer->pause(); + LLAO::playingStands--; + if(LLAO::playingStands == 0) + LLAO::mTimer->pause();//Timer only pauses if its not paused, check is inside function. } if( (LLAO::mOverrides.find(id) != LLAO::mOverrides.end()) && (id != LLAO::mOverrides[id]) )