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
cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter)
{
bool distCalculated = false;
bool8 distCalculated = FALSE;
if(col.m_fIntensity2 > 0.0016f) {
uint8 emittingVol = SetLoopingCollisionRequestedSfxFreqAndGetVol(col);
if(emittingVol) {
@ -168,7 +168,7 @@ cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 coun
m_sQueueSample.m_nCounter = counter;
m_sQueueSample.m_vecPos = col.m_vecPosition;
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_nLoopCount = 0;
m_sQueueSample.m_nEmittingVolume = emittingVol;
@ -178,10 +178,10 @@ cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 coun
SampleManager.GetSampleLoopEndOffset(m_sQueueSample.m_nSampleIndex);
m_sQueueSample.m_fSpeedMultiplier = 4.0f;
m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity;
m_sQueueSample.m_bReleasingSoundFlag = false;
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_nReleasingVolumeDivider = 5;
m_sQueueSample.m_bReverbFlag = true;
m_sQueueSample.m_bRequireReflection = false;
m_sQueueSample.m_bReverbFlag = TRUE;
m_sQueueSample.m_bRequireReflection = FALSE;
AddSampleToRequestedQueue();
}
}
@ -311,7 +311,7 @@ cAudioManager::SetUpOneShotCollisionSound(const cAudioCollision &col)
if(counter >= 255) counter = 28;
m_sQueueSample.m_vecPos = col.m_vecPosition;
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_nLoopCount = 1;
m_sQueueSample.m_nEmittingVolume = emittingVol;
@ -319,9 +319,9 @@ cAudioManager::SetUpOneShotCollisionSound(const cAudioCollision &col)
m_sQueueSample.m_nLoopEnd = -1;
m_sQueueSample.m_fSpeedMultiplier = 4.0f;
m_sQueueSample.m_fSoundIntensity = CollisionSoundIntensity;
m_sQueueSample.m_bReleasingSoundFlag = true;
m_sQueueSample.m_bReverbFlag = true;
m_sQueueSample.m_bRequireReflection = false;
m_sQueueSample.m_bReleasingSoundFlag = TRUE;
m_sQueueSample.m_bReverbFlag = TRUE;
m_sQueueSample.m_bRequireReflection = FALSE;
AddSampleToRequestedQueue();
}
}
@ -332,13 +332,12 @@ void
cAudioManager::ServiceCollisions()
{
int i, j;
bool abRepeatedCollision1[NUMAUDIOCOLLISIONS];
bool abRepeatedCollision2[NUMAUDIOCOLLISIONS];
bool8 abRepeatedCollision1[NUMAUDIOCOLLISIONS];
bool8 abRepeatedCollision2[NUMAUDIOCOLLISIONS];
m_sQueueSample.m_nEntityIndex = m_nCollisionEntity;
for (int i = 0; i < NUMAUDIOCOLLISIONS; i++)
abRepeatedCollision1[i] = abRepeatedCollision2[i] = false;
for (int i = 0; i < NUMAUDIOCOLLISIONS; i++) abRepeatedCollision1[i] = abRepeatedCollision2[i] = FALSE;
for (i = 0; i < m_sCollisionManager.m_bCollisionsInQueue; i++) {
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_bSurface2 == m_sCollisionManager.m_asCollisions2[j].m_bSurface2)
) {
abRepeatedCollision1[index] = true;
abRepeatedCollision2[j] = true;
abRepeatedCollision1[index] = TRUE;
abRepeatedCollision2[j] = TRUE;
m_sCollisionManager.m_asCollisions1[index].m_nBaseVolume = ++m_sCollisionManager.m_asCollisions2[j].m_nBaseVolume;
SetUpLoopingCollisionSound(m_sCollisionManager.m_asCollisions1[index], j);
break;

File diff suppressed because it is too large Load Diff

View File

@ -23,8 +23,8 @@ const int allChannels = channels + 2;
cAudioManager::cAudioManager()
{
m_bIsInitialised = false;
m_bReverb = true;
m_bIsInitialised = FALSE;
m_bReverb = TRUE;
field_6 = 0;
m_fSpeedOfSound = SPEED_OF_SOUND / TIME_SPENT;
m_nTimeSpent = TIME_SPENT;
@ -36,16 +36,16 @@ cAudioManager::cAudioManager()
ClearActiveSamples();
GenerateIntegerRandomNumberTable();
field_4 = 0;
m_bDynamicAcousticModelingStatus = true;
m_bDynamicAcousticModelingStatus = TRUE;
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_nAudioEntitiesTotal = 0;
m_FrameCounter = 0;
m_bFifthFrameFlag = false;
m_bTimerJustReset = false;
m_bFifthFrameFlag = FALSE;
m_bTimerJustReset = FALSE;
m_nTimer = 0;
}
@ -83,7 +83,7 @@ cAudioManager::Terminate()
MusicManager.Terminate();
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);
}
@ -98,7 +98,7 @@ cAudioManager::Terminate()
SampleManager.Terminate();
m_bIsInitialised = false;
m_bIsInitialised = FALSE;
PostTerminateGameSpecificShutdown();
}
}
@ -110,7 +110,7 @@ cAudioManager::Service()
if (m_bTimerJustReset) {
ResetAudioLogicTimers(m_nTimer);
MusicManager.ResetTimers(m_nTimer);
m_bTimerJustReset = false;
m_bTimerJustReset = FALSE;
}
if (m_bIsInitialised) {
m_nPreviousUserPause = m_nUserPause;
@ -132,8 +132,8 @@ cAudioManager::CreateEntity(eAudioType type, void *entity)
return AEHANDLE_ERROR_BADAUDIOTYPE;
for (uint32 i = 0; i < ARRAY_SIZE(m_asAudioEntities); i++) {
if (!m_asAudioEntities[i].m_bIsUsed) {
m_asAudioEntities[i].m_bIsUsed = true;
m_asAudioEntities[i].m_bStatus = false;
m_asAudioEntities[i].m_bIsUsed = TRUE;
m_asAudioEntities[i].m_bStatus = FALSE;
m_asAudioEntities[i].m_nType = type;
m_asAudioEntities[i].m_pEntity = entity;
m_asAudioEntities[i].m_awAudioEvent[0] = SOUND_NO_SOUND;
@ -152,7 +152,7 @@ void
cAudioManager::DestroyEntity(int32 id)
{
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) {
if (id == m_anAudioEntityIndices[i]) {
if (i < NUM_AUDIOENTITIES - 1)
@ -165,7 +165,7 @@ cAudioManager::DestroyEntity(int32 id)
}
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)
m_asAudioEntities[id].m_bStatus = status;
@ -193,7 +193,7 @@ cAudioManager::PlayOneShot(int32 index, uint16 sound, float vol)
}
} else {
int32 i = 0;
while (true) {
while (TRUE) {
if (i >= entity.m_AudioEvents) {
if (entity.m_AudioEvents < ARRAY_SIZE(entity.m_awAudioEvent)) {
entity.m_awAudioEvent[i] = sound;
@ -246,7 +246,7 @@ cAudioManager::SetEffectsFadeVol(uint8 volume) const
}
void
cAudioManager::SetMonoMode(uint8 mono)
cAudioManager::SetMonoMode(bool8 mono)
{
SampleManager.SetMonoMode(mono);
}
@ -261,7 +261,7 @@ void
cAudioManager::ResetTimers(uint32 time)
{
if (m_bIsInitialised) {
m_bTimerJustReset = true;
m_bTimerJustReset = TRUE;
m_nTimer = time;
ClearRequestedQueue();
if (m_nActiveSampleQueue) {
@ -280,7 +280,7 @@ cAudioManager::ResetTimers(uint32 time)
SampleManager.SetEffectsFadeVolume(0);
SampleManager.SetMusicFadeVolume(0);
MusicManager.ResetMusicAfterReload();
m_bIsPlayerShutUp = false;
m_bIsPlayerShutUp = FALSE;
#ifdef AUDIO_OAL
SampleManager.Service();
#endif
@ -391,13 +391,13 @@ cAudioManager::SetSpeakerConfig(int32 conf) const
SampleManager.SetSpeakerConfig(conf);
}
bool
bool8
cAudioManager::IsMP3RadioChannelAvailable() const
{
if (m_bIsInitialised)
return SampleManager.IsMP3RadioChannelAvailable();
return false;
return FALSE;
}
void
@ -417,25 +417,25 @@ cAudioManager::ReacquireDigitalHandle() const
}
void
cAudioManager::SetDynamicAcousticModelingStatus(uint8 status)
cAudioManager::SetDynamicAcousticModelingStatus(bool8 status)
{
m_bDynamicAcousticModelingStatus = status!=0;
m_bDynamicAcousticModelingStatus = status;
}
bool
bool8
cAudioManager::CheckForAnAudioFileOnCD() const
{
return SampleManager.CheckForAnAudioFileOnCD();
}
uint8
char
cAudioManager::GetCDAudioDriveLetter() const
{
if(m_bIsInitialised) return SampleManager.GetCDAudioDriveLetter();
return 0;
return '\0';
}
bool
bool8
cAudioManager::IsAudioInitialised() const
{
return m_bIsInitialised;
@ -545,7 +545,7 @@ cAudioManager::RandomDisplacement(uint32 seed) const
{
int32 value;
static bool bPos = true;
static bool8 bPos = TRUE;
static uint32 Adjustment = 0;
if (!seed)
@ -576,7 +576,7 @@ cAudioManager::AddSampleToRequestedQueue()
{
int32 calculatedVolume;
uint8 sampleIndex;
bool bReflections;
bool8 bReflections;
if (m_sQueueSample.m_nSampleIndex < TOTAL_AUDIO_SAMPLES) {
calculatedVolume = m_sQueueSample.m_nReleasingVolumeModificator * (MAX_VOLUME - m_sQueueSample.m_nVolume);
@ -589,24 +589,24 @@ cAudioManager::AddSampleToRequestedQueue()
++m_SampleRequestQueuesStatus[m_nActiveSampleQueue];
}
m_sQueueSample.m_nCalculatedVolume = calculatedVolume;
m_sQueueSample.m_bLoopEnded = false;
m_sQueueSample.m_bLoopEnded = FALSE;
if (m_sQueueSample.m_bIs2D || CCullZones::InRoomForAudio()) {
m_sQueueSample.m_bRequireReflection = false;
m_sQueueSample.m_bRequireReflection = FALSE;
m_sQueueSample.m_nLoopsRemaining = 0;
}
if (m_bDynamicAcousticModelingStatus && m_sQueueSample.m_nLoopCount) {
bReflections = m_sQueueSample.m_bRequireReflection;
} else {
bReflections = false;
bReflections = FALSE;
m_sQueueSample.m_nLoopsRemaining = 0;
}
m_sQueueSample.m_bRequireReflection = false;
m_sQueueSample.m_bRequireReflection = FALSE;
if ( m_bReverb && m_sQueueSample.m_bIs2D )
m_sQueueSample.field_4C = 30;
if (!m_bDynamicAcousticModelingStatus)
m_sQueueSample.m_bReverbFlag = false;
m_sQueueSample.m_bReverbFlag = FALSE;
m_asSamples[m_nActiveSampleQueue][sampleIndex] = m_sQueueSample;
@ -773,7 +773,7 @@ cAudioManager::UpdateReflections()
void
cAudioManager::AddReleasingSounds()
{
bool toProcess[44]; // why not 27?
bool8 toProcess[44]; // why not 27?
int8 queue = m_nActiveSampleQueue == 0 ? 1 : 0;
@ -782,11 +782,11 @@ cAudioManager::AddReleasingSounds()
if (sample.m_bLoopEnded)
continue;
toProcess[i] = false;
toProcess[i] = FALSE;
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 &&
sample.m_nCounter == m_asSamples[m_nActiveSampleQueue][m_abSampleQueueIndexTable[m_nActiveSampleQueue][j]].m_nCounter) {
toProcess[i] = true;
toProcess[i] = TRUE;
break;
}
}
@ -811,7 +811,7 @@ cAudioManager::AddReleasingSounds()
if (sample.m_nReleasingVolumeModificator < 20)
++sample.m_nReleasingVolumeModificator;
}
sample.m_bReleasingSoundFlag = false;
sample.m_bReleasingSoundFlag = FALSE;
}
memcpy(&m_sQueueSample, &sample, sizeof(tSound));
AddSampleToRequestedQueue();
@ -829,12 +829,12 @@ cAudioManager::ProcessActiveQueues()
uint8 vol;
uint8 offset;
float x;
bool flag;
bool missionState;
bool8 flag;
bool8 missionState;
for (int32 i = 0; i < m_nActiveSamples; i++) {
m_asSamples[m_nActiveSampleQueue][i].m_bIsProcessed = false;
m_asActiveSamples[i].m_bIsProcessed = false;
m_asSamples[m_nActiveSampleQueue][i].m_bIsProcessed = FALSE;
m_asActiveSamples[i].m_bIsProcessed = FALSE;
}
for (int32 i = 0; i < m_SampleRequestQueuesStatus[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 (!(j & 1)) {
flag = false;
flag = FALSE;
} else {
flag = true;
flag = TRUE;
}
} else if (j & 1) {
flag = false;
flag = FALSE;
} else {
flag = true;
flag = TRUE;
}
if (flag && !SampleManager.GetChannelUsedFlag(j)) {
sample.m_bLoopEnded = true;
m_asActiveSamples[j].m_bLoopEnded = true;
sample.m_bLoopEnded = TRUE;
m_asActiveSamples[j].m_bLoopEnded = TRUE;
m_asActiveSamples[j].m_nSampleIndex = NO_SAMPLE;
m_asActiveSamples[j].m_nEntityIndex = AEHANDLE_NONE;
continue;
@ -867,8 +867,8 @@ cAudioManager::ProcessActiveQueues()
if (!sample.m_nReleasingVolumeDivider)
sample.m_nReleasingVolumeDivider = 1;
}
sample.m_bIsProcessed = true;
m_asActiveSamples[j].m_bIsProcessed = true;
sample.m_bIsProcessed = TRUE;
m_asActiveSamples[j].m_bIsProcessed = TRUE;
sample.m_nVolumeChange = -1;
if (!sample.m_bReleasingSoundFlag) {
if (sample.m_bIs2D) {
@ -900,10 +900,10 @@ cAudioManager::ProcessActiveQueues()
emittingVol = vol;
}
missionState = false;
missionState = FALSE;
for (int32 k = 0; k < ARRAY_SIZE(m_sMissionAudio.m_bIsMobile); k++) {
if (m_sMissionAudio.m_bIsMobile[k]) {
missionState = true;
missionState = TRUE;
break;
}
}
@ -924,8 +924,8 @@ cAudioManager::ProcessActiveQueues()
SampleManager.SetChannelReverbFlag(j, sample.m_bReverbFlag);
break; //continue for i
}
sample.m_bIsProcessed = false;
m_asActiveSamples[j].m_bIsProcessed = false;
sample.m_bIsProcessed = FALSE;
m_asActiveSamples[j].m_bIsProcessed = FALSE;
//continue for j
}
}
@ -966,10 +966,10 @@ cAudioManager::ProcessActiveQueues()
}
if (SampleManager.InitialiseChannel(k, m_asActiveSamples[k].m_nSampleIndex, m_asActiveSamples[k].m_nBankIndex)) {
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++) {
if (m_sMissionAudio.m_bIsMobile[l]) {
isMobile = true;
isMobile = TRUE;
break;
}
}
@ -1000,8 +1000,8 @@ cAudioManager::ProcessActiveQueues()
SampleManager.SetChannel3DDistances(k, m_asActiveSamples[k].m_fSoundIntensity, 0.25f * m_asActiveSamples[k].m_fSoundIntensity);
SampleManager.StartChannel(k);
}
m_asActiveSamples[k].m_bIsProcessed = true;
sample.m_bIsProcessed = true;
m_asActiveSamples[k].m_bIsProcessed = TRUE;
sample.m_bIsProcessed = TRUE;
sample.m_nVolumeChange = -1;
break;
}
@ -1029,28 +1029,28 @@ cAudioManager::ClearActiveSamples()
m_asActiveSamples[i].m_nCounter = 0;
m_asActiveSamples[i].m_nSampleIndex = NO_SAMPLE;
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_nFrequency = 0;
m_asActiveSamples[i].m_nVolume = 0;
m_asActiveSamples[i].m_nEmittingVolume = 0;
m_asActiveSamples[i].m_fDistance = 0.0f;
m_asActiveSamples[i].m_bIsProcessed = false;
m_asActiveSamples[i].m_bLoopEnded = false;
m_asActiveSamples[i].m_bIsProcessed = FALSE;
m_asActiveSamples[i].m_bLoopEnded = FALSE;
m_asActiveSamples[i].m_nLoopCount = 1;
m_asActiveSamples[i].m_nLoopStart = 0;
m_asActiveSamples[i].m_nLoopEnd = -1;
m_asActiveSamples[i].m_fSpeedMultiplier = 0.0f;
m_asActiveSamples[i].m_fSoundIntensity = 200.0f;
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_nReleasingVolumeDivider = 0;
m_asActiveSamples[i].m_nVolumeChange = -1;
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_bRequireReflection = false;
m_asActiveSamples[i].m_bRequireReflection = FALSE;
}
}

View File

@ -13,7 +13,7 @@ public:
int32 m_nCounter;
int32 m_nSampleIndex;
uint8 m_nBankIndex;
bool m_bIs2D;
bool8 m_bIs2D;
int32 m_nReleasingVolumeModificator;
uint32 m_nFrequency;
uint8 m_nVolume;
@ -24,16 +24,16 @@ public:
uint8 m_nEmittingVolume;
float m_fSpeedMultiplier;
float m_fSoundIntensity;
bool m_bReleasingSoundFlag;
bool8 m_bReleasingSoundFlag;
CVector m_vecPos;
bool m_bReverbFlag;
bool8 m_bReverbFlag;
uint8 m_nLoopsRemaining;
bool m_bRequireReflection; // Used for oneshots
bool8 m_bRequireReflection; // Used for oneshots
uint8 m_nOffset;
uint8 field_4C;
int32 m_nReleasingVolumeDivider;
bool m_bIsProcessed;
bool m_bLoopEnded;
bool8 m_bIsProcessed;
bool8 m_bLoopEnded;
int32 m_nCalculatedVolume;
int8 m_nVolumeChange;
};
@ -48,7 +48,7 @@ class tAudioEntity
public:
eAudioType m_nType;
void *m_pEntity;
bool m_bIsUsed;
bool8 m_bIsUsed;
uint8 m_bStatus;
int16 m_awAudioEvent[NUM_AUDIOENTITY_EVENTS];
float m_afVolume[NUM_AUDIOENTITY_EVENTS];
@ -78,7 +78,7 @@ public:
uint8 m_nCommentsInBank[NUM_PED_COMMENTS_BANKS];
uint8 m_nActiveBank;
#ifdef GTA_PC
bool m_bDelay;
bool8 m_bDelay;
uint32 m_nDelayTimer;
#endif
@ -110,14 +110,14 @@ class cMissionAudio
{
public:
CVector m_vecPos[MISSION_AUDIO_SLOTS];
bool m_bPredefinedProperties[MISSION_AUDIO_SLOTS];
bool8 m_bPredefinedProperties[MISSION_AUDIO_SLOTS];
int32 m_nSampleIndex[MISSION_AUDIO_SLOTS];
uint8 m_nLoadingStatus[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];
bool m_bIsPlayed[MISSION_AUDIO_SLOTS];
bool m_bIsMobile[MISSION_AUDIO_SLOTS];
bool8 m_bIsPlayed[MISSION_AUDIO_SLOTS];
bool8 m_bIsMobile[MISSION_AUDIO_SLOTS];
};
VALIDATE_SIZE(cMissionAudio, 0x38);
@ -141,7 +141,7 @@ class CPed;
class cPedParams
{
public:
bool m_bDistanceCalculated;
bool8 m_bDistanceCalculated;
float m_fDistance;
CPed *m_pPed;
@ -157,7 +157,7 @@ class cVehicleParams
{
public:
int32 m_VehicleType;
bool m_bDistanceCalculated;
bool8 m_bDistanceCalculated;
float m_fDistance;
CVehicle *m_pVehicle;
cTransmission *m_pTransmission;
@ -193,15 +193,15 @@ enum {
class cAudioManager
{
public:
bool m_bIsInitialised;
bool8 m_bIsInitialised;
uint8 m_bReverb; // unused
bool m_bFifthFrameFlag;
bool8 m_bFifthFrameFlag;
uint8 m_nActiveSamples;
uint8 field_4; // unused
bool m_bDynamicAcousticModelingStatus;
bool8 m_bDynamicAcousticModelingStatus;
int8 field_6;
float m_fSpeedOfSound;
bool m_bTimerJustReset;
bool8 m_bTimerJustReset;
int32 m_nTimer;
tSound m_sQueueSample;
uint8 m_nActiveSampleQueue;
@ -217,11 +217,11 @@ public:
cAudioScriptObjectManager m_sAudioScriptObjectManager;
// miami
uint8 m_bIsPlayerShutUp;
bool8 m_bIsPlayerShutUp;
uint8 m_nPlayerMood;
uint32 m_nPlayerMoodTimer;
uint8 field_rest[4];
bool m_bGenericSfx;
bool8 m_bGenericSfx;
cPedComments m_sPedComments;
int32 m_nFireAudioEntity;
@ -253,19 +253,19 @@ public:
float GetReflectionsDistance(int32 idx) const { return m_afReflectionsDistances[idx]; } // done
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; }
bool IsMissionAudioSamplePlaying(uint8 slot) const; // { return m_sMissionAudio.m_nPlayStatus == 1; }
bool ShouldDuckMissionAudio(uint8 slot) const;
bool8 IsMissionAudioSamplePlaying(uint8 slot) const; // { return m_sMissionAudio.m_nPlayStatus == 1; }
bool8 ShouldDuckMissionAudio(uint8 slot) const;
// "Should" be in alphabetic order, except "getXTalkSfx"
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 AddReleasingSounds(); // done
void AddSampleToRequestedQueue(); // done
void AgeCrimes(); // done (inlined in vc)
void CalculateDistance(bool &condition, float dist); // done
bool CheckForAnAudioFileOnCD() const; // done
void CalculateDistance(bool8 &condition, float dist); // done
bool8 CheckForAnAudioFileOnCD() const; // done
void ClearActiveSamples(); // done
void ClearMissionAudio(uint8 slot); // done (inlined in vc)
void ClearRequestedQueue(); // done (inlined in vc)
@ -379,7 +379,7 @@ public:
void GenerateIntegerRandomNumberTable(); // done
char *Get3DProviderName(uint8 id) const; // done
uint8 GetCDAudioDriveLetter() const; // done
char GetCDAudioDriveLetter() const; // done
int8 GetCurrent3DProviderIndex() const; // done
int8 AutoDetect3DProviders() const; // done
float GetCollisionLoopingRatio(uint32 a, uint32 b, float c) const; // not used
@ -396,17 +396,17 @@ public:
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 InitialisePoliceRadio(); // done
void InitialisePoliceRadioZones(); // done
void InterrogateAudioEntities(); // done (inlined)
bool IsAudioInitialised() const; // done
bool IsMissionAudioSampleFinished(uint8 slot); // done
bool IsMP3RadioChannelAvailable() const; // done
bool8 IsAudioInitialised() const; // done
bool8 IsMissionAudioSampleFinished(uint8 slot); // done
bool8 IsMP3RadioChannelAvailable() const; // done
bool MissionScriptAudioUsesPoliceChannel(int32 soundMission) const; //done
bool8 MissionScriptAudioUsesPoliceChannel(int32 soundMission) const; //done
void PlayLoadedMissionAudio(uint8 slot); // done
void PlayOneShot(int32 index, uint16 sound, float vol); // done
@ -420,20 +420,20 @@ public:
void PreTerminateGameSpecificShutdown(); // done
/// processX - main logic of adding new sounds
void ProcessActiveQueues(); // done
bool ProcessAirBrakes(cVehicleParams& params); // done
bool ProcessBoatEngine(cVehicleParams& params);
bool ProcessBoatMovingOverWater(cVehicleParams& params); //done
bool8 ProcessAirBrakes(cVehicleParams& params); // done
bool8 ProcessBoatEngine(cVehicleParams& params);
bool8 ProcessBoatMovingOverWater(cVehicleParams& params); //done
#ifdef GTA_BRIDGE
void ProcessBridge(); // done(bcs not exists in VC)
void ProcessBridgeMotor(); // done(bcs not exists in VC)
void ProcessBridgeOneShots(); // done(bcs not exists in VC)
void ProcessBridgeWarning(); // done(bcs not exists in VC)
#endif
bool ProcessCarBombTick(cVehicleParams& params); // done
bool8 ProcessCarBombTick(cVehicleParams& params); // done
void ProcessCarHeli(cVehicleParams& params); // done
void ProcessCesna(cVehicleParams& params); // done
//void ProcessCrane(); // done(bcs not exists in VC)
bool ProcessEngineDamage(cVehicleParams& params); // done
bool8 ProcessEngineDamage(cVehicleParams& params); // done
void ProcessEntity(int32 sound); // done
void ProcessExplosions(int32 explosion); // done
void ProcessFireHydrant(); // done
@ -462,25 +462,25 @@ public:
void ProcessProjectiles(); // done
void ProcessRainOnVehicle(cVehicleParams& params); // done
void ProcessReverb() const; // done
bool ProcessReverseGear(cVehicleParams& params); // done
bool8 ProcessReverseGear(cVehicleParams& params); // done
void ProcessScriptObject(int32 id); // done
void ProcessSpecial(); // done
#ifdef GTA_TRAIN
bool ProcessTrainNoise(cVehicleParams *params); //done(bcs not exists in VC)
bool8 ProcessTrainNoise(cVehicleParams *params); //done(bcs not exists in VC)
#endif
void ProcessVehicle(CVehicle *vehicle); // done
bool ProcessVehicleDoors(cVehicleParams &params); // done
bool8 ProcessVehicleDoors(cVehicleParams &params); // done
void ProcessVehicleEngine(cVehicleParams &params); // done
void ProcessVehicleFlatTyre(cVehicleParams &params); // done
bool ProcessVehicleHorn(cVehicleParams &params); // done
bool8 ProcessVehicleHorn(cVehicleParams &params); // done
void ProcessVehicleOneShots(cVehicleParams &params); // done
bool ProcessVehicleReverseWarning(cVehicleParams &params); // done
bool ProcessVehicleRoadNoise(cVehicleParams &params); // done
bool ProcessVehicleSirenOrAlarm(cVehicleParams &params); // done
bool ProcessVehicleSkidding(cVehicleParams &params); // done
bool8 ProcessVehicleReverseWarning(cVehicleParams &params); // done
bool8 ProcessVehicleRoadNoise(cVehicleParams &params); // done
bool8 ProcessVehicleSirenOrAlarm(cVehicleParams &params); // done
bool8 ProcessVehicleSkidding(cVehicleParams &params); // done
void ProcessWaterCannon(int32); // done
void ProcessWeather(int32 id); // done
bool ProcessWetRoadNoise(cVehicleParams& params); // done
bool8 ProcessWetRoadNoise(cVehicleParams& params); // done
void ProcessEscalators(); // done
void ProcessExtraSounds(); // done
@ -499,26 +499,26 @@ public:
void ServicePoliceRadioChannel(uint8 wantedLevel); // done
void ServiceSoundEffects(); // done
int8 SetCurrent3DProvider(uint8 which); // done
void SetDynamicAcousticModelingStatus(uint8 status); // done
void SetDynamicAcousticModelingStatus(bool8 status); // done
void SetEffectsFadeVol(uint8 volume) const; // done
void SetEffectsMasterVolume(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
void SetMissionAudioLocation(uint8 slot, float x, float y, float z); // done
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 SetMusicMasterVolume(uint8 volume) const; // done
void SetSpeakerConfig(int32 conf) const; // done
void SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 counter); // done
void SetUpOneShotCollisionSound(const cAudioCollision &col); // done
bool SetupCrimeReport(); // done
bool SetupJumboEngineSound(uint8 vol, uint32 freq); // done
bool SetupJumboFlySound(uint8 emittingVol); // done
bool SetupJumboRumbleSound(uint8 emittingVol); // done
bool SetupJumboTaxiSound(uint8 vol); // done
bool SetupJumboWhineSound(uint8 emittingVol, uint32 freq); // done
bool8 SetupCrimeReport(); // done
bool8 SetupJumboEngineSound(uint8 vol, uint32 freq); // done
bool8 SetupJumboFlySound(uint8 emittingVol); // done
bool8 SetupJumboRumbleSound(uint8 emittingVol); // done
bool8 SetupJumboTaxiSound(uint8 vol); // done
bool8 SetupJumboWhineSound(uint8 emittingVol, uint32 freq); // done
void SetupPedComments(cPedParams &params, uint16 sound); // done
void SetupSuspectLastSeenReport();
@ -527,12 +527,12 @@ public:
void UpdateGasPedalAudio(CVehicle *veh, int vehType); // done
void UpdateReflections(); // done
bool UsesReverseWarning(int32 model) const; // done
bool UsesSiren(cVehicleParams &params) const; // done
bool UsesSirenSwitching(cVehicleParams &params) const; // done
bool8 UsesReverseWarning(int32 model) const; // done
bool8 UsesSiren(cVehicleParams &params) const; // done
bool8 UsesSirenSwitching(cVehicleParams &params) const; // 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
float Sqrt(float v) const { return v <= 0.0f ? 0.0f : ::Sqrt(v); }

View File

@ -39,7 +39,7 @@ cDMAudio::DestroyEntity(int32 audioEntity)
}
void
cDMAudio::SetEntityStatus(int32 audioEntity, uint8 status)
cDMAudio::SetEntityStatus(int32 audioEntity, bool8 status)
{
AudioManager.SetEntityStatus(audioEntity, status);
}
@ -57,7 +57,7 @@ cDMAudio::DestroyAllGameCreatedEntities(void)
}
void
cDMAudio::SetMonoMode(uint8 mono)
cDMAudio::SetMonoMode(bool8 mono)
{
AudioManager.SetMonoMode(mono);
}
@ -142,7 +142,7 @@ cDMAudio::SetSpeakerConfig(int32 config)
AudioManager.SetSpeakerConfig(config);
}
bool
bool8
cDMAudio::IsMP3RadioChannelAvailable(void)
{
return AudioManager.IsMP3RadioChannelAvailable();
@ -161,12 +161,12 @@ cDMAudio::ReacquireDigitalHandle(void)
}
void
cDMAudio::SetDynamicAcousticModelingStatus(uint8 status)
cDMAudio::SetDynamicAcousticModelingStatus(bool8 status)
{
AudioManager.SetDynamicAcousticModelingStatus(status);
}
bool
bool8
cDMAudio::CheckForAnAudioFileOnCD(void)
{
return AudioManager.CheckForAnAudioFileOnCD();
@ -178,7 +178,7 @@ cDMAudio::GetCDAudioDriveLetter(void)
return AudioManager.GetCDAudioDriveLetter();
}
bool
bool8
cDMAudio::IsAudioInitialised(void)
{
return AudioManager.IsAudioInitialised();
@ -196,7 +196,7 @@ cDMAudio::CreateLoopingScriptObject(cAudioScriptObject *scriptObject)
int32 audioEntity = AudioManager.CreateEntity(AUDIOTYPE_SCRIPTOBJECT, scriptObject);
if ( AEHANDLE_IS_OK(audioEntity) )
AudioManager.SetEntityStatus(audioEntity, true);
AudioManager.SetEntityStatus(audioEntity, TRUE);
return audioEntity;
}
@ -214,7 +214,7 @@ cDMAudio::CreateOneShotScriptObject(cAudioScriptObject *scriptObject)
if ( AEHANDLE_IS_OK(audioEntity) )
{
AudioManager.SetEntityStatus(audioEntity, true);
AudioManager.SetEntityStatus(audioEntity, TRUE);
AudioManager.PlayOneShot(audioEntity, scriptObject->AudioId, 0.0f);
}
}
@ -244,7 +244,7 @@ cDMAudio::PlayRadioAnnouncement(uint32 announcement)
}
void
cDMAudio::PlayFrontEndTrack(uint32 track, uint8 frontendFlag)
cDMAudio::PlayFrontEndTrack(uint32 track, bool8 frontendFlag)
{
MusicManager.PlayFrontEndTrack(track, frontendFlag);
}
@ -309,7 +309,7 @@ cDMAudio::PlayLoadedMissionAudio(uint8 slot)
AudioManager.PlayLoadedMissionAudio(slot);
}
bool
bool8
cDMAudio::IsMissionAudioSampleFinished(uint8 slot)
{
return AudioManager.IsMissionAudioSampleFinished(slot);
@ -340,7 +340,7 @@ cDMAudio::SetRadioChannel(uint32 radio, int32 pos)
}
void
cDMAudio::SetStartingTrackPositions(uint8 isStartGame)
cDMAudio::SetStartingTrackPositions(bool8 isStartGame)
{
MusicManager.SetStartingTrackPositions(isStartGame);
}
@ -364,7 +364,7 @@ cDMAudio::GetRadioPosition(uint32 station)
}
void
cDMAudio::SetPedTalkingStatus(CPed *ped, uint8 status)
cDMAudio::SetPedTalkingStatus(CPed *ped, bool8 status)
{
return AudioManager.SetPedTalkingStatus(ped, status);
}
@ -376,7 +376,7 @@ cDMAudio::SetPlayersMood(uint8 mood, uint32 time)
}
void
cDMAudio::ShutUpPlayerTalking(uint8 state)
cDMAudio::ShutUpPlayerTalking(bool8 state)
{
AudioManager.m_bIsPlayerShutUp = state;
}

View File

@ -25,11 +25,11 @@ public:
int32 CreateEntity(eAudioType type, void *UID);
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 DestroyAllGameCreatedEntities(void);
void SetMonoMode(uint8 mono);
void SetMonoMode(bool8 mono);
void SetMP3BoostVolume(uint8 volume);
void SetEffectsMasterVolume(uint8 volume);
void SetMusicMasterVolume(uint8 volume);
@ -46,17 +46,17 @@ public:
void SetSpeakerConfig(int32 config);
bool IsMP3RadioChannelAvailable(void);
bool8 IsMP3RadioChannelAvailable(void);
void ReleaseDigitalHandle(void);
void ReacquireDigitalHandle(void);
void SetDynamicAcousticModelingStatus(uint8 status);
void SetDynamicAcousticModelingStatus(bool8 status);
bool CheckForAnAudioFileOnCD(void);
bool8 CheckForAnAudioFileOnCD(void);
char GetCDAudioDriveLetter(void);
bool IsAudioInitialised(void);
bool8 IsAudioInitialised(void);
void ReportCrime(eCrimeType crime, CVector const &pos);
@ -70,7 +70,7 @@ public:
void PlayFrontEndSound(uint16 frontend, uint32 volume);
void PlayRadioAnnouncement(uint32 announcement);
void PlayFrontEndTrack(uint32 track, uint8 frontendFlag);
void PlayFrontEndTrack(uint32 track, bool8 frontendFlag);
void StopFrontEndTrack(void);
void ResetTimers(uint32 time);
@ -85,19 +85,19 @@ public:
uint8 GetMissionAudioLoadingStatus(uint8 slot);
void SetMissionAudioLocation(uint8 slot, float x, float y, float z);
void PlayLoadedMissionAudio(uint8 slot);
bool IsMissionAudioSampleFinished(uint8 slot);
bool8 IsMissionAudioSampleFinished(uint8 slot);
void ClearMissionAudio(uint8 slot);
uint8 GetRadioInCar(void);
void SetRadioInCar(uint32 radio);
void SetRadioChannel(uint32 radio, int32 pos);
void SetStartingTrackPositions(uint8 isStartGame);
void SetStartingTrackPositions(bool8 isStartGame);
float *GetListenTimeArray();
uint32 GetFavouriteRadioStation();
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 ShutUpPlayerTalking(uint8 state);
void ShutUpPlayerTalking(bool8 state);
};
extern cDMAudio DMAudio;

View File

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

View File

@ -16,18 +16,18 @@ class CPed;
class cMusicManager
{
public:
bool m_bIsInitialised;
bool m_bDisabled;
bool m_bSetNextStation;
bool8 m_bIsInitialised;
bool8 m_bDisabled;
bool8 m_bSetNextStation;
uint8 m_nVolumeLatency;
uint8 m_nCurrentVolume;
uint8 m_nMaxVolume;
uint32 m_nAnnouncement;
bool m_bAnnouncementInProgress;
bool8 m_bAnnouncementInProgress;
tStreamedSample m_aTracks[TOTAL_STREAMED_SOUNDS];
bool m_bResetTimers;
bool8 m_bResetTimers;
uint32 m_nResetTime;
bool m_bRadioSetByScript;
bool8 m_bRadioSetByScript;
uint8 m_nRadioStationScript;
int32 m_nRadioPosition;
uint32 m_nRadioInCar;
@ -35,40 +35,40 @@ public:
uint32 m_nPlayingTrack;
uint8 m_nUpcomingMusicMode;
uint8 m_nMusicMode;
bool m_FrontendLoopFlag;
bool m_bTrackChangeStarted;
bool8 m_FrontendLoopFlag;
bool8 m_bTrackChangeStarted;
uint32 m_nNextTrack;
bool m_nNextLoopFlag;
bool m_bVerifyNextTrackStartedToPlay;
bool m_bGameplayAllowsRadio;
bool m_bRadioStreamReady;
bool8 m_nNextLoopFlag;
bool8 m_bVerifyNextTrackStartedToPlay;
bool8 m_bGameplayAllowsRadio;
bool8 m_bRadioStreamReady;
int8 nFramesSinceCutsceneEnded;
bool m_bUserResumedGame;
bool m_bMusicModeChangeStarted;
bool8 m_bUserResumedGame;
bool8 m_bMusicModeChangeStarted;
uint8 m_nMusicModeToBeSet;
bool m_bEarlyFrontendTrack;
bool8 m_bEarlyFrontendTrack;
float aListenTimeArray[NUM_RADIOS];
float m_nLastTrackServiceTime;
public:
cMusicManager();
bool IsInitialised() { return m_bIsInitialised; }
bool8 IsInitialised() { return m_bIsInitialised; }
uint8 GetMusicMode() { return m_nMusicMode; }
uint32 GetCurrentTrack() { return m_nPlayingTrack; }
void ResetMusicAfterReload();
void SetStartingTrackPositions(uint8 isNewGameTimer);
bool Initialise();
void SetStartingTrackPositions(bool8 isNewGameTimer);
bool8 Initialise();
void Terminate();
void ChangeMusicMode(uint8 mode);
void StopFrontEndTrack();
bool PlayerInCar();
bool8 PlayerInCar();
void DisplayRadioStationName();
void PlayAnnouncement(uint32);
void PlayFrontEndTrack(uint32, uint8);
void PlayFrontEndTrack(uint32, bool8);
void PreloadCutSceneMusic(uint32);
void PlayPreloadedCutSceneMusic(void);
void StopCutSceneMusic(void);
@ -83,16 +83,16 @@ public:
void ServiceAmbience();
void ServiceTrack(CVehicle *veh, CPed *ped);
bool UsesPoliceRadio(CVehicle *veh);
bool UsesTaxiRadio(CVehicle *veh);
bool8 UsesPoliceRadio(CVehicle *veh);
bool8 UsesTaxiRadio(CVehicle *veh);
uint32 GetTrackStartPos(uint32 track);
void ComputeAmbienceVol(uint8 reset, uint8& outVolume);
bool ServiceAnnouncement();
void ComputeAmbienceVol(bool8 reset, uint8& outVolume);
bool8 ServiceAnnouncement();
uint32 GetCarTuning();
uint32 GetNextCarTuning();
bool ChangeRadioChannel();
bool8 ChangeRadioChannel();
void RecordRadioStats();
void SetUpCorrectAmbienceTrack();
float *GetListenTimeArray();
@ -100,7 +100,7 @@ public:
uint32 GetFavouriteRadioStation();
void SetMalibuClubTrackPos(uint8 pos);
void SetStripClubTrackPos(uint8 pos);
bool CheckForMusicInterruptions();
bool8 CheckForMusicInterruptions();
void Enable();
void Disable();
@ -109,5 +109,5 @@ public:
VALIDATE_SIZE(cMusicManager, 0x95C);
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();

View File

@ -68,8 +68,8 @@ cAudioManager::InitialisePoliceRadio()
for (int32 i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++)
m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE;
SampleManager.SetChannelReverbFlag(policeChannel, false);
gSpecialSuspectLastSeenReport = false;
SampleManager.SetChannelReverbFlag(policeChannel, FALSE);
gSpecialSuspectLastSeenReport = FALSE;
for (int32 i = 0; i < ARRAY_SIZE(gMinTimeToNextReport); i++)
gMinTimeToNextReport[i] = m_FrameCounter;
}
@ -105,7 +105,7 @@ cAudioManager::DoPoliceRadioCrackle()
m_sQueueSample.m_nCounter = 0;
m_sQueueSample.m_nSampleIndex = SFX_POLICE_RADIO_CRACKLE;
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_nFrequency = SampleManager.GetSampleBaseFrequency(SFX_POLICE_RADIO_CRACKLE);
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_nLoopStart = SampleManager.GetSampleLoopStartOffset(SFX_POLICE_RADIO_CRACKLE);
m_sQueueSample.m_nLoopEnd = SampleManager.GetSampleLoopEndOffset(SFX_POLICE_RADIO_CRACKLE);
m_sQueueSample.m_bReleasingSoundFlag = false;
m_sQueueSample.m_bReverbFlag = false;
m_sQueueSample.m_bReleasingSoundFlag = FALSE;
m_sQueueSample.m_bReverbFlag = FALSE;
m_sQueueSample.m_nOffset = 63;
m_sQueueSample.m_nReleasingVolumeDivider = 3;
m_sQueueSample.m_bRequireReflection = false;
m_sQueueSample.m_bRequireReflection = FALSE;
AddSampleToRequestedQueue();
}
@ -130,7 +130,7 @@ cAudioManager::ServicePoliceRadio()
if(!m_bIsInitialised) return;
if(m_nUserPause == 0) {
bool crimeReport = SetupCrimeReport();
bool8 crimeReport = SetupCrimeReport();
#ifdef FIX_BUGS // Crash at 0x5fe6ef
if(CReplay::IsPlayingBack() || !FindPlayerPed() || !FindPlayerPed()->m_pWanted)
return;
@ -156,12 +156,12 @@ cAudioManager::ServicePoliceRadio()
void
cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
{
bool processed = false;
bool8 processed = FALSE;
uint32 sample;
int32 freq;
static int cWait = 0;
static bool bChannelOpen = false;
static bool8 bChannelOpen = FALSE;
static uint8 bMissionAudioPhysicalPlayingStatus = 0;
static int32 PoliceChannelFreq = 22050;
@ -171,14 +171,14 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
if (SampleManager.GetChannelUsedFlag(policeChannel)) SampleManager.StopChannel(policeChannel);
if (g_nMissionAudioSfx != NO_SAMPLE && bMissionAudioPhysicalPlayingStatus == 1 &&
SampleManager.IsStreamPlaying(1)) {
SampleManager.PauseStream(1, 1);
SampleManager.PauseStream(TRUE, 1);
}
} else {
if (m_nPreviousUserPause && g_nMissionAudioSfx != NO_SAMPLE &&
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) {
--cWait;
return;
@ -202,7 +202,7 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
}
} else if (!SampleManager.GetChannelUsedFlag(policeChannel)) {
SampleManager.PreloadStreamedFile(g_nMissionAudioSfx, 1);
SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, 1, 1);
SampleManager.SetStreamedVolumeAndPan(MAX_VOLUME, 63, TRUE, 1);
SampleManager.StartPreloadedStreamedFile(1);
g_nMissionAudioPlayingStatus = 1;
bMissionAudioPhysicalPlayingStatus = 0;
@ -223,8 +223,8 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
if (gSpecialSuspectLastSeenReport) {
gSpecialSuspectLastSeenReport = 0;
} else if (sample == SFX_POLICE_RADIO_MESSAGE_NOISE_1) {
bChannelOpen = false;
processed = true;
bChannelOpen = FALSE;
processed = TRUE;
}
}
if (sample == NO_SAMPLE) {
@ -234,7 +234,7 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
switch (sample) {
case SFX_POLICE_RADIO_MESSAGE_NOISE_1:
freq = m_anRandomTable[4] % 2000 + 10025;
bChannelOpen = bChannelOpen == false;
bChannelOpen = bChannelOpen == FALSE;
break;
default: freq = SampleManager.GetSampleBaseFrequency(sample); break;
}
@ -251,7 +251,7 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
}
}
bool
bool8
cAudioManager::SetupCrimeReport()
{
int16 audioZoneId;
@ -264,13 +264,13 @@ cAudioManager::SetupCrimeReport()
float quarterY;
int i;
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) {
AgeCrimes();
return true;
return TRUE;
}
for (i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++) {
@ -278,7 +278,7 @@ cAudioManager::SetupCrimeReport()
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);
if (audioZoneId >= 0 && audioZoneId < NUMAUDIOZONES) {
zone = CTheZones::GetAudioZone(audioZoneId);
@ -317,10 +317,10 @@ cAudioManager::SetupCrimeReport()
if (m_sPoliceRadioQueue.crimes[i].position.y > halfY + quarterY) {
m_sPoliceRadioQueue.Add(SFX_NORTH);
processed = true;
processed = TRUE;
} else if (m_sPoliceRadioQueue.crimes[i].position.y < halfY - quarterY) {
m_sPoliceRadioQueue.Add(SFX_SOUTH);
processed = true;
processed = TRUE;
}
if (m_sPoliceRadioQueue.crimes[i].position.x > halfX + quarterX)
@ -339,7 +339,7 @@ cAudioManager::SetupCrimeReport()
}
m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE;
AgeCrimes();
return true;
return TRUE;
}
void
@ -688,7 +688,7 @@ cAudioManager::PlaySuspectLastSeen(float x, float y, float z)
float quarterX;
float quarterY;
int32 sample;
bool processed = false;
bool8 processed = FALSE;
CVector vec = CVector(x, y, z);
if (!m_bIsInitialised) return;
@ -713,10 +713,10 @@ cAudioManager::PlaySuspectLastSeen(float x, float y, float z)
if (vec.y > halfY + quarterY) {
m_sPoliceRadioQueue.Add(SFX_NORTH);
processed = true;
processed = TRUE;
} else if (vec.y < halfY - quarterY) {
m_sPoliceRadioQueue.Add(SFX_SOUTH);
processed = true;
processed = TRUE;
}
if (vec.x > halfX + quarterX)
@ -728,7 +728,7 @@ cAudioManager::PlaySuspectLastSeen(float x, float y, float z)
m_sPoliceRadioQueue.Add(sample);
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_MESSAGE_NOISE_1);
m_sPoliceRadioQueue.Add(NO_SAMPLE);
gSpecialSuspectLastSeenReport = true;
gSpecialSuspectLastSeenReport = TRUE;
break;
}
}

View File

@ -135,9 +135,9 @@ class cSampleManager
uint8 m_nMP3BoostVolume;
uint8 m_nEffectsFadeVolume;
uint8 m_nMusicFadeVolume;
uint8 m_nMonoMode;
bool8 m_nMonoMode;
char m_szCDRomRootPath[80];
bool m_bInitialised;
bool8 m_bInitialised;
uint8 m_nNumberOfProviders;
char *m_aAudioProviders[MAXPROVIDERS];
tSample m_aSamples[TOTAL_AUDIO_SAMPLES];
@ -167,16 +167,16 @@ public:
int8 AutoDetect3DProviders();
bool IsMP3RadioChannelAvailable(void);
bool8 IsMP3RadioChannelAvailable(void);
void ReleaseDigitalHandle (void);
void ReacquireDigitalHandle(void);
bool Initialise(void);
void Terminate (void);
bool8 Initialise(void);
void Terminate (void);
bool CheckForAnAudioFileOnCD(void);
char GetCDAudioDriveLetter (void);
bool8 CheckForAnAudioFileOnCD(void);
char GetCDAudioDriveLetter (void);
void UpdateEffectsVolume(void);
@ -185,14 +185,14 @@ public:
void SetMP3BoostVolume (uint8 nVolume);
void SetEffectsFadeVolume (uint8 nVolume);
void SetMusicFadeVolume (uint8 nVolume);
void SetMonoMode (uint8 nMode);
void SetMonoMode (bool8 nMode);
bool LoadSampleBank (uint8 nBank);
void UnloadSampleBank (uint8 nBank);
bool IsSampleBankLoaded(uint8 nBank);
bool8 LoadSampleBank (uint8 nBank);
void UnloadSampleBank (uint8 nBank);
bool8 IsSampleBankLoaded(uint8 nBank);
bool IsPedCommentLoaded(uint32 nComment);
bool LoadPedComment (uint32 nComment);
bool8 IsPedCommentLoaded(uint32 nComment);
bool8 LoadPedComment (uint32 nComment);
int32 GetBankContainingSound(uint32 offset);
int32 _GetPedCommentSlot(uint32 nComment);
@ -202,10 +202,10 @@ public:
int32 GetSampleLoopEndOffset (uint32 nSample);
uint32 GetSampleLength (uint32 nSample);
bool UpdateReverb(void);
bool8 UpdateReverb(void);
void SetChannelReverbFlag (uint32 nChannel, uint8 nReverbFlag);
bool InitialiseChannel (uint32 nChannel, uint32 nSfx, uint8 nBank);
void SetChannelReverbFlag (uint32 nChannel, bool8 nReverbFlag);
bool8 InitialiseChannel (uint32 nChannel, uint32 nSfx, uint8 nBank);
void SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume);
void SetChannel3DPosition (uint32 nChannel, float fX, float fY, float fZ);
void SetChannel3DDistances (uint32 nChannel, float fMax, float fMin);
@ -214,23 +214,23 @@ public:
void SetChannelFrequency (uint32 nChannel, uint32 nFreq);
void SetChannelLoopPoints (uint32 nChannel, uint32 nLoopStart, int32 nLoopEnd);
void SetChannelLoopCount (uint32 nChannel, uint32 nLoopCount);
bool GetChannelUsedFlag (uint32 nChannel);
bool8 GetChannelUsedFlag (uint32 nChannel);
void StartChannel (uint32 nChannel);
void StopChannel (uint32 nChannel);
void PreloadStreamedFile (uint32 nFile, uint8 nStream);
void PauseStream (uint8 nPauseFlag, uint8 nStream);
void PauseStream (bool8 nPauseFlag, 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);
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);
bool IsStreamPlaying (uint8 nStream);
bool8 IsStreamPlaying (uint8 nStream);
#ifdef AUDIO_OAL
void Service(void);
#endif
bool InitialiseSampleBanks(void);
bool8 InitialiseSampleBanks(void);
uint8 GetMusicVolume() const { return m_nMusicVolume; }
void SetStreamedFileLoopFlag(uint8 nLoopFlag, uint8 nStream);

