summaryrefslogtreecommitdiff
path: root/indra/newview/llagentpilot.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llagentpilot.cpp')
-rwxr-xr-xindra/newview/llagentpilot.cpp61
1 files changed, 31 insertions, 30 deletions
diff --git a/indra/newview/llagentpilot.cpp b/indra/newview/llagentpilot.cpp
index c7872fc5f6..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,20 +88,21 @@ 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.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;
@@ -128,16 +129,16 @@ 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.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();
@@ -171,13 +172,13 @@ 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.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];
@@ -194,11 +195,11 @@ 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;
- 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;
@@ -232,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();
@@ -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,16 +256,16 @@ void LLAgentPilot::startPlayback()
mCurrentAction = 0;
mTimer.reset();
- if (mActions.count())
+ 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;
}
}
@@ -291,7 +292,7 @@ void LLAgentPilot::moveCamera()
if (!getOverrideCamera())
return;
- if (mCurrentAction<mActions.count())
+ if (mCurrentAction<mActions.size())
{
S32 start_index = llmax(mCurrentAction-1,0);
S32 end_index = mCurrentAction;
@@ -305,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;
}
@@ -331,7 +332,7 @@ void LLAgentPilot::updateTarget()
{
if (mPlaying)
{
- if (mCurrentAction < mActions.count())
+ if (mCurrentAction < mActions.size())
{
if (0 == mCurrentAction)
{
@@ -344,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;
}
@@ -355,7 +356,7 @@ void LLAgentPilot::updateTarget()
//gAgent.stopAutoPilot();
mCurrentAction++;
- if (mCurrentAction < mActions.count())
+ if (mCurrentAction < mActions.size())
{
gAgent.startAutoPilotGlobal(mActions[mCurrentAction].mTarget);
moveCamera();
@@ -368,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();
}
}