diff options
-rw-r--r-- | src/audio/AudioManager.cpp | 22 | ||||
-rw-r--r-- | src/audio/AudioManager.h | 1 | ||||
-rw-r--r-- | src/modelinfo/ModelIndices.h | 2 | ||||
-rw-r--r-- | src/vehicles/Ferry.cpp | 7 |
4 files changed, 28 insertions, 4 deletions
diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index c339ea43..c4320b5d 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -1402,6 +1402,28 @@ cAudioManager::GenerateIntegerRandomNumberTable() m_anRandomTable[i] = myrand(); } +void +cAudioManager::DirectlyEnqueueSample(uint32 sample, uint8 bank, uint32 counter, uint32 priority, uint32 freq, uint8 volume, uint8 framesToPlay, uint32 notStereo) +{ + m_sQueueSample.m_nSampleIndex = sample; + m_sQueueSample.m_bReflections = FALSE; + m_sQueueSample.m_nLoopCount = 0; + m_sQueueSample.m_bIs2D = FALSE; + m_sQueueSample.m_bStatic = FALSE; + m_sQueueSample.m_nPan = 0; + m_sQueueSample.m_nBankIndex = bank; + m_sQueueSample.m_nCounter = counter; + m_sQueueSample.m_nFrequency = freq; + m_sQueueSample.m_nVolume = volume; + m_sQueueSample.m_nPriority = priority; + m_sQueueSample.m_nFramesToPlay = framesToPlay; + AudioManager.AddSampleToRequestedQueue(); + if (!notStereo) { + m_sQueueSample.m_nPan = 127; + AudioManager.AddSampleToRequestedQueue(); + } +} + #ifdef EXTERNAL_3D_SOUND void cAudioManager::AdjustSamplesVolume() diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index d8511bf0..f9472a52 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -359,6 +359,7 @@ public: void ClearActiveSamples(); void GenerateIntegerRandomNumberTable(); void LoadBankIfNecessary(uint8 bank); + void DirectlyEnqueueSample(uint32 sample, uint8 bank, uint32 counter, uint32 priority, uint32 freq, uint8 volume, uint8 framesToPlay, uint32 notStereo = 0); #ifdef EXTERNAL_3D_SOUND // actually must have been && AUDIO_MSS as well void AdjustSamplesVolume(); // inlined diff --git a/src/modelinfo/ModelIndices.h b/src/modelinfo/ModelIndices.h index 0d6a9b9c..bb256eea 100644 --- a/src/modelinfo/ModelIndices.h +++ b/src/modelinfo/ModelIndices.h @@ -1108,8 +1108,8 @@ enum MI_COMET = -972, MI_KAUFMAN = -967, MI_BAGGAGE = -963, - MI_VICECHEE = -954, MI_RCBARON = -955, + MI_VICECHEE = -954, // HACK HACK, hopefully temporary MI_JETMAX = -2000, diff --git a/src/vehicles/Ferry.cpp b/src/vehicles/Ferry.cpp index 89a0de9f..339c2819 100644 --- a/src/vehicles/Ferry.cpp +++ b/src/vehicles/Ferry.cpp @@ -14,6 +14,7 @@ #include "TempColModels.h" #include "WaterLevel.h" #include "World.h" +#include "sampman.h" CFerryInst* CFerry::mspInst; @@ -706,7 +707,7 @@ void CFerry::OpenDoor(void) m_bUseFrontDoor = true; if (fDistToCar4 < fDistToCar1) m_bUseFrontDoor = false; - // AudioManager.DirectlyEnqueueSample(0xb8,0,0,1,0x5622,0x7f,0x14,0); // TODO + AudioManager.DirectlyEnqueueSample(SFX_GATE_START_CLU, SFX_BANK_0, 0, 1, 22050, 127, 20); } void CFerry::CloseDoor(void) @@ -714,7 +715,7 @@ void CFerry::CloseDoor(void) printf("closing the ferry door\n"); m_nDoorState = FERRY_DOOR_CLOSING; m_nDoorTimer = CTimer::GetTimeInMilliseconds() + 10000; - // AudioManager.DirectlyEnqueueSample(0xb8, 0, 0, 1, 0x5622, 0x7f, 0x14, 0); // TODO + AudioManager.DirectlyEnqueueSample(SFX_GATE_START_CLU, SFX_BANK_0, 0, 1, 22050, 127, 20); // shouldn't this be SFX_GATE_STOP_CLU? } bool CFerry::IsDoorOpen(void) @@ -798,7 +799,7 @@ void CFerry::PlayArrivedHorn(void) float fDistToCamera = (GetPosition() - TheCamera.GetPosition()).Magnitude(); if (fDistToCamera < 200.0f) { uint8 volume = (200.0f - fDistToCamera) / 200.0f * 127; - // AudioManager.DirectlyEnqueueSample(0x32, 0, 0, 1, 18000, volume, 0x32, 0); // TODO + AudioManager.DirectlyEnqueueSample(SFX_CAR_HORN_TRUCK, SFX_BANK_0, 0, 1, 18000, volume, 50); } } |