mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Implement mount ambient sounds
Added full mount sound system with: - Wing flap sounds for flying mounts (gryphon/wyvern) when moving - Wing idle/hovering sounds when stationary in air - Breathing/snorting sounds for ground mounts when idle - Occasional whinny sounds for ground mounts when moving Sounds are loaded from MPQ files and played via AudioEngine with randomized pitch/volume variation. Mount sound manager tracks mount type, movement state, and flying state to play appropriate ambient sounds at natural intervals. Updated setMounted() to accept creature display ID and notify the mount sound manager, which uses display ID ranges to detect mount type (flying vs ground).
This commit is contained in:
parent
0b6b403848
commit
0fed931aa0
5 changed files with 221 additions and 23 deletions
|
|
@ -2,6 +2,8 @@
|
|||
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
#include <chrono>
|
||||
|
||||
namespace wowee {
|
||||
namespace pipeline { class AssetManager; }
|
||||
|
|
@ -15,6 +17,11 @@ enum class MountType {
|
|||
SWIMMING // Sea turtle, etc.
|
||||
};
|
||||
|
||||
struct MountSample {
|
||||
std::string path;
|
||||
std::vector<uint8_t> data;
|
||||
};
|
||||
|
||||
class MountSoundManager {
|
||||
public:
|
||||
MountSoundManager();
|
||||
|
|
@ -40,6 +47,8 @@ private:
|
|||
MountType detectMountType(uint32_t creatureDisplayId) const;
|
||||
void updateMountSounds();
|
||||
void stopAllMountSounds();
|
||||
void loadMountSounds();
|
||||
bool loadSound(const std::string& path, MountSample& sample);
|
||||
|
||||
pipeline::AssetManager* assetManager_ = nullptr;
|
||||
bool mounted_ = false;
|
||||
|
|
@ -49,9 +58,17 @@ private:
|
|||
uint32_t currentDisplayId_ = 0;
|
||||
float volumeScale_ = 1.0f;
|
||||
|
||||
// Mount sound samples (loaded from MPQ)
|
||||
std::vector<MountSample> wingFlapSounds_;
|
||||
std::vector<MountSample> wingIdleSounds_;
|
||||
std::vector<MountSample> horseBreathSounds_;
|
||||
std::vector<MountSample> horseMoveSounds_;
|
||||
|
||||
// Sound state tracking
|
||||
bool playingMovementSound_ = false;
|
||||
bool playingIdleSound_ = false;
|
||||
std::chrono::steady_clock::time_point lastSoundUpdate_;
|
||||
float soundLoopTimer_ = 0.0f;
|
||||
};
|
||||
|
||||
} // namespace audio
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ public:
|
|||
void setEquippedWeaponType(uint32_t inventoryType) { equippedWeaponInvType_ = inventoryType; meleeAnimId = 0; }
|
||||
|
||||
// Mount rendering
|
||||
void setMounted(uint32_t mountInstId, float heightOffset);
|
||||
void setMounted(uint32_t mountInstId, uint32_t mountDisplayId, float heightOffset);
|
||||
void setTaxiFlight(bool onTaxi) { taxiFlight_ = onTaxi; }
|
||||
void setMountPitchRoll(float pitch, float roll) { mountPitch_ = pitch; mountRoll_ = roll; }
|
||||
void clearMount();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue