Whatever The Fuck Man

This commit is contained in:
shweet committed 2026-07-04 00:15:26 -04:00
1 parent ce77175162
commit 2efed2a443
162 files changed
+13119 -7417

No files matched your search

+15 -4
View File
@@ -47,8 +47,19 @@ namespace game::resource
void Audio::volume_set(float volume)
{
auto mixer = mixer_get();
MIX_SetMasterGain(mixer, volume);
Audio::volume = volume;
gain_apply();
}
void Audio::mute_set(bool isMuted)
{
Audio::isMuted = isMuted;
gain_apply();
}
void Audio::gain_apply()
{
MIX_SetMasterGain(mixer_get(), isMuted ? 0.0f : volume);
}
Audio::Audio(const std::filesystem::path& path)
@@ -66,7 +77,7 @@ namespace game::resource
cache_set(key, internal);
if (internal) logger.info(std::format("Initialized audio: {}", pathString));
if (!internal) logger.info(std::format("Failed to intialize audio: {} ({})", pathString, SDL_GetError()));
if (!internal) logger.error(std::format("Failed to initialize audio: {} ({})", pathString, SDL_GetError()));
}
Audio::Audio(const physfs::Path& path)
@@ -102,7 +113,7 @@ namespace game::resource
if (internal)
logger.info(std::format("Initialized audio: {}", path.c_str()));
else
logger.info(std::format("Failed to intialize audio: {} ({})", path.c_str(), SDL_GetError()));
logger.error(std::format("Failed to initialize audio: {} ({})", path.c_str(), SDL_GetError()));
}
Audio::Audio(const Audio& other)