mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Move flat caching code to the map data load function.
This commit is contained in:
parent
b1344fd8f0
commit
d2e7e6cd9c
1 changed files with 8 additions and 8 deletions
|
|
@ -651,14 +651,6 @@ static void P_LoadRawSectors(UINT8 *data)
|
|||
sector_t *ss = sectors;
|
||||
size_t i;
|
||||
|
||||
// Allocate a big chunk of memory as big as our MAXLEVELFLATS limit.
|
||||
//Fab : FIXME: allocate for whatever number of flats - 512 different flats per level should be plenty
|
||||
foundflats = calloc(MAXLEVELFLATS, sizeof (*foundflats));
|
||||
if (foundflats == NULL)
|
||||
I_Error("Ran out of memory while loading sectors\n");
|
||||
|
||||
numlevelflats = 0;
|
||||
|
||||
// For each counted sector, copy the sector raw data from our cache pointer ms, to the global table pointer ss.
|
||||
for (i = 0; i < numsectors; i++, ss++, ms++)
|
||||
{
|
||||
|
|
@ -1982,6 +1974,14 @@ static void P_LoadMapData(const virtres_t* virt)
|
|||
lines = Z_Calloc(numlines * sizeof (*lines), PU_LEVEL, NULL);
|
||||
mapthings = Z_Calloc(nummapthings * sizeof (*mapthings), PU_LEVEL, NULL);
|
||||
|
||||
// Allocate a big chunk of memory as big as our MAXLEVELFLATS limit.
|
||||
//Fab : FIXME: allocate for whatever number of flats - 512 different flats per level should be plenty
|
||||
foundflats = calloc(MAXLEVELFLATS, sizeof (*foundflats));
|
||||
if (foundflats == NULL)
|
||||
I_Error("Ran out of memory while loading sectors\n");
|
||||
|
||||
numlevelflats = 0;
|
||||
|
||||
#ifdef UDMF
|
||||
if (textmap)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue