Implemented master volume slider

This commit is contained in:
Hyper
2024-12-25 21:17:40 +00:00
parent 0b5281d652
commit a1a05f83dc
10 changed files with 25 additions and 14 deletions
+8 -7
View File
@@ -147,25 +147,26 @@ int Window_OnSDLEvent(void*, SDL_Event* event)
return 0;
}
void GameWindow::Init(const char *sdlVideoDriver)
void GameWindow::Init(const char* sdlVideoDriver)
{
#ifdef __linux__
SDL_SetHint("SDL_APP_ID", "io.github.hedge_dev.unleashedrecomp");
#endif
int videoRes = SDL_VideoInit(sdlVideoDriver);
if (videoRes != 0 && sdlVideoDriver != nullptr)
if (SDL_VideoInit(sdlVideoDriver) != 0 && sdlVideoDriver)
{
fmt::println("Failed to initialize the specified SDL Video Driver {}. Falling back to default.", sdlVideoDriver);
LOGFN_ERROR("Failed to initialise the SDL video driver: \"{}\". Falling back to default.", sdlVideoDriver);
SDL_VideoInit(nullptr);
}
const char* videoDriverName = SDL_GetCurrentVideoDriver();
if (videoDriverName != nullptr)
fmt::println("SDL Video Driver: {}", videoDriverName);
auto videoDriverName = SDL_GetCurrentVideoDriver();
if (videoDriverName)
LOGFN("SDL video driver: \"{}\"", videoDriverName);
SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE);
SDL_AddEventWatch(Window_OnSDLEvent, s_pWindow);
#ifdef _WIN32
SetProcessDPIAware();
#endif
+1
View File
@@ -825,6 +825,7 @@ static void DrawConfigOptions()
break;
case 2: // AUDIO
DrawConfigOption(rowCount++, yOffset, &Config::MasterVolume, true);
DrawConfigOption(rowCount++, yOffset, &Config::MusicVolume, true);
DrawConfigOption(rowCount++, yOffset, &Config::EffectsVolume, true);
DrawConfigOption(rowCount++, yOffset, &Config::VoiceLanguage, OptionsMenu::s_pauseMenuType == SWA::eMenuType_WorldMap, cmnReason);
@@ -21,6 +21,7 @@
#include <res/images/options_menu/thumbnails/invert_camera_x.dds.h>
#include <res/images/options_menu/thumbnails/invert_camera_y.dds.h>
#include <res/images/options_menu/thumbnails/language.dds.h>
#include <res/images/options_menu/thumbnails/master_volume.dds.h>
#include <res/images/options_menu/thumbnails/monitor.dds.h>
#include <res/images/options_menu/thumbnails/motion_blur_off.dds.h>
#include <res/images/options_menu/thumbnails/motion_blur_original.dds.h>
@@ -77,6 +78,7 @@ void LoadThumbnails()
g_configThumbnails[&Config::AllowBackgroundInput] = LOAD_ZSTD_TEXTURE(g_allow_background_input);
g_configThumbnails[&Config::AllowDPadMovement] = LOAD_ZSTD_TEXTURE(g_allow_dpad_movement);
g_configThumbnails[&Config::ControllerIcons] = LOAD_ZSTD_TEXTURE(g_controller_icons);
g_configThumbnails[&Config::MasterVolume] = LOAD_ZSTD_TEXTURE(g_master_volume);
g_configThumbnails[&Config::MusicVolume] = LOAD_ZSTD_TEXTURE(g_music_volume);
g_configThumbnails[&Config::EffectsVolume] = LOAD_ZSTD_TEXTURE(g_effects_volume);
g_configThumbnails[&Config::VoiceLanguage] = LOAD_ZSTD_TEXTURE(g_voice_language);
+1 -1
View File
@@ -29,7 +29,7 @@ inline void SDL_MoveEvent(SDL_Window* pWindow, int x, int y)
SDL_PushEvent(&event);
}
inline void SDL_User_EvilSonic(SDL_Window* pWindow, bool isCtor)
inline void SDL_User_EvilSonic(bool isCtor)
{
SDL_Event event{};
event.type = SDL_USER_EVILSONIC;