From 9655ee9843524d10ba074ae0bd6fc523c92e6d3e Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 9 Jun 2006 08:19:46 +0000 Subject: [PATCH] - Changed music name handling in MAPINFO so that music can be specified by full path of a file in a Zip. - Fixed: intermusic in MAPINFO was limited to WAD lumps and couldn't handle external data. ACS: - Fixed: Global and World array symbols didn't initialize their array information. SVN r182 (trunk) --- docs/rh-log.txt | 6 ++++++ src/d_main.cpp | 4 ++-- src/g_level.cpp | 2 +- src/g_level.h | 3 ++- src/s_sound.cpp | 7 +++++-- src/wi_stuff.cpp | 6 +++--- 6 files changed, 19 insertions(+), 9 deletions(-) diff --git a/docs/rh-log.txt b/docs/rh-log.txt index 1ecff027a..764ede19d 100644 --- a/docs/rh-log.txt +++ b/docs/rh-log.txt @@ -1,3 +1,9 @@ +June 8, 2006 (Changes by Graf Zahl) +- Changed music name handling in MAPINFO so that music can be specified by + full path of a file in a Zip. +- Fixed: intermusic in MAPINFO was limited to WAD lumps and couldn't handle + external data. + June 8, 2006 - Fixed: Trying to play a 0-length song from a wad inside a zip caused a crash. diff --git a/src/d_main.cpp b/src/d_main.cpp index eefef8e2e..e8addb39e 100644 --- a/src/d_main.cpp +++ b/src/d_main.cpp @@ -1545,7 +1545,7 @@ static EIWADType IdentifyVersion (const char *zdoom_wad) #ifdef unix else if (*value == '~' && (*(value + 1) == 0 || *(value + 1) == '/')) { - FString homepath = GetUserFile (*(value + 1) ? value + 2 : value + 1); + FString homepath = GetUserFile (*(value + 1) ? value + 2 : value + 1, true); CheckIWAD (homepath, wads); } #endif @@ -1691,7 +1691,7 @@ static const char *BaseFileSearch (const char *file, const char *ext, bool lookf #ifdef unix else if (*value == '~' && (*(value + 1) == 0 || *(value + 1) == '/')) { - homepath = GetUserFile (*(value + 1) ? value + 2 : value + 1); + homepath = GetUserFile (*(value + 1) ? value + 2 : value + 1, true); dir = homepath; } #endif diff --git a/src/g_level.cpp b/src/g_level.cpp index 0c6eaf631..cf1c0d5ec 100644 --- a/src/g_level.cpp +++ b/src/g_level.cpp @@ -363,7 +363,7 @@ MapHandlers[] = { MITYPE_LUMPNAME, lioffset(exitpic), 0 }, { MITYPE_LUMPNAME, lioffset(exitpic), 0 }, { MITYPE_LUMPNAME, lioffset(enterpic), 0 }, - { MITYPE_LUMPNAME, lioffset(intermusic), 0 }, + { MITYPE_MUSIC, lioffset(intermusic), lioffset(intermusicorder) }, { MITYPE_INT, lioffset(airsupply), 0 }, { MITYPE_SPECIALACTION, lioffset(specialactions), 0 }, { MITYPE_SETFLAG, LEVEL_KEEPFULLINVENTORY, 0 }, diff --git a/src/g_level.h b/src/g_level.h index d762c7379..f9e49a9cc 100644 --- a/src/g_level.h +++ b/src/g_level.h @@ -160,7 +160,8 @@ struct level_info_s char enterpic[9]; char exitpic[9]; - char intermusic[9]; + char *intermusic; + int intermusicorder; char soundinfo[9]; char sndseq[9]; diff --git a/src/s_sound.cpp b/src/s_sound.cpp index 101ec8d16..1d58c1774 100644 --- a/src/s_sound.cpp +++ b/src/s_sound.cpp @@ -1507,8 +1507,11 @@ bool S_ChangeMusic (const char *musicname, int order, bool looping, bool force) { if ((lumpnum = Wads.CheckNumForName (musicname)) == -1) { - Printf ("Music \"%s\" not found\n", musicname); - return false; + if ((lumpnum = Wads.CheckNumForFullName (musicname)) == -1) + { + Printf ("Music \"%s\" not found\n", musicname); + return false; + } } if (!Wads.IsUncompressedFile(lumpnum)) { diff --git a/src/wi_stuff.cpp b/src/wi_stuff.cpp index 2824b7879..1b4d4e9ba 100644 --- a/src/wi_stuff.cpp +++ b/src/wi_stuff.cpp @@ -1917,13 +1917,13 @@ void WI_Ticker(void) if (bcnt == 1) { // intermission music - use the defaults if none specified - if (level.info->intermusic[0]) - S_ChangeMusic(level.info->intermusic); + if (level.info->intermusic != NULL) + S_ChangeMusic(level.info->intermusic, level.info->intermusicorder); else if (gameinfo.gametype == GAME_Heretic) S_ChangeMusic ("mus_intr"); else if (gameinfo.gametype == GAME_Hexen) S_ChangeMusic ("hub"); - else if (gameinfo.gametype == GAME_Strife) // Strife also needs a default! + else if (gameinfo.gametype == GAME_Strife) // Strife also needs a default S_ChangeMusic ("d_slide"); else if (gamemode == commercial) S_ChangeMusic ("d_dm2int");