mirror of
https://github.com/ZDoom/Raze.git
synced 2025-06-03 02:30:58 +00:00
- updated VM from GZDoom.
Just to be up to date.
This commit is contained in:
parent
0314cdec55
commit
cb49bcb96d
9 changed files with 60 additions and 9 deletions
|
@ -121,6 +121,17 @@ template<class T> unsigned int ArrayReserve(T *self, int amount)
|
|||
return self->Reserve(amount);
|
||||
}
|
||||
|
||||
template<> unsigned int ArrayReserve(TArray<DObject*> *self, int amount)
|
||||
{
|
||||
const unsigned int oldSize = self->Reserve(amount);
|
||||
const unsigned int fillCount = self->Size() - oldSize;
|
||||
|
||||
if (fillCount > 0)
|
||||
memset(&(*self)[oldSize], 0, sizeof(DObject*) * fillCount);
|
||||
|
||||
return oldSize;
|
||||
}
|
||||
|
||||
template<class T> int ArrayMax(T *self)
|
||||
{
|
||||
return self->Max();
|
||||
|
@ -908,7 +919,7 @@ DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Reserve, ArrayReserve<FDynArray_Obj
|
|||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FDynArray_Obj);
|
||||
PARAM_INT(count);
|
||||
ACTION_RETURN_INT(self->Reserve(count));
|
||||
ACTION_RETURN_INT(ArrayReserve(self, count));
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION_NATIVE(FDynArray_Obj, Max, ArrayMax<FDynArray_Obj>)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue