mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-16 01:02:03 +00:00
- Fixed: When r3837 moved SNDINFO parsing before MAPINFO parsing, it broke support for Hexen's $map SNDINFO command. Removed LEVEL2_MUSICDEFINED, since it's no longer needed by the new implementation for this command.
SVN r3856 (trunk)
This commit is contained in:
parent
3a6806942c
commit
40cefe6107
3 changed files with 19 additions and 12 deletions
|
@ -181,7 +181,7 @@ enum ELevelFlags
|
|||
|
||||
LEVEL2_KEEPFULLINVENTORY = 0x00000040, // doesn't reduce the amount of inventory items to 1
|
||||
|
||||
LEVEL2_MUSICDEFINED = 0x00000080, // a marker to disable the $map command in SNDINFO for this map
|
||||
/* = 0x00000080, */
|
||||
LEVEL2_MONSTERFALLINGDAMAGE = 0x00000100,
|
||||
LEVEL2_CLIPMIDTEX = 0x00000200,
|
||||
LEVEL2_WRAPMIDTEX = 0x00000400,
|
||||
|
|
|
@ -61,6 +61,8 @@ static cluster_info_t TheDefaultClusterInfo;
|
|||
|
||||
TArray<FEpisode> AllEpisodes;
|
||||
|
||||
extern TMap<int, FString> HexenMusic;
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
|
@ -918,8 +920,6 @@ DEFINE_MAP_OPTION(music, true)
|
|||
{
|
||||
parse.ParseAssign();
|
||||
parse.ParseMusic(info->Music, info->musicorder);
|
||||
// Flag the level so that the $MAP command doesn't override this.
|
||||
info->flags2 |= LEVEL2_MUSICDEFINED;
|
||||
}
|
||||
|
||||
DEFINE_MAP_OPTION(intermusic, true)
|
||||
|
@ -1538,6 +1538,14 @@ level_info_t *FMapInfoParser::ParseMapHeader(level_info_t &defaultinfo)
|
|||
// to teleport to maps with standard names without needing a levelnum.
|
||||
levelinfo->levelnum = GetDefaultLevelNum(levelinfo->mapname);
|
||||
|
||||
// Does this map have a song defined via SNDINFO's $map command?
|
||||
// Set that as this map's default music if it does.
|
||||
FString *song;
|
||||
if ((song = HexenMusic.CheckKey(levelinfo->levelnum)) != NULL)
|
||||
{
|
||||
levelinfo->Music = *song;
|
||||
}
|
||||
|
||||
return levelinfo;
|
||||
}
|
||||
|
||||
|
@ -1832,7 +1840,6 @@ void FMapInfoParser::ParseMapInfo (int lump, level_info_t &gamedefaults, level_i
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
//
|
||||
|
|
|
@ -220,6 +220,7 @@ extern int sfx_empty;
|
|||
// PUBLIC DATA DEFINITIONS -------------------------------------------------
|
||||
|
||||
TArray<sfxinfo_t> S_sfx (128);
|
||||
TMap<int, FString> HexenMusic;
|
||||
|
||||
// PRIVATE DATA DEFINITIONS ------------------------------------------------
|
||||
|
||||
|
@ -886,6 +887,7 @@ static void S_ClearSoundData()
|
|||
DefPlayerClassName = "";
|
||||
MusicAliases.Clear();
|
||||
MidiDevices.Clear();
|
||||
HexenMusic.Clear();
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -1084,16 +1086,14 @@ static void S_AddSNDINFO (int lump)
|
|||
|
||||
case SI_Map: {
|
||||
// Hexen-style $MAP command
|
||||
level_info_t *info;
|
||||
char temp[16];
|
||||
int mapnum;
|
||||
|
||||
sc.MustGetNumber ();
|
||||
mysnprintf (temp, countof(temp), "MAP%02d", sc.Number);
|
||||
info = FindLevelInfo (temp);
|
||||
sc.MustGetString ();
|
||||
if (info->mapname[0] && (!(info->flags2 & LEVEL2_MUSICDEFINED)))
|
||||
sc.MustGetNumber();
|
||||
mapnum = sc.Number;
|
||||
sc.MustGetString();
|
||||
if (mapnum != 0)
|
||||
{
|
||||
info->Music = sc.String;
|
||||
HexenMusic[mapnum] = sc.String;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue