Skip to content

Commit

Permalink
music: add ability to mute music in main menu
Browse files Browse the repository at this point in the history
Closes #119
  • Loading branch information
rr- committed Oct 17, 2021
1 parent b075f4e commit a9090a9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions cfg/Tomb1Main.json5
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@
// Disables ingame cinematics.
"disable_cine": false,

// Disables music in the main menu.
"disable_music_in_menu": false,

// Overrides game resolution. Leave at 0 or negative values to
// automatically guess from the screen size. Note: these values
// only override the last position in the game resolutions menu that
Expand Down
1 change: 1 addition & 0 deletions src/config.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ int8_t T1MReadConfigFromJson(const char *cfg_data)
READ_BOOL(disable_demo, 0);
READ_BOOL(disable_fmv, 0);
READ_BOOL(disable_cine, 0);
READ_BOOL(disable_music_in_menu, 0);

READ_BAR_SHOWING_MODE(healthbar_showing_mode, T1M_BSM_FLASHING_OR_DEFAULT);
READ_BAR_SHOWING_MODE(airbar_showing_mode, T1M_BSM_DEFAULT);
Expand Down
1 change: 1 addition & 0 deletions src/config.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ typedef struct {
int8_t disable_demo;
int8_t disable_fmv;
int8_t disable_cine;
int8_t disable_music_in_menu;
int32_t resolution_width;
int32_t resolution_height;
} T1MConfigStruct;
Expand Down
4 changes: 4 additions & 0 deletions src/specific/sndpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,10 @@ void S_MusicUnpause()
// original name: CDPlay
int32_t MusicPlay(int16_t track)
{
if (CurrentLevel == GF.title_level_num && T1MConfig.disable_music_in_menu) {
return 0;
}

if (track < 2) {
return 0;
}
Expand Down

0 comments on commit a9090a9

Please sign in to comment.