View File

@ -28,7 +28,7 @@ char SampleBankDataFilename[] = "AUDIO\\SFX.RAW";
FILE *fpSampleDescHandle;
FILE *fpSampleDataHandle;
bool bSampleBankLoaded [MAX_SFX_BANKS];
bool8 bSampleBankLoaded [MAX_SFX_BANKS];
int32 nSampleBankDiscStartOffset [MAX_SFX_BANKS];
int32 nSampleBankSize [MAX_SFX_BANKS];
int32 nSampleBankMemoryStartAddress[MAX_SFX_BANKS];
@ -63,11 +63,11 @@ int8 nStreamVolume[MAX_STREAMS];
uint8 nStreamLoopedFlag[MAX_STREAMS];
uint32 _CurMP3Index;
int32 _CurMP3Pos;
bool _bIsMp3Active;
bool8 _bIsMp3Active;
///////////////////////////////////////////////////////////////
bool _bSampmanInitialised = false;
bool8 _bSampmanInitialised = FALSE;
//
// Miscellaneous globals / defines
@ -94,7 +94,7 @@ S32 speaker_type=0;
U32 _maxSamples;
float _fPrevEaxRatioDestination;
bool _usingMilesFast2D;
bool8 _usingMilesFast2D;
float _fEffectsLevel;
@ -166,17 +166,17 @@ release_existing()
}
_fPrevEaxRatioDestination = 0.0f;
_usingMilesFast2D = false;
_usingMilesFast2D = FALSE;
_fEffectsLevel = 0.0f;
}
static bool
static bool8
set_new_provider(S32 index)
{
DWORD result;
if ( curprovider == index )
return true;
return TRUE;
//close the already opened provider
curprovider = index;
@ -203,7 +203,7 @@ set_new_provider(S32 index)
release_existing();
return false;
return FALSE;
}
else
{
@ -234,7 +234,7 @@ set_new_provider(S32 index)
AIL_set_3D_room_type(opened_provider, ENVIRONMENT_CAVE);
if ( !strcmp(providers[index].name, "Miles Fast 2D Positional Audio") )
_usingMilesFast2D = true;
_usingMilesFast2D = TRUE;
}
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);
}
return true;
return TRUE;
}
}
return false;
return FALSE;
}
U32 RadioHandlers[9];
@ -459,7 +459,7 @@ cSampleManager::AutoDetect3DProviders()
return -1;
}
static bool
static bool8
_ResolveLink(char const *path, char *out)
{
IShellLink* psl;
@ -495,7 +495,7 @@ _ResolveLink(char const *path, char *out)
ppf->Release();
psl->Release();
#endif
return true;
return TRUE;
}
}
}
@ -505,15 +505,15 @@ _ResolveLink(char const *path, char *out)
psl->Release();
}
return false;
return FALSE;
}
static void
_FindMP3s(void)
{
tMP3Entry *pList;
bool bShortcut;
bool bInitFirstEntry;
bool8 bShortcut;
bool8 bInitFirstEntry;
HANDLE hFind;
char path[MAX_PATH];
char filepath[MAX_PATH*2];
@ -565,10 +565,10 @@ _FindMP3s(void)
OutputDebugString(filepath);
}
bShortcut = true;
bShortcut = TRUE;
}
else
bShortcut = false;
bShortcut = FALSE;
}
mp3Stream[0] = AIL_open_stream(DIG, filepath, 0);
@ -608,7 +608,7 @@ _FindMP3s(void)
{
_pMP3List->pLinkPath = NULL;
}
bInitFirstEntry = false;
bInitFirstEntry = FALSE;
}
else
{
@ -616,10 +616,10 @@ _FindMP3s(void)
OutputDebugString(filepath);
bInitFirstEntry = true;
bInitFirstEntry = TRUE;
}
while ( true )
while ( TRUE )
{
if ( !FindNextFile(hFind, &fd) )
break;
@ -643,11 +643,11 @@ _FindMP3s(void)
OutputDebugString(filepath);
}
bShortcut = true;
bShortcut = TRUE;
}
else
{
bShortcut = false;
bShortcut = FALSE;
if ( filepathlen > MAX_PATH )
{
@ -690,7 +690,7 @@ _FindMP3s(void)
pList = _pMP3List;
bInitFirstEntry = false;
bInitFirstEntry = FALSE;
}
else
{
@ -718,11 +718,11 @@ _FindMP3s(void)
OutputDebugString(filepath);
}
bShortcut = true;
bShortcut = TRUE;
}
else
{
bShortcut = false;
bShortcut = FALSE;
}
}
@ -834,7 +834,7 @@ _GetMP3EntryByIndex(uint32 idx)
return NULL;
}
static inline bool
static inline bool8
_GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
{
_CurMP3Index = 0;
@ -847,7 +847,7 @@ _GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
*pPosition -= (*pEntry)->nTrackStreamPos;
_CurMP3Pos = *pPosition;
return true;
return TRUE;
}
_CurMP3Index++;
@ -858,10 +858,10 @@ _GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
_CurMP3Pos = 0;
_CurMP3Index = 0;
return false;
return FALSE;
}
bool
bool8
cSampleManager::IsMP3RadioChannelAvailable(void)
{
return nNumMP3s != 0;
@ -890,13 +890,13 @@ cSampleManager::ReacquireDigitalHandle(void)
}
}
bool
bool8
cSampleManager::Initialise(void)
{
TRACE("start");
if ( _bSampmanInitialised )
return true;
return TRUE;
{
for ( int32 i = 0; i < TOTAL_AUDIO_SAMPLES; i++ )
@ -922,7 +922,7 @@ cSampleManager::Initialise(void)
curprovider = -1;
prevprovider = -1;
_usingMilesFast2D = false;
_usingMilesFast2D = FALSE;
usingEAX=0;
usingEAX3=0;
@ -947,7 +947,7 @@ cSampleManager::Initialise(void)
for ( int32 i = 0; i < MAX_SFX_BANKS; i++ )
{
bSampleBankLoaded[i] = false;
bSampleBankLoaded[i] = FALSE;
nSampleBankDiscStartOffset[i] = 0;
nSampleBankSize[i] = 0;
nSampleBankMemoryStartAddress[i] = 0;
@ -988,24 +988,24 @@ cSampleManager::Initialise(void)
#ifdef AUDIO_CACHE
TRACE("cache");
FILE *cacheFile = fcaseopen("audio\\sound.cache", "rb");
bool CreateCache = false;
bool8 CreateCache = FALSE;
if (cacheFile) {
fread(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
fclose(cacheFile);
}else
CreateCache = true;
CreateCache = TRUE;
#endif
char filepath[MAX_PATH];
bool bFileNotFound;
bool8 bFileNotFound;
S32 tatalms;
TRACE("cdrom");
{
m_bInitialised = false;
m_bInitialised = FALSE;
while (true)
while (TRUE)
{
// Find path of WAVs (originally in HDD)
@ -1046,7 +1046,7 @@ cSampleManager::Initialise(void)
{
OutputDebugString(AIL_last_error());
Terminate();
return false;
return FALSE;
}
add_providers();
@ -1076,9 +1076,9 @@ cSampleManager::Initialise(void)
}
else
{
m_bInitialised = false;
m_bInitialised = FALSE;
Terminate();
return false;
return FALSE;
}
}
@ -1113,7 +1113,7 @@ cSampleManager::Initialise(void)
AIL_close_stream(mp3Stream[0]);
mp3Stream[0] = NULL;
bFileNotFound = false;
bFileNotFound = FALSE;
#ifdef AUDIO_CACHE
if (!CreateCache)
break;
@ -1124,7 +1124,7 @@ cSampleManager::Initialise(void)
}
else
{
bFileNotFound = true;
bFileNotFound = TRUE;
break;
}
}
@ -1159,11 +1159,11 @@ cSampleManager::Initialise(void)
mp3Stream[0] = NULL;
nStreamLength[i] = tatalms;
bFileNotFound = false;
bFileNotFound = FALSE;
}
else
{
bFileNotFound = true;
bFileNotFound = TRUE;
break;
}
}
@ -1178,11 +1178,11 @@ cSampleManager::Initialise(void)
if ( FrontEndMenuManager.m_bQuitGameNoCD )
{
Terminate();
return false;
return FALSE;
}
continue;
#else
m_bInitialised = true;
m_bInitialised = TRUE;
#endif
}
@ -1201,14 +1201,14 @@ cSampleManager::Initialise(void)
if ( !InitialiseSampleBanks() )
{
Terminate();
return false;
return FALSE;
}
nSampleBankMemoryStartAddress[SFX_BANK_0] = (int32)AIL_mem_alloc_lock(nSampleBankSize[SFX_BANK_0]);
if ( !nSampleBankMemoryStartAddress[SFX_BANK_0] )
{
Terminate();
return false;
return FALSE;
}
nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] = (int32)AIL_mem_alloc_lock(PED_BLOCKSIZE*MAX_PEDSFX);
@ -1237,7 +1237,7 @@ cSampleManager::Initialise(void)
TRACE("providerset");
{
_bSampmanInitialised = true;
_bSampmanInitialised = TRUE;
U32 n = 0;
@ -1254,7 +1254,7 @@ cSampleManager::Initialise(void)
if ( n == m_nNumberOfProviders )
{
Terminate();
return false;
return FALSE;
}
}
@ -1279,13 +1279,13 @@ cSampleManager::Initialise(void)
time_t t = time(NULL);
tm *localtm;
bool bUseRandomTable;
bool8 bUseRandomTable;
if ( t == -1 )
bUseRandomTable = true;
bUseRandomTable = TRUE;
else
{
bUseRandomTable = false;
bUseRandomTable = FALSE;
localtm = localtime(&t);
}
@ -1317,12 +1317,12 @@ cSampleManager::Initialise(void)
else
_CurMP3Pos = 0;
_bIsMp3Active = false;
_bIsMp3Active = FALSE;
}
TRACE("end");
return true;
return TRUE;
}
void
@ -1371,10 +1371,10 @@ cSampleManager::Terminate(void)
AIL_shutdown();
_bSampmanInitialised = false;
_bSampmanInitialised = FALSE;
}
bool
bool8
cSampleManager::CheckForAnAudioFileOnCD(void)
{
#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.Service();
return true;
return TRUE;
}
DMAudio.SetMusicMasterVolume(0);
DMAudio.SetEffectsMasterVolume(0);
DMAudio.Service();
return false;
return FALSE;
#else
return true;
return TRUE;
#endif // #if !defined(NO_CDCHECK)
}
@ -1484,48 +1484,48 @@ cSampleManager::SetMusicFadeVolume(uint8 nVolume)
}
void
cSampleManager::SetMonoMode(uint8 nMode)
cSampleManager::SetMonoMode(bool8 nMode)
{
m_nMonoMode = nMode;
}
bool
bool8
cSampleManager::LoadSampleBank(uint8 nBank)
{
if ( CTimer::GetIsCodePaused() )
return false;
return FALSE;
if ( MusicManager.IsInitialised()
&& MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
&& nBank != SFX_BANK_0 )
{
return false;
return FALSE;
}
if ( fseek(fpSampleDataHandle, nSampleBankDiscStartOffset[nBank], SEEK_SET) != 0 )
return false;
return FALSE;
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
cSampleManager::UnloadSampleBank(uint8 nBank)
{
bSampleBankLoaded[nBank] = false;
bSampleBankLoaded[nBank] = FALSE;
}
bool
bool8
cSampleManager::IsSampleBankLoaded(uint8 nBank)
{
return bSampleBankLoaded[nBank];
}
bool
bool8
cSampleManager::IsPedCommentLoaded(uint32 nComment)
{
int8 slot;
@ -1538,10 +1538,10 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment)
slot += ARRAY_SIZE(nPedSlotSfx);
#endif
if ( nComment == nPedSlotSfx[slot] )
return true;
return TRUE;
}
return false;
return FALSE;
}
int32
@ -1563,11 +1563,11 @@ cSampleManager::_GetPedCommentSlot(uint32 nComment)
return -1;
}
bool
bool8
cSampleManager::LoadPedComment(uint32 nComment)
{
if ( CTimer::GetIsCodePaused() )
return false;
return FALSE;
// no talking peds during cutsenes or the game end
if ( MusicManager.IsInitialised() )
@ -1576,7 +1576,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
{
case MUSICMODE_CUTSCENE:
{
return false;
return FALSE;
break;
}
@ -1584,10 +1584,10 @@ cSampleManager::LoadPedComment(uint32 nComment)
}
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 )
return false;
return FALSE;
nPedSlotSfxAddr[nCurrentPedSlot] = nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE*nCurrentPedSlot;
nPedSlotSfx [nCurrentPedSlot] = nComment;
@ -1595,7 +1595,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
if ( ++nCurrentPedSlot >= MAX_PEDSFX )
nCurrentPedSlot = 0;
return true;
return TRUE;
}
int32
@ -1634,14 +1634,14 @@ cSampleManager::GetSampleLength(uint32 nSample)
return m_aSamples[nSample].nSize >> 1;
}
bool
bool8
cSampleManager::UpdateReverb(void)
{
if ( !usingEAX )
return false;
return FALSE;
if ( AudioManager.GetFrameCounter() & 15 )
return false;
return FALSE;
float fRatio = 0.0f;
@ -1662,7 +1662,7 @@ cSampleManager::UpdateReverb(void)
fRatio = clamp(fRatio, 0.0f, 0.6f);
if ( fRatio == _fPrevEaxRatioDestination )
return false;
return FALSE;
if ( usingEAX3 )
{
@ -1684,26 +1684,26 @@ cSampleManager::UpdateReverb(void)
_fPrevEaxRatioDestination = fRatio;
return true;
return TRUE;
}
void
cSampleManager::SetChannelReverbFlag(uint32 nChannel, uint8 nReverbFlag)
cSampleManager::SetChannelReverbFlag(uint32 nChannel, bool8 nReverbFlag)
{
bool b2d = false;
bool8 b2d = FALSE;
switch ( nChannel )
{
case CHANNEL2D:
{
b2d = true;
b2d = TRUE;
break;
}
}
if ( usingEAX )
{
if ( nReverbFlag != 0 )
if ( nReverbFlag != FALSE )
{
if ( !b2d )
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)
{
bool b2d = false;
bool8 b2d = FALSE;
switch ( nChannel )
{
case CHANNEL2D:
{
b2d = true;
b2d = TRUE;
break;
}
}
@ -1735,14 +1735,14 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
if ( nSfx < SAMPLEBANK_MAX )
{
if ( !IsSampleBankLoaded(nBank) )
return false;
return FALSE;
addr = nSampleBankMemoryStartAddress[nBank] + m_aSamples[nSfx].nOffset - m_aSamples[BankStartOffset[nBank]].nOffset;
}
else
{
if ( !IsPedCommentLoaded(nSfx) )
return false;
return FALSE;
int32 slot = _GetPedCommentSlot(nSfx);
@ -1754,10 +1754,10 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
if ( opened_2dsamples[nChannel - MAXCHANNELS] )
{
AIL_set_sample_address(opened_2dsamples[nChannel - MAXCHANNELS], (void *)addr, m_aSamples[nSfx].nSize);
return true;
return TRUE;
}
else
return false;
return FALSE;
}
else
{
@ -1773,10 +1773,10 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
if ( AIL_set_3D_sample_info(opened_samples[nChannel], &info) == 0 )
{
OutputDebugString(AIL_last_error());
return false;
return FALSE;
}
return true;
return TRUE;
}
}
@ -1867,13 +1867,13 @@ cSampleManager::SetChannelPan(uint32 nChannel, uint32 nPan)
void
cSampleManager::SetChannelFrequency(uint32 nChannel, uint32 nFreq)
{
bool b2d = false;
bool8 b2d = FALSE;
switch ( nChannel )
{
case CHANNEL2D:
{
b2d = true;
b2d = TRUE;
break;
}
}
@ -1893,13 +1893,13 @@ cSampleManager::SetChannelFrequency(uint32 nChannel, uint32 nFreq)
void
cSampleManager::SetChannelLoopPoints(uint32 nChannel, uint32 nLoopStart, int32 nLoopEnd)
{
bool b2d = false;
bool8 b2d = FALSE;
switch ( nChannel )
{
case CHANNEL2D:
{
b2d = true;
b2d = TRUE;
break;
}
}
@ -1919,13 +1919,13 @@ cSampleManager::SetChannelLoopPoints(uint32 nChannel, uint32 nLoopStart, int32 n
void
cSampleManager::SetChannelLoopCount(uint32 nChannel, uint32 nLoopCount)
{
bool b2d = false;
bool8 b2d = FALSE;
switch ( nChannel )
{
case CHANNEL2D:
{
b2d = true;
b2d = TRUE;
break;
}
}
@ -1942,16 +1942,16 @@ cSampleManager::SetChannelLoopCount(uint32 nChannel, uint32 nLoopCount)
}
}
bool
bool8
cSampleManager::GetChannelUsedFlag(uint32 nChannel)
{
bool b2d = false;
bool8 b2d = FALSE;
switch ( nChannel )
{
case CHANNEL2D:
{
b2d = true;
b2d = TRUE;
break;
}
}
@ -1961,14 +1961,14 @@ cSampleManager::GetChannelUsedFlag(uint32 nChannel)
if ( opened_2dsamples[nChannel - MAXCHANNELS] )
return AIL_sample_status(opened_2dsamples[nChannel - MAXCHANNELS]) == SMP_PLAYING;
else
return false;
return FALSE;
}
else
{
if ( opened_samples[nChannel] )
return AIL_3D_sample_status(opened_samples[nChannel]) == SMP_PLAYING;
else
return false;
return FALSE;
}
}
@ -1976,13 +1976,13 @@ cSampleManager::GetChannelUsedFlag(uint32 nChannel)
void
cSampleManager::StartChannel(uint32 nChannel)
{
bool b2d = false;
bool8 b2d = FALSE;
switch ( nChannel )
{
case CHANNEL2D:
{
b2d = true;
b2d = TRUE;
break;
}
}
@ -2002,13 +2002,13 @@ cSampleManager::StartChannel(uint32 nChannel)
void
cSampleManager::StopChannel(uint32 nChannel)
{
bool b2d = false;
bool8 b2d = FALSE;
switch ( nChannel )
{
case CHANNEL2D:
{
b2d = true;
b2d = TRUE;
break;
}
}
@ -2060,12 +2060,12 @@ cSampleManager::PreloadStreamedFile(uint32 nFile, uint8 nStream)
}
void
cSampleManager::PauseStream(uint8 nPauseFlag, uint8 nStream)
cSampleManager::PauseStream(bool8 nPauseFlag, uint8 nStream)
{
if ( m_bInitialised )
{
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)
{
int i = 0;
@ -2087,7 +2087,7 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
char filename[MAX_PATH];
if ( !m_bInitialised || nFile >= TOTAL_STREAMED_SOUNDS )
return false;
return FALSE;
if ( mp3Stream[nStream] )
{
@ -2114,12 +2114,12 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
AIL_open_stream(DIG, filename, 0);
if(mp3Stream[nStream]) {
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_pause_stream(mp3Stream[nStream], 0);
return true;
return TRUE;
}
return false;
return FALSE;
} else {
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_pause_stream(mp3Stream[nStream], 0);
_bIsMp3Active = true;
_bIsMp3Active = TRUE;
return true;
return TRUE;
}
// fall through, start playing from another song
}
@ -2163,14 +2163,14 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
if(mp3Stream[nStream]) {
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_pause_stream(mp3Stream[nStream],
0);
return true;
return TRUE;
}
return false;
return FALSE;
}
}
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_pause_stream(mp3Stream[nStream], 0);
#ifdef FIX_BUGS
_bIsMp3Active = true;
_bIsMp3Active = TRUE;
#endif
return true;
return TRUE;
}
}
@ -2207,12 +2207,12 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
if ( mp3Stream[nStream] )
{
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_pause_stream(mp3Stream[nStream], 0);
return true;
return TRUE;
}
return false;
return FALSE;
}
void
@ -2228,7 +2228,7 @@ cSampleManager::StopStreamedFile(uint8 nStream)
mp3Stream[nStream] = NULL;
if ( nStream == 0 )
_bIsMp3Active = false;
_bIsMp3Active = FALSE;
}
}
}
@ -2266,7 +2266,7 @@ cSampleManager::GetStreamedFilePosition(uint8 nStream)
}
void
cSampleManager::SetStreamedVolumeAndPan(uint8 nVolume, uint8 nPan, uint8 nEffectFlag, uint8 nStream)
cSampleManager::SetStreamedVolumeAndPan(uint8 nVolume, uint8 nPan, bool8 nEffectFlag, uint8 nStream)
{
uint8 vol = nVolume;
float boostMult = 0.0f;
@ -2307,7 +2307,7 @@ cSampleManager::GetStreamedFileLength(uint8 nStream)
return 0;
}
bool
bool8
cSampleManager::IsStreamPlaying(uint8 nStream)
{
if ( m_bInitialised )
@ -2315,23 +2315,23 @@ cSampleManager::IsStreamPlaying(uint8 nStream)
if ( mp3Stream[nStream] )
{
if ( AIL_stream_status(mp3Stream[nStream]) == SMP_PLAYING )
return true;
return TRUE;
else
return false;
return FALSE;
}
}
return false;
return FALSE;
}
bool
bool8
cSampleManager::InitialiseSampleBanks(void)
{
int32 nBank = SFX_BANK_0;
fpSampleDescHandle = fopen(SampleBankDescFilename, "rb");
if ( fpSampleDescHandle == NULL )
return false;
return FALSE;
fpSampleDataHandle = fopen(SampleBankDataFilename, "rb");
if ( fpSampleDataHandle == NULL )
@ -2339,7 +2339,7 @@ cSampleManager::InitialiseSampleBanks(void)
fclose(fpSampleDescHandle);
fpSampleDescHandle = NULL;
return false;
return FALSE;
}
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_PED_COMMENTS] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS];
return true;
return TRUE;
}

View File

@ -4,7 +4,7 @@
#include "AudioManager.h"
cSampleManager SampleManager;
bool _bSampmanInitialised = false;
bool8 _bSampmanInitialised = FALSE;
uint32 BankStartOffset[MAX_SFX_BANKS];
uint32 nNumMP3s;
@ -60,7 +60,7 @@ int8 cSampleManager::SetCurrent3DProvider(uint8 nProvider)
return 0;
}
bool
bool8
cSampleManager::IsMP3RadioChannelAvailable(void)
{
return nNumMP3s != 0;
@ -75,10 +75,10 @@ void cSampleManager::ReacquireDigitalHandle(void)
{
}
bool
bool8
cSampleManager::Initialise(void)
{
return true;
return TRUE;
}
void
@ -87,9 +87,9 @@ cSampleManager::Terminate(void)
}
bool cSampleManager::CheckForAnAudioFileOnCD(void)
bool8 cSampleManager::CheckForAnAudioFileOnCD(void)
{
return true;
return TRUE;
}
char cSampleManager::GetCDAudioDriveLetter(void)
@ -129,15 +129,15 @@ cSampleManager::SetMusicFadeVolume(uint8 nVolume)
}
void
cSampleManager::SetMonoMode(uint8 nMode)
cSampleManager::SetMonoMode(bool8 nMode)
{
}
bool
bool8
cSampleManager::LoadSampleBank(uint8 nBank)
{
ASSERT( nBank < MAX_SFX_BANKS );
return false;
return FALSE;
}
void
@ -146,20 +146,20 @@ cSampleManager::UnloadSampleBank(uint8 nBank)
ASSERT( nBank < MAX_SFX_BANKS );
}
bool
bool8
cSampleManager::IsSampleBankLoaded(uint8 nBank)
{
ASSERT( nBank < MAX_SFX_BANKS );
return false;
return FALSE;
}
bool
bool8
cSampleManager::IsPedCommentLoaded(uint32 nComment)
{
ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
return false;
return FALSE;
}
@ -169,11 +169,11 @@ cSampleManager::_GetPedCommentSlot(uint32 nComment)
return -1;
}
bool
bool8
cSampleManager::LoadPedComment(uint32 nComment)
{
ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
return false;
return FALSE;
}
int32
@ -210,22 +210,22 @@ cSampleManager::GetSampleLength(uint32 nSample)
return 0;
}
bool cSampleManager::UpdateReverb(void)
bool8 cSampleManager::UpdateReverb(void)
{
return false;
return FALSE;
}
void
cSampleManager::SetChannelReverbFlag(uint32 nChannel, uint8 nReverbFlag)
cSampleManager::SetChannelReverbFlag(uint32 nChannel, bool8 nReverbFlag)
{
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
}
bool
bool8
cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
{
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
return false;
return FALSE;
}
void
@ -281,12 +281,12 @@ cSampleManager::SetChannelLoopCount(uint32 nChannel, uint32 nLoopCount)
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
}
bool
bool8
cSampleManager::GetChannelUsedFlag(uint32 nChannel)
{
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
return false;
return FALSE;
}
void
@ -308,7 +308,7 @@ cSampleManager::PreloadStreamedFile(uint32 nFile, uint8 nStream)
}
void
cSampleManager::PauseStream(uint8 nPauseFlag, uint8 nStream)
cSampleManager::PauseStream(bool8 nPauseFlag, uint8 nStream)
{
ASSERT( nStream < MAX_STREAMS );
}
@ -319,12 +319,12 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
ASSERT( nStream < MAX_STREAMS );
}
bool
bool8
cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
{
ASSERT( nStream < MAX_STREAMS );
return false;
return FALSE;
}
void
@ -342,7 +342,7 @@ cSampleManager::GetStreamedFilePosition(uint8 nStream)
}
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 );
}
@ -355,19 +355,19 @@ cSampleManager::GetStreamedFileLength(uint8 nStream)
return 1;
}
bool
bool8
cSampleManager::IsStreamPlaying(uint8 nStream)
{
ASSERT( nStream < MAX_STREAMS );
return false;
return FALSE;
}
bool
bool8
cSampleManager::InitialiseSampleBanks(void)
{
return true;
return TRUE;
}
void

View File

@ -48,7 +48,7 @@
//TODO: max channels
cSampleManager SampleManager;
bool _bSampmanInitialised = false;
bool8 _bSampmanInitialised = FALSE;
uint32 BankStartOffset[MAX_SFX_BANKS];
@ -84,7 +84,7 @@ OggOpusFile *fpSampleDataHandle;
#else
FILE *fpSampleDataHandle;
#endif
bool bSampleBankLoaded [MAX_SFX_BANKS];
bool8 bSampleBankLoaded [MAX_SFX_BANKS];
int32 nSampleBankDiscStartOffset [MAX_SFX_BANKS];
int32 nSampleBankSize [MAX_SFX_BANKS];
uintptr nSampleBankMemoryStartAddress[MAX_SFX_BANKS];
@ -121,7 +121,7 @@ uint8 nStreamVolume[MAX_STREAMS];
uint8 nStreamLoopedFlag[MAX_STREAMS];
uint32 _CurMP3Index;
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
EAXLISTENERPROPERTIES StartEAX3 =
@ -266,11 +266,11 @@ release_existing()
DEV("release_existing()\n");
}
static bool
static bool8
set_new_provider(int index)
{
if ( curprovider == index )
return true;
return TRUE;
curprovider = index;
@ -302,7 +302,7 @@ set_new_provider(int index)
{
curprovider=-1;
release_existing();
return false;
return FALSE;
}
alListenerf (AL_GAIN, 1.0f);
@ -383,13 +383,13 @@ set_new_provider(int index)
aChannel[i].SetReverbMix(ALEffectSlot, 0.0f);
}
return true;
return TRUE;
}
return false;
return FALSE;
}
static bool
static bool8
IsThisTrackAt16KHz(uint32 track)
{
return track == STREAMED_SOUND_RADIO_KCHAT || track == STREAMED_SOUND_RADIO_VCPR || track == STREAMED_SOUND_RADIO_POLICE;
@ -482,13 +482,13 @@ cSampleManager::AutoDetect3DProviders()
return -1;
}
static bool
static bool8
_ResolveLink(char const *path, char *out)
{
#ifdef _WIN32
size_t len = strlen(path);
if (len < 4 || strcmp(&path[len - 4], ".lnk") != 0)
return false;
return FALSE;
IShellLink* psl;
WIN32_FIND_DATA fd;
@ -523,7 +523,7 @@ _ResolveLink(char const *path, char *out)
ppf->Release();
psl->Release();
#endif
return true;
return TRUE;
}
}
}
@ -533,31 +533,31 @@ _ResolveLink(char const *path, char *out)
psl->Release();
}
return false;
return FALSE;
#else
struct stat sb;
if (lstat(path, &sb) == -1) {
perror("lstat: ");
return false;
return FALSE;
}
if (S_ISLNK(sb.st_mode)) {
char* linkname = (char*)alloca(sb.st_size + 1);
if (linkname == NULL) {
fprintf(stderr, "insufficient memory\n");
return false;
return FALSE;
}
if (readlink(path, linkname, sb.st_size + 1) < 0) {
perror("readlink: ");
return false;
return FALSE;
}
linkname[sb.st_size] = '\0';
strcpy(out, linkname);
return true;
return TRUE;
} else {
return false;
return FALSE;
}
#endif
}
@ -566,8 +566,8 @@ static void
_FindMP3s(void)
{
tMP3Entry *pList;
bool bShortcut;
bool bInitFirstEntry;
bool8 bShortcut;
bool8 bInitFirstEntry;
HANDLE hFind;
char path[MAX_PATH];
char filepath[MAX_PATH*2];
@ -610,9 +610,9 @@ _FindMP3s(void)
{
OutputDebugString("Resolving Link");
OutputDebugString(filepath);
bShortcut = true;
bShortcut = TRUE;
} else
bShortcut = false;
bShortcut = FALSE;
aStream[0] = new CStream(filepath, ALStreamSources[0], ALStreamBuffers[0]);
@ -652,7 +652,7 @@ _FindMP3s(void)
_pMP3List->pLinkPath = NULL;
}
bInitFirstEntry = false;
bInitFirstEntry = FALSE;
}
else
{
@ -660,10 +660,10 @@ _FindMP3s(void)
OutputDebugString(filepath);
bInitFirstEntry = true;
bInitFirstEntry = TRUE;
}
while ( true )
while ( TRUE )
{
if ( !FindNextFile(hFind, &fd) )
break;
@ -681,9 +681,9 @@ _FindMP3s(void)
{
OutputDebugString("Resolving Link");
OutputDebugString(filepath);
bShortcut = true;
bShortcut = TRUE;
} else {
bShortcut = false;
bShortcut = FALSE;
if (filepathlen > MAX_PATH) {
continue;
}
@ -722,7 +722,7 @@ _FindMP3s(void)
pList = _pMP3List;
bInitFirstEntry = false;
bInitFirstEntry = FALSE;
}
else
{
@ -744,9 +744,9 @@ _FindMP3s(void)
{
OutputDebugString("Resolving Link");
OutputDebugString(filepath);
bShortcut = true;
bShortcut = TRUE;
} else
bShortcut = false;
bShortcut = FALSE;
aStream[0] = new CStream(filepath, ALStreamSources[0], ALStreamBuffers[0]);
@ -858,7 +858,7 @@ _GetMP3EntryByIndex(uint32 idx)
return NULL;
}
static inline bool
static inline bool8
_GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
{
_CurMP3Index = 0;
@ -871,7 +871,7 @@ _GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
*pPosition -= (*pEntry)->nTrackStreamPos;
_CurMP3Pos = *pPosition;
return true;
return TRUE;
}
_CurMP3Index++;
@ -882,10 +882,10 @@ _GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
_CurMP3Pos = 0;
_CurMP3Index = 0;
return false;
return FALSE;
}
bool
bool8
cSampleManager::IsMP3RadioChannelAvailable(void)
{
return nNumMP3s != 0;
@ -911,11 +911,11 @@ void cSampleManager::ReacquireDigitalHandle(void)
}
}
bool
bool8
cSampleManager::Initialise(void)
{
if ( _bSampmanInitialised )
return true;
return TRUE;
EFXInit();
CStream::Initialise();
@ -960,7 +960,7 @@ cSampleManager::Initialise(void)
for ( int32 i = 0; i < MAX_SFX_BANKS; i++ )
{
bSampleBankLoaded[i] = false;
bSampleBankLoaded[i] = FALSE;
nSampleBankDiscStartOffset[i] = 0;
nSampleBankSize[i] = 0;
nSampleBankMemoryStartAddress[i] = 0;
@ -1031,7 +1031,7 @@ cSampleManager::Initialise(void)
if ( !InitialiseSampleBanks() )
{
Terminate();
return false;
return FALSE;
}
nSampleBankMemoryStartAddress[SFX_BANK_0] = (uintptr)malloc(nSampleBankSize[SFX_BANK_0]);
@ -1040,7 +1040,7 @@ cSampleManager::Initialise(void)
if ( nSampleBankMemoryStartAddress[SFX_BANK_0] == 0 )
{
Terminate();
return false;
return FALSE;
}
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 )
{
@ -1068,7 +1068,7 @@ cSampleManager::Initialise(void)
else
{
Terminate();
return false;
return FALSE;
}
}
@ -1091,13 +1091,13 @@ cSampleManager::Initialise(void)
time_t t = time(NULL);
tm *localtm;
bool bUseRandomTable;
bool8 bUseRandomTable;
if ( t == -1 )
bUseRandomTable = true;
bUseRandomTable = TRUE;
else
{
bUseRandomTable = false;
bUseRandomTable = FALSE;
localtm = localtime(&t);
}
@ -1129,10 +1129,10 @@ cSampleManager::Initialise(void)
else
_CurMP3Pos = 0;
_bIsMp3Active = false;
_bIsMp3Active = FALSE;
}
return true;
return TRUE;
}
void
@ -1166,12 +1166,12 @@ cSampleManager::Terminate(void)
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)
@ -1228,24 +1228,24 @@ cSampleManager::SetMusicFadeVolume(uint8 nVolume)
}
void
cSampleManager::SetMonoMode(uint8 nMode)
cSampleManager::SetMonoMode(bool8 nMode)
{
m_nMonoMode = nMode;
}
bool
bool8
cSampleManager::LoadSampleBank(uint8 nBank)
{
ASSERT( nBank < MAX_SFX_BANKS);
if ( CTimer::GetIsCodePaused() )
return false;
return FALSE;
if ( MusicManager.IsInitialised()
&& MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
&& nBank != SFX_BANK_0 )
{
return false;
return FALSE;
}
#ifdef OPUS_SFX
@ -1264,14 +1264,14 @@ cSampleManager::LoadSampleBank(uint8 nBank)
}
#else
if ( fseek(fpSampleDataHandle, nSampleBankDiscStartOffset[nBank], SEEK_SET) != 0 )
return false;
return FALSE;
if ( fread((void *)nSampleBankMemoryStartAddress[nBank], 1, nSampleBankSize[nBank], fpSampleDataHandle) != nSampleBankSize[nBank] )
return false;
return FALSE;
#endif
bSampleBankLoaded[nBank] = true;
bSampleBankLoaded[nBank] = TRUE;
return true;
return TRUE;
}
void
@ -1279,10 +1279,10 @@ cSampleManager::UnloadSampleBank(uint8 nBank)
{
ASSERT( nBank < MAX_SFX_BANKS);
bSampleBankLoaded[nBank] = false;
bSampleBankLoaded[nBank] = FALSE;
}
bool
bool8
cSampleManager::IsSampleBankLoaded(uint8 nBank)
{
ASSERT( nBank < MAX_SFX_BANKS);
@ -1290,7 +1290,7 @@ cSampleManager::IsSampleBankLoaded(uint8 nBank)
return bSampleBankLoaded[nBank];
}
bool
bool8
cSampleManager::IsPedCommentLoaded(uint32 nComment)
{
ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
@ -1305,10 +1305,10 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment)
slot += ARRAY_SIZE(nPedSlotSfx);
#endif
if ( nComment == nPedSlotSfx[slot] )
return true;
return TRUE;
}
return false;
return FALSE;
}
@ -1331,13 +1331,13 @@ cSampleManager::_GetPedCommentSlot(uint32 nComment)
return -1;
}
bool
bool8
cSampleManager::LoadPedComment(uint32 nComment)
{
ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
if ( CTimer::GetIsCodePaused() )
return false;
return FALSE;
// no talking peds during cutsenes or the game end
if ( MusicManager.IsInitialised() )
@ -1346,7 +1346,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
{
case MUSICMODE_CUTSCENE:
{
return false;
return FALSE;
break;
}
@ -1361,17 +1361,17 @@ cSampleManager::LoadPedComment(uint32 nComment)
int size = op_read(fpSampleDataHandle, (opus_int16 *)(nSampleBankMemoryStartAddress[SAMPLEBANK_PED] + PED_BLOCKSIZE * nCurrentPedSlot + samplesRead),
samplesSize, NULL);
if (size <= 0) {
return false;
return FALSE;
}
samplesRead += size * 2;
samplesSize -= size;
}
#else
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 )
return false;
return FALSE;
#endif
nPedSlotSfx[nCurrentPedSlot] = nComment;
@ -1379,7 +1379,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
if ( ++nCurrentPedSlot >= MAX_PEDSFX )
nCurrentPedSlot = 0;
return true;
return TRUE;
}
int32
@ -1422,13 +1422,13 @@ cSampleManager::GetSampleLength(uint32 nSample)
return m_aSamples[nSample].nSize / sizeof(uint16);
}
bool cSampleManager::UpdateReverb(void)
bool8 cSampleManager::UpdateReverb(void)
{
if ( !usingEAX && !_usingEFX )
return false;
return FALSE;
if ( AudioManager.GetFrameCounter() & 15 )
return false;
return FALSE;
float fRatio = 0.0f;
@ -1449,7 +1449,7 @@ bool cSampleManager::UpdateReverb(void)
fRatio = clamp(fRatio, 0.0f, 0.6f);
if ( fRatio == _fPrevEaxRatioDestination )
return false;
return FALSE;
#ifdef JUICY_OAL
if ( usingEAX3 || _usingEFX )
@ -1486,11 +1486,11 @@ bool cSampleManager::UpdateReverb(void)
_fPrevEaxRatioDestination = fRatio;
return true;
return TRUE;
}
void
cSampleManager::SetChannelReverbFlag(uint32 nChannel, uint8 nReverbFlag)
cSampleManager::SetChannelReverbFlag(uint32 nChannel, bool8 nReverbFlag)
{
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
@ -1500,7 +1500,7 @@ cSampleManager::SetChannelReverbFlag(uint32 nChannel, uint8 nReverbFlag)
{
alAuxiliaryEffectSloti(ALEffectSlot, AL_EFFECTSLOT_EFFECT, ALEffect);
if ( nReverbFlag != 0 )
if ( nReverbFlag != FALSE )
aChannel[nChannel].SetReverbMix(ALEffectSlot, _fEffectsLevel);
else
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)
{
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
@ -1518,14 +1518,14 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
if ( nSfx < SAMPLEBANK_MAX )
{
if ( !IsSampleBankLoaded(nBank) )
return false;
return FALSE;
addr = nSampleBankMemoryStartAddress[nBank] + m_aSamples[nSfx].nOffset - m_aSamples[BankStartOffset[nBank]].nOffset;
}
else
{
if ( !IsPedCommentLoaded(nSfx) )
return false;
return FALSE;
int32 slot = _GetPedCommentSlot(nSfx);
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].SetLoopPoints (0, -1);
aChannel[nChannel].SetPitch (1.0f);
return true;
return TRUE;
}
return false;
return FALSE;
}
void
@ -1649,7 +1649,7 @@ cSampleManager::SetChannelLoopCount(uint32 nChannel, uint32 nLoopCount)
aChannel[nChannel].SetLoopCount(nLoopCount);
}
bool
bool8
cSampleManager::GetChannelUsedFlag(uint32 nChannel)
{
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
@ -1703,7 +1703,7 @@ cSampleManager::PreloadStreamedFile(uint32 nFile, uint8 nStream)
}
void
cSampleManager::PauseStream(uint8 nPauseFlag, uint8 nStream)
cSampleManager::PauseStream(bool8 nPauseFlag, uint8 nStream)
{
ASSERT( nStream < MAX_STREAMS );
@ -1711,7 +1711,7 @@ cSampleManager::PauseStream(uint8 nPauseFlag, uint8 nStream)
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)
{
int i = 0;
@ -1739,7 +1739,7 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
char filename[MAX_PATH];
if ( nFile >= TOTAL_STREAMED_SOUNDS )
return false;
return FALSE;
if ( aStream[nStream] )
{
@ -1768,18 +1768,18 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
if (stream->Setup()) {
stream->SetLoopCount(nStreamLoopedFlag[nStream] ? 0 : 1);
nStreamLoopedFlag[nStream] = true;
nStreamLoopedFlag[nStream] = TRUE;
if (position != 0)
stream->SetPosMS(position);
stream->Start();
return true;
return TRUE;
} else {
delete stream;
aStream[nStream] = NULL;
}
return false;
return FALSE;
} else {
@ -1798,8 +1798,8 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
aStream[nStream]->Start();
_bIsMp3Active = true;
return true;
_bIsMp3Active = TRUE;
return TRUE;
} else {
delete aStream[nStream];
aStream[nStream] = NULL;
@ -1827,18 +1827,18 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
if (stream->Setup()) {
stream->SetLoopCount(nStreamLoopedFlag[nStream] ? 0 : 1);
nStreamLoopedFlag[nStream] = true;
nStreamLoopedFlag[nStream] = TRUE;
if (position != 0)
stream->SetPosMS(position);
stream->Start();
return true;
return TRUE;
} else {
delete stream;
aStream[nStream] = NULL;
}
return false;
return FALSE;
}
}
if (mp3->pLinkPath != NULL)
@ -1853,9 +1853,9 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
if (aStream[nStream]->Setup()) {
aStream[nStream]->Start();
#ifdef FIX_BUGS
_bIsMp3Active = true;
_bIsMp3Active = TRUE;
#endif
return true;
return TRUE;
} else {
delete aStream[nStream];
aStream[nStream] = NULL;
@ -1876,18 +1876,18 @@ cSampleManager::StartStreamedFile(uint32 nFile, uint32 nPos, uint8 nStream)
if ( stream->Setup() ) {
stream->SetLoopCount(nStreamLoopedFlag[nStream] ? 0 : 1);
nStreamLoopedFlag[nStream] = true;
nStreamLoopedFlag[nStream] = TRUE;
if (position != 0)
stream->SetPosMS(position);
stream->Start();
return true;
return TRUE;
} else {
delete stream;
aStream[nStream] = NULL;
}
return false;
return FALSE;
}
void
@ -1903,7 +1903,7 @@ cSampleManager::StopStreamedFile(uint8 nStream)
aStream[nStream] = NULL;
if ( nStream == 0 )
_bIsMp3Active = false;
_bIsMp3Active = FALSE;
}
}
@ -1937,7 +1937,7 @@ cSampleManager::GetStreamedFilePosition(uint8 nStream)
}
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 );
@ -1980,7 +1980,7 @@ cSampleManager::GetStreamedFileLength(uint8 nStream)
return nStreamLength[nStream];
}
bool
bool8
cSampleManager::IsStreamPlaying(uint8 nStream)
{
ASSERT( nStream < MAX_STREAMS );
@ -1990,10 +1990,10 @@ cSampleManager::IsStreamPlaying(uint8 nStream)
if ( stream )
{
if ( stream->IsPlaying() )
return true;
return TRUE;
}
return false;
return FALSE;
}
void
@ -2014,14 +2014,14 @@ cSampleManager::Service(void)
}
}
bool
bool8
cSampleManager::InitialiseSampleBanks(void)
{
int32 nBank = SFX_BANK_0;
fpSampleDescHandle = fcaseopen(SampleBankDescFilename, "rb");
if ( fpSampleDescHandle == NULL )
return false;
return FALSE;
#ifndef OPUS_SFX
fpSampleDataHandle = fcaseopen(SampleBankDataFilename, "rb");
if ( fpSampleDataHandle == NULL )
@ -2029,7 +2029,7 @@ cSampleManager::InitialiseSampleBanks(void)
fclose(fpSampleDescHandle);
fpSampleDescHandle = NULL;
return false;
return FALSE;
}
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_PED_COMMENTS] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS];
return true;
return TRUE;
}
void

