mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-18 07:22:28 +00:00
Merge branch 'textmap-parser' of https://git.magicalgirl.moe/STJr/SRB2/ into textmap-parser
This commit is contained in:
commit
99aace19f5
1 changed files with 21 additions and 19 deletions
|
@ -1462,33 +1462,35 @@ static void TextmapThing(UINT32 i, char *param)
|
||||||
*/
|
*/
|
||||||
static void TextmapParse(UINT32 dataPos, size_t num, void (*parser)(UINT32, char *))
|
static void TextmapParse(UINT32 dataPos, size_t num, void (*parser)(UINT32, char *))
|
||||||
{
|
{
|
||||||
char *open;
|
char *tkn;
|
||||||
|
|
||||||
M_SetTokenPos(dataPos);
|
M_SetTokenPos(dataPos);
|
||||||
open = M_GetToken(NULL);
|
tkn = M_GetToken(NULL);
|
||||||
if (fastcmp(open, "{"))
|
if (!fastcmp(tkn, "{"))
|
||||||
{
|
{
|
||||||
char *tkn = M_GetToken(NULL);
|
|
||||||
while (!fastcmp(tkn, "}"))
|
|
||||||
{
|
|
||||||
dat = NULL;
|
|
||||||
parser(num, tkn);
|
|
||||||
if (dat)
|
|
||||||
Z_Free(dat);
|
|
||||||
|
|
||||||
Z_Free(tkn);
|
|
||||||
tkn = M_GetToken(NULL);
|
|
||||||
}
|
|
||||||
Z_Free(tkn);
|
Z_Free(tkn);
|
||||||
}
|
|
||||||
else
|
|
||||||
CONS_Alert(CONS_WARNING, "Invalid UDMF data capsule!\n");
|
CONS_Alert(CONS_WARNING, "Invalid UDMF data capsule!\n");
|
||||||
Z_Free(open);
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
Z_Free(tkn);
|
||||||
|
tkn = M_GetToken(NULL);
|
||||||
|
while (!fastcmp(tkn, "}"))
|
||||||
|
{
|
||||||
|
dat = NULL;
|
||||||
|
parser(num, tkn);
|
||||||
|
if (dat)
|
||||||
|
Z_Free(dat);
|
||||||
|
|
||||||
|
Z_Free(tkn);
|
||||||
|
tkn = M_GetToken(NULL);
|
||||||
|
}
|
||||||
|
Z_Free(tkn);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Provides a fix to the flat alignment coordinate transform from standard Textmaps.
|
/** Provides a fix to the flat alignment coordinate transform from standard Textmaps.
|
||||||
*/
|
*/
|
||||||
static void TextmapFixFlatOffsets (sector_t* sec)
|
static void TextmapFixFlatOffsets(sector_t *sec)
|
||||||
{
|
{
|
||||||
if (sec->floorpic_angle)
|
if (sec->floorpic_angle)
|
||||||
{
|
{
|
||||||
|
@ -1517,7 +1519,7 @@ static void TextmapFixFlatOffsets (sector_t* sec)
|
||||||
|
|
||||||
/** Loads the textmap data, after obtaining the elements count and allocating their respective space.
|
/** Loads the textmap data, after obtaining the elements count and allocating their respective space.
|
||||||
*/
|
*/
|
||||||
static void P_LoadTextmap (void)
|
static void P_LoadTextmap(void)
|
||||||
{
|
{
|
||||||
UINT32 i;
|
UINT32 i;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue