From 311c175f3184103950c72bc5c775174597430b83 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 14 Jul 2017 01:31:22 +0300 Subject: Replace std::vector into macro STD_VECTOR. In most case it equal to std::vector except debug modes. Now it can be also mse::mstd::vector, but sadly this class not support all required features. --- src/being/being.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'src/being/being.cpp') diff --git a/src/being/being.cpp b/src/being/being.cpp index 56f22a1d5..508104d27 100644 --- a/src/being/being.cpp +++ b/src/being/being.cpp @@ -156,7 +156,7 @@ static const unsigned int SPEECH_MAX_TIME = 800; for (int f = 0; f < BadgeIndex::BadgeIndexSize; f++) #define for_each_horses(name) \ - FOR_EACH (std::vector::const_iterator, it, name) + FOR_EACH (STD_VECTOR::const_iterator, it, name) Being::Being(const BeingId id, const ActorTypeT type) : @@ -3265,8 +3265,8 @@ void Being::setSpriteSlot(const unsigned int slot, void Being::dumpSprites() const restrict2 { - std::vector::const_iterator it1 = mSlots.begin(); - const std::vector::const_iterator it1_end = mSlots.end(); + STD_VECTOR::const_iterator it1 = mSlots.begin(); + const STD_VECTOR::const_iterator it1_end = mSlots.end(); logger->log("sprites"); for (; it1 != it1_end; @@ -4195,10 +4195,10 @@ void Being::recalcSpritesOrder() restrict2 if (sz < 1) return; - std::vector slotRemap; + STD_VECTOR slotRemap; IntMap itemSlotRemap; - std::vector::iterator it; + STD_VECTOR::iterator it; int oldHide[20]; bool updatedSprite[20]; int dir = mSpriteDirection; @@ -4471,7 +4471,7 @@ void Being::recalcSpritesOrder() restrict2 } } -int Being::searchSlotValue(const std::vector &restrict slotRemap, +int Being::searchSlotValue(const STD_VECTOR &restrict slotRemap, const int val) const restrict2 { const size_t sz = mSprites.size(); @@ -4483,14 +4483,14 @@ int Being::searchSlotValue(const std::vector &restrict slotRemap, return CompoundSprite::getNumberOfLayers() - 1; } -void Being::searchSlotValueItr(std::vector::iterator &restrict it, +void Being::searchSlotValueItr(STD_VECTOR::iterator &restrict it, int &restrict idx, - std::vector &restrict slotRemap, + STD_VECTOR &restrict slotRemap, const int val) { // logger->log("searching %d", val); it = slotRemap.begin(); - const std::vector::iterator it_end = slotRemap.end(); + const STD_VECTOR::iterator it_end = slotRemap.end(); idx = 0; while (it != it_end) { @@ -4974,7 +4974,7 @@ void Being::removeItemParticles(const int id) restrict2 ParticleInfo *restrict const pi = (*it).second; if (pi != nullptr) { - FOR_EACH (std::vector::const_iterator, itp, pi->particles) + FOR_EACH (STD_VECTOR::const_iterator, itp, pi->particles) mChildParticleEffects.removeLocally(*itp); delete pi; } @@ -4988,13 +4988,13 @@ void Being::recreateItemParticles() restrict2 ParticleInfo *restrict const pi = (*it).second; if ((pi != nullptr) && !pi->files.empty()) { - FOR_EACH (std::vector::const_iterator, + FOR_EACH (STD_VECTOR::const_iterator, itp, pi->particles) { mChildParticleEffects.removeLocally(*itp); } - FOR_EACH (std::vector::const_iterator, str, pi->files) + FOR_EACH (STD_VECTOR::const_iterator, str, pi->files) { Particle *const p = particleEngine->addEffect( *str, 0, 0); -- cgit v1.2.3-70-g09d2