mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
Move flat caching code to the map data load function.
This commit is contained in:
parent
9a9f72f598
commit
c4a017ddf0
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…
Reference in a new issue