mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Adds complete audio volume controls for all 11 audio systems with master volume. Reorganizes settings window into Video, Audio, and Gameplay tabs for better UX. Audio Features: - Master volume control affecting all audio systems - Individual volume sliders for: Music, Ambient, UI, Combat, Spell, Movement, Footsteps, NPC Voices, Mounts, Activity sounds - Real-time volume adjustment with master volume multiplier - Restore defaults button per tab Technical Changes: - Added getVolumeScale() getters to all audio managers - Integrated all 10 audio managers into renderer (UI, Combat, Spell, Movement added) - Expanded game_screen.hpp with 11 pending volume variables - Reorganized settings window using ImGui tab bars (Video/Audio/Gameplay) - Audio settings uses scrollable child window for 11 volume controls - Settings window expanded to 520x720px to accommodate comprehensive controls
107 lines
3.2 KiB
C++
107 lines
3.2 KiB
C++
#pragma once
|
|
|
|
#include <vector>
|
|
#include <memory>
|
|
#include <string>
|
|
#include <cstdint>
|
|
|
|
namespace wowee {
|
|
namespace pipeline {
|
|
class AssetManager;
|
|
}
|
|
|
|
namespace audio {
|
|
|
|
class SpellSoundManager {
|
|
public:
|
|
SpellSoundManager() = default;
|
|
~SpellSoundManager() = default;
|
|
|
|
// Initialization
|
|
bool initialize(pipeline::AssetManager* assets);
|
|
void shutdown();
|
|
|
|
// Volume control
|
|
void setVolumeScale(float scale);
|
|
float getVolumeScale() const { return volumeScale_; }
|
|
|
|
// Magic school types
|
|
enum class MagicSchool {
|
|
FIRE,
|
|
FROST,
|
|
HOLY,
|
|
NATURE,
|
|
SHADOW,
|
|
ARCANE,
|
|
PHYSICAL // Non-magical abilities
|
|
};
|
|
|
|
// Spell power level
|
|
enum class SpellPower {
|
|
LOW, // Weak spells, low level
|
|
MEDIUM, // Standard spells
|
|
HIGH // Powerful spells
|
|
};
|
|
|
|
// Spell casting sounds
|
|
void playPrecast(MagicSchool school, SpellPower power); // Channeling/preparation
|
|
void playCast(MagicSchool school); // When spell fires
|
|
void playImpact(MagicSchool school, SpellPower power); // When spell hits target
|
|
|
|
// Specific spell sounds
|
|
void playFireball();
|
|
void playFrostbolt();
|
|
void playLightningBolt();
|
|
void playHeal();
|
|
void playShadowBolt();
|
|
|
|
private:
|
|
struct SpellSample {
|
|
std::string path;
|
|
std::vector<uint8_t> data;
|
|
bool loaded;
|
|
};
|
|
|
|
// Precast sound libraries (channeling)
|
|
std::vector<SpellSample> precastFireLowSounds_;
|
|
std::vector<SpellSample> precastFireMediumSounds_;
|
|
std::vector<SpellSample> precastFireHighSounds_;
|
|
std::vector<SpellSample> precastFrostLowSounds_;
|
|
std::vector<SpellSample> precastFrostMediumSounds_;
|
|
std::vector<SpellSample> precastFrostHighSounds_;
|
|
std::vector<SpellSample> precastHolyLowSounds_;
|
|
std::vector<SpellSample> precastHolyMediumSounds_;
|
|
std::vector<SpellSample> precastHolyHighSounds_;
|
|
std::vector<SpellSample> precastNatureLowSounds_;
|
|
std::vector<SpellSample> precastNatureMediumSounds_;
|
|
std::vector<SpellSample> precastNatureHighSounds_;
|
|
std::vector<SpellSample> precastShadowLowSounds_;
|
|
std::vector<SpellSample> precastShadowMediumSounds_;
|
|
std::vector<SpellSample> precastShadowHighSounds_;
|
|
std::vector<SpellSample> precastArcaneSounds_;
|
|
|
|
// Cast sound libraries (spell release)
|
|
std::vector<SpellSample> castFireSounds_;
|
|
std::vector<SpellSample> castFrostSounds_;
|
|
std::vector<SpellSample> castHolySounds_;
|
|
std::vector<SpellSample> castNatureSounds_;
|
|
std::vector<SpellSample> castShadowSounds_;
|
|
|
|
// Impact sound libraries (spell hits)
|
|
std::vector<SpellSample> impactFireballSounds_;
|
|
std::vector<SpellSample> impactBlizzardSounds_;
|
|
std::vector<SpellSample> impactHolySounds_;
|
|
std::vector<SpellSample> impactArcaneMissileSounds_;
|
|
|
|
// State tracking
|
|
float volumeScale_ = 1.0f;
|
|
bool initialized_ = false;
|
|
|
|
// Helper methods
|
|
bool loadSound(const std::string& path, SpellSample& sample, pipeline::AssetManager* assets);
|
|
void playSound(const std::vector<SpellSample>& library, float volumeMultiplier = 1.0f);
|
|
void playRandomSound(const std::vector<SpellSample>& library, float volumeMultiplier = 1.0f);
|
|
};
|
|
|
|
} // namespace audio
|
|
} // namespace wowee
|