Merge remote-tracking branch 'thoronador/fix-minor-stuff'

actorid
Marc Zinnschlag 11 years ago
commit 0b2371a05d

@ -333,7 +333,7 @@ int load(Arguments& info)
// Is the user interested in this record type?
bool interested = true;
if (info.types.size() > 0)
if (!info.types.empty())
{
std::vector<std::string>::iterator match;
match = std::find(info.types.begin(), info.types.end(),

@ -124,7 +124,7 @@ void printEffectList(ESM::EffectList effects)
{
int i = 0;
std::vector<ESM::ENAMstruct>::iterator eit;
for (eit = effects.mList.begin(); eit != effects.mList.end(); eit++)
for (eit = effects.mList.begin(); eit != effects.mList.end(); ++eit)
{
std::cout << " Effect[" << i << "]: " << magicEffectLabel(eit->mEffectID)
<< " (" << eit->mEffectID << ")" << std::endl;

@ -214,13 +214,13 @@ QStringList Launcher::GraphicsPage::getAvailableOptions(const QString &key, Ogre
uint row = 0;
Ogre::ConfigOptionMap options = renderer->getConfigOptions();
for (Ogre::ConfigOptionMap::iterator i = options.begin (); i != options.end (); i++, row++)
for (Ogre::ConfigOptionMap::iterator i = options.begin (); i != options.end (); ++i, ++row)
{
Ogre::StringVector::iterator opt_it;
uint idx = 0;
for (opt_it = i->second.possibleValues.begin();
opt_it != i->second.possibleValues.end(); opt_it++, idx++)
opt_it != i->second.possibleValues.end(); ++opt_it, ++idx)
{
if (strcmp (key.toStdString().c_str(), i->first.c_str()) == 0) {
result << ((key == "FSAA") ? QString("MSAA ") : QString("")) + QString::fromStdString((*opt_it).c_str()).simplified();

@ -25,7 +25,7 @@ CSVWorld::DataDisplayDelegate::DataDisplayDelegate(const ValueList &values,
void CSVWorld::DataDisplayDelegate::buildPixmaps ()
{
if (mPixmaps.size() > 0)
if (!mPixmaps.empty())
mPixmaps.clear();
IconList::iterator it = mIcons.begin();
@ -33,7 +33,7 @@ void CSVWorld::DataDisplayDelegate::buildPixmaps ()
while (it != mIcons.end())
{
mPixmaps.push_back (std::make_pair (it->first, it->second.pixmap (mIconSize) ) );
it++;
++it;
}
}

@ -298,7 +298,7 @@ void CSVWorld::Table::revertRecord()
{
std::vector<std::string> revertableIds = listRevertableSelectedIds();
if (revertableIds.size()>0)
if (!revertableIds.empty())
{
if (revertableIds.size()>1)
mDocument.getUndoStack().beginMacro (tr ("Revert multiple records"));
@ -318,7 +318,7 @@ void CSVWorld::Table::deleteRecord()
{
std::vector<std::string> deletableIds = listDeletableSelectedIds();
if (deletableIds.size()>0)
if (!deletableIds.empty())
{
if (deletableIds.size()>1)
mDocument.getUndoStack().beginMacro (tr ("Delete multiple records"));

@ -245,7 +245,7 @@ namespace MWGui
// were there any items traded at all?
std::vector<ItemStack> playerBought = playerItemModel->getItemsBorrowedToUs();
std::vector<ItemStack> merchantBought = mTradeModel->getItemsBorrowedToUs();
if (!playerBought.size() && !merchantBought.size())
if (playerBought.empty() && merchantBought.empty())
{
// user notification
MWBase::Environment::get().getWindowManager()->

@ -206,7 +206,7 @@ namespace MWMechanics
if (effectIt->mKey.mId == effectId)
effectIt = it->second.mEffects.erase(effectIt);
else
effectIt++;
++effectIt;
}
}
mSpellsChanged = true;
@ -224,7 +224,7 @@ namespace MWMechanics
&& it->second.mCasterHandle == actorHandle)
effectIt = it->second.mEffects.erase(effectIt);
else
effectIt++;
++effectIt;
}
}
mSpellsChanged = true;

@ -118,7 +118,7 @@ void MWMechanics::AiSequence::clear()
void MWMechanics::AiSequence::stack (const AiPackage& package)
{
for(std::list<AiPackage *>::iterator it = mPackages.begin(); it != mPackages.end(); it++)
for(std::list<AiPackage *>::iterator it = mPackages.begin(); it != mPackages.end(); ++it)
{
if(mPackages.front()->getPriority() <= package.getPriority())
{

@ -296,7 +296,7 @@ namespace MWMechanics
// add this edge to openset, lowest cost goes to the front
// TODO: if this causes performance problems a hash table may help
std::list<int>::iterator it = openset.begin();
for(it = openset.begin(); it!= openset.end(); it++)
for(it = openset.begin(); it!= openset.end(); ++it)
{
if(fScore[*it] > fScore[dest])
break;

@ -401,10 +401,10 @@ namespace MWMechanics
if (!exploded)
MWBase::Environment::get().getWorld()->explodeSpell(mHitPosition, mTarget, effects, caster, mId, mSourceName);
if (reflectedEffects.mList.size())
if (!reflectedEffects.mList.empty())
inflict(caster, target, reflectedEffects, range, true);
if (appliedLastingEffects.size())
if (!appliedLastingEffects.empty())
target.getClass().getCreatureStats(target).getActiveSpells().addSpell(mId, mStack, appliedLastingEffects,
mSourceName, caster.getRefData().getHandle());

@ -129,7 +129,7 @@ namespace MWMechanics
if (spell->mData.mType == ESM::Spell::ST_Disease)
mSpells.erase(iter++);
else
iter++;
++iter;
}
}
@ -143,7 +143,7 @@ namespace MWMechanics
if (spell->mData.mType == ESM::Spell::ST_Blight)
mSpells.erase(iter++);
else
iter++;
++iter;
}
}
@ -157,7 +157,7 @@ namespace MWMechanics
if (Misc::StringUtils::ciEqual(spell->mId, "corprus"))
mSpells.erase(iter++);
else
iter++;
++iter;
}
}
@ -171,7 +171,7 @@ namespace MWMechanics
if (spell->mData.mType == ESM::Spell::ST_Curse)
mSpells.erase(iter++);
else
iter++;
++iter;
}
}

@ -411,7 +411,7 @@ Ogre::Node *Animation::getNode(const std::string &name)
NifOgre::TextKeyMap::const_iterator Animation::findGroupStart(const NifOgre::TextKeyMap &keys, const std::string &groupname)
{
NifOgre::TextKeyMap::const_iterator iter(keys.begin());
for(;iter != keys.end();iter++)
for(;iter != keys.end();++iter)
{
if(iter->second.compare(0, groupname.size(), groupname) == 0 &&
iter->second.compare(groupname.size(), 2, ": ") == 0)
@ -424,7 +424,7 @@ NifOgre::TextKeyMap::const_iterator Animation::findGroupStart(const NifOgre::Tex
bool Animation::hasAnimation(const std::string &anim)
{
AnimSourceList::const_iterator iter(mAnimSources.begin());
for(;iter != mAnimSources.end();iter++)
for(;iter != mAnimSources.end();++iter)
{
const NifOgre::TextKeyMap &keys = (*iter)->mTextKeys;
if(findGroupStart(keys, anim) != keys.end())
@ -465,7 +465,7 @@ float Animation::calcAnimVelocity(const NifOgre::TextKeyMap &keys, NifOgre::Node
stoptime = keyiter->first;
break;
}
keyiter++;
++keyiter;
}
if(stoptime > starttime)
@ -585,13 +585,13 @@ bool Animation::reset(AnimState &state, const NifOgre::TextKeyMap &keys, const s
std::string starttag = groupname+": "+start;
NifOgre::TextKeyMap::const_iterator startkey(groupstart);
while(startkey != keys.end() && startkey->second != starttag)
startkey++;
++startkey;
if(startkey == keys.end() && start == "loop start")
{
starttag = groupname+": start";
startkey = groupstart;
while(startkey != keys.end() && startkey->second != starttag)
startkey++;
++startkey;
}
if(startkey == keys.end())
return false;
@ -603,7 +603,7 @@ bool Animation::reset(AnimState &state, const NifOgre::TextKeyMap &keys, const s
// The Scrib's idle3 animation has "Idle3: Stop." instead of "Idle3: Stop".
// Why, just why? :(
&& (stopkey->second.size() < stoptag.size() || stopkey->second.substr(0,stoptag.size()) != stoptag))
stopkey++;
++stopkey;
if(stopkey == keys.end())
return false;
@ -627,7 +627,7 @@ bool Animation::reset(AnimState &state, const NifOgre::TextKeyMap &keys, const s
state.mLoopStartTime = key->first;
else if(key->second == loopstoptag)
state.mLoopStopTime = key->first;
key++;
++key;
}
}
@ -776,7 +776,7 @@ void Animation::play(const std::string &groupname, int priority, int groups, boo
/* Look in reverse; last-inserted source has priority. */
AnimSourceList::reverse_iterator iter(mAnimSources.rbegin());
for(;iter != mAnimSources.rend();iter++)
for(;iter != mAnimSources.rend();++iter)
{
const NifOgre::TextKeyMap &textkeys = (*iter)->mTextKeys;
AnimState state;
@ -795,7 +795,7 @@ void Animation::play(const std::string &groupname, int priority, int groups, boo
while(textkey != textkeys.end() && textkey->first <= state.mTime)
{
handleTextKey(state, groupname, textkey);
textkey++;
++textkey;
}
if(state.mTime >= state.mLoopStopTime && state.mLoopCount > 0)
@ -810,7 +810,7 @@ void Animation::play(const std::string &groupname, int priority, int groups, boo
while(textkey != textkeys.end() && textkey->first <= state.mTime)
{
handleTextKey(state, groupname, textkey);
textkey++;
++textkey;
}
}
@ -965,7 +965,7 @@ Ogre::Vector3 Animation::runAnimation(float duration)
while(textkey != textkeys.end() && textkey->first <= state.mTime)
{
handleTextKey(state, stateiter->first, textkey);
textkey++;
++textkey;
}
if(state.mTime >= state.mLoopStopTime && state.mLoopCount > 0)
@ -979,7 +979,7 @@ Ogre::Vector3 Animation::runAnimation(float duration)
while(textkey != textkeys.end() && textkey->first <= state.mTime)
{
handleTextKey(state, stateiter->first, textkey);
textkey++;
++textkey;
}
if(state.mTime >= state.mLoopStopTime)

@ -106,7 +106,7 @@ ManualObject *Debugging::createPathgridPoints(const ESM::Pathgrid *pathgrid)
uint32 startIndex = 0;
for(ESM::Pathgrid::PointList::const_iterator it = pathgrid->mPoints.begin();
it != pathgrid->mPoints.end();
it++, startIndex += 6)
++it, startIndex += 6)
{
Vector3 pointPos(it->mX, it->mY, it->mZ);

@ -240,25 +240,25 @@ Ogre::AxisAlignedBox Objects::getDimensions(MWWorld::CellStore* cell)
void Objects::enableLights()
{
PtrAnimationMap::const_iterator it = mObjects.begin();
for(;it != mObjects.end();it++)
for(;it != mObjects.end();++it)
it->second->enableLights(true);
}
void Objects::disableLights()
{
PtrAnimationMap::const_iterator it = mObjects.begin();
for(;it != mObjects.end();it++)
for(;it != mObjects.end();++it)
it->second->enableLights(false);
}
void Objects::update(float dt, Ogre::Camera* camera)
{
PtrAnimationMap::const_iterator it = mObjects.begin();
for(;it != mObjects.end();it++)
for(;it != mObjects.end();++it)
it->second->runAnimation(dt);
it = mObjects.begin();
for(;it != mObjects.end();it++)
for(;it != mObjects.end();++it)
it->second->preRender(camera);
}

@ -442,7 +442,7 @@ namespace MWSound
{
snditer->first->setFadeout(duration);
}
snditer++;
++snditer;
}
}

@ -20,7 +20,7 @@ namespace MWWorld
//find any NPC that is following the actor and teleport him too
std::list<MWWorld::Ptr> followers = MWBase::Environment::get().getMechanicsManager()->getActorsFollowing(actor);
for(std::list<MWWorld::Ptr>::iterator it = followers.begin();it != followers.end();it++)
for(std::list<MWWorld::Ptr>::iterator it = followers.begin();it != followers.end();++it)
{
std::cout << "teleporting someone!" << (*it).getCellRef().mRefID;
executeImp(*it);

@ -433,7 +433,6 @@ namespace MWWorld
while(mCell->getNextRef(esm[index], ref, deleted))
{
// Don't load reference if it was moved to a different cell.
std::string lowerCase = Misc::StringUtils::lowerCase(ref.mRefID);
ESM::MovedCellRefTracker::const_iterator iter =
std::find(mCell->mMovedRefs.begin(), mCell->mMovedRefs.end(), ref.mRefNum);
if (iter != mCell->mMovedRefs.end()) {

@ -671,7 +671,7 @@ namespace MWWorld
void PhysicsSystem::queueObjectMovement(const Ptr &ptr, const Ogre::Vector3 &movement)
{
PtrVelocityList::iterator iter = mMovementQueue.begin();
for(;iter != mMovementQueue.end();iter++)
for(;iter != mMovementQueue.end();++iter)
{
if(iter->first == ptr)
{
@ -692,7 +692,7 @@ namespace MWWorld
{
const MWBase::World *world = MWBase::Environment::get().getWorld();
PtrVelocityList::iterator iter = mMovementQueue.begin();
for(;iter != mMovementQueue.end();iter++)
for(;iter != mMovementQueue.end();++iter)
{
float waterlevel = -std::numeric_limits<float>::max();
const ESM::Cell *cell = iter->first.getCell()->getCell();

@ -151,7 +151,7 @@ namespace MWWorld
break;
}
}
if (neighbors.size() == 0)
if (neighbors.empty())
MWBase::Environment::get().getWindowManager()->setSneakVisibility(true);
}
}

Loading…
Cancel
Save