mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-03-22 23:30:14 +00:00
Implement MPQ-path sound loading in AudioEngine
Add AssetManager hookup to AudioEngine so the path-based playSound2D/3D overloads can load files on demand rather than requiring preloading. - Add setAssetManager() to AudioEngine (called during world load alongside other audio manager initializations) - playSound2D(mpqPath) now calls assetManager->readFile() then delegates to the vector<uint8_t> overload (removes the "not yet implemented" warning) - playSound3D(mpqPath, position) same — delegates to the fully spatialized vector overload (was previously silently falling back to 2D)
This commit is contained in:
parent
e73bedd78b
commit
c998c945bf
3 changed files with 28 additions and 6 deletions
|
|
@ -11,6 +11,7 @@ struct ma_engine;
|
|||
struct ma_sound;
|
||||
|
||||
namespace wowee {
|
||||
namespace pipeline { class AssetManager; }
|
||||
namespace audio {
|
||||
|
||||
/**
|
||||
|
|
@ -32,6 +33,9 @@ public:
|
|||
void setMasterVolume(float volume);
|
||||
float getMasterVolume() const { return masterVolume_; }
|
||||
|
||||
// Asset manager (enables sound loading by MPQ path)
|
||||
void setAssetManager(pipeline::AssetManager* am) { assetManager_ = am; }
|
||||
|
||||
// 3D listener position (for positional audio)
|
||||
void setListenerPosition(const glm::vec3& position);
|
||||
void setListenerOrientation(const glm::vec3& forward, const glm::vec3& up);
|
||||
|
|
@ -81,6 +85,8 @@ private:
|
|||
glm::vec3 listenerForward_{0.0f, 0.0f, -1.0f};
|
||||
glm::vec3 listenerUp_{0.0f, 1.0f, 0.0f};
|
||||
|
||||
pipeline::AssetManager* assetManager_ = nullptr;
|
||||
|
||||
// miniaudio engine (opaque pointer)
|
||||
ma_engine* engine_ = nullptr;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue