Isle
Loading...
Searching...
No Matches
lego3dwavepresenter.cpp
Go to the documentation of this file.
2
4#include "mxdsaction.h"
5#include "mxomni.h"
6
8
9// FUNCTION: LEGO1 0x1004a7c0
11{
14
15 if (MxOmni::IsSound3D()) {
16 m_is3d = TRUE;
17 }
18
19 return result;
20}
21
22// FUNCTION: LEGO1 0x1004a7f0
24{
27
28 if (MxOmni::IsSound3D()) {
29 m_is3d = TRUE;
30 }
31}
32
33// FUNCTION: LEGO1 0x1004a810
34// FUNCTION: BETA10 0x1003a3b0
36{
37 if (MxOmni::IsSound3D()) {
38 m_is3d = TRUE;
39 }
40
42
43 if (m_dsBuffer != NULL) {
44 MxU16 extraLength;
45 char* buff;
46 m_action->GetExtra(extraLength, buff);
47
48 if (!strcmp(buff, "FROM_PARENT") && m_compositePresenter != NULL) {
49 m_compositePresenter->GetAction()->GetExtra(extraLength, buff);
50 }
51
52 if (m_sound.Create(m_dsBuffer, buff, m_volume) != SUCCESS) {
53 m_dsBuffer->Release();
55 EndAction();
56 }
57 }
58}
59
60// FUNCTION: LEGO1 0x1004a8b0
61// FUNCTION: BETA10 0x1003a4cc
63{
66}
MxU32 UpdatePosition(LPDIRECTSOUNDBUFFER p_directSoundBuffer)
[AI] Recalculates and updates the sound position on the underlying DirectSound 3D buffer or the volum...
MxResult Create(LPDIRECTSOUNDBUFFER p_directSoundBuffer, const char *p_name, MxS32 p_volume)
[AI] Initializes 3D sound for a given DirectSound buffer and associates it with a named game object.
Definition: lego3dsound.cpp:40
[AI] Handles the presentation of 3D positional audio using DirectSound buffers within the LEGO Island...
void Destroy() override
[AI] Cleans up internal 3D sound resources and DirectSound objects, and reinitializes base presenter.
void StreamingTickle() override
[AI] Updates the 3D buffer position each tick, keeping audio in sync with moving objects in the world...
void StartingTickle() override
[AI] Performs setup and initial buffer management prior to starting audio streaming.
MxS32 m_volume
[AI] Current playback volume, range 0-100 (percent).
void GetExtra(MxU16 &p_extraLength, char *&p_extraData)
[AI] Retrieves the extra data and its length for this action.
Definition: mxdsaction.h:168
static MxBool IsSound3D()
[AI] Returns current state of 3D sound configuration.
Definition: mxomni.cpp:387
MxDSAction * m_action
[AI] The associated action currently being presented by this presenter.
Definition: mxpresenter.h:211
MxCompositePresenter * m_compositePresenter
[AI] Owner composite presenter, if any.
Definition: mxpresenter.h:217
MxDSAction * GetAction() const
[AI] Returns the current action being presented.
Definition: mxpresenter.h:175
MxResult AddToManager() override
[AI] Registers this presenter with the global MxSoundManager.
void StartingTickle() override
[AI] Handles actions required when first starting presentation. Advances to streaming state.
LPDIRECTSOUNDBUFFER m_dsBuffer
[AI] DirectSound buffer handling PCM sample playback.
void EndAction() override
[AI] Ends the media playback action, releasing all resources, notifying listeners if necessary.
void Destroy() override
[AI] Explicit resource release.
void StreamingTickle() override
[AI] Per-frame update when streaming the media stream.
void Init()
[AI] Initializes all member variables to safe/empty values.
MxBool m_is3d
[AI] TRUE if buffer/audio is 3D spatialized.
#define TRUE
Definition: d3drmdef.h:28
#define DECOMP_SIZE_ASSERT(T, S)
Definition: decomp.h:19
#define NULL
[AI] Null pointer value (C/C++ semantics).
Definition: legotypes.h:26
#define SUCCESS
[AI] Used to indicate a successful operation in result codes.
Definition: legotypes.h:30
MxLong MxResult
[AI]
Definition: mxtypes.h:106
unsigned short MxU16
[AI]
Definition: mxtypes.h:20