mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-22 12:05:11 +00:00
Allow object sounds to fade out to 0
This commit is contained in:
parent
3331b5c98b
commit
61b72ae1ee
13 changed files with 20 additions and 3 deletions
|
@ -338,6 +338,7 @@ MASTER_VOLUME = "Hlavní hlasitost"
|
||||||
MUSIC_VOLUME = "Hlasitost písničky"
|
MUSIC_VOLUME = "Hlasitost písničky"
|
||||||
SFX_VOLUME = "Hlasitost zvuků"
|
SFX_VOLUME = "Hlasitost zvuků"
|
||||||
ENV_VOLUME = "Hlasitost prostředí"
|
ENV_VOLUME = "Hlasitost prostředí"
|
||||||
|
FADEOUT = "Fadeout Distant Sounds"
|
||||||
|
|
||||||
[LANGUAGE]
|
[LANGUAGE]
|
||||||
LANGUAGE = "JAZYK"
|
LANGUAGE = "JAZYK"
|
||||||
|
|
|
@ -336,6 +336,7 @@ MASTER_VOLUME = "Meester Geluid"
|
||||||
MUSIC_VOLUME = "Muziek Geluid"
|
MUSIC_VOLUME = "Muziek Geluid"
|
||||||
SFX_VOLUME = "Sfx Geluid"
|
SFX_VOLUME = "Sfx Geluid"
|
||||||
ENV_VOLUME = "Env Geluid"
|
ENV_VOLUME = "Env Geluid"
|
||||||
|
FADEOUT = "Fade-out verre geluiden"
|
||||||
|
|
||||||
[LANGUAGE]
|
[LANGUAGE]
|
||||||
LANGUAGE = "TAAL"
|
LANGUAGE = "TAAL"
|
||||||
|
|
|
@ -338,6 +338,7 @@ MASTER_VOLUME = "Master Volume"
|
||||||
MUSIC_VOLUME = "Music Volume"
|
MUSIC_VOLUME = "Music Volume"
|
||||||
SFX_VOLUME = "Sfx Volume"
|
SFX_VOLUME = "Sfx Volume"
|
||||||
ENV_VOLUME = "Env Volume"
|
ENV_VOLUME = "Env Volume"
|
||||||
|
FADEOUT = "Fadeout Distant Sounds"
|
||||||
|
|
||||||
[LANGUAGE]
|
[LANGUAGE]
|
||||||
LANGUAGE = "LANGUAGE"
|
LANGUAGE = "LANGUAGE"
|
||||||
|
|
|
@ -338,6 +338,7 @@ MASTER_VOLUME = "Volume principal"
|
||||||
MUSIC_VOLUME = "Volume de la musique"
|
MUSIC_VOLUME = "Volume de la musique"
|
||||||
SFX_VOLUME = "Volume des effets sonores"
|
SFX_VOLUME = "Volume des effets sonores"
|
||||||
ENV_VOLUME = "Volume de l'environnement"
|
ENV_VOLUME = "Volume de l'environnement"
|
||||||
|
FADEOUT = "Fondu des sons distants"
|
||||||
|
|
||||||
[LANGUAGE]
|
[LANGUAGE]
|
||||||
LANGUAGE = "LANGUE"
|
LANGUAGE = "LANGUE"
|
||||||
|
|
|
@ -338,6 +338,7 @@ MASTER_VOLUME = "Hauptlautstärke"
|
||||||
MUSIC_VOLUME = "Musik Lautstärke"
|
MUSIC_VOLUME = "Musik Lautstärke"
|
||||||
SFX_VOLUME = "Geräusch Lautstärke"
|
SFX_VOLUME = "Geräusch Lautstärke"
|
||||||
ENV_VOLUME = "Env Lautstärke"
|
ENV_VOLUME = "Env Lautstärke"
|
||||||
|
FADEOUT = "Entfernte Geräusche Ausblenden"
|
||||||
|
|
||||||
[LANGUAGE]
|
[LANGUAGE]
|
||||||
LANGUAGE = "SPRACHE"
|
LANGUAGE = "SPRACHE"
|
||||||
|
|
|
@ -335,6 +335,7 @@ MASTER_VOLUME = "Principale"
|
||||||
MUSIC_VOLUME = "Musica"
|
MUSIC_VOLUME = "Musica"
|
||||||
SFX_VOLUME = "Effetti sonori"
|
SFX_VOLUME = "Effetti sonori"
|
||||||
ENV_VOLUME = "Ambiente"
|
ENV_VOLUME = "Ambiente"
|
||||||
|
FADEOUT = "Suoni lontani in dissolvenza"
|
||||||
|
|
||||||
[LANGUAGE]
|
[LANGUAGE]
|
||||||
LANGUAGE = "LINGUA"
|
LANGUAGE = "LINGUA"
|
||||||
|
|
|
@ -338,6 +338,7 @@ MASTER_VOLUME = "Volume Geral"
|
||||||
MUSIC_VOLUME = "Volume da Música"
|
MUSIC_VOLUME = "Volume da Música"
|
||||||
SFX_VOLUME = "Volume dos Efeitos"
|
SFX_VOLUME = "Volume dos Efeitos"
|
||||||
ENV_VOLUME = "Volume Ambiente"
|
ENV_VOLUME = "Volume Ambiente"
|
||||||
|
FADEOUT = "Desaparecimento do som com a distância"
|
||||||
|
|
||||||
[LANGUAGE]
|
[LANGUAGE]
|
||||||
LANGUAGE = "IDIOMA"
|
LANGUAGE = "IDIOMA"
|
||||||
|
|
|
@ -337,6 +337,7 @@ MASTER_VOLUME = "Общая громкость"
|
||||||
MUSIC_VOLUME = "Громкость музыки"
|
MUSIC_VOLUME = "Громкость музыки"
|
||||||
SFX_VOLUME = "Громкость звуков"
|
SFX_VOLUME = "Громкость звуков"
|
||||||
ENV_VOLUME = "Объёмное звучание"
|
ENV_VOLUME = "Объёмное звучание"
|
||||||
|
FADEOUT = "Затухание далеких звуков"
|
||||||
|
|
||||||
[LANGUAGE]
|
[LANGUAGE]
|
||||||
LANGUAGE = "LANGUAGE"
|
LANGUAGE = "LANGUAGE"
|
||||||
|
|
|
@ -338,6 +338,7 @@ MASTER_VOLUME = "Volumen General"
|
||||||
MUSIC_VOLUME = "Volumen de Música"
|
MUSIC_VOLUME = "Volumen de Música"
|
||||||
SFX_VOLUME = "Volumen de Efectos de Sonido"
|
SFX_VOLUME = "Volumen de Efectos de Sonido"
|
||||||
ENV_VOLUME = "Volumen de Entorno"
|
ENV_VOLUME = "Volumen de Entorno"
|
||||||
|
FADEOUT = "Desvanecimiento de sonidos distantes"
|
||||||
|
|
||||||
[LANGUAGE]
|
[LANGUAGE]
|
||||||
LANGUAGE = "IDIOMA"
|
LANGUAGE = "IDIOMA"
|
||||||
|
|
|
@ -1264,11 +1264,15 @@ f32 get_sound_pan(f32 x, f32 z) {
|
||||||
* Called from threads: thread4_sound, thread5_game_loop (EU only)
|
* Called from threads: thread4_sound, thread5_game_loop (EU only)
|
||||||
*/
|
*/
|
||||||
static f32 get_sound_volume(u8 bank, u8 soundIndex, f32 volumeRange) {
|
static f32 get_sound_volume(u8 bank, u8 soundIndex, f32 volumeRange) {
|
||||||
|
if (configFadeoutDistantSounds) {
|
||||||
|
volumeRange = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (bank >= SOUND_BANK_COUNT || soundIndex >= SOUND_INDEX_COUNT) { return 0; }
|
if (bank >= SOUND_BANK_COUNT || soundIndex >= SOUND_INDEX_COUNT) { return 0; }
|
||||||
f32 maxSoundDistance;
|
f32 maxSoundDistance = AUDIO_MAX_DISTANCE;
|
||||||
f32 intensity;
|
f32 intensity = 0;
|
||||||
#ifndef VERSION_JP
|
#ifndef VERSION_JP
|
||||||
s32 div = bank < 3 ? 2 : 3;
|
f32 div = (bank < 3) ? 2.0f : 3.0f;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (!(sSoundBanks[bank][soundIndex].soundBits & SOUND_NO_VOLUME_LOSS)) {
|
if (!(sSoundBanks[bank][soundIndex].soundBits & SOUND_NO_VOLUME_LOSS)) {
|
||||||
|
|
|
@ -158,6 +158,7 @@ bool configForce4By3 = false;
|
||||||
char configCoopNetIp[MAX_CONFIG_STRING] = DEFAULT_COOPNET_IP;
|
char configCoopNetIp[MAX_CONFIG_STRING] = DEFAULT_COOPNET_IP;
|
||||||
unsigned int configCoopNetPort = DEFAULT_COOPNET_PORT;
|
unsigned int configCoopNetPort = DEFAULT_COOPNET_PORT;
|
||||||
char configPassword[MAX_CONFIG_STRING] = "";
|
char configPassword[MAX_CONFIG_STRING] = "";
|
||||||
|
bool configFadeoutDistantSounds = true;
|
||||||
|
|
||||||
static const struct ConfigOption options[] = {
|
static const struct ConfigOption options[] = {
|
||||||
{.name = "fullscreen", .type = CONFIG_TYPE_BOOL, .boolValue = &configWindow.fullscreen},
|
{.name = "fullscreen", .type = CONFIG_TYPE_BOOL, .boolValue = &configWindow.fullscreen},
|
||||||
|
@ -268,6 +269,7 @@ static const struct ConfigOption options[] = {
|
||||||
{.name = "coopnet_ip", .type = CONFIG_TYPE_STRING, .stringValue = (char*)&configCoopNetIp, .maxStringLength = MAX_CONFIG_STRING},
|
{.name = "coopnet_ip", .type = CONFIG_TYPE_STRING, .stringValue = (char*)&configCoopNetIp, .maxStringLength = MAX_CONFIG_STRING},
|
||||||
{.name = "coopnet_port", .type = CONFIG_TYPE_UINT , .uintValue = &configCoopNetPort},
|
{.name = "coopnet_port", .type = CONFIG_TYPE_UINT , .uintValue = &configCoopNetPort},
|
||||||
{.name = "coopnet_password", .type = CONFIG_TYPE_STRING, .stringValue = (char*)&configPassword, .maxStringLength = MAX_CONFIG_STRING},
|
{.name = "coopnet_password", .type = CONFIG_TYPE_STRING, .stringValue = (char*)&configPassword, .maxStringLength = MAX_CONFIG_STRING},
|
||||||
|
{.name = "fade_distant_sounds", .type = CONFIG_TYPE_BOOL , .boolValue = &configFadeoutDistantSounds},
|
||||||
};
|
};
|
||||||
|
|
||||||
// FunctionConfigOption functions
|
// FunctionConfigOption functions
|
||||||
|
|
|
@ -115,6 +115,7 @@ extern bool configForce4By3;
|
||||||
extern char configCoopNetIp[];
|
extern char configCoopNetIp[];
|
||||||
extern unsigned int configCoopNetPort;
|
extern unsigned int configCoopNetPort;
|
||||||
extern char configPassword[];
|
extern char configPassword[];
|
||||||
|
extern bool configFadeoutDistantSounds;
|
||||||
|
|
||||||
void configfile_load(void);
|
void configfile_load(void);
|
||||||
void configfile_save(const char *filename);
|
void configfile_save(const char *filename);
|
||||||
|
|
|
@ -13,6 +13,7 @@ void djui_panel_sound_create(struct DjuiBase* caller) {
|
||||||
djui_slider_create(body, DLANG(SOUND, MUSIC_VOLUME), &configMusicVolume, 0, 127, NULL);
|
djui_slider_create(body, DLANG(SOUND, MUSIC_VOLUME), &configMusicVolume, 0, 127, NULL);
|
||||||
djui_slider_create(body, DLANG(SOUND, SFX_VOLUME), &configSfxVolume, 0, 127, NULL);
|
djui_slider_create(body, DLANG(SOUND, SFX_VOLUME), &configSfxVolume, 0, 127, NULL);
|
||||||
djui_slider_create(body, DLANG(SOUND, ENV_VOLUME), &configEnvVolume, 0, 127, NULL);
|
djui_slider_create(body, DLANG(SOUND, ENV_VOLUME), &configEnvVolume, 0, 127, NULL);
|
||||||
|
djui_checkbox_create(body, DLANG(SOUND, FADEOUT), &configFadeoutDistantSounds, NULL);
|
||||||
djui_button_create(body, DLANG(MENU, BACK), DJUI_BUTTON_STYLE_BACK, djui_panel_menu_back);
|
djui_button_create(body, DLANG(MENU, BACK), DJUI_BUTTON_STYLE_BACK, djui_panel_menu_back);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue