mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-28 06:53:58 +00:00
- Fixed: Hexen's fighter's skull has a different animation than Heretic's so it needs to be a separate class.
- Added an option to parse lumps named ZMAPINFO in place of MAPINFO. Any MAPINFO lumps in files containing a ZMAPINFO lump will be completely ignored. This is to allow ZDoom specific definitions which are incompatible with other engines capable of reading MAPINFO. Any ZMAPINFO lump must be in the new MAPINFO format. SVN r2208 (trunk)
This commit is contained in:
parent
cf06cd68bc
commit
c191d95110
5 changed files with 84 additions and 5 deletions
|
@ -68,9 +68,9 @@ struct FMapInfoParser
|
|||
int format_type;
|
||||
bool HexenHack;
|
||||
|
||||
FMapInfoParser()
|
||||
FMapInfoParser(int format = FMT_Unknown)
|
||||
{
|
||||
format_type = FMT_Unknown;
|
||||
format_type = format;
|
||||
HexenHack = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -1929,10 +1929,23 @@ void G_ParseMapInfo (const char *basemapinfo)
|
|||
parse.ParseMapInfo(Wads.GetNumForFullName(basemapinfo), gamedefaults, defaultinfo);
|
||||
}
|
||||
|
||||
static const char *mapinfonames[] = { "MAPINFO", "ZMAPINFO", NULL };
|
||||
int nindex;
|
||||
|
||||
// Parse any extra MAPINFOs.
|
||||
while ((lump = Wads.FindLump ("MAPINFO", &lastlump)) != -1)
|
||||
while ((lump = Wads.FindLumpMulti (mapinfonames, &lastlump, false, &nindex)) != -1)
|
||||
{
|
||||
FMapInfoParser parse;
|
||||
if (nindex == 0)
|
||||
{
|
||||
// If this lump is named MAPINFO we need to check if the same WAD contains a ZMAPINFO lump.
|
||||
// If that exists we need to skip this one.
|
||||
|
||||
int wad = Wads.GetLumpFile(lump);
|
||||
int altlump = Wads.CheckNumForName("ZMAPINFO", ns_global, wad, true);
|
||||
|
||||
if (altlump >= 0) continue;
|
||||
}
|
||||
FMapInfoParser parse(nindex == 1? FMapInfoParser::FMT_New : FMapInfoParser::FMT_Unknown);
|
||||
level_info_t defaultinfo;
|
||||
parse.ParseMapInfo(lump, gamedefaults, defaultinfo);
|
||||
}
|
||||
|
|
|
@ -848,6 +848,46 @@ int FWadCollection::FindLump (const char *name, int *lastlump, bool anyns)
|
|||
return -1;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// W_FindLumpMulti
|
||||
//
|
||||
// Find a named lump. Specifically allows duplicates for merging of e.g.
|
||||
// SNDINFO lumps. Returns everything having one of the passed names.
|
||||
//
|
||||
//==========================================================================
|
||||
|
||||
int FWadCollection::FindLumpMulti (const char **names, int *lastlump, bool anyns, int *nameindex)
|
||||
{
|
||||
LumpRecord *lump_p;
|
||||
|
||||
assert(lastlump != NULL && *lastlump >= 0);
|
||||
lump_p = &LumpInfo[*lastlump];
|
||||
while (lump_p < &LumpInfo[NumLumps])
|
||||
{
|
||||
FResourceLump *lump = lump_p->lump;
|
||||
|
||||
if (anyns || lump->Namespace == ns_global)
|
||||
{
|
||||
|
||||
for(const char **name = names; *name != NULL; name++)
|
||||
{
|
||||
if (!strnicmp(*name, lump->Name, 8))
|
||||
{
|
||||
int lump = int(lump_p - &LumpInfo[0]);
|
||||
*lastlump = lump + 1;
|
||||
if (nameindex != NULL) *nameindex = int(name - names);
|
||||
return lump;
|
||||
}
|
||||
}
|
||||
}
|
||||
lump_p++;
|
||||
}
|
||||
|
||||
*lastlump = NumLumps;
|
||||
return -1;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// W_CheckLumpName
|
||||
|
|
|
@ -182,6 +182,7 @@ public:
|
|||
FileReader * GetFileReader(int wadnum); // Gets a FileReader object to the entire WAD
|
||||
|
||||
int FindLump (const char *name, int *lastlump, bool anyns=false); // [RH] Find lumps with duplication
|
||||
int FindLumpMulti (const char **names, int *lastlump, bool anyns = false, int *nameindex = NULL); // same with multiple possible names
|
||||
bool CheckLumpName (int lump, const char *name); // [RH] True if lump's name == name
|
||||
|
||||
static DWORD LumpNameHash (const char *name); // [RH] Create hash key from an 8-char name
|
||||
|
|
|
@ -64,7 +64,7 @@ ACTOR FighterPlayer : PlayerPawn
|
|||
Stop
|
||||
XDeath:
|
||||
PLAY O 5 A_PlayerScream
|
||||
PLAY P 5 A_SkullPop
|
||||
PLAY P 5 A_SkullPop("BloodyFighterSkull")
|
||||
PLAY R 5 A_NoBlocking
|
||||
PLAY STUV 5
|
||||
PLAY W -1
|
||||
|
@ -99,3 +99,28 @@ ACTOR FighterPlayer : PlayerPawn
|
|||
}
|
||||
}
|
||||
|
||||
// The fighter's bloody skull --------------------------------------------------------------
|
||||
|
||||
Actor BloodyFighterSkull : PlayerChunk
|
||||
{
|
||||
Game Hexen
|
||||
Radius 4
|
||||
Height 4
|
||||
+NOBLOCKMAP
|
||||
+DROPOFF
|
||||
+LOWGRAVITY
|
||||
+CANNOTPUSH
|
||||
+SKYEXPLODE
|
||||
+NOBLOCKMONST
|
||||
+NOSKIN
|
||||
States
|
||||
{
|
||||
Spawn:
|
||||
BSKL A 0
|
||||
BSKL ABCDFGH 5 A_CheckFloor("Hit")
|
||||
Goto Spawn+1
|
||||
Hit:
|
||||
BSKL I 16 A_CheckPlayerDone
|
||||
Wait
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue