24void LegoSoundManager::Init()
26 m_cacheSoundManager =
NULL;
33 delete m_cacheSoundManager;
36 if (!p_fromDestructor) {
62 memset(&caps, 0,
sizeof(
DSCAPS));
66 m_listener->SetDistanceFactor(0.026315790f, 0);
67 m_listener->SetRolloffFactor(10, 0);
73 assert(m_cacheSoundManager);
103 return m_cacheSoundManager->
Tickle();
109 const float* p_position,
110 const float* p_direction,
112 const float* p_velocity
115 if (m_listener !=
NULL) {
116 if (p_position !=
NULL) {
117 m_listener->SetPosition(p_position[0], p_position[1], p_position[2],
DS3D_DEFERRED);
120 if (p_direction !=
NULL && p_up !=
NULL) {
121 m_listener->SetOrientation(
132 if (p_velocity !=
NULL) {
133 m_listener->SetVelocity(p_velocity[0], p_velocity[1], p_velocity[2],
DS3D_DEFERRED);
136 if (p_position !=
NULL || (p_direction !=
NULL && p_up !=
NULL) || p_velocity !=
NULL) {
137 m_listener->CommitDeferredSettings();
[AI] Manages caching, reuse, and playback of LegoCacheSound objects.
virtual MxResult Tickle()
[AI] Advances or cleans up all managed sounds.
[AI] Manages 3D sound effects and music playback for LEGO Island, integrating with DirectSound and pr...
void Destroy() override
[AI] Cleans up and releases all resources used by the sound manager and its cache.
MxResult Tickle() override
[AI] Performs periodic processing, such as updating the cache sound manager.
void UpdateListener(const float *p_position, const float *p_direction, const float *p_up, const float *p_velocity)
[AI] Updates the 3D sound listener properties in DirectSound, reflecting player/world changes.
~LegoSoundManager() override
[AI] Destructor. Cleans up resources, optionally as part of destruction.
MxResult Create() override
[AI] Initializes audio subsystem resources and registers an instance for global audio management.
virtual MxResult Tickle()
[AI] Called by tickle managers to allow the object to update itself.
void Enter()
[AI] Acquires/gains entry to the critical section or mutex, blocking if not available.
void Leave()
[AI] Releases/leaves the critical section or mutex.
[AI] Central subsystem coordinator and singleton of the LEGO Island engine.
static MxOmni * GetInstance()
[AI] Returns the singleton instance of the MxOmni subsystem coordinator.
static MxBool IsSound3D()
[AI] Returns current state of 3D sound configuration.
MxSoundManager * GetSoundManager() const
[AI] Gets the engine's sound manager used for playing/controlling sounds.
LPDIRECTSOUND GetDirectSound()
[AI] Gets pointer to internal DirectSound interface.
void Destroy() override
[AI] Releases sound resources and unregisters from tickle system.
LPDIRECTSOUNDBUFFER m_dsBuffer
[AI] Primary DirectSound buffer interface for setting output format/volume.
#define DECOMP_SIZE_ASSERT(T, S)
struct IDirectSound * LPDIRECTSOUND
#define NULL
[AI] Null pointer value (C/C++ semantics).
#define FAILURE
[AI] Used to indicate a failed operation in result codes.
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
#define AUTOLOCK(CS)
[AI] Macro for automatic locking using the MxAutoLock class. This macro instantiates an MxAutoLock ob...
DWORD dwMaxHw3DAllBuffers