Use bool8 in audio code

This commit is contained in:
Sergeanur 2021-05-22 12:11:50 +03:00
parent 596e12b897
commit 786e101acf
26 changed files with 1183 additions and 1183 deletions

View file

@ -166,7 +166,7 @@ cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 coun
m_sQueueSample.m_nCounter = counter; m_sQueueSample.m_nCounter = counter;
m_sQueueSample.m_vecPos = col.m_vecPosition; m_sQueueSample.m_vecPos = col.m_vecPosition;
m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_nReleasingVolumeModificator = 7; m_sQueueSample.m_nReleasingVolumeModificator = 7;
m_sQueueSample.m_nLoopCount = 0; m_sQueueSample.m_nLoopCount = 0;
m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nEmittingVolume = emittingVol;
@ -176,10 +176,10 @@ cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 coun
SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex); SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSpeedMultiplier = 4.0f;
m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity; m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity;
m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5; m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = true; m_sQueueSample.m_bReverbFlag = TRUE;
m_sQueueSample.m_bRequireReflection = false; m_sQueueSample.m_bRequireReflection = FALSE;
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
} }
@ -307,7 +307,7 @@ cAudioManager::SetUpOneShotCollisionSound(const cAudioCollision &col)
if(counter >= 255) counter = 28; if(counter >= 255) counter = 28;
m_sQueueSample.m_vecPos = col.m_vecPosition; m_sQueueSample.m_vecPos = col.m_vecPosition;
m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_bIs2D = FALSE;
m_sQueueSample.m_nReleasingVolumeModificator = 11; m_sQueueSample.m_nReleasingVolumeModificator = 11;
m_sQueueSample.m_nLoopCount = 1; m_sQueueSample.m_nLoopCount = 1;
m_sQueueSample.m_nEmittingVolume = emittingVol; m_sQueueSample.m_nEmittingVolume = emittingVol;
@ -315,9 +315,9 @@ cAudioManager::SetUpOneShotCollisionSound(const cAudioCollision &col)
m_sQueueSample.m_nLoopEnd = -1; m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_fSpeedMultiplier = 4.0f; m_sQueueSample.m_fSpeedMultiplier = 4.0f;
m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity; m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity;
m_sQueueSample.m_bReleasingSoundFlag = true; m_sQueueSample.m_bReleasingSoundFlag = TRUE;
m_sQueueSample.m_bReverbFlag = true; m_sQueueSample.m_bReverbFlag = TRUE;
m_sQueueSample.m_bRequireReflection = false; m_sQueueSample.m_bRequireReflection = FALSE;
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
} }
@ -328,13 +328,13 @@ void
cAudioManager::ServiceCollisions() cAudioManager::ServiceCollisions()
{ {
int i, j; int i, j;
bool abRepeatedCollision1[NUMAUDIOCOLLISIONS]; bool8 abRepeatedCollision1[NUMAUDIOCOLLISIONS];
bool abRepeatedCollision2[NUMAUDIOCOLLISIONS]; bool8 abRepeatedCollision2[NUMAUDIOCOLLISIONS];
m_sQueueSample.m_nEntityIndex = m_nCollisionEntity; m_sQueueSample.m_nEntityIndex = m_nCollisionEntity;
for (int i = 0; i < NUMAUDIOCOLLISIONS; i++) for (int i = 0; i < NUMAUDIOCOLLISIONS; i++)
abRepeatedCollision1[i] = abRepeatedCollision2[i] = false; abRepeatedCollision1[i] = abRepeatedCollision2[i] = FALSE;
for (i = 0; i < m_sCollisionManager.m_bCollisionsInQueue; i++) { for (i = 0; i < m_sCollisionManager.m_bCollisionsInQueue; i++) {
for (j = 0; j < NUMAUDIOCOLLISIONS; j++) { for (j = 0; j < NUMAUDIOCOLLISIONS; j++) {
@ -344,8 +344,8 @@ cAudioManager::ServiceCollisions()
&& (m_sCollisionManager.m_asCollisions1[index].m_bSurface1 == m_sCollisionManager.m_asCollisions2[j].m_bSurface1) && (m_sCollisionManager.m_asCollisions1[index].m_bSurface1 == m_sCollisionManager.m_asCollisions2[j].m_bSurface1)
&& (m_sCollisionManager.m_asCollisions1[index].m_bSurface2 == m_sCollisionManager.m_asCollisions2[j].m_bSurface2) && (m_sCollisionManager.m_asCollisions1[index].m_bSurface2 == m_sCollisionManager.m_asCollisions2[j].m_bSurface2)
) { ) {
abRepeatedCollision1[index] = true; abRepeatedCollision1[index] = TRUE;
abRepeatedCollision2[j] = true; abRepeatedCollision2[j] = TRUE;
m_sCollisionManager.m_asCollisions1[index].m_nBaseVolume = ++m_sCollisionManager.m_asCollisions2[j].m_nBaseVolume; m_sCollisionManager.m_asCollisions1[index].m_nBaseVolume = ++m_sCollisionManager.m_asCollisions2[j].m_nBaseVolume;
SetUpLoopingCollisionSound(m_sCollisionManager.m_asCollisions1[index], j); SetUpLoopingCollisionSound(m_sCollisionManager.m_asCollisions1[index], j);
break; break;

File diff suppressed because it is too large Load diff

View file

@ -22,8 +22,8 @@ const int allChannels = channels + 2;
cAudioManager::cAudioManager() cAudioManager::cAudioManager()
{ {
m_bIsInitialised = false; m_bIsInitialised = FALSE;
m_bReverb = true; m_bReverb = TRUE;
m_fSpeedOfSound = SPEED_OF_SOUND / TIME_SPENT; m_fSpeedOfSound = SPEED_OF_SOUND / TIME_SPENT;
m_nTimeSpent = TIME_SPENT; m_nTimeSpent = TIME_SPENT;
m_nActiveSamples = NUM_SOUNDS_SAMPLES_SLOTS; m_nActiveSamples = NUM_SOUNDS_SAMPLES_SLOTS;
@ -34,16 +34,16 @@ cAudioManager::cAudioManager()
ClearActiveSamples(); ClearActiveSamples();
GenerateIntegerRandomNumberTable(); GenerateIntegerRandomNumberTable();
field_4 = 0; field_4 = 0;
m_bDynamicAcousticModelingStatus = true; m_bDynamicAcousticModelingStatus = TRUE;
for (int i = 0; i < NUM_AUDIOENTITIES; i++) { for (int i = 0; i < NUM_AUDIOENTITIES; i++) {
m_asAudioEntities[i].m_bIsUsed = false; m_asAudioEntities[i].m_bIsUsed = FALSE;
m_anAudioEntityIndices[i] = NUM_AUDIOENTITIES; m_anAudioEntityIndices[i] = NUM_AUDIOENTITIES;
} }
m_nAudioEntitiesTotal = 0; m_nAudioEntitiesTotal = 0;
m_FrameCounter = 0; m_FrameCounter = 0;
m_bFifthFrameFlag = false; m_bFifthFrameFlag = FALSE;
m_bTimerJustReset = false; m_bTimerJustReset = FALSE;
m_nTimer = 0; m_nTimer = 0;
} }
@ -81,7 +81,7 @@ cAudioManager::Terminate()
MusicManager.Terminate(); MusicManager.Terminate();
for (uint32 i = 0; i < NUM_AUDIOENTITIES; i++) { for (uint32 i = 0; i < NUM_AUDIOENTITIES; i++) {
m_asAudioEntities[i].m_bIsUsed = false; m_asAudioEntities[i].m_bIsUsed = FALSE;
m_anAudioEntityIndices[i] = ARRAY_SIZE(m_anAudioEntityIndices); m_anAudioEntityIndices[i] = ARRAY_SIZE(m_anAudioEntityIndices);
} }
@ -96,7 +96,7 @@ cAudioManager::Terminate()
SampleManager.Terminate(); SampleManager.Terminate();
m_bIsInitialised = false; m_bIsInitialised = FALSE;
PostTerminateGameSpecificShutdown(); PostTerminateGameSpecificShutdown();
} }
} }
@ -108,7 +108,7 @@ cAudioManager::Service()
if (m_bTimerJustReset) { if (m_bTimerJustReset) {
ResetAudioLogicTimers(m_nTimer); ResetAudioLogicTimers(m_nTimer);
MusicManager.ResetTimers(m_nTimer); MusicManager.ResetTimers(m_nTimer);
m_bTimerJustReset = false; m_bTimerJustReset = FALSE;
} }
if (m_bIsInitialised) { if (m_bIsInitialised) {
m_nPreviousUserPause = m_nUserPause; m_nPreviousUserPause = m_nUserPause;
@ -130,8 +130,8 @@ cAudioManager::CreateEntity(eAudioType type, void *entity)
return AEHANDLE_ERROR_BADAUDIOTYPE; return AEHANDLE_ERROR_BADAUDIOTYPE;
for (uint32 i = 0; i < ARRAY_SIZE(m_asAudioEntities); i++) { for (uint32 i = 0; i < ARRAY_SIZE(m_asAudioEntities); i++) {
if (!m_asAudioEntities[i].m_bIsUsed) { if (!m_asAudioEntities[i].m_bIsUsed) {
m_asAudioEntities[i].m_bIsUsed = true; m_asAudioEntities[i].m_bIsUsed = TRUE;
m_asAudioEntities[i].m_bStatus = false; m_asAudioEntities[i].m_bStatus = FALSE;
m_asAudioEntities[i].m_nType = type; m_asAudioEntities[i].m_nType = type;
m_asAudioEntities[i].m_pEntity = entity; m_asAudioEntities[i].m_pEntity = entity;
m_asAudioEntities[i].m_awAudioEvent[0] = SOUND_NO_SOUND; m_asAudioEntities[i].m_awAudioEvent[0] = SOUND_NO_SOUND;
@ -150,7 +150,7 @@ void
cAudioManager::DestroyEntity(int32 id) cAudioManager::DestroyEntity(int32 id)
{ {
if (m_bIsInitialised && id >= 0 && id < NUM_AUDIOENTITIES && m_asAudioEntities[id].m_bIsUsed) { if (m_bIsInitialised && id >= 0 && id < NUM_AUDIOENTITIES && m_asAudioEntities[id].m_bIsUsed) {
m_asAudioEntities[id].m_bIsUsed = false; m_asAudioEntities[id].m_bIsUsed = FALSE;
for (int32 i = 0; i < m_nAudioEntitiesTotal; ++i) { for (int32 i = 0; i < m_nAudioEntitiesTotal; ++i) {
if (id == m_anAudioEntityIndices[i]) { if (id == m_anAudioEntityIndices[i]) {
if (i < NUM_AUDIOENTITIES - 1) if (i < NUM_AUDIOENTITIES - 1)
@ -163,7 +163,7 @@ cAudioManager::DestroyEntity(int32 id)
} }
void void
cAudioManager::SetEntityStatus(int32 id, uint8 status) cAudioManager::SetEntityStatus(int32 id, bool8 status)
{ {
if (m_bIsInitialised && id >= 0 && id < NUM_AUDIOENTITIES && m_asAudioEntities[id].m_bIsUsed) if (m_bIsInitialised && id >= 0 && id < NUM_AUDIOENTITIES && m_asAudioEntities[id].m_bIsUsed)
m_asAudioEntities[id].m_bStatus = status; m_asAudioEntities[id].m_bStatus = status;
@ -191,7 +191,7 @@ cAudioManager::PlayOneShot(int32 index, uint16 sound, float vol)
} }
} else { } else {
int32 i = 0; int32 i = 0;
while (true) { while (TRUE) {
if (i >= entity.m_AudioEvents) { if (i >= entity.m_AudioEvents) {
if (entity.m_AudioEvents < ARRAY_SIZE(entity.m_awAudioEvent)) { if (entity.m_AudioEvents < ARRAY_SIZE(entity.m_awAudioEvent)) {
entity.m_awAudioEvent[i] = sound; entity.m_awAudioEvent[i] = sound;
@ -238,7 +238,7 @@ cAudioManager::SetEffectsFadeVol(uint8 volume) const
} }
void void
cAudioManager::SetMonoMode(uint8 mono) cAudioManager::SetMonoMode(bool8 mono)
{ {
SampleManager.SetMonoMode(mono); SampleManager.SetMonoMode(mono);
} }
@ -253,7 +253,7 @@ void
cAudioManager::ResetTimers(uint32 time) cAudioManager::ResetTimers(uint32 time)
{ {
if (m_bIsInitialised) { if (m_bIsInitialised) {
m_bTimerJustReset = true; m_bTimerJustReset = TRUE;
m_nTimer = time; m_nTimer = time;
ClearRequestedQueue(); ClearRequestedQueue();
if (m_nActiveSampleQueue) { if (m_nActiveSampleQueue) {
@ -372,13 +372,13 @@ cAudioManager::SetSpeakerConfig(int32 conf) const
SampleManager.SetSpeakerConfig(conf); SampleManager.SetSpeakerConfig(conf);
} }
bool bool8
cAudioManager::IsMP3RadioChannelAvailable() const cAudioManager::IsMP3RadioChannelAvailable() const
{ {
if (m_bIsInitialised) if (m_bIsInitialised)
return SampleManager.IsMP3RadioChannelAvailable(); return SampleManager.IsMP3RadioChannelAvailable();
return false; return FALSE;
} }
void void
@ -398,12 +398,12 @@ cAudioManager::ReacquireDigitalHandle() const
} }
void void
cAudioManager::SetDynamicAcousticModelingStatus(uint8 status) cAudioManager::SetDynamicAcousticModelingStatus(bool8 status)
{ {
m_bDynamicAcousticModelingStatus = status!=0; m_bDynamicAcousticModelingStatus = status;
} }
bool bool8
cAudioManager::CheckForAnAudioFileOnCD() const cAudioManager::CheckForAnAudioFileOnCD() const
{ {
return SampleManager.CheckForAnAudioFileOnCD(); return SampleManager.CheckForAnAudioFileOnCD();
@ -418,7 +418,7 @@ cAudioManager::GetCDAudioDriveLetter() const
return 0; return 0;
} }
bool bool8
cAudioManager::IsAudioInitialised() const cAudioManager::IsAudioInitialised() const
{ {
return m_bIsInitialised; return m_bIsInitialised;
@ -527,7 +527,7 @@ cAudioManager::RandomDisplacement(uint32 seed) const
{ {
int32 value; int32 value;
static bool bPos = true; static bool8 bPos = TRUE;
static uint32 Adjustment = 0; static uint32 Adjustment = 0;
if (!seed) if (!seed)
@ -558,7 +558,7 @@ cAudioManager::AddSampleToRequestedQueue()
{ {
int32 calculatedVolume; int32 calculatedVolume;
uint8 sampleIndex; uint8 sampleIndex;
bool bReflections; bool8 bReflections;
if (m_sQueueSample.m_nSampleIndex < TOTAL_AUDIO_SAMPLES) { if (m_sQueueSample.m_nSampleIndex < TOTAL_AUDIO_SAMPLES) {
calculatedVolume = m_sQueueSample.m_nReleasingVolumeModificator * (MAX_VOLUME - m_sQueueSample.m_nVolume); calculatedVolume = m_sQueueSample.m_nReleasingVolumeModificator * (MAX_VOLUME - m_sQueueSample.m_nVolume);
@ -571,21 +571,21 @@ cAudioManager::AddSampleToRequestedQueue()
++m_SampleRequestQueuesStatus[m_nActiveSampleQueue]; ++m_SampleRequestQueuesStatus[m_nActiveSampleQueue];
} }
m_sQueueSample.m_nCalculatedVolume = calculatedVolume; m_sQueueSample.m_nCalculatedVolume = calculatedVolume;
m_sQueueSample.m_bLoopEnded = false; m_sQueueSample.m_bLoopEnded = FALSE;
if (m_sQueueSample.m_bIs2D) { if (m_sQueueSample.m_bIs2D) {
m_sQueueSample.m_bRequireReflection = false; m_sQueueSample.m_bRequireReflection = FALSE;
m_sQueueSample.m_nLoopsRemaining = 0; m_sQueueSample.m_nLoopsRemaining = 0;
} }
if (m_bDynamicAcousticModelingStatus && m_sQueueSample.m_nLoopCount) { if (m_bDynamicAcousticModelingStatus && m_sQueueSample.m_nLoopCount) {
bReflections = m_sQueueSample.m_bRequireReflection; bReflections = m_sQueueSample.m_bRequireReflection;
} else { } else {
bReflections = false; bReflections = FALSE;
m_sQueueSample.m_nLoopsRemaining = 0; m_sQueueSample.m_nLoopsRemaining = 0;
} }
m_sQueueSample.m_bRequireReflection = false; m_sQueueSample.m_bRequireReflection = FALSE;
if (!m_bDynamicAcousticModelingStatus) if (!m_bDynamicAcousticModelingStatus)
m_sQueueSample.m_bReverbFlag = false; m_sQueueSample.m_bReverbFlag = FALSE;
m_asSamples[m_nActiveSampleQueue][sampleIndex] = m_sQueueSample; m_asSamples[m_nActiveSampleQueue][sampleIndex] = m_sQueueSample;
@ -692,7 +692,7 @@ cAudioManager::UpdateReflections()
void void
cAudioManager::AddReleasingSounds() cAudioManager::AddReleasingSounds()
{ {
bool toProcess[44]; // why not 27? bool8 toProcess[44]; // why not 27? because PS2?
int8 queue = m_nActiveSampleQueue == 0 ? 1 : 0; int8 queue = m_nActiveSampleQueue == 0 ? 1 : 0;
@ -701,11 +701,11 @@ cAudioManager::AddReleasingSounds()
if (sample.m_bLoopEnded) if (sample.m_bLoopEnded)
continue; continue;
toProcess[i] = false; toProcess[i] = FALSE;
for (int32 j = 0; j < m_SampleRequestQueuesStatus[m_nActiveSampleQueue]; j++) { for (int32 j = 0; j < m_SampleRequestQueuesStatus[m_nActiveSampleQueue]; j++) {
if (sample.m_nEntityIndex == m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][j]].m_nEntityIndex && if (sample.m_nEntityIndex == m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][j]].m_nEntityIndex &&
sample.m_nCounter == m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][j]].m_nCounter) { sample.m_nCounter == m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][j]].m_nCounter) {
toProcess[i] = true; toProcess[i] = TRUE;
break; break;
} }
} }
@ -741,7 +741,7 @@ cAudioManager::AddReleasingSounds()
void void
cAudioManager::ProcessActiveQueues() cAudioManager::ProcessActiveQueues()
{ {
bool flag; bool8 flag;
float position2; float position2;
float position1; float position1;
@ -758,8 +758,8 @@ cAudioManager::ProcessActiveQueues()
CVector position; CVector position;
for (int32 i = 0; i < m_nActiveSamples; i++) { for (int32 i = 0; i < m_nActiveSamples; i++) {
m_asSamples[m_nActiveSampleQueue][i].m_bIsProcessed = false; m_asSamples[m_nActiveSampleQueue][i].m_bIsProcessed = FALSE;
m_asActiveSamples[i].m_bIsProcessed = false; m_asActiveSamples[i].m_bIsProcessed = FALSE;
} }
for (int32 i = 0; i < m_SampleRequestQueuesStatus[m_nActiveSampleQueue]; ++i) { for (int32 i = 0; i < m_SampleRequestQueuesStatus[m_nActiveSampleQueue]; ++i) {
@ -775,15 +775,15 @@ cAudioManager::ProcessActiveQueues()
flag = !(j & 1); flag = !(j & 1);
} }
if (flag && !SampleManager.GetChannelUsedFlag(j)) { if (flag && !SampleManager.GetChannelUsedFlag(j)) {
sample.m_bLoopEnded = true; sample.m_bLoopEnded = TRUE;
m_asActiveSamples[j].m_bLoopEnded = true; m_asActiveSamples[j].m_bLoopEnded = TRUE;
m_asActiveSamples[j].m_nSampleIndex = NO_SAMPLE; m_asActiveSamples[j].m_nSampleIndex = NO_SAMPLE;
m_asActiveSamples[j].m_nEntityIndex = AEHANDLE_NONE; m_asActiveSamples[j].m_nEntityIndex = AEHANDLE_NONE;
continue; continue;
} }
} }
sample.m_bIsProcessed = true; sample.m_bIsProcessed = TRUE;
m_asActiveSamples[j].m_bIsProcessed = true; m_asActiveSamples[j].m_bIsProcessed = TRUE;
sample.m_nVolumeChange = -1; sample.m_nVolumeChange = -1;
if (!sample.m_bReleasingSoundFlag) { if (!sample.m_bReleasingSoundFlag) {
if (sample.m_bIs2D) { if (sample.m_bIs2D) {
@ -837,8 +837,8 @@ cAudioManager::ProcessActiveQueues()
SampleManager.SetChannelReverbFlag(j, sample.m_bReverbFlag); SampleManager.SetChannelReverbFlag(j, sample.m_bReverbFlag);
break; break;
} }
sample.m_bIsProcessed = false; sample.m_bIsProcessed = FALSE;
m_asActiveSamples[j].m_bIsProcessed = false; m_asActiveSamples[j].m_bIsProcessed = FALSE;
} }
} }
} }
@ -902,8 +902,8 @@ cAudioManager::ProcessActiveQueues()
SampleManager.SetChannel3DDistances(j, m_asActiveSamples[j].m_fSoundIntensity, 0.25f * m_asActiveSamples[j].m_fSoundIntensity); SampleManager.SetChannel3DDistances(j, m_asActiveSamples[j].m_fSoundIntensity, 0.25f * m_asActiveSamples[j].m_fSoundIntensity);
SampleManager.StartChannel(j); SampleManager.StartChannel(j);
} }
m_asActiveSamples[j].m_bIsProcessed = true; m_asActiveSamples[j].m_bIsProcessed = TRUE;
sample.m_bIsProcessed = true; sample.m_bIsProcessed = TRUE;
sample.m_nVolumeChange = -1; sample.m_nVolumeChange = -1;
break; break;
} }
@ -930,28 +930,28 @@ cAudioManager::ClearActiveSamples()
m_asActiveSamples[i].m_nCounter = 0; m_asActiveSamples[i].m_nCounter = 0;
m_asActiveSamples[i].m_nSampleIndex = NO_SAMPLE; m_asActiveSamples[i].m_nSampleIndex = NO_SAMPLE;
m_asActiveSamples[i].m_nBankIndex = INVALID_SFX_BANK; m_asActiveSamples[i].m_nBankIndex = INVALID_SFX_BANK;
m_asActiveSamples[i].m_bIs2D = false; m_asActiveSamples[i].m_bIs2D = FALSE;
m_asActiveSamples[i].m_nReleasingVolumeModificator = 5; m_asActiveSamples[i].m_nReleasingVolumeModificator = 5;
m_asActiveSamples[i].m_nFrequency = 0; m_asActiveSamples[i].m_nFrequency = 0;
m_asActiveSamples[i].m_nVolume = 0; m_asActiveSamples[i].m_nVolume = 0;
m_asActiveSamples[i].m_nEmittingVolume = 0; m_asActiveSamples[i].m_nEmittingVolume = 0;
m_asActiveSamples[i].m_fDistance = 0.0f; m_asActiveSamples[i].m_fDistance = 0.0f;
m_asActiveSamples[i].m_bIsProcessed = false; m_asActiveSamples[i].m_bIsProcessed = FALSE;
m_asActiveSamples[i].m_bLoopEnded = false; m_asActiveSamples[i].m_bLoopEnded = FALSE;
m_asActiveSamples[i].m_nLoopCount = 1; m_asActiveSamples[i].m_nLoopCount = 1;
m_asActiveSamples[i].m_nLoopStart = 0; m_asActiveSamples[i].m_nLoopStart = 0;
m_asActiveSamples[i].m_nLoopEnd = -1; m_asActiveSamples[i].m_nLoopEnd = -1;
m_asActiveSamples[i].m_fSpeedMultiplier = 0.0f; m_asActiveSamples[i].m_fSpeedMultiplier = 0.0f;
m_asActiveSamples[i].m_fSoundIntensity = 200.0f; m_asActiveSamples[i].m_fSoundIntensity = 200.0f;
m_asActiveSamples[i].m_nOffset = 63; m_asActiveSamples[i].m_nOffset = 63;
m_asActiveSamples[i].m_bReleasingSoundFlag = false; m_asActiveSamples[i].m_bReleasingSoundFlag = FALSE;
m_asActiveSamples[i].m_nCalculatedVolume = 0; m_asActiveSamples[i].m_nCalculatedVolume = 0;
m_asActiveSamples[i].m_nReleasingVolumeDivider = 0; m_asActiveSamples[i].m_nReleasingVolumeDivider = 0;
m_asActiveSamples[i].m_nVolumeChange = -1; m_asActiveSamples[i].m_nVolumeChange = -1;
m_asActiveSamples[i].m_vecPos = CVector(0.0f, 0.0f, 0.0f); m_asActiveSamples[i].m_vecPos = CVector(0.0f, 0.0f, 0.0f);
m_asActiveSamples[i].m_bReverbFlag = false; m_asActiveSamples[i].m_bReverbFlag = FALSE;
m_asActiveSamples[i].m_nLoopsRemaining = 0; m_asActiveSamples[i].m_nLoopsRemaining = 0;
m_asActiveSamples[i].m_bRequireReflection = false; m_asActiveSamples[i].m_bRequireReflection = FALSE;
} }
} }

View file

@ -11,7 +11,7 @@ public:
int32 m_nCounter; int32 m_nCounter;
int32 m_nSampleIndex; int32 m_nSampleIndex;
uint8 m_nBankIndex; uint8 m_nBankIndex;
bool m_bIs2D; bool8 m_bIs2D;
int32 m_nReleasingVolumeModificator; int32 m_nReleasingVolumeModificator;
uint32 m_nFrequency; uint32 m_nFrequency;
uint8 m_nVolume; uint8 m_nVolume;
@ -22,15 +22,15 @@ public:
uint8 m_nEmittingVolume; uint8 m_nEmittingVolume;
float m_fSpeedMultiplier; float m_fSpeedMultiplier;
float m_fSoundIntensity; float m_fSoundIntensity;
bool m_bReleasingSoundFlag; bool8 m_bReleasingSoundFlag;
CVector m_vecPos; CVector m_vecPos;
bool m_bReverbFlag; bool8 m_bReverbFlag;
uint8 m_nLoopsRemaining; uint8 m_nLoopsRemaining;
bool m_bRequireReflection; // Used for oneshots bool8 m_bRequireReflection; // Used for oneshots
uint8 m_nOffset; uint8 m_nOffset;
int32 m_nReleasingVolumeDivider; int32 m_nReleasingVolumeDivider;
bool m_bIsProcessed; bool8 m_bIsProcessed;
bool m_bLoopEnded; bool8 m_bLoopEnded;
int32 m_nCalculatedVolume; int32 m_nCalculatedVolume;
int8 m_nVolumeChange; int8 m_nVolumeChange;
}; };
@ -45,7 +45,7 @@ class tAudioEntity
public: public:
eAudioType m_nType; eAudioType m_nType;
void *m_pEntity; void *m_pEntity;
bool m_bIsUsed; bool8 m_bIsUsed;
uint8 m_bStatus; uint8 m_bStatus;
int16 m_awAudioEvent[NUM_AUDIOENTITY_EVENTS]; int16 m_awAudioEvent[NUM_AUDIOENTITY_EVENTS];
float m_afVolume[NUM_AUDIOENTITY_EVENTS]; float m_afVolume[NUM_AUDIOENTITY_EVENTS];
@ -99,13 +99,13 @@ class cMissionAudio
{ {
public: public:
CVector m_vecPos; CVector m_vecPos;
bool m_bPredefinedProperties; bool8 m_bPredefinedProperties;
int32 m_nSampleIndex; int32 m_nSampleIndex;
uint8 m_nLoadingStatus; uint8 m_nLoadingStatus;
uint8 m_nPlayStatus; uint8 m_nPlayStatus;
bool m_bIsPlaying; bool8 m_bIsPlaying;
int32 m_nMissionAudioCounter; int32 m_nMissionAudioCounter;
bool m_bIsPlayed; bool8 m_bIsPlayed;
}; };
VALIDATE_SIZE(cMissionAudio, 32); VALIDATE_SIZE(cMissionAudio, 32);
@ -129,7 +129,7 @@ class CPed;
class cPedParams class cPedParams
{ {
public: public:
bool m_bDistanceCalculated; bool8 m_bDistanceCalculated;
float m_fDistance; float m_fDistance;
CPed *m_pPed; CPed *m_pPed;
@ -144,7 +144,7 @@ public:
class cVehicleParams class cVehicleParams
{ {
public: public:
bool m_bDistanceCalculated; bool8 m_bDistanceCalculated;
float m_fDistance; float m_fDistance;
CVehicle *m_pVehicle; CVehicle *m_pVehicle;
cTransmission *m_pTransmission; cTransmission *m_pTransmission;
@ -184,14 +184,14 @@ enum {
class cAudioManager class cAudioManager
{ {
public: public:
bool m_bIsInitialised; bool8 m_bIsInitialised;
bool m_bReverb; // unused bool8 m_bReverb; // unused
bool m_bFifthFrameFlag; bool8 m_bFifthFrameFlag;
uint8 m_nActiveSamples; uint8 m_nActiveSamples;
uint8 field_4; // unused uint8 field_4; // unused
bool m_bDynamicAcousticModelingStatus; bool8 m_bDynamicAcousticModelingStatus;
float m_fSpeedOfSound; float m_fSpeedOfSound;
bool m_bTimerJustReset; bool8 m_bTimerJustReset;
int32 m_nTimer; int32 m_nTimer;
tSound m_sQueueSample; tSound m_sQueueSample;
uint8 m_nActiveSampleQueue; uint8 m_nActiveSampleQueue;
@ -230,19 +230,19 @@ public:
float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; } float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; }
int32 GetRandomNumber(int32 idx) const { return m_anRandomTable[idx]; } int32 GetRandomNumber(int32 idx) const { return m_anRandomTable[idx]; }
int32 GetRandomNumberInRange(int32 idx, int32 low, int32 high) const { return (m_anRandomTable[idx] % (high - low + 1)) + low; } int32 GetRandomNumberInRange(int32 idx, int32 low, int32 high) const { return (m_anRandomTable[idx] % (high - low + 1)) + low; }
bool ShouldDuckMissionAudio() const { return m_sMissionAudio.m_nPlayStatus == 1; } bool8 ShouldDuckMissionAudio() const { return m_sMissionAudio.m_nPlayStatus == 1; }
// "Should" be in alphabetic order, except "getXTalkSfx" // "Should" be in alphabetic order, except "getXTalkSfx"
void AddDetailsToRequestedOrderList(uint8 sample); void AddDetailsToRequestedOrderList(uint8 sample);
void AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 bank, void AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 bank,
uint8 counter, bool notLooping); uint8 counter, bool8 notLooping);
void AddReflectionsToRequestedQueue(); void AddReflectionsToRequestedQueue();
void AddReleasingSounds(); void AddReleasingSounds();
void AddSampleToRequestedQueue(); void AddSampleToRequestedQueue();
void AgeCrimes(); void AgeCrimes();
void CalculateDistance(bool &condition, float dist); void CalculateDistance(bool8 &condition, float dist);
bool CheckForAnAudioFileOnCD() const; bool8 CheckForAnAudioFileOnCD() const;
void ClearActiveSamples(); void ClearActiveSamples();
void ClearMissionAudio(); void ClearMissionAudio();
void ClearRequestedQueue(); void ClearRequestedQueue();
@ -355,17 +355,17 @@ public:
float GetVehicleNonDriveWheelSkidValue(uint8 wheel, CAutomobile *automobile, float GetVehicleNonDriveWheelSkidValue(uint8 wheel, CAutomobile *automobile,
cTransmission *transmission, float velocityChange); cTransmission *transmission, float velocityChange);
bool HasAirBrakes(int32 model) const; bool8 HasAirBrakes(int32 model) const;
void Initialise(); void Initialise();
void InitialisePoliceRadio(); void InitialisePoliceRadio();
void InitialisePoliceRadioZones(); void InitialisePoliceRadioZones();
void InterrogateAudioEntities(); void InterrogateAudioEntities();
bool IsAudioInitialised() const; bool8 IsAudioInitialised() const;
bool IsMissionAudioSampleFinished(); bool8 IsMissionAudioSampleFinished();
bool IsMP3RadioChannelAvailable() const; bool8 IsMP3RadioChannelAvailable() const;
bool MissionScriptAudioUsesPoliceChannel(int32 soundMission) const; bool8 MissionScriptAudioUsesPoliceChannel(int32 soundMission) const;
void PlayLoadedMissionAudio(); void PlayLoadedMissionAudio();
void PlayOneShot(int32 index, uint16 sound, float vol); void PlayOneShot(int32 index, uint16 sound, float vol);
@ -379,27 +379,27 @@ public:
void PreTerminateGameSpecificShutdown(); void PreTerminateGameSpecificShutdown();
/// processX - main logic of adding new sounds /// processX - main logic of adding new sounds
void ProcessActiveQueues(); void ProcessActiveQueues();
bool ProcessAirBrakes(cVehicleParams& params); bool8 ProcessAirBrakes(cVehicleParams& params);
void ProcessAirportScriptObject(uint8 sound); void ProcessAirportScriptObject(uint8 sound);
bool ProcessBoatEngine(cVehicleParams& params); bool8 ProcessBoatEngine(cVehicleParams& params);
bool ProcessBoatMovingOverWater(cVehicleParams& params); bool8 ProcessBoatMovingOverWater(cVehicleParams& params);
void ProcessBridge(); void ProcessBridge();
void ProcessBridgeMotor(); void ProcessBridgeMotor();
void ProcessBridgeOneShots(); void ProcessBridgeOneShots();
void ProcessBridgeWarning(); void ProcessBridgeWarning();
bool ProcessCarBombTick(cVehicleParams& params); bool8 ProcessCarBombTick(cVehicleParams& params);
void ProcessCesna(cVehicleParams& params); void ProcessCesna(cVehicleParams& params);
void ProcessCinemaScriptObject(uint8 sound); void ProcessCinemaScriptObject(uint8 sound);
void ProcessCrane(); void ProcessCrane();
void ProcessDocksScriptObject(uint8 sound); void ProcessDocksScriptObject(uint8 sound);
bool ProcessEngineDamage(cVehicleParams& params); bool8 ProcessEngineDamage(cVehicleParams& params);
void ProcessEntity(int32 sound); void ProcessEntity(int32 sound);
void ProcessExplosions(int32 explosion); void ProcessExplosions(int32 explosion);
void ProcessFireHydrant(); void ProcessFireHydrant();
void ProcessFires(int32 entity); void ProcessFires(int32 entity);
void ProcessFrontEnd(); void ProcessFrontEnd();
void ProcessGarages(); void ProcessGarages();
bool ProcessHelicopter(cVehicleParams& params); bool8 ProcessHelicopter(cVehicleParams& params);
void ProcessHomeScriptObject(uint8 sound); void ProcessHomeScriptObject(uint8 sound);
void ProcessJumbo(cVehicleParams& params); void ProcessJumbo(cVehicleParams& params);
void ProcessJumboAccel(CPlane *plane); void ProcessJumboAccel(CPlane *plane);
@ -424,24 +424,24 @@ public:
void ProcessProjectiles(); void ProcessProjectiles();
void ProcessRainOnVehicle(cVehicleParams& params); void ProcessRainOnVehicle(cVehicleParams& params);
void ProcessReverb() const; void ProcessReverb() const;
bool ProcessReverseGear(cVehicleParams& params); bool8 ProcessReverseGear(cVehicleParams& params);
void ProcessSawMillScriptObject(uint8 sound); void ProcessSawMillScriptObject(uint8 sound);
void ProcessScriptObject(int32 id); void ProcessScriptObject(int32 id);
void ProcessShopScriptObject(uint8 sound); void ProcessShopScriptObject(uint8 sound);
void ProcessSpecial(); void ProcessSpecial();
bool ProcessTrainNoise(cVehicleParams& params); bool8 ProcessTrainNoise(cVehicleParams& params);
void ProcessVehicle(CVehicle *vehicle); void ProcessVehicle(CVehicle *vehicle);
bool ProcessVehicleDoors(cVehicleParams& params); bool8 ProcessVehicleDoors(cVehicleParams& params);
void ProcessVehicleEngine(cVehicleParams& params); void ProcessVehicleEngine(cVehicleParams& params);
void ProcessVehicleHorn(cVehicleParams& params); void ProcessVehicleHorn(cVehicleParams& params);
void ProcessVehicleOneShots(cVehicleParams& params); void ProcessVehicleOneShots(cVehicleParams& params);
bool ProcessVehicleReverseWarning(cVehicleParams& params); bool8 ProcessVehicleReverseWarning(cVehicleParams& params);
bool ProcessVehicleRoadNoise(cVehicleParams& params); bool8 ProcessVehicleRoadNoise(cVehicleParams& params);
bool ProcessVehicleSirenOrAlarm(cVehicleParams& params); bool8 ProcessVehicleSirenOrAlarm(cVehicleParams& params);
bool ProcessVehicleSkidding(cVehicleParams& params); bool8 ProcessVehicleSkidding(cVehicleParams& params);
void ProcessWaterCannon(int32); void ProcessWaterCannon(int32);
void ProcessWeather(int32 id); void ProcessWeather(int32 id);
bool ProcessWetRoadNoise(cVehicleParams& params); bool8 ProcessWetRoadNoise(cVehicleParams& params);
void ProcessWorkShopScriptObject(uint8 sound); void ProcessWorkShopScriptObject(uint8 sound);
int32 RandomDisplacement(uint32 seed) const; int32 RandomDisplacement(uint32 seed) const;
@ -460,25 +460,25 @@ public:
void ServicePoliceRadioChannel(uint8 wantedLevel); void ServicePoliceRadioChannel(uint8 wantedLevel);
void ServiceSoundEffects(); void ServiceSoundEffects();
int8 SetCurrent3DProvider(uint8 which); int8 SetCurrent3DProvider(uint8 which);
void SetDynamicAcousticModelingStatus(uint8 status); void SetDynamicAcousticModelingStatus(bool8 status);
void SetEffectsFadeVol(uint8 volume) const; void SetEffectsFadeVol(uint8 volume) const;
void SetEffectsMasterVolume(uint8 volume) const; void SetEffectsMasterVolume(uint8 volume) const;
void SetEntityStatus(int32 id, uint8 status); void SetEntityStatus(int32 id, bool8 status);
uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision); uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision);
void SetMissionAudioLocation(float x, float y, float z); void SetMissionAudioLocation(float x, float y, float z);
void SetMissionScriptPoliceAudio(int32 sfx) const; void SetMissionScriptPoliceAudio(int32 sfx) const;
void SetMonoMode(uint8 mono); void SetMonoMode(bool8 mono);
void SetMusicFadeVol(uint8 volume) const; void SetMusicFadeVol(uint8 volume) const;
void SetMusicMasterVolume(uint8 volume) const; void SetMusicMasterVolume(uint8 volume) const;
void SetSpeakerConfig(int32 conf) const; void SetSpeakerConfig(int32 conf) const;
void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter); void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter);
void SetUpOneShotCollisionSound(const cAudioCollision &col); void SetUpOneShotCollisionSound(const cAudioCollision &col);
bool SetupCrimeReport(); bool8 SetupCrimeReport();
bool SetupJumboEngineSound(uint8 vol, uint32 freq); bool8 SetupJumboEngineSound(uint8 vol, uint32 freq);
bool SetupJumboFlySound(uint8 emittingVol); bool8 SetupJumboFlySound(uint8 emittingVol);
bool SetupJumboRumbleSound(uint8 emittingVol); bool8 SetupJumboRumbleSound(uint8 emittingVol);
bool SetupJumboTaxiSound(uint8 vol); bool8 SetupJumboTaxiSound(uint8 vol);
bool SetupJumboWhineSound(uint8 emittingVol, uint32 freq); bool8 SetupJumboWhineSound(uint8 emittingVol, uint32 freq);
void SetupPedComments(cPedParams &params, uint16 sound); void SetupPedComments(cPedParams &params, uint16 sound);
void SetupSuspectLastSeenReport(); void SetupSuspectLastSeenReport();
@ -487,9 +487,9 @@ public:
void UpdateGasPedalAudio(CAutomobile *automobile); void UpdateGasPedalAudio(CAutomobile *automobile);
void UpdateReflections(); void UpdateReflections();
bool UsesReverseWarning(int32 model) const; bool8 UsesReverseWarning(int32 model) const;
bool UsesSiren(int32 model) const; bool8 UsesSiren(int32 model) const;
bool UsesSirenSwitching(int32 model) const; bool8 UsesSirenSwitching(int32 model) const;
#ifdef GTA_PC #ifdef GTA_PC
// only used in pc // only used in pc

View file

@ -39,7 +39,7 @@ cDMAudio::DestroyEntity(int32 audioEntity)
} }
void void
cDMAudio::SetEntityStatus(int32 audioEntity, uint8 status) cDMAudio::SetEntityStatus(int32 audioEntity, bool8 status)
{ {
AudioManager.SetEntityStatus(audioEntity, status); AudioManager.SetEntityStatus(audioEntity, status);
} }
@ -57,7 +57,7 @@ cDMAudio::DestroyAllGameCreatedEntities(void)
} }
void void
cDMAudio::SetMonoMode(uint8 mono) cDMAudio::SetMonoMode(bool8 mono)
{ {
AudioManager.SetMonoMode(mono); AudioManager.SetMonoMode(mono);
} }
@ -128,7 +128,7 @@ cDMAudio::SetSpeakerConfig(int32 config)
AudioManager.SetSpeakerConfig(config); AudioManager.SetSpeakerConfig(config);
} }
bool bool8
cDMAudio::IsMP3RadioChannelAvailable(void) cDMAudio::IsMP3RadioChannelAvailable(void)
{ {
return AudioManager.IsMP3RadioChannelAvailable(); return AudioManager.IsMP3RadioChannelAvailable();
@ -147,12 +147,12 @@ cDMAudio::ReacquireDigitalHandle(void)
} }
void void
cDMAudio::SetDynamicAcousticModelingStatus(uint8 status) cDMAudio::SetDynamicAcousticModelingStatus(bool8 status)
{ {
AudioManager.SetDynamicAcousticModelingStatus(status); AudioManager.SetDynamicAcousticModelingStatus(status);
} }
bool bool8
cDMAudio::CheckForAnAudioFileOnCD(void) cDMAudio::CheckForAnAudioFileOnCD(void)
{ {
return AudioManager.CheckForAnAudioFileOnCD(); return AudioManager.CheckForAnAudioFileOnCD();
@ -164,7 +164,7 @@ cDMAudio::GetCDAudioDriveLetter(void)
return AudioManager.GetCDAudioDriveLetter(); return AudioManager.GetCDAudioDriveLetter();
} }
bool bool8
cDMAudio::IsAudioInitialised(void) cDMAudio::IsAudioInitialised(void)
{ {
return AudioManager.IsAudioInitialised(); return AudioManager.IsAudioInitialised();
@ -182,7 +182,7 @@ cDMAudio::CreateLoopingScriptObject(cAudioScriptObject *scriptObject)
int32 audioEntity = AudioManager.CreateEntity(AUDIOTYPE_SCRIPTOBJECT, scriptObject); int32 audioEntity = AudioManager.CreateEntity(AUDIOTYPE_SCRIPTOBJECT, scriptObject);
if ( AEHANDLE_IS_OK(audioEntity) ) if ( AEHANDLE_IS_OK(audioEntity) )
AudioManager.SetEntityStatus(audioEntity, true); AudioManager.SetEntityStatus(audioEntity, TRUE);
return audioEntity; return audioEntity;
} }
@ -200,7 +200,7 @@ cDMAudio::CreateOneShotScriptObject(cAudioScriptObject *scriptObject)
if ( AEHANDLE_IS_OK(audioEntity) ) if ( AEHANDLE_IS_OK(audioEntity) )
{ {
AudioManager.SetEntityStatus(audioEntity, true); AudioManager.SetEntityStatus(audioEntity, TRUE);
AudioManager.PlayOneShot(audioEntity, scriptObject->AudioId, 0.0f); AudioManager.PlayOneShot(audioEntity, scriptObject->AudioId, 0.0f);
} }
} }
@ -230,7 +230,7 @@ cDMAudio::PlayRadioAnnouncement(uint8 announcement)
} }
void void
cDMAudio::PlayFrontEndTrack(uint8 track, uint8 frontendFlag) cDMAudio::PlayFrontEndTrack(uint8 track, bool8 frontendFlag)
{ {
MusicManager.PlayFrontEndTrack(track, frontendFlag); MusicManager.PlayFrontEndTrack(track, frontendFlag);
} }
@ -295,7 +295,7 @@ cDMAudio::PlayLoadedMissionAudio(void)
AudioManager.PlayLoadedMissionAudio(); AudioManager.PlayLoadedMissionAudio();
} }
bool bool8
cDMAudio::IsMissionAudioSampleFinished(void) cDMAudio::IsMissionAudioSampleFinished(void)
{ {
return AudioManager.IsMissionAudioSampleFinished(); return AudioManager.IsMissionAudioSampleFinished();

View file

@ -22,11 +22,11 @@ public:
int32 CreateEntity(eAudioType type, void *UID); int32 CreateEntity(eAudioType type, void *UID);
void DestroyEntity(int32 audioEntity); void DestroyEntity(int32 audioEntity);
void SetEntityStatus(int32 audioEntity, uint8 status); void SetEntityStatus(int32 audioEntity, bool8 status);
void PlayOneShot(int32 audioEntity, uint16 oneShot, float volume); void PlayOneShot(int32 audioEntity, uint16 oneShot, float volume);
void DestroyAllGameCreatedEntities(void); void DestroyAllGameCreatedEntities(void);
void SetMonoMode(uint8 mono); void SetMonoMode(bool8 mono);
void SetEffectsMasterVolume(uint8 volume); void SetEffectsMasterVolume(uint8 volume);
void SetMusicMasterVolume(uint8 volume); void SetMusicMasterVolume(uint8 volume);
void SetEffectsFadeVol(uint8 volume); void SetEffectsFadeVol(uint8 volume);
@ -40,17 +40,17 @@ public:
void SetSpeakerConfig(int32 config); void SetSpeakerConfig(int32 config);
bool IsMP3RadioChannelAvailable(void); bool8 IsMP3RadioChannelAvailable(void);
void ReleaseDigitalHandle(void); void ReleaseDigitalHandle(void);
void ReacquireDigitalHandle(void); void ReacquireDigitalHandle(void);
void SetDynamicAcousticModelingStatus(uint8 status); void SetDynamicAcousticModelingStatus(bool8 status);
bool CheckForAnAudioFileOnCD(void); bool8 CheckForAnAudioFileOnCD(void);
char GetCDAudioDriveLetter(void); char GetCDAudioDriveLetter(void);
bool IsAudioInitialised(void); bool8 IsAudioInitialised(void);
void ReportCrime(eCrimeType crime, CVector const &pos); void ReportCrime(eCrimeType crime, CVector const &pos);
@ -64,7 +64,7 @@ public:
void PlayFrontEndSound(uint16 frontend, uint32 volume); void PlayFrontEndSound(uint16 frontend, uint32 volume);
void PlayRadioAnnouncement(uint8 announcement); void PlayRadioAnnouncement(uint8 announcement);
void PlayFrontEndTrack(uint8 track, uint8 frontendFlag); void PlayFrontEndTrack(uint8 track, bool8 frontendFlag);
void StopFrontEndTrack(void); void StopFrontEndTrack(void);
void ResetTimers(uint32 time); void ResetTimers(uint32 time);
@ -79,7 +79,7 @@ public:
uint8 GetMissionAudioLoadingStatus(void); uint8 GetMissionAudioLoadingStatus(void);
void SetMissionAudioLocation(float x, float y, float z); void SetMissionAudioLocation(float x, float y, float z);
void PlayLoadedMissionAudio(void); void PlayLoadedMissionAudio(void);
bool IsMissionAudioSampleFinished(void); bool8 IsMissionAudioSampleFinished(void);
void ClearMissionAudio(void); void ClearMissionAudio(void);
uint8 GetRadioInCar(void); uint8 GetRadioInCar(void);

View file

@ -22,42 +22,42 @@ static_assert(false, "RADIO_SCROLL_TO_PREV_STATION and RADIO_OFF_TEXT won't work
cMusicManager MusicManager; cMusicManager MusicManager;
int32 gNumRetunePresses; int32 gNumRetunePresses;
int32 gRetuneCounter; int32 gRetuneCounter;
bool bHasStarted; bool8 bHasStarted;
cMusicManager::cMusicManager() cMusicManager::cMusicManager()
{ {
m_bIsInitialised = false; m_bIsInitialised = FALSE;
m_bDisabled = false; m_bDisabled = FALSE;
m_nMusicMode = MUSICMODE_DISABLED; m_nMusicMode = MUSICMODE_DISABLED;
m_nNextTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
m_bFrontendTrackFinished = false; m_bFrontendTrackFinished = FALSE;
m_bPlayInFrontend = false; m_bPlayInFrontend = FALSE;
m_bSetNextStation = false; m_bSetNextStation = FALSE;
m_nAnnouncement = NO_TRACK; m_nAnnouncement = NO_TRACK;
m_bPreviousPlayerInCar = false; m_bPreviousPlayerInCar = FALSE;
m_bPlayerInCar = false; m_bPlayerInCar = FALSE;
m_bAnnouncementInProgress = false; m_bAnnouncementInProgress = FALSE;
m_bVerifyAmbienceTrackStartedToPlay = false; m_bVerifyAmbienceTrackStartedToPlay = FALSE;
bHasStarted = false; bHasStarted = FALSE;
} }
bool bool8
cMusicManager::PlayerInCar() cMusicManager::PlayerInCar()
{ {
if(!FindPlayerVehicle()) if(!FindPlayerVehicle())
return false; return FALSE;
int32 State = FindPlayerPed()->m_nPedState; int32 State = FindPlayerPed()->m_nPedState;
if(State == PED_DRAG_FROM_CAR || State == PED_EXIT_CAR || State == PED_ARRESTED) if(State == PED_DRAG_FROM_CAR || State == PED_EXIT_CAR || State == PED_ARRESTED)
return false; return FALSE;
if (!FindPlayerVehicle()) if (!FindPlayerVehicle())
return true; return TRUE;
if (FindPlayerVehicle()->GetStatus() == STATUS_WRECKED) if (FindPlayerVehicle()->GetStatus() == STATUS_WRECKED)
return false; return FALSE;
switch (FindPlayerVehicle()->GetModelIndex()) { switch (FindPlayerVehicle()->GetModelIndex()) {
case MI_FIRETRUCK: case MI_FIRETRUCK:
@ -67,8 +67,8 @@ cMusicManager::PlayerInCar()
case MI_TRAIN: case MI_TRAIN:
case MI_SPEEDER: case MI_SPEEDER:
case MI_REEFER: case MI_REEFER:
case MI_GHOST: return false; case MI_GHOST: return FALSE;
default: return true; default: return TRUE;
} }
} }
@ -224,7 +224,7 @@ cMusicManager::DisplayRadioStationName()
} }
} }
bool bool8
cMusicManager::Initialise() cMusicManager::Initialise()
{ {
int pos; int pos;
@ -265,18 +265,18 @@ cMusicManager::Initialise()
m_aTracks[i].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); m_aTracks[i].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
} }
m_bResetTimers = false; m_bResetTimers = FALSE;
m_nResetTime = 0; m_nResetTime = 0;
m_nTimer = m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode(); m_nTimer = m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode();
m_bDoTrackService = false; m_bDoTrackService = FALSE;
m_bIgnoreTimeDelay = false; m_bIgnoreTimeDelay = FALSE;
m_bRadioSetByScript = false; m_bRadioSetByScript = FALSE;
m_nRadioStationScript = HEAD_RADIO; m_nRadioStationScript = HEAD_RADIO;
m_nRadioPosition = -1; m_nRadioPosition = -1;
m_nRadioInCar = NO_TRACK; m_nRadioInCar = NO_TRACK;
gNumRetunePresses = 0; gNumRetunePresses = 0;
gRetuneCounter = 0; gRetuneCounter = 0;
m_bIsInitialised = true; m_bIsInitialised = TRUE;
} }
return m_bIsInitialised; return m_bIsInitialised;
} }
@ -291,7 +291,7 @@ cMusicManager::Terminate()
m_nNextTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
} }
m_bIsInitialised = false; m_bIsInitialised = FALSE;
} }
void void
@ -325,16 +325,16 @@ cMusicManager::ChangeMusicMode(uint8 mode)
} }
m_nNextTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
m_bFrontendTrackFinished = false; m_bFrontendTrackFinished = FALSE;
m_bPlayInFrontend = false; m_bPlayInFrontend = FALSE;
m_bSetNextStation = false; m_bSetNextStation = FALSE;
m_bPreviousPlayerInCar = false; m_bPreviousPlayerInCar = FALSE;
m_bPlayerInCar = false; m_bPlayerInCar = FALSE;
m_bAnnouncementInProgress = false; m_bAnnouncementInProgress = FALSE;
m_nTimer = m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode(); m_nTimer = m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode();
m_bDoTrackService = false; m_bDoTrackService = FALSE;
m_bIgnoreTimeDelay = true; m_bIgnoreTimeDelay = TRUE;
m_bVerifyAmbienceTrackStartedToPlay = false; m_bVerifyAmbienceTrackStartedToPlay = FALSE;
m_nMusicMode = mode2; m_nMusicMode = mode2;
break; break;
default: return; default: return;
@ -383,7 +383,7 @@ void
cMusicManager::SetRadioChannelByScript(uint8 station, int32 pos) cMusicManager::SetRadioChannelByScript(uint8 station, int32 pos)
{ {
if (m_bIsInitialised && station < RADIO_OFF) { if (m_bIsInitialised && station < RADIO_OFF) {
m_bRadioSetByScript = true; m_bRadioSetByScript = TRUE;
m_nRadioStationScript = station; m_nRadioStationScript = station;
m_nRadioPosition = pos == -1 ? -1 : pos % m_aTracks[station].m_nLength; m_nRadioPosition = pos == -1 ? -1 : pos % m_aTracks[station].m_nLength;
} }
@ -393,12 +393,12 @@ cMusicManager::SetRadioChannelByScript(uint8 station, int32 pos)
void void
cMusicManager::ResetMusicAfterReload() cMusicManager::ResetMusicAfterReload()
{ {
m_bRadioSetByScript = false; m_bRadioSetByScript = FALSE;
m_nRadioStationScript = 0; m_nRadioStationScript = 0;
m_nRadioPosition = -1; m_nRadioPosition = -1;
m_nAnnouncement = NO_TRACK; m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false; m_bAnnouncementInProgress = FALSE;
m_bSetNextStation = false; m_bSetNextStation = FALSE;
gRetuneCounter = 0; gRetuneCounter = 0;
gNumRetunePresses = 0; gNumRetunePresses = 0;
} }
@ -407,7 +407,7 @@ cMusicManager::ResetMusicAfterReload()
void void
cMusicManager::ResetTimers(int32 time) cMusicManager::ResetTimers(int32 time)
{ {
m_bResetTimers = true; m_bResetTimers = TRUE;
m_nResetTime = time; m_nResetTime = time;
} }
@ -415,23 +415,23 @@ void
cMusicManager::Service() cMusicManager::Service()
{ {
if (m_bResetTimers) { if (m_bResetTimers) {
m_bResetTimers = false; m_bResetTimers = FALSE;
m_nLastTrackServiceTime = m_nResetTime; m_nLastTrackServiceTime = m_nResetTime;
} }
if (!m_bIsInitialised || m_bDisabled) return; if (!m_bIsInitialised || m_bDisabled) return;
if (m_nMusicMode == MUSICMODE_CUTSCENE) { if (m_nMusicMode == MUSICMODE_CUTSCENE) {
SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, 1, 0); SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, TRUE, 0);
return; return;
} }
m_nTimer = CTimer::GetTimeInMillisecondsPauseMode(); m_nTimer = CTimer::GetTimeInMillisecondsPauseMode();
if (m_nTimer > (m_nLastTrackServiceTime + 2000) || m_bIgnoreTimeDelay) { if (m_nTimer > (m_nLastTrackServiceTime + 2000) || m_bIgnoreTimeDelay) {
m_bIgnoreTimeDelay = false; m_bIgnoreTimeDelay = FALSE;
m_bDoTrackService = true; m_bDoTrackService = TRUE;
m_nLastTrackServiceTime = m_nTimer; m_nLastTrackServiceTime = m_nTimer;
} else m_bDoTrackService = false; } else m_bDoTrackService = FALSE;
if (m_nNextTrack == NO_TRACK && SampleManager.IsStreamPlaying(0)) if (m_nNextTrack == NO_TRACK && SampleManager.IsStreamPlaying(0))
SampleManager.StopStreamedFile(0); SampleManager.StopStreamedFile(0);
@ -466,22 +466,22 @@ cMusicManager::ServiceFrontEndMode()
if (!SampleManager.IsStreamPlaying(0)) if (!SampleManager.IsStreamPlaying(0))
SampleManager.StartStreamedFile(m_nNextTrack, 0, 0); SampleManager.StartStreamedFile(m_nNextTrack, 0, 0);
} else { } else {
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(0, 63, FALSE, 0);
if (!SampleManager.StartStreamedFile(m_nNextTrack, m_nNextTrack < NUM_RADIOS ? GetTrackStartPos(m_nNextTrack) : 0, 0)) if (!SampleManager.StartStreamedFile(m_nNextTrack, m_nNextTrack < NUM_RADIOS ? GetTrackStartPos(m_nNextTrack) : 0, 0))
return; return;
SampleManager.SetStreamedVolumeAndPan(100, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(100, 63, FALSE, 0);
if (m_bPlayInFrontend) bHasStarted = true; if (m_bPlayInFrontend) bHasStarted = TRUE;
else m_bFrontendTrackFinished = true; else m_bFrontendTrackFinished = TRUE;
} }
} }
if (SampleManager.IsStreamPlaying(0)) if (SampleManager.IsStreamPlaying(0))
SampleManager.SetStreamedVolumeAndPan((CPad::GetPad(0)->bDisplayNoControllerMessage || CPad::GetPad(0)->bObsoleteControllerMessage) ? 0 : 100, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan((CPad::GetPad(0)->bDisplayNoControllerMessage || CPad::GetPad(0)->bObsoleteControllerMessage) ? 0 : 100, 63, FALSE, 0);
} }
void void
cMusicManager::ServiceGameMode() cMusicManager::ServiceGameMode()
{ {
bool bRadioOff = false; bool8 bRadioOff = FALSE;
static int8 nFramesSinceCutsceneEnded = -1; static int8 nFramesSinceCutsceneEnded = -1;
uint8 volume; uint8 volume;
@ -525,7 +525,7 @@ cMusicManager::ServiceGameMode()
} }
if (AudioManager.m_nPreviousUserPause) if (AudioManager.m_nPreviousUserPause)
m_bPreviousPlayerInCar = false; m_bPreviousPlayerInCar = FALSE;
if (!m_bPlayerInCar) { if (!m_bPlayerInCar) {
if (m_bPreviousPlayerInCar) { if (m_bPreviousPlayerInCar) {
if (m_nNextTrack != STREAMED_SOUND_RADIO_POLICE) if (m_nNextTrack != STREAMED_SOUND_RADIO_POLICE)
@ -541,7 +541,7 @@ cMusicManager::ServiceGameMode()
&& ServiceAnnouncement()) && ServiceAnnouncement())
{ {
if (m_bAnnouncementInProgress) { if (m_bAnnouncementInProgress) {
m_bSetNextStation = false; m_bSetNextStation = FALSE;
return; return;
} }
m_nPlayingTrack = m_nNextTrack; m_nPlayingTrack = m_nNextTrack;
@ -558,7 +558,7 @@ cMusicManager::ServiceGameMode()
AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_RADIO_CHANGE, 1.0f); AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_RADIO_CHANGE, 1.0f);
gRetuneCounter = 0; gRetuneCounter = 0;
gNumRetunePresses = 0; gNumRetunePresses = 0;
m_bSetNextStation = false; m_bSetNextStation = FALSE;
} }
// Because when you switch radio back and forth, gNumRetunePresses will be 0 but gRetuneCounter won't. // Because when you switch radio back and forth, gNumRetunePresses will be 0 but gRetuneCounter won't.
#ifdef RADIO_SCROLL_TO_PREV_STATION #ifdef RADIO_SCROLL_TO_PREV_STATION
@ -566,24 +566,24 @@ cMusicManager::ServiceGameMode()
if (gRetuneCounter > 1) gRetuneCounter--; if (gRetuneCounter > 1) gRetuneCounter--;
else if (gRetuneCounter == 1) gRetuneCounter = -1; else if (gRetuneCounter == 1) gRetuneCounter = -1;
else if (gRetuneCounter == -1) { else if (gRetuneCounter == -1) {
m_bSetNextStation = true; m_bSetNextStation = TRUE;
gRetuneCounter = 0; gRetuneCounter = 0;
} }
} }
#else #else
if (gNumRetunePresses) { if (gNumRetunePresses) {
if (gRetuneCounter != 0) gRetuneCounter--; if (gRetuneCounter != 0) gRetuneCounter--;
else m_bSetNextStation = true; else m_bSetNextStation = TRUE;
} }
#endif #endif
if (gRetuneCounter) if (gRetuneCounter)
AudioManager.DoPoliceRadioCrackle(); AudioManager.DoPoliceRadioCrackle();
if (m_bSetNextStation) { if (m_bSetNextStation) {
m_bSetNextStation = false; m_bSetNextStation = FALSE;
m_nPlayingTrack = m_nNextTrack; m_nPlayingTrack = m_nNextTrack;
m_nNextTrack = GetNextCarTuning(); m_nNextTrack = GetNextCarTuning();
if (m_nNextTrack == STREAMED_SOUND_CITY_AMBIENT || m_nNextTrack == STREAMED_SOUND_WATER_AMBIENT) if (m_nNextTrack == STREAMED_SOUND_CITY_AMBIENT || m_nNextTrack == STREAMED_SOUND_WATER_AMBIENT)
bRadioOff = true; bRadioOff = TRUE;
if (m_nPlayingTrack == STREAMED_SOUND_CITY_AMBIENT || m_nPlayingTrack == STREAMED_SOUND_WATER_AMBIENT) if (m_nPlayingTrack == STREAMED_SOUND_CITY_AMBIENT || m_nPlayingTrack == STREAMED_SOUND_WATER_AMBIENT)
AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_RADIO_CHANGE, 0.0f); AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_RADIO_CHANGE, 0.0f);
@ -592,7 +592,7 @@ cMusicManager::ServiceGameMode()
if (ChangeRadioChannel()) { if (ChangeRadioChannel()) {
ServiceTrack(); ServiceTrack();
} else { } else {
m_bPlayerInCar = false; m_bPlayerInCar = FALSE;
if (FindPlayerVehicle()) if (FindPlayerVehicle())
FindPlayerVehicle()->m_nRadioStation = m_nNextTrack; FindPlayerVehicle()->m_nRadioStation = m_nNextTrack;
m_nNextTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
@ -601,7 +601,7 @@ cMusicManager::ServiceGameMode()
if (TheCamera.pTargetEntity != nil) { if (TheCamera.pTargetEntity != nil) {
float DistToTargetSq = (TheCamera.pTargetEntity->GetPosition() - TheCamera.GetPosition()).MagnitudeSqr(); float DistToTargetSq = (TheCamera.pTargetEntity->GetPosition() - TheCamera.GetPosition()).MagnitudeSqr();
if (DistToTargetSq >= SQR(55.0f)) { if (DistToTargetSq >= SQR(55.0f)) {
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(0, 63, FALSE, 0);
} else if (DistToTargetSq >= SQR(10.0f)) { } else if (DistToTargetSq >= SQR(10.0f)) {
volume = ((45.0f - (Sqrt(DistToTargetSq) - 10.0f)) / 45.0f * 100.0f); volume = ((45.0f - (Sqrt(DistToTargetSq) - 10.0f)) / 45.0f * 100.0f);
uint8 pan; uint8 pan;
@ -616,17 +616,17 @@ cMusicManager::ServiceGameMode()
} }
if (gRetuneCounter) if (gRetuneCounter)
volume /= 4; volume /= 4;
SampleManager.SetStreamedVolumeAndPan(volume, pan, 0, 0); SampleManager.SetStreamedVolumeAndPan(volume, pan, FALSE, 0);
} else if (AudioManager.ShouldDuckMissionAudio()) { } else if (AudioManager.ShouldDuckMissionAudio()) {
SampleManager.SetStreamedVolumeAndPan(25, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(25, 63, FALSE, 0);
} else if (gRetuneCounter) { } else if (gRetuneCounter) {
SampleManager.SetStreamedVolumeAndPan(25, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(25, 63, FALSE, 0);
} else { } else {
SampleManager.SetStreamedVolumeAndPan(100, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(100, 63, FALSE, 0);
} }
} }
} else if (AudioManager.ShouldDuckMissionAudio()) { } else if (AudioManager.ShouldDuckMissionAudio()) {
SampleManager.SetStreamedVolumeAndPan(25, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(25, 63, FALSE, 0);
nFramesSinceCutsceneEnded = 0; nFramesSinceCutsceneEnded = 0;
} else { } else {
if (nFramesSinceCutsceneEnded == -1) { if (nFramesSinceCutsceneEnded == -1) {
@ -643,7 +643,7 @@ cMusicManager::ServiceGameMode()
} }
if (gRetuneCounter != 0) if (gRetuneCounter != 0)
volume /= 4; volume /= 4;
SampleManager.SetStreamedVolumeAndPan(volume, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(volume, 63, FALSE, 0);
} }
return; return;
} }
@ -663,7 +663,7 @@ cMusicManager::ServiceGameMode()
m_nNextTrack = m_nRadioStationScript; m_nNextTrack = m_nRadioStationScript;
if (FindPlayerVehicle()->m_nRadioStation == m_nNextTrack) { if (FindPlayerVehicle()->m_nRadioStation == m_nNextTrack) {
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(0, 63, FALSE, 0);
SampleManager.StopStreamedFile(0); SampleManager.StopStreamedFile(0);
} }
if (m_nRadioPosition != -1) { if (m_nRadioPosition != -1) {
@ -680,11 +680,11 @@ cMusicManager::ServiceGameMode()
} }
if (ChangeRadioChannel()) { if (ChangeRadioChannel()) {
if (m_bRadioSetByScript) { if (m_bRadioSetByScript) {
m_bRadioSetByScript = false; m_bRadioSetByScript = FALSE;
FindPlayerVehicle()->m_nRadioStation = m_nNextTrack; FindPlayerVehicle()->m_nRadioStation = m_nNextTrack;
} }
} else { } else {
m_bPlayerInCar = false; m_bPlayerInCar = FALSE;
m_nNextTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
} }
} }
@ -709,14 +709,14 @@ cMusicManager::PlayAnnouncement(uint8 announcement)
} }
void void
cMusicManager::PlayFrontEndTrack(uint8 track, uint8 bPlayInFrontend) cMusicManager::PlayFrontEndTrack(uint8 track, bool8 bPlayInFrontend)
{ {
if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS) { if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS) {
if (m_nMusicMode == MUSICMODE_GAME) { if (m_nMusicMode == MUSICMODE_GAME) {
if (m_nNextTrack != NO_TRACK) { if (m_nNextTrack != NO_TRACK) {
if (m_bAnnouncementInProgress) { if (m_bAnnouncementInProgress) {
m_nAnnouncement = NO_TRACK; m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false; m_bAnnouncementInProgress = FALSE;
} }
m_aTracks[m_nNextTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0); m_aTracks[m_nNextTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0);
m_aTracks[m_nNextTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); m_aTracks[m_nNextTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
@ -732,10 +732,10 @@ cMusicManager::PlayFrontEndTrack(uint8 track, uint8 bPlayInFrontend)
m_nPlayingTrack = m_nNextTrack; m_nPlayingTrack = m_nNextTrack;
m_nNextTrack = track; m_nNextTrack = track;
m_bPlayInFrontend = !!bPlayInFrontend; m_bPlayInFrontend = bPlayInFrontend;
m_bFrontendTrackFinished = false; m_bFrontendTrackFinished = FALSE;
m_bDoTrackService = true; m_bDoTrackService = TRUE;
bHasStarted = false; bHasStarted = FALSE;
if (m_nNextTrack < NUM_RADIOS) { if (m_nNextTrack < NUM_RADIOS) {
gRetuneCounter = 0; gRetuneCounter = 0;
gNumRetunePresses = 0; gNumRetunePresses = 0;
@ -751,7 +751,7 @@ cMusicManager::PreloadCutSceneMusic(uint8 track)
while (SampleManager.IsStreamPlaying(0)) while (SampleManager.IsStreamPlaying(0))
SampleManager.StopStreamedFile(0); SampleManager.StopStreamedFile(0);
SampleManager.PreloadStreamedFile(track, 0); SampleManager.PreloadStreamedFile(track, 0);
SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, 1, 0); SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, TRUE, 0);
m_nNextTrack = track; m_nNextTrack = track;
} }
} }
@ -787,7 +787,7 @@ cMusicManager::GetTrackStartPos(uint8 track)
} }
bool bool8
cMusicManager::UsesPoliceRadio(CVehicle *veh) cMusicManager::UsesPoliceRadio(CVehicle *veh)
{ {
switch (veh->GetModelIndex()) switch (veh->GetModelIndex())
@ -798,9 +798,9 @@ cMusicManager::UsesPoliceRadio(CVehicle *veh)
case MI_PREDATOR: case MI_PREDATOR:
case MI_RHINO: case MI_RHINO:
case MI_BARRACKS: case MI_BARRACKS:
return true; return TRUE;
} }
return false; return FALSE;
} }
void void
@ -810,7 +810,7 @@ cMusicManager::ServiceAmbience()
if (m_bAnnouncementInProgress) { if (m_bAnnouncementInProgress) {
m_nAnnouncement = NO_TRACK; m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false; m_bAnnouncementInProgress = FALSE;
} }
if (m_nNextTrack < RADIO_OFF) { if (m_nNextTrack < RADIO_OFF) {
if (SampleManager.IsStreamPlaying(0)) { if (SampleManager.IsStreamPlaying(0)) {
@ -831,11 +831,11 @@ cMusicManager::ServiceAmbience()
m_nNextTrack = TheCamera.DistanceToWater <= 45.0f ? STREAMED_SOUND_WATER_AMBIENT : STREAMED_SOUND_CITY_AMBIENT; m_nNextTrack = TheCamera.DistanceToWater <= 45.0f ? STREAMED_SOUND_WATER_AMBIENT : STREAMED_SOUND_CITY_AMBIENT;
if (m_nNextTrack == m_nPlayingTrack) { if (m_nNextTrack == m_nPlayingTrack) {
ComputeAmbienceVol(false, volume); ComputeAmbienceVol(FALSE, volume);
SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0); SampleManager.SetStreamedVolumeAndPan(volume, 63, TRUE, 0);
if (m_bVerifyAmbienceTrackStartedToPlay) { if (m_bVerifyAmbienceTrackStartedToPlay) {
if (SampleManager.IsStreamPlaying(0)) if (SampleManager.IsStreamPlaying(0))
m_bVerifyAmbienceTrackStartedToPlay = false; m_bVerifyAmbienceTrackStartedToPlay = FALSE;
} else ServiceTrack(); } else ServiceTrack();
} else { } else {
if (m_nPlayingTrack < TOTAL_STREAMED_SOUNDS) { if (m_nPlayingTrack < TOTAL_STREAMED_SOUNDS) {
@ -844,18 +844,18 @@ cMusicManager::ServiceAmbience()
SampleManager.StopStreamedFile(0); SampleManager.StopStreamedFile(0);
} }
uint32 pos = GetTrackStartPos(m_nNextTrack); uint32 pos = GetTrackStartPos(m_nNextTrack);
SampleManager.SetStreamedVolumeAndPan(0, 63, 1, 0); SampleManager.SetStreamedVolumeAndPan(0, 63, TRUE, 0);
if (SampleManager.StartStreamedFile(m_nNextTrack, pos, 0)) { if (SampleManager.StartStreamedFile(m_nNextTrack, pos, 0)) {
ComputeAmbienceVol(true, volume); ComputeAmbienceVol(TRUE, volume);
SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0); SampleManager.SetStreamedVolumeAndPan(volume, 63, TRUE, 0);
m_bVerifyAmbienceTrackStartedToPlay = true; m_bVerifyAmbienceTrackStartedToPlay = TRUE;
} else } else
m_nNextTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
} }
} }
void void
cMusicManager::ComputeAmbienceVol(uint8 reset, uint8 &outVolume) cMusicManager::ComputeAmbienceVol(bool8 reset, uint8 &outVolume)
{ {
static float fVol = 0.0f; static float fVol = 0.0f;
@ -883,16 +883,16 @@ cMusicManager::ServiceTrack()
} }
} }
bool bool8
cMusicManager::ServiceAnnouncement() cMusicManager::ServiceAnnouncement()
{ {
static int8 cCheck = 0; static int8 cCheck = 0;
if (m_bAnnouncementInProgress) { if (m_bAnnouncementInProgress) {
if (!SampleManager.IsStreamPlaying(0)) { if (!SampleManager.IsStreamPlaying(0)) {
m_nAnnouncement = NO_TRACK; m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false; m_bAnnouncementInProgress = FALSE;
} }
return true; return TRUE;
} }
if (++cCheck >= 30) { if (++cCheck >= 30) {
@ -906,21 +906,21 @@ cMusicManager::ServiceAnnouncement()
} }
} }
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(0, 63, FALSE, 0);
if (SampleManager.StartStreamedFile(m_nAnnouncement, 0, 0)) { if (SampleManager.StartStreamedFile(m_nAnnouncement, 0, 0)) {
SampleManager.SetStreamedVolumeAndPan(AudioManager.ShouldDuckMissionAudio() ? 25 : 100, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(AudioManager.ShouldDuckMissionAudio() ? 25 : 100, 63, FALSE, 0);
m_bAnnouncementInProgress = true; m_bAnnouncementInProgress = TRUE;
m_nPlayingTrack = m_nNextTrack; m_nPlayingTrack = m_nNextTrack;
m_nNextTrack = m_nAnnouncement; m_nNextTrack = m_nAnnouncement;
return true; return TRUE;
} }
if (cCheck != 0) cCheck--; if (cCheck != 0) cCheck--;
else cCheck = 30; else cCheck = 30;
return false; return FALSE;
} }
return false; return FALSE;
} }
uint8 uint8
@ -987,21 +987,21 @@ cMusicManager::GetNextCarTuning()
return veh->m_nRadioStation; return veh->m_nRadioStation;
} }
bool bool8
cMusicManager::ChangeRadioChannel() cMusicManager::ChangeRadioChannel()
{ {
if (m_nNextTrack != m_nPlayingTrack) { if (m_nNextTrack != m_nPlayingTrack) {
if (m_nPlayingTrack < TOTAL_STREAMED_SOUNDS) { if (m_nPlayingTrack < TOTAL_STREAMED_SOUNDS) {
m_aTracks[m_nPlayingTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0); m_aTracks[m_nPlayingTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0);
m_aTracks[m_nPlayingTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); m_aTracks[m_nPlayingTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(0, 63, FALSE, 0);
SampleManager.StopStreamedFile(0); SampleManager.StopStreamedFile(0);
} }
if (SampleManager.IsStreamPlaying(0)) if (SampleManager.IsStreamPlaying(0))
return false; return FALSE;
if (!SampleManager.StartStreamedFile(m_nNextTrack, GetTrackStartPos(m_nNextTrack), 0)) if (!SampleManager.StartStreamedFile(m_nNextTrack, GetTrackStartPos(m_nNextTrack), 0))
return false; return FALSE;
SampleManager.SetStreamedVolumeAndPan(AudioManager.ShouldDuckMissionAudio() ? 25 : 100, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(AudioManager.ShouldDuckMissionAudio() ? 25 : 100, 63, FALSE, 0);
} }
return true; return TRUE;
} }

View file

@ -15,48 +15,48 @@ class CVehicle;
class cMusicManager class cMusicManager
{ {
public: public:
bool m_bIsInitialised; bool8 m_bIsInitialised;
bool m_bDisabled; bool8 m_bDisabled;
uint8 m_nMusicMode; uint8 m_nMusicMode;
uint8 m_nNextTrack; uint8 m_nNextTrack;
uint8 m_nPlayingTrack; uint8 m_nPlayingTrack;
bool m_bFrontendTrackFinished; bool8 m_bFrontendTrackFinished;
bool m_bPlayInFrontend; bool8 m_bPlayInFrontend;
bool m_bSetNextStation; bool8 m_bSetNextStation;
uint8 m_nAnnouncement; uint8 m_nAnnouncement;
bool m_bPreviousPlayerInCar; bool8 m_bPreviousPlayerInCar;
bool m_bPlayerInCar; bool8 m_bPlayerInCar;
bool m_bAnnouncementInProgress; bool8 m_bAnnouncementInProgress;
tStreamedSample m_aTracks[TOTAL_STREAMED_SOUNDS]; tStreamedSample m_aTracks[TOTAL_STREAMED_SOUNDS];
bool m_bResetTimers; bool8 m_bResetTimers;
uint32 m_nResetTime; uint32 m_nResetTime;
uint32 m_nLastTrackServiceTime; uint32 m_nLastTrackServiceTime;
uint32 m_nTimer; uint32 m_nTimer;
bool m_bDoTrackService; bool8 m_bDoTrackService;
bool m_bIgnoreTimeDelay; bool8 m_bIgnoreTimeDelay;
bool m_bVerifyAmbienceTrackStartedToPlay; bool8 m_bVerifyAmbienceTrackStartedToPlay;
bool m_bRadioSetByScript; bool8 m_bRadioSetByScript;
uint8 m_nRadioStationScript; uint8 m_nRadioStationScript;
int32 m_nRadioPosition; int32 m_nRadioPosition;
uint8 m_nRadioInCar; uint8 m_nRadioInCar;
public: public:
cMusicManager(); cMusicManager();
bool IsInitialised() { return m_bIsInitialised; } bool8 IsInitialised() { return m_bIsInitialised; }
uint32 GetMusicMode() { return m_nMusicMode; } uint32 GetMusicMode() { return m_nMusicMode; }
uint8 GetNextTrack() { return m_nNextTrack; } uint8 GetNextTrack() { return m_nNextTrack; }
bool Initialise(); bool8 Initialise();
void Terminate(); void Terminate();
void ChangeMusicMode(uint8 mode); void ChangeMusicMode(uint8 mode);
void StopFrontEndTrack(); void StopFrontEndTrack();
bool PlayerInCar(); bool8 PlayerInCar();
void DisplayRadioStationName(); void DisplayRadioStationName();
void PlayAnnouncement(uint8); void PlayAnnouncement(uint8);
void PlayFrontEndTrack(uint8, uint8); void PlayFrontEndTrack(uint8, bool8);
void PreloadCutSceneMusic(uint8); void PreloadCutSceneMusic(uint8);
void PlayPreloadedCutSceneMusic(void); void PlayPreloadedCutSceneMusic(void);
void StopCutSceneMusic(void); void StopCutSceneMusic(void);
@ -73,15 +73,15 @@ public:
void ServiceAmbience(); void ServiceAmbience();
void ServiceTrack(); void ServiceTrack();
bool UsesPoliceRadio(CVehicle *veh); bool8 UsesPoliceRadio(CVehicle *veh);
uint32 GetTrackStartPos(uint8); uint32 GetTrackStartPos(uint8);
void ComputeAmbienceVol(uint8 reset, uint8& outVolume); void ComputeAmbienceVol(bool8 reset, uint8& outVolume);
bool ServiceAnnouncement(); bool8 ServiceAnnouncement();
uint8 GetCarTuning(); uint8 GetCarTuning();
uint8 GetNextCarTuning(); uint8 GetNextCarTuning();
bool ChangeRadioChannel(); bool8 ChangeRadioChannel();
}; };
VALIDATE_SIZE(cMusicManager, 0x95C); VALIDATE_SIZE(cMusicManager, 0x95C);

View file

@ -94,8 +94,8 @@ cAudioManager::InitialisePoliceRadio()
for (int32 i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++) for (int32 i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++)
m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE; m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE;
SampleManager.SetChannelReverbFlag(policeChannel, false); SampleManager.SetChannelReverbFlag(policeChannel, FALSE);
gSpecialSuspectLastSeenReport = false; gSpecialSuspectLastSeenReport = FALSE;
for (int32 i = 0; i < ARRAY_SIZE(gMinTimeToNextReport); i++) for (int32 i = 0; i < ARRAY_SIZE(gMinTimeToNextReport); i++)
gMinTimeToNextReport[i] = m_FrameCounter; gMinTimeToNextReport[i] = m_FrameCounter;
} }
@ -131,7 +131,7 @@ cAudioManager::DoPoliceRadioCrackle()
m_sQueueSample.m_nCounter = 0; m_sQueueSample.m_nCounter = 0;
m_sQueueSample.m_nSampleIndex = SFX_POLICE_RADIO_CRACKLE; m_sQueueSample.m_nSampleIndex = SFX_POLICE_RADIO_CRACKLE;
m_sQueueSample.m_nBankIndex = SFX_BANK_0; m_sQueueSample.m_nBankIndex = SFX_BANK_0;
m_sQueueSample.m_bIs2D = true; m_sQueueSample.m_bIs2D = TRUE;
m_sQueueSample.m_nReleasingVolumeModificator = 10; m_sQueueSample.m_nReleasingVolumeModificator = 10;
m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_POLICE_RADIO_CRACKLE); m_sQueueSample.m_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_POLICE_RADIO_CRACKLE);
m_sQueueSample.m_nVolume = m_anRandomTable[2] % 20 + 15; m_sQueueSample.m_nVolume = m_anRandomTable[2] % 20 + 15;
@ -139,11 +139,11 @@ cAudioManager::DoPoliceRadioCrackle()
m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume; m_sQueueSample.m_nEmittingVolume = m_sQueueSample.m_nVolume;
m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(SFX_POLICE_RADIO_CRACKLE); m_sQueueSample.m_nLoopStart = SampleManager.GetSampleLoopStartOffset(SFX_POLICE_RADIO_CRACKLE);
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(SFX_POLICE_RADIO_CRACKLE); m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(SFX_POLICE_RADIO_CRACKLE);
m_sQueueSample.m_bReleasingSoundFlag = false; m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_bReverbFlag = false; m_sQueueSample.m_bReverbFlag = FALSE;
m_sQueueSample.m_nOffset = 63; m_sQueueSample.m_nOffset = 63;
m_sQueueSample.m_nReleasingVolumeDivider = 3; m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bRequireReflection = false; m_sQueueSample.m_bRequireReflection = FALSE;
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
} }
@ -156,7 +156,7 @@ cAudioManager::ServicePoliceRadio()
if(!m_bIsInitialised) return; if(!m_bIsInitialised) return;
if(m_nUserPause == 0) { if(m_nUserPause == 0) {
bool crimeReport = SetupCrimeReport(); bool8 crimeReport = SetupCrimeReport();
#ifdef FIX_BUGS // Crash at 0x5fe6ef #ifdef FIX_BUGS // Crash at 0x5fe6ef
if(CReplay::IsPlayingBack() || !FindPlayerPed() || !FindPlayerPed()->m_pWanted) if(CReplay::IsPlayingBack() || !FindPlayerPed() || !FindPlayerPed()->m_pWanted)
return; return;
@ -179,12 +179,12 @@ cAudioManager::ServicePoliceRadio()
void void
cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel) cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
{ {
bool processed = false; bool8 processed = FALSE;
uint32 sample; uint32 sample;
int32 freq; int32 freq;
static int cWait = 0; static int cWait = 0;
static bool bChannelOpen = false; static bool8 bChannelOpen = FALSE;
static uint8 bMissionAudioPhysicalPlayingStatus = 0; static uint8 bMissionAudioPhysicalPlayingStatus = 0;
static int32 PoliceChannelFreq = 5500; static int32 PoliceChannelFreq = 5500;
@ -194,14 +194,14 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
if (SampleManager.GetChannelUsedFlag(policeChannel)) SampleManager.StopChannel(policeChannel); if (SampleManager.GetChannelUsedFlag(policeChannel)) SampleManager.StopChannel(policeChannel);
if (g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && bMissionAudioPhysicalPlayingStatus == 1 && if (g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && bMissionAudioPhysicalPlayingStatus == 1 &&
SampleManager.IsStreamPlaying(1)) { SampleManager.IsStreamPlaying(1)) {
SampleManager.PauseStream(1, 1); SampleManager.PauseStream(TRUE, 1);
} }
} else { } else {
if (m_nPreviousUserPause && g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && if (m_nPreviousUserPause && g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES &&
bMissionAudioPhysicalPlayingStatus == 1) { bMissionAudioPhysicalPlayingStatus == 1) {
SampleManager.PauseStream(0, 1); SampleManager.PauseStream(FALSE, 1);
} }
if (m_sPoliceRadioQueue.policeChannelTimer == 0) bChannelOpen = false; if (m_sPoliceRadioQueue.policeChannelTimer == 0) bChannelOpen = FALSE;
if (cWait) { if (cWait) {
--cWait; --cWait;
return; return;
@ -225,7 +225,7 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
} }
} else if (!SampleManager.GetChannelUsedFlag(policeChannel)) { } else if (!SampleManager.GetChannelUsedFlag(policeChannel)) {
SampleManager.PreloadStreamedFile(g_nMissionAudioSfx, 1); SampleManager.PreloadStreamedFile(g_nMissionAudioSfx, 1);
SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, 1, 1); SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, TRUE, 1);
SampleManager.StartPreloadedStreamedFile(1); SampleManager.StartPreloadedStreamedFile(1);
g_nMissionAudioPlayingStatus = 1; g_nMissionAudioPlayingStatus = 1;
bMissionAudioPhysicalPlayingStatus = 0; bMissionAudioPhysicalPlayingStatus = 0;
@ -246,8 +246,8 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
if (gSpecialSuspectLastSeenReport) { if (gSpecialSuspectLastSeenReport) {
gSpecialSuspectLastSeenReport = 0; gSpecialSuspectLastSeenReport = 0;
} else if (((sample >= SFX_POLICE_RADIO_MESSAGE_NOISE_1) && (sample <= SFX_POLICE_RADIO_MESSAGE_NOISE_3)) || sample == TOTAL_AUDIO_SAMPLES) { } else if (((sample >= SFX_POLICE_RADIO_MESSAGE_NOISE_1) && (sample <= SFX_POLICE_RADIO_MESSAGE_NOISE_3)) || sample == TOTAL_AUDIO_SAMPLES) {
bChannelOpen = false; bChannelOpen = FALSE;
processed = true; processed = TRUE;
} }
} }
if (sample == TOTAL_AUDIO_SAMPLES) { if (sample == TOTAL_AUDIO_SAMPLES) {
@ -259,7 +259,7 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
case SFX_POLICE_RADIO_MESSAGE_NOISE_2: case SFX_POLICE_RADIO_MESSAGE_NOISE_2:
case SFX_POLICE_RADIO_MESSAGE_NOISE_3: case SFX_POLICE_RADIO_MESSAGE_NOISE_3:
freq = m_anRandomTable[4] % 2000 + 10025; freq = m_anRandomTable[4] % 2000 + 10025;
bChannelOpen = bChannelOpen == false; bChannelOpen = bChannelOpen == FALSE;
break; break;
default: freq = SampleManager.GetSampleBaseFrequency(sample); break; default: freq = SampleManager.GetSampleBaseFrequency(sample); break;
} }
@ -276,7 +276,7 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
} }
} }
bool bool8
cAudioManager::SetupCrimeReport() cAudioManager::SetupCrimeReport()
{ {
int16 audioZoneId; int16 audioZoneId;
@ -289,13 +289,13 @@ cAudioManager::SetupCrimeReport()
float quarterY; float quarterY;
int i; int i;
int32 sampleIndex; int32 sampleIndex;
bool processed = false; bool8 processed = FALSE;
if (MusicManager.m_nMusicMode == MUSICMODE_CUTSCENE) return false; if (MusicManager.m_nMusicMode == MUSICMODE_CUTSCENE) return FALSE;
if (60 - m_sPoliceRadioQueue.policeChannelTimer <= 9) { if (60 - m_sPoliceRadioQueue.policeChannelTimer <= 9) {
AgeCrimes(); AgeCrimes();
return true; return TRUE;
} }
for (i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++) { for (i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++) {
@ -303,7 +303,7 @@ cAudioManager::SetupCrimeReport()
break; break;
} }
if (i == ARRAY_SIZE(m_sPoliceRadioQueue.crimes)) return false; if (i == ARRAY_SIZE(m_sPoliceRadioQueue.crimes)) return FALSE;
audioZoneId = CTheZones::FindAudioZone(&m_sPoliceRadioQueue.crimes[i].position); audioZoneId = CTheZones::FindAudioZone(&m_sPoliceRadioQueue.crimes[i].position);
if (audioZoneId >= 0 && audioZoneId < NUMAUDIOZONES) { if (audioZoneId >= 0 && audioZoneId < NUMAUDIOZONES) {
zone = CTheZones::GetAudioZone(audioZoneId); zone = CTheZones::GetAudioZone(audioZoneId);
@ -336,10 +336,10 @@ cAudioManager::SetupCrimeReport()
if (m_sPoliceRadioQueue.crimes[i].position.y > halfY + quarterY) { if (m_sPoliceRadioQueue.crimes[i].position.y > halfY + quarterY) {
m_sPoliceRadioQueue.Add(SFX_NORTH); m_sPoliceRadioQueue.Add(SFX_NORTH);
processed = true; processed = TRUE;
} else if (m_sPoliceRadioQueue.crimes[i].position.y < halfY - quarterY) { } else if (m_sPoliceRadioQueue.crimes[i].position.y < halfY - quarterY) {
m_sPoliceRadioQueue.Add(SFX_SOUTH); m_sPoliceRadioQueue.Add(SFX_SOUTH);
processed = true; processed = TRUE;
} }
if (m_sPoliceRadioQueue.crimes[i].position.x > halfX + quarterX) if (m_sPoliceRadioQueue.crimes[i].position.x > halfX + quarterX)
@ -359,7 +359,7 @@ cAudioManager::SetupCrimeReport()
} }
m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE; m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE;
AgeCrimes(); AgeCrimes();
return true; return TRUE;
} }
void void
@ -714,7 +714,7 @@ cAudioManager::PlaySuspectLastSeen(float x, float y, float z)
float quarterX; float quarterX;
float quarterY; float quarterY;
int32 sample; int32 sample;
bool processed = false; bool8 processed = false;
CVector vec = CVector(x, y, z); CVector vec = CVector(x, y, z);
if (!m_bIsInitialised) return; if (!m_bIsInitialised) return;
@ -745,10 +745,10 @@ cAudioManager::PlaySuspectLastSeen(float x, float y, float z)
if (vec.y > halfY + quarterY) { if (vec.y > halfY + quarterY) {
m_sPoliceRadioQueue.Add(SFX_NORTH); m_sPoliceRadioQueue.Add(SFX_NORTH);
processed = true; processed = TRUE;
} else if (vec.y < halfY - quarterY) { } else if (vec.y < halfY - quarterY) {
m_sPoliceRadioQueue.Add(SFX_SOUTH); m_sPoliceRadioQueue.Add(SFX_SOUTH);
processed = true; processed = TRUE;
} }
if (vec.x > halfX + quarterX) if (vec.x > halfX + quarterX)
@ -761,7 +761,7 @@ cAudioManager::PlaySuspectLastSeen(float x, float y, float z)
m_sPoliceRadioQueue.Add(sample); m_sPoliceRadioQueue.Add(sample);
m_sPoliceRadioQueue.Add(m_anRandomTable[2] % 3 + SFX_POLICE_RADIO_MESSAGE_NOISE_1); m_sPoliceRadioQueue.Add(m_anRandomTable[2] % 3 + SFX_POLICE_RADIO_MESSAGE_NOISE_1);
m_sPoliceRadioQueue.Add(TOTAL_AUDIO_SAMPLES); m_sPoliceRadioQueue.Add(TOTAL_AUDIO_SAMPLES);
gSpecialSuspectLastSeenReport = true; gSpecialSuspectLastSeenReport = TRUE;
break; break;
} }
} }

View file

@ -118,10 +118,10 @@ class cSampleManager
uint8 m_nMusicVolume; uint8 m_nMusicVolume;
uint8 m_nEffectsFadeVolume; uint8 m_nEffectsFadeVolume;
uint8 m_nMusicFadeVolume; uint8 m_nMusicFadeVolume;
uint8 m_nMonoMode; bool8 m_nMonoMode;
char unk; char unk;
char m_szCDRomRootPath[80]; char m_szCDRomRootPath[80];
bool m_bInitialised; bool8 m_bInitialised;
uint8 m_nNumberOfProviders; uint8 m_nNumberOfProviders;
char *m_aAudioProviders[MAXPROVIDERS]; char *m_aAudioProviders[MAXPROVIDERS];
tSample m_aSamples[TOTAL_AUDIO_SAMPLES]; tSample m_aSamples[TOTAL_AUDIO_SAMPLES];
@ -145,16 +145,16 @@ public:
int8 GetCurrent3DProviderIndex(void); int8 GetCurrent3DProviderIndex(void);
int8 SetCurrent3DProvider(uint8 which); int8 SetCurrent3DProvider(uint8 which);
bool IsMP3RadioChannelAvailable(void); bool8 IsMP3RadioChannelAvailable(void);
void ReleaseDigitalHandle (void); void ReleaseDigitalHandle (void);
void ReacquireDigitalHandle(void); void ReacquireDigitalHandle(void);
bool Initialise(void); bool8 Initialise(void);
void Terminate (void); void Terminate (void);
bool CheckForAnAudioFileOnCD(void); bool8 CheckForAnAudioFileOnCD(void);
char GetCDAudioDriveLetter (void); char GetCDAudioDriveLetter (void);
void UpdateEffectsVolume(void); void UpdateEffectsVolume(void);
@ -162,14 +162,14 @@ public:
void SetMusicMasterVolume (uint8 nVolume); void SetMusicMasterVolume (uint8 nVolume);
void SetEffectsFadeVolume (uint8 nVolume); void SetEffectsFadeVolume (uint8 nVolume);
void SetMusicFadeVolume (uint8 nVolume); void SetMusicFadeVolume (uint8 nVolume);
void SetMonoMode (uint8 nMode); void SetMonoMode (bool8 nMode);
bool LoadSampleBank (uint8 nBank); bool8 LoadSampleBank (uint8 nBank);
void UnloadSampleBank (uint8 nBank); void UnloadSampleBank (uint8 nBank);
bool IsSampleBankLoaded(uint8 nBank); bool8 IsSampleBankLoaded(uint8 nBank);
bool IsPedCommentLoaded(uint32 nComment); bool8 IsPedCommentLoaded(uint32 nComment);
bool LoadPedComment (uint32 nComment); bool8 LoadPedComment (uint32 nComment);
int32 GetBankContainingSound(uint32 offset); int32 GetBankContainingSound(uint32 offset);
int32 _GetPedCommentSlot(uint32 nComment); int32 _GetPedCommentSlot(uint32 nComment);
@ -179,10 +179,10 @@ public:
int32 GetSampleLoopEndOffset (uint32 nSample); int32 GetSampleLoopEndOffset (uint32 nSample);
uint32 GetSampleLength (uint32 nSample); uint32 GetSampleLength (uint32 nSample);
bool UpdateReverb(void); bool8 UpdateReverb(void);
void SetChannelReverbFlag (uint32 nChannel, uint8 nReverbFlag); void SetChannelReverbFlag (uint32 nChannel, bool8 nReverbFlag);
bool InitialiseChannel (uint32 nChannel, uint32 nSfx, uint8 nBank); bool8 InitialiseChannel (uint32 nChannel, uint32 nSfx, uint8 nBank);
void SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume); void SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume);
void SetChannel3DPosition (uint32 nChannel, float fX, float fY, float fZ); void SetChannel3DPosition (uint32 nChannel, float fX, float fY, float fZ);
void SetChannel3DDistances (uint32 nChannel, float fMax, float fMin); void SetChannel3DDistances (uint32 nChannel, float fMax, float fMin);
@ -191,23 +191,23 @@ public:
void SetChannelFrequency (uint32 nChannel, uint32 nFreq); void SetChannelFrequency (uint32 nChannel, uint32 nFreq);
void SetChannelLoopPoints (uint32 nChannel, uint32 nLoopStart, int32 nLoopEnd); void SetChannelLoopPoints (uint32 nChannel, uint32 nLoopStart, int32 nLoopEnd);
void SetChannelLoopCount (uint32 nChannel, uint32 nLoopCount); void SetChannelLoopCount (uint32 nChannel, uint32 nLoopCount);
bool GetChannelUsedFlag (uint32 nChannel); bool8 GetChannelUsedFlag (uint32 nChannel);
void StartChannel (uint32 nChannel); void StartChannel (uint32 nChannel);
void StopChannel (uint32 nChannel); void StopChannel (uint32 nChannel);
void PreloadStreamedFile (uint8 nFile, uint8 nStream); void PreloadStreamedFile (uint8 nFile, uint8 nStream);
void PauseStream (uint8 nPauseFlag, uint8 nStream); void PauseStream (bool8 nPauseFlag, uint8 nStream);
void StartPreloadedStreamedFile (uint8 nStream); void StartPreloadedStreamedFile (uint8 nStream);
bool StartStreamedFile (uint8 nFile, uint32 nPos, uint8 nStream); bool8 StartStreamedFile (uint8 nFile, uint32 nPos, uint8 nStream);
void StopStreamedFile (uint8 nStream); void StopStreamedFile (uint8 nStream);
int32 GetStreamedFilePosition (uint8 nStream); int32 GetStreamedFilePosition (uint8 nStream);
void SetStreamedVolumeAndPan(uint8 nVolume, uint8 nPan, uint8 nEffectFlag, uint8 nStream); void SetStreamedVolumeAndPan(uint8 nVolume, uint8 nPan, bool8 nEffectFlag, uint8 nStream);
int32 GetStreamedFileLength (uint8 nStream); int32 GetStreamedFileLength (uint8 nStream);
bool IsStreamPlaying (uint8 nStream); bool8 IsStreamPlaying (uint8 nStream);
#ifdef AUDIO_OAL #ifdef AUDIO_OAL
void Service(void); void Service(void);
#endif #endif
bool InitialiseSampleBanks(void); bool8 InitialiseSampleBanks(void);
}; };
extern cSampleManager SampleManager; extern cSampleManager SampleManager;

View file

@ -28,7 +28,7 @@ char SampleBankDataFilename[] = "AUDIO\\SFX.RAW";
FILE *fpSampleDescHandle; FILE *fpSampleDescHandle;
FILE *fpSampleDataHandle; FILE *fpSampleDataHandle;
bool bSampleBankLoaded [MAX_SFX_BANKS]; bool8 bSampleBankLoaded [MAX_SFX_BANKS];
int32 nSampleBankDiscStartOffset [MAX_SFX_BANKS]; int32 nSampleBankDiscStartOffset [MAX_SFX_BANKS];
int32 nSampleBankSize [MAX_SFX_BANKS]; int32 nSampleBankSize [MAX_SFX_BANKS];
int32 nSampleBankMemoryStartAddress[MAX_SFX_BANKS]; int32 nSampleBankMemoryStartAddress[MAX_SFX_BANKS];
@ -62,16 +62,16 @@ int8 nStreamPan [MAX_STREAMS];
int8 nStreamVolume[MAX_STREAMS]; int8 nStreamVolume[MAX_STREAMS];
uint32 _CurMP3Index; uint32 _CurMP3Index;
int32 _CurMP3Pos; int32 _CurMP3Pos;
bool _bIsMp3Active; bool8 _bIsMp3Active;
#if GTA_VERSION >= GTA3_PC_11 || defined(NO_CDCHECK) #if GTA_VERSION >= GTA3_PC_11 || defined(NO_CDCHECK)
bool _bUseHDDAudio; bool8 _bUseHDDAudio;
char _aHDDPath[MAX_PATH]; char _aHDDPath[MAX_PATH];
#endif #endif
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////
bool _bSampmanInitialised = false; bool8 _bSampmanInitialised = FALSE;
// //
// Miscellaneous globals / defines // Miscellaneous globals / defines
@ -98,7 +98,7 @@ S32 speaker_type=0;
U32 _maxSamples; U32 _maxSamples;
float _fPrevEaxRatioDestination; float _fPrevEaxRatioDestination;
bool _usingMilesFast2D; bool8 _usingMilesFast2D;
float _fEffectsLevel; float _fEffectsLevel;
@ -170,17 +170,17 @@ release_existing()
} }
_fPrevEaxRatioDestination = 0.0f; _fPrevEaxRatioDestination = 0.0f;
_usingMilesFast2D = false; _usingMilesFast2D = FALSE;
_fEffectsLevel = 0.0f; _fEffectsLevel = 0.0f;
} }
static bool static bool8
set_new_provider(S32 index) set_new_provider(S32 index)
{ {
DWORD result; DWORD result;
if ( curprovider == index ) if ( curprovider == index )
return true; return TRUE;
//close the already opened provider //close the already opened provider
curprovider = index; curprovider = index;
@ -207,7 +207,7 @@ set_new_provider(S32 index)
release_existing(); release_existing();
return false; return FALSE;
} }
else else
{ {
@ -238,7 +238,7 @@ set_new_provider(S32 index)
AIL_set_3D_room_type(opened_provider, ENVIRONMENT_CAVE); AIL_set_3D_room_type(opened_provider, ENVIRONMENT_CAVE);
if ( !strcmp(providers[index].name, "Miles Fast 2D Positional Audio") ) if ( !strcmp(providers[index].name, "Miles Fast 2D Positional Audio") )
_usingMilesFast2D = true; _usingMilesFast2D = TRUE;
} }
AIL_3D_provider_attribute(opened_provider, "Maximum supported samples", &_maxSamples); AIL_3D_provider_attribute(opened_provider, "Maximum supported samples", &_maxSamples);
@ -256,11 +256,11 @@ set_new_provider(S32 index)
AIL_set_3D_sample_effects_level(opened_samples[i], 0.0f); AIL_set_3D_sample_effects_level(opened_samples[i], 0.0f);
} }
return true; return TRUE;
} }
} }
return false; return FALSE;
} }
cSampleManager::cSampleManager(void) : cSampleManager::cSampleManager(void) :
@ -353,7 +353,7 @@ cSampleManager::SetCurrent3DProvider(uint8 nProvider)
return curprovider; return curprovider;
} }
static bool static bool8
_ResolveLink(char const *path, char *out) _ResolveLink(char const *path, char *out)
{ {
IShellLink* psl; IShellLink* psl;
@ -389,7 +389,7 @@ _ResolveLink(char const *path, char *out)
ppf->Release(); ppf->Release();
psl->Release(); psl->Release();
#endif #endif
return true; return TRUE;
} }
} }
} }
@ -399,15 +399,15 @@ _ResolveLink(char const *path, char *out)
psl->Release(); psl->Release();
} }
return false; return FALSE;
} }
static void static void
_FindMP3s(void) _FindMP3s(void)
{ {
tMP3Entry *pList; tMP3Entry *pList;
bool bShortcut; bool8 bShortcut;
bool bInitFirstEntry; bool8 bInitFirstEntry;
HANDLE hFind; HANDLE hFind;
char path[MAX_PATH]; char path[MAX_PATH];
char filepath[MAX_PATH*2]; char filepath[MAX_PATH*2];
@ -474,10 +474,10 @@ _FindMP3s(void)
if ( f ) fprintf(f, " - couldn't resolve shortcut"); if ( f ) fprintf(f, " - couldn't resolve shortcut");
} }
bShortcut = true; bShortcut = TRUE;
} }
else else
bShortcut = false; bShortcut = FALSE;
} }
mp3Stream[0] = AIL_open_stream(DIG, filepath, 0); mp3Stream[0] = AIL_open_stream(DIG, filepath, 0);
@ -524,7 +524,7 @@ _FindMP3s(void)
if ( f ) fprintf(f, " - OK\n"); if ( f ) fprintf(f, " - OK\n");
bInitFirstEntry = false; bInitFirstEntry = FALSE;
} }
else else
{ {
@ -534,10 +534,10 @@ _FindMP3s(void)
if ( f ) fprintf(f, " - not an MP3 or supported MP3 type\n"); if ( f ) fprintf(f, " - not an MP3 or supported MP3 type\n");
bInitFirstEntry = true; bInitFirstEntry = TRUE;
} }
while ( true ) while ( TRUE )
{ {
if ( !FindNextFile(hFind, &fd) ) if ( !FindNextFile(hFind, &fd) )
break; break;
@ -569,11 +569,11 @@ _FindMP3s(void)
if ( f ) fprintf(f, " - couldn't resolve shortcut"); if ( f ) fprintf(f, " - couldn't resolve shortcut");
} }
bShortcut = true; bShortcut = TRUE;
} }
else else
{ {
bShortcut = false; bShortcut = FALSE;
if ( filepathlen > MAX_PATH ) if ( filepathlen > MAX_PATH )
{ {
@ -620,7 +620,7 @@ _FindMP3s(void)
if ( f ) fprintf(f, " - OK\n"); if ( f ) fprintf(f, " - OK\n");
bInitFirstEntry = false; bInitFirstEntry = FALSE;
} }
else else
{ {
@ -658,11 +658,11 @@ _FindMP3s(void)
if ( f ) fprintf(f, " - couldn't resolve shortcut"); if ( f ) fprintf(f, " - couldn't resolve shortcut");
} }
bShortcut = true; bShortcut = TRUE;
} }
else else
{ {
bShortcut = false; bShortcut = FALSE;
} }
} }
@ -784,7 +784,7 @@ _GetMP3EntryByIndex(uint32 idx)
return NULL; return NULL;
} }
static inline bool static inline bool8
_GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry) _GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
{ {
_CurMP3Index = 0; _CurMP3Index = 0;
@ -797,7 +797,7 @@ _GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
*pPosition -= (*pEntry)->nTrackStreamPos; *pPosition -= (*pEntry)->nTrackStreamPos;
_CurMP3Pos = *pPosition; _CurMP3Pos = *pPosition;
return true; return TRUE;
} }
_CurMP3Index++; _CurMP3Index++;
@ -808,10 +808,10 @@ _GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
_CurMP3Pos = 0; _CurMP3Pos = 0;
_CurMP3Index = 0; _CurMP3Index = 0;
return false; return FALSE;
} }
bool bool8
cSampleManager::IsMP3RadioChannelAvailable(void) cSampleManager::IsMP3RadioChannelAvailable(void)
{ {
return nNumMP3s != 0; return nNumMP3s != 0;
@ -840,13 +840,13 @@ cSampleManager::ReacquireDigitalHandle(void)
} }
} }
bool bool8
cSampleManager::Initialise(void) cSampleManager::Initialise(void)
{ {
TRACE("start"); TRACE("start");
if ( _bSampmanInitialised ) if ( _bSampmanInitialised )
return true; return TRUE;
{ {
for ( int32 i = 0; i < TOTAL_AUDIO_SAMPLES; i++ ) for ( int32 i = 0; i < TOTAL_AUDIO_SAMPLES; i++ )
@ -872,7 +872,7 @@ cSampleManager::Initialise(void)
curprovider = -1; curprovider = -1;
prevprovider = -1; prevprovider = -1;
_usingMilesFast2D = false; _usingMilesFast2D = FALSE;
usingEAX=0; usingEAX=0;
usingEAX3=0; usingEAX3=0;
@ -897,7 +897,7 @@ cSampleManager::Initialise(void)
for ( int32 i = 0; i < MAX_SFX_BANKS; i++ ) for ( int32 i = 0; i < MAX_SFX_BANKS; i++ )
{ {
bSampleBankLoaded[i] = false; bSampleBankLoaded[i] = FALSE;
nSampleBankDiscStartOffset[i] = 0; nSampleBankDiscStartOffset[i] = 0;
nSampleBankSize[i] = 0; nSampleBankSize[i] = 0;
nSampleBankMemoryStartAddress[i] = 0; nSampleBankMemoryStartAddress[i] = 0;
@ -936,7 +936,7 @@ cSampleManager::Initialise(void)
{ {
OutputDebugString(AIL_last_error()); OutputDebugString(AIL_last_error());
Terminate(); Terminate();
return false; return FALSE;
} }
add_providers(); add_providers();
@ -944,14 +944,14 @@ cSampleManager::Initialise(void)
if ( !InitialiseSampleBanks() ) if ( !InitialiseSampleBanks() )
{ {
Terminate(); Terminate();
return false; return FALSE;
} }
nSampleBankMemoryStartAddress[SFX_BANK_0] = (int32)AIL_mem_alloc_lock(nSampleBankSize[SFX_BANK_0]); nSampleBankMemoryStartAddress[SFX_BANK_0] = (int32)AIL_mem_alloc_lock(nSampleBankSize[SFX_BANK_0]);
if ( !nSampleBankMemoryStartAddress[SFX_BANK_0] ) if ( !nSampleBankMemoryStartAddress[SFX_BANK_0] )
{ {
Terminate(); Terminate();
return false; return FALSE;
} }
nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] = (int32)AIL_mem_alloc_lock(PED_BLOCKSIZE*MAX_PEDSFX); nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] = (int32)AIL_mem_alloc_lock(PED_BLOCKSIZE*MAX_PEDSFX);
@ -964,7 +964,7 @@ cSampleManager::Initialise(void)
if (cacheFile) { if (cacheFile) {
fread(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile); fread(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
fclose(cacheFile); fclose(cacheFile);
m_bInitialised = true; m_bInitialised = TRUE;
}else { }else {
#endif #endif
TRACE("cdrom"); TRACE("cdrom");
@ -973,9 +973,9 @@ cSampleManager::Initialise(void)
char filepath[MAX_PATH]; char filepath[MAX_PATH];
{ {
m_bInitialised = false; m_bInitialised = FALSE;
while (true) while (TRUE)
{ {
int32 drive = 'C'; int32 drive = 'C';
@ -1000,7 +1000,7 @@ cSampleManager::Initialise(void)
{ {
fclose(f); fclose(f);
bool bFileNotFound = false; bool8 bFileNotFound = FALSE;
for ( int32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++ ) for ( int32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++ )
{ {
@ -1020,19 +1020,19 @@ cSampleManager::Initialise(void)
} }
else else
{ {
bFileNotFound = true; bFileNotFound = TRUE;
break; break;
} }
} }
if ( !bFileNotFound ) if ( !bFileNotFound )
{ {
m_bInitialised = true; m_bInitialised = TRUE;
break; break;
} }
else else
{ {
m_bInitialised = false; m_bInitialised = FALSE;
continue; continue;
} }
} }
@ -1047,11 +1047,11 @@ cSampleManager::Initialise(void)
if ( FrontEndMenuManager.m_bQuitGameNoCD ) if ( FrontEndMenuManager.m_bQuitGameNoCD )
{ {
Terminate(); Terminate();
return false; return FALSE;
} }
continue; continue;
#else #else
m_bInitialised = true; m_bInitialised = TRUE;
#endif #endif
} }
@ -1071,7 +1071,7 @@ cSampleManager::Initialise(void)
{ {
int32 streamLength[TOTAL_STREAMED_SOUNDS]; int32 streamLength[TOTAL_STREAMED_SOUNDS];
bool bFileNotFound = false; bool8 bFileNotFound = FALSE;
char rootpath[MAX_PATH]; char rootpath[MAX_PATH];
strcpy(_aHDDPath, m_szCDRomRootPath); strcpy(_aHDDPath, m_szCDRomRootPath);
@ -1101,14 +1101,14 @@ cSampleManager::Initialise(void)
} }
else else
{ {
bFileNotFound = true; bFileNotFound = TRUE;
break; break;
} }
} }
} }
else else
bFileNotFound = true; bFileNotFound = TRUE;
if ( !bFileNotFound ) if ( !bFileNotFound )
{ {
@ -1117,10 +1117,10 @@ cSampleManager::Initialise(void)
for ( int32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++ ) for ( int32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++ )
nStreamLength[i] = streamLength[i]; nStreamLength[i] = streamLength[i];
_bUseHDDAudio = true; _bUseHDDAudio = TRUE;
} }
else else
_bUseHDDAudio = false; _bUseHDDAudio = FALSE;
} }
#endif #endif
#ifdef AUDIO_CACHE #ifdef AUDIO_CACHE
@ -1152,7 +1152,7 @@ cSampleManager::Initialise(void)
TRACE("providerset"); TRACE("providerset");
{ {
_bSampmanInitialised = true; _bSampmanInitialised = TRUE;
U32 n = 0; U32 n = 0;
@ -1169,7 +1169,7 @@ cSampleManager::Initialise(void)
if ( n == m_nNumberOfProviders ) if ( n == m_nNumberOfProviders )
{ {
Terminate(); Terminate();
return false; return FALSE;
} }
} }
@ -1198,13 +1198,13 @@ cSampleManager::Initialise(void)
time_t t = time(NULL); time_t t = time(NULL);
tm *localtm; tm *localtm;
bool bUseRandomTable; bool8 bUseRandomTable;
if ( t == -1 ) if ( t == -1 )
bUseRandomTable = true; bUseRandomTable = TRUE;
else else
{ {
bUseRandomTable = false; bUseRandomTable = FALSE;
localtm = localtime(&t); localtm = localtime(&t);
} }
@ -1236,12 +1236,12 @@ cSampleManager::Initialise(void)
else else
_CurMP3Pos = 0; _CurMP3Pos = 0;
_bIsMp3Active = false; _bIsMp3Active = FALSE;
} }
TRACE("end"); TRACE("end");
return true; return TRUE;
} }
void void
@ -1290,10 +1290,10 @@ cSampleManager::Terminate(void)
AIL_shutdown(); AIL_shutdown();
_bSampmanInitialised = false; _bSampmanInitialised = FALSE;
} }
bool bool8
cSampleManager::CheckForAnAudioFileOnCD(void) cSampleManager::CheckForAnAudioFileOnCD(void)
{ {
#if GTA_VERSION < GTA3_PC_STEAM && !defined(NO_CDCHECK) #if GTA_VERSION < GTA3_PC_STEAM && !defined(NO_CDCHECK)
@ -1316,13 +1316,13 @@ cSampleManager::CheckForAnAudioFileOnCD(void)
{ {
fclose(f); fclose(f);
return true; return TRUE;
} }
return false; return FALSE;
#else #else
return true; return TRUE;
#endif // #if GTA_VERSION < GTA3_PC_STEAM && !defined(NO_CDCHECK) #endif // #if GTA_VERSION < GTA3_PC_STEAM && !defined(NO_CDCHECK)
} }
@ -1415,48 +1415,48 @@ cSampleManager::SetMusicFadeVolume(uint8 nVolume)
} }
void void
cSampleManager::SetMonoMode(uint8 nMode) cSampleManager::SetMonoMode(bool8 nMode)
{ {
m_nMonoMode = nMode; m_nMonoMode = nMode;
} }
bool bool8
cSampleManager::LoadSampleBank(uint8 nBank) cSampleManager::LoadSampleBank(uint8 nBank)
{ {
if ( CTimer::GetIsCodePaused() ) if ( CTimer::GetIsCodePaused() )
return false; return FALSE;
if ( MusicManager.IsInitialised() if ( MusicManager.IsInitialised()
&& MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE && MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
&& nBank != SFX_BANK_0 ) && nBank != SFX_BANK_0 )
{ {
return false; return FALSE;
} }
if ( fseek(fpSampleDataHandle, nSampleBankDiscStartOffset[nBank], SEEK_SET) != 0 ) if ( fseek(fpSampleDataHandle, nSampleBankDiscStartOffset[nBank], SEEK_SET) != 0 )
return false; return FALSE;
if ( fread((void *)nSampleBankMemoryStartAddress[nBank], 1, nSampleBankSize[nBank],fpSampleDataHandle) != nSampleBankSize[nBank] ) if ( fread((void *)nSampleBankMemoryStartAddress[nBank], 1, nSampleBankSize[nBank],fpSampleDataHandle) != nSampleBankSize[nBank] )
return false; return FALSE;
bSampleBankLoaded[nBank] = true; bSampleBankLoaded[nBank] = TRUE;
return true; return TRUE;
} }
void void
cSampleManager::UnloadSampleBank(uint8 nBank) cSampleManager::UnloadSampleBank(uint8 nBank)
{ {
bSampleBankLoaded[nBank] = false; bSampleBankLoaded[nBank] = FALSE;
} }
bool bool8
cSampleManager::IsSampleBankLoaded(uint8 nBank) cSampleManager::IsSampleBankLoaded(uint8 nBank)
{ {
return bSampleBankLoaded[nBank]; return bSampleBankLoaded[nBank];
} }
bool bool8
cSampleManager::IsPedCommentLoaded(uint32 nComment) cSampleManager::IsPedCommentLoaded(uint32 nComment)
{ {
int8 slot; int8 slot;
@ -1469,10 +1469,10 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment)
slot += ARRAY_SIZE(nPedSlotSfx); slot += ARRAY_SIZE(nPedSlotSfx);
#endif #endif
if ( nComment == nPedSlotSfx[slot] ) if ( nComment == nPedSlotSfx[slot] )
return true; return TRUE;
} }
return false; return FALSE;
} }
int32 int32
@ -1494,11 +1494,11 @@ cSampleManager::_GetPedCommentSlot(uint32 nComment)
return -1; return -1;
} }
bool bool8
cSampleManager::LoadPedComment(uint32 nComment) cSampleManager::LoadPedComment(uint32 nComment)
{ {
if ( CTimer::GetIsCodePaused() ) if ( CTimer::GetIsCodePaused() )
return false; return FALSE;
// no talking peds during cutsenes or the game end // no talking peds during cutsenes or the game end
if ( MusicManager.IsInitialised() ) if ( MusicManager.IsInitialised() )
@ -1507,7 +1507,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
{ {
case MUSICMODE_CUTSCENE: case MUSICMODE_CUTSCENE:
{ {
return false; return FALSE;
break; break;
} }
@ -1515,7 +1515,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
case MUSICMODE_FRONTEND: case MUSICMODE_FRONTEND:
{ {
if ( MusicManager.GetNextTrack() == STREAMED_SOUND_GAME_COMPLETED ) if ( MusicManager.GetNextTrack() == STREAMED_SOUND_GAME_COMPLETED )
return false; return FALSE;
break; break;
} }
@ -1523,10 +1523,10 @@ cSampleManager::LoadPedComment(uint32 nComment)
} }
if ( fseek(fpSampleDataHandle, m_aSamples[nComment].nOffset, SEEK_SET) != 0 ) if ( fseek(fpSampleDataHandle, m_aSamples[nComment].nOffset, SEEK_SET) != 0 )
return false; return FALSE;
if ( fread((void *)(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE*nCurrentPedSlot), 1, m_aSamples[nComment].nSize, fpSampleDataHandle) != m_aSamples[nComment].nSize ) if ( fread((void *)(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE*nCurrentPedSlot), 1, m_aSamples[nComment].nSize, fpSampleDataHandle) != m_aSamples[nComment].nSize )
return false; return FALSE;
nPedSlotSfxAddr[nCurrentPedSlot] = nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE*nCurrentPedSlot; nPedSlotSfxAddr[nCurrentPedSlot] = nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE*nCurrentPedSlot;
nPedSlotSfx [nCurrentPedSlot] = nComment; nPedSlotSfx [nCurrentPedSlot] = nComment;
@ -1534,7 +1534,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
if ( ++nCurrentPedSlot >= MAX_PEDSFX ) if ( ++nCurrentPedSlot >= MAX_PEDSFX )
nCurrentPedSlot = 0; nCurrentPedSlot = 0;
return true; return TRUE;
} }
int32 int32
@ -1573,14 +1573,14 @@ cSampleManager::GetSampleLength(uint32 nSample)
return m_aSamples[nSample].nSize >> 1; return m_aSamples[nSample].nSize >> 1;
} }
bool bool8
cSampleManager::UpdateReverb(void) cSampleManager::UpdateReverb(void)
{ {
if ( !usingEAX ) if ( !usingEAX )
return false; return FALSE;
if ( AudioManager.GetFrameCounter() & 15 ) if ( AudioManager.GetFrameCounter() & 15 )
return false; return FALSE;
float y = AudioManager.GetReflectionsDistance(REFLECTION_TOP) + AudioManager.GetReflectionsDistance(REFLECTION_BOTTOM); float y = AudioManager.GetReflectionsDistance(REFLECTION_TOP) + AudioManager.GetReflectionsDistance(REFLECTION_BOTTOM);
float x = AudioManager.GetReflectionsDistance(REFLECTION_LEFT) + AudioManager.GetReflectionsDistance(REFLECTION_RIGHT); float x = AudioManager.GetReflectionsDistance(REFLECTION_LEFT) + AudioManager.GetReflectionsDistance(REFLECTION_RIGHT);
@ -1627,7 +1627,7 @@ cSampleManager::UpdateReverb(void)
fRatio = clamp(fRatio, usingEAX3==1 ? 0.0f : 0.30f, 1.0f); fRatio = clamp(fRatio, usingEAX3==1 ? 0.0f : 0.30f, 1.0f);
if ( fRatio == _fPrevEaxRatioDestination ) if ( fRatio == _fPrevEaxRatioDestination )
return false; return FALSE;
if ( usingEAX3 ) if ( usingEAX3 )
{ {
@ -1647,26 +1647,26 @@ cSampleManager::UpdateReverb(void)
_fPrevEaxRatioDestination = fRatio; _fPrevEaxRatioDestination = fRatio;
return true; return TRUE;
} }
void void
cSampleManager::SetChannelReverbFlag(uint32 nChannel, uint8 nReverbFlag) cSampleManager::SetChannelReverbFlag(uint32 nChannel, bool8 nReverbFlag)
{ {
bool b2d = false; bool8 b2d = FALSE;
switch ( nChannel ) switch ( nChannel )
{ {
case CHANNEL2D: case CHANNEL2D:
{ {
b2d = true; b2d = TRUE;
break; break;
} }
} }
if ( usingEAX ) if ( usingEAX )
{ {
if ( nReverbFlag != 0 ) if ( nReverbFlag != FALSE )
{ {
if ( !b2d ) if ( !b2d )
AIL_set_3D_sample_effects_level(opened_samples[nChannel], _fEffectsLevel); AIL_set_3D_sample_effects_level(opened_samples[nChannel], _fEffectsLevel);
@ -1679,16 +1679,16 @@ cSampleManager::SetChannelReverbFlag(uint32 nChannel, uint8 nReverbFlag)
} }
} }
bool bool8
cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank) cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
{ {
bool b2d = false; bool8 b2d = FALSE;
switch ( nChannel ) switch ( nChannel )
{ {
case CHANNEL2D: case CHANNEL2D:
{ {
b2d = true; b2d = TRUE;
break; break;
} }
} }
@ -1698,14 +1698,14 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
if ( nSfx < SAMPLEBANK_MAX ) if ( nSfx < SAMPLEBANK_MAX )
{ {
if ( !IsSampleBankLoaded(nBank) ) if ( !IsSampleBankLoaded(nBank) )
return false; return FALSE;
addr = nSampleBankMemoryStartAddress[nBank] + m_aSamples[nSfx].nOffset - m_aSamples[BankStartOffset[nBank]].nOffset; addr = nSampleBankMemoryStartAddress[nBank] + m_aSamples[nSfx].nOffset - m_aSamples[BankStartOffset[nBank]].nOffset;
} }
else else
{ {
if ( !IsPedCommentLoaded(nSfx) ) if ( !IsPedCommentLoaded(nSfx) )
return false; return FALSE;
int32 slot = _GetPedCommentSlot(nSfx); int32 slot = _GetPedCommentSlot(nSfx);
@ -1717,10 +1717,10 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
if ( opened_2dsamples[nChannel - MAXCHANNELS] ) if ( opened_2dsamples[nChannel - MAXCHANNELS] )
{ {
AIL_set_sample_address(opened_2dsamples[nChannel - MAXCHANNELS], (void *)addr, m_aSamples[nSfx].nSize); AIL_set_sample_address(opened_2dsamples[nChannel - MAXCHANNELS], (void *)addr, m_aSamples[nSfx].nSize);
return true; return TRUE;
} }
else else
return false; return FALSE;
} }
else else
{ {
@ -1736,10 +1736,10 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
if ( AIL_set_3D_sample_info(opened_samples[nChannel], &info) == 0 ) if ( AIL_set_3D_sample_info(opened_samples[nChannel], &info) == 0 )
{ {
OutputDebugString(AIL_last_error()); OutputDebugString(AIL_last_error());
return false; return FALSE;
} }
return true; return TRUE;
} }
} }
@ -1831,13 +1831,13 @@ cSampleManager::SetChannelPan(uint32 nChannel, uint32 nPan)
void void
cSampleManager::SetChannelFrequency(uint32 nChannel, uint32 nFreq) cSampleManager::SetChannelFrequency(uint32 nChannel, uint32 nFreq)
{ {
bool b2d = false; bool8 b2d = FALSE;
switch ( nChannel ) switch ( nChannel )
{ {
case CHANNEL2D: case CHANNEL2D:
{ {
b2d = true; b2d = TRUE;
break; break;
} }
} }
@ -1857,13 +1857,13 @@ cSampleManager::SetChannelFrequency(uint32 nChannel, uint32 nFreq)
void void
cSampleManager::SetChannelLoopPoints(uint32 nChannel, uint32 nLoopStart, int32 nLoopEnd) cSampleManager::SetChannelLoopPoints(uint32 nChannel, uint32 nLoopStart, int32 nLoopEnd)
{ {
bool b2d = false; bool8 b2d = FALSE;
switch ( nChannel ) switch ( nChannel )
{ {
case CHANNEL2D: case CHANNEL2D:
{ {
b2d = true; b2d = TRUE;
break; break;
} }
} }
@ -1883,13 +1883,13 @@ cSampleManager::SetChannelLoopPoints(uint32 nChannel, uint32 nLoopStart, int32 n
void void
cSampleManager::SetChannelLoopCount(uint32 nChannel, uint32 nLoopCount) cSampleManager::SetChannelLoopCount(uint32 nChannel, uint32 nLoopCount)
{ {
bool b2d = false; bool8 b2d = FALSE;
switch ( nChannel ) switch ( nChannel )
{ {
case CHANNEL2D: case CHANNEL2D:
{ {
b2d = true; b2d = TRUE;
break; break;
} }
} }
@ -1906,16 +1906,16 @@ cSampleManager::SetChannelLoopCount(uint32 nChannel, uint32 nLoopCount)
} }
} }
bool bool8
cSampleManager::GetChannelUsedFlag(uint32 nChannel) cSampleManager::GetChannelUsedFlag(uint32 nChannel)
{ {
bool b2d = false; bool8 b2d = FALSE;
switch ( nChannel ) switch ( nChannel )
{ {
case CHANNEL2D: case CHANNEL2D:
{ {
b2d = true; b2d = TRUE;
break; break;
} }
} }
@ -1925,14 +1925,14 @@ cSampleManager::GetChannelUsedFlag(uint32 nChannel)
if ( opened_2dsamples[nChannel - MAXCHANNELS] ) if ( opened_2dsamples[nChannel - MAXCHANNELS] )
return AIL_sample_status(opened_2dsamples[nChannel - MAXCHANNELS]) == SMP_PLAYING; return AIL_sample_status(opened_2dsamples[nChannel - MAXCHANNELS]) == SMP_PLAYING;
else else
return false; return FALSE;
} }
else else
{ {
if ( opened_samples[nChannel] ) if ( opened_samples[nChannel] )
return AIL_3D_sample_status(opened_samples[nChannel]) == SMP_PLAYING; return AIL_3D_sample_status(opened_samples[nChannel]) == SMP_PLAYING;
else else
return false; return FALSE;
} }
} }
@ -1940,13 +1940,13 @@ cSampleManager::GetChannelUsedFlag(uint32 nChannel)
void void
cSampleManager::StartChannel(uint32 nChannel) cSampleManager::StartChannel(uint32 nChannel)
{ {
bool b2d = false; bool8 b2d = FALSE;
switch ( nChannel ) switch ( nChannel )
{ {
case CHANNEL2D: case CHANNEL2D:
{ {
b2d = true; b2d = TRUE;
break; break;
} }
} }
@ -1966,13 +1966,13 @@ cSampleManager::StartChannel(uint32 nChannel)
void void
cSampleManager::StopChannel(uint32 nChannel) cSampleManager::StopChannel(uint32 nChannel)
{ {
bool b2d = false; bool8 b2d = FALSE;
switch ( nChannel ) switch ( nChannel )
{ {
case CHANNEL2D: case CHANNEL2D:
{ {
b2d = true; b2d = TRUE;
break; break;
} }
} }
@ -2024,12 +2024,12 @@ cSampleManager::PreloadStreamedFile(uint8 nFile, uint8 nStream)
} }
void void
cSampleManager::PauseStream(uint8 nPauseFlag, uint8 nStream) cSampleManager::PauseStream(bool8 nPauseFlag, uint8 nStream)
{ {
if ( m_bInitialised ) if ( m_bInitialised )
{ {
if ( mp3Stream[nStream] ) if ( mp3Stream[nStream] )
AIL_pause_stream(mp3Stream[nStream], nPauseFlag != 0); AIL_pause_stream(mp3Stream[nStream], nPauseFlag != FALSE);
} }
} }
@ -2043,7 +2043,7 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
} }
} }
bool bool8
cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
{ {
int i = 0; int i = 0;
@ -2051,7 +2051,7 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
char filename[MAX_PATH]; char filename[MAX_PATH];
if ( !m_bInitialised || nFile >= TOTAL_STREAMED_SOUNDS ) if ( !m_bInitialised || nFile >= TOTAL_STREAMED_SOUNDS )
return false; return FALSE;
if ( mp3Stream[nStream] ) if ( mp3Stream[nStream] )
{ {
@ -2081,9 +2081,9 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
AIL_set_stream_loop_count(mp3Stream[nStream], 1); AIL_set_stream_loop_count(mp3Stream[nStream], 1);
AIL_set_stream_ms_position(mp3Stream[nStream], position); AIL_set_stream_ms_position(mp3Stream[nStream], position);
AIL_pause_stream(mp3Stream[nStream], 0); AIL_pause_stream(mp3Stream[nStream], 0);
return true; return TRUE;
} }
return false; return FALSE;
} else { } else {
if ( e->pLinkPath != NULL ) if ( e->pLinkPath != NULL )
@ -2100,9 +2100,9 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
AIL_set_stream_ms_position(mp3Stream[nStream], position); AIL_set_stream_ms_position(mp3Stream[nStream], position);
AIL_pause_stream(mp3Stream[nStream], 0); AIL_pause_stream(mp3Stream[nStream], 0);
_bIsMp3Active = true; _bIsMp3Active = TRUE;
return true; return TRUE;
} }
// fall through, start playing from another song // fall through, start playing from another song
} }
@ -2128,9 +2128,9 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
AIL_set_stream_loop_count(mp3Stream[nStream], 1); AIL_set_stream_loop_count(mp3Stream[nStream], 1);
AIL_set_stream_ms_position(mp3Stream[nStream], position); AIL_set_stream_ms_position(mp3Stream[nStream], position);
AIL_pause_stream(mp3Stream[nStream], 0); AIL_pause_stream(mp3Stream[nStream], 0);
return true; return TRUE;
} }
return false; return FALSE;
} }
} }
if(mp3->pLinkPath != NULL) if(mp3->pLinkPath != NULL)
@ -2148,9 +2148,9 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
AIL_set_stream_ms_position(mp3Stream[nStream], 0); AIL_set_stream_ms_position(mp3Stream[nStream], 0);
AIL_pause_stream(mp3Stream[nStream], 0); AIL_pause_stream(mp3Stream[nStream], 0);
#ifdef FIX_BUGS #ifdef FIX_BUGS
_bIsMp3Active = true; _bIsMp3Active = TRUE;
#endif #endif
return true; return TRUE;
} }
} }
@ -2169,9 +2169,9 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
AIL_set_stream_loop_count(mp3Stream[nStream], 1); AIL_set_stream_loop_count(mp3Stream[nStream], 1);
AIL_set_stream_ms_position(mp3Stream[nStream], position); AIL_set_stream_ms_position(mp3Stream[nStream], position);
AIL_pause_stream(mp3Stream[nStream], 0); AIL_pause_stream(mp3Stream[nStream], 0);
return true; return TRUE;
} }
return false; return FALSE;
} }
void void
@ -2187,7 +2187,7 @@ cSampleManager::StopStreamedFile(uint8 nStream)
mp3Stream[nStream] = NULL; mp3Stream[nStream] = NULL;
if ( nStream == 0 ) if ( nStream == 0 )
_bIsMp3Active = false; _bIsMp3Active = FALSE;
} }
} }
} }
@ -2225,7 +2225,7 @@ cSampleManager::GetStreamedFilePosition(uint8 nStream)
} }
void void
cSampleManager::SetStreamedVolumeAndPan(uint8 nVolume, uint8 nPan, uint8 nEffectFlag, uint8 nStream) cSampleManager::SetStreamedVolumeAndPan(uint8 nVolume, uint8 nPan, bool8 nEffectFlag, uint8 nStream)
{ {
uint8 vol = nVolume; uint8 vol = nVolume;
@ -2258,7 +2258,7 @@ cSampleManager::GetStreamedFileLength(uint8 nStream)
return 0; return 0;
} }
bool bool8
cSampleManager::IsStreamPlaying(uint8 nStream) cSampleManager::IsStreamPlaying(uint8 nStream)
{ {
if ( m_bInitialised ) if ( m_bInitialised )
@ -2266,23 +2266,23 @@ cSampleManager::IsStreamPlaying(uint8 nStream)
if ( mp3Stream[nStream] ) if ( mp3Stream[nStream] )
{ {
if ( AIL_stream_status(mp3Stream[nStream]) == SMP_PLAYING ) if ( AIL_stream_status(mp3Stream[nStream]) == SMP_PLAYING )
return true; return TRUE;
else else
return false; return FALSE;
} }
} }
return false; return FALSE;
} }
bool bool8
cSampleManager::InitialiseSampleBanks(void) cSampleManager::InitialiseSampleBanks(void)
{ {
int32 nBank = SFX_BANK_0; int32 nBank = SFX_BANK_0;
fpSampleDescHandle = fopen(SampleBankDescFilename, "rb"); fpSampleDescHandle = fopen(SampleBankDescFilename, "rb");
if ( fpSampleDescHandle == NULL ) if ( fpSampleDescHandle == NULL )
return false; return FALSE;
fpSampleDataHandle = fopen(SampleBankDataFilename, "rb"); fpSampleDataHandle = fopen(SampleBankDataFilename, "rb");
if ( fpSampleDataHandle == NULL ) if ( fpSampleDataHandle == NULL )
@ -2290,7 +2290,7 @@ cSampleManager::InitialiseSampleBanks(void)
fclose(fpSampleDescHandle); fclose(fpSampleDescHandle);
fpSampleDescHandle = NULL; fpSampleDescHandle = NULL;
return false; return FALSE;
} }
fseek(fpSampleDataHandle, 0, SEEK_END); fseek(fpSampleDataHandle, 0, SEEK_END);
@ -2317,7 +2317,7 @@ cSampleManager::InitialiseSampleBanks(void)
nSampleBankSize[SFX_BANK_0] = nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS] - nSampleBankDiscStartOffset[SFX_BANK_0]; nSampleBankSize[SFX_BANK_0] = nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS] - nSampleBankDiscStartOffset[SFX_BANK_0];
nSampleBankSize[SFX_BANK_PED_COMMENTS] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS]; nSampleBankSize[SFX_BANK_PED_COMMENTS] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS];
return true; return TRUE;
} }
#endif #endif

View file

@ -4,7 +4,7 @@
#include "AudioManager.h" #include "AudioManager.h"
cSampleManager SampleManager; cSampleManager SampleManager;
bool _bSampmanInitialised = false; bool8 _bSampmanInitialised = FALSE;
uint32 BankStartOffset[MAX_SFX_BANKS]; uint32 BankStartOffset[MAX_SFX_BANKS];
uint32 nNumMP3s; uint32 nNumMP3s;
@ -60,7 +60,7 @@ int8 cSampleManager::SetCurrent3DProvider(uint8 nProvider)
return 0; return 0;
} }
bool bool8
cSampleManager::IsMP3RadioChannelAvailable(void) cSampleManager::IsMP3RadioChannelAvailable(void)
{ {
return nNumMP3s != 0; return nNumMP3s != 0;
@ -75,10 +75,10 @@ void cSampleManager::ReacquireDigitalHandle(void)
{ {
} }
bool bool8
cSampleManager::Initialise(void) cSampleManager::Initialise(void)
{ {
return true; return TRUE;
} }
void void
@ -87,9 +87,9 @@ cSampleManager::Terminate(void)
} }
bool cSampleManager::CheckForAnAudioFileOnCD(void) bool8 cSampleManager::CheckForAnAudioFileOnCD(void)
{ {
return true; return TRUE;
} }
char cSampleManager::GetCDAudioDriveLetter(void) char cSampleManager::GetCDAudioDriveLetter(void)
@ -128,11 +128,11 @@ cSampleManager::SetMonoMode(uint8 nMode)
{ {
} }
bool bool8
cSampleManager::LoadSampleBank(uint8 nBank) cSampleManager::LoadSampleBank(uint8 nBank)
{ {
ASSERT( nBank < MAX_SFX_BANKS ); ASSERT( nBank < MAX_SFX_BANKS );
return false; return FALSE;
} }
void void
@ -141,20 +141,20 @@ cSampleManager::UnloadSampleBank(uint8 nBank)
ASSERT( nBank < MAX_SFX_BANKS ); ASSERT( nBank < MAX_SFX_BANKS );
} }
bool bool8
cSampleManager::IsSampleBankLoaded(uint8 nBank) cSampleManager::IsSampleBankLoaded(uint8 nBank)
{ {
ASSERT( nBank < MAX_SFX_BANKS ); ASSERT( nBank < MAX_SFX_BANKS );
return false; return FALSE;
} }
bool bool8
cSampleManager::IsPedCommentLoaded(uint32 nComment) cSampleManager::IsPedCommentLoaded(uint32 nComment)
{ {
ASSERT( nComment < TOTAL_AUDIO_SAMPLES ); ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
return false; return FALSE;
} }
@ -164,11 +164,11 @@ cSampleManager::_GetPedCommentSlot(uint32 nComment)
return -1; return -1;
} }
bool bool8
cSampleManager::LoadPedComment(uint32 nComment) cSampleManager::LoadPedComment(uint32 nComment)
{ {
ASSERT( nComment < TOTAL_AUDIO_SAMPLES ); ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
return false; return FALSE;
} }
int32 int32
@ -205,22 +205,22 @@ cSampleManager::GetSampleLength(uint32 nSample)
return 0; return 0;
} }
bool cSampleManager::UpdateReverb(void) bool8 cSampleManager::UpdateReverb(void)
{ {
return false; return FALSE;
} }
void void
cSampleManager::SetChannelReverbFlag(uint32 nChannel, uint8 nReverbFlag) cSampleManager::SetChannelReverbFlag(uint32 nChannel, bool8 nReverbFlag)
{ {
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS ); ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
} }
bool bool8
cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank) cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
{ {
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS ); ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
return false; return FALSE;
} }
void void
@ -276,12 +276,12 @@ cSampleManager::SetChannelLoopCount(uint32 nChannel, uint32 nLoopCount)
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS ); ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
} }
bool bool8
cSampleManager::GetChannelUsedFlag(uint32 nChannel) cSampleManager::GetChannelUsedFlag(uint32 nChannel)
{ {
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS ); ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
return false; return FALSE;
} }
void void
@ -303,7 +303,7 @@ cSampleManager::PreloadStreamedFile(uint8 nFile, uint8 nStream)
} }
void void
cSampleManager::PauseStream(uint8 nPauseFlag, uint8 nStream) cSampleManager::PauseStream(bool8 nPauseFlag, uint8 nStream)
{ {
ASSERT( nStream < MAX_STREAMS ); ASSERT( nStream < MAX_STREAMS );
} }
@ -314,12 +314,12 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
ASSERT( nStream < MAX_STREAMS ); ASSERT( nStream < MAX_STREAMS );
} }
bool bool8
cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
{ {
ASSERT( nStream < MAX_STREAMS ); ASSERT( nStream < MAX_STREAMS );
return false; return FALSE;
} }
void void
@ -350,19 +350,19 @@ cSampleManager::GetStreamedFileLength(uint8 nStream)
return 1; return 1;
} }
bool bool8
cSampleManager::IsStreamPlaying(uint8 nStream) cSampleManager::IsStreamPlaying(uint8 nStream)
{ {
ASSERT( nStream < MAX_STREAMS ); ASSERT( nStream < MAX_STREAMS );
return false; return FALSE;
} }
bool bool8
cSampleManager::InitialiseSampleBanks(void) cSampleManager::InitialiseSampleBanks(void)
{ {
return true; return TRUE;
} }
#endif #endif

View file

@ -48,7 +48,7 @@
//TODO: max channels //TODO: max channels
cSampleManager SampleManager; cSampleManager SampleManager;
bool _bSampmanInitialised = false; bool8 _bSampmanInitialised = FALSE;
uint32 BankStartOffset[MAX_SFX_BANKS]; uint32 BankStartOffset[MAX_SFX_BANKS];
@ -84,7 +84,7 @@ OggOpusFile *fpSampleDataHandle;
#else #else
FILE *fpSampleDataHandle; FILE *fpSampleDataHandle;
#endif #endif
bool bSampleBankLoaded [MAX_SFX_BANKS]; bool8 bSampleBankLoaded [MAX_SFX_BANKS];
int32 nSampleBankDiscStartOffset [MAX_SFX_BANKS]; int32 nSampleBankDiscStartOffset [MAX_SFX_BANKS];
int32 nSampleBankSize [MAX_SFX_BANKS]; int32 nSampleBankSize [MAX_SFX_BANKS];
uintptr nSampleBankMemoryStartAddress[MAX_SFX_BANKS]; uintptr nSampleBankMemoryStartAddress[MAX_SFX_BANKS];
@ -120,7 +120,7 @@ uint8 nStreamPan [MAX_STREAMS];
uint8 nStreamVolume[MAX_STREAMS]; uint8 nStreamVolume[MAX_STREAMS];
uint32 _CurMP3Index; uint32 _CurMP3Index;
int32 _CurMP3Pos; int32 _CurMP3Pos;
bool _bIsMp3Active; bool8 _bIsMp3Active;
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////
// Env Size Diffus Room RoomHF RoomLF DecTm DcHF DcLF Refl RefDel Ref Pan Revb RevDel Rev Pan EchTm EchDp ModTm ModDp AirAbs HFRef LFRef RRlOff FLAGS // Env Size Diffus Room RoomHF RoomLF DecTm DcHF DcLF Refl RefDel Ref Pan Revb RevDel Rev Pan EchTm EchDp ModTm ModDp AirAbs HFRef LFRef RRlOff FLAGS
EAXLISTENERPROPERTIES StartEAX3 = EAXLISTENERPROPERTIES StartEAX3 =
@ -265,11 +265,11 @@ release_existing()
DEV("release_existing()\n"); DEV("release_existing()\n");
} }
static bool static bool8
set_new_provider(int index) set_new_provider(int index)
{ {
if ( curprovider == index ) if ( curprovider == index )
return true; return TRUE;
curprovider = index; curprovider = index;
@ -301,7 +301,7 @@ set_new_provider(int index)
{ {
curprovider=-1; curprovider=-1;
release_existing(); release_existing();
return false; return FALSE;
} }
alListenerf (AL_GAIN, 1.0f); alListenerf (AL_GAIN, 1.0f);
@ -382,13 +382,13 @@ set_new_provider(int index)
aChannel[i].SetReverbMix(ALEffectSlot, 0.0f); aChannel[i].SetReverbMix(ALEffectSlot, 0.0f);
} }
return true; return TRUE;
} }
return false; return FALSE;
} }
static bool static bool8
IsThisTrackAt16KHz(uint32 track) IsThisTrackAt16KHz(uint32 track)
{ {
return track == STREAMED_SOUND_RADIO_CHAT; return track == STREAMED_SOUND_RADIO_CHAT;
@ -456,13 +456,13 @@ int8 cSampleManager::SetCurrent3DProvider(uint8 nProvider)
return curprovider; return curprovider;
} }
static bool static bool8
_ResolveLink(char const *path, char *out) _ResolveLink(char const *path, char *out)
{ {
#ifdef _WIN32 #ifdef _WIN32
size_t len = strlen(path); size_t len = strlen(path);
if (len < 4 || strcmp(&path[len - 4], ".lnk") != 0) if (len < 4 || strcmp(&path[len - 4], ".lnk") != 0)
return false; return FALSE;
IShellLink* psl; IShellLink* psl;
WIN32_FIND_DATA fd; WIN32_FIND_DATA fd;
@ -497,7 +497,7 @@ _ResolveLink(char const *path, char *out)
ppf->Release(); ppf->Release();
psl->Release(); psl->Release();
#endif #endif
return true; return TRUE;
} }
} }
} }
@ -507,31 +507,31 @@ _ResolveLink(char const *path, char *out)
psl->Release(); psl->Release();
} }
return false; return FALSE;
#else #else
struct stat sb; struct stat sb;
if (lstat(path, &sb) == -1) { if (lstat(path, &sb) == -1) {
perror("lstat: "); perror("lstat: ");
return false; return FALSE;
} }
if (S_ISLNK(sb.st_mode)) { if (S_ISLNK(sb.st_mode)) {
char* linkname = (char*)alloca(sb.st_size + 1); char* linkname = (char*)alloca(sb.st_size + 1);
if (linkname == NULL) { if (linkname == NULL) {
fprintf(stderr, "insufficient memory\n"); fprintf(stderr, "insufficient memory\n");
return false; return FALSE;
} }
if (readlink(path, linkname, sb.st_size + 1) < 0) { if (readlink(path, linkname, sb.st_size + 1) < 0) {
perror("readlink: "); perror("readlink: ");
return false; return FALSE;
} }
linkname[sb.st_size] = '\0'; linkname[sb.st_size] = '\0';
strcpy(out, linkname); strcpy(out, linkname);
return true; return TRUE;
} else { } else {
return false; return FALSE;
} }
#endif #endif
} }
@ -540,8 +540,8 @@ static void
_FindMP3s(void) _FindMP3s(void)
{ {
tMP3Entry *pList; tMP3Entry *pList;
bool bShortcut; bool8 bShortcut;
bool bInitFirstEntry; bool8 bInitFirstEntry;
HANDLE hFind; HANDLE hFind;
char path[MAX_PATH]; char path[MAX_PATH];
char filepath[MAX_PATH*2]; char filepath[MAX_PATH*2];
@ -584,9 +584,9 @@ _FindMP3s(void)
{ {
OutputDebugString("Resolving Link"); OutputDebugString("Resolving Link");
OutputDebugString(filepath); OutputDebugString(filepath);
bShortcut = true; bShortcut = TRUE;
} else } else
bShortcut = false; bShortcut = FALSE;
aStream[0] = new CStream(filepath, ALStreamSources[0], ALStreamBuffers[0]); aStream[0] = new CStream(filepath, ALStreamSources[0], ALStreamBuffers[0]);
@ -626,7 +626,7 @@ _FindMP3s(void)
_pMP3List->pLinkPath = NULL; _pMP3List->pLinkPath = NULL;
} }
bInitFirstEntry = false; bInitFirstEntry = FALSE;
} }
else else
{ {
@ -634,10 +634,10 @@ _FindMP3s(void)
OutputDebugString(filepath); OutputDebugString(filepath);
bInitFirstEntry = true; bInitFirstEntry = TRUE;
} }
while ( true ) while ( TRUE )
{ {
if ( !FindNextFile(hFind, &fd) ) if ( !FindNextFile(hFind, &fd) )
break; break;
@ -655,9 +655,9 @@ _FindMP3s(void)
{ {
OutputDebugString("Resolving Link"); OutputDebugString("Resolving Link");
OutputDebugString(filepath); OutputDebugString(filepath);
bShortcut = true; bShortcut = TRUE;
} else { } else {
bShortcut = false; bShortcut = FALSE;
if (filepathlen > MAX_PATH) { if (filepathlen > MAX_PATH) {
continue; continue;
} }
@ -696,7 +696,7 @@ _FindMP3s(void)
pList = _pMP3List; pList = _pMP3List;
bInitFirstEntry = false; bInitFirstEntry = FALSE;
} }
else else
{ {
@ -718,9 +718,9 @@ _FindMP3s(void)
{ {
OutputDebugString("Resolving Link"); OutputDebugString("Resolving Link");
OutputDebugString(filepath); OutputDebugString(filepath);
bShortcut = true; bShortcut = TRUE;
} else } else
bShortcut = false; bShortcut = FALSE;
aStream[0] = new CStream(filepath, ALStreamSources[0], ALStreamBuffers[0]); aStream[0] = new CStream(filepath, ALStreamSources[0], ALStreamBuffers[0]);
@ -830,7 +830,7 @@ _GetMP3EntryByIndex(uint32 idx)
return NULL; return NULL;
} }
static inline bool static inline bool8
_GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry) _GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
{ {
_CurMP3Index = 0; _CurMP3Index = 0;
@ -843,7 +843,7 @@ _GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
*pPosition -= (*pEntry)->nTrackStreamPos; *pPosition -= (*pEntry)->nTrackStreamPos;
_CurMP3Pos = *pPosition; _CurMP3Pos = *pPosition;
return true; return TRUE;
} }
_CurMP3Index++; _CurMP3Index++;
@ -854,10 +854,10 @@ _GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
_CurMP3Pos = 0; _CurMP3Pos = 0;
_CurMP3Index = 0; _CurMP3Index = 0;
return false; return FALSE;
} }
bool bool8
cSampleManager::IsMP3RadioChannelAvailable(void) cSampleManager::IsMP3RadioChannelAvailable(void)
{ {
return nNumMP3s != 0; return nNumMP3s != 0;
@ -883,11 +883,11 @@ void cSampleManager::ReacquireDigitalHandle(void)
} }
} }
bool bool8
cSampleManager::Initialise(void) cSampleManager::Initialise(void)
{ {
if ( _bSampmanInitialised ) if ( _bSampmanInitialised )
return true; return TRUE;
EFXInit(); EFXInit();
CStream::Initialise(); CStream::Initialise();
@ -932,7 +932,7 @@ cSampleManager::Initialise(void)
for ( int32 i = 0; i < MAX_SFX_BANKS; i++ ) for ( int32 i = 0; i < MAX_SFX_BANKS; i++ )
{ {
bSampleBankLoaded[i] = false; bSampleBankLoaded[i] = FALSE;
nSampleBankDiscStartOffset[i] = 0; nSampleBankDiscStartOffset[i] = 0;
nSampleBankSize[i] = 0; nSampleBankSize[i] = 0;
nSampleBankMemoryStartAddress[i] = 0; nSampleBankMemoryStartAddress[i] = 0;
@ -1000,7 +1000,7 @@ cSampleManager::Initialise(void)
if ( !InitialiseSampleBanks() ) if ( !InitialiseSampleBanks() )
{ {
Terminate(); Terminate();
return false; return FALSE;
} }
nSampleBankMemoryStartAddress[SFX_BANK_0] = (uintptr)malloc(nSampleBankSize[SFX_BANK_0]); nSampleBankMemoryStartAddress[SFX_BANK_0] = (uintptr)malloc(nSampleBankSize[SFX_BANK_0]);
@ -1009,7 +1009,7 @@ cSampleManager::Initialise(void)
if ( nSampleBankMemoryStartAddress[SFX_BANK_0] == 0 ) if ( nSampleBankMemoryStartAddress[SFX_BANK_0] == 0 )
{ {
Terminate(); Terminate();
return false; return FALSE;
} }
nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] = (uintptr)malloc(PED_BLOCKSIZE*MAX_PEDSFX); nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] = (uintptr)malloc(PED_BLOCKSIZE*MAX_PEDSFX);
@ -1028,7 +1028,7 @@ cSampleManager::Initialise(void)
} }
{ {
_bSampmanInitialised = true; _bSampmanInitialised = TRUE;
if ( defaultProvider >= 0 && defaultProvider < m_nNumberOfProviders ) if ( defaultProvider >= 0 && defaultProvider < m_nNumberOfProviders )
{ {
@ -1037,7 +1037,7 @@ cSampleManager::Initialise(void)
else else
{ {
Terminate(); Terminate();
return false; return FALSE;
} }
} }
@ -1060,13 +1060,13 @@ cSampleManager::Initialise(void)
time_t t = time(NULL); time_t t = time(NULL);
tm *localtm; tm *localtm;
bool bUseRandomTable; bool8 bUseRandomTable;
if ( t == -1 ) if ( t == -1 )
bUseRandomTable = true; bUseRandomTable = TRUE;
else else
{ {
bUseRandomTable = false; bUseRandomTable = FALSE;
localtm = localtime(&t); localtm = localtime(&t);
} }
@ -1098,10 +1098,10 @@ cSampleManager::Initialise(void)
else else
_CurMP3Pos = 0; _CurMP3Pos = 0;
_bIsMp3Active = false; _bIsMp3Active = FALSE;
} }
return true; return TRUE;
} }
void void
@ -1135,12 +1135,12 @@ cSampleManager::Terminate(void)
nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] = 0; nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] = 0;
} }
_bSampmanInitialised = false; _bSampmanInitialised = FALSE;
} }
bool cSampleManager::CheckForAnAudioFileOnCD(void) bool8 cSampleManager::CheckForAnAudioFileOnCD(void)
{ {
return true; return TRUE;
} }
char cSampleManager::GetCDAudioDriveLetter(void) char cSampleManager::GetCDAudioDriveLetter(void)
@ -1196,19 +1196,19 @@ cSampleManager::SetMonoMode(uint8 nMode)
m_nMonoMode = nMode; m_nMonoMode = nMode;
} }
bool bool8
cSampleManager::LoadSampleBank(uint8 nBank) cSampleManager::LoadSampleBank(uint8 nBank)
{ {
ASSERT( nBank < MAX_SFX_BANKS); ASSERT( nBank < MAX_SFX_BANKS);
if ( CTimer::GetIsCodePaused() ) if ( CTimer::GetIsCodePaused() )
return false; return FALSE;
if ( MusicManager.IsInitialised() if ( MusicManager.IsInitialised()
&& MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE && MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
&& nBank != SFX_BANK_0 ) && nBank != SFX_BANK_0 )
{ {
return false; return FALSE;
} }
#ifdef OPUS_SFX #ifdef OPUS_SFX
@ -1227,14 +1227,14 @@ cSampleManager::LoadSampleBank(uint8 nBank)
} }
#else #else
if ( fseek(fpSampleDataHandle, nSampleBankDiscStartOffset[nBank], SEEK_SET) != 0 ) if ( fseek(fpSampleDataHandle, nSampleBankDiscStartOffset[nBank], SEEK_SET) != 0 )
return false; return FALSE;
if ( fread((void *)nSampleBankMemoryStartAddress[nBank], 1, nSampleBankSize[nBank], fpSampleDataHandle) != nSampleBankSize[nBank] ) if ( fread((void *)nSampleBankMemoryStartAddress[nBank], 1, nSampleBankSize[nBank], fpSampleDataHandle) != nSampleBankSize[nBank] )
return false; return FALSE;
#endif #endif
bSampleBankLoaded[nBank] = true; bSampleBankLoaded[nBank] = TRUE;
return true; return TRUE;
} }
void void
@ -1242,10 +1242,10 @@ cSampleManager::UnloadSampleBank(uint8 nBank)
{ {
ASSERT( nBank < MAX_SFX_BANKS); ASSERT( nBank < MAX_SFX_BANKS);
bSampleBankLoaded[nBank] = false; bSampleBankLoaded[nBank] = FALSE;
} }
bool bool8
cSampleManager::IsSampleBankLoaded(uint8 nBank) cSampleManager::IsSampleBankLoaded(uint8 nBank)
{ {
ASSERT( nBank < MAX_SFX_BANKS); ASSERT( nBank < MAX_SFX_BANKS);
@ -1253,7 +1253,7 @@ cSampleManager::IsSampleBankLoaded(uint8 nBank)
return bSampleBankLoaded[nBank]; return bSampleBankLoaded[nBank];
} }
bool bool8
cSampleManager::IsPedCommentLoaded(uint32 nComment) cSampleManager::IsPedCommentLoaded(uint32 nComment)
{ {
ASSERT( nComment < TOTAL_AUDIO_SAMPLES ); ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
@ -1268,10 +1268,10 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment)
slot += ARRAY_SIZE(nPedSlotSfx); slot += ARRAY_SIZE(nPedSlotSfx);
#endif #endif
if ( nComment == nPedSlotSfx[slot] ) if ( nComment == nPedSlotSfx[slot] )
return true; return TRUE;
} }
return false; return FALSE;
} }
@ -1294,13 +1294,13 @@ cSampleManager::_GetPedCommentSlot(uint32 nComment)
return -1; return -1;
} }
bool bool8
cSampleManager::LoadPedComment(uint32 nComment) cSampleManager::LoadPedComment(uint32 nComment)
{ {
ASSERT( nComment < TOTAL_AUDIO_SAMPLES ); ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
if ( CTimer::GetIsCodePaused() ) if ( CTimer::GetIsCodePaused() )
return false; return FALSE;
// no talking peds during cutsenes or the game end // no talking peds during cutsenes or the game end
if ( MusicManager.IsInitialised() ) if ( MusicManager.IsInitialised() )
@ -1309,7 +1309,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
{ {
case MUSICMODE_CUTSCENE: case MUSICMODE_CUTSCENE:
{ {
return false; return FALSE;
break; break;
} }
@ -1317,7 +1317,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
case MUSICMODE_FRONTEND: case MUSICMODE_FRONTEND:
{ {
if ( MusicManager.GetNextTrack() == STREAMED_SOUND_GAME_COMPLETED ) if ( MusicManager.GetNextTrack() == STREAMED_SOUND_GAME_COMPLETED )
return false; return FALSE;
break; break;
} }
@ -1332,17 +1332,17 @@ cSampleManager::LoadPedComment(uint32 nComment)
int size = op_read(fpSampleDataHandle, (opus_int16 *)(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE * nCurrentPedSlot + samplesRead), int size = op_read(fpSampleDataHandle, (opus_int16 *)(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE * nCurrentPedSlot + samplesRead),
samplesSize, NULL); samplesSize, NULL);
if (size <= 0) { if (size <= 0) {
return false; return FALSE;
} }
samplesRead += size * 2; samplesRead += size * 2;
samplesSize -= size; samplesSize -= size;
} }
#else #else
if ( fseek(fpSampleDataHandle, m_aSamples[nComment].nOffset, SEEK_SET) != 0 ) if ( fseek(fpSampleDataHandle, m_aSamples[nComment].nOffset, SEEK_SET) != 0 )
return false; return FALSE;
if ( fread((void *)(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE*nCurrentPedSlot), 1, m_aSamples[nComment].nSize, fpSampleDataHandle) != m_aSamples[nComment].nSize ) if ( fread((void *)(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE*nCurrentPedSlot), 1, m_aSamples[nComment].nSize, fpSampleDataHandle) != m_aSamples[nComment].nSize )
return false; return FALSE;
#endif #endif
nPedSlotSfx[nCurrentPedSlot] = nComment; nPedSlotSfx[nCurrentPedSlot] = nComment;
@ -1350,7 +1350,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
if ( ++nCurrentPedSlot >= MAX_PEDSFX ) if ( ++nCurrentPedSlot >= MAX_PEDSFX )
nCurrentPedSlot = 0; nCurrentPedSlot = 0;
return true; return TRUE;
} }
int32 int32
@ -1393,13 +1393,13 @@ cSampleManager::GetSampleLength(uint32 nSample)
return m_aSamples[nSample].nSize / sizeof(uint16); return m_aSamples[nSample].nSize / sizeof(uint16);
} }
bool cSampleManager::UpdateReverb(void) bool8 cSampleManager::UpdateReverb(void)
{ {
if ( !usingEAX && !_usingEFX ) if ( !usingEAX && !_usingEFX )
return false; return FALSE;
if ( AudioManager.GetFrameCounter() & 15 ) if ( AudioManager.GetFrameCounter() & 15 )
return false; return FALSE;
float y = AudioManager.GetReflectionsDistance(REFLECTION_TOP) + AudioManager.GetReflectionsDistance(REFLECTION_BOTTOM); float y = AudioManager.GetReflectionsDistance(REFLECTION_TOP) + AudioManager.GetReflectionsDistance(REFLECTION_BOTTOM);
float x = AudioManager.GetReflectionsDistance(REFLECTION_LEFT) + AudioManager.GetReflectionsDistance(REFLECTION_RIGHT); float x = AudioManager.GetReflectionsDistance(REFLECTION_LEFT) + AudioManager.GetReflectionsDistance(REFLECTION_RIGHT);
@ -1420,7 +1420,7 @@ bool cSampleManager::UpdateReverb(void)
fRatio = clamp(fRatio, usingEAX3==1 ? 0.0f : 0.30f, 1.0f); fRatio = clamp(fRatio, usingEAX3==1 ? 0.0f : 0.30f, 1.0f);
if ( fRatio == _fPrevEaxRatioDestination ) if ( fRatio == _fPrevEaxRatioDestination )
return false; return FALSE;
#ifdef JUICY_OAL #ifdef JUICY_OAL
if ( usingEAX3 || _usingEFX ) if ( usingEAX3 || _usingEFX )
@ -1455,11 +1455,11 @@ bool cSampleManager::UpdateReverb(void)
_fPrevEaxRatioDestination = fRatio; _fPrevEaxRatioDestination = fRatio;
return true; return TRUE;
} }
void void
cSampleManager::SetChannelReverbFlag(uint32 nChannel, uint8 nReverbFlag) cSampleManager::SetChannelReverbFlag(uint32 nChannel, bool8 nReverbFlag)
{ {
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS ); ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
@ -1469,7 +1469,7 @@ cSampleManager::SetChannelReverbFlag(uint32 nChannel, uint8 nReverbFlag)
{ {
alAuxiliaryEffectSloti(ALEffectSlot, AL_EFFECTSLOT_EFFECT, ALEffect); alAuxiliaryEffectSloti(ALEffectSlot, AL_EFFECTSLOT_EFFECT, ALEffect);
if ( nReverbFlag != 0 ) if ( nReverbFlag != FALSE )
aChannel[nChannel].SetReverbMix(ALEffectSlot, _fEffectsLevel); aChannel[nChannel].SetReverbMix(ALEffectSlot, _fEffectsLevel);
else else
aChannel[nChannel].SetReverbMix(ALEffectSlot, 0.0f); aChannel[nChannel].SetReverbMix(ALEffectSlot, 0.0f);
@ -1477,7 +1477,7 @@ cSampleManager::SetChannelReverbFlag(uint32 nChannel, uint8 nReverbFlag)
} }
} }
bool bool8
cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank) cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
{ {
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS ); ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
@ -1487,14 +1487,14 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
if ( nSfx < SAMPLEBANK_MAX ) if ( nSfx < SAMPLEBANK_MAX )
{ {
if ( !IsSampleBankLoaded(nBank) ) if ( !IsSampleBankLoaded(nBank) )
return false; return FALSE;
addr = nSampleBankMemoryStartAddress[nBank] + m_aSamples[nSfx].nOffset - m_aSamples[BankStartOffset[nBank]].nOffset; addr = nSampleBankMemoryStartAddress[nBank] + m_aSamples[nSfx].nOffset - m_aSamples[BankStartOffset[nBank]].nOffset;
} }
else else
{ {
if ( !IsPedCommentLoaded(nSfx) ) if ( !IsPedCommentLoaded(nSfx) )
return false; return FALSE;
int32 slot = _GetPedCommentSlot(nSfx); int32 slot = _GetPedCommentSlot(nSfx);
addr = (nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE * slot); addr = (nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE * slot);
@ -1512,10 +1512,10 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
aChannel[nChannel].SetSampleData ((void*)addr, m_aSamples[nSfx].nSize, m_aSamples[nSfx].nFrequency); aChannel[nChannel].SetSampleData ((void*)addr, m_aSamples[nSfx].nSize, m_aSamples[nSfx].nFrequency);
aChannel[nChannel].SetLoopPoints (0, -1); aChannel[nChannel].SetLoopPoints (0, -1);
aChannel[nChannel].SetPitch (1.0f); aChannel[nChannel].SetPitch (1.0f);
return true; return TRUE;
} }
return false; return FALSE;
} }
void void
@ -1619,7 +1619,7 @@ cSampleManager::SetChannelLoopCount(uint32 nChannel, uint32 nLoopCount)
aChannel[nChannel].SetLoopCount(nLoopCount); aChannel[nChannel].SetLoopCount(nLoopCount);
} }
bool bool8
cSampleManager::GetChannelUsedFlag(uint32 nChannel) cSampleManager::GetChannelUsedFlag(uint32 nChannel)
{ {
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS ); ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
@ -1673,7 +1673,7 @@ cSampleManager::PreloadStreamedFile(uint8 nFile, uint8 nStream)
} }
void void
cSampleManager::PauseStream(uint8 nPauseFlag, uint8 nStream) cSampleManager::PauseStream(bool8 nPauseFlag, uint8 nStream)
{ {
ASSERT( nStream < MAX_STREAMS ); ASSERT( nStream < MAX_STREAMS );
@ -1681,7 +1681,7 @@ cSampleManager::PauseStream(uint8 nPauseFlag, uint8 nStream)
if ( stream ) if ( stream )
{ {
stream->SetPause(nPauseFlag != 0); stream->SetPause(nPauseFlag != FALSE);
} }
} }
@ -1701,7 +1701,7 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
} }
} }
bool bool8
cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream) cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
{ {
int i = 0; int i = 0;
@ -1709,7 +1709,7 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
char filename[MAX_PATH]; char filename[MAX_PATH];
if ( nFile >= TOTAL_STREAMED_SOUNDS ) if ( nFile >= TOTAL_STREAMED_SOUNDS )
return false; return FALSE;
if ( aStream[nStream] ) if ( aStream[nStream] )
{ {
@ -1742,12 +1742,12 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
stream->Start(); stream->Start();
return true; return TRUE;
} else { } else {
delete stream; delete stream;
aStream[nStream] = NULL; aStream[nStream] = NULL;
} }
return false; return FALSE;
} else { } else {
if ( e->pLinkPath != NULL ) if ( e->pLinkPath != NULL )
@ -1765,8 +1765,8 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
aStream[nStream]->Start(); aStream[nStream]->Start();
_bIsMp3Active = true; _bIsMp3Active = TRUE;
return true; return TRUE;
} else { } else {
delete aStream[nStream]; delete aStream[nStream];
aStream[nStream] = NULL; aStream[nStream] = NULL;
@ -1798,12 +1798,12 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
stream->Start(); stream->Start();
return true; return TRUE;
} else { } else {
delete stream; delete stream;
aStream[nStream] = NULL; aStream[nStream] = NULL;
} }
return false; return FALSE;
} }
} }
if(mp3->pLinkPath != NULL) if(mp3->pLinkPath != NULL)
@ -1818,9 +1818,9 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
if (aStream[nStream]->Setup()) { if (aStream[nStream]->Setup()) {
aStream[nStream]->Start(); aStream[nStream]->Start();
#ifdef FIX_BUGS #ifdef FIX_BUGS
_bIsMp3Active = true; _bIsMp3Active = TRUE;
#endif #endif
return true; return TRUE;
} else { } else {
delete aStream[nStream]; delete aStream[nStream];
aStream[nStream] = NULL; aStream[nStream] = NULL;
@ -1845,12 +1845,12 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
stream->Start(); stream->Start();
return true; return TRUE;
} else { } else {
delete stream; delete stream;
aStream[nStream] = NULL; aStream[nStream] = NULL;
} }
return false; return FALSE;
} }
void void
@ -1866,7 +1866,7 @@ cSampleManager::StopStreamedFile(uint8 nStream)
aStream[nStream] = NULL; aStream[nStream] = NULL;
if ( nStream == 0 ) if ( nStream == 0 )
_bIsMp3Active = false; _bIsMp3Active = FALSE;
} }
} }
@ -1934,7 +1934,7 @@ cSampleManager::GetStreamedFileLength(uint8 nStream)
return nStreamLength[nStream]; return nStreamLength[nStream];
} }
bool bool8
cSampleManager::IsStreamPlaying(uint8 nStream) cSampleManager::IsStreamPlaying(uint8 nStream)
{ {
ASSERT( nStream < MAX_STREAMS ); ASSERT( nStream < MAX_STREAMS );
@ -1944,10 +1944,10 @@ cSampleManager::IsStreamPlaying(uint8 nStream)
if ( stream ) if ( stream )
{ {
if ( stream->IsPlaying() ) if ( stream->IsPlaying() )
return true; return TRUE;
} }
return false; return FALSE;
} }
void void
@ -1968,14 +1968,14 @@ cSampleManager::Service(void)
} }
} }
bool bool8
cSampleManager::InitialiseSampleBanks(void) cSampleManager::InitialiseSampleBanks(void)
{ {
int32 nBank = SFX_BANK_0; int32 nBank = SFX_BANK_0;
fpSampleDescHandle = fcaseopen(SampleBankDescFilename, "rb"); fpSampleDescHandle = fcaseopen(SampleBankDescFilename, "rb");
if ( fpSampleDescHandle == NULL ) if ( fpSampleDescHandle == NULL )
return false; return FALSE;
#ifndef OPUS_SFX #ifndef OPUS_SFX
fpSampleDataHandle = fcaseopen(SampleBankDataFilename, "rb"); fpSampleDataHandle = fcaseopen(SampleBankDataFilename, "rb");
if ( fpSampleDataHandle == NULL ) if ( fpSampleDataHandle == NULL )
@ -1983,7 +1983,7 @@ cSampleManager::InitialiseSampleBanks(void)
fclose(fpSampleDescHandle); fclose(fpSampleDescHandle);
fpSampleDescHandle = NULL; fpSampleDescHandle = NULL;
return false; return FALSE;
} }
fseek(fpSampleDataHandle, 0, SEEK_END); fseek(fpSampleDataHandle, 0, SEEK_END);
@ -2015,6 +2015,6 @@ cSampleManager::InitialiseSampleBanks(void)
nSampleBankSize[SFX_BANK_0] = nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS] - nSampleBankDiscStartOffset[SFX_BANK_0]; nSampleBankSize[SFX_BANK_0] = nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS] - nSampleBankDiscStartOffset[SFX_BANK_0];
nSampleBankSize[SFX_BANK_PED_COMMENTS] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS]; nSampleBankSize[SFX_BANK_PED_COMMENTS] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS];
return true; return TRUE;
} }
#endif #endif

View file

@ -160,7 +160,7 @@ void CGarages::Init(void)
aCarsInSafeHouse3[i].Init(); aCarsInSafeHouse3[i].Init();
hGarages = DMAudio.CreateEntity(AUDIOTYPE_GARAGE, (void*)1); hGarages = DMAudio.CreateEntity(AUDIOTYPE_GARAGE, (void*)1);
if (hGarages >= 0) if (hGarages >= 0)
DMAudio.SetEntityStatus(hGarages, true); DMAudio.SetEntityStatus(hGarages, TRUE);
AddOne( AddOne(
CVector(CRUSHER_GARAGE_X1, CRUSHER_GARAGE_Y1, CRUSHER_GARAGE_Z1), CVector(CRUSHER_GARAGE_X1, CRUSHER_GARAGE_Y1, CRUSHER_GARAGE_Z1),
CVector(CRUSHER_GARAGE_X2, CRUSHER_GARAGE_Y2, CRUSHER_GARAGE_Z2), CVector(CRUSHER_GARAGE_X2, CRUSHER_GARAGE_Y2, CRUSHER_GARAGE_Z2),

View file

@ -1232,7 +1232,7 @@ void CReplay::RestoreStuffFromMem(void)
ped->SetModelIndex(mi); ped->SetModelIndex(mi);
ped->m_pVehicleAnim = nil; ped->m_pVehicleAnim = nil;
ped->m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, ped); ped->m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, ped);
DMAudio.SetEntityStatus(ped->m_audioEntityId, true); DMAudio.SetEntityStatus(ped->m_audioEntityId, TRUE);
CPopulation::UpdatePedCount((ePedType)ped->m_nPedType, false); CPopulation::UpdatePedCount((ePedType)ped->m_nPedType, false);
if (ped->m_wepModelID >= 0) if (ped->m_wepModelID >= 0)
ped->AddWeaponModel(ped->m_wepModelID); ped->AddWeaponModel(ped->m_wepModelID);
@ -1270,7 +1270,7 @@ void CReplay::RestoreStuffFromMem(void)
car->SetDoorDamage(CAR_DOOR_RR, DOOR_REAR_RIGHT, true); car->SetDoorDamage(CAR_DOOR_RR, DOOR_REAR_RIGHT, true);
} }
vehicle->m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, vehicle); vehicle->m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, vehicle);
DMAudio.SetEntityStatus(vehicle->m_audioEntityId, true); DMAudio.SetEntityStatus(vehicle->m_audioEntityId, TRUE);
CCarCtrl::UpdateCarCount(vehicle, false); CCarCtrl::UpdateCarCount(vehicle, false);
if ((mi == MI_AIRTRAIN || mi == MI_DEADDODO) && vehicle->m_rwObject){ if ((mi == MI_AIRTRAIN || mi == MI_DEADDODO) && vehicle->m_rwObject){
CVehicleModelInfo* info = (CVehicleModelInfo*)CModelInfo::GetModelInfo(mi); CVehicleModelInfo* info = (CVehicleModelInfo*)CModelInfo::GetModelInfo(mi);

View file

@ -1327,7 +1327,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
{ {
CollectParameters(&m_nIp, 1); CollectParameters(&m_nIp, 1);
DMAudio.ChangeMusicMode(MUSICMODE_FRONTEND); DMAudio.ChangeMusicMode(MUSICMODE_FRONTEND);
DMAudio.PlayFrontEndTrack(ScriptParams[0] + STREAMED_SOUND_MISSION_COMPLETED - 1, 0); DMAudio.PlayFrontEndTrack(ScriptParams[0] + STREAMED_SOUND_MISSION_COMPLETED - 1, FALSE);
return 0; return 0;
} }
case COMMAND_CLEAR_AREA: case COMMAND_CLEAR_AREA:

View file

@ -4422,7 +4422,7 @@ CMenuManager::ProcessButtonPresses(void)
m_PrefsRadioStation = m_nHoverOption - HOVEROPTION_RADIO_0; m_PrefsRadioStation = m_nHoverOption - HOVEROPTION_RADIO_0;
SaveSettings(); SaveSettings();
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("FRONTEND RADIO STATION CHANGED"); OutputDebugString("FRONTEND RADIO STATION CHANGED");
} else if (m_nHoverOption == HOVEROPTION_RANDOM_ITEM } else if (m_nHoverOption == HOVEROPTION_RANDOM_ITEM
&& aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action != MENUACTION_RESUME) { && aScreens[m_nCurrScreen].m_aEntries[m_nCurrOption].m_Action != MENUACTION_RESUME) {
@ -4436,7 +4436,7 @@ CMenuManager::ProcessButtonPresses(void)
m_PrefsRadioStation = HEAD_RADIO; m_PrefsRadioStation = HEAD_RADIO;
SaveSettings(); SaveSettings();
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("FRONTEND RADIO STATION CHANGED"); OutputDebugString("FRONTEND RADIO STATION CHANGED");
break; break;
case HOVEROPTION_RADIO_1: case HOVEROPTION_RADIO_1:
@ -4444,7 +4444,7 @@ CMenuManager::ProcessButtonPresses(void)
m_PrefsRadioStation = DOUBLE_CLEF; m_PrefsRadioStation = DOUBLE_CLEF;
SaveSettings(); SaveSettings();
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("FRONTEND RADIO STATION CHANGED"); OutputDebugString("FRONTEND RADIO STATION CHANGED");
break; break;
case HOVEROPTION_RADIO_2: case HOVEROPTION_RADIO_2:
@ -4452,7 +4452,7 @@ CMenuManager::ProcessButtonPresses(void)
m_PrefsRadioStation = JAH_RADIO; m_PrefsRadioStation = JAH_RADIO;
SaveSettings(); SaveSettings();
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("FRONTEND RADIO STATION CHANGED"); OutputDebugString("FRONTEND RADIO STATION CHANGED");
break; break;
case HOVEROPTION_RADIO_3: case HOVEROPTION_RADIO_3:
@ -4460,7 +4460,7 @@ CMenuManager::ProcessButtonPresses(void)
m_PrefsRadioStation = RISE_FM; m_PrefsRadioStation = RISE_FM;
SaveSettings(); SaveSettings();
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("FRONTEND RADIO STATION CHANGED"); OutputDebugString("FRONTEND RADIO STATION CHANGED");
break; break;
case HOVEROPTION_RADIO_4: case HOVEROPTION_RADIO_4:
@ -4468,7 +4468,7 @@ CMenuManager::ProcessButtonPresses(void)
m_PrefsRadioStation = LIPS_106; m_PrefsRadioStation = LIPS_106;
SaveSettings(); SaveSettings();
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("FRONTEND RADIO STATION CHANGED"); OutputDebugString("FRONTEND RADIO STATION CHANGED");
break; break;
case HOVEROPTION_RADIO_5: case HOVEROPTION_RADIO_5:
@ -4476,7 +4476,7 @@ CMenuManager::ProcessButtonPresses(void)
m_PrefsRadioStation = GAME_FM; m_PrefsRadioStation = GAME_FM;
SaveSettings(); SaveSettings();
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("FRONTEND RADIO STATION CHANGED"); OutputDebugString("FRONTEND RADIO STATION CHANGED");
break; break;
case HOVEROPTION_RADIO_6: case HOVEROPTION_RADIO_6:
@ -4484,7 +4484,7 @@ CMenuManager::ProcessButtonPresses(void)
m_PrefsRadioStation = MSX_FM; m_PrefsRadioStation = MSX_FM;
SaveSettings(); SaveSettings();
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("FRONTEND RADIO STATION CHANGED"); OutputDebugString("FRONTEND RADIO STATION CHANGED");
break; break;
case HOVEROPTION_RADIO_7: case HOVEROPTION_RADIO_7:
@ -4492,7 +4492,7 @@ CMenuManager::ProcessButtonPresses(void)
m_PrefsRadioStation = FLASHBACK; m_PrefsRadioStation = FLASHBACK;
SaveSettings(); SaveSettings();
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("FRONTEND RADIO STATION CHANGED"); OutputDebugString("FRONTEND RADIO STATION CHANGED");
break; break;
case HOVEROPTION_RADIO_8: case HOVEROPTION_RADIO_8:
@ -4500,7 +4500,7 @@ CMenuManager::ProcessButtonPresses(void)
m_PrefsRadioStation = CHATTERBOX; m_PrefsRadioStation = CHATTERBOX;
SaveSettings(); SaveSettings();
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("FRONTEND RADIO STATION CHANGED"); OutputDebugString("FRONTEND RADIO STATION CHANGED");
break; break;
case HOVEROPTION_RADIO_9: case HOVEROPTION_RADIO_9:
@ -4508,7 +4508,7 @@ CMenuManager::ProcessButtonPresses(void)
m_PrefsRadioStation = USERTRACK; m_PrefsRadioStation = USERTRACK;
SaveSettings(); SaveSettings();
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("FRONTEND RADIO STATION CHANGED"); OutputDebugString("FRONTEND RADIO STATION CHANGED");
break; break;
case HOVEROPTION_RANDOM_ITEM: case HOVEROPTION_RANDOM_ITEM:
@ -4731,7 +4731,7 @@ CMenuManager::ProcessButtonPresses(void)
curBottomBarOption = hoveredBottomBarOption; curBottomBarOption = hoveredBottomBarOption;
ChangeScreen(bbNames[curBottomBarOption].screenId, 0, true, false); ChangeScreen(bbNames[curBottomBarOption].screenId, 0, true, false);
if (bbNames[curBottomBarOption].screenId == MENUPAGE_SOUND_SETTINGS) if (bbNames[curBottomBarOption].screenId == MENUPAGE_SOUND_SETTINGS)
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
return; return;
} else if (bottomBarActive) { } else if (bottomBarActive) {
if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetCrossJustDown()) { if (CPad::GetPad(0)->GetEnterJustDown() || CPad::GetPad(0)->GetCrossJustDown()) {
@ -4739,7 +4739,7 @@ CMenuManager::ProcessButtonPresses(void)
bottomBarActive = false; bottomBarActive = false;
if (bbNames[curBottomBarOption].screenId == MENUPAGE_SOUND_SETTINGS) if (bbNames[curBottomBarOption].screenId == MENUPAGE_SOUND_SETTINGS)
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
return; return;
} else if (CPad::GetPad(0)->GetLeftJustDown() || CPad::GetPad(0)->GetAnaloguePadLeft() || CPad::GetPad(0)->GetDPadLeftJustDown() } else if (CPad::GetPad(0)->GetLeftJustDown() || CPad::GetPad(0)->GetAnaloguePadLeft() || CPad::GetPad(0)->GetDPadLeftJustDown()
@ -4890,7 +4890,7 @@ CMenuManager::ProcessButtonPresses(void)
} }
SaveSettings(); SaveSettings();
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("FRONTEND RADIO STATION CHANGED"); OutputDebugString("FRONTEND RADIO STATION CHANGED");
#endif #endif
break; break;
@ -5100,7 +5100,7 @@ CMenuManager::ProcessButtonPresses(void)
DMAudio.SetMusicMasterVolume(102); DMAudio.SetMusicMasterVolume(102);
DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume); DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume);
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
SaveSettings(); SaveSettings();
} else if (m_nCurrScreen == MENUPAGE_DISPLAY_SETTINGS) { } else if (m_nCurrScreen == MENUPAGE_DISPLAY_SETTINGS) {
m_PrefsFrameLimiter = true; m_PrefsFrameLimiter = true;
@ -5186,7 +5186,7 @@ CMenuManager::ProcessButtonPresses(void)
break; break;
case MENUACTION_LOADRADIO: case MENUACTION_LOADRADIO:
ChangeScreen(MENUPAGE_SOUND_SETTINGS, 0, true, true); ChangeScreen(MENUPAGE_SOUND_SETTINGS, 0, true, true);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("STARTED PLAYING FRONTEND AUDIO TRACK"); OutputDebugString("STARTED PLAYING FRONTEND AUDIO TRACK");
break; break;
#ifdef MISSION_REPLAY #ifdef MISSION_REPLAY
@ -5381,7 +5381,7 @@ CMenuManager::ProcessButtonPresses(void)
} }
SaveSettings(); SaveSettings();
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("FRONTEND RADIO STATION CHANGED"); OutputDebugString("FRONTEND RADIO STATION CHANGED");
break; break;
#ifdef ASPECT_RATIO_SCALE #ifdef ASPECT_RATIO_SCALE

View file

@ -779,7 +779,7 @@ TriggerAudio_RadioStation(CMenuMultiChoicePicturedTriggered *widget)
if ( CMenuManager::m_PrefsRadioStation != widget->GetMenuSelection() ) if ( CMenuManager::m_PrefsRadioStation != widget->GetMenuSelection() )
{ {
CMenuManager::m_PrefsRadioStation = widget->GetMenuSelection(); CMenuManager::m_PrefsRadioStation = widget->GetMenuSelection();
DMAudio.PlayFrontEndTrack(CMenuManager::m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(CMenuManager::m_PrefsRadioStation, TRUE);
DMAudio.SetRadioInCar(CMenuManager::m_PrefsRadioStation); DMAudio.SetRadioInCar(CMenuManager::m_PrefsRadioStation);
} }
} }
@ -792,12 +792,12 @@ TriggerAudio_StereoMono(CMenuMultiChoiceTriggered *widget)
{ {
if (widget->GetMenuSelection() == 1) if (widget->GetMenuSelection() == 1)
{ {
DMAudio.SetMonoMode(true); DMAudio.SetMonoMode(TRUE);
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MONO, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MONO, 0);
} }
else else
{ {
DMAudio.SetMonoMode(false); DMAudio.SetMonoMode(FALSE);
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_STEREO, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_STEREO, 0);
} }
} }

View file

@ -2871,7 +2871,7 @@ CMenuManager::ProcessDPadCrossJustDown(void)
{ {
if ( !gMusicPlaying ) if ( !gMusicPlaying )
{ {
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
gMusicPlaying = true; gMusicPlaying = true;
} }
} }

View file

@ -64,7 +64,7 @@ CWorld::Initialise()
void void
CWorld::Add(CEntity *ent) CWorld::Add(CEntity *ent)
{ {
if(ent->IsVehicle() || ent->IsPed()) DMAudio.SetEntityStatus(((CPhysical *)ent)->m_audioEntityId, true); if(ent->IsVehicle() || ent->IsPed()) DMAudio.SetEntityStatus(((CPhysical *)ent)->m_audioEntityId, TRUE);
if(ent->bIsBIGBuilding) if(ent->bIsBIGBuilding)
ms_bigBuildingsList[ent->m_level].InsertItem(ent); ms_bigBuildingsList[ent->m_level].InsertItem(ent);
@ -79,7 +79,7 @@ CWorld::Add(CEntity *ent)
void void
CWorld::Remove(CEntity *ent) CWorld::Remove(CEntity *ent)
{ {
if(ent->IsVehicle() || ent->IsPed()) DMAudio.SetEntityStatus(((CPhysical *)ent)->m_audioEntityId, false); if(ent->IsVehicle() || ent->IsPed()) DMAudio.SetEntityStatus(((CPhysical *)ent)->m_audioEntityId, FALSE);
if(ent->bIsBIGBuilding) if(ent->bIsBIGBuilding)
ms_bigBuildingsList[ent->m_level].RemoveItem(ent); ms_bigBuildingsList[ent->m_level].RemoveItem(ent);

View file

@ -33,7 +33,7 @@ CAudioHydrant::Add(CParticleObject *particleobject)
if ( AEHANDLE_IS_FAILED(List[i].AudioEntity) ) if ( AEHANDLE_IS_FAILED(List[i].AudioEntity) )
return false; return false;
DMAudio.SetEntityStatus(List[i].AudioEntity, true); DMAudio.SetEntityStatus(List[i].AudioEntity, TRUE);
List[i].pParticleObject = particleobject; List[i].pParticleObject = particleobject;

View file

@ -244,7 +244,7 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
bHasACamera = true; bHasACamera = true;
m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, this); m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, this);
DMAudio.SetEntityStatus(m_audioEntityId, true); DMAudio.SetEntityStatus(m_audioEntityId, TRUE);
m_fearFlags = CPedType::GetThreats(m_nPedType); m_fearFlags = CPedType::GetThreats(m_nPedType);
m_threatEntity = nil; m_threatEntity = nil;
m_eventOrThreat = CVector2D(0.0f, 0.0f); m_eventOrThreat = CVector2D(0.0f, 0.0f);

View file

@ -114,7 +114,7 @@ void CWeather::Init(void)
ForcedWeatherType = WEATHER_RANDOM; ForcedWeatherType = WEATHER_RANDOM;
SoundHandle = DMAudio.CreateEntity(AUDIOTYPE_WEATHER, (void*)1); SoundHandle = DMAudio.CreateEntity(AUDIOTYPE_WEATHER, (void*)1);
if (SoundHandle >= 0) if (SoundHandle >= 0)
DMAudio.SetEntityStatus(SoundHandle, true); DMAudio.SetEntityStatus(SoundHandle, TRUE);
} }
void CWeather::Update(void) void CWeather::Update(void)

View file

@ -85,7 +85,7 @@ void CCranes::AddThisOneCrane(CEntity* pEntity)
pCrane->m_bWasMilitaryCrane = false; pCrane->m_bWasMilitaryCrane = false;
pCrane->m_nAudioEntity = DMAudio.CreateEntity(AUDIOTYPE_CRANE, &aCranes[NumCranes]); pCrane->m_nAudioEntity = DMAudio.CreateEntity(AUDIOTYPE_CRANE, &aCranes[NumCranes]);
if (pCrane->m_nAudioEntity >= 0) if (pCrane->m_nAudioEntity >= 0)
DMAudio.SetEntityStatus(pCrane->m_nAudioEntity, true); DMAudio.SetEntityStatus(pCrane->m_nAudioEntity, TRUE);
pCrane->m_bIsTop = (MODELID_CRANE_1 != pEntity->GetModelIndex()); pCrane->m_bIsTop = (MODELID_CRANE_1 != pEntity->GetModelIndex());
// Is this used to avoid military crane? // Is this used to avoid military crane?
if (pCrane->m_bIsTop || pEntity->GetPosition().y > 0.0f) { if (pCrane->m_bIsTop || pEntity->GetPosition().y > 0.0f) {
@ -669,7 +669,7 @@ void CCranes::Load(uint8* buf, uint32 size)
for (int i = 0; i < NUM_CRANES; i++) { for (int i = 0; i < NUM_CRANES; i++) {
aCranes[i].m_nAudioEntity = DMAudio.CreateEntity(AUDIOTYPE_CRANE, &aCranes[i]); aCranes[i].m_nAudioEntity = DMAudio.CreateEntity(AUDIOTYPE_CRANE, &aCranes[i]);
if (aCranes[i].m_nAudioEntity != 0) if (aCranes[i].m_nAudioEntity != 0)
DMAudio.SetEntityStatus(aCranes[i].m_nAudioEntity, true); DMAudio.SetEntityStatus(aCranes[i].m_nAudioEntity, TRUE);
} }
VALIDATESAVEBUF(size); VALIDATESAVEBUF(size);

View file

@ -108,7 +108,7 @@ CVehicle::CVehicle(uint8 CreatedBy)
m_fMapObjectHeightAhead = m_fMapObjectHeightBehind = 0.0f; m_fMapObjectHeightAhead = m_fMapObjectHeightBehind = 0.0f;
m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, this); m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, this);
if(m_audioEntityId >= 0) if(m_audioEntityId >= 0)
DMAudio.SetEntityStatus(m_audioEntityId, true); DMAudio.SetEntityStatus(m_audioEntityId, TRUE);
m_nRadioStation = CGeneral::GetRandomNumber() % USERTRACK; m_nRadioStation = CGeneral::GetRandomNumber() % USERTRACK;
m_pCurGroundEntity = nil; m_pCurGroundEntity = nil;
m_bRainAudioCounter = 0; m_bRainAudioCounter = 0;

View file

@ -46,7 +46,7 @@ CExplosion::Initialise()
} }
AudioHandle = DMAudio.CreateEntity(AUDIOTYPE_EXPLOSION, (void*)1); AudioHandle = DMAudio.CreateEntity(AUDIOTYPE_EXPLOSION, (void*)1);
if (AudioHandle >= 0) if (AudioHandle >= 0)
DMAudio.SetEntityStatus(AudioHandle, true); DMAudio.SetEntityStatus(AudioHandle, TRUE);
debug("CExplosion ready\n"); debug("CExplosion ready\n");
} }