mirror of
https://github.com/ZDoom/Raze.git
synced 2025-06-03 02:30:58 +00:00
- backend update from GZDoom.
This commit is contained in:
parent
8b03abcd00
commit
c82d9d2908
28 changed files with 178 additions and 53 deletions
|
@ -87,11 +87,12 @@ template<class T> void ArrayDelete(T *self, int index, int count)
|
|||
|
||||
template<class T, class U, int fill = 1> void ArrayInsert(T *self, int index, U val)
|
||||
{
|
||||
//int oldSize = self->Size();
|
||||
int oldSize = self->Size();
|
||||
self->Insert(index, static_cast<typename T::value_type>(val));
|
||||
// Is this even necessary? All Insert does is inserting one defined element into the array and moving the rest.
|
||||
// It never creates empty tailing entries. fillcount in the macro will always be 0
|
||||
//if (fill) { DYNARRAY_FILL_ITEMS_SKIP(1); }
|
||||
if constexpr (fill)
|
||||
{
|
||||
for (unsigned i = oldSize; i < self->Size() - 1; i++) (*self)[i] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
template<class T> void ArrayShrinkToFit(T *self)
|
||||
|
@ -879,8 +880,10 @@ DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Delete, ArrayDelete<FDynArray_Obj>)
|
|||
|
||||
void ObjArrayInsert(FDynArray_Obj *self,int index, DObject *obj)
|
||||
{
|
||||
int oldSize = self->Size();
|
||||
GC::WriteBarrier(obj);
|
||||
self->Insert(index, obj);
|
||||
for (unsigned i = oldSize; i < self->Size() - 1; i++) (*self)[i] = nullptr;
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Insert, ObjArrayInsert)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue