- Expanded the args for MAPINFO special actions to 32 bit integers as in
the rest of the game. - Fixed: The specialaction list was not copied properly when transferred from the defaultinfo. - Fixed: The defaultinfo for MAPINFO wasn't cleared fully after MAPINFO parsing was completed. - Made Doom-format linedef translators a map property so that it's easier to define replacements or extensions. SVN r843 (trunk)
This commit is contained in:
parent
3237c6b4e8
commit
969cc1f6f9
7 changed files with 88 additions and 54 deletions
|
|
@ -309,6 +309,7 @@ static const char *MapInfoMapLevel[] =
|
|||
"teamplayoff",
|
||||
"checkswitchrange",
|
||||
"nocheckswitchrange",
|
||||
"translator",
|
||||
NULL
|
||||
};
|
||||
|
||||
|
|
@ -458,6 +459,7 @@ MapHandlers[] =
|
|||
{ MITYPE_SCFLAGS, LEVEL_FORCETEAMPLAYOFF, ~LEVEL_FORCETEAMPLAYON },
|
||||
{ MITYPE_SETFLAG, LEVEL_CHECKSWITCHRANGE, 0 },
|
||||
{ MITYPE_CLRFLAG, LEVEL_CHECKSWITCHRANGE, 0 },
|
||||
{ MITYPE_STRING, lioffset(translator), 0 },
|
||||
};
|
||||
|
||||
static const char *MapInfoClusterLevel[] =
|
||||
|
|
@ -605,6 +607,20 @@ void G_ParseMapInfo ()
|
|||
}
|
||||
}
|
||||
|
||||
static FSpecialAction *CopySpecialActions(FSpecialAction *spec)
|
||||
{
|
||||
FSpecialAction **pSpec = &spec;
|
||||
|
||||
while (*pSpec)
|
||||
{
|
||||
FSpecialAction *newspec = new FSpecialAction;
|
||||
*newspec = **pSpec;
|
||||
*pSpec = newspec;
|
||||
pSpec = &newspec->Next;
|
||||
}
|
||||
return spec;
|
||||
}
|
||||
|
||||
static void G_DoParseMapInfo (int lump)
|
||||
{
|
||||
level_info_t defaultinfo;
|
||||
|
|
@ -624,8 +640,7 @@ static void G_DoParseMapInfo (int lump)
|
|||
switch (sc.MustMatchString (MapInfoTopLevel))
|
||||
{
|
||||
case MITL_DEFAULTMAP:
|
||||
if (defaultinfo.music != NULL) delete [] defaultinfo.music;
|
||||
if (defaultinfo.intermusic != NULL) delete [] defaultinfo.intermusic;
|
||||
ClearLevelInfoStrings(&defaultinfo);
|
||||
SetLevelDefaults (&defaultinfo);
|
||||
ParseMapInfoLower (sc, MapHandlers, MapInfoMapLevel, &defaultinfo, NULL, defaultinfo.flags);
|
||||
break;
|
||||
|
|
@ -668,6 +683,11 @@ static void G_DoParseMapInfo (int lump)
|
|||
{
|
||||
levelinfo->intermusic = copystring (levelinfo->intermusic);
|
||||
}
|
||||
if (levelinfo->translator != NULL)
|
||||
{
|
||||
levelinfo->translator = copystring (levelinfo->translator);
|
||||
}
|
||||
levelinfo->specialactions = CopySpecialActions(levelinfo->specialactions);
|
||||
if (HexenHack)
|
||||
{
|
||||
levelinfo->WallHorizLight = levelinfo->WallVertLight = 0;
|
||||
|
|
@ -773,14 +793,7 @@ static void G_DoParseMapInfo (int lump)
|
|||
|
||||
}
|
||||
}
|
||||
if (defaultinfo.music != NULL)
|
||||
{
|
||||
delete [] defaultinfo.music;
|
||||
}
|
||||
if (defaultinfo.intermusic != NULL)
|
||||
{
|
||||
delete [] defaultinfo.intermusic;
|
||||
}
|
||||
ClearLevelInfoStrings(&defaultinfo);
|
||||
}
|
||||
|
||||
static void ClearLevelInfoStrings(level_info_t *linfo)
|
||||
|
|
@ -800,6 +813,11 @@ static void ClearLevelInfoStrings(level_info_t *linfo)
|
|||
delete[] linfo->level_name;
|
||||
linfo->level_name = NULL;
|
||||
}
|
||||
if (linfo->translator != NULL)
|
||||
{
|
||||
delete[] linfo->translator;
|
||||
linfo->translator = NULL;
|
||||
}
|
||||
for (FSpecialAction *spac = linfo->specialactions; spac != NULL; )
|
||||
{
|
||||
FSpecialAction *next = spac->Next;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue