Use bool8 in audio code

This commit is contained in:
Sergeanur 2021-05-22 13:08:26 +03:00
parent bd94c16e78
commit 5bcdb933a7
27 changed files with 1395 additions and 1396 deletions

View File

@ -158,7 +158,7 @@ cAudioManager::SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollisio
void void
cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter) cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter)
{ {
bool distCalculated = false; bool8 distCalculated = FALSE;
if(col.m_fIntensity2 > 0.0016f) { if(col.m_fIntensity2 > 0.0016f) {
uint8 emittingVol = SetLoopingCollisionRequestedSfxFreqAndGetVol(col); uint8 emittingVol = SetLoopingCollisionRequestedSfxFreqAndGetVol(col);
if(emittingVol) { if(emittingVol) {
@ -168,7 +168,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;
@ -178,10 +178,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();
} }
} }
@ -311,7 +311,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;
@ -319,9 +319,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();
} }
} }
@ -332,13 +332,12 @@ 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++) {
@ -348,8 +347,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

@ -23,8 +23,8 @@ const int allChannels = channels + 2;
cAudioManager::cAudioManager() cAudioManager::cAudioManager()
{ {
m_bIsInitialised = false; m_bIsInitialised = FALSE;
m_bReverb = true; m_bReverb = TRUE;
field_6 = 0; field_6 = 0;
m_fSpeedOfSound = SPEED_OF_SOUND / TIME_SPENT; m_fSpeedOfSound = SPEED_OF_SOUND / TIME_SPENT;
m_nTimeSpent = TIME_SPENT; m_nTimeSpent = TIME_SPENT;
@ -36,16 +36,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;
} }
@ -83,7 +83,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);
} }
@ -98,7 +98,7 @@ cAudioManager::Terminate()
SampleManager.Terminate(); SampleManager.Terminate();
m_bIsInitialised = false; m_bIsInitialised = FALSE;
PostTerminateGameSpecificShutdown(); PostTerminateGameSpecificShutdown();
} }
} }
@ -110,7 +110,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;
@ -132,8 +132,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;
@ -152,7 +152,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)
@ -165,7 +165,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;
@ -193,7 +193,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;
@ -246,7 +246,7 @@ cAudioManager::SetEffectsFadeVol(uint8 volume) const
} }
void void
cAudioManager::SetMonoMode(uint8 mono) cAudioManager::SetMonoMode(bool8 mono)
{ {
SampleManager.SetMonoMode(mono); SampleManager.SetMonoMode(mono);
} }
@ -261,7 +261,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) {
@ -280,7 +280,7 @@ cAudioManager::ResetTimers(uint32 time)
SampleManager.SetEffectsFadeVolume(0); SampleManager.SetEffectsFadeVolume(0);
SampleManager.SetMusicFadeVolume(0); SampleManager.SetMusicFadeVolume(0);
MusicManager.ResetMusicAfterReload(); MusicManager.ResetMusicAfterReload();
m_bIsPlayerShutUp = false; m_bIsPlayerShutUp = FALSE;
#ifdef AUDIO_OAL #ifdef AUDIO_OAL
SampleManager.Service(); SampleManager.Service();
#endif #endif
@ -391,13 +391,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
@ -417,25 +417,25 @@ 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();
} }
uint8 char
cAudioManager::GetCDAudioDriveLetter() const cAudioManager::GetCDAudioDriveLetter() const
{ {
if(m_bIsInitialised) return SampleManager.GetCDAudioDriveLetter(); if(m_bIsInitialised) return SampleManager.GetCDAudioDriveLetter();
return 0; return '\0';
} }
bool bool8
cAudioManager::IsAudioInitialised() const cAudioManager::IsAudioInitialised() const
{ {
return m_bIsInitialised; return m_bIsInitialised;
@ -545,7 +545,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)
@ -576,7 +576,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);
@ -589,24 +589,24 @@ 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 || CCullZones::InRoomForAudio()) { if (m_sQueueSample.m_bIs2D || CCullZones::InRoomForAudio()) {
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_bReverb && m_sQueueSample.m_bIs2D ) if ( m_bReverb && m_sQueueSample.m_bIs2D )
m_sQueueSample.field_4C = 30; m_sQueueSample.field_4C = 30;
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;
@ -773,7 +773,7 @@ cAudioManager::UpdateReflections()
void void
cAudioManager::AddReleasingSounds() cAudioManager::AddReleasingSounds()
{ {
bool toProcess[44]; // why not 27? bool8 toProcess[44]; // why not 27?
int8 queue = m_nActiveSampleQueue == 0 ? 1 : 0; int8 queue = m_nActiveSampleQueue == 0 ? 1 : 0;
@ -782,11 +782,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;
} }
} }
@ -811,7 +811,7 @@ cAudioManager::AddReleasingSounds()
if (sample.m_nReleasingVolumeModificator < 20) if (sample.m_nReleasingVolumeModificator < 20)
++sample.m_nReleasingVolumeModificator; ++sample.m_nReleasingVolumeModificator;
} }
sample.m_bReleasingSoundFlag = false; sample.m_bReleasingSoundFlag = FALSE;
} }
memcpy(&m_sQueueSample, &sample, sizeof(tSound)); memcpy(&m_sQueueSample, &sample, sizeof(tSound));
AddSampleToRequestedQueue(); AddSampleToRequestedQueue();
@ -829,12 +829,12 @@ cAudioManager::ProcessActiveQueues()
uint8 vol; uint8 vol;
uint8 offset; uint8 offset;
float x; float x;
bool flag; bool8 flag;
bool missionState; bool8 missionState;
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++) {
tSound& sample = m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][i]]; tSound& sample = m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][i]];
@ -847,19 +847,19 @@ cAudioManager::ProcessActiveQueues()
if (m_FrameCounter & 1) { if (m_FrameCounter & 1) {
if (!(j & 1)) { if (!(j & 1)) {
flag = false; flag = FALSE;
} else { } else {
flag = true; flag = TRUE;
} }
} else if (j & 1) { } else if (j & 1) {
flag = false; flag = FALSE;
} else { } else {
flag = true; flag = TRUE;
} }
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;
@ -867,8 +867,8 @@ cAudioManager::ProcessActiveQueues()
if (!sample.m_nReleasingVolumeDivider) if (!sample.m_nReleasingVolumeDivider)
sample.m_nReleasingVolumeDivider = 1; sample.m_nReleasingVolumeDivider = 1;
} }
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) {
@ -900,10 +900,10 @@ cAudioManager::ProcessActiveQueues()
emittingVol = vol; emittingVol = vol;
} }
missionState = false; missionState = FALSE;
for (int32 k = 0; k < ARRAY_SIZE(m_sMissionAudio.m_bIsMobile); k++) { for (int32 k = 0; k < ARRAY_SIZE(m_sMissionAudio.m_bIsMobile); k++) {
if (m_sMissionAudio.m_bIsMobile[k]) { if (m_sMissionAudio.m_bIsMobile[k]) {
missionState = true; missionState = TRUE;
break; break;
} }
} }
@ -924,8 +924,8 @@ cAudioManager::ProcessActiveQueues()
SampleManager.SetChannelReverbFlag(j, sample.m_bReverbFlag); SampleManager.SetChannelReverbFlag(j, sample.m_bReverbFlag);
break; //continue for i break; //continue for i
} }
sample.m_bIsProcessed = false; sample.m_bIsProcessed = FALSE;
m_asActiveSamples[j].m_bIsProcessed = false; m_asActiveSamples[j].m_bIsProcessed = FALSE;
//continue for j //continue for j
} }
} }
@ -966,10 +966,10 @@ cAudioManager::ProcessActiveQueues()
} }
if (SampleManager.InitialiseChannel(k, m_asActiveSamples[k].m_nSampleIndex, m_asActiveSamples[k].m_nBankIndex)) { if (SampleManager.InitialiseChannel(k, m_asActiveSamples[k].m_nSampleIndex, m_asActiveSamples[k].m_nBankIndex)) {
SampleManager.SetChannelFrequency(k, m_asActiveSamples[k].m_nFrequency); SampleManager.SetChannelFrequency(k, m_asActiveSamples[k].m_nFrequency);
bool isMobile = false; bool8 isMobile = FALSE;
for (int32 l = 0; l < ARRAY_SIZE(m_sMissionAudio.m_bIsMobile); l++) { for (int32 l = 0; l < ARRAY_SIZE(m_sMissionAudio.m_bIsMobile); l++) {
if (m_sMissionAudio.m_bIsMobile[l]) { if (m_sMissionAudio.m_bIsMobile[l]) {
isMobile = true; isMobile = TRUE;
break; break;
} }
} }
@ -1000,8 +1000,8 @@ cAudioManager::ProcessActiveQueues()
SampleManager.SetChannel3DDistances(k, m_asActiveSamples[k].m_fSoundIntensity, 0.25f * m_asActiveSamples[k].m_fSoundIntensity); SampleManager.SetChannel3DDistances(k, m_asActiveSamples[k].m_fSoundIntensity, 0.25f * m_asActiveSamples[k].m_fSoundIntensity);
SampleManager.StartChannel(k); SampleManager.StartChannel(k);
} }
m_asActiveSamples[k].m_bIsProcessed = true; m_asActiveSamples[k].m_bIsProcessed = TRUE;
sample.m_bIsProcessed = true; sample.m_bIsProcessed = TRUE;
sample.m_nVolumeChange = -1; sample.m_nVolumeChange = -1;
break; break;
} }
@ -1029,28 +1029,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

@ -13,7 +13,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;
@ -24,16 +24,16 @@ 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;
uint8 field_4C; uint8 field_4C;
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;
}; };
@ -48,7 +48,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];
@ -78,7 +78,7 @@ public:
uint8 m_nCommentsInBank[NUM_PED_COMMENTS_BANKS]; uint8 m_nCommentsInBank[NUM_PED_COMMENTS_BANKS];
uint8 m_nActiveBank; uint8 m_nActiveBank;
#ifdef GTA_PC #ifdef GTA_PC
bool m_bDelay; bool8 m_bDelay;
uint32 m_nDelayTimer; uint32 m_nDelayTimer;
#endif #endif
@ -110,14 +110,14 @@ class cMissionAudio
{ {
public: public:
CVector m_vecPos[MISSION_AUDIO_SLOTS]; CVector m_vecPos[MISSION_AUDIO_SLOTS];
bool m_bPredefinedProperties[MISSION_AUDIO_SLOTS]; bool8 m_bPredefinedProperties[MISSION_AUDIO_SLOTS];
int32 m_nSampleIndex[MISSION_AUDIO_SLOTS]; int32 m_nSampleIndex[MISSION_AUDIO_SLOTS];
uint8 m_nLoadingStatus[MISSION_AUDIO_SLOTS]; uint8 m_nLoadingStatus[MISSION_AUDIO_SLOTS];
uint8 m_nPlayStatus[MISSION_AUDIO_SLOTS]; uint8 m_nPlayStatus[MISSION_AUDIO_SLOTS];
bool m_bIsPlaying[MISSION_AUDIO_SLOTS]; bool8 m_bIsPlaying[MISSION_AUDIO_SLOTS];
int32 m_nMissionAudioCounter[MISSION_AUDIO_SLOTS]; int32 m_nMissionAudioCounter[MISSION_AUDIO_SLOTS];
bool m_bIsPlayed[MISSION_AUDIO_SLOTS]; bool8 m_bIsPlayed[MISSION_AUDIO_SLOTS];
bool m_bIsMobile[MISSION_AUDIO_SLOTS]; bool8 m_bIsMobile[MISSION_AUDIO_SLOTS];
}; };
VALIDATE_SIZE(cMissionAudio, 0x38); VALIDATE_SIZE(cMissionAudio, 0x38);
@ -141,7 +141,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;
@ -157,7 +157,7 @@ class cVehicleParams
{ {
public: public:
int32 m_VehicleType; int32 m_VehicleType;
bool m_bDistanceCalculated; bool8 m_bDistanceCalculated;
float m_fDistance; float m_fDistance;
CVehicle *m_pVehicle; CVehicle *m_pVehicle;
cTransmission *m_pTransmission; cTransmission *m_pTransmission;
@ -193,15 +193,15 @@ enum {
class cAudioManager class cAudioManager
{ {
public: public:
bool m_bIsInitialised; bool8 m_bIsInitialised;
uint8 m_bReverb; // unused uint8 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;
int8 field_6; int8 field_6;
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;
@ -217,11 +217,11 @@ public:
cAudioScriptObjectManager m_sAudioScriptObjectManager; cAudioScriptObjectManager m_sAudioScriptObjectManager;
// miami // miami
uint8 m_bIsPlayerShutUp; bool8 m_bIsPlayerShutUp;
uint8 m_nPlayerMood; uint8 m_nPlayerMood;
uint32 m_nPlayerMoodTimer; uint32 m_nPlayerMoodTimer;
uint8 field_rest[4]; uint8 field_rest[4];
bool m_bGenericSfx; bool8 m_bGenericSfx;
cPedComments m_sPedComments; cPedComments m_sPedComments;
int32 m_nFireAudioEntity; int32 m_nFireAudioEntity;
@ -253,19 +253,19 @@ public:
float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; } // done float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; } // done
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 IsMissionAudioSamplePlaying(uint8 slot) const; // { return m_sMissionAudio.m_nPlayStatus == 1; } bool8 IsMissionAudioSamplePlaying(uint8 slot) const; // { return m_sMissionAudio.m_nPlayStatus == 1; }
bool ShouldDuckMissionAudio(uint8 slot) const; bool8 ShouldDuckMissionAudio(uint8 slot) const;
// "Should" be in alphabetic order, except "getXTalkSfx" // "Should" be in alphabetic order, except "getXTalkSfx"
void AddDetailsToRequestedOrderList(uint8 sample); // done (inlined in vc) void AddDetailsToRequestedOrderList(uint8 sample); // done (inlined in vc)
void AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 bank, uint8 counter, bool notLooping); // done void AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 bank, uint8 counter, bool8 notLooping); // done
void AddReflectionsToRequestedQueue(); // done void AddReflectionsToRequestedQueue(); // done
void AddReleasingSounds(); // done void AddReleasingSounds(); // done
void AddSampleToRequestedQueue(); // done void AddSampleToRequestedQueue(); // done
void AgeCrimes(); // done (inlined in vc) void AgeCrimes(); // done (inlined in vc)
void CalculateDistance(bool &condition, float dist); // done void CalculateDistance(bool8 &condition, float dist); // done
bool CheckForAnAudioFileOnCD() const; // done bool8 CheckForAnAudioFileOnCD() const; // done
void ClearActiveSamples(); // done void ClearActiveSamples(); // done
void ClearMissionAudio(uint8 slot); // done (inlined in vc) void ClearMissionAudio(uint8 slot); // done (inlined in vc)
void ClearRequestedQueue(); // done (inlined in vc) void ClearRequestedQueue(); // done (inlined in vc)
@ -379,7 +379,7 @@ public:
void GenerateIntegerRandomNumberTable(); // done void GenerateIntegerRandomNumberTable(); // done
char *Get3DProviderName(uint8 id) const; // done char *Get3DProviderName(uint8 id) const; // done
uint8 GetCDAudioDriveLetter() const; // done char GetCDAudioDriveLetter() const; // done
int8 GetCurrent3DProviderIndex() const; // done int8 GetCurrent3DProviderIndex() const; // done
int8 AutoDetect3DProviders() const; // done int8 AutoDetect3DProviders() const; // done
float GetCollisionLoopingRatio(uint32 a, uint32 b, float c) const; // not used float GetCollisionLoopingRatio(uint32 a, uint32 b, float c) const; // not used
@ -396,17 +396,17 @@ public:
float velocityChange); // done float velocityChange); // done
float GetVehicleNonDriveWheelSkidValue(CVehicle *veh, tWheelState wheelState, cTransmission *transmission, float velocityChange); // done float GetVehicleNonDriveWheelSkidValue(CVehicle *veh, tWheelState wheelState, cTransmission *transmission, float velocityChange); // done
bool HasAirBrakes(int32 model) const; // done bool8 HasAirBrakes(int32 model) const; // done
void Initialise(); // done void Initialise(); // done
void InitialisePoliceRadio(); // done void InitialisePoliceRadio(); // done
void InitialisePoliceRadioZones(); // done void InitialisePoliceRadioZones(); // done
void InterrogateAudioEntities(); // done (inlined) void InterrogateAudioEntities(); // done (inlined)
bool IsAudioInitialised() const; // done bool8 IsAudioInitialised() const; // done
bool IsMissionAudioSampleFinished(uint8 slot); // done bool8 IsMissionAudioSampleFinished(uint8 slot); // done
bool IsMP3RadioChannelAvailable() const; // done bool8 IsMP3RadioChannelAvailable() const; // done
bool MissionScriptAudioUsesPoliceChannel(int32 soundMission) const; //done bool8 MissionScriptAudioUsesPoliceChannel(int32 soundMission) const; //done
void PlayLoadedMissionAudio(uint8 slot); // done void PlayLoadedMissionAudio(uint8 slot); // done
void PlayOneShot(int32 index, uint16 sound, float vol); // done void PlayOneShot(int32 index, uint16 sound, float vol); // done
@ -420,20 +420,20 @@ public:
void PreTerminateGameSpecificShutdown(); // done void PreTerminateGameSpecificShutdown(); // done
/// processX - main logic of adding new sounds /// processX - main logic of adding new sounds
void ProcessActiveQueues(); // done void ProcessActiveQueues(); // done
bool ProcessAirBrakes(cVehicleParams& params); // done bool8 ProcessAirBrakes(cVehicleParams& params); // done
bool ProcessBoatEngine(cVehicleParams& params); bool8 ProcessBoatEngine(cVehicleParams& params);
bool ProcessBoatMovingOverWater(cVehicleParams& params); //done bool8 ProcessBoatMovingOverWater(cVehicleParams& params); //done
#ifdef GTA_BRIDGE #ifdef GTA_BRIDGE
void ProcessBridge(); // done(bcs not exists in VC) void ProcessBridge(); // done(bcs not exists in VC)
void ProcessBridgeMotor(); // done(bcs not exists in VC) void ProcessBridgeMotor(); // done(bcs not exists in VC)
void ProcessBridgeOneShots(); // done(bcs not exists in VC) void ProcessBridgeOneShots(); // done(bcs not exists in VC)
void ProcessBridgeWarning(); // done(bcs not exists in VC) void ProcessBridgeWarning(); // done(bcs not exists in VC)
#endif #endif
bool ProcessCarBombTick(cVehicleParams& params); // done bool8 ProcessCarBombTick(cVehicleParams& params); // done
void ProcessCarHeli(cVehicleParams& params); // done void ProcessCarHeli(cVehicleParams& params); // done
void ProcessCesna(cVehicleParams& params); // done void ProcessCesna(cVehicleParams& params); // done
//void ProcessCrane(); // done(bcs not exists in VC) //void ProcessCrane(); // done(bcs not exists in VC)
bool ProcessEngineDamage(cVehicleParams& params); // done bool8 ProcessEngineDamage(cVehicleParams& params); // done
void ProcessEntity(int32 sound); // done void ProcessEntity(int32 sound); // done
void ProcessExplosions(int32 explosion); // done void ProcessExplosions(int32 explosion); // done
void ProcessFireHydrant(); // done void ProcessFireHydrant(); // done
@ -462,25 +462,25 @@ public:
void ProcessProjectiles(); // done void ProcessProjectiles(); // done
void ProcessRainOnVehicle(cVehicleParams& params); // done void ProcessRainOnVehicle(cVehicleParams& params); // done
void ProcessReverb() const; // done void ProcessReverb() const; // done
bool ProcessReverseGear(cVehicleParams& params); // done bool8 ProcessReverseGear(cVehicleParams& params); // done
void ProcessScriptObject(int32 id); // done void ProcessScriptObject(int32 id); // done
void ProcessSpecial(); // done void ProcessSpecial(); // done
#ifdef GTA_TRAIN #ifdef GTA_TRAIN
bool ProcessTrainNoise(cVehicleParams *params); //done(bcs not exists in VC) bool8 ProcessTrainNoise(cVehicleParams *params); //done(bcs not exists in VC)
#endif #endif
void ProcessVehicle(CVehicle *vehicle); // done void ProcessVehicle(CVehicle *vehicle); // done
bool ProcessVehicleDoors(cVehicleParams &params); // done bool8 ProcessVehicleDoors(cVehicleParams &params); // done
void ProcessVehicleEngine(cVehicleParams &params); // done void ProcessVehicleEngine(cVehicleParams &params); // done
void ProcessVehicleFlatTyre(cVehicleParams &params); // done void ProcessVehicleFlatTyre(cVehicleParams &params); // done
bool ProcessVehicleHorn(cVehicleParams &params); // done bool8 ProcessVehicleHorn(cVehicleParams &params); // done
void ProcessVehicleOneShots(cVehicleParams &params); // done void ProcessVehicleOneShots(cVehicleParams &params); // done
bool ProcessVehicleReverseWarning(cVehicleParams &params); // done bool8 ProcessVehicleReverseWarning(cVehicleParams &params); // done
bool ProcessVehicleRoadNoise(cVehicleParams &params); // done bool8 ProcessVehicleRoadNoise(cVehicleParams &params); // done
bool ProcessVehicleSirenOrAlarm(cVehicleParams &params); // done bool8 ProcessVehicleSirenOrAlarm(cVehicleParams &params); // done
bool ProcessVehicleSkidding(cVehicleParams &params); // done bool8 ProcessVehicleSkidding(cVehicleParams &params); // done
void ProcessWaterCannon(int32); // done void ProcessWaterCannon(int32); // done
void ProcessWeather(int32 id); // done void ProcessWeather(int32 id); // done
bool ProcessWetRoadNoise(cVehicleParams& params); // done bool8 ProcessWetRoadNoise(cVehicleParams& params); // done
void ProcessEscalators(); // done void ProcessEscalators(); // done
void ProcessExtraSounds(); // done void ProcessExtraSounds(); // done
@ -499,26 +499,26 @@ public:
void ServicePoliceRadioChannel(uint8 wantedLevel); // done void ServicePoliceRadioChannel(uint8 wantedLevel); // done
void ServiceSoundEffects(); // done void ServiceSoundEffects(); // done
int8 SetCurrent3DProvider(uint8 which); // done int8 SetCurrent3DProvider(uint8 which); // done
void SetDynamicAcousticModelingStatus(uint8 status); // done void SetDynamicAcousticModelingStatus(bool8 status); // done
void SetEffectsFadeVol(uint8 volume) const; // done void SetEffectsFadeVol(uint8 volume) const; // done
void SetEffectsMasterVolume(uint8 volume) const; // done void SetEffectsMasterVolume(uint8 volume) const; // done
void SetMP3BoostVolume(uint8 volume) const; // done void SetMP3BoostVolume(uint8 volume) const; // done
void SetEntityStatus(int32 id, uint8 status); // done void SetEntityStatus(int32 id, bool8 status); // done
uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision); // done uint32 SetLoopingCollisionRequestedSfxFreqAndGetVol(const cAudioCollision &audioCollision); // done
void SetMissionAudioLocation(uint8 slot, float x, float y, float z); // done void SetMissionAudioLocation(uint8 slot, float x, float y, float z); // done
void SetMissionScriptPoliceAudio(int32 sfx) const; // inlined and optimized void SetMissionScriptPoliceAudio(int32 sfx) const; // inlined and optimized
void SetMonoMode(uint8 mono); // done void SetMonoMode(bool8 mono); // done
void SetMusicFadeVol(uint8 volume) const; // done void SetMusicFadeVol(uint8 volume) const; // done
void SetMusicMasterVolume(uint8 volume) const; // done void SetMusicMasterVolume(uint8 volume) const; // done
void SetSpeakerConfig(int32 conf) const; // done void SetSpeakerConfig(int32 conf) const; // done
void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter); // done void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter); // done
void SetUpOneShotCollisionSound(const cAudioCollision &col); // done void SetUpOneShotCollisionSound(const cAudioCollision &col); // done
bool SetupCrimeReport(); // done bool8 SetupCrimeReport(); // done
bool SetupJumboEngineSound(uint8 vol, uint32 freq); // done bool8 SetupJumboEngineSound(uint8 vol, uint32 freq); // done
bool SetupJumboFlySound(uint8 emittingVol); // done bool8 SetupJumboFlySound(uint8 emittingVol); // done
bool SetupJumboRumbleSound(uint8 emittingVol); // done bool8 SetupJumboRumbleSound(uint8 emittingVol); // done
bool SetupJumboTaxiSound(uint8 vol); // done bool8 SetupJumboTaxiSound(uint8 vol); // done
bool SetupJumboWhineSound(uint8 emittingVol, uint32 freq); // done bool8 SetupJumboWhineSound(uint8 emittingVol, uint32 freq); // done
void SetupPedComments(cPedParams &params, uint16 sound); // done void SetupPedComments(cPedParams &params, uint16 sound); // done
void SetupSuspectLastSeenReport(); void SetupSuspectLastSeenReport();
@ -527,12 +527,12 @@ public:
void UpdateGasPedalAudio(CVehicle *veh, int vehType); // done void UpdateGasPedalAudio(CVehicle *veh, int vehType); // done
void UpdateReflections(); // done void UpdateReflections(); // done
bool UsesReverseWarning(int32 model) const; // done bool8 UsesReverseWarning(int32 model) const; // done
bool UsesSiren(cVehicleParams &params) const; // done bool8 UsesSiren(cVehicleParams &params) const; // done
bool UsesSirenSwitching(cVehicleParams &params) const; // done bool8 UsesSirenSwitching(cVehicleParams &params) const; // done
CVehicle *FindVehicleOfPlayer(); // done CVehicle *FindVehicleOfPlayer(); // done
void SetPedTalkingStatus(CPed *ped, uint8 status); // done void SetPedTalkingStatus(CPed *ped, bool8 status); // done
void SetPlayersMood(uint8 mood, uint32 time); // done void SetPlayersMood(uint8 mood, uint32 time); // done
float Sqrt(float v) const { return v <= 0.0f ? 0.0f : ::Sqrt(v); } float Sqrt(float v) const { return v <= 0.0f ? 0.0f : ::Sqrt(v); }

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);
} }
@ -142,7 +142,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();
@ -161,12 +161,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();
@ -178,7 +178,7 @@ cDMAudio::GetCDAudioDriveLetter(void)
return AudioManager.GetCDAudioDriveLetter(); return AudioManager.GetCDAudioDriveLetter();
} }
bool bool8
cDMAudio::IsAudioInitialised(void) cDMAudio::IsAudioInitialised(void)
{ {
return AudioManager.IsAudioInitialised(); return AudioManager.IsAudioInitialised();
@ -196,7 +196,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;
} }
@ -214,7 +214,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);
} }
} }
@ -244,7 +244,7 @@ cDMAudio::PlayRadioAnnouncement(uint32 announcement)
} }
void void
cDMAudio::PlayFrontEndTrack(uint32 track, uint8 frontendFlag) cDMAudio::PlayFrontEndTrack(uint32 track, bool8 frontendFlag)
{ {
MusicManager.PlayFrontEndTrack(track, frontendFlag); MusicManager.PlayFrontEndTrack(track, frontendFlag);
} }
@ -309,7 +309,7 @@ cDMAudio::PlayLoadedMissionAudio(uint8 slot)
AudioManager.PlayLoadedMissionAudio(slot); AudioManager.PlayLoadedMissionAudio(slot);
} }
bool bool8
cDMAudio::IsMissionAudioSampleFinished(uint8 slot) cDMAudio::IsMissionAudioSampleFinished(uint8 slot)
{ {
return AudioManager.IsMissionAudioSampleFinished(slot); return AudioManager.IsMissionAudioSampleFinished(slot);
@ -340,7 +340,7 @@ cDMAudio::SetRadioChannel(uint32 radio, int32 pos)
} }
void void
cDMAudio::SetStartingTrackPositions(uint8 isStartGame) cDMAudio::SetStartingTrackPositions(bool8 isStartGame)
{ {
MusicManager.SetStartingTrackPositions(isStartGame); MusicManager.SetStartingTrackPositions(isStartGame);
} }
@ -364,7 +364,7 @@ cDMAudio::GetRadioPosition(uint32 station)
} }
void void
cDMAudio::SetPedTalkingStatus(CPed *ped, uint8 status) cDMAudio::SetPedTalkingStatus(CPed *ped, bool8 status)
{ {
return AudioManager.SetPedTalkingStatus(ped, status); return AudioManager.SetPedTalkingStatus(ped, status);
} }
@ -376,7 +376,7 @@ cDMAudio::SetPlayersMood(uint8 mood, uint32 time)
} }
void void
cDMAudio::ShutUpPlayerTalking(uint8 state) cDMAudio::ShutUpPlayerTalking(bool8 state)
{ {
AudioManager.m_bIsPlayerShutUp = state; AudioManager.m_bIsPlayerShutUp = state;
} }

View File

@ -25,11 +25,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 SetMP3BoostVolume(uint8 volume); void SetMP3BoostVolume(uint8 volume);
void SetEffectsMasterVolume(uint8 volume); void SetEffectsMasterVolume(uint8 volume);
void SetMusicMasterVolume(uint8 volume); void SetMusicMasterVolume(uint8 volume);
@ -46,17 +46,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);
@ -70,7 +70,7 @@ public:
void PlayFrontEndSound(uint16 frontend, uint32 volume); void PlayFrontEndSound(uint16 frontend, uint32 volume);
void PlayRadioAnnouncement(uint32 announcement); void PlayRadioAnnouncement(uint32 announcement);
void PlayFrontEndTrack(uint32 track, uint8 frontendFlag); void PlayFrontEndTrack(uint32 track, bool8 frontendFlag);
void StopFrontEndTrack(void); void StopFrontEndTrack(void);
void ResetTimers(uint32 time); void ResetTimers(uint32 time);
@ -85,19 +85,19 @@ public:
uint8 GetMissionAudioLoadingStatus(uint8 slot); uint8 GetMissionAudioLoadingStatus(uint8 slot);
void SetMissionAudioLocation(uint8 slot, float x, float y, float z); void SetMissionAudioLocation(uint8 slot, float x, float y, float z);
void PlayLoadedMissionAudio(uint8 slot); void PlayLoadedMissionAudio(uint8 slot);
bool IsMissionAudioSampleFinished(uint8 slot); bool8 IsMissionAudioSampleFinished(uint8 slot);
void ClearMissionAudio(uint8 slot); void ClearMissionAudio(uint8 slot);
uint8 GetRadioInCar(void); uint8 GetRadioInCar(void);
void SetRadioInCar(uint32 radio); void SetRadioInCar(uint32 radio);
void SetRadioChannel(uint32 radio, int32 pos); void SetRadioChannel(uint32 radio, int32 pos);
void SetStartingTrackPositions(uint8 isStartGame); void SetStartingTrackPositions(bool8 isStartGame);
float *GetListenTimeArray(); float *GetListenTimeArray();
uint32 GetFavouriteRadioStation(); uint32 GetFavouriteRadioStation();
int32 GetRadioPosition(uint32 station); int32 GetRadioPosition(uint32 station);
void SetPedTalkingStatus(class CPed *ped, uint8 status); void SetPedTalkingStatus(class CPed *ped, bool8 status);
void SetPlayersMood(uint8 mood, uint32 time); void SetPlayersMood(uint8 mood, uint32 time);
void ShutUpPlayerTalking(uint8 state); void ShutUpPlayerTalking(bool8 state);
}; };
extern cDMAudio DMAudio; extern cDMAudio DMAudio;

View File

@ -28,7 +28,7 @@ static_assert(false, "R*'s radio implementation is quite buggy, RADIO_SCROLL_TO_
cMusicManager MusicManager; cMusicManager MusicManager;
int32 gNumRetunePresses; int32 gNumRetunePresses;
int32 gRetuneCounter; int32 gRetuneCounter;
bool g_bAnnouncementReadPosAlready; bool8 g_bAnnouncementReadPosAlready;
uint8 RadioStaticCounter = 5; uint8 RadioStaticCounter = 5;
uint32 RadioStaticTimer; uint32 RadioStaticTimer;
@ -50,13 +50,13 @@ uint32 NewGameRadioTimers[10] =
cMusicManager::cMusicManager() cMusicManager::cMusicManager()
{ {
m_bIsInitialised = false; m_bIsInitialised = FALSE;
m_bDisabled = false; m_bDisabled = FALSE;
m_nFrontendTrack = NO_TRACK; m_nFrontendTrack = NO_TRACK;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
m_nUpcomingMusicMode = MUSICMODE_DISABLED; m_nUpcomingMusicMode = MUSICMODE_DISABLED;
m_nMusicMode = MUSICMODE_DISABLED; m_nMusicMode = MUSICMODE_DISABLED;
m_bSetNextStation = false; m_bSetNextStation = FALSE;
for (int i = 0; i < NUM_RADIOS; i++) for (int i = 0; i < NUM_RADIOS; i++)
aListenTimeArray[i] = 0.0f; aListenTimeArray[i] = 0.0f;
@ -66,7 +66,7 @@ cMusicManager::cMusicManager()
m_nCurrentVolume = 0; m_nCurrentVolume = 0;
m_nMaxVolume = 0; m_nMaxVolume = 0;
m_nAnnouncement = NO_TRACK; m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false; m_bAnnouncementInProgress = FALSE;
} }
void void
@ -74,38 +74,38 @@ cMusicManager::ResetMusicAfterReload()
{ {
float afRadioTime[NUM_RADIOS]; float afRadioTime[NUM_RADIOS];
m_bRadioSetByScript = false; m_bRadioSetByScript = FALSE;
m_nRadioStationScript = WILDSTYLE; m_nRadioStationScript = WILDSTYLE;
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;
RadioStaticTimer = 0; RadioStaticTimer = 0;
gNumRetunePresses = 0; gNumRetunePresses = 0;
gRetuneCounter = 0; gRetuneCounter = 0;
m_nFrontendTrack = NO_TRACK; m_nFrontendTrack = NO_TRACK;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
m_FrontendLoopFlag = false; m_FrontendLoopFlag = FALSE;
m_bTrackChangeStarted = false; m_bTrackChangeStarted = FALSE;
m_nNextTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
m_nNextLoopFlag = false; m_nNextLoopFlag = FALSE;
m_bVerifyNextTrackStartedToPlay = false; m_bVerifyNextTrackStartedToPlay = FALSE;
m_bGameplayAllowsRadio = false; m_bGameplayAllowsRadio = FALSE;
m_bRadioStreamReady = false; m_bRadioStreamReady = FALSE;
nFramesSinceCutsceneEnded = -1; nFramesSinceCutsceneEnded = -1;
m_bUserResumedGame = false; m_bUserResumedGame = FALSE;
m_bMusicModeChangeStarted = false; m_bMusicModeChangeStarted = FALSE;
m_bEarlyFrontendTrack = false; m_bEarlyFrontendTrack = FALSE;
m_nVolumeLatency = 0; m_nVolumeLatency = 0;
m_nCurrentVolume = 0; m_nCurrentVolume = 0;
m_nMaxVolume = 0; m_nMaxVolume = 0;
bool bRadioWasEverListened = false; bool8 bRadioWasEverListened = FALSE;
for (int i = 0; i < NUM_RADIOS; i++) { for (int i = 0; i < NUM_RADIOS; i++) {
afRadioTime[i] = CStats::GetFavoriteRadioStationList(i); afRadioTime[i] = CStats::GetFavoriteRadioStationList(i);
if (!bRadioWasEverListened && afRadioTime[i] != 0.0f) if (!bRadioWasEverListened && afRadioTime[i] != 0.0f)
bRadioWasEverListened = true; bRadioWasEverListened = TRUE;
} }
if (!bRadioWasEverListened) return; if (!bRadioWasEverListened) return;
@ -125,7 +125,7 @@ cMusicManager::ResetMusicAfterReload()
} }
void void
cMusicManager::SetStartingTrackPositions(uint8 isNewGameTimer) cMusicManager::SetStartingTrackPositions(bool8 isNewGameTimer)
{ {
int pos; int pos;
@ -174,15 +174,15 @@ cMusicManager::SetStartingTrackPositions(uint8 isNewGameTimer)
} }
} }
bool bool8
cMusicManager::Initialise() cMusicManager::Initialise()
{ {
if (!IsInitialised()) { if (!IsInitialised()) {
m_bIsInitialised = true; m_bIsInitialised = TRUE;
SetStartingTrackPositions(false); SetStartingTrackPositions(FALSE);
m_bResetTimers = false; m_bResetTimers = FALSE;
m_nResetTime = 0; m_nResetTime = 0;
m_bRadioSetByScript = false; m_bRadioSetByScript = FALSE;
m_nRadioStationScript = WILDSTYLE; m_nRadioStationScript = WILDSTYLE;
m_nRadioPosition = -1; m_nRadioPosition = -1;
m_nRadioInCar = NO_TRACK; m_nRadioInCar = NO_TRACK;
@ -192,18 +192,18 @@ cMusicManager::Initialise()
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
m_nUpcomingMusicMode = MUSICMODE_DISABLED; m_nUpcomingMusicMode = MUSICMODE_DISABLED;
m_nMusicMode = MUSICMODE_DISABLED; m_nMusicMode = MUSICMODE_DISABLED;
m_FrontendLoopFlag = false; m_FrontendLoopFlag = FALSE;
m_bTrackChangeStarted = false; m_bTrackChangeStarted = FALSE;
m_nNextTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
m_nNextLoopFlag = false; m_nNextLoopFlag = FALSE;
m_bVerifyNextTrackStartedToPlay = false; m_bVerifyNextTrackStartedToPlay = FALSE;
m_bGameplayAllowsRadio = false; m_bGameplayAllowsRadio = FALSE;
m_bRadioStreamReady = false; m_bRadioStreamReady = FALSE;
nFramesSinceCutsceneEnded = -1; nFramesSinceCutsceneEnded = -1;
m_bUserResumedGame = false; m_bUserResumedGame = FALSE;
m_bMusicModeChangeStarted = false; m_bMusicModeChangeStarted = FALSE;
m_nMusicModeToBeSet = MUSICMODE_DISABLED; m_nMusicModeToBeSet = MUSICMODE_DISABLED;
m_bEarlyFrontendTrack = false; m_bEarlyFrontendTrack = FALSE;
m_nVolumeLatency = 0; m_nVolumeLatency = 0;
m_nCurrentVolume = 0; m_nCurrentVolume = 0;
m_nMaxVolume = 0; m_nMaxVolume = 0;
@ -220,7 +220,7 @@ cMusicManager::Terminate()
SampleManager.StopStreamedFile(0); SampleManager.StopStreamedFile(0);
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
} }
m_bIsInitialised = false; m_bIsInitialised = FALSE;
} }
void void
@ -230,29 +230,29 @@ cMusicManager::SetRadioChannelByScript(uint32 station, int32 pos)
if (station == STREAMED_SOUND_RADIO_MP3_PLAYER) if (station == STREAMED_SOUND_RADIO_MP3_PLAYER)
station = STREAMED_SOUND_CITY_AMBIENT; station = STREAMED_SOUND_CITY_AMBIENT;
if (station <= STREAMED_SOUND_RADIO_POLICE) { if (station <= STREAMED_SOUND_RADIO_POLICE) {
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;
} }
} }
} }
bool bool8
cMusicManager::PlayerInCar() cMusicManager::PlayerInCar()
{ {
CVehicle *vehicle = AudioManager.FindVehicleOfPlayer(); CVehicle *vehicle = AudioManager.FindVehicleOfPlayer();
if(!vehicle) if(!vehicle)
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 (vehicle->GetStatus() == STATUS_WRECKED) if (vehicle->GetStatus() == STATUS_WRECKED)
return false; return FALSE;
return true; return TRUE;
} }
uint32 uint32
@ -325,16 +325,16 @@ cMusicManager::ChangeMusicMode(uint8 mode)
while (SampleManager.IsStreamPlaying(0)) while (SampleManager.IsStreamPlaying(0))
SampleManager.StopStreamedFile(0); SampleManager.StopStreamedFile(0);
m_nMusicMode = m_nUpcomingMusicMode; m_nMusicMode = m_nUpcomingMusicMode;
m_bMusicModeChangeStarted = false; m_bMusicModeChangeStarted = FALSE;
m_bTrackChangeStarted = false; m_bTrackChangeStarted = FALSE;
m_nNextTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
m_nNextLoopFlag = false; m_nNextLoopFlag = FALSE;
m_bVerifyNextTrackStartedToPlay = false; m_bVerifyNextTrackStartedToPlay = FALSE;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
m_nFrontendTrack = NO_TRACK; m_nFrontendTrack = NO_TRACK;
m_bAnnouncementInProgress = false; m_bAnnouncementInProgress = FALSE;
m_nAnnouncement = NO_TRACK; m_nAnnouncement = NO_TRACK;
g_bAnnouncementReadPosAlready = false; g_bAnnouncementReadPosAlready = FALSE;
break; break;
case MUSICMODE_DISABLE: m_nUpcomingMusicMode = MUSICMODE_DISABLED; break; case MUSICMODE_DISABLE: m_nUpcomingMusicMode = MUSICMODE_DISABLED; break;
default: return; default: return;
@ -344,7 +344,7 @@ cMusicManager::ChangeMusicMode(uint8 mode)
void void
cMusicManager::ResetTimers(int32 time) cMusicManager::ResetTimers(int32 time)
{ {
m_bResetTimers = true; m_bResetTimers = TRUE;
m_nResetTime = time; m_nResetTime = time;
} }
@ -352,11 +352,11 @@ 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;
} }
static bool bRadioStatsRecorded = false; static bool8 bRadioStatsRecorded = FALSE;
if (!m_bIsInitialised || m_bDisabled) return; if (!m_bIsInitialised || m_bDisabled) return;
@ -369,39 +369,39 @@ cMusicManager::Service()
{ {
case MUSICMODE_FRONTEND: ServiceFrontEndMode(); break; case MUSICMODE_FRONTEND: ServiceFrontEndMode(); break;
case MUSICMODE_GAME: ServiceGameMode(); break; case MUSICMODE_GAME: ServiceGameMode(); break;
case MUSICMODE_CUTSCENE: SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, 1, 0); break; case MUSICMODE_CUTSCENE: SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, TRUE, 0); break;
} }
} }
else else
m_nMusicMode = MUSICMODE_DISABLED; m_nMusicMode = MUSICMODE_DISABLED;
} else { } else {
m_bMusicModeChangeStarted = true; m_bMusicModeChangeStarted = TRUE;
if (!m_bUserResumedGame && !AudioManager.m_nUserPause && AudioManager.m_nPreviousUserPause) if (!m_bUserResumedGame && !AudioManager.m_nUserPause && AudioManager.m_nPreviousUserPause)
m_bUserResumedGame = true; m_bUserResumedGame = TRUE;
if (AudioManager.m_FrameCounter % 4 == 0) { if (AudioManager.m_FrameCounter % 4 == 0) {
gNumRetunePresses = 0; gNumRetunePresses = 0;
gRetuneCounter = 0; gRetuneCounter = 0;
m_bSetNextStation = false; m_bSetNextStation = FALSE;
if (SampleManager.IsStreamPlaying(0)) { if (SampleManager.IsStreamPlaying(0)) {
if (m_nPlayingTrack != NO_TRACK && !bRadioStatsRecorded) if (m_nPlayingTrack != NO_TRACK && !bRadioStatsRecorded)
{ {
RecordRadioStats(); RecordRadioStats();
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();
bRadioStatsRecorded = true; bRadioStatsRecorded = TRUE;
} }
SampleManager.StopStreamedFile(0); SampleManager.StopStreamedFile(0);
} else { } else {
bRadioStatsRecorded = false; bRadioStatsRecorded = FALSE;
m_nMusicMode = m_nMusicModeToBeSet; m_nMusicMode = m_nMusicModeToBeSet;
m_bMusicModeChangeStarted = false; m_bMusicModeChangeStarted = FALSE;
m_bTrackChangeStarted = false; m_bTrackChangeStarted = FALSE;
m_nNextTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
m_nNextLoopFlag = false; m_nNextLoopFlag = FALSE;
m_bVerifyNextTrackStartedToPlay = false; m_bVerifyNextTrackStartedToPlay = FALSE;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
if (m_bEarlyFrontendTrack) if (m_bEarlyFrontendTrack)
m_bEarlyFrontendTrack = false; m_bEarlyFrontendTrack = FALSE;
else else
m_nFrontendTrack = NO_TRACK; m_nFrontendTrack = NO_TRACK;
} }
@ -412,15 +412,15 @@ cMusicManager::Service()
void void
cMusicManager::ServiceFrontEndMode() cMusicManager::ServiceFrontEndMode()
{ {
static bool bRadioStatsRecorded = false; static bool8 bRadioStatsRecorded = FALSE;
if (m_bAnnouncementInProgress) { if (m_bAnnouncementInProgress) {
SampleManager.StopStreamedFile(0); SampleManager.StopStreamedFile(0);
if (SampleManager.IsStreamPlaying(0)) if (SampleManager.IsStreamPlaying(0))
return; return;
g_bAnnouncementReadPosAlready = false; g_bAnnouncementReadPosAlready = FALSE;
m_nAnnouncement = NO_TRACK; m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false; m_bAnnouncementInProgress = FALSE;
m_nNextTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
m_nFrontendTrack = NO_TRACK; m_nFrontendTrack = NO_TRACK;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
@ -439,7 +439,7 @@ cMusicManager::ServiceFrontEndMode()
else { else {
if (m_nCurrentVolume < m_nMaxVolume) if (m_nCurrentVolume < m_nMaxVolume)
m_nCurrentVolume = Min(m_nMaxVolume, m_nCurrentVolume + 6); m_nCurrentVolume = Min(m_nMaxVolume, m_nCurrentVolume + 6);
SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, FALSE, 0);
} }
} else { } else {
if (m_nPlayingTrack == STREAMED_SOUND_RADIO_MP3_PLAYER) if (m_nPlayingTrack == STREAMED_SOUND_RADIO_MP3_PLAYER)
@ -448,13 +448,13 @@ cMusicManager::ServiceFrontEndMode()
ChangeMusicMode(MUSICMODE_GAME); ChangeMusicMode(MUSICMODE_GAME);
} }
} else { } else {
m_bTrackChangeStarted = true; m_bTrackChangeStarted = TRUE;
if (m_bVerifyNextTrackStartedToPlay || !SampleManager.IsStreamPlaying(0)) { if (m_bVerifyNextTrackStartedToPlay || !SampleManager.IsStreamPlaying(0)) {
bRadioStatsRecorded = false; bRadioStatsRecorded = FALSE;
if (SampleManager.IsStreamPlaying(0) || m_nNextTrack == NO_TRACK) { if (SampleManager.IsStreamPlaying(0) || m_nNextTrack == NO_TRACK) {
m_nPlayingTrack = m_nNextTrack; m_nPlayingTrack = m_nNextTrack;
m_bVerifyNextTrackStartedToPlay = false; m_bVerifyNextTrackStartedToPlay = FALSE;
m_bTrackChangeStarted = false; m_bTrackChangeStarted = FALSE;
} else { } else {
uint32 trackStartPos = (m_nNextTrack > STREAMED_SOUND_RADIO_POLICE) ? 0 : GetTrackStartPos(m_nNextTrack); uint32 trackStartPos = (m_nNextTrack > STREAMED_SOUND_RADIO_POLICE) ? 0 : GetTrackStartPos(m_nNextTrack);
if (m_nNextTrack != NO_TRACK) { if (m_nNextTrack != NO_TRACK) {
@ -463,10 +463,10 @@ cMusicManager::ServiceFrontEndMode()
m_nVolumeLatency = 3; m_nVolumeLatency = 3;
m_nCurrentVolume = 0; m_nCurrentVolume = 0;
m_nMaxVolume = 100; m_nMaxVolume = 100;
SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, FALSE, 0);
if (m_nNextTrack < STREAMED_SOUND_CITY_AMBIENT) if (m_nNextTrack < STREAMED_SOUND_CITY_AMBIENT)
m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode(); m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode();
m_bVerifyNextTrackStartedToPlay = true; m_bVerifyNextTrackStartedToPlay = TRUE;
} }
} }
} else { } else {
@ -474,9 +474,9 @@ cMusicManager::ServiceFrontEndMode()
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();
RecordRadioStats(); RecordRadioStats();
bRadioStatsRecorded = true; bRadioStatsRecorded = TRUE;
} }
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(0, 63, FALSE, 0);
SampleManager.StopStreamedFile(0); SampleManager.StopStreamedFile(0);
} }
} }
@ -488,7 +488,7 @@ cMusicManager::ServiceGameMode()
CPed *ped = FindPlayerPed(); CPed *ped = FindPlayerPed();
CVehicle *vehicle = AudioManager.FindVehicleOfPlayer(); CVehicle *vehicle = AudioManager.FindVehicleOfPlayer();
m_bRadioStreamReady = m_bGameplayAllowsRadio; m_bRadioStreamReady = m_bGameplayAllowsRadio;
m_bGameplayAllowsRadio = false; m_bGameplayAllowsRadio = FALSE;
switch (CGame::currArea) switch (CGame::currArea)
{ {
@ -499,14 +499,14 @@ cMusicManager::ServiceGameMode()
case AREA_BLOOD: case AREA_BLOOD:
case AREA_OVALRING: case AREA_OVALRING:
case AREA_MALIBU_CLUB: case AREA_MALIBU_CLUB:
m_bGameplayAllowsRadio = false; m_bGameplayAllowsRadio = FALSE;
break; break;
default: default:
if (SampleManager.GetMusicVolume()) { if (SampleManager.GetMusicVolume()) {
if (PlayerInCar()) if (PlayerInCar())
m_bGameplayAllowsRadio = true; m_bGameplayAllowsRadio = TRUE;
} else } else
m_bGameplayAllowsRadio = false; m_bGameplayAllowsRadio = FALSE;
break; break;
} }
@ -514,7 +514,7 @@ cMusicManager::ServiceGameMode()
nFramesSinceCutsceneEnded = -1; nFramesSinceCutsceneEnded = -1;
gNumRetunePresses = 0; gNumRetunePresses = 0;
gRetuneCounter = 0; gRetuneCounter = 0;
m_bSetNextStation = false; m_bSetNextStation = FALSE;
} else if (ped) { } else if (ped) {
if(!ped->DyingOrDead() && vehicle) { if(!ped->DyingOrDead() && vehicle) {
#ifdef GTA_PC #ifdef GTA_PC
@ -567,11 +567,11 @@ cMusicManager::ServiceGameMode()
if (m_bUserResumedGame) if (m_bUserResumedGame)
{ {
m_bRadioStreamReady = false; m_bRadioStreamReady = FALSE;
m_bUserResumedGame = false; m_bUserResumedGame = FALSE;
} }
if (m_nPlayingTrack == NO_TRACK && m_nFrontendTrack == NO_TRACK) if (m_nPlayingTrack == NO_TRACK && m_nFrontendTrack == NO_TRACK)
m_bRadioStreamReady = false; m_bRadioStreamReady = FALSE;
if (m_bGameplayAllowsRadio) if (m_bGameplayAllowsRadio)
{ {
@ -594,7 +594,7 @@ cMusicManager::ServiceGameMode()
m_aTracks[m_nFrontendTrack].m_nPosition = m_nRadioPosition; m_aTracks[m_nFrontendTrack].m_nPosition = m_nRadioPosition;
m_aTracks[m_nFrontendTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); m_aTracks[m_nFrontendTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
} }
m_bRadioSetByScript = false; m_bRadioSetByScript = FALSE;
return; return;
} }
@ -605,7 +605,7 @@ cMusicManager::ServiceGameMode()
if (m_nAnnouncement < NO_TRACK) { if (m_nAnnouncement < NO_TRACK) {
if ((m_bAnnouncementInProgress || m_nFrontendTrack == m_nPlayingTrack) && ServiceAnnouncement()) { if ((m_bAnnouncementInProgress || m_nFrontendTrack == m_nPlayingTrack) && ServiceAnnouncement()) {
if (m_bAnnouncementInProgress) { if (m_bAnnouncementInProgress) {
m_bSetNextStation = false; m_bSetNextStation = FALSE;
gNumRetunePresses = 0; gNumRetunePresses = 0;
gRetuneCounter = 0; gRetuneCounter = 0;
return; return;
@ -613,7 +613,7 @@ cMusicManager::ServiceGameMode()
if(m_nAnnouncement == NO_TRACK) { if(m_nAnnouncement == NO_TRACK) {
m_nNextTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
m_nFrontendTrack = GetCarTuning(); m_nFrontendTrack = GetCarTuning();
m_bSetNextStation = false; m_bSetNextStation = FALSE;
gRetuneCounter = 0; gRetuneCounter = 0;
gNumRetunePresses = 0; gNumRetunePresses = 0;
} }
@ -635,7 +635,7 @@ cMusicManager::ServiceGameMode()
if(gRetuneCounter > 1) if(gRetuneCounter > 1)
gRetuneCounter--; gRetuneCounter--;
else if(gRetuneCounter == 1) { else if(gRetuneCounter == 1) {
m_bSetNextStation = true; m_bSetNextStation = TRUE;
gRetuneCounter = 0; gRetuneCounter = 0;
} }
} }
@ -644,7 +644,7 @@ cMusicManager::ServiceGameMode()
{ {
if (--gRetuneCounter == 0) if (--gRetuneCounter == 0)
{ {
m_bSetNextStation = true; m_bSetNextStation = TRUE;
gRetuneCounter = 0; gRetuneCounter = 0;
} }
} }
@ -694,7 +694,7 @@ cMusicManager::ServiceGameMode()
SetUpCorrectAmbienceTrack(); SetUpCorrectAmbienceTrack();
ServiceTrack(vehicle, ped); ServiceTrack(vehicle, ped);
if (m_bSetNextStation) if (m_bSetNextStation)
m_bSetNextStation = false; m_bSetNextStation = FALSE;
return; return;
} }
if (UsesPoliceRadio(vehicle)) if (UsesPoliceRadio(vehicle))
@ -713,13 +713,13 @@ cMusicManager::ServiceGameMode()
gRetuneCounter = 0; gRetuneCounter = 0;
gNumRetunePresses = 0; gNumRetunePresses = 0;
m_bSetNextStation = false; m_bSetNextStation = FALSE;
m_bRadioSetByScript = false; m_bRadioSetByScript = FALSE;
if (m_nFrontendTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nFrontendTrack <= STREAMED_SOUND_AMBSIL_AMBIENT) if (m_nFrontendTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nFrontendTrack <= STREAMED_SOUND_AMBSIL_AMBIENT)
SetUpCorrectAmbienceTrack(); SetUpCorrectAmbienceTrack();
ServiceTrack(vehicle, ped); ServiceTrack(vehicle, ped);
if (m_bSetNextStation) if (m_bSetNextStation)
m_bSetNextStation = false; m_bSetNextStation = FALSE;
return; return;
} }
@ -728,9 +728,9 @@ cMusicManager::ServiceGameMode()
SampleManager.StopStreamedFile(0); SampleManager.StopStreamedFile(0);
if (SampleManager.IsStreamPlaying(0)) if (SampleManager.IsStreamPlaying(0))
return; return;
g_bAnnouncementReadPosAlready = false; g_bAnnouncementReadPosAlready = FALSE;
m_nAnnouncement = NO_TRACK; m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false; m_bAnnouncementInProgress = FALSE;
m_nNextTrack = NO_TRACK; m_nNextTrack = NO_TRACK;
m_nFrontendTrack = NO_TRACK; m_nFrontendTrack = NO_TRACK;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
@ -808,7 +808,7 @@ GetHeightScale()
} }
void void
cMusicManager::ComputeAmbienceVol(uint8 reset, uint8& outVolume) cMusicManager::ComputeAmbienceVol(bool8 reset, uint8& outVolume)
{ {
static float fVol = 0.0f; static float fVol = 0.0f;
@ -868,7 +868,7 @@ cMusicManager::ComputeAmbienceVol(uint8 reset, uint8& outVolume)
outVolume = (90.0f - fHeightScale) / 50.0f * fVol; outVolume = (90.0f - fHeightScale) / 50.0f * fVol;
} }
bool bool8
cMusicManager::ServiceAnnouncement() cMusicManager::ServiceAnnouncement()
{ {
if (m_bAnnouncementInProgress) { if (m_bAnnouncementInProgress) {
@ -876,36 +876,36 @@ cMusicManager::ServiceAnnouncement()
m_nPlayingTrack = m_nNextTrack; m_nPlayingTrack = m_nNextTrack;
else if (m_nPlayingTrack != NO_TRACK) { else if (m_nPlayingTrack != NO_TRACK) {
m_nAnnouncement = NO_TRACK; m_nAnnouncement = NO_TRACK;
m_bAnnouncementInProgress = false; m_bAnnouncementInProgress = FALSE;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
} }
return true; return TRUE;
} else if (SampleManager.IsStreamPlaying(0)) { } else if (SampleManager.IsStreamPlaying(0)) {
if (m_nPlayingTrack != NO_TRACK && !g_bAnnouncementReadPosAlready) { if (m_nPlayingTrack != NO_TRACK && !g_bAnnouncementReadPosAlready) {
RecordRadioStats(); RecordRadioStats();
m_aTracks[m_nPlayingTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0); m_aTracks[m_nPlayingTrack].m_nPosition = SampleManager.GetStreamedFilePosition(0);
g_bAnnouncementReadPosAlready = true; g_bAnnouncementReadPosAlready = TRUE;
m_aTracks[m_nPlayingTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode(); m_aTracks[m_nPlayingTrack].m_nLastPosCheckTimer = CTimer::GetTimeInMillisecondsPauseMode();
} }
SampleManager.StopStreamedFile(0); SampleManager.StopStreamedFile(0);
} else { } else {
g_bAnnouncementReadPosAlready = false; g_bAnnouncementReadPosAlready = FALSE;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
m_nNextTrack = m_nAnnouncement; m_nNextTrack = m_nAnnouncement;
SampleManager.SetStreamedFileLoopFlag(0, 0); SampleManager.SetStreamedFileLoopFlag(0, 0);
SampleManager.StartStreamedFile(m_nNextTrack, 0, 0); SampleManager.StartStreamedFile(m_nNextTrack, 0, 0);
SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, FALSE, 0);
m_bAnnouncementInProgress = true; m_bAnnouncementInProgress = TRUE;
} }
return true; return TRUE;
} }
void void
cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped) cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
{ {
static bool bRadioStatsRecorded = false; static bool8 bRadioStatsRecorded = FALSE;
static bool bRadioStatsRecorded2 = false; static bool8 bRadioStatsRecorded2 = FALSE;
uint8 volume; uint8 volume;
if (!m_bTrackChangeStarted) if (!m_bTrackChangeStarted)
m_nNextTrack = m_nFrontendTrack; m_nNextTrack = m_nFrontendTrack;
@ -915,30 +915,30 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
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();
RecordRadioStats(); RecordRadioStats();
bRadioStatsRecorded = true; bRadioStatsRecorded = TRUE;
} }
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(0, 63, FALSE, 0);
SampleManager.StopStreamedFile(0); SampleManager.StopStreamedFile(0);
} }
return; return;
} }
if (bRadioStatsRecorded) { if (bRadioStatsRecorded) {
bRadioStatsRecorded = false; bRadioStatsRecorded = FALSE;
m_nPlayingTrack = NO_TRACK; m_nPlayingTrack = NO_TRACK;
} }
if (m_nNextTrack != m_nPlayingTrack) if (m_nNextTrack != m_nPlayingTrack)
{ {
m_bTrackChangeStarted = true; m_bTrackChangeStarted = TRUE;
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(0, 63, FALSE, 0);
if (!(AudioManager.m_FrameCounter & 1)) { if (!(AudioManager.m_FrameCounter & 1)) {
if (m_bVerifyNextTrackStartedToPlay || !SampleManager.IsStreamPlaying(0)) { if (m_bVerifyNextTrackStartedToPlay || !SampleManager.IsStreamPlaying(0)) {
bRadioStatsRecorded2 = false; bRadioStatsRecorded2 = FALSE;
if (SampleManager.IsStreamPlaying(0)) { if (SampleManager.IsStreamPlaying(0)) {
m_nPlayingTrack = m_nNextTrack; m_nPlayingTrack = m_nNextTrack;
m_bVerifyNextTrackStartedToPlay = false; m_bVerifyNextTrackStartedToPlay = FALSE;
m_bTrackChangeStarted = false; m_bTrackChangeStarted = FALSE;
if (veh) { if (veh) {
#ifdef FIX_BUGS #ifdef FIX_BUGS
if (m_nPlayingTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nPlayingTrack <= STREAMED_SOUND_AMBSIL_AMBIENT) if (m_nPlayingTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nPlayingTrack <= STREAMED_SOUND_AMBSIL_AMBIENT)
@ -962,16 +962,16 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
m_nVolumeLatency = 10; m_nVolumeLatency = 10;
m_nCurrentVolume = 0; m_nCurrentVolume = 0;
m_nMaxVolume = 100; m_nMaxVolume = 100;
SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, FALSE, 0);
} }
else else
{ {
ComputeAmbienceVol(true, volume); ComputeAmbienceVol(TRUE, volume);
SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0); SampleManager.SetStreamedVolumeAndPan(volume, 63, TRUE, 0);
} }
if (m_nNextTrack < STREAMED_SOUND_CITY_AMBIENT) if (m_nNextTrack < STREAMED_SOUND_CITY_AMBIENT)
m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode(); m_nLastTrackServiceTime = CTimer::GetTimeInMillisecondsPauseMode();
m_bVerifyNextTrackStartedToPlay = true; m_bVerifyNextTrackStartedToPlay = TRUE;
} }
} }
} else { } else {
@ -981,7 +981,7 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
{ {
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();
bRadioStatsRecorded2 = true; bRadioStatsRecorded2 = TRUE;
RecordRadioStats(); RecordRadioStats();
if (m_nPlayingTrack >= STREAMED_SOUND_HAVANA_CITY_AMBIENT && m_nPlayingTrack <= STREAMED_SOUND_HAVANA_BEACH_AMBIENT) if (m_nPlayingTrack >= STREAMED_SOUND_HAVANA_CITY_AMBIENT && m_nPlayingTrack <= STREAMED_SOUND_HAVANA_BEACH_AMBIENT)
{ {
@ -989,7 +989,7 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_HURRICANE, 0.0); AudioManager.PlayOneShot(AudioManager.m_nFrontEndEntity, SOUND_FRONTEND_HURRICANE, 0.0);
} }
} }
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(0, 63, FALSE, 0);
SampleManager.StopStreamedFile(0); SampleManager.StopStreamedFile(0);
} }
} }
@ -998,8 +998,8 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
if (m_nPlayingTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nPlayingTrack <= STREAMED_SOUND_AMBSIL_AMBIENT) if (m_nPlayingTrack >= STREAMED_SOUND_CITY_AMBIENT && m_nPlayingTrack <= STREAMED_SOUND_AMBSIL_AMBIENT)
{ {
ComputeAmbienceVol(false, volume); ComputeAmbienceVol(FALSE, volume);
SampleManager.SetStreamedVolumeAndPan(volume, 63, 1, 0); SampleManager.SetStreamedVolumeAndPan(volume, 63, TRUE, 0);
return; return;
} }
if (CTimer::GetIsSlowMotionActive()) if (CTimer::GetIsSlowMotionActive())
@ -1009,7 +1009,7 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
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))
{ {
@ -1026,17 +1026,17 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
} }
if (gRetuneCounter != 0) if (gRetuneCounter != 0)
volume = 0; volume = 0;
SampleManager.SetStreamedVolumeAndPan(volume, pan, 0, 0); SampleManager.SetStreamedVolumeAndPan(volume, pan, FALSE, 0);
} }
else if (AudioManager.ShouldDuckMissionAudio(0) || AudioManager.ShouldDuckMissionAudio(1)) else if (AudioManager.ShouldDuckMissionAudio(0) || AudioManager.ShouldDuckMissionAudio(1))
SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, FALSE, 0);
else if (gRetuneCounter != 0) else if (gRetuneCounter != 0)
SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(0, 63, FALSE, 0);
else else
SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(m_nCurrentVolume, 63, FALSE, 0);
} }
} else if (AudioManager.ShouldDuckMissionAudio(0) || AudioManager.ShouldDuckMissionAudio(1)) { } else if (AudioManager.ShouldDuckMissionAudio(0) || AudioManager.ShouldDuckMissionAudio(1)) {
SampleManager.SetStreamedVolumeAndPan(Min(m_nCurrentVolume, 25), 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(Min(m_nCurrentVolume, 25), 63, FALSE, 0);
nFramesSinceCutsceneEnded = 0; nFramesSinceCutsceneEnded = 0;
} else { } else {
if (nFramesSinceCutsceneEnded == -1) if (nFramesSinceCutsceneEnded == -1)
@ -1058,7 +1058,7 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped)
} }
if (gRetuneCounter != 0) if (gRetuneCounter != 0)
volume = 0; volume = 0;
SampleManager.SetStreamedVolumeAndPan(volume, 63, 0, 0); SampleManager.SetStreamedVolumeAndPan(volume, 63, FALSE, 0);
} }
if (m_nVolumeLatency > 0) if (m_nVolumeLatency > 0)
m_nVolumeLatency--; m_nVolumeLatency--;
@ -1074,7 +1074,7 @@ cMusicManager::PreloadCutSceneMusic(uint32 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_nPlayingTrack = track; m_nPlayingTrack = track;
} }
} }
@ -1096,14 +1096,14 @@ cMusicManager::StopCutSceneMusic(void)
} }
void void
cMusicManager::PlayFrontEndTrack(uint32 track, uint8 loopFlag) cMusicManager::PlayFrontEndTrack(uint32 track, bool8 loopFlag)
{ {
if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS && (m_nUpcomingMusicMode == MUSICMODE_FRONTEND || m_nMusicMode == MUSICMODE_FRONTEND)) if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS && (m_nUpcomingMusicMode == MUSICMODE_FRONTEND || m_nMusicMode == MUSICMODE_FRONTEND))
{ {
m_nFrontendTrack = track; m_nFrontendTrack = track;
m_FrontendLoopFlag = loopFlag; m_FrontendLoopFlag = loopFlag;
if (m_nMusicMode != MUSICMODE_FRONTEND) if (m_nMusicMode != MUSICMODE_FRONTEND)
m_bEarlyFrontendTrack = true; m_bEarlyFrontendTrack = TRUE;
} }
} }
@ -1201,7 +1201,7 @@ cMusicManager::GetFavouriteRadioStation()
return favstation; return favstation;
} }
bool bool8
cMusicManager::CheckForMusicInterruptions() cMusicManager::CheckForMusicInterruptions()
{ {
return (m_nPlayingTrack == STREAMED_SOUND_MISSION_COMPLETED) || (m_nPlayingTrack == STREAMED_SOUND_CUTSCENE_FINALE); return (m_nPlayingTrack == STREAMED_SOUND_MISSION_COMPLETED) || (m_nPlayingTrack == STREAMED_SOUND_CUTSCENE_FINALE);
@ -1361,7 +1361,7 @@ cMusicManager::DisplayRadioStationName()
#endif #endif
} }
bool bool8
cMusicManager::UsesPoliceRadio(CVehicle *veh) cMusicManager::UsesPoliceRadio(CVehicle *veh)
{ {
switch (veh->GetModelIndex()) switch (veh->GetModelIndex())
@ -1371,18 +1371,18 @@ cMusicManager::UsesPoliceRadio(CVehicle *veh)
case MI_COASTG: case MI_COASTG:
case MI_RHINO: case MI_RHINO:
case MI_BARRACKS: case MI_BARRACKS:
return true; return TRUE;
case MI_MRWHOOP: case MI_MRWHOOP:
case MI_HUNTER: case MI_HUNTER:
return false; return FALSE;
} }
return veh->UsesSiren(); return veh->UsesSiren();
} }
bool bool8
cMusicManager::UsesTaxiRadio(CVehicle *veh) cMusicManager::UsesTaxiRadio(CVehicle *veh)
{ {
if (veh->GetModelIndex() != MI_KAUFMAN) return false; if (veh->GetModelIndex() != MI_KAUFMAN) return FALSE;
return CTheScripts::bPlayerHasMetDebbieHarry; return CTheScripts::bPlayerHasMetDebbieHarry;
} }
@ -1391,10 +1391,10 @@ cMusicManager::ServiceAmbience()
{ {
} }
bool bool8
cMusicManager::ChangeRadioChannel() cMusicManager::ChangeRadioChannel()
{ {
return true; return TRUE;
} }
// these two are empty // these two are empty

View File

@ -16,18 +16,18 @@ class CPed;
class cMusicManager class cMusicManager
{ {
public: public:
bool m_bIsInitialised; bool8 m_bIsInitialised;
bool m_bDisabled; bool8 m_bDisabled;
bool m_bSetNextStation; bool8 m_bSetNextStation;
uint8 m_nVolumeLatency; uint8 m_nVolumeLatency;
uint8 m_nCurrentVolume; uint8 m_nCurrentVolume;
uint8 m_nMaxVolume; uint8 m_nMaxVolume;
uint32 m_nAnnouncement; uint32 m_nAnnouncement;
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;
bool m_bRadioSetByScript; bool8 m_bRadioSetByScript;
uint8 m_nRadioStationScript; uint8 m_nRadioStationScript;
int32 m_nRadioPosition; int32 m_nRadioPosition;
uint32 m_nRadioInCar; uint32 m_nRadioInCar;
@ -35,40 +35,40 @@ public:
uint32 m_nPlayingTrack; uint32 m_nPlayingTrack;
uint8 m_nUpcomingMusicMode; uint8 m_nUpcomingMusicMode;
uint8 m_nMusicMode; uint8 m_nMusicMode;
bool m_FrontendLoopFlag; bool8 m_FrontendLoopFlag;
bool m_bTrackChangeStarted; bool8 m_bTrackChangeStarted;
uint32 m_nNextTrack; uint32 m_nNextTrack;
bool m_nNextLoopFlag; bool8 m_nNextLoopFlag;
bool m_bVerifyNextTrackStartedToPlay; bool8 m_bVerifyNextTrackStartedToPlay;
bool m_bGameplayAllowsRadio; bool8 m_bGameplayAllowsRadio;
bool m_bRadioStreamReady; bool8 m_bRadioStreamReady;
int8 nFramesSinceCutsceneEnded; int8 nFramesSinceCutsceneEnded;
bool m_bUserResumedGame; bool8 m_bUserResumedGame;
bool m_bMusicModeChangeStarted; bool8 m_bMusicModeChangeStarted;
uint8 m_nMusicModeToBeSet; uint8 m_nMusicModeToBeSet;
bool m_bEarlyFrontendTrack; bool8 m_bEarlyFrontendTrack;
float aListenTimeArray[NUM_RADIOS]; float aListenTimeArray[NUM_RADIOS];
float m_nLastTrackServiceTime; float m_nLastTrackServiceTime;
public: public:
cMusicManager(); cMusicManager();
bool IsInitialised() { return m_bIsInitialised; } bool8 IsInitialised() { return m_bIsInitialised; }
uint8 GetMusicMode() { return m_nMusicMode; } uint8 GetMusicMode() { return m_nMusicMode; }
uint32 GetCurrentTrack() { return m_nPlayingTrack; } uint32 GetCurrentTrack() { return m_nPlayingTrack; }
void ResetMusicAfterReload(); void ResetMusicAfterReload();
void SetStartingTrackPositions(uint8 isNewGameTimer); void SetStartingTrackPositions(bool8 isNewGameTimer);
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(uint32); void PlayAnnouncement(uint32);
void PlayFrontEndTrack(uint32, uint8); void PlayFrontEndTrack(uint32, bool8);
void PreloadCutSceneMusic(uint32); void PreloadCutSceneMusic(uint32);
void PlayPreloadedCutSceneMusic(void); void PlayPreloadedCutSceneMusic(void);
void StopCutSceneMusic(void); void StopCutSceneMusic(void);
@ -83,16 +83,16 @@ public:
void ServiceAmbience(); void ServiceAmbience();
void ServiceTrack(CVehicle *veh, CPed *ped); void ServiceTrack(CVehicle *veh, CPed *ped);
bool UsesPoliceRadio(CVehicle *veh); bool8 UsesPoliceRadio(CVehicle *veh);
bool UsesTaxiRadio(CVehicle *veh); bool8 UsesTaxiRadio(CVehicle *veh);
uint32 GetTrackStartPos(uint32 track); uint32 GetTrackStartPos(uint32 track);
void ComputeAmbienceVol(uint8 reset, uint8& outVolume); void ComputeAmbienceVol(bool8 reset, uint8& outVolume);
bool ServiceAnnouncement(); bool8 ServiceAnnouncement();
uint32 GetCarTuning(); uint32 GetCarTuning();
uint32 GetNextCarTuning(); uint32 GetNextCarTuning();
bool ChangeRadioChannel(); bool8 ChangeRadioChannel();
void RecordRadioStats(); void RecordRadioStats();
void SetUpCorrectAmbienceTrack(); void SetUpCorrectAmbienceTrack();
float *GetListenTimeArray(); float *GetListenTimeArray();
@ -100,7 +100,7 @@ public:
uint32 GetFavouriteRadioStation(); uint32 GetFavouriteRadioStation();
void SetMalibuClubTrackPos(uint8 pos); void SetMalibuClubTrackPos(uint8 pos);
void SetStripClubTrackPos(uint8 pos); void SetStripClubTrackPos(uint8 pos);
bool CheckForMusicInterruptions(); bool8 CheckForMusicInterruptions();
void Enable(); void Enable();
void Disable(); void Disable();
@ -109,5 +109,5 @@ public:
VALIDATE_SIZE(cMusicManager, 0x95C); VALIDATE_SIZE(cMusicManager, 0x95C);
extern cMusicManager MusicManager; extern cMusicManager MusicManager;
extern bool g_bAnnouncementReadPosAlready; // we have a symbol of this so it was declared in .h extern bool8 g_bAnnouncementReadPosAlready; // we have a symbol of this so it was declared in .h
float GetHeightScale(); float GetHeightScale();

View File

@ -68,8 +68,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;
} }
@ -105,7 +105,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;
@ -113,11 +113,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();
} }
@ -130,7 +130,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;
@ -156,12 +156,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 = 22050; static int32 PoliceChannelFreq = 22050;
@ -171,14 +171,14 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
if (SampleManager.GetChannelUsedFlag(policeChannel)) SampleManager.StopChannel(policeChannel); if (SampleManager.GetChannelUsedFlag(policeChannel)) SampleManager.StopChannel(policeChannel);
if (g_nMissionAudioSfx != NO_SAMPLE && bMissionAudioPhysicalPlayingStatus == 1 && if (g_nMissionAudioSfx != NO_SAMPLE && bMissionAudioPhysicalPlayingStatus == 1 &&
SampleManager.IsStreamPlaying(1)) { SampleManager.IsStreamPlaying(1)) {
SampleManager.PauseStream(1, 1); SampleManager.PauseStream(TRUE, 1);
} }
} else { } else {
if (m_nPreviousUserPause && g_nMissionAudioSfx != NO_SAMPLE && if (m_nPreviousUserPause && g_nMissionAudioSfx != NO_SAMPLE &&
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;
@ -202,7 +202,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;
@ -223,8 +223,8 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
if (gSpecialSuspectLastSeenReport) { if (gSpecialSuspectLastSeenReport) {
gSpecialSuspectLastSeenReport = 0; gSpecialSuspectLastSeenReport = 0;
} else if (sample == SFX_POLICE_RADIO_MESSAGE_NOISE_1) { } else if (sample == SFX_POLICE_RADIO_MESSAGE_NOISE_1) {
bChannelOpen = false; bChannelOpen = FALSE;
processed = true; processed = TRUE;
} }
} }
if (sample == NO_SAMPLE) { if (sample == NO_SAMPLE) {
@ -234,7 +234,7 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
switch (sample) { switch (sample) {
case SFX_POLICE_RADIO_MESSAGE_NOISE_1: case SFX_POLICE_RADIO_MESSAGE_NOISE_1:
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;
} }
@ -251,7 +251,7 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
} }
} }
bool bool8
cAudioManager::SetupCrimeReport() cAudioManager::SetupCrimeReport()
{ {
int16 audioZoneId; int16 audioZoneId;
@ -264,13 +264,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++) {
@ -278,7 +278,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);
@ -317,10 +317,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)
@ -339,7 +339,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
@ -688,7 +688,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;
@ -713,10 +713,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)
@ -728,7 +728,7 @@ cAudioManager::PlaySuspectLastSeen(float x, float y, float z)
m_sPoliceRadioQueue.Add(sample); m_sPoliceRadioQueue.Add(sample);
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_MESSAGE_NOISE_1); m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_MESSAGE_NOISE_1);
m_sPoliceRadioQueue.Add(NO_SAMPLE); m_sPoliceRadioQueue.Add(NO_SAMPLE);
gSpecialSuspectLastSeenReport = true; gSpecialSuspectLastSeenReport = TRUE;
break; break;
} }
} }

View File

@ -135,9 +135,9 @@ class cSampleManager
uint8 m_nMP3BoostVolume; uint8 m_nMP3BoostVolume;
uint8 m_nEffectsFadeVolume; uint8 m_nEffectsFadeVolume;
uint8 m_nMusicFadeVolume; uint8 m_nMusicFadeVolume;
uint8 m_nMonoMode; bool8 m_nMonoMode;
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];
@ -167,16 +167,16 @@ public:
int8 AutoDetect3DProviders(); int8 AutoDetect3DProviders();
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);
@ -185,14 +185,14 @@ public:
void SetMP3BoostVolume (uint8 nVolume); void SetMP3BoostVolume (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);
@ -202,10 +202,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);
@ -214,23 +214,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 (uint32 nFile, uint8 nStream); void PreloadStreamedFile (uint32 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 (uint32 nFile, uint32 nPos, uint8 nStream); bool8 StartStreamedFile (uint32 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);
uint8 GetMusicVolume() const { return m_nMusicVolume; } uint8 GetMusicVolume() const { return m_nMusicVolume; }
void SetStreamedFileLoopFlag(uint8 nLoopFlag, uint8 nStream); void SetStreamedFileLoopFlag(uint8 nLoopFlag, uint8 nStream);

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];
@ -63,11 +63,11 @@ int8 nStreamVolume[MAX_STREAMS];
uint8 nStreamLoopedFlag[MAX_STREAMS]; uint8 nStreamLoopedFlag[MAX_STREAMS];
uint32 _CurMP3Index; uint32 _CurMP3Index;
int32 _CurMP3Pos; int32 _CurMP3Pos;
bool _bIsMp3Active; bool8 _bIsMp3Active;
/////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////
bool _bSampmanInitialised = false; bool8 _bSampmanInitialised = FALSE;
// //
// Miscellaneous globals / defines // Miscellaneous globals / defines
@ -94,7 +94,7 @@ S32 speaker_type=0;
U32 _maxSamples; U32 _maxSamples;
float _fPrevEaxRatioDestination; float _fPrevEaxRatioDestination;
bool _usingMilesFast2D; bool8 _usingMilesFast2D;
float _fEffectsLevel; float _fEffectsLevel;
@ -166,17 +166,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;
@ -203,7 +203,7 @@ set_new_provider(S32 index)
release_existing(); release_existing();
return false; return FALSE;
} }
else else
{ {
@ -234,7 +234,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);
@ -252,11 +252,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;
} }
U32 RadioHandlers[9]; U32 RadioHandlers[9];
@ -459,7 +459,7 @@ cSampleManager::AutoDetect3DProviders()
return -1; return -1;
} }
static bool static bool8
_ResolveLink(char const *path, char *out) _ResolveLink(char const *path, char *out)
{ {
IShellLink* psl; IShellLink* psl;
@ -495,7 +495,7 @@ _ResolveLink(char const *path, char *out)
ppf->Release(); ppf->Release();
psl->Release(); psl->Release();
#endif #endif
return true; return TRUE;
} }
} }
} }
@ -505,15 +505,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];
@ -565,10 +565,10 @@ _FindMP3s(void)
OutputDebugString(filepath); OutputDebugString(filepath);
} }
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);
@ -608,7 +608,7 @@ _FindMP3s(void)
{ {
_pMP3List->pLinkPath = NULL; _pMP3List->pLinkPath = NULL;
} }
bInitFirstEntry = false; bInitFirstEntry = FALSE;
} }
else else
{ {
@ -616,10 +616,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;
@ -643,11 +643,11 @@ _FindMP3s(void)
OutputDebugString(filepath); OutputDebugString(filepath);
} }
bShortcut = true; bShortcut = TRUE;
} }
else else
{ {
bShortcut = false; bShortcut = FALSE;
if ( filepathlen > MAX_PATH ) if ( filepathlen > MAX_PATH )
{ {
@ -690,7 +690,7 @@ _FindMP3s(void)
pList = _pMP3List; pList = _pMP3List;
bInitFirstEntry = false; bInitFirstEntry = FALSE;
} }
else else
{ {
@ -718,11 +718,11 @@ _FindMP3s(void)
OutputDebugString(filepath); OutputDebugString(filepath);
} }
bShortcut = true; bShortcut = TRUE;
} }
else else
{ {
bShortcut = false; bShortcut = FALSE;
} }
} }
@ -834,7 +834,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;
@ -847,7 +847,7 @@ _GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
*pPosition -= (*pEntry)->nTrackStreamPos; *pPosition -= (*pEntry)->nTrackStreamPos;
_CurMP3Pos = *pPosition; _CurMP3Pos = *pPosition;
return true; return TRUE;
} }
_CurMP3Index++; _CurMP3Index++;
@ -858,10 +858,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;
@ -890,13 +890,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++ )
@ -922,7 +922,7 @@ cSampleManager::Initialise(void)
curprovider = -1; curprovider = -1;
prevprovider = -1; prevprovider = -1;
_usingMilesFast2D = false; _usingMilesFast2D = FALSE;
usingEAX=0; usingEAX=0;
usingEAX3=0; usingEAX3=0;
@ -947,7 +947,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;
@ -988,24 +988,24 @@ cSampleManager::Initialise(void)
#ifdef AUDIO_CACHE #ifdef AUDIO_CACHE
TRACE("cache"); TRACE("cache");
FILE *cacheFile = fcaseopen("audio\\sound.cache", "rb"); FILE *cacheFile = fcaseopen("audio\\sound.cache", "rb");
bool CreateCache = false; bool8 CreateCache = FALSE;
if (cacheFile) { if (cacheFile) {
fread(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile); fread(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
fclose(cacheFile); fclose(cacheFile);
}else }else
CreateCache = true; CreateCache = TRUE;
#endif #endif
char filepath[MAX_PATH]; char filepath[MAX_PATH];
bool bFileNotFound; bool8 bFileNotFound;
S32 tatalms; S32 tatalms;
TRACE("cdrom"); TRACE("cdrom");
{ {
m_bInitialised = false; m_bInitialised = FALSE;
while (true) while (TRUE)
{ {
// Find path of WAVs (originally in HDD) // Find path of WAVs (originally in HDD)
@ -1046,7 +1046,7 @@ cSampleManager::Initialise(void)
{ {
OutputDebugString(AIL_last_error()); OutputDebugString(AIL_last_error());
Terminate(); Terminate();
return false; return FALSE;
} }
add_providers(); add_providers();
@ -1076,9 +1076,9 @@ cSampleManager::Initialise(void)
} }
else else
{ {
m_bInitialised = false; m_bInitialised = FALSE;
Terminate(); Terminate();
return false; return FALSE;
} }
} }
@ -1113,7 +1113,7 @@ cSampleManager::Initialise(void)
AIL_close_stream(mp3Stream[0]); AIL_close_stream(mp3Stream[0]);
mp3Stream[0] = NULL; mp3Stream[0] = NULL;
bFileNotFound = false; bFileNotFound = FALSE;
#ifdef AUDIO_CACHE #ifdef AUDIO_CACHE
if (!CreateCache) if (!CreateCache)
break; break;
@ -1124,7 +1124,7 @@ cSampleManager::Initialise(void)
} }
else else
{ {
bFileNotFound = true; bFileNotFound = TRUE;
break; break;
} }
} }
@ -1159,11 +1159,11 @@ cSampleManager::Initialise(void)
mp3Stream[0] = NULL; mp3Stream[0] = NULL;
nStreamLength[i] = tatalms; nStreamLength[i] = tatalms;
bFileNotFound = false; bFileNotFound = FALSE;
} }
else else
{ {
bFileNotFound = true; bFileNotFound = TRUE;
break; break;
} }
} }
@ -1178,11 +1178,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
} }
@ -1201,14 +1201,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);
@ -1237,7 +1237,7 @@ cSampleManager::Initialise(void)
TRACE("providerset"); TRACE("providerset");
{ {
_bSampmanInitialised = true; _bSampmanInitialised = TRUE;
U32 n = 0; U32 n = 0;
@ -1254,7 +1254,7 @@ cSampleManager::Initialise(void)
if ( n == m_nNumberOfProviders ) if ( n == m_nNumberOfProviders )
{ {
Terminate(); Terminate();
return false; return FALSE;
} }
} }
@ -1279,13 +1279,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);
} }
@ -1317,12 +1317,12 @@ cSampleManager::Initialise(void)
else else
_CurMP3Pos = 0; _CurMP3Pos = 0;
_bIsMp3Active = false; _bIsMp3Active = FALSE;
} }
TRACE("end"); TRACE("end");
return true; return TRUE;
} }
void void
@ -1371,10 +1371,10 @@ cSampleManager::Terminate(void)
AIL_shutdown(); AIL_shutdown();
_bSampmanInitialised = false; _bSampmanInitialised = FALSE;
} }
bool bool8
cSampleManager::CheckForAnAudioFileOnCD(void) cSampleManager::CheckForAnAudioFileOnCD(void)
{ {
#if !defined(NO_CDCHECK) // TODO: check steam, probably GTAVC_STEAM_PATCH needs to be added #if !defined(NO_CDCHECK) // TODO: check steam, probably GTAVC_STEAM_PATCH needs to be added
@ -1392,17 +1392,17 @@ cSampleManager::CheckForAnAudioFileOnCD(void)
DMAudio.SetEffectsMasterVolume(FrontEndMenuManager.m_PrefsSfxVolume); DMAudio.SetEffectsMasterVolume(FrontEndMenuManager.m_PrefsSfxVolume);
DMAudio.Service(); DMAudio.Service();
return true; return TRUE;
} }
DMAudio.SetMusicMasterVolume(0); DMAudio.SetMusicMasterVolume(0);
DMAudio.SetEffectsMasterVolume(0); DMAudio.SetEffectsMasterVolume(0);
DMAudio.Service(); DMAudio.Service();
return false; return FALSE;
#else #else
return true; return TRUE;
#endif // #if !defined(NO_CDCHECK) #endif // #if !defined(NO_CDCHECK)
} }
@ -1484,48 +1484,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;
@ -1538,10 +1538,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
@ -1563,11 +1563,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() )
@ -1576,7 +1576,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
{ {
case MUSICMODE_CUTSCENE: case MUSICMODE_CUTSCENE:
{ {
return false; return FALSE;
break; break;
} }
@ -1584,10 +1584,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;
@ -1595,7 +1595,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
if ( ++nCurrentPedSlot >= MAX_PEDSFX ) if ( ++nCurrentPedSlot >= MAX_PEDSFX )
nCurrentPedSlot = 0; nCurrentPedSlot = 0;
return true; return TRUE;
} }
int32 int32
@ -1634,14 +1634,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 fRatio = 0.0f; float fRatio = 0.0f;
@ -1662,7 +1662,7 @@ cSampleManager::UpdateReverb(void)
fRatio = clamp(fRatio, 0.0f, 0.6f); fRatio = clamp(fRatio, 0.0f, 0.6f);
if ( fRatio == _fPrevEaxRatioDestination ) if ( fRatio == _fPrevEaxRatioDestination )
return false; return FALSE;
if ( usingEAX3 ) if ( usingEAX3 )
{ {
@ -1684,26 +1684,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);
@ -1716,16 +1716,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;
} }
} }
@ -1735,14 +1735,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);
@ -1754,10 +1754,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
{ {
@ -1773,10 +1773,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;
} }
} }
@ -1867,13 +1867,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;
} }
} }
@ -1893,13 +1893,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;
} }
} }
@ -1919,13 +1919,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;
} }
} }
@ -1942,16 +1942,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;
} }
} }
@ -1961,14 +1961,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;
} }
} }
@ -1976,13 +1976,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;
} }
} }
@ -2002,13 +2002,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;
} }
} }
@ -2060,12 +2060,12 @@ cSampleManager::PreloadStreamedFile(uint32 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);
} }
} }
@ -2079,7 +2079,7 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
} }
} }
bool bool8
cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream) cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
{ {
int i = 0; int i = 0;
@ -2087,7 +2087,7 @@ cSampleManager::StartStreamedFile(uint32 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] )
{ {
@ -2114,12 +2114,12 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
AIL_open_stream(DIG, filename, 0); AIL_open_stream(DIG, filename, 0);
if(mp3Stream[nStream]) { if(mp3Stream[nStream]) {
AIL_set_stream_loop_count(mp3Stream[nStream], nStreamLoopedFlag[nStream] ? 0 : 1); AIL_set_stream_loop_count(mp3Stream[nStream], nStreamLoopedFlag[nStream] ? 0 : 1);
nStreamLoopedFlag[nStream] = true; nStreamLoopedFlag[nStream] = TRUE;
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 )
@ -2136,9 +2136,9 @@ cSampleManager::StartStreamedFile(uint32 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
} }
@ -2163,14 +2163,14 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
if(mp3Stream[nStream]) { if(mp3Stream[nStream]) {
AIL_set_stream_loop_count( AIL_set_stream_loop_count(
mp3Stream[nStream], nStreamLoopedFlag[nStream] ? 0 : 1); mp3Stream[nStream], nStreamLoopedFlag[nStream] ? 0 : 1);
nStreamLoopedFlag[nStream] = true; nStreamLoopedFlag[nStream] = TRUE;
AIL_set_stream_ms_position( AIL_set_stream_ms_position(
mp3Stream[nStream], position); mp3Stream[nStream], position);
AIL_pause_stream(mp3Stream[nStream], AIL_pause_stream(mp3Stream[nStream],
0); 0);
return true; return TRUE;
} }
return false; return FALSE;
} }
} }
if(mp3->pLinkPath != NULL) if(mp3->pLinkPath != NULL)
@ -2188,9 +2188,9 @@ cSampleManager::StartStreamedFile(uint32 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;
} }
} }
@ -2207,12 +2207,12 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
if ( mp3Stream[nStream] ) if ( mp3Stream[nStream] )
{ {
AIL_set_stream_loop_count(mp3Stream[nStream], nStreamLoopedFlag[nStream] ? 0 : 1); AIL_set_stream_loop_count(mp3Stream[nStream], nStreamLoopedFlag[nStream] ? 0 : 1);
nStreamLoopedFlag[nStream] = true; nStreamLoopedFlag[nStream] = TRUE;
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
@ -2228,7 +2228,7 @@ cSampleManager::StopStreamedFile(uint8 nStream)
mp3Stream[nStream] = NULL; mp3Stream[nStream] = NULL;
if ( nStream == 0 ) if ( nStream == 0 )
_bIsMp3Active = false; _bIsMp3Active = FALSE;
} }
} }
} }
@ -2266,7 +2266,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;
float boostMult = 0.0f; float boostMult = 0.0f;
@ -2307,7 +2307,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 )
@ -2315,23 +2315,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 )
@ -2339,7 +2339,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);
@ -2366,7 +2366,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;
} }

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)
@ -129,15 +129,15 @@ cSampleManager::SetMusicFadeVolume(uint8 nVolume)
} }
void void
cSampleManager::SetMonoMode(uint8 nMode) cSampleManager::SetMonoMode(bool8 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
@ -146,20 +146,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;
} }
@ -169,11 +169,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
@ -210,22 +210,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
@ -281,12 +281,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
@ -308,7 +308,7 @@ cSampleManager::PreloadStreamedFile(uint32 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 );
} }
@ -319,12 +319,12 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
ASSERT( nStream < MAX_STREAMS ); ASSERT( nStream < MAX_STREAMS );
} }
bool bool8
cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream) cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
{ {
ASSERT( nStream < MAX_STREAMS ); ASSERT( nStream < MAX_STREAMS );
return false; return FALSE;
} }
void void
@ -342,7 +342,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)
{ {
ASSERT( nStream < MAX_STREAMS ); ASSERT( nStream < MAX_STREAMS );
} }
@ -355,19 +355,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;
} }
void void

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];
@ -121,7 +121,7 @@ uint8 nStreamVolume[MAX_STREAMS];
uint8 nStreamLoopedFlag[MAX_STREAMS]; uint8 nStreamLoopedFlag[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 =
@ -266,11 +266,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;
@ -302,7 +302,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);
@ -383,13 +383,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_KCHAT || track == STREAMED_SOUND_RADIO_VCPR || track == STREAMED_SOUND_RADIO_POLICE; return track == STREAMED_SOUND_RADIO_KCHAT || track == STREAMED_SOUND_RADIO_VCPR || track == STREAMED_SOUND_RADIO_POLICE;
@ -482,13 +482,13 @@ cSampleManager::AutoDetect3DProviders()
return -1; return -1;
} }
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;
@ -523,7 +523,7 @@ _ResolveLink(char const *path, char *out)
ppf->Release(); ppf->Release();
psl->Release(); psl->Release();
#endif #endif
return true; return TRUE;
} }
} }
} }
@ -533,31 +533,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
} }
@ -566,8 +566,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];
@ -610,9 +610,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]);
@ -652,7 +652,7 @@ _FindMP3s(void)
_pMP3List->pLinkPath = NULL; _pMP3List->pLinkPath = NULL;
} }
bInitFirstEntry = false; bInitFirstEntry = FALSE;
} }
else else
{ {
@ -660,10 +660,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;
@ -681,9 +681,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;
} }
@ -722,7 +722,7 @@ _FindMP3s(void)
pList = _pMP3List; pList = _pMP3List;
bInitFirstEntry = false; bInitFirstEntry = FALSE;
} }
else else
{ {
@ -744,9 +744,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]);
@ -858,7 +858,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;
@ -871,7 +871,7 @@ _GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
*pPosition -= (*pEntry)->nTrackStreamPos; *pPosition -= (*pEntry)->nTrackStreamPos;
_CurMP3Pos = *pPosition; _CurMP3Pos = *pPosition;
return true; return TRUE;
} }
_CurMP3Index++; _CurMP3Index++;
@ -882,10 +882,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;
@ -911,11 +911,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();
@ -960,7 +960,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;
@ -1031,7 +1031,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]);
@ -1040,7 +1040,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);
@ -1059,7 +1059,7 @@ cSampleManager::Initialise(void)
} }
{ {
_bSampmanInitialised = true; _bSampmanInitialised = TRUE;
if ( defaultProvider >= 0 && defaultProvider < m_nNumberOfProviders ) if ( defaultProvider >= 0 && defaultProvider < m_nNumberOfProviders )
{ {
@ -1068,7 +1068,7 @@ cSampleManager::Initialise(void)
else else
{ {
Terminate(); Terminate();
return false; return FALSE;
} }
} }
@ -1091,13 +1091,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);
} }
@ -1129,10 +1129,10 @@ cSampleManager::Initialise(void)
else else
_CurMP3Pos = 0; _CurMP3Pos = 0;
_bIsMp3Active = false; _bIsMp3Active = FALSE;
} }
return true; return TRUE;
} }
void void
@ -1166,12 +1166,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)
@ -1228,24 +1228,24 @@ 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)
{ {
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
@ -1264,14 +1264,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
@ -1279,10 +1279,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);
@ -1290,7 +1290,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 );
@ -1305,10 +1305,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;
} }
@ -1331,13 +1331,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() )
@ -1346,7 +1346,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
{ {
case MUSICMODE_CUTSCENE: case MUSICMODE_CUTSCENE:
{ {
return false; return FALSE;
break; break;
} }
@ -1361,17 +1361,17 @@ cSampleManager::LoadPedComment(uint32 nComment)
int size = op_read(fpSampleDataHandle, (opus_int16 *)(nSampleBankMemoryStartAddress[SAMPLEBANK_PED] + PED_BLOCKSIZE * nCurrentPedSlot + samplesRead), int size = op_read(fpSampleDataHandle, (opus_int16 *)(nSampleBankMemoryStartAddress[SAMPLEBANK_PED] + 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;
@ -1379,7 +1379,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
if ( ++nCurrentPedSlot >= MAX_PEDSFX ) if ( ++nCurrentPedSlot >= MAX_PEDSFX )
nCurrentPedSlot = 0; nCurrentPedSlot = 0;
return true; return TRUE;
} }
int32 int32
@ -1422,13 +1422,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 fRatio = 0.0f; float fRatio = 0.0f;
@ -1449,7 +1449,7 @@ bool cSampleManager::UpdateReverb(void)
fRatio = clamp(fRatio, 0.0f, 0.6f); fRatio = clamp(fRatio, 0.0f, 0.6f);
if ( fRatio == _fPrevEaxRatioDestination ) if ( fRatio == _fPrevEaxRatioDestination )
return false; return FALSE;
#ifdef JUICY_OAL #ifdef JUICY_OAL
if ( usingEAX3 || _usingEFX ) if ( usingEAX3 || _usingEFX )
@ -1486,11 +1486,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 );
@ -1500,7 +1500,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);
@ -1508,7 +1508,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 );
@ -1518,14 +1518,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);
@ -1543,10 +1543,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
@ -1649,7 +1649,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 );
@ -1703,7 +1703,7 @@ cSampleManager::PreloadStreamedFile(uint32 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 );
@ -1711,7 +1711,7 @@ cSampleManager::PauseStream(uint8 nPauseFlag, uint8 nStream)
if ( stream ) if ( stream )
{ {
stream->SetPause(nPauseFlag != 0); stream->SetPause(nPauseFlag != FALSE);
} }
} }
@ -1731,7 +1731,7 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
} }
} }
bool bool8
cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream) cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
{ {
int i = 0; int i = 0;
@ -1739,7 +1739,7 @@ cSampleManager::StartStreamedFile(uint32 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] )
{ {
@ -1768,18 +1768,18 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
if (stream->Setup()) { if (stream->Setup()) {
stream->SetLoopCount(nStreamLoopedFlag[nStream] ? 0 : 1); stream->SetLoopCount(nStreamLoopedFlag[nStream] ? 0 : 1);
nStreamLoopedFlag[nStream] = true; nStreamLoopedFlag[nStream] = TRUE;
if (position != 0) if (position != 0)
stream->SetPosMS(position); stream->SetPosMS(position);
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 {
@ -1798,8 +1798,8 @@ cSampleManager::StartStreamedFile(uint32 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;
@ -1827,18 +1827,18 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
if (stream->Setup()) { if (stream->Setup()) {
stream->SetLoopCount(nStreamLoopedFlag[nStream] ? 0 : 1); stream->SetLoopCount(nStreamLoopedFlag[nStream] ? 0 : 1);
nStreamLoopedFlag[nStream] = true; nStreamLoopedFlag[nStream] = TRUE;
if (position != 0) if (position != 0)
stream->SetPosMS(position); stream->SetPosMS(position);
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)
@ -1853,9 +1853,9 @@ cSampleManager::StartStreamedFile(uint32 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;
@ -1876,18 +1876,18 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
if ( stream->Setup() ) { if ( stream->Setup() ) {
stream->SetLoopCount(nStreamLoopedFlag[nStream] ? 0 : 1); stream->SetLoopCount(nStreamLoopedFlag[nStream] ? 0 : 1);
nStreamLoopedFlag[nStream] = true; nStreamLoopedFlag[nStream] = TRUE;
if (position != 0) if (position != 0)
stream->SetPosMS(position); stream->SetPosMS(position);
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
@ -1903,7 +1903,7 @@ cSampleManager::StopStreamedFile(uint8 nStream)
aStream[nStream] = NULL; aStream[nStream] = NULL;
if ( nStream == 0 ) if ( nStream == 0 )
_bIsMp3Active = false; _bIsMp3Active = FALSE;
} }
} }
@ -1937,7 +1937,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)
{ {
ASSERT( nStream < MAX_STREAMS ); ASSERT( nStream < MAX_STREAMS );
@ -1980,7 +1980,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 );
@ -1990,10 +1990,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
@ -2014,14 +2014,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 )
@ -2029,7 +2029,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);
@ -2061,7 +2061,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;
} }
void void

View File

@ -158,7 +158,7 @@ void CGarages::Init(void)
} }
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);
} }
void CGarages::Shutdown(void) void CGarages::Shutdown(void)

View File

@ -1463,7 +1463,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);
for (int j = 0; j < TOTAL_WEAPON_SLOTS; j++) { for (int j = 0; j < TOTAL_WEAPON_SLOTS; j++) {
int mi1 = CWeaponInfo::GetWeaponInfo(ped->m_weapons[j].m_eWeaponType)->m_nModelId; int mi1 = CWeaponInfo::GetWeaponInfo(ped->m_weapons[j].m_eWeaponType)->m_nModelId;
@ -1529,7 +1529,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

@ -1829,7 +1829,7 @@ void CMissionCleanup::Process()
CWorld::Players[0].m_pPed->m_nDrunkCountdown = 0; CWorld::Players[0].m_pPed->m_nDrunkCountdown = 0;
CPad::GetPad(0)->SetDrunkInputDelay(0); CPad::GetPad(0)->SetDrunkInputDelay(0);
CWorld::Players[0].m_bDriveByAllowed = true; CWorld::Players[0].m_bDriveByAllowed = true;
DMAudio.ShutUpPlayerTalking(0); DMAudio.ShutUpPlayerTalking(FALSE);
CVehicle::bDisableRemoteDetonation = false; CVehicle::bDisableRemoteDetonation = false;
CVehicle::bDisableRemoteDetonationOnContact = false; CVehicle::bDisableRemoteDetonationOnContact = false;
CGameLogic::ClearShortCut(); CGameLogic::ClearShortCut();

View File

@ -1398,7 +1398,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

@ -3968,7 +3968,7 @@ CMenuManager::PrintRadioSelector(void)
if (radioChangeRequested) { if (radioChangeRequested) {
if (CTimer::GetTimeInMillisecondsPauseMode() - lastRadioChange > 50) { if (CTimer::GetTimeInMillisecondsPauseMode() - lastRadioChange > 50) {
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");
lastRadioChange = CTimer::GetTimeInMillisecondsPauseMode(); lastRadioChange = CTimer::GetTimeInMillisecondsPauseMode();
radioChangeRequested = false; radioChangeRequested = false;
@ -4702,7 +4702,7 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u
case MENUACTION_LOADRADIO: case MENUACTION_LOADRADIO:
if (m_nPrefsAudio3DProviderIndex != NO_AUDIO_PROVIDER) { if (m_nPrefsAudio3DProviderIndex != NO_AUDIO_PROVIDER) {
SwitchToNewScreen(MENUPAGE_SOUND_SETTINGS); SwitchToNewScreen(MENUPAGE_SOUND_SETTINGS);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1); DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("STARTED PLAYING FRONTEND AUDIO TRACK"); OutputDebugString("STARTED PLAYING FRONTEND AUDIO TRACK");
} }
break; break;
@ -4807,7 +4807,7 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u
DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume); DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume);
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_PrefsBrightness = 256; m_PrefsBrightness = 256;

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);
} }
} }

View File

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

View File

@ -577,7 +577,7 @@ bool CGame::Initialise(const char* datFile)
#endif #endif
DMAudio.SetStartingTrackPositions(true); DMAudio.SetStartingTrackPositions(TRUE);
DMAudio.ChangeMusicMode(MUSICMODE_GAME); DMAudio.ChangeMusicMode(MUSICMODE_GAME);
return true; return true;
} }

View File

@ -65,7 +65,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);
@ -80,7 +80,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

@ -317,7 +317,7 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
bCanGiveUpSunbathing = true; bCanGiveUpSunbathing = 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

@ -137,7 +137,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

@ -151,7 +151,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() % NUM_RADIOS; //m_nRadioStation = CGeneral::GetRandomNumber() % NUM_RADIOS;
switch(GetModelIndex()){ switch(GetModelIndex()){
case MI_HUNTER: case MI_HUNTER:

View File

@ -37,7 +37,7 @@ CExplosion::Initialise()
ClearAllExplosions(); ClearAllExplosions();
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");
} }