Move openings to r_memory

This commit is contained in:
Magnus Norddahl 2016-12-30 05:35:25 +01:00
commit 60c0dcc3c7
10 changed files with 67 additions and 38 deletions

View file

@ -74,20 +74,4 @@ namespace swrenderer
return ds_p++;
}
ptrdiff_t R_NewOpening(ptrdiff_t len)
{
ptrdiff_t res = lastopening;
len = (len + 1) & ~1; // only return DWORD aligned addresses because some code stores fixed_t's and floats in openings...
lastopening += len;
if ((size_t)lastopening > maxopenings)
{
do
maxopenings = maxopenings ? maxopenings * 2 : 16384;
while ((size_t)lastopening > maxopenings);
openings = (short *)M_Realloc(openings, maxopenings * sizeof(*openings));
DPrintf(DMSG_NOTIFY, "MaxOpenings increased to %zu\n", maxopenings);
}
return res;
}
}