diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-10-11 04:25:15 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-10-12 19:22:39 +0200 |
commit | d18a55f429cd1845d5b5e97b37a2b222ac888bb8 (patch) | |
tree | 6ffce0e4f8967c3a4ff77a3b8af4a173963f6bf2 /src/core | |
parent | Merge remote-tracking branch 'origin/master' into miami (diff) | |
download | re3-d18a55f429cd1845d5b5e97b37a2b222ac888bb8.tar re3-d18a55f429cd1845d5b5e97b37a2b222ac888bb8.tar.gz re3-d18a55f429cd1845d5b5e97b37a2b222ac888bb8.tar.bz2 re3-d18a55f429cd1845d5b5e97b37a2b222ac888bb8.tar.lz re3-d18a55f429cd1845d5b5e97b37a2b222ac888bb8.tar.xz re3-d18a55f429cd1845d5b5e97b37a2b222ac888bb8.tar.zst re3-d18a55f429cd1845d5b5e97b37a2b222ac888bb8.zip |
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Frontend.cpp | 91 | ||||
-rw-r--r-- | src/core/config.h | 2 |
2 files changed, 63 insertions, 30 deletions
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp index 59649e93..63684c12 100644 --- a/src/core/Frontend.cpp +++ b/src/core/Frontend.cpp @@ -37,6 +37,7 @@ #include "Messages.h" #include "FileLoader.h" #include "User.h" +#include "sampman.h" // TODO(Miami): Remove that!! That was my map implementation for III, instead use MAP_ENHACEMENTS on some places #define CUSTOM_MAP @@ -376,8 +377,7 @@ CMenuManager::CMenuManager() m_bShowMouse = true; m_nHoverOption = HOVEROPTION_NOT_HOVERING; - // TODO(Miami) - // DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume); + DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume); m_bMenuActive = false; m_bActivateSaveMenu = false; m_bWantToLoad = false; @@ -426,9 +426,7 @@ CMenuManager::Initialise(void) DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume); DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume); m_PrefsRadioStation = DMAudio.GetRadioInCar(); - - // TODO(Miami) - // DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume); + DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume); if (DMAudio.IsMP3RadioChannelAvailable()) { if (m_PrefsRadioStation < WILDSTYLE || m_PrefsRadioStation > USERTRACK) m_PrefsRadioStation = CGeneral::GetRandomNumber() % 10; @@ -570,6 +568,7 @@ CMenuManager::CheckHover(int x1, int x2, int y1, int y2) m_nMousePosY > y1 && m_nMousePosY < y2; } +// --MIAMI: Done void CMenuManager::CheckSliderMovement(int value) { @@ -587,14 +586,27 @@ CMenuManager::CheckSliderMovement(int value) CRenderer::ms_lodDistScale = m_PrefsLOD; break; case MENUACTION_MUSICVOLUME: - m_PrefsMusicVolume += value * (128/32); - m_PrefsMusicVolume = clamp(m_PrefsMusicVolume, 0, 65); - DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume); + if (m_nPrefsAudio3DProviderIndex != NO_AUDIO_PROVIDER) { + m_PrefsMusicVolume += value * (128 / 32); + m_PrefsMusicVolume = clamp(m_PrefsMusicVolume, 0, 65); + DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume); + } break; case MENUACTION_SFXVOLUME: - m_PrefsSfxVolume += value * (128/32); - m_PrefsSfxVolume = clamp(m_PrefsSfxVolume, 0, 65); - DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume); + if (m_nPrefsAudio3DProviderIndex != NO_AUDIO_PROVIDER) { + m_PrefsSfxVolume += value * (128 / 32); + m_PrefsSfxVolume = clamp(m_PrefsSfxVolume, 0, 65); + DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume); + } + break; + case MENUACTION_MP3VOLUMEBOOST: + if (m_nPrefsAudio3DProviderIndex != NO_AUDIO_PROVIDER) { + if (DMAudio.IsMP3RadioChannelAvailable()) { + m_PrefsMP3BoostVolume += value * (128 / 32); + m_PrefsMP3BoostVolume = clamp(m_PrefsMP3BoostVolume, 0, 65); + DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume); + } + } break; case MENUACTION_MOUSESENS: TheCamera.m_fMouseAccelHorzntl += value * 1.0f/200.0f/15.0f; // ??? @@ -1065,20 +1077,17 @@ CMenuManager::DrawStandardMenus(bool activeScreen) else if (m_nPrefsAudio3DProviderIndex == -1) rightText = TheText.Get("FEA_ADP"); else { - char* provider = DMAudio.Get3DProviderName(m_nPrefsAudio3DProviderIndex); - if (provider != NULL) { - if (!strcmp(strupr(provider), "DIRECTSOUND3D HARDWARE SUPPORT")) { - strcpy(provider, "DSOUND3D HARDWARE SUPPORT"); - } - else if (!strcmp(strupr(provider), "DIRECTSOUND3D SOFTWARE EMULATION")) { - strcpy(provider, "DSOUND3D SOFTWARE EMULATION"); - } - AsciiToUnicode(provider, unicodeTemp); - rightText = unicodeTemp; - } - else { - rightText = TheText.Get("not defined"); + char *rawProvider = DMAudio.Get3DProviderName(m_nPrefsAudio3DProviderIndex); + AsciiToUnicode(rawProvider, unicodeTemp); + char *provider = UnicodeToAscii(unicodeTemp); // genius + strupr(provider); + if (!strcmp(provider, "DIRECTSOUND3D HARDWARE SUPPORT")) { + strcpy(provider, "DSOUND3D HARDWARE SUPPORT"); + } else if (!strcmp(provider, "DIRECTSOUND3D SOFTWARE EMULATION")) { + strcpy(provider, "DSOUND3D SOFTWARE EMULATION"); } + AsciiToUnicode(provider, unicodeTemp); + rightText = unicodeTemp; } break; case MENUACTION_SPEAKERCONF: { @@ -4007,6 +4016,7 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u if (selectedProvider != NO_AUDIO_PROVIDER) { if (selectedProvider == -1) selectedProvider = m_nPrefsAudio3DProviderIndex = DMAudio.AutoDetect3DProviders(); + m_nPrefsAudio3DProviderIndex = DMAudio.SetCurrent3DProvider(m_nPrefsAudio3DProviderIndex); if (selectedProvider != m_nPrefsAudio3DProviderIndex) { SetHelperText(5); @@ -4039,7 +4049,7 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u m_PrefsMP3BoostVolume = 0; m_PrefsStereoMono = 1; m_PrefsSpeakers = 0; - // DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume); // TODO(Miami) + DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume); DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume); DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume); DMAudio.SetRadioInCar(m_PrefsRadioStation); @@ -4180,11 +4190,36 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u break; #endif case MENUACTION_AUDIOHW: - // TODO(Miami): What are the extra things in here?? - if (m_nPrefsAudio3DProviderIndex != NO_AUDIO_PROVIDER) { m_nPrefsAudio3DProviderIndex += changeAmount; - m_nPrefsAudio3DProviderIndex = clamp(m_nPrefsAudio3DProviderIndex, 0, DMAudio.GetNum3DProvidersAvailable() - 1); + + bool checkIfForbidden = true; + while (checkIfForbidden) { + checkIfForbidden = false; + + if (m_nPrefsAudio3DProviderIndex < -1) + m_nPrefsAudio3DProviderIndex = DMAudio.GetNum3DProvidersAvailable() - 1; + else if (m_nPrefsAudio3DProviderIndex > DMAudio.GetNum3DProvidersAvailable() - 1) + m_nPrefsAudio3DProviderIndex = -1; + + // what a retarded move... + if (m_nPrefsAudio3DProviderIndex != -1) { + char* provider = DMAudio.Get3DProviderName(m_nPrefsAudio3DProviderIndex); + strupr(provider); + if (!strcmp(provider, "MILES FAST 2D POSITIONAL AUDIO")) { + m_nPrefsAudio3DProviderIndex += changeAmount; + checkIfForbidden = true; + + } else if (!strcmp(provider, "AUREAL A3D 2.0 (TM)")) { + m_nPrefsAudio3DProviderIndex += changeAmount; + checkIfForbidden = true; + + } else if (!strcmp(provider, "AUREAL A3D INTERACTIVE (TM)")) { + m_nPrefsAudio3DProviderIndex += changeAmount; + checkIfForbidden = true; + } + } + } } break; case MENUACTION_SPEAKERCONF: diff --git a/src/core/config.h b/src/core/config.h index f85232ed..57978950 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -314,9 +314,7 @@ enum Config { #define FREE_CAM // Rotating cam // Audio -#ifndef AUDIO_OAL // is not working yet for openal #define AUDIO_CACHE // cache sound lengths to speed up the cold boot -#endif //#define PS2_AUDIO // changes audio paths for cutscenes and radio to PS2 paths, needs vbdec to support VB with MSS |