forked from Ports/perfect_dark
port: add option to disable death music in MP
This commit is contained in:
1 parent
94e8e1b5e7
commit
2d3e3d1aaf
4 files changed
+70
No files matched your search
@@ -151,6 +151,7 @@ PD_CONSTRUCTOR static void gameConfigInit(void)
|
||||
configRegisterFloat("Game.ScreenShakeIntensity", &g_ViShakeIntensityMult, 0.f, 10.f);
|
||||
configRegisterInt("Game.TickRateDivisor", &g_TickRateDiv, 0, 10);
|
||||
configRegisterInt("Game.SkipIntro", &g_SkipIntro, 0, 1);
|
||||
configRegisterInt("Game.DisableMpDeathMusic", &g_MusicDisableMpDeath, 0, 1);
|
||||
for (s32 j = 0; j < MAX_PLAYERS; ++j) {
|
||||
const s32 i = j + 1;
|
||||
configRegisterFloat(strFmt("Game.Player%d.FovY", i), &g_PlayerExtCfg[j].fovy, 5.f, 175.f);
|
||||
|
||||
@@ -724,6 +724,56 @@ struct menudialogdef g_ExtendedVideoMenuDialog = {
|
||||
NULL,
|
||||
};
|
||||
|
||||
static MenuItemHandlerResult menuhandlerDisableMpDeathMusic(s32 operation, struct menuitem *item, union handlerdata *data)
|
||||
{
|
||||
switch (operation) {
|
||||
case MENUOP_GET:
|
||||
return g_MusicDisableMpDeath;
|
||||
case MENUOP_SET:
|
||||
g_MusicDisableMpDeath = data->checkbox.value;
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct menuitem g_ExtendedAudioMenuItems[] = {
|
||||
{
|
||||
MENUITEMTYPE_CHECKBOX,
|
||||
0,
|
||||
MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"Disable MP Death Music",
|
||||
0,
|
||||
menuhandlerDisableMpDeathMusic,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_SEPARATOR,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
NULL,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_SELECTABLE,
|
||||
0,
|
||||
MENUITEMFLAG_SELECTABLE_CLOSESDIALOG,
|
||||
L_OPTIONS_213, // "Back"
|
||||
0,
|
||||
NULL,
|
||||
},
|
||||
{ MENUITEMTYPE_END },
|
||||
};
|
||||
|
||||
struct menudialogdef g_ExtendedAudioMenuDialog = {
|
||||
MENUDIALOGTYPE_DEFAULT,
|
||||
(uintptr_t)"Extended Audio Options",
|
||||
g_ExtendedAudioMenuItems,
|
||||
NULL,
|
||||
MENUDIALOGFLAG_LITERAL_TEXT,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static MenuItemHandlerResult menuhandlerCrouchMode(s32 operation, struct menuitem *item, union handlerdata *data)
|
||||
{
|
||||
static const char *opts[] = {
|
||||
@@ -1107,6 +1157,14 @@ struct menuitem g_ExtendedMenuItems[] = {
|
||||
0,
|
||||
(void *)&g_ExtendedVideoMenuDialog,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_SELECTABLE,
|
||||
0,
|
||||
MENUITEMFLAG_SELECTABLE_OPENSDIALOG | MENUITEMFLAG_LITERAL_TEXT,
|
||||
(uintptr_t)"Audio\n",
|
||||
0,
|
||||
(void *)&g_ExtendedAudioMenuDialog,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_SELECTABLE,
|
||||
0,
|
||||
|
||||
@@ -46,6 +46,10 @@ s32 g_MusicAge60 = 0; // The current age of the MP track being played
|
||||
s32 g_MusicLife60 = TICKS(120); // The max age of any MP track (this value is changed in MP code)
|
||||
s32 g_MusicSilenceTimer60 = 0; // Counts down the 2 second silence between MP track changes
|
||||
|
||||
#ifndef PLATFORM_N64
|
||||
s32 g_MusicDisableMpDeath = false;
|
||||
#endif
|
||||
|
||||
#if VERSION < VERSION_NTSC_1_0
|
||||
const char var7f1b2030nb[] = "MUSIC : musicPlayLevel\n";
|
||||
const char var7f1b2048nb[] = "MUSIC : SWITCHING TO CORRECT AMBIENT TUNE\n";
|
||||
@@ -516,6 +520,12 @@ void _musicStartMpDeath(f32 arg0)
|
||||
|
||||
void musicStartMpDeath(void)
|
||||
{
|
||||
#ifndef PLATFORM_N64
|
||||
if (g_MusicDisableMpDeath) {
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if VERSION >= VERSION_NTSC_1_0
|
||||
musicSaveInterval();
|
||||
#endif
|
||||
|
||||
@@ -546,6 +546,7 @@ extern s32 g_PrevFrameFb;
|
||||
extern s32 g_BlurFb;
|
||||
extern s32 g_BlurFbCapTimer;
|
||||
extern s32 g_TickRateDiv;
|
||||
extern s32 g_MusicDisableMpDeath;
|
||||
|
||||
#define PLAYER_EXTCFG() g_PlayerExtCfg[g_Vars.currentplayerstats->mpindex & 3]
|
||||
#define PLAYER_DEFAULT_FOV (PLAYER_EXTCFG().fovy)
|
||||
|
||||
Reference in new issue
Block a user