2026-02-09 01:04:53 -08:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
#include <cstdint>
|
2026-02-09 01:19:35 -08:00
|
|
|
#include <vector>
|
|
|
|
|
#include <chrono>
|
2026-02-09 01:04:53 -08:00
|
|
|
|
|
|
|
|
namespace wowee {
|
|
|
|
|
namespace pipeline { class AssetManager; }
|
|
|
|
|
|
|
|
|
|
namespace audio {
|
|
|
|
|
|
|
|
|
|
enum class MountType {
|
|
|
|
|
NONE,
|
|
|
|
|
GROUND, // Horse, wolf, raptor, etc.
|
|
|
|
|
FLYING, // Griffin, wyvern, drake, etc.
|
|
|
|
|
SWIMMING // Sea turtle, etc.
|
|
|
|
|
};
|
|
|
|
|
|
Fix mount sounds with real MPQ paths and family detection
Mount Sound System:
- Use actual creature sounds from MPQ (Horse, Ram, Wolf, Tiger, Dragons)
- Separate sound pools: jump (attack), landing (wound), rear-up (aggro)
- Mount family detection: HORSE, RAM, WOLF, TIGER, RAPTOR, DRAGON
- Family logged on mount for future per-family sound selection
Sound Mappings:
- Flying mounts: Dragon wing flaps + DragonHawk screeches
- Ground mounts: Horse attack (jump), wound (land), aggro (rear-up)
- Ready for family-specific sound selection (TODO)
Mount Lean:
- Procedural lean into turns for ground mounts
- Physics-based: turn rate × 0.15, max ±14°, 6x/sec blend
- Returns to upright when not turning or when flying
- Rider follows mount roll automatically via bone attachment
2026-02-10 19:49:07 -08:00
|
|
|
enum class MountFamily {
|
|
|
|
|
UNKNOWN,
|
|
|
|
|
HORSE,
|
|
|
|
|
RAM,
|
|
|
|
|
WOLF,
|
|
|
|
|
TIGER,
|
|
|
|
|
RAPTOR,
|
|
|
|
|
DRAGON
|
|
|
|
|
};
|
|
|
|
|
|
2026-02-09 01:19:35 -08:00
|
|
|
struct MountSample {
|
|
|
|
|
std::string path;
|
|
|
|
|
std::vector<uint8_t> data;
|
|
|
|
|
};
|
|
|
|
|
|
2026-02-09 01:04:53 -08:00
|
|
|
class MountSoundManager {
|
|
|
|
|
public:
|
|
|
|
|
MountSoundManager();
|
|
|
|
|
~MountSoundManager();
|
|
|
|
|
|
|
|
|
|
bool initialize(pipeline::AssetManager* assets);
|
|
|
|
|
void shutdown();
|
|
|
|
|
void update(float deltaTime);
|
|
|
|
|
|
|
|
|
|
// Called when mounting/dismounting
|
|
|
|
|
void onMount(uint32_t creatureDisplayId, bool isFlying);
|
|
|
|
|
void onDismount();
|
|
|
|
|
|
|
|
|
|
// Update movement state
|
|
|
|
|
void setMoving(bool moving);
|
|
|
|
|
void setFlying(bool flying);
|
|
|
|
|
void setGrounded(bool grounded);
|
|
|
|
|
|
2026-02-10 19:30:45 -08:00
|
|
|
// Play semantic mount action sounds (triggered on animation state changes)
|
|
|
|
|
void playRearUpSound(); // Rear-up flourish (whinny/roar)
|
|
|
|
|
void playJumpSound(); // Jump start (grunt/snort)
|
|
|
|
|
void playLandSound(); // Landing (thud/hoof)
|
|
|
|
|
|
2026-02-09 01:04:53 -08:00
|
|
|
bool isMounted() const { return mounted_; }
|
|
|
|
|
void setVolumeScale(float scale) { volumeScale_ = 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 01:04:53 -08:00
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
MountType detectMountType(uint32_t creatureDisplayId) const;
|
Fix mount sounds with real MPQ paths and family detection
Mount Sound System:
- Use actual creature sounds from MPQ (Horse, Ram, Wolf, Tiger, Dragons)
- Separate sound pools: jump (attack), landing (wound), rear-up (aggro)
- Mount family detection: HORSE, RAM, WOLF, TIGER, RAPTOR, DRAGON
- Family logged on mount for future per-family sound selection
Sound Mappings:
- Flying mounts: Dragon wing flaps + DragonHawk screeches
- Ground mounts: Horse attack (jump), wound (land), aggro (rear-up)
- Ready for family-specific sound selection (TODO)
Mount Lean:
- Procedural lean into turns for ground mounts
- Physics-based: turn rate × 0.15, max ±14°, 6x/sec blend
- Returns to upright when not turning or when flying
- Rider follows mount roll automatically via bone attachment
2026-02-10 19:49:07 -08:00
|
|
|
MountFamily detectMountFamily(uint32_t creatureDisplayId) const;
|
2026-02-09 01:04:53 -08:00
|
|
|
void updateMountSounds();
|
|
|
|
|
void stopAllMountSounds();
|
2026-02-09 01:19:35 -08:00
|
|
|
void loadMountSounds();
|
|
|
|
|
bool loadSound(const std::string& path, MountSample& sample);
|
2026-02-09 01:04:53 -08:00
|
|
|
|
|
|
|
|
pipeline::AssetManager* assetManager_ = nullptr;
|
|
|
|
|
bool mounted_ = false;
|
|
|
|
|
bool moving_ = false;
|
|
|
|
|
bool flying_ = false;
|
|
|
|
|
MountType currentMountType_ = MountType::NONE;
|
Fix mount sounds with real MPQ paths and family detection
Mount Sound System:
- Use actual creature sounds from MPQ (Horse, Ram, Wolf, Tiger, Dragons)
- Separate sound pools: jump (attack), landing (wound), rear-up (aggro)
- Mount family detection: HORSE, RAM, WOLF, TIGER, RAPTOR, DRAGON
- Family logged on mount for future per-family sound selection
Sound Mappings:
- Flying mounts: Dragon wing flaps + DragonHawk screeches
- Ground mounts: Horse attack (jump), wound (land), aggro (rear-up)
- Ready for family-specific sound selection (TODO)
Mount Lean:
- Procedural lean into turns for ground mounts
- Physics-based: turn rate × 0.15, max ±14°, 6x/sec blend
- Returns to upright when not turning or when flying
- Rider follows mount roll automatically via bone attachment
2026-02-10 19:49:07 -08:00
|
|
|
MountFamily currentMountFamily_ = MountFamily::UNKNOWN;
|
2026-02-09 01:04:53 -08:00
|
|
|
uint32_t currentDisplayId_ = 0;
|
|
|
|
|
float volumeScale_ = 1.0f;
|
|
|
|
|
|
2026-02-09 01:19:35 -08:00
|
|
|
// Mount sound samples (loaded from MPQ)
|
|
|
|
|
std::vector<MountSample> wingFlapSounds_;
|
|
|
|
|
std::vector<MountSample> wingIdleSounds_;
|
|
|
|
|
std::vector<MountSample> horseBreathSounds_;
|
|
|
|
|
std::vector<MountSample> horseMoveSounds_;
|
Fix mount sounds with real MPQ paths and family detection
Mount Sound System:
- Use actual creature sounds from MPQ (Horse, Ram, Wolf, Tiger, Dragons)
- Separate sound pools: jump (attack), landing (wound), rear-up (aggro)
- Mount family detection: HORSE, RAM, WOLF, TIGER, RAPTOR, DRAGON
- Family logged on mount for future per-family sound selection
Sound Mappings:
- Flying mounts: Dragon wing flaps + DragonHawk screeches
- Ground mounts: Horse attack (jump), wound (land), aggro (rear-up)
- Ready for family-specific sound selection (TODO)
Mount Lean:
- Procedural lean into turns for ground mounts
- Physics-based: turn rate × 0.15, max ±14°, 6x/sec blend
- Returns to upright when not turning or when flying
- Rider follows mount roll automatically via bone attachment
2026-02-10 19:49:07 -08:00
|
|
|
std::vector<MountSample> horseJumpSounds_; // Jump effort sounds
|
|
|
|
|
std::vector<MountSample> horseLandSounds_; // Landing thud sounds
|
2026-02-09 01:19:35 -08:00
|
|
|
|
2026-02-09 01:04:53 -08:00
|
|
|
// Sound state tracking
|
|
|
|
|
bool playingMovementSound_ = false;
|
|
|
|
|
bool playingIdleSound_ = false;
|
2026-02-09 01:19:35 -08:00
|
|
|
std::chrono::steady_clock::time_point lastSoundUpdate_;
|
2026-02-10 19:30:45 -08:00
|
|
|
std::chrono::steady_clock::time_point lastActionSoundTime_; // Cooldown for action sounds
|
2026-02-09 01:19:35 -08:00
|
|
|
float soundLoopTimer_ = 0.0f;
|
2026-02-09 01:04:53 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace audio
|
|
|
|
|
} // namespace wowee
|