mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-24 04:51:19 +00:00
- fixed: The music that's defined in the Gameinfo section of MAPINFO could not set the order for multitrack music lumps.
This commit is contained in:
parent
ecfe67dd78
commit
072b66fb9f
5 changed files with 23 additions and 6 deletions
|
@ -1300,7 +1300,7 @@ void D_DoAdvanceDemo (void)
|
|||
gamestate = GS_DEMOSCREEN;
|
||||
pagename = gameinfo.titlePage;
|
||||
pagetic = (int)(gameinfo.titleTime * TICRATE);
|
||||
S_StartMusic (gameinfo.titleMusic);
|
||||
S_ChangeMusic (gameinfo.titleMusic, gameinfo.titleOrder, false);
|
||||
demosequence = 3;
|
||||
pagecount = 0;
|
||||
C_HideConsole ();
|
||||
|
|
20
src/gi.cpp
20
src/gi.cpp
|
@ -184,6 +184,20 @@ const char* GameInfoBorders[] =
|
|||
gameinfo.key.color = NAME_Null; \
|
||||
}
|
||||
|
||||
#define GAMEINFOKEY_MUSIC(key, order, variable) \
|
||||
else if(nextKey.CompareNoCase(variable) == 0) \
|
||||
{ \
|
||||
sc.MustGetToken(TK_StringConst); \
|
||||
gameinfo.order = 0; \
|
||||
char *colon = strchr (sc.String, ':'); \
|
||||
if (colon) \
|
||||
{ \
|
||||
gameinfo.order = atoi(colon+1); \
|
||||
*colon = 0; \
|
||||
} \
|
||||
gameinfo.key = sc.String; \
|
||||
}
|
||||
|
||||
|
||||
void FMapInfoParser::ParseGameInfo()
|
||||
{
|
||||
|
@ -286,12 +300,12 @@ void FMapInfoParser::ParseGameInfo()
|
|||
GAMEINFOKEY_STRINGARRAY(creditPages, "CreditPage", 8, true)
|
||||
GAMEINFOKEY_STRINGARRAY(PlayerClasses, "addplayerclasses", 0, false)
|
||||
GAMEINFOKEY_STRINGARRAY(PlayerClasses, "playerclasses", 0, true)
|
||||
GAMEINFOKEY_STRING(titleMusic, "titleMusic")
|
||||
GAMEINFOKEY_MUSIC(titleMusic, titleOrder, "titleMusic")
|
||||
GAMEINFOKEY_FLOAT(titleTime, "titleTime")
|
||||
GAMEINFOKEY_FLOAT(advisoryTime, "advisoryTime")
|
||||
GAMEINFOKEY_FLOAT(pageTime, "pageTime")
|
||||
GAMEINFOKEY_STRING(chatSound, "chatSound")
|
||||
GAMEINFOKEY_STRING(finaleMusic, "finaleMusic")
|
||||
GAMEINFOKEY_MUSIC(finaleMusic, finaleOrder, "finaleMusic")
|
||||
GAMEINFOKEY_CSTRING(finaleFlat, "finaleFlat", 8)
|
||||
GAMEINFOKEY_STRINGARRAY(finalePages, "finalePage", 8, true)
|
||||
GAMEINFOKEY_STRINGARRAY(infoPages, "addinfoPage", 8, false)
|
||||
|
@ -309,7 +323,7 @@ void FMapInfoParser::ParseGameInfo()
|
|||
GAMEINFOKEY_COLOR(defaultbloodparticlecolor, "defaultbloodparticlecolor")
|
||||
GAMEINFOKEY_STRING(backpacktype, "backpacktype")
|
||||
GAMEINFOKEY_STRING(statusbar, "statusbar")
|
||||
GAMEINFOKEY_STRING(intermissionMusic, "intermissionMusic")
|
||||
GAMEINFOKEY_MUSIC(intermissionMusic, intermissionOrder, "intermissionMusic")
|
||||
GAMEINFOKEY_STRING(CursorPic, "CursorPic")
|
||||
GAMEINFOKEY_BOOL(noloopfinalemusic, "noloopfinalemusic")
|
||||
GAMEINFOKEY_BOOL(drawreadthis, "drawreadthis")
|
||||
|
|
3
src/gi.h
3
src/gi.h
|
@ -91,11 +91,13 @@ struct gameinfo_t
|
|||
TArray<FName> PlayerClasses;
|
||||
|
||||
FString titleMusic;
|
||||
int titleOrder;
|
||||
float titleTime;
|
||||
float advisoryTime;
|
||||
float pageTime;
|
||||
FString chatSound;
|
||||
FString finaleMusic;
|
||||
int finaleOrder;
|
||||
char finaleFlat[9];
|
||||
char borderFlat[9];
|
||||
char SkyFlatName[9];
|
||||
|
@ -114,6 +116,7 @@ struct gameinfo_t
|
|||
FString backpacktype;
|
||||
FString statusbar;
|
||||
FString intermissionMusic;
|
||||
int intermissionOrder;
|
||||
FString CursorPic;
|
||||
DWORD dimcolor;
|
||||
float dimamount;
|
||||
|
|
|
@ -80,7 +80,7 @@ void DIntermissionScreen::Init(FIntermissionAction *desc, bool first)
|
|||
if (desc->mMusic.IsEmpty())
|
||||
{
|
||||
// only start the default music if this is the first action in an intermission
|
||||
if (first) S_ChangeMusic (gameinfo.finaleMusic, 0, desc->mMusicLooping);
|
||||
if (first) S_ChangeMusic (gameinfo.finaleMusic, gameinfo.finaleOrder, desc->mMusicLooping);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1947,7 +1947,7 @@ void WI_Ticker(void)
|
|||
if (level.info->InterMusic.IsNotEmpty())
|
||||
S_ChangeMusic(level.info->InterMusic, level.info->intermusicorder);
|
||||
else
|
||||
S_ChangeMusic (gameinfo.intermissionMusic.GetChars());
|
||||
S_ChangeMusic (gameinfo.intermissionMusic.GetChars(), gameinfo.intermissionOrder);
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue