Use bool8 in audio code

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

View File

@ -166,7 +166,7 @@ cAudioManager::SetUpLoopingCollisionSound(const cAudioCollision &col, uint8 coun
m_sQueueSample.m_nCounter = counter;
m_sQueueSample.m_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;
@ -176,10 +176,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();
}
}
@ -307,7 +307,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;
@ -315,9 +315,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();
}
}
@ -328,13 +328,13 @@ 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;
abRepeatedCollision1[i] = abRepeatedCollision2[i] = FALSE;
for (i = 0; i < m_sCollisionManager.m_bCollisionsInQueue; i++) {
for (j = 0; j < NUMAUDIOCOLLISIONS; j++) {
@ -344,8 +344,8 @@ cAudioManager::ServiceCollisions()
&& (m_sCollisionManager.m_asCollisions1[index].m_bSurface1 == m_sCollisionManager.m_asCollisions2[j].m_bSurface1)
&& (m_sCollisionManager.m_asCollisions1[index].m_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

@ -22,8 +22,8 @@ const int allChannels = channels + 2;
cAudioManager::cAudioManager()
{
m_bIsInitialised = false;
m_bReverb = true;
m_bIsInitialised = FALSE;
m_bReverb = TRUE;
m_fSpeedOfSound = SPEED_OF_SOUND / TIME_SPENT;
m_nTimeSpent = TIME_SPENT;
m_nActiveSamples = NUM_SOUNDS_SAMPLES_SLOTS;
@ -34,16 +34,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;
}
@ -81,7 +81,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);
}
@ -96,7 +96,7 @@ cAudioManager::Terminate()
SampleManager.Terminate();
m_bIsInitialised = false;
m_bIsInitialised = FALSE;
PostTerminateGameSpecificShutdown();
}
}
@ -108,7 +108,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;
@ -130,8 +130,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;
@ -150,7 +150,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)
@ -163,7 +163,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;
@ -191,7 +191,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;
@ -238,7 +238,7 @@ cAudioManager::SetEffectsFadeVol(uint8 volume) const
}
void
cAudioManager::SetMonoMode(uint8 mono)
cAudioManager::SetMonoMode(bool8 mono)
{
SampleManager.SetMonoMode(mono);
}
@ -253,7 +253,7 @@ void
cAudioManager::ResetTimers(uint32 time)
{
if (m_bIsInitialised) {
m_bTimerJustReset = true;
m_bTimerJustReset = TRUE;
m_nTimer = time;
ClearRequestedQueue();
if (m_nActiveSampleQueue) {
@ -372,13 +372,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
@ -398,12 +398,12 @@ 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();
@ -418,7 +418,7 @@ cAudioManager::GetCDAudioDriveLetter() const
return 0;
}
bool
bool8
cAudioManager::IsAudioInitialised() const
{
return m_bIsInitialised;
@ -527,7 +527,7 @@ cAudioManager::RandomDisplacement(uint32 seed) const
{
int32 value;
static bool bPos = true;
static bool8 bPos = TRUE;
static uint32 Adjustment = 0;
if (!seed)
@ -558,7 +558,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);
@ -571,21 +571,21 @@ 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) {
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_bDynamicAcousticModelingStatus)
m_sQueueSample.m_bReverbFlag = false;
m_sQueueSample.m_bReverbFlag = FALSE;
m_asSamples[m_nActiveSampleQueue][sampleIndex] = m_sQueueSample;
@ -692,7 +692,7 @@ cAudioManager::UpdateReflections()
void
cAudioManager::AddReleasingSounds()
{
bool toProcess[44]; // why not 27?
bool8 toProcess[44]; // why not 27? because PS2?
int8 queue = m_nActiveSampleQueue == 0 ? 1 : 0;
@ -701,11 +701,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;
}
}
@ -741,7 +741,7 @@ cAudioManager::AddReleasingSounds()
void
cAudioManager::ProcessActiveQueues()
{
bool flag;
bool8 flag;
float position2;
float position1;
@ -758,8 +758,8 @@ cAudioManager::ProcessActiveQueues()
CVector position;
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) {
@ -775,15 +775,15 @@ cAudioManager::ProcessActiveQueues()
flag = !(j & 1);
}
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;
}
}
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) {
@ -837,8 +837,8 @@ cAudioManager::ProcessActiveQueues()
SampleManager.SetChannelReverbFlag(j, sample.m_bReverbFlag);
break;
}
sample.m_bIsProcessed = false;
m_asActiveSamples[j].m_bIsProcessed = false;
sample.m_bIsProcessed = FALSE;
m_asActiveSamples[j].m_bIsProcessed = FALSE;
}
}
}
@ -902,8 +902,8 @@ cAudioManager::ProcessActiveQueues()
SampleManager.SetChannel3DDistances(j, m_asActiveSamples[j].m_fSoundIntensity, 0.25f * m_asActiveSamples[j].m_fSoundIntensity);
SampleManager.StartChannel(j);
}
m_asActiveSamples[j].m_bIsProcessed = true;
sample.m_bIsProcessed = true;
m_asActiveSamples[j].m_bIsProcessed = TRUE;
sample.m_bIsProcessed = TRUE;
sample.m_nVolumeChange = -1;
break;
}
@ -930,28 +930,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

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

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);
}
@ -128,7 +128,7 @@ cDMAudio::SetSpeakerConfig(int32 config)
AudioManager.SetSpeakerConfig(config);
}
bool
bool8
cDMAudio::IsMP3RadioChannelAvailable(void)
{
return AudioManager.IsMP3RadioChannelAvailable();
@ -147,12 +147,12 @@ cDMAudio::ReacquireDigitalHandle(void)
}
void
cDMAudio::SetDynamicAcousticModelingStatus(uint8 status)
cDMAudio::SetDynamicAcousticModelingStatus(bool8 status)
{
AudioManager.SetDynamicAcousticModelingStatus(status);
}
bool
bool8
cDMAudio::CheckForAnAudioFileOnCD(void)
{
return AudioManager.CheckForAnAudioFileOnCD();
@ -164,7 +164,7 @@ cDMAudio::GetCDAudioDriveLetter(void)
return AudioManager.GetCDAudioDriveLetter();
}
bool
bool8
cDMAudio::IsAudioInitialised(void)
{
return AudioManager.IsAudioInitialised();
@ -182,7 +182,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;
}
@ -200,7 +200,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);
}
}
@ -230,7 +230,7 @@ cDMAudio::PlayRadioAnnouncement(uint8 announcement)
}
void
cDMAudio::PlayFrontEndTrack(uint8 track, uint8 frontendFlag)
cDMAudio::PlayFrontEndTrack(uint8 track, bool8 frontendFlag)
{
MusicManager.PlayFrontEndTrack(track, frontendFlag);
}
@ -295,7 +295,7 @@ cDMAudio::PlayLoadedMissionAudio(void)
AudioManager.PlayLoadedMissionAudio();
}
bool
bool8
cDMAudio::IsMissionAudioSampleFinished(void)
{
return AudioManager.IsMissionAudioSampleFinished();

View File

@ -22,11 +22,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 SetEffectsMasterVolume(uint8 volume);
void SetMusicMasterVolume(uint8 volume);
void SetEffectsFadeVol(uint8 volume);
@ -40,17 +40,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);
@ -64,7 +64,7 @@ public:
void PlayFrontEndSound(uint16 frontend, uint32 volume);
void PlayRadioAnnouncement(uint8 announcement);
void PlayFrontEndTrack(uint8 track, uint8 frontendFlag);
void PlayFrontEndTrack(uint8 track, bool8 frontendFlag);
void StopFrontEndTrack(void);
void ResetTimers(uint32 time);
@ -79,7 +79,7 @@ public:
uint8 GetMissionAudioLoadingStatus(void);
void SetMissionAudioLocation(float x, float y, float z);
void PlayLoadedMissionAudio(void);
bool IsMissionAudioSampleFinished(void);
bool8 IsMissionAudioSampleFinished(void);
void ClearMissionAudio(void);
uint8 GetRadioInCar(void);

View File

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

View File

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

View File

@ -94,8 +94,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;
}
@ -131,7 +131,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;
@ -139,11 +139,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();
}
@ -156,7 +156,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;
@ -179,12 +179,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 = 5500;
@ -194,14 +194,14 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
if (SampleManager.GetChannelUsedFlag(policeChannel)) SampleManager.StopChannel(policeChannel);
if (g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && bMissionAudioPhysicalPlayingStatus == 1 &&
SampleManager.IsStreamPlaying(1)) {
SampleManager.PauseStream(1, 1);
SampleManager.PauseStream(TRUE, 1);
}
} else {
if (m_nPreviousUserPause && g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES &&
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;
@ -225,7 +225,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;
@ -246,8 +246,8 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
if (gSpecialSuspectLastSeenReport) {
gSpecialSuspectLastSeenReport = 0;
} else if (((sample >= SFX_POLICE_RADIO_MESSAGE_NOISE_1) && (sample <= SFX_POLICE_RADIO_MESSAGE_NOISE_3)) || sample == TOTAL_AUDIO_SAMPLES) {
bChannelOpen = false;
processed = true;
bChannelOpen = FALSE;
processed = TRUE;
}
}
if (sample == TOTAL_AUDIO_SAMPLES) {
@ -259,7 +259,7 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
case SFX_POLICE_RADIO_MESSAGE_NOISE_2:
case SFX_POLICE_RADIO_MESSAGE_NOISE_3:
freq = m_anRandomTable[4] % 2000 + 10025;
bChannelOpen = bChannelOpen == false;
bChannelOpen = bChannelOpen == FALSE;
break;
default: freq = SampleManager.GetSampleBaseFrequency(sample); break;
}
@ -276,7 +276,7 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
}
}
bool
bool8
cAudioManager::SetupCrimeReport()
{
int16 audioZoneId;
@ -289,13 +289,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++) {
@ -303,7 +303,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);
@ -336,10 +336,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)
@ -359,7 +359,7 @@ cAudioManager::SetupCrimeReport()
}
m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE;
AgeCrimes();
return true;
return TRUE;
}
void
@ -714,7 +714,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;
@ -745,10 +745,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)
@ -761,7 +761,7 @@ cAudioManager::PlaySuspectLastSeen(float x, float y, float z)
m_sPoliceRadioQueue.Add(sample);
m_sPoliceRadioQueue.Add(m_anRandomTable[2] % 3 + SFX_POLICE_RADIO_MESSAGE_NOISE_1);
m_sPoliceRadioQueue.Add(TOTAL_AUDIO_SAMPLES);
gSpecialSuspectLastSeenReport = true;
gSpecialSuspectLastSeenReport = TRUE;
break;
}
}

View File

@ -118,10 +118,10 @@ class cSampleManager
uint8 m_nMusicVolume;
uint8 m_nEffectsFadeVolume;
uint8 m_nMusicFadeVolume;
uint8 m_nMonoMode;
bool8 m_nMonoMode;
char unk;
char m_szCDRomRootPath[80];
bool m_bInitialised;
bool8 m_bInitialised;
uint8 m_nNumberOfProviders;
char *m_aAudioProviders[MAXPROVIDERS];
tSample m_aSamples[TOTAL_AUDIO_SAMPLES];
@ -145,16 +145,16 @@ public:
int8 GetCurrent3DProviderIndex(void);
int8 SetCurrent3DProvider(uint8 which);
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);
@ -162,14 +162,14 @@ public:
void SetMusicMasterVolume (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);
@ -179,10 +179,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);
@ -191,23 +191,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 (uint8 nFile, uint8 nStream);
void PauseStream (uint8 nPauseFlag, uint8 nStream);
void PauseStream (bool8 nPauseFlag, uint8 nStream);
void StartPreloadedStreamedFile (uint8 nStream);
bool StartStreamedFile (uint8 nFile, uint32 nPos, uint8 nStream);
bool8 StartStreamedFile (uint8 nFile, uint32 nPos, uint8 nStream);
void StopStreamedFile (uint8 nStream);
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);
};
extern cSampleManager SampleManager;

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];
@ -62,16 +62,16 @@ int8 nStreamPan [MAX_STREAMS];
int8 nStreamVolume[MAX_STREAMS];
uint32 _CurMP3Index;
int32 _CurMP3Pos;
bool _bIsMp3Active;
bool8 _bIsMp3Active;
#if GTA_VERSION >= GTA3_PC_11 || defined(NO_CDCHECK)
bool _bUseHDDAudio;
bool8 _bUseHDDAudio;
char _aHDDPath[MAX_PATH];
#endif
///////////////////////////////////////////////////////////////
bool _bSampmanInitialised = false;
bool8 _bSampmanInitialised = FALSE;
//
// Miscellaneous globals / defines
@ -98,7 +98,7 @@ S32 speaker_type=0;
U32 _maxSamples;
float _fPrevEaxRatioDestination;
bool _usingMilesFast2D;
bool8 _usingMilesFast2D;
float _fEffectsLevel;
@ -170,17 +170,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;
@ -207,7 +207,7 @@ set_new_provider(S32 index)
release_existing();
return false;
return FALSE;
}
else
{
@ -238,7 +238,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);
@ -256,11 +256,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;
}
cSampleManager::cSampleManager(void) :
@ -353,7 +353,7 @@ cSampleManager::SetCurrent3DProvider(uint8 nProvider)
return curprovider;
}
static bool
static bool8
_ResolveLink(char const *path, char *out)
{
IShellLink* psl;
@ -389,7 +389,7 @@ _ResolveLink(char const *path, char *out)
ppf->Release();
psl->Release();
#endif
return true;
return TRUE;
}
}
}
@ -399,15 +399,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];
@ -474,10 +474,10 @@ _FindMP3s(void)
if ( f ) fprintf(f, " - couldn't resolve shortcut");
}
bShortcut = true;
bShortcut = TRUE;
}
else
bShortcut = false;
bShortcut = FALSE;
}
mp3Stream[0] = AIL_open_stream(DIG, filepath, 0);
@ -524,7 +524,7 @@ _FindMP3s(void)
if ( f ) fprintf(f, " - OK\n");
bInitFirstEntry = false;
bInitFirstEntry = FALSE;
}
else
{
@ -534,10 +534,10 @@ _FindMP3s(void)
if ( f ) fprintf(f, " - not an MP3 or supported MP3 type\n");
bInitFirstEntry = true;
bInitFirstEntry = TRUE;
}
while ( true )
while ( TRUE )
{
if ( !FindNextFile(hFind, &fd) )
break;
@ -569,11 +569,11 @@ _FindMP3s(void)
if ( f ) fprintf(f, " - couldn't resolve shortcut");
}
bShortcut = true;
bShortcut = TRUE;
}
else
{
bShortcut = false;
bShortcut = FALSE;
if ( filepathlen > MAX_PATH )
{
@ -620,7 +620,7 @@ _FindMP3s(void)
if ( f ) fprintf(f, " - OK\n");
bInitFirstEntry = false;
bInitFirstEntry = FALSE;
}
else
{
@ -658,11 +658,11 @@ _FindMP3s(void)
if ( f ) fprintf(f, " - couldn't resolve shortcut");
}
bShortcut = true;
bShortcut = TRUE;
}
else
{
bShortcut = false;
bShortcut = FALSE;
}
}
@ -784,7 +784,7 @@ _GetMP3EntryByIndex(uint32 idx)
return NULL;
}
static inline bool
static inline bool8
_GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
{
_CurMP3Index = 0;
@ -797,7 +797,7 @@ _GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
*pPosition -= (*pEntry)->nTrackStreamPos;
_CurMP3Pos = *pPosition;
return true;
return TRUE;
}
_CurMP3Index++;
@ -808,10 +808,10 @@ _GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
_CurMP3Pos = 0;
_CurMP3Index = 0;
return false;
return FALSE;
}
bool
bool8
cSampleManager::IsMP3RadioChannelAvailable(void)
{
return nNumMP3s != 0;
@ -840,13 +840,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++ )
@ -872,7 +872,7 @@ cSampleManager::Initialise(void)
curprovider = -1;
prevprovider = -1;
_usingMilesFast2D = false;
_usingMilesFast2D = FALSE;
usingEAX=0;
usingEAX3=0;
@ -897,7 +897,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;
@ -936,7 +936,7 @@ cSampleManager::Initialise(void)
{
OutputDebugString(AIL_last_error());
Terminate();
return false;
return FALSE;
}
add_providers();
@ -944,14 +944,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);
@ -964,7 +964,7 @@ cSampleManager::Initialise(void)
if (cacheFile) {
fread(nStreamLength, sizeof(uint32), TOTAL_STREAMED_SOUNDS, cacheFile);
fclose(cacheFile);
m_bInitialised = true;
m_bInitialised = TRUE;
}else {
#endif
TRACE("cdrom");
@ -973,9 +973,9 @@ cSampleManager::Initialise(void)
char filepath[MAX_PATH];
{
m_bInitialised = false;
m_bInitialised = FALSE;
while (true)
while (TRUE)
{
int32 drive = 'C';
@ -1000,7 +1000,7 @@ cSampleManager::Initialise(void)
{
fclose(f);
bool bFileNotFound = false;
bool8 bFileNotFound = FALSE;
for ( int32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++ )
{
@ -1020,19 +1020,19 @@ cSampleManager::Initialise(void)
}
else
{
bFileNotFound = true;
bFileNotFound = TRUE;
break;
}
}
if ( !bFileNotFound )
{
m_bInitialised = true;
m_bInitialised = TRUE;
break;
}
else
{
m_bInitialised = false;
m_bInitialised = FALSE;
continue;
}
}
@ -1047,11 +1047,11 @@ cSampleManager::Initialise(void)
if ( FrontEndMenuManager.m_bQuitGameNoCD )
{
Terminate();
return false;
return FALSE;
}
continue;
#else
m_bInitialised = true;
m_bInitialised = TRUE;
#endif
}
@ -1071,7 +1071,7 @@ cSampleManager::Initialise(void)
{
int32 streamLength[TOTAL_STREAMED_SOUNDS];
bool bFileNotFound = false;
bool8 bFileNotFound = FALSE;
char rootpath[MAX_PATH];
strcpy(_aHDDPath, m_szCDRomRootPath);
@ -1101,14 +1101,14 @@ cSampleManager::Initialise(void)
}
else
{
bFileNotFound = true;
bFileNotFound = TRUE;
break;
}
}
}
else
bFileNotFound = true;
bFileNotFound = TRUE;
if ( !bFileNotFound )
{
@ -1117,10 +1117,10 @@ cSampleManager::Initialise(void)
for ( int32 i = 0; i < TOTAL_STREAMED_SOUNDS; i++ )
nStreamLength[i] = streamLength[i];
_bUseHDDAudio = true;
_bUseHDDAudio = TRUE;
}
else
_bUseHDDAudio = false;
_bUseHDDAudio = FALSE;
}
#endif
#ifdef AUDIO_CACHE
@ -1152,7 +1152,7 @@ cSampleManager::Initialise(void)
TRACE("providerset");
{
_bSampmanInitialised = true;
_bSampmanInitialised = TRUE;
U32 n = 0;
@ -1169,7 +1169,7 @@ cSampleManager::Initialise(void)
if ( n == m_nNumberOfProviders )
{
Terminate();
return false;
return FALSE;
}
}
@ -1198,13 +1198,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);
}
@ -1236,12 +1236,12 @@ cSampleManager::Initialise(void)
else
_CurMP3Pos = 0;
_bIsMp3Active = false;
_bIsMp3Active = FALSE;
}
TRACE("end");
return true;
return TRUE;
}
void
@ -1290,10 +1290,10 @@ cSampleManager::Terminate(void)
AIL_shutdown();
_bSampmanInitialised = false;
_bSampmanInitialised = FALSE;
}
bool
bool8
cSampleManager::CheckForAnAudioFileOnCD(void)
{
#if GTA_VERSION < GTA3_PC_STEAM && !defined(NO_CDCHECK)
@ -1316,13 +1316,13 @@ cSampleManager::CheckForAnAudioFileOnCD(void)
{
fclose(f);
return true;
return TRUE;
}
return false;
return FALSE;
#else
return true;
return TRUE;
#endif // #if GTA_VERSION < GTA3_PC_STEAM && !defined(NO_CDCHECK)
}
@ -1415,48 +1415,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;
@ -1469,10 +1469,10 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment)
slot += ARRAY_SIZE(nPedSlotSfx);
#endif
if ( nComment == nPedSlotSfx[slot] )
return true;
return TRUE;
}
return false;
return FALSE;
}
int32
@ -1494,11 +1494,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() )
@ -1507,7 +1507,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
{
case MUSICMODE_CUTSCENE:
{
return false;
return FALSE;
break;
}
@ -1515,7 +1515,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
case MUSICMODE_FRONTEND:
{
if ( MusicManager.GetNextTrack() == STREAMED_SOUND_GAME_COMPLETED )
return false;
return FALSE;
break;
}
@ -1523,10 +1523,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;
@ -1534,7 +1534,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
if ( ++nCurrentPedSlot >= MAX_PEDSFX )
nCurrentPedSlot = 0;
return true;
return TRUE;
}
int32
@ -1573,14 +1573,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 y = AudioManager.GetReflectionsDistance(REFLECTION_TOP) + AudioManager.GetReflectionsDistance(REFLECTION_BOTTOM);
float x = AudioManager.GetReflectionsDistance(REFLECTION_LEFT) + AudioManager.GetReflectionsDistance(REFLECTION_RIGHT);
@ -1627,7 +1627,7 @@ cSampleManager::UpdateReverb(void)
fRatio = clamp(fRatio, usingEAX3==1 ? 0.0f : 0.30f, 1.0f);
if ( fRatio == _fPrevEaxRatioDestination )
return false;
return FALSE;
if ( usingEAX3 )
{
@ -1647,26 +1647,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);
@ -1679,16 +1679,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;
}
}
@ -1698,14 +1698,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);
@ -1717,10 +1717,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
{
@ -1736,10 +1736,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;
}
}
@ -1831,13 +1831,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;
}
}
@ -1857,13 +1857,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;
}
}
@ -1883,13 +1883,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;
}
}
@ -1906,16 +1906,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;
}
}
@ -1925,14 +1925,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;
}
}
@ -1940,13 +1940,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;
}
}
@ -1966,13 +1966,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;
}
}
@ -2024,12 +2024,12 @@ cSampleManager::PreloadStreamedFile(uint8 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);
}
}
@ -2043,7 +2043,7 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
}
}
bool
bool8
cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
{
int i = 0;
@ -2051,7 +2051,7 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
char filename[MAX_PATH];
if ( !m_bInitialised || nFile >= TOTAL_STREAMED_SOUNDS )
return false;
return FALSE;
if ( mp3Stream[nStream] )
{
@ -2081,9 +2081,9 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
AIL_set_stream_loop_count(mp3Stream[nStream], 1);
AIL_set_stream_ms_position(mp3Stream[nStream], position);
AIL_pause_stream(mp3Stream[nStream], 0);
return true;
return TRUE;
}
return false;
return FALSE;
} else {
if ( e->pLinkPath != NULL )
@ -2100,9 +2100,9 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
AIL_set_stream_ms_position(mp3Stream[nStream], position);
AIL_pause_stream(mp3Stream[nStream], 0);
_bIsMp3Active = true;
_bIsMp3Active = TRUE;
return true;
return TRUE;
}
// fall through, start playing from another song
}
@ -2128,9 +2128,9 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
AIL_set_stream_loop_count(mp3Stream[nStream], 1);
AIL_set_stream_ms_position(mp3Stream[nStream], position);
AIL_pause_stream(mp3Stream[nStream], 0);
return true;
return TRUE;
}
return false;
return FALSE;
}
}
if(mp3->pLinkPath != NULL)
@ -2148,9 +2148,9 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
AIL_set_stream_ms_position(mp3Stream[nStream], 0);
AIL_pause_stream(mp3Stream[nStream], 0);
#ifdef FIX_BUGS
_bIsMp3Active = true;
_bIsMp3Active = TRUE;
#endif
return true;
return TRUE;
}
}
@ -2169,9 +2169,9 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
AIL_set_stream_loop_count(mp3Stream[nStream], 1);
AIL_set_stream_ms_position(mp3Stream[nStream], position);
AIL_pause_stream(mp3Stream[nStream], 0);
return true;
return TRUE;
}
return false;
return FALSE;
}
void
@ -2187,7 +2187,7 @@ cSampleManager::StopStreamedFile(uint8 nStream)
mp3Stream[nStream] = NULL;
if ( nStream == 0 )
_bIsMp3Active = false;
_bIsMp3Active = FALSE;
}
}
}
@ -2225,7 +2225,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;
@ -2258,7 +2258,7 @@ cSampleManager::GetStreamedFileLength(uint8 nStream)
return 0;
}
bool
bool8
cSampleManager::IsStreamPlaying(uint8 nStream)
{
if ( m_bInitialised )
@ -2266,23 +2266,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 )
@ -2290,7 +2290,7 @@ cSampleManager::InitialiseSampleBanks(void)
fclose(fpSampleDescHandle);
fpSampleDescHandle = NULL;
return false;
return FALSE;
}
fseek(fpSampleDataHandle, 0, SEEK_END);
@ -2317,7 +2317,7 @@ cSampleManager::InitialiseSampleBanks(void)
nSampleBankSize[SFX_BANK_0] = nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS] - nSampleBankDiscStartOffset[SFX_BANK_0];
nSampleBankSize[SFX_BANK_PED_COMMENTS] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS];
return true;
return TRUE;
}
#endif

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)
@ -128,11 +128,11 @@ cSampleManager::SetMonoMode(uint8 nMode)
{
}
bool
bool8
cSampleManager::LoadSampleBank(uint8 nBank)
{
ASSERT( nBank < MAX_SFX_BANKS );
return false;
return FALSE;
}
void
@ -141,20 +141,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;
}
@ -164,11 +164,11 @@ cSampleManager::_GetPedCommentSlot(uint32 nComment)
return -1;
}
bool
bool8
cSampleManager::LoadPedComment(uint32 nComment)
{
ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
return false;
return FALSE;
}
int32
@ -205,22 +205,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
@ -276,12 +276,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
@ -303,7 +303,7 @@ cSampleManager::PreloadStreamedFile(uint8 nFile, uint8 nStream)
}
void
cSampleManager::PauseStream(uint8 nPauseFlag, uint8 nStream)
cSampleManager::PauseStream(bool8 nPauseFlag, uint8 nStream)
{
ASSERT( nStream < MAX_STREAMS );
}
@ -314,12 +314,12 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
ASSERT( nStream < MAX_STREAMS );
}
bool
bool8
cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
{
ASSERT( nStream < MAX_STREAMS );
return false;
return FALSE;
}
void
@ -350,19 +350,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;
}
#endif

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];
@ -120,7 +120,7 @@ uint8 nStreamPan [MAX_STREAMS];
uint8 nStreamVolume[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 =
@ -265,11 +265,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;
@ -301,7 +301,7 @@ set_new_provider(int index)
{
curprovider=-1;
release_existing();
return false;
return FALSE;
}
alListenerf (AL_GAIN, 1.0f);
@ -382,13 +382,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_CHAT;
@ -456,13 +456,13 @@ int8 cSampleManager::SetCurrent3DProvider(uint8 nProvider)
return curprovider;
}
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;
@ -497,7 +497,7 @@ _ResolveLink(char const *path, char *out)
ppf->Release();
psl->Release();
#endif
return true;
return TRUE;
}
}
}
@ -507,31 +507,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
}
@ -540,8 +540,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];
@ -584,9 +584,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]);
@ -626,7 +626,7 @@ _FindMP3s(void)
_pMP3List->pLinkPath = NULL;
}
bInitFirstEntry = false;
bInitFirstEntry = FALSE;
}
else
{
@ -634,10 +634,10 @@ _FindMP3s(void)
OutputDebugString(filepath);
bInitFirstEntry = true;
bInitFirstEntry = TRUE;
}
while ( true )
while ( TRUE )
{
if ( !FindNextFile(hFind, &fd) )
break;
@ -655,9 +655,9 @@ _FindMP3s(void)
{
OutputDebugString("Resolving Link");
OutputDebugString(filepath);
bShortcut = true;
bShortcut = TRUE;
} else {
bShortcut = false;
bShortcut = FALSE;
if (filepathlen > MAX_PATH) {
continue;
}
@ -696,7 +696,7 @@ _FindMP3s(void)
pList = _pMP3List;
bInitFirstEntry = false;
bInitFirstEntry = FALSE;
}
else
{
@ -718,9 +718,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]);
@ -830,7 +830,7 @@ _GetMP3EntryByIndex(uint32 idx)
return NULL;
}
static inline bool
static inline bool8
_GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
{
_CurMP3Index = 0;
@ -843,7 +843,7 @@ _GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
*pPosition -= (*pEntry)->nTrackStreamPos;
_CurMP3Pos = *pPosition;
return true;
return TRUE;
}
_CurMP3Index++;
@ -854,10 +854,10 @@ _GetMP3PosFromStreamPos(uint32 *pPosition, tMP3Entry **pEntry)
_CurMP3Pos = 0;
_CurMP3Index = 0;
return false;
return FALSE;
}
bool
bool8
cSampleManager::IsMP3RadioChannelAvailable(void)
{
return nNumMP3s != 0;
@ -883,11 +883,11 @@ void cSampleManager::ReacquireDigitalHandle(void)
}
}
bool
bool8
cSampleManager::Initialise(void)
{
if ( _bSampmanInitialised )
return true;
return TRUE;
EFXInit();
CStream::Initialise();
@ -932,7 +932,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;
@ -1000,7 +1000,7 @@ cSampleManager::Initialise(void)
if ( !InitialiseSampleBanks() )
{
Terminate();
return false;
return FALSE;
}
nSampleBankMemoryStartAddress[SFX_BANK_0] = (uintptr)malloc(nSampleBankSize[SFX_BANK_0]);
@ -1009,7 +1009,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);
@ -1028,7 +1028,7 @@ cSampleManager::Initialise(void)
}
{
_bSampmanInitialised = true;
_bSampmanInitialised = TRUE;
if ( defaultProvider >= 0 && defaultProvider < m_nNumberOfProviders )
{
@ -1037,7 +1037,7 @@ cSampleManager::Initialise(void)
else
{
Terminate();
return false;
return FALSE;
}
}
@ -1060,13 +1060,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);
}
@ -1098,10 +1098,10 @@ cSampleManager::Initialise(void)
else
_CurMP3Pos = 0;
_bIsMp3Active = false;
_bIsMp3Active = FALSE;
}
return true;
return TRUE;
}
void
@ -1135,12 +1135,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)
@ -1196,19 +1196,19 @@ cSampleManager::SetMonoMode(uint8 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
@ -1227,14 +1227,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
@ -1242,10 +1242,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);
@ -1253,7 +1253,7 @@ cSampleManager::IsSampleBankLoaded(uint8 nBank)
return bSampleBankLoaded[nBank];
}
bool
bool8
cSampleManager::IsPedCommentLoaded(uint32 nComment)
{
ASSERT( nComment < TOTAL_AUDIO_SAMPLES );
@ -1268,10 +1268,10 @@ cSampleManager::IsPedCommentLoaded(uint32 nComment)
slot += ARRAY_SIZE(nPedSlotSfx);
#endif
if ( nComment == nPedSlotSfx[slot] )
return true;
return TRUE;
}
return false;
return FALSE;
}
@ -1294,13 +1294,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() )
@ -1309,7 +1309,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
{
case MUSICMODE_CUTSCENE:
{
return false;
return FALSE;
break;
}
@ -1317,7 +1317,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
case MUSICMODE_FRONTEND:
{
if ( MusicManager.GetNextTrack() == STREAMED_SOUND_GAME_COMPLETED )
return false;
return FALSE;
break;
}
@ -1332,17 +1332,17 @@ cSampleManager::LoadPedComment(uint32 nComment)
int size = op_read(fpSampleDataHandle, (opus_int16 *)(nSampleBankMemoryStartAddress[SFX_BANK_PED_COMMENTS] + PED_BLOCKSIZE * nCurrentPedSlot + samplesRead),
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;
@ -1350,7 +1350,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
if ( ++nCurrentPedSlot >= MAX_PEDSFX )
nCurrentPedSlot = 0;
return true;
return TRUE;
}
int32
@ -1393,13 +1393,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 y = AudioManager.GetReflectionsDistance(REFLECTION_TOP) + AudioManager.GetReflectionsDistance(REFLECTION_BOTTOM);
float x = AudioManager.GetReflectionsDistance(REFLECTION_LEFT) + AudioManager.GetReflectionsDistance(REFLECTION_RIGHT);
@ -1420,7 +1420,7 @@ bool cSampleManager::UpdateReverb(void)
fRatio = clamp(fRatio, usingEAX3==1 ? 0.0f : 0.30f, 1.0f);
if ( fRatio == _fPrevEaxRatioDestination )
return false;
return FALSE;
#ifdef JUICY_OAL
if ( usingEAX3 || _usingEFX )
@ -1455,11 +1455,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 );
@ -1469,7 +1469,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);
@ -1477,7 +1477,7 @@ cSampleManager::SetChannelReverbFlag(uint32 nChannel, uint8 nReverbFlag)
}
}
bool
bool8
cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
{
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
@ -1487,14 +1487,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);
@ -1512,10 +1512,10 @@ cSampleManager::InitialiseChannel(uint32 nChannel, uint32 nSfx, uint8 nBank)
aChannel[nChannel].SetSampleData ((void*)addr, m_aSamples[nSfx].nSize, m_aSamples[nSfx].nFrequency);
aChannel[nChannel].SetLoopPoints (0, -1);
aChannel[nChannel].SetPitch (1.0f);
return true;
return TRUE;
}
return false;
return FALSE;
}
void
@ -1619,7 +1619,7 @@ cSampleManager::SetChannelLoopCount(uint32 nChannel, uint32 nLoopCount)
aChannel[nChannel].SetLoopCount(nLoopCount);
}
bool
bool8
cSampleManager::GetChannelUsedFlag(uint32 nChannel)
{
ASSERT( nChannel < MAXCHANNELS+MAX2DCHANNELS );
@ -1673,7 +1673,7 @@ cSampleManager::PreloadStreamedFile(uint8 nFile, uint8 nStream)
}
void
cSampleManager::PauseStream(uint8 nPauseFlag, uint8 nStream)
cSampleManager::PauseStream(bool8 nPauseFlag, uint8 nStream)
{
ASSERT( nStream < MAX_STREAMS );
@ -1681,7 +1681,7 @@ cSampleManager::PauseStream(uint8 nPauseFlag, uint8 nStream)
if ( stream )
{
stream->SetPause(nPauseFlag != 0);
stream->SetPause(nPauseFlag != FALSE);
}
}
@ -1701,7 +1701,7 @@ cSampleManager::StartPreloadedStreamedFile(uint8 nStream)
}
}
bool
bool8
cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
{
int i = 0;
@ -1709,7 +1709,7 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
char filename[MAX_PATH];
if ( nFile >= TOTAL_STREAMED_SOUNDS )
return false;
return FALSE;
if ( aStream[nStream] )
{
@ -1742,12 +1742,12 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
stream->Start();
return true;
return TRUE;
} else {
delete stream;
aStream[nStream] = NULL;
}
return false;
return FALSE;
} else {
if ( e->pLinkPath != NULL )
@ -1765,8 +1765,8 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
aStream[nStream]->Start();
_bIsMp3Active = true;
return true;
_bIsMp3Active = TRUE;
return TRUE;
} else {
delete aStream[nStream];
aStream[nStream] = NULL;
@ -1798,12 +1798,12 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
stream->Start();
return true;
return TRUE;
} else {
delete stream;
aStream[nStream] = NULL;
}
return false;
return FALSE;
}
}
if(mp3->pLinkPath != NULL)
@ -1818,9 +1818,9 @@ cSampleManager::StartStreamedFile(uint8 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;
@ -1845,12 +1845,12 @@ cSampleManager::StartStreamedFile(uint8 nFile, uint32 nPos, uint8 nStream)
stream->Start();
return true;
return TRUE;
} else {
delete stream;
aStream[nStream] = NULL;
}
return false;
return FALSE;
}
void
@ -1866,7 +1866,7 @@ cSampleManager::StopStreamedFile(uint8 nStream)
aStream[nStream] = NULL;
if ( nStream == 0 )
_bIsMp3Active = false;
_bIsMp3Active = FALSE;
}
}
@ -1934,7 +1934,7 @@ cSampleManager::GetStreamedFileLength(uint8 nStream)
return nStreamLength[nStream];
}
bool
bool8
cSampleManager::IsStreamPlaying(uint8 nStream)
{
ASSERT( nStream < MAX_STREAMS );
@ -1944,10 +1944,10 @@ cSampleManager::IsStreamPlaying(uint8 nStream)
if ( stream )
{
if ( stream->IsPlaying() )
return true;
return TRUE;
}
return false;
return FALSE;
}
void
@ -1968,14 +1968,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 )
@ -1983,7 +1983,7 @@ cSampleManager::InitialiseSampleBanks(void)
fclose(fpSampleDescHandle);
fpSampleDescHandle = NULL;
return false;
return FALSE;
}
fseek(fpSampleDataHandle, 0, SEEK_END);
@ -2015,6 +2015,6 @@ cSampleManager::InitialiseSampleBanks(void)
nSampleBankSize[SFX_BANK_0] = nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS] - nSampleBankDiscStartOffset[SFX_BANK_0];
nSampleBankSize[SFX_BANK_PED_COMMENTS] = _nSampleDataEndOffset - nSampleBankDiscStartOffset[SFX_BANK_PED_COMMENTS];
return true;
return TRUE;
}
#endif

View File

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

View File

@ -1232,7 +1232,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);
if (ped->m_wepModelID >= 0)
ped->AddWeaponModel(ped->m_wepModelID);
@ -1270,7 +1270,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

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

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

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);
}
}
@ -792,12 +792,12 @@ TriggerAudio_StereoMono(CMenuMultiChoiceTriggered *widget)
{
if (widget->GetMenuSelection() == 1)
{
DMAudio.SetMonoMode(true);
DMAudio.SetMonoMode(TRUE);
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MONO, 0);
}
else
{
DMAudio.SetMonoMode(false);
DMAudio.SetMonoMode(FALSE);
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_STEREO, 0);
}
}

View File

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

View File

@ -64,7 +64,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);
@ -79,7 +79,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

@ -244,7 +244,7 @@ CPed::CPed(uint32 pedType) : m_pedIK(this)
bHasACamera = 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

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

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

View File

@ -108,7 +108,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() % USERTRACK;
m_pCurGroundEntity = nil;
m_bRainAudioCounter = 0;

View File

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