View File

@ -158,7 +158,7 @@ void CGarages::Init(void)
}
hGarages = DMAudio.CreateEntity(AUDIOTYPE_GARAGE, (void*)1);
if (hGarages >= 0)
DMAudio.SetEntityStatus(hGarages, true);
DMAudio.SetEntityStatus(hGarages, TRUE);
}
void CGarages::Shutdown(void)

View File

@ -1463,7 +1463,7 @@ void CReplay::RestoreStuffFromMem(void)
ped->SetModelIndex(mi);
ped->m_pVehicleAnim = nil;
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);
for (int j = 0; j < TOTAL_WEAPON_SLOTS; j++) {
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);
}
vehicle->m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, vehicle);
DMAudio.SetEntityStatus(vehicle->m_audioEntityId, true);
DMAudio.SetEntityStatus(vehicle->m_audioEntityId, TRUE);
CCarCtrl::UpdateCarCount(vehicle, false);
if ((mi == MI_AIRTRAIN || mi == MI_DEADDODO) && vehicle->m_rwObject){
CVehicleModelInfo* info = (CVehicleModelInfo*)CModelInfo::GetModelInfo(mi);

View File

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

View File

@ -1398,7 +1398,7 @@ int8 CRunningScript::ProcessCommands900To999(int32 command)
{
CollectParameters(&m_nIp, 1);
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;
}
case COMMAND_CLEAR_AREA:

View File

@ -3968,7 +3968,7 @@ CMenuManager::PrintRadioSelector(void)
if (radioChangeRequested) {
if (CTimer::GetTimeInMillisecondsPauseMode() - lastRadioChange > 50) {
DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("FRONTEND RADIO STATION CHANGED");
lastRadioChange = CTimer::GetTimeInMillisecondsPauseMode();
radioChangeRequested = false;
@ -4702,7 +4702,7 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u
case MENUACTION_LOADRADIO:
if (m_nPrefsAudio3DProviderIndex != NO_AUDIO_PROVIDER) {
SwitchToNewScreen(MENUPAGE_SOUND_SETTINGS);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
OutputDebugString("STARTED PLAYING FRONTEND AUDIO TRACK");
}
break;
@ -4807,7 +4807,7 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u
DMAudio.SetMusicMasterVolume(m_PrefsMusicVolume);
DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume);
DMAudio.SetRadioInCar(m_PrefsRadioStation);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, 1);
DMAudio.PlayFrontEndTrack(m_PrefsRadioStation, TRUE);
SaveSettings();
} else if (m_nCurrScreen == MENUPAGE_DISPLAY_SETTINGS) {
m_PrefsBrightness = 256;

View File

@ -779,7 +779,7 @@ TriggerAudio_RadioStation(CMenuMultiChoicePicturedTriggered *widget)
if ( 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);
}
}

View File

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

View File

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

View File

@ -65,7 +65,7 @@ CWorld::Initialise()
void
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)
ms_bigBuildingsList[ent->m_level].InsertItem(ent);
@ -80,7 +80,7 @@ CWorld::Add(CEntity *ent)
void
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)
ms_bigBuildingsList[ent->m_level].RemoveItem(ent);

View File

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

View File

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

View File

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

View File

@ -151,7 +151,7 @@ CVehicle::CVehicle(uint8 CreatedBy)
m_fMapObjectHeightAhead = m_fMapObjectHeightBehind = 0.0f;
m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, this);
if(m_audioEntityId >= 0)
DMAudio.SetEntityStatus(m_audioEntityId, true);
DMAudio.SetEntityStatus(m_audioEntityId, TRUE);
//m_nRadioStation = CGeneral::GetRandomNumber() % NUM_RADIOS;
switch(GetModelIndex()){
case MI_HUNTER:

View File

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