- reverse the order of the texture list before resolving it.

Since this deletes the resolved elements one by one and needs to start at the front to ensure consistency, it is better to reverse the order so that the deletions take place at the end of the list which requires a lot less data movement.
On Total Chaos this slowed down texture setup to the point where the mod was basically unlaunchable.
This commit is contained in:
Christoph Oelckers 2018-12-19 18:17:21 +01:00
commit 0160841dde
4 changed files with 55 additions and 3 deletions

View file

@ -497,6 +497,14 @@ public:
Array = nullptr;
}
}
void Swap(TArray<T, TT> &other)
{
std::swap(Array, other.Array);
std::swap(Count, other.Count);
std::swap(Most, other.Most);
}
private:
T *Array;
unsigned int Count;
@ -760,6 +768,7 @@ struct FMap
hash_t NumUsed;
};
template<class KT, class VT, class MapType> class TMapIterator;
template<class KT, class VT, class MapType> class TMapConstIterator;
@ -947,6 +956,14 @@ public:
DelKey(key);
}
void Swap(MyType &other)
{
std::swap(Nodes, other.Nodes);
std::swap(LastFree, other.LastFree);
std::swap(Size, other.Size);
std::swap(NumUsed, other.NumUsed);
}
protected:
struct IPair // This must be the same as Pair above, but with a
{ // non-const Key.
@ -1518,4 +1535,3 @@ private:
T *Array;
unsigned int Count;
};