- implemented a proper texture composition cache.
This will mostly ensure that each patch used for composition is only loaded once and automatically unloaded once no longer needed. So far only for paletted rendering, but the same logic can be used for true color as well.
This commit is contained in:
parent
796c0fe931
commit
2e7bcf9e41
32 changed files with 367 additions and 60 deletions
14
src/tarray.h
14
src/tarray.h
|
|
@ -272,6 +272,18 @@ public:
|
|||
return i;
|
||||
}
|
||||
|
||||
template<class Func> const
|
||||
unsigned int FindEx(Func compare) const
|
||||
{
|
||||
unsigned int i;
|
||||
for (i = 0; i < Count; ++i)
|
||||
{
|
||||
if (compare(Array[i]))
|
||||
break;
|
||||
}
|
||||
return i;
|
||||
}
|
||||
|
||||
unsigned int Push (const T &item)
|
||||
{
|
||||
Grow (1);
|
||||
|
|
@ -1019,7 +1031,7 @@ protected:
|
|||
if (!nold[i].IsNil())
|
||||
{
|
||||
Node *n = NewKey(nold[i].Pair.Key);
|
||||
::new(&n->Pair.Value) VT(nold[i].Pair.Value);
|
||||
::new(&n->Pair.Value) VT(std::move(nold[i].Pair.Value));
|
||||
nold[i].~Node();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue