mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-28 04:51:42 +00:00
Nix'd midimusicvolume
This commit is contained in:
parent
3cce0b8a33
commit
5a2663704e
7 changed files with 7 additions and 53 deletions
|
|
@ -1212,7 +1212,7 @@ void D_SRB2Main(void)
|
||||||
}
|
}
|
||||||
I_StartupSound();
|
I_StartupSound();
|
||||||
I_InitMusic();
|
I_InitMusic();
|
||||||
S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value);
|
S_Init(cv_soundvolume.value, cv_digmusicvolume.value);
|
||||||
|
|
||||||
CONS_Printf("ST_Init(): Init status bar.\n");
|
CONS_Printf("ST_Init(): Init status bar.\n");
|
||||||
ST_Init();
|
ST_Init();
|
||||||
|
|
|
||||||
|
|
@ -790,7 +790,6 @@ void D_RegisterClientCommands(void)
|
||||||
CV_RegisterVar(&cv_soundvolume);
|
CV_RegisterVar(&cv_soundvolume);
|
||||||
CV_RegisterVar(&cv_closedcaptioning);
|
CV_RegisterVar(&cv_closedcaptioning);
|
||||||
CV_RegisterVar(&cv_digmusicvolume);
|
CV_RegisterVar(&cv_digmusicvolume);
|
||||||
CV_RegisterVar(&cv_midimusicvolume);
|
|
||||||
CV_RegisterVar(&cv_numChannels);
|
CV_RegisterVar(&cv_numChannels);
|
||||||
|
|
||||||
// i_cdmus.c
|
// i_cdmus.c
|
||||||
|
|
@ -4058,7 +4057,6 @@ static void Command_RestartAudio_f(void)
|
||||||
|
|
||||||
I_SetSfxVolume(cv_soundvolume.value);
|
I_SetSfxVolume(cv_soundvolume.value);
|
||||||
I_SetDigMusicVolume(cv_digmusicvolume.value);
|
I_SetDigMusicVolume(cv_digmusicvolume.value);
|
||||||
I_SetMIDIMusicVolume(cv_midimusicvolume.value);
|
|
||||||
if (Playing()) // Gotta make sure the player is in a level
|
if (Playing()) // Gotta make sure the player is in a level
|
||||||
P_RestoreMusic(&players[consoleplayer]);
|
P_RestoreMusic(&players[consoleplayer]);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -144,14 +144,6 @@ void I_InitMIDIMusic(void);
|
||||||
*/
|
*/
|
||||||
void I_ShutdownMIDIMusic(void);
|
void I_ShutdownMIDIMusic(void);
|
||||||
|
|
||||||
/** \brief The I_SetMIDIMusicVolume function
|
|
||||||
|
|
||||||
\param volume volume to set at
|
|
||||||
|
|
||||||
\return void
|
|
||||||
*/
|
|
||||||
void I_SetMIDIMusicVolume(UINT8 volume);
|
|
||||||
|
|
||||||
/** \brief Registers a song handle to song data.
|
/** \brief Registers a song handle to song data.
|
||||||
|
|
||||||
\param data pointer to song data
|
\param data pointer to song data
|
||||||
|
|
|
||||||
|
|
@ -1314,9 +1314,6 @@ static menuitem_t OP_SoundOptionsMenu[] =
|
||||||
{IT_STRING | IT_KEYHANDLER, NULL, "Digital Music", M_ToggleDigital, 40},
|
{IT_STRING | IT_KEYHANDLER, NULL, "Digital Music", M_ToggleDigital, 40},
|
||||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Digital Music Volume", &cv_digmusicvolume, 50},
|
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Digital Music Volume", &cv_digmusicvolume, 50},
|
||||||
|
|
||||||
{IT_STRING | IT_KEYHANDLER, NULL, "MIDI Music", M_ToggleMIDI, 70},
|
|
||||||
{IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "MIDI Music Volume", &cv_midimusicvolume, 80},
|
|
||||||
|
|
||||||
{IT_STRING | IT_CVAR, NULL, "Closed Captioning", &cv_closedcaptioning, 100},
|
{IT_STRING | IT_CVAR, NULL, "Closed Captioning", &cv_closedcaptioning, 100},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -9421,7 +9418,7 @@ static void M_ToggleSFX(INT32 choice)
|
||||||
nosound = false;
|
nosound = false;
|
||||||
I_StartupSound();
|
I_StartupSound();
|
||||||
if (nosound) return;
|
if (nosound) return;
|
||||||
S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value);
|
S_Init(cv_soundvolume.value, cv_digmusicvolume.value);
|
||||||
S_StartSound(NULL, sfx_strpst);
|
S_StartSound(NULL, sfx_strpst);
|
||||||
OP_SoundOptionsMenu[6].status = IT_STRING | IT_CVAR;
|
OP_SoundOptionsMenu[6].status = IT_STRING | IT_CVAR;
|
||||||
//M_StartMessage(M_GetText("SFX Enabled\n"), NULL, MM_NOTHING);
|
//M_StartMessage(M_GetText("SFX Enabled\n"), NULL, MM_NOTHING);
|
||||||
|
|
@ -9474,7 +9471,7 @@ static void M_ToggleDigital(INT32 choice)
|
||||||
nodigimusic = false;
|
nodigimusic = false;
|
||||||
I_InitDigMusic();
|
I_InitDigMusic();
|
||||||
if (nodigimusic) return;
|
if (nodigimusic) return;
|
||||||
S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value);
|
S_Init(cv_soundvolume.value, cv_digmusicvolume.value);
|
||||||
S_StopMusic();
|
S_StopMusic();
|
||||||
if (Playing())
|
if (Playing())
|
||||||
P_RestoreMusic(&players[consoleplayer]);
|
P_RestoreMusic(&players[consoleplayer]);
|
||||||
|
|
@ -9531,7 +9528,7 @@ static void M_ToggleMIDI(INT32 choice)
|
||||||
nomidimusic = false;
|
nomidimusic = false;
|
||||||
I_InitMIDIMusic();
|
I_InitMIDIMusic();
|
||||||
if (nomidimusic) return;
|
if (nomidimusic) return;
|
||||||
S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value);
|
S_Init(cv_soundvolume.value, cv_digmusicvolume.value);
|
||||||
if (Playing())
|
if (Playing())
|
||||||
P_RestoreMusic(&players[consoleplayer]);
|
P_RestoreMusic(&players[consoleplayer]);
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -77,7 +77,6 @@ static consvar_t precachesound = {"precachesound", "Off", CV_SAVE, CV_OnOff, NUL
|
||||||
// actual general (maximum) sound & music volume, saved into the config
|
// actual general (maximum) sound & music volume, saved into the config
|
||||||
consvar_t cv_soundvolume = {"soundvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_soundvolume = {"soundvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
consvar_t cv_digmusicvolume = {"digmusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||||
consvar_t cv_midimusicvolume = {"midimusicvolume", "18", CV_SAVE, soundvolume_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
|
||||||
|
|
||||||
static void Captioning_OnChange(void)
|
static void Captioning_OnChange(void)
|
||||||
{
|
{
|
||||||
|
|
@ -788,7 +787,6 @@ void S_StopSound(void *origin)
|
||||||
//
|
//
|
||||||
static INT32 actualsfxvolume; // check for change through console
|
static INT32 actualsfxvolume; // check for change through console
|
||||||
static INT32 actualdigmusicvolume;
|
static INT32 actualdigmusicvolume;
|
||||||
static INT32 actualmidimusicvolume;
|
|
||||||
|
|
||||||
void S_UpdateSounds(void)
|
void S_UpdateSounds(void)
|
||||||
{
|
{
|
||||||
|
|
@ -810,8 +808,6 @@ void S_UpdateSounds(void)
|
||||||
S_SetSfxVolume (cv_soundvolume.value);
|
S_SetSfxVolume (cv_soundvolume.value);
|
||||||
if (actualdigmusicvolume != cv_digmusicvolume.value)
|
if (actualdigmusicvolume != cv_digmusicvolume.value)
|
||||||
S_SetDigMusicVolume (cv_digmusicvolume.value);
|
S_SetDigMusicVolume (cv_digmusicvolume.value);
|
||||||
if (actualmidimusicvolume != cv_midimusicvolume.value)
|
|
||||||
S_SetMIDIMusicVolume (cv_midimusicvolume.value);
|
|
||||||
|
|
||||||
// We're done now, if we're not in a level.
|
// We're done now, if we're not in a level.
|
||||||
if (gamestate != GS_LEVEL)
|
if (gamestate != GS_LEVEL)
|
||||||
|
|
@ -1447,20 +1443,6 @@ void S_SetDigMusicVolume(INT32 volume)
|
||||||
I_SetDigMusicVolume(volume&31);
|
I_SetDigMusicVolume(volume&31);
|
||||||
}
|
}
|
||||||
|
|
||||||
void S_SetMIDIMusicVolume(INT32 volume)
|
|
||||||
{
|
|
||||||
if (volume < 0 || volume > 31)
|
|
||||||
CONS_Alert(CONS_WARNING, "musicvolume should be between 0-31\n");
|
|
||||||
|
|
||||||
CV_SetValue(&cv_midimusicvolume, volume&0x1f);
|
|
||||||
actualmidimusicvolume = cv_midimusicvolume.value; //check for change of var
|
|
||||||
|
|
||||||
#ifdef DJGPPDOS
|
|
||||||
I_SetMIDIMusicVolume(31); // Trick for buggy dos drivers. Win32 doesn't need this.
|
|
||||||
#endif
|
|
||||||
I_SetMIDIMusicVolume(volume&0x1f);
|
|
||||||
}
|
|
||||||
|
|
||||||
/// ------------------------
|
/// ------------------------
|
||||||
/// Init & Others
|
/// Init & Others
|
||||||
/// ------------------------
|
/// ------------------------
|
||||||
|
|
@ -1470,7 +1452,7 @@ void S_SetMIDIMusicVolume(INT32 volume)
|
||||||
// Sets channels, SFX and music volume,
|
// Sets channels, SFX and music volume,
|
||||||
// allocates channel buffer, sets S_sfx lookup.
|
// allocates channel buffer, sets S_sfx lookup.
|
||||||
//
|
//
|
||||||
void S_Init(INT32 sfxVolume, INT32 digMusicVolume, INT32 midiMusicVolume)
|
void S_Init(INT32 sfxVolume, INT32 digMusicVolume)
|
||||||
{
|
{
|
||||||
INT32 i;
|
INT32 i;
|
||||||
|
|
||||||
|
|
@ -1479,7 +1461,6 @@ void S_Init(INT32 sfxVolume, INT32 digMusicVolume, INT32 midiMusicVolume)
|
||||||
|
|
||||||
S_SetSfxVolume(sfxVolume);
|
S_SetSfxVolume(sfxVolume);
|
||||||
S_SetDigMusicVolume(digMusicVolume);
|
S_SetDigMusicVolume(digMusicVolume);
|
||||||
S_SetMIDIMusicVolume(midiMusicVolume);
|
|
||||||
|
|
||||||
SetChannelsNum();
|
SetChannelsNum();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
#define PICKUP_SOUND 0x8000
|
#define PICKUP_SOUND 0x8000
|
||||||
|
|
||||||
extern consvar_t stereoreverse;
|
extern consvar_t stereoreverse;
|
||||||
extern consvar_t cv_soundvolume, cv_closedcaptioning, cv_digmusicvolume, cv_midimusicvolume;
|
extern consvar_t cv_soundvolume, cv_closedcaptioning, cv_digmusicvolume;
|
||||||
extern consvar_t cv_numChannels;
|
extern consvar_t cv_numChannels;
|
||||||
|
|
||||||
#ifdef SNDSERV
|
#ifdef SNDSERV
|
||||||
|
|
@ -99,7 +99,7 @@ void S_RegisterSoundStuff(void);
|
||||||
// Initializes sound stuff, including volume
|
// Initializes sound stuff, including volume
|
||||||
// Sets channels, SFX and music volume, allocates channel buffer, sets S_sfx lookup.
|
// Sets channels, SFX and music volume, allocates channel buffer, sets S_sfx lookup.
|
||||||
//
|
//
|
||||||
void S_Init(INT32 sfxVolume, INT32 digMusicVolume, INT32 midiMusicVolume);
|
void S_Init(INT32 sfxVolume, INT32 digMusicVolume);
|
||||||
|
|
||||||
//
|
//
|
||||||
// Per level startup code.
|
// Per level startup code.
|
||||||
|
|
@ -150,7 +150,6 @@ void S_UpdateSounds(void);
|
||||||
FUNCMATH fixed_t S_CalculateSoundDistance(fixed_t px1, fixed_t py1, fixed_t pz1, fixed_t px2, fixed_t py2, fixed_t pz2);
|
FUNCMATH fixed_t S_CalculateSoundDistance(fixed_t px1, fixed_t py1, fixed_t pz1, fixed_t px2, fixed_t py2, fixed_t pz2);
|
||||||
|
|
||||||
void S_SetDigMusicVolume(INT32 volume);
|
void S_SetDigMusicVolume(INT32 volume);
|
||||||
void S_SetMIDIMusicVolume(INT32 volume);
|
|
||||||
void S_SetSfxVolume(INT32 volume);
|
void S_SetSfxVolume(INT32 volume);
|
||||||
|
|
||||||
INT32 S_OriginPlaying(void *origin);
|
INT32 S_OriginPlaying(void *origin);
|
||||||
|
|
|
||||||
|
|
@ -783,19 +783,6 @@ void I_ShutdownMIDIMusic(void)
|
||||||
music = NULL;
|
music = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void I_SetMIDIMusicVolume(UINT8 volume)
|
|
||||||
{
|
|
||||||
// HACK: Until we stop using native MIDI,
|
|
||||||
// disable volume changes
|
|
||||||
(void)volume;
|
|
||||||
midi_volume = 31;
|
|
||||||
//midi_volume = volume;
|
|
||||||
|
|
||||||
if (!midimode || !music)
|
|
||||||
return;
|
|
||||||
Mix_VolumeMusic((UINT32)midi_volume*128/31);
|
|
||||||
}
|
|
||||||
|
|
||||||
INT32 I_RegisterSong(void *data, size_t len)
|
INT32 I_RegisterSong(void *data, size_t len)
|
||||||
{
|
{
|
||||||
music = Mix_LoadMUS_RW(SDL_RWFromMem(data, len), SDL_FALSE);
|
music = Mix_LoadMUS_RW(SDL_RWFromMem(data, len), SDL_FALSE);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue