mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-02-28 22:21:19 +00:00
- fixed .def 'music' parsing.
This was incomplete and just ignored Duke's special music, and the levelnum generation used an outdated formula so that it never managed to assign any music to the maps.
This commit is contained in:
parent
e2f570a70a
commit
fc1fbfe8b3
5 changed files with 6 additions and 5 deletions
|
@ -38,6 +38,7 @@
|
||||||
#include "raze_music.h"
|
#include "raze_music.h"
|
||||||
#include "filesystem.h"
|
#include "filesystem.h"
|
||||||
#include "printf.h"
|
#include "printf.h"
|
||||||
|
#include "raze_sound.h"
|
||||||
|
|
||||||
FString gSkillNames[MAXSKILLS];
|
FString gSkillNames[MAXSKILLS];
|
||||||
FString gVolumeNames[MAXVOLUMES];
|
FString gVolumeNames[MAXVOLUMES];
|
||||||
|
@ -109,7 +110,8 @@ bool SetMusicForMap(const char* mapname, const char* music, bool namehack)
|
||||||
{
|
{
|
||||||
if (!stricmp(mapname, specials[i]))
|
if (!stricmp(mapname, specials[i]))
|
||||||
{
|
{
|
||||||
// todo: store this properly.
|
if (specialmusic.Size() <= i) specialmusic.Resize(i + 1);
|
||||||
|
specialmusic[i] = music;
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,7 +129,7 @@ bool SetMusicForMap(const char* mapname, const char* music, bool namehack)
|
||||||
if (numMatches != 4 || toupper(b1) != 'E' || toupper(b2) != 'L')
|
if (numMatches != 4 || toupper(b1) != 'E' || toupper(b2) != 'L')
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
index = FindMapByLevelNum(ep*100 + lev);
|
index = FindMapByLevelNum(levelnum(ep - 1, lev - 1));
|
||||||
|
|
||||||
}
|
}
|
||||||
if (index != nullptr)
|
if (index != nullptr)
|
||||||
|
|
|
@ -46,6 +46,7 @@
|
||||||
|
|
||||||
static bool mus_blocked;
|
static bool mus_blocked;
|
||||||
static FString lastStartedMusic;
|
static FString lastStartedMusic;
|
||||||
|
TArray<FString> specialmusic;
|
||||||
|
|
||||||
MusicAliasMap MusicAliases;
|
MusicAliasMap MusicAliases;
|
||||||
MusicAliasMap LevelMusicAliases;
|
MusicAliasMap LevelMusicAliases;
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
typedef TMap<FName, FName> MusicAliasMap;
|
typedef TMap<FName, FName> MusicAliasMap;
|
||||||
extern MusicAliasMap MusicAliases;
|
extern MusicAliasMap MusicAliases;
|
||||||
|
extern TArray<FString> specialmusic;
|
||||||
|
|
||||||
// Totally minimalistic interface - should be all the game modules need.
|
// Totally minimalistic interface - should be all the game modules need.
|
||||||
void Mus_InitMusic();
|
void Mus_InitMusic();
|
||||||
|
|
|
@ -65,7 +65,6 @@ inline DDukeActor* getSndActor(const void* source)
|
||||||
return source ? &hittype[((spritetype*)source) - sprite] : nullptr;
|
return source ? &hittype[((spritetype*)source) - sprite] : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
TArray<FString> specialmusic;
|
|
||||||
static FSoundID currentCommentarySound;
|
static FSoundID currentCommentarySound;
|
||||||
static DDukeActor* currentCommentarySprite; // todo: GC this once actors become objects
|
static DDukeActor* currentCommentarySprite; // todo: GC this once actors become objects
|
||||||
|
|
||||||
|
|
|
@ -74,8 +74,6 @@ void S_ParseDeveloperCommentary();
|
||||||
void StopCommentary();
|
void StopCommentary();
|
||||||
bool StartCommentary(int tag, DDukeActor* sprnum);
|
bool StartCommentary(int tag, DDukeActor* sprnum);
|
||||||
|
|
||||||
extern TArray<FString> specialmusic;
|
|
||||||
|
|
||||||
|
|
||||||
END_DUKE_NS
|
END_DUKE_NS
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue