mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 17:43:52 +00:00
Replace (std::min + std::max) with std::clamp
Replace (std::min + std::max) with std::clamp
This commit is contained in:
commit
2afd455d52
1 changed files with 2 additions and 1 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
#include "audio/audio_engine.hpp"
|
#include "audio/audio_engine.hpp"
|
||||||
#include "pipeline/asset_manager.hpp"
|
#include "pipeline/asset_manager.hpp"
|
||||||
#include "core/logger.hpp"
|
#include "core/logger.hpp"
|
||||||
|
#include <algorithm>
|
||||||
#include <random>
|
#include <random>
|
||||||
|
|
||||||
namespace wowee {
|
namespace wowee {
|
||||||
|
|
@ -180,7 +181,7 @@ void SpellSoundManager::playRandomSound(const std::vector<SpellSample>& library,
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellSoundManager::setVolumeScale(float scale) {
|
void SpellSoundManager::setVolumeScale(float scale) {
|
||||||
volumeScale_ = std::max(0.0f, std::min(1.0f, scale));
|
volumeScale_ = std::clamp(scale, .0f, 1.f);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SpellSoundManager::playPrecast(MagicSchool school, SpellPower power) {
|
void SpellSoundManager::playPrecast(MagicSchool school, SpellPower power) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue