minor backend update from Raze.

This commit is contained in:
Christoph Oelckers 2023-10-17 20:54:04 +02:00
parent 1957c15a41
commit d65d1a3b82
3 changed files with 13 additions and 0 deletions

View file

@ -282,6 +282,11 @@ public:
return GC::ReadBarrier(o) == u;
}
constexpr bool operator==(TObjPtr<T> u) noexcept
{
return ForceGet() == u.ForceGet();
}
template<class U> friend inline void GC::Mark(TObjPtr<U> &obj);
template<class U> friend FSerializer &Serialize(FSerializer &arc, const char *key, TObjPtr<U> &value, TObjPtr<U> *);
template<class U> friend FSerializer &Serialize(FSerializer &arc, const char *key, TObjPtr<U> &value, U *);

View file

@ -232,3 +232,4 @@ inline bool BoxInRange(const DVector2& boxtl, const DVector2& boxbr, const DVect
boxtl.Y < max(start.Y, end.Y) &&
boxbr.Y > min(start.Y, end.Y);
}

View file

@ -455,6 +455,13 @@ public:
return start;
}
unsigned AddUnique(const T& obj)
{
auto f = Find(obj);
if (f == Size()) Push(obj);
return f;
}
bool Pop ()
{
if (Count > 0)