From a2e22732f195dc075a733c79f15156752f522a43 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Tue, 30 Jul 2013 19:13:45 -0700 Subject: Summer cleaning - removed a lot of llcommon dependencies to speed up build times consolidated most indra-specific constants in llcommon under indra_constants.h fixed issues with operations on mixed unit types (implicit and explicit) made LL_INFOS() style macros variadic in order to subsume other logging methods such as ll_infos added optional tag output to error recorders --- indra/newview/llagentpilot.cpp | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'indra/newview/llagentpilot.cpp') diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp index c7872fc5f6..0dd107f349 100755 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -97,11 +97,12 @@ void LLAgentPilot::loadTxt(const std::string& filename) llinfos << "Opening pilot file " << filename << llendl; } - mActions.reset(); + mActions.clear(); S32 num_actions; file >> num_actions; + mActions.reserve(num_actions); for (S32 i = 0; i < num_actions; i++) { S32 action_type; @@ -109,7 +110,7 @@ void LLAgentPilot::loadTxt(const std::string& filename) file >> new_action.mTime >> action_type; file >> new_action.mTarget.mdV[VX] >> new_action.mTarget.mdV[VY] >> new_action.mTarget.mdV[VZ]; new_action.mType = (EActionType)action_type; - mActions.put(new_action); + mActions.push_back(new_action); } mOverrideCamera = false; @@ -137,7 +138,7 @@ void LLAgentPilot::loadXML(const std::string& filename) llinfos << "Opening pilot file " << filename << llendl; } - mActions.reset(); + mActions.clear(); LLSD record; while (!file.eof() && LLSDParser::PARSE_FAILURE != LLSDSerialize::fromXML(record, file)) { @@ -150,7 +151,7 @@ void LLAgentPilot::loadXML(const std::string& filename) action.mCameraXAxis = ll_vector3_from_sd(record["camera_xaxis"]); action.mCameraYAxis = ll_vector3_from_sd(record["camera_yaxis"]); action.mCameraZAxis = ll_vector3_from_sd(record["camera_zaxis"]); - mActions.put(action); + mActions.push_back(action); } mOverrideCamera = true; file.close(); @@ -174,10 +175,10 @@ void LLAgentPilot::saveTxt(const std::string& filename) llinfos << "Couldn't open " << filename << ", aborting agentpilot save!" << llendl; } - file << mActions.count() << '\n'; + file << mActions.size() << '\n'; S32 i; - for (i = 0; i < mActions.count(); i++) + for (i = 0; i < mActions.size(); i++) { file << mActions[i].mTime << "\t" << mActions[i].mType << "\t"; file << std::setprecision(32) << mActions[i].mTarget.mdV[VX] << "\t" << mActions[i].mTarget.mdV[VY] << "\t" << mActions[i].mTarget.mdV[VZ]; @@ -198,7 +199,7 @@ void LLAgentPilot::saveXML(const std::string& filename) } S32 i; - for (i = 0; i < mActions.count(); i++) + for (i = 0; i < mActions.size(); i++) { Action& action = mActions[i]; LLSD record; @@ -217,7 +218,7 @@ void LLAgentPilot::saveXML(const std::string& filename) void LLAgentPilot::startRecord() { - mActions.reset(); + mActions.clear(); mTimer.reset(); addAction(STRAIGHT); mRecording = TRUE; @@ -244,7 +245,7 @@ void LLAgentPilot::addAction(enum EActionType action_type) action.mCameraYAxis = cam->getYAxis(); action.mCameraZAxis = cam->getZAxis(); mLastRecordTime = (F32)action.mTime; - mActions.put(action); + mActions.push_back(action); } void LLAgentPilot::startPlayback() @@ -255,7 +256,7 @@ void LLAgentPilot::startPlayback() mCurrentAction = 0; mTimer.reset(); - if (mActions.count()) + if (mActions.size()) { llinfos << "Starting playback, moving to waypoint 0" << llendl; gAgent.startAutoPilotGlobal(mActions[0].mTarget); @@ -291,7 +292,7 @@ void LLAgentPilot::moveCamera() if (!getOverrideCamera()) return; - if (mCurrentAction Date: Fri, 9 Aug 2013 17:11:19 -0700 Subject: second phase summer cleaning replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc. --- indra/newview/llagentpilot.cpp | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) (limited to 'indra/newview/llagentpilot.cpp') diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp index 0dd107f349..44589f0d57 100755 --- a/indra/newview/llagentpilot.cpp +++ b/indra/newview/llagentpilot.cpp @@ -72,7 +72,7 @@ void LLAgentPilot::load() } else { - lldebugs << "no autopilot file found" << llendl; + LL_DEBUGS() << "no autopilot file found" << LL_ENDL; return; } } @@ -88,13 +88,13 @@ void LLAgentPilot::loadTxt(const std::string& filename) if (!file) { - lldebugs << "Couldn't open " << filename - << ", aborting agentpilot load!" << llendl; + LL_DEBUGS() << "Couldn't open " << filename + << ", aborting agentpilot load!" << LL_ENDL; return; } else { - llinfos << "Opening pilot file " << filename << llendl; + LL_INFOS() << "Opening pilot file " << filename << LL_ENDL; } mActions.clear(); @@ -129,13 +129,13 @@ void LLAgentPilot::loadXML(const std::string& filename) if (!file) { - lldebugs << "Couldn't open " << filename - << ", aborting agentpilot load!" << llendl; + LL_DEBUGS() << "Couldn't open " << filename + << ", aborting agentpilot load!" << LL_ENDL; return; } else { - llinfos << "Opening pilot file " << filename << llendl; + LL_INFOS() << "Opening pilot file " << filename << LL_ENDL; } mActions.clear(); @@ -172,7 +172,7 @@ void LLAgentPilot::saveTxt(const std::string& filename) if (!file) { - llinfos << "Couldn't open " << filename << ", aborting agentpilot save!" << llendl; + LL_INFOS() << "Couldn't open " << filename << ", aborting agentpilot save!" << LL_ENDL; } file << mActions.size() << '\n'; @@ -195,7 +195,7 @@ void LLAgentPilot::saveXML(const std::string& filename) if (!file) { - llinfos << "Couldn't open " << filename << ", aborting agentpilot save!" << llendl; + LL_INFOS() << "Couldn't open " << filename << ", aborting agentpilot save!" << LL_ENDL; } S32 i; @@ -233,7 +233,7 @@ void LLAgentPilot::stopRecord() void LLAgentPilot::addAction(enum EActionType action_type) { - llinfos << "Adding waypoint: " << gAgent.getPositionGlobal() << llendl; + LL_INFOS() << "Adding waypoint: " << gAgent.getPositionGlobal() << LL_ENDL; Action action; action.mType = action_type; action.mTarget = gAgent.getPositionGlobal(); @@ -258,14 +258,14 @@ void LLAgentPilot::startPlayback() if (mActions.size()) { - llinfos << "Starting playback, moving to waypoint 0" << llendl; + LL_INFOS() << "Starting playback, moving to waypoint 0" << LL_ENDL; gAgent.startAutoPilotGlobal(mActions[0].mTarget); moveCamera(); mStarted = FALSE; } else { - llinfos << "No autopilot data, cancelling!" << llendl; + LL_INFOS() << "No autopilot data, cancelling!" << LL_ENDL; mPlaying = FALSE; } } @@ -306,7 +306,7 @@ void LLAgentPilot::moveCamera() if ((t<0.0)||(t>1.0)) { - llwarns << "mCurrentAction is invalid, t = " << t << llendl; + LL_WARNS() << "mCurrentAction is invalid, t = " << t << LL_ENDL; return; } @@ -345,7 +345,7 @@ void LLAgentPilot::updateTarget() { if (!mStarted) { - llinfos << "At start, beginning playback" << llendl; + LL_INFOS() << "At start, beginning playback" << LL_ENDL; mTimer.reset(); mStarted = TRUE; } @@ -369,17 +369,17 @@ void LLAgentPilot::updateTarget() { if ((mNumRuns < 0) || (mNumRuns > 0)) { - llinfos << "Looping, restarting playback" << llendl; + LL_INFOS() << "Looping, restarting playback" << LL_ENDL; startPlayback(); } else if (mQuitAfterRuns) { - llinfos << "Done with all runs, quitting viewer!" << llendl; + LL_INFOS() << "Done with all runs, quitting viewer!" << LL_ENDL; LLAppViewer::instance()->forceQuit(); } else { - llinfos << "Done with all runs, disabling pilot" << llendl; + LL_INFOS() << "Done with all runs, disabling pilot" << LL_ENDL; stopPlayback(); } } -- cgit v1.2.3