2026-02-09 16:38:50 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include <memory>
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <cstdint>
|
|
|
|
|
|
|
|
|
|
namespace wowee {
|
|
|
|
|
namespace pipeline {
|
|
|
|
|
class AssetManager;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
namespace audio {
|
|
|
|
|
|
|
|
|
|
class CombatSoundManager {
|
|
|
|
|
public:
|
|
|
|
|
CombatSoundManager() = default;
|
|
|
|
|
~CombatSoundManager() = default;
|
|
|
|
|
|
|
|
|
|
// Initialization
|
|
|
|
|
bool initialize(pipeline::AssetManager* assets);
|
|
|
|
|
void shutdown();
|
|
|
|
|
|
|
|
|
|
// Volume control
|
|
|
|
|
void setVolumeScale(float scale);
|
Implement comprehensive audio control panel with tabbed settings interface
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
2026-02-09 17:07:22 -08:00
|
|
|
float getVolumeScale() const { return volumeScale_; }
|
2026-02-09 16:38:50 -08:00
|
|
|
|
|
|
|
|
// Weapon swing sounds (whoosh sounds before impact)
|
|
|
|
|
enum class WeaponSize {
|
|
|
|
|
SMALL, // 1H weapons (daggers, swords, maces)
|
|
|
|
|
MEDIUM, // 2H weapons (2H swords, axes)
|
|
|
|
|
LARGE // 2H heavy weapons (polearms, staves)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void playWeaponSwing(WeaponSize size, bool isCrit = false);
|
|
|
|
|
void playWeaponMiss(bool twoHanded = false);
|
|
|
|
|
|
|
|
|
|
// Impact sounds (when weapon hits target)
|
|
|
|
|
enum class ImpactType {
|
|
|
|
|
FLESH, // Hit unarmored/cloth
|
|
|
|
|
CHAIN, // Hit chain armor
|
|
|
|
|
PLATE, // Hit plate armor
|
|
|
|
|
SHIELD, // Hit shield
|
|
|
|
|
METAL_WEAPON, // Parry/weapon clash
|
|
|
|
|
WOOD, // Hit wooden objects
|
|
|
|
|
STONE // Hit stone/rock
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void playImpact(WeaponSize weaponSize, ImpactType impactType, bool isCrit = false);
|
|
|
|
|
|
|
|
|
|
// Emote sounds
|
|
|
|
|
void playClap();
|
|
|
|
|
|
Add player character combat vocals with 60+ voice lines
Implemented player combat vocals for Blood Elf and Draenei races:
Player vocal types:
- Attack grunts: Multiple variations per race/gender
- Wound sounds: Pain reactions when hit
- Wound crits: Special sounds for critical hits taken
- Death cries: Final sounds when player dies
Race coverage (60+ voice lines):
- Blood Elf Male: 9 attacks, 8 wounds, 3 crit wounds, 2 deaths
- Blood Elf Female: 5 attacks, 7 wounds, 1 death
- Draenei Male: 7 attacks, 8 wounds, 3 crit wounds, 2 deaths
- Draenei Female: 7 attacks, 4 wounds, 3 crit wounds, 1 death
Technical details:
- Loads 60+ vocal sound files from Sound\Character\*PC folders
- Simple API: playPlayerAttackGrunt(race), playPlayerWound(race, crit), playPlayerDeath(race)
- Random variation selection for immersion
- Volume at 0.9-1.1 depending on sound type
- Crit wounds play 1.1x louder for emphasis
- Extensible design ready for other races
- Only BC races have dedicated PC vocal folders in WotLK 3.3.5a
Usage examples:
```cpp
combatSoundManager->playPlayerAttackGrunt(PlayerRace::BLOOD_ELF_MALE);
combatSoundManager->playPlayerWound(PlayerRace::DRAENEI_FEMALE, true); // Crit
combatSoundManager->playPlayerDeath(PlayerRace::BLOOD_ELF_FEMALE);
```
This adds essential combat immersion with player character reactions!
2026-02-09 16:42:15 -08:00
|
|
|
// Player character vocals
|
|
|
|
|
enum class PlayerRace {
|
|
|
|
|
BLOOD_ELF_MALE,
|
|
|
|
|
BLOOD_ELF_FEMALE,
|
|
|
|
|
DRAENEI_MALE,
|
|
|
|
|
DRAENEI_FEMALE
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
void playPlayerAttackGrunt(PlayerRace race);
|
|
|
|
|
void playPlayerWound(PlayerRace race, bool isCrit = false);
|
|
|
|
|
void playPlayerDeath(PlayerRace race);
|
|
|
|
|
|
2026-02-09 16:38:50 -08:00
|
|
|
private:
|
|
|
|
|
struct CombatSample {
|
|
|
|
|
std::string path;
|
|
|
|
|
std::vector<uint8_t> data;
|
|
|
|
|
bool loaded;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// Weapon swing sound libraries
|
|
|
|
|
std::vector<CombatSample> swingSmallSounds_;
|
|
|
|
|
std::vector<CombatSample> swingMediumSounds_;
|
|
|
|
|
std::vector<CombatSample> swingLargeSounds_;
|
|
|
|
|
std::vector<CombatSample> swingSmallCritSounds_;
|
|
|
|
|
std::vector<CombatSample> swingMediumCritSounds_;
|
|
|
|
|
std::vector<CombatSample> swingLargeCritSounds_;
|
|
|
|
|
std::vector<CombatSample> missWhoosh1HSounds_;
|
|
|
|
|
std::vector<CombatSample> missWhoosh2HSounds_;
|
|
|
|
|
|
|
|
|
|
// Impact sound libraries (using 1H axe as base - similar across weapon types)
|
|
|
|
|
std::vector<CombatSample> hitFleshSounds_;
|
|
|
|
|
std::vector<CombatSample> hitChainSounds_;
|
|
|
|
|
std::vector<CombatSample> hitPlateSounds_;
|
|
|
|
|
std::vector<CombatSample> hitShieldSounds_;
|
|
|
|
|
std::vector<CombatSample> hitMetalWeaponSounds_;
|
|
|
|
|
std::vector<CombatSample> hitWoodSounds_;
|
|
|
|
|
std::vector<CombatSample> hitStoneSounds_;
|
|
|
|
|
std::vector<CombatSample> hitFleshCritSounds_;
|
|
|
|
|
std::vector<CombatSample> hitChainCritSounds_;
|
|
|
|
|
std::vector<CombatSample> hitPlateCritSounds_;
|
|
|
|
|
std::vector<CombatSample> hitShieldCritSounds_;
|
|
|
|
|
|
|
|
|
|
// Emote sounds
|
|
|
|
|
std::vector<CombatSample> clapSounds_;
|
|
|
|
|
|
Add player character combat vocals with 60+ voice lines
Implemented player combat vocals for Blood Elf and Draenei races:
Player vocal types:
- Attack grunts: Multiple variations per race/gender
- Wound sounds: Pain reactions when hit
- Wound crits: Special sounds for critical hits taken
- Death cries: Final sounds when player dies
Race coverage (60+ voice lines):
- Blood Elf Male: 9 attacks, 8 wounds, 3 crit wounds, 2 deaths
- Blood Elf Female: 5 attacks, 7 wounds, 1 death
- Draenei Male: 7 attacks, 8 wounds, 3 crit wounds, 2 deaths
- Draenei Female: 7 attacks, 4 wounds, 3 crit wounds, 1 death
Technical details:
- Loads 60+ vocal sound files from Sound\Character\*PC folders
- Simple API: playPlayerAttackGrunt(race), playPlayerWound(race, crit), playPlayerDeath(race)
- Random variation selection for immersion
- Volume at 0.9-1.1 depending on sound type
- Crit wounds play 1.1x louder for emphasis
- Extensible design ready for other races
- Only BC races have dedicated PC vocal folders in WotLK 3.3.5a
Usage examples:
```cpp
combatSoundManager->playPlayerAttackGrunt(PlayerRace::BLOOD_ELF_MALE);
combatSoundManager->playPlayerWound(PlayerRace::DRAENEI_FEMALE, true); // Crit
combatSoundManager->playPlayerDeath(PlayerRace::BLOOD_ELF_FEMALE);
```
This adds essential combat immersion with player character reactions!
2026-02-09 16:42:15 -08:00
|
|
|
// Player character vocal libraries
|
|
|
|
|
std::vector<CombatSample> bloodElfMaleAttackSounds_;
|
|
|
|
|
std::vector<CombatSample> bloodElfMaleWoundSounds_;
|
|
|
|
|
std::vector<CombatSample> bloodElfMaleWoundCritSounds_;
|
|
|
|
|
std::vector<CombatSample> bloodElfMaleDeathSounds_;
|
|
|
|
|
|
|
|
|
|
std::vector<CombatSample> bloodElfFemaleAttackSounds_;
|
|
|
|
|
std::vector<CombatSample> bloodElfFemaleWoundSounds_;
|
|
|
|
|
std::vector<CombatSample> bloodElfFemaleDeathSounds_;
|
|
|
|
|
|
|
|
|
|
std::vector<CombatSample> draeneiMaleAttackSounds_;
|
|
|
|
|
std::vector<CombatSample> draeneiMaleWoundSounds_;
|
|
|
|
|
std::vector<CombatSample> draeneiMaleWoundCritSounds_;
|
|
|
|
|
std::vector<CombatSample> draeneiMaleDeathSounds_;
|
|
|
|
|
|
|
|
|
|
std::vector<CombatSample> draeneiFemaleAttackSounds_;
|
|
|
|
|
std::vector<CombatSample> draeneiFemaleWoundSounds_;
|
|
|
|
|
std::vector<CombatSample> draeneiFemaleWoundCritSounds_;
|
|
|
|
|
std::vector<CombatSample> draeneiFemaleDeathSounds_;
|
|
|
|
|
|
2026-02-09 16:38:50 -08:00
|
|
|
// State tracking
|
|
|
|
|
float volumeScale_ = 1.0f;
|
|
|
|
|
bool initialized_ = false;
|
|
|
|
|
|
|
|
|
|
// Helper methods
|
|
|
|
|
bool loadSound(const std::string& path, CombatSample& sample, pipeline::AssetManager* assets);
|
|
|
|
|
void playSound(const std::vector<CombatSample>& library, float volumeMultiplier = 1.0f);
|
|
|
|
|
void playRandomSound(const std::vector<CombatSample>& library, float volumeMultiplier = 1.0f);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace audio
|
|
|
|
|
} // namespace wowee
|