diff --git a/Source/init.cpp b/Source/init.cpp index fd4841726..70dfdfe71 100644 --- a/Source/init.cpp +++ b/Source/init.cpp @@ -21,6 +21,8 @@ int gbActive; HANDLE hellfire_mpq; /** The current input handler function */ WNDPROC CurrentProc; +/** A handle to the spawn.mpq archive. */ +HANDLE spawn_mpq; /** A handle to the diabdat.mpq archive. */ HANDLE diabdat_mpq; /** A handle to the patch_rt.mpq archive. */ @@ -70,6 +72,10 @@ void init_cleanup() { pfile_flush_W(); + if (spawn_mpq) { + SFileCloseArchive(spawn_mpq); + spawn_mpq = NULL; + } if (diabdat_mpq) { SFileCloseArchive(diabdat_mpq); diabdat_mpq = NULL; @@ -133,11 +139,11 @@ void init_archives() diabdat_mpq = init_test_access("diabdat.mpq", "DiabloCD", 1000, FS_CD); if (diabdat_mpq == NULL) { - diabdat_mpq = init_test_access("spawn.mpq", "DiabloSpawn", 1000, FS_PC); - if (diabdat_mpq != NULL) + spawn_mpq = init_test_access("spawn.mpq", "DiabloSpawn", 1000, FS_PC); + if (spawn_mpq != NULL) gbIsSpawn = true; } - if (diabdat_mpq == NULL || !SFileOpenFile("ui_art\\title.pcx", &fh)) + if (!SFileOpenFile("ui_art\\title.pcx", &fh)) InsertCDDlg(); SFileCloseFile(fh); diff --git a/Source/init.h b/Source/init.h index 5d9d9d82a..604ecb4d2 100644 --- a/Source/init.h +++ b/Source/init.h @@ -16,6 +16,7 @@ extern _SNETVERSIONDATA fileinfo; extern int gbActive; extern HANDLE hellfire_mpq; extern WNDPROC CurrentProc; +extern HANDLE spawn_mpq; extern HANDLE diabdat_mpq; extern bool gbIsSpawn; extern bool gbIsHellfire; diff --git a/Source/mainmenu.cpp b/Source/mainmenu.cpp index 7fcece1b0..b4cf7faa7 100644 --- a/Source/mainmenu.cpp +++ b/Source/mainmenu.cpp @@ -20,12 +20,16 @@ void mainmenu_refresh_music() { music_start(menu_music_track_id); + if (gbIsSpawn && !gbIsHellfire) { + return; + } + do { menu_music_track_id++; + if (menu_music_track_id == NUM_MUSIC || (!gbIsHellfire && menu_music_track_id > TMUSIC_L4)) + menu_music_track_id = TMUSIC_L2; if (gbIsSpawn && menu_music_track_id > TMUSIC_L1) menu_music_track_id = TMUSIC_L5; - if (menu_music_track_id == NUM_MUSIC || (!gbIsHellfire && menu_music_track_id > TMUSIC_L4)) - menu_music_track_id = TMUSIC_TOWN; } while (menu_music_track_id == TMUSIC_TOWN || menu_music_track_id == TMUSIC_L1); } diff --git a/SourceX/DiabloUI/dialogs.cpp b/SourceX/DiabloUI/dialogs.cpp index 6ae1cce9c..894004805 100644 --- a/SourceX/DiabloUI/dialogs.cpp +++ b/SourceX/DiabloUI/dialogs.cpp @@ -11,9 +11,6 @@ namespace dvl { -extern HANDLE diabdat_mpq; -extern SDL_Surface *pal_surface; - namespace { Art dialogArt; diff --git a/SourceX/DiabloUI/selhero.cpp b/SourceX/DiabloUI/selhero.cpp index 746c0247d..650895760 100644 --- a/SourceX/DiabloUI/selhero.cpp +++ b/SourceX/DiabloUI/selhero.cpp @@ -348,7 +348,7 @@ void selhero_ClassSelector_Focus(int value) void selhero_ClassSelector_Select(int value) { int hClass = vecSelHeroDlgItems[value]->m_value; - if (gbSpawned && (hClass == PC_ROGUE || hClass == PC_SORCERER)) { + if (gbSpawned && (hClass == PC_ROGUE || hClass == PC_SORCERER || hClass == PC_BARD)) { ArtBackground.Unload(); UiSelOkDialog(NULL, "The Rogue and Sorcerer are only available in the full retail version of Diablo. Visit https://www.gog.com/game/diablo to purchase.", false); LoadBackgroundArt("ui_art\\selhero.pcx"); diff --git a/SourceX/sound.cpp b/SourceX/sound.cpp index c59530fab..f5f704a25 100644 --- a/SourceX/sound.cpp +++ b/SourceX/sound.cpp @@ -204,7 +204,7 @@ void music_start(int nTrack) assert((DWORD)nTrack < NUM_MUSIC); music_stop(); if (gbMusicOn) { - if (gbIsSpawn) + if (spawn_mpq) trackPath = sgszSpawnMusicTracks[nTrack]; else trackPath = sgszMusicTracks[nTrack]; diff --git a/SourceX/storm/storm.cpp b/SourceX/storm/storm.cpp index 209a953f6..4b48f270f 100644 --- a/SourceX/storm/storm.cpp +++ b/SourceX/storm/storm.cpp @@ -182,7 +182,10 @@ BOOL SFileOpenFile(const char *filename, HANDLE *phFile) if (!result && patch_rt_mpq) { result = SFileOpenFileEx((HANDLE)patch_rt_mpq, filename, 0, phFile); } - if (!result) { + if (!result && spawn_mpq) { + result = SFileOpenFileEx((HANDLE)spawn_mpq, filename, 0, phFile); + } + if (!result && diabdat_mpq) { result = SFileOpenFileEx((HANDLE)diabdat_mpq, filename, 0, phFile); }