- handle Blood.

This commit is contained in:
Christoph Oelckers 2019-11-28 03:32:02 +01:00
parent 324056ad88
commit cd4ff92266
6 changed files with 4 additions and 58 deletions

View file

@ -97,8 +97,6 @@ char bAddUserMap = false;
bool bNoDemo = false; bool bNoDemo = false;
bool bQuickStart = true; bool bQuickStart = true;
int gMusicPrevLoadedEpisode = -1;
int gMusicPrevLoadedLevel = -1;
char gUserMapFilename[BMAX_PATH]; char gUserMapFilename[BMAX_PATH];
@ -387,8 +385,6 @@ void PreloadCache(void)
if (gDemo.at1) if (gDemo.at1)
return; return;
PrecacheSounds(); PrecacheSounds();
if (mus_restartonload)
sndTryPlaySpecialMusic(MUS_LOADING);
PreloadTiles(); PreloadTiles();
ClockTicks clock = totalclock; ClockTicks clock = totalclock;
int cnt = 0; int cnt = 0;
@ -485,8 +481,6 @@ void StartLevel(GAMEOPTIONS *gameOptions)
EndLevel(); EndLevel();
gStartNewGame = 0; gStartNewGame = 0;
ready2send = 0; ready2send = 0;
gMusicPrevLoadedEpisode = gGameOptions.nEpisode;
gMusicPrevLoadedLevel = gGameOptions.nLevel;
if (gDemo.at0 && gGameStarted) if (gDemo.at0 && gGameStarted)
gDemo.Close(); gDemo.Close();
netWaitForEveryone(0); netWaitForEveryone(0);

View file

@ -60,8 +60,6 @@ extern bool gRestartGame;
extern double g_gameUpdateTime, g_gameUpdateAndDrawTime; extern double g_gameUpdateTime, g_gameUpdateAndDrawTime;
extern double g_gameUpdateAvgTime; extern double g_gameUpdateAvgTime;
extern int blood_globalflags; extern int blood_globalflags;
extern int gMusicPrevLoadedEpisode;
extern int gMusicPrevLoadedLevel;
extern int gSaveGameNum; extern int gSaveGameNum;
extern bool gPaused; extern bool gPaused;

View file

@ -50,7 +50,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
BEGIN_BLD_NS BEGIN_BLD_NS
int32_t mus_restartonload;
int32_t gTurnSpeed; int32_t gTurnSpeed;
int32_t gDetail; int32_t gDetail;
int32_t cl_weaponswitch; int32_t cl_weaponswitch;

View file

@ -47,6 +47,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "i_specialpaths.h" #include "i_specialpaths.h"
#include "view.h" #include "view.h"
#include "savegamehelp.h" #include "savegamehelp.h"
#include "z_music.h"
BEGIN_BLD_NS BEGIN_BLD_NS
@ -177,14 +178,7 @@ void LoadSave::LoadGame(const char *pzFile)
gGameStarted = 1; gGameStarted = 1;
bVanilla = false; bVanilla = false;
if (mus_restartonload MUS_ResumeSaved();
|| demoWasPlayed
|| (gMusicPrevLoadedEpisode != gGameOptions.nEpisode || gMusicPrevLoadedLevel != gGameOptions.nLevel))
{
levelTryPlayMusic(gGameOptions.nEpisode, gGameOptions.nLevel);
}
gMusicPrevLoadedEpisode = gGameOptions.nEpisode;
gMusicPrevLoadedLevel = gGameOptions.nLevel;
netBroadcastPlayerInfo(myconnectindex); netBroadcastPlayerInfo(myconnectindex);
//sndPlaySong(gGameOptions.zLevelSong, 1); //sndPlaySong(gGameOptions.zLevelSong, 1);

View file

@ -153,43 +153,6 @@ static int osdcmd_demo(osdcmdptr_t parm)
return OSDCMD_OK; return OSDCMD_OK;
} }
static int osdcmd_music(osdcmdptr_t parm)
{
char buffer[128];
if (parm->numparms == 1)
{
int32_t sel = levelGetMusicIdx(parm->parms[0]);
if (sel == -1)
return OSDCMD_SHOWHELP;
if (sel == -2)
{
OSD_Printf("%s is not a valid episode/level number pair\n", parm->parms[0]);
return OSDCMD_OK;
}
int nEpisode = sel/kMaxLevels;
int nLevel = sel%kMaxLevels;
if (!levelTryPlayMusic(nEpisode, nLevel))
{
if (mus_redbook)
snprintf(buffer, sizeof(buffer), "Playing %i track", gEpisodeInfo[nEpisode].at28[nLevel].ate0);
else
snprintf(buffer, sizeof(buffer), "Playing %s", gEpisodeInfo[nEpisode].at28[nLevel].atd0);
viewSetMessage(buffer);
}
else
{
OSD_Printf("No music defined for %s\n", parm->parms[0]);
}
return OSDCMD_OK;
}
return OSDCMD_SHOWHELP;
}
static int osdcmd_vidmode(osdcmdptr_t parm) static int osdcmd_vidmode(osdcmdptr_t parm)
{ {
@ -367,9 +330,6 @@ static int osdcmd_restartsound(osdcmdptr_t UNUSED(parm))
sndInit(); sndInit();
sfxInit(); sfxInit();
if (MusicEnabled() && (gGameStarted || gDemo.at1))
sndPlaySong(nullptr, "*", true);
return OSDCMD_OK; return OSDCMD_OK;
} }
@ -474,7 +434,6 @@ int32_t registerosdcommands(void)
OSD_RegisterFunction("give","give <all|health|weapons|ammo|armor|keys|inventory>: gives requested item", osdcmd_give); OSD_RegisterFunction("give","give <all|health|weapons|ammo|armor|keys|inventory>: gives requested item", osdcmd_give);
OSD_RegisterFunction("god","god: toggles god mode", osdcmd_god); OSD_RegisterFunction("god","god: toggles god mode", osdcmd_god);
OSD_RegisterFunction("music","music E<ep>L<lev>: change music", osdcmd_music);
OSD_RegisterFunction("noclip","noclip: toggles clipping mode", osdcmd_noclip); OSD_RegisterFunction("noclip","noclip: toggles clipping mode", osdcmd_noclip);
OSD_RegisterFunction("quicksave","quicksave: performs a quick save", osdcmd_quicksave); OSD_RegisterFunction("quicksave","quicksave: performs a quick save", osdcmd_quicksave);
OSD_RegisterFunction("quickload","quickload: performs a quick load", osdcmd_quickload); OSD_RegisterFunction("quickload","quickload: performs a quick load", osdcmd_quickload);

View file

@ -71,6 +71,8 @@
#include "savegamehelp.h" #include "savegamehelp.h"
#include "sjson.h" #include "sjson.h"
CVARD(Bool, mus_restartonload, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG, "restart the music when loading a saved game with the same map or not") // only implemented for Blood - todo: generalize
MusPlayingInfo mus_playing; MusPlayingInfo mus_playing;
MusicAliasMap MusicAliases; MusicAliasMap MusicAliases;
MidiDeviceMap MidiDevices; MidiDeviceMap MidiDevices;