mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-21 08:51:10 +00:00
Minor cleanup of virtual resources code
This commit is contained in:
parent
c64a9d7ae9
commit
bb3440d021
3 changed files with 20 additions and 26 deletions
|
@ -367,12 +367,7 @@ UINT32 P_GetScoreForGrade(INT16 map, UINT8 mare, UINT8 grade)
|
|||
return mapheaderinfo[map-1]->grades[mare].grade[grade-1];
|
||||
}
|
||||
|
||||
/** Loads the vertexes for a level.
|
||||
*
|
||||
* \param lump VERTEXES lump number.
|
||||
* \sa ML_VERTEXES
|
||||
*/
|
||||
|
||||
// Loads the vertexes for a level.
|
||||
static inline void P_LoadRawVertexes(UINT8 *data)
|
||||
{
|
||||
mapvertex_t *ml = (mapvertex_t *)data;
|
||||
|
@ -666,7 +661,6 @@ INT32 P_CheckLevelFlat(const char *flatname)
|
|||
}
|
||||
|
||||
// Sets up the ingame sectors structures.
|
||||
// Lumpnum is the lumpnum of a SECTORS lump.
|
||||
static void P_LoadRawSectors(UINT8 *data)
|
||||
{
|
||||
mapsector_t *ms = (mapsector_t *)data;
|
||||
|
@ -1147,7 +1141,7 @@ static void P_LoadRawLineDefs(UINT8 *data)
|
|||
}
|
||||
}
|
||||
|
||||
static void SetupLines (void)
|
||||
static void P_SetupLines(void)
|
||||
{
|
||||
line_t *ld = lines;
|
||||
size_t i;
|
||||
|
@ -1933,7 +1927,7 @@ static void P_LoadRawReject(UINT8 *data, size_t count)
|
|||
}
|
||||
}
|
||||
|
||||
static void LoadMapBSP (const virtres_t* virt)
|
||||
static void P_LoadMapBSP(const virtres_t* virt)
|
||||
{
|
||||
virtlump_t* virtssectors = vres_Find(virt, "SSECTORS");
|
||||
virtlump_t* virtsegs = vres_Find(virt, "SEGS");
|
||||
|
@ -1945,7 +1939,7 @@ static void LoadMapBSP (const virtres_t* virt)
|
|||
P_LoadRawSegs(virtsegs->data, virtsegs->size);
|
||||
}
|
||||
|
||||
static void LoadMapLUT (const virtres_t* virt)
|
||||
static void P_LoadMapLUT(const virtres_t* virt)
|
||||
{
|
||||
virtlump_t* virtblockmap = vres_Find(virt, "BLOCKMAP");
|
||||
virtlump_t* virtreject = vres_Find(virt, "REJECT");
|
||||
|
@ -1960,7 +1954,7 @@ static void LoadMapLUT (const virtres_t* virt)
|
|||
P_CreateBlockMap();
|
||||
}
|
||||
|
||||
static void LoadMapData (const virtres_t* virt)
|
||||
static void P_LoadMapData(const virtres_t* virt)
|
||||
{
|
||||
virtlump_t* virtvertexes = NULL, * virtsectors = NULL, * virtsidedefs = NULL, * virtlinedefs = NULL, * virtthings = NULL;
|
||||
#ifdef UDMF
|
||||
|
@ -2022,7 +2016,7 @@ static void LoadMapData (const virtres_t* virt)
|
|||
P_LoadRawVertexes(virtvertexes->data);
|
||||
P_LoadRawSectors(virtsectors->data);
|
||||
P_LoadRawLineDefs(virtlinedefs->data);
|
||||
SetupLines();
|
||||
P_SetupLines();
|
||||
P_LoadRawSideDefs2(virtsidedefs->data);
|
||||
}
|
||||
}
|
||||
|
@ -2784,9 +2778,9 @@ boolean P_SetupLevel(boolean skipprecip)
|
|||
{
|
||||
virtres_t* virt = vres_GetMap(lastloadedmaplumpnum);
|
||||
|
||||
LoadMapData(virt);
|
||||
LoadMapBSP(virt);
|
||||
LoadMapLUT(virt);
|
||||
P_LoadMapData(virt);
|
||||
P_LoadMapBSP(virt);
|
||||
P_LoadMapLUT(virt);
|
||||
|
||||
P_LoadLineDefs2();
|
||||
P_GroupLines();
|
||||
|
|
16
src/w_wad.c
16
src/w_wad.c
|
@ -1895,12 +1895,12 @@ int W_VerifyNMUSlumps(const char *filename)
|
|||
* \return Virtual resource
|
||||
*
|
||||
*/
|
||||
virtres_t* vres_GetMap (lumpnum_t lumpnum)
|
||||
virtres_t* vres_GetMap(lumpnum_t lumpnum)
|
||||
{
|
||||
UINT32 i;
|
||||
virtres_t* vres = NULL;
|
||||
virtlump_t* vlumps = NULL;
|
||||
size_t numlumps = 0;
|
||||
virtres_t* vres = NULL;
|
||||
virtlump_t* vlumps = NULL;
|
||||
size_t numlumps = 0;
|
||||
|
||||
if (W_IsLumpWad(lumpnum))
|
||||
{
|
||||
|
@ -1942,8 +1942,8 @@ virtres_t* vres_GetMap (lumpnum_t lumpnum)
|
|||
}
|
||||
}
|
||||
vres = Z_Malloc(sizeof(virtres_t), PU_LEVEL, NULL);
|
||||
vres->vlumps = vlumps;
|
||||
vres->numlumps = numlumps;
|
||||
vres->vlumps = vlumps;
|
||||
vres->numlumps = numlumps;
|
||||
|
||||
return vres;
|
||||
}
|
||||
|
@ -1952,7 +1952,7 @@ virtres_t* vres_GetMap (lumpnum_t lumpnum)
|
|||
*
|
||||
* \param Virtual resource
|
||||
*/
|
||||
void vres_Free (virtres_t* vres)
|
||||
void vres_Free(virtres_t* vres)
|
||||
{
|
||||
while (vres->numlumps--)
|
||||
Z_Free(vres->vlumps[vres->numlumps].data);
|
||||
|
@ -1963,7 +1963,7 @@ void vres_Free (virtres_t* vres)
|
|||
/** (Debug) Prints lumps from a virtual resource into console.
|
||||
*/
|
||||
/*
|
||||
static void vres_Diag (const virtres_t* vres)
|
||||
static void vres_Diag(const virtres_t* vres)
|
||||
{
|
||||
UINT32 i;
|
||||
for (i = 0; i < vres->numlumps; i++)
|
||||
|
|
|
@ -87,9 +87,9 @@ typedef struct {
|
|||
virtlump_t* vlumps;
|
||||
} virtres_t;
|
||||
|
||||
virtres_t* vres_GetMap (lumpnum_t);
|
||||
void vres_Free (virtres_t*);
|
||||
virtlump_t* vres_Find (const virtres_t*, const char*);
|
||||
virtres_t* vres_GetMap(lumpnum_t);
|
||||
void vres_Free(virtres_t*);
|
||||
virtlump_t* vres_Find(const virtres_t*, const char*);
|
||||
|
||||
// =========================================================================
|
||||
// DYNAMIC WAD LOADING
|
||||
|
|
Loading…
Reference in a new issue