mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-25 09:24:17 +00:00
Implement/match LegoSoundManager::UpdateListener (#985)
This commit is contained in:
committed by
GitHub
parent
ac4e8da662
commit
1423eb56fc
@@ -47,10 +47,10 @@ MxResult Lego3DSound::Create(LPDIRECTSOUNDBUFFER p_directSoundBuffer, const char
|
||||
return FAILURE;
|
||||
}
|
||||
|
||||
m_ds3dBuffer->SetMinDistance(15.0f, 0);
|
||||
m_ds3dBuffer->SetMaxDistance(100.0f, 0);
|
||||
m_ds3dBuffer->SetPosition(0.0f, 0.0f, -40.0f, 0);
|
||||
m_ds3dBuffer->SetConeOutsideVolume(-10000, 0);
|
||||
m_ds3dBuffer->SetMinDistance(15.0f, DS3D_IMMEDIATE);
|
||||
m_ds3dBuffer->SetMaxDistance(100.0f, DS3D_IMMEDIATE);
|
||||
m_ds3dBuffer->SetPosition(0.0f, 0.0f, -40.0f, DS3D_IMMEDIATE);
|
||||
m_ds3dBuffer->SetConeOutsideVolume(-10000, DS3D_IMMEDIATE);
|
||||
}
|
||||
|
||||
if (m_ds3dBuffer == NULL || p_name == NULL) {
|
||||
@@ -86,7 +86,7 @@ MxResult Lego3DSound::Create(LPDIRECTSOUNDBUFFER p_directSoundBuffer, const char
|
||||
|
||||
if (MxOmni::IsSound3D()) {
|
||||
const float* position = m_positionROI->GetWorldPosition();
|
||||
m_ds3dBuffer->SetPosition(position[0], position[1], position[2], 0);
|
||||
m_ds3dBuffer->SetPosition(position[0], position[1], position[2], DS3D_IMMEDIATE);
|
||||
}
|
||||
|
||||
LegoEntity* entity = m_roi->GetEntity();
|
||||
@@ -147,7 +147,7 @@ MxU32 Lego3DSound::UpdatePosition(LPDIRECTSOUNDBUFFER p_directSoundBuffer)
|
||||
}
|
||||
|
||||
if (m_ds3dBuffer != NULL) {
|
||||
m_ds3dBuffer->SetPosition(position[0], position[1], position[2], 0);
|
||||
m_ds3dBuffer->SetPosition(position[0], position[1], position[2], DS3D_IMMEDIATE);
|
||||
}
|
||||
else {
|
||||
MxS32 newVolume = m_volume;
|
||||
@@ -209,8 +209,8 @@ MxS32 Lego3DSound::SetDistance(MxS32 p_min, MxS32 p_max)
|
||||
return -1;
|
||||
}
|
||||
|
||||
m_ds3dBuffer->SetMinDistance(p_min, 0);
|
||||
m_ds3dBuffer->SetMaxDistance(p_max, 0);
|
||||
m_ds3dBuffer->SetMinDistance(p_min, DS3D_IMMEDIATE);
|
||||
m_ds3dBuffer->SetMaxDistance(p_max, DS3D_IMMEDIATE);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ void LegoCacheSound::Init()
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10006710
|
||||
// FUNCTION: BETA10 0x10066505
|
||||
MxResult LegoCacheSound::FUN_10006710()
|
||||
{
|
||||
// TODO
|
||||
|
||||
@@ -97,8 +97,38 @@ MxResult LegoSoundManager::Tickle()
|
||||
return m_cacheSoundManager->Tickle();
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x1002a410
|
||||
void LegoSoundManager::FUN_1002a410(const float* p_pos, const float* p_dir, const float* p_up, const float* p_vel)
|
||||
// FUNCTION: LEGO1 0x1002a410
|
||||
// FUNCTION: BETA10 0x100d03a5
|
||||
void LegoSoundManager::UpdateListener(
|
||||
const float* p_position,
|
||||
const float* p_direction,
|
||||
const float* p_up,
|
||||
const float* p_velocity
|
||||
)
|
||||
{
|
||||
// TODO
|
||||
if (m_listener != NULL) {
|
||||
if (p_position != NULL) {
|
||||
m_listener->SetPosition(p_position[0], p_position[1], p_position[2], DS3D_DEFERRED);
|
||||
}
|
||||
|
||||
if (p_direction != NULL && p_up != NULL) {
|
||||
m_listener->SetOrientation(
|
||||
p_direction[0],
|
||||
p_direction[1],
|
||||
p_direction[2],
|
||||
p_up[0],
|
||||
p_up[1],
|
||||
p_up[2],
|
||||
DS3D_DEFERRED
|
||||
);
|
||||
}
|
||||
|
||||
if (p_velocity != NULL) {
|
||||
m_listener->SetVelocity(p_velocity[0], p_velocity[1], p_velocity[2], DS3D_DEFERRED);
|
||||
}
|
||||
|
||||
if (p_position != NULL || (p_direction != NULL && p_up != NULL) || p_velocity != NULL) {
|
||||
m_listener->CommitDeferredSettings();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user