mirror of
https://github.com/halpz/re3.git
synced 2025-02-24 18:22:09 +00:00
Merge branch 'miami' into lcs
# Conflicts: # src/audio/AudioLogic.cpp # src/audio/AudioManager.cpp # src/audio/PolRadio.cpp # src/control/CarCtrl.cpp
This commit is contained in:
commit
e0be6beb18
@ -47,10 +47,6 @@
|
|||||||
// TODO: Get rid of *intensity* consts (and get rid of term 'intensity' in general)
|
// TODO: Get rid of *intensity* consts (and get rid of term 'intensity' in general)
|
||||||
// Make them defines, not floats because they were not floats on PS2
|
// Make them defines, not floats because they were not floats on PS2
|
||||||
|
|
||||||
#ifndef GTA_PS2
|
|
||||||
#define CHANNEL_PLAYER_VEHICLE_ENGINE m_nActiveSamples
|
|
||||||
#endif
|
|
||||||
|
|
||||||
void
|
void
|
||||||
cAudioManager::PreInitialiseGameSpecificSetup()
|
cAudioManager::PreInitialiseGameSpecificSetup()
|
||||||
{
|
{
|
||||||
@ -145,11 +141,7 @@ cAudioManager::PostInitialiseGameSpecificSetup()
|
|||||||
m_nPoliceChannelEntity = CreateEntity(AUDIOTYPE_POLICERADIO, (void *)1);
|
m_nPoliceChannelEntity = CreateEntity(AUDIOTYPE_POLICERADIO, (void *)1);
|
||||||
if (m_nPoliceChannelEntity >= 0)
|
if (m_nPoliceChannelEntity >= 0)
|
||||||
SetEntityStatus(m_nPoliceChannelEntity, TRUE);
|
SetEntityStatus(m_nPoliceChannelEntity, TRUE);
|
||||||
#ifdef GTA_BRIDGE
|
|
||||||
m_nBridgeEntity = CreateEntity(AUDIOTYPE_BRIDGE, (void*)1);
|
|
||||||
if (m_nBridgeEntity >= 0)
|
|
||||||
SetEntityStatus(m_nBridgeEntity, TRUE);
|
|
||||||
#endif // GTA_BRIDGE
|
|
||||||
m_nEscalatorEntity = CreateEntity(AUDIOTYPE_ESCALATOR, (void*)1);
|
m_nEscalatorEntity = CreateEntity(AUDIOTYPE_ESCALATOR, (void*)1);
|
||||||
if (m_nEscalatorEntity >= 0)
|
if (m_nEscalatorEntity >= 0)
|
||||||
SetEntityStatus(m_nEscalatorEntity, TRUE);
|
SetEntityStatus(m_nEscalatorEntity, TRUE);
|
||||||
@ -158,25 +150,23 @@ cAudioManager::PostInitialiseGameSpecificSetup()
|
|||||||
if (m_nExtraSoundsEntity >= 0)
|
if (m_nExtraSoundsEntity >= 0)
|
||||||
SetEntityStatus(m_nExtraSoundsEntity, TRUE);
|
SetEntityStatus(m_nExtraSoundsEntity, TRUE);
|
||||||
|
|
||||||
|
#ifdef GTA_BRIDGE
|
||||||
|
m_nBridgeEntity = CreateEntity(AUDIOTYPE_BRIDGE, (void*)1);
|
||||||
|
if (m_nBridgeEntity >= 0)
|
||||||
|
SetEntityStatus(m_nBridgeEntity, TRUE);
|
||||||
|
#endif // GTA_BRIDGE
|
||||||
|
|
||||||
m_sMissionAudio.m_nSampleIndex[0] = NO_SAMPLE;
|
for (int i = 0; i < MISSION_AUDIO_SLOTS; i++) {
|
||||||
m_sMissionAudio.m_nLoadingStatus[0] = LOADING_STATUS_NOT_LOADED;
|
m_nMissionAudioSampleIndex[i] = NO_SAMPLE;
|
||||||
m_sMissionAudio.m_nPlayStatus[0] = PLAY_STATUS_STOPPED;
|
m_nMissionAudioLoadingStatus[i] = LOADING_STATUS_NOT_LOADED;
|
||||||
m_sMissionAudio.m_bIsPlaying[0] = FALSE;
|
m_nMissionAudioPlayStatus[i] = PLAY_STATUS_STOPPED;
|
||||||
m_sMissionAudio.m_bIsPlayed[0] = FALSE;
|
m_bIsMissionAudioPlaying[i] = FALSE;
|
||||||
m_sMissionAudio.m_bPredefinedProperties[0] = TRUE;
|
m_bIsMissionAudioAllowedToPlay[i] = FALSE;
|
||||||
m_sMissionAudio.m_nMissionAudioCounter[0] = 0;
|
m_bIsMissionAudio2D[i] = TRUE;
|
||||||
m_sMissionAudio.m_bIsMobile[0] = FALSE;
|
m_nMissionAudioFramesToPlay[i] = 0;
|
||||||
field_5538 = 127;
|
m_bIsMissionAudioPhoneCall[i] = FALSE;
|
||||||
m_sMissionAudio.m_nSampleIndex[1] = NO_SAMPLE;
|
m_nGlobalSfxVolumeMultiplier = 127;
|
||||||
m_sMissionAudio.m_nLoadingStatus[1] = LOADING_STATUS_NOT_LOADED;
|
}
|
||||||
m_sMissionAudio.m_nPlayStatus[1] = PLAY_STATUS_STOPPED;
|
|
||||||
m_sMissionAudio.m_bIsPlaying[1] = FALSE;
|
|
||||||
m_sMissionAudio.m_bIsPlayed[1] = FALSE;
|
|
||||||
m_sMissionAudio.m_bPredefinedProperties[1] = TRUE;
|
|
||||||
m_sMissionAudio.m_nMissionAudioCounter[1] = 0;
|
|
||||||
m_sMissionAudio.m_bIsMobile[1] = FALSE;
|
|
||||||
field_5538 = 127;
|
|
||||||
|
|
||||||
ResetAudioLogicTimers(CTimer::GetTimeInMilliseconds());
|
ResetAudioLogicTimers(CTimer::GetTimeInMilliseconds());
|
||||||
m_bIsPlayerShutUp = FALSE;
|
m_bIsPlayerShutUp = FALSE;
|
||||||
@ -2027,7 +2017,11 @@ cAudioManager::ProcessPlayersVehicleEngine(cVehicleParams& params, CVehicle* veh
|
|||||||
bool8 isMoped = FALSE;
|
bool8 isMoped = FALSE;
|
||||||
bool8 processedAccelSampleStopped = FALSE;
|
bool8 processedAccelSampleStopped = FALSE;
|
||||||
static uint32 gearSoundStartTime = CTimer::GetTimeInMilliseconds();
|
static uint32 gearSoundStartTime = CTimer::GetTimeInMilliseconds();
|
||||||
uint8 nChannel = CHANNEL_PLAYER_VEHICLE_ENGINE; // TODO: PS2 channels
|
#ifdef GTA_PS2
|
||||||
|
uint8 nChannel = m_bIsSurround ? CHANNEL_DTS_PLAYER_VEHICLE_ENGINE : CHANNEL_PLAYER_VEHICLE_ENGINE;
|
||||||
|
#else
|
||||||
|
uint8 nChannel = CHANNEL_PLAYER_VEHICLE_ENGINE;
|
||||||
|
#endif
|
||||||
if (bPlayerJustEnteredCar) {
|
if (bPlayerJustEnteredCar) {
|
||||||
bAccelSampleStopped = TRUE;
|
bAccelSampleStopped = TRUE;
|
||||||
bPlayerJustEnteredCar = FALSE;
|
bPlayerJustEnteredCar = FALSE;
|
||||||
@ -11532,9 +11526,9 @@ FindMissionAudioSfx(const char *name)
|
|||||||
const char *
|
const char *
|
||||||
cAudioManager::GetMissionAudioLoadedLabel(uint8 slot)
|
cAudioManager::GetMissionAudioLoadedLabel(uint8 slot)
|
||||||
{
|
{
|
||||||
if (m_bIsInitialised && slot < MISSION_AUDIO_SLOTS && m_sMissionAudio.m_nSampleIndex[slot] != NO_SAMPLE) {
|
if (m_bIsInitialised && slot < MISSION_AUDIO_SLOTS && m_nMissionAudioSampleIndex[slot] != NO_SAMPLE) {
|
||||||
for (uint32 i = 0; MissionAudioNameSfxAssoc[i].m_pName != nil; ++i) {
|
for (uint32 i = 0; MissionAudioNameSfxAssoc[i].m_pName != nil; ++i) {
|
||||||
if (m_sMissionAudio.m_nSampleIndex[slot] == MissionAudioNameSfxAssoc[i].m_nId)
|
if (m_nMissionAudioSampleIndex[slot] == MissionAudioNameSfxAssoc[i].m_nId)
|
||||||
return MissionAudioNameSfxAssoc[i].m_pName;
|
return MissionAudioNameSfxAssoc[i].m_pName;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -11560,14 +11554,14 @@ cAudioManager::PreloadMissionAudio(uint8 slot, Const char *name)
|
|||||||
if (m_bIsInitialised && slot < MISSION_AUDIO_SLOTS) {
|
if (m_bIsInitialised && slot < MISSION_AUDIO_SLOTS) {
|
||||||
int32 missionAudioSfx = FindMissionAudioSfx(name);
|
int32 missionAudioSfx = FindMissionAudioSfx(name);
|
||||||
if (missionAudioSfx != NO_SAMPLE) {
|
if (missionAudioSfx != NO_SAMPLE) {
|
||||||
m_sMissionAudio.m_nSampleIndex[slot] = missionAudioSfx;
|
m_nMissionAudioSampleIndex[slot] = missionAudioSfx;
|
||||||
m_sMissionAudio.m_nLoadingStatus[slot] = LOADING_STATUS_NOT_LOADED;
|
m_nMissionAudioLoadingStatus[slot] = LOADING_STATUS_NOT_LOADED;
|
||||||
m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_STOPPED;
|
m_nMissionAudioPlayStatus[slot] = PLAY_STATUS_STOPPED;
|
||||||
m_sMissionAudio.m_bIsPlaying[slot] = FALSE;
|
m_bIsMissionAudioPlaying[slot] = FALSE;
|
||||||
m_sMissionAudio.m_nMissionAudioCounter[slot] = m_nTimeSpent * SampleManager.GetSampleLength(missionAudioSfx) / SampleManager.GetSampleBaseFrequency(missionAudioSfx);
|
m_nMissionAudioFramesToPlay[slot] = m_nTimeSpent * SampleManager.GetSampleLength(missionAudioSfx) / SampleManager.GetSampleBaseFrequency(missionAudioSfx);
|
||||||
m_sMissionAudio.m_nMissionAudioCounter[slot] = 11 * m_sMissionAudio.m_nMissionAudioCounter[slot] / 10;
|
m_nMissionAudioFramesToPlay[slot] = 11 * m_nMissionAudioFramesToPlay[slot] / 10;
|
||||||
m_sMissionAudio.m_bIsPlayed[slot] = FALSE;
|
m_bIsMissionAudioAllowedToPlay[slot] = FALSE;
|
||||||
m_sMissionAudio.m_bPredefinedProperties[slot] = TRUE;
|
m_bIsMissionAudio2D[slot] = TRUE;
|
||||||
g_bMissionAudioLoadFailed[slot] = FALSE;
|
g_bMissionAudioLoadFailed[slot] = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -11577,7 +11571,7 @@ uint8
|
|||||||
cAudioManager::GetMissionAudioLoadingStatus(uint8 slot)
|
cAudioManager::GetMissionAudioLoadingStatus(uint8 slot)
|
||||||
{
|
{
|
||||||
if (m_bIsInitialised && slot < MISSION_AUDIO_SLOTS)
|
if (m_bIsInitialised && slot < MISSION_AUDIO_SLOTS)
|
||||||
return m_sMissionAudio.m_nLoadingStatus[slot];
|
return m_nMissionAudioLoadingStatus[slot];
|
||||||
|
|
||||||
return LOADING_STATUS_LOADED;
|
return LOADING_STATUS_LOADED;
|
||||||
}
|
}
|
||||||
@ -11586,24 +11580,24 @@ void
|
|||||||
cAudioManager::SetMissionAudioLocation(uint8 slot, float x, float y, float z)
|
cAudioManager::SetMissionAudioLocation(uint8 slot, float x, float y, float z)
|
||||||
{
|
{
|
||||||
if (m_bIsInitialised && slot < MISSION_AUDIO_SLOTS) {
|
if (m_bIsInitialised && slot < MISSION_AUDIO_SLOTS) {
|
||||||
m_sMissionAudio.m_bPredefinedProperties[slot] = FALSE;
|
m_bIsMissionAudio2D[slot] = FALSE;
|
||||||
m_sMissionAudio.m_vecPos[slot] = CVector(x, y, z);
|
m_vecMissionAudioPosition[slot] = CVector(x, y, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
cAudioManager::PlayLoadedMissionAudio(uint8 slot)
|
cAudioManager::PlayLoadedMissionAudio(uint8 slot)
|
||||||
{
|
{
|
||||||
if (m_bIsInitialised && slot < MISSION_AUDIO_SLOTS && m_sMissionAudio.m_nSampleIndex[slot] != NO_SAMPLE && m_sMissionAudio.m_nLoadingStatus[slot] == LOADING_STATUS_LOADED &&
|
if (m_bIsInitialised && slot < MISSION_AUDIO_SLOTS && m_nMissionAudioSampleIndex[slot] != NO_SAMPLE && m_nMissionAudioLoadingStatus[slot] == LOADING_STATUS_LOADED &&
|
||||||
m_sMissionAudio.m_nPlayStatus[slot] == PLAY_STATUS_STOPPED)
|
m_nMissionAudioPlayStatus[slot] == PLAY_STATUS_STOPPED)
|
||||||
m_sMissionAudio.m_bIsPlayed[slot] = TRUE;
|
m_bIsMissionAudioAllowedToPlay[slot] = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8
|
bool8
|
||||||
cAudioManager::ShouldDuckMissionAudio(uint8 slot)
|
cAudioManager::ShouldDuckMissionAudio(uint8 slot)
|
||||||
{
|
{
|
||||||
//if (IsMissionAudioSamplePlaying(slot))
|
//if (IsMissionAudioSamplePlaying(slot))
|
||||||
// return m_sMissionAudio.m_nSampleIndex[slot] != STREAMED_SOUND_MISSION_ROK2_01;
|
// return m_nMissionAudioSampleIndex[slot] != STREAMED_SOUND_MISSION_ROK2_01;
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -11612,7 +11606,7 @@ cAudioManager::IsMissionAudioSamplePlaying(uint8 slot)
|
|||||||
{
|
{
|
||||||
if (m_bIsInitialised) {
|
if (m_bIsInitialised) {
|
||||||
if (slot < MISSION_AUDIO_SLOTS)
|
if (slot < MISSION_AUDIO_SLOTS)
|
||||||
return m_sMissionAudio.m_nPlayStatus[slot] == PLAY_STATUS_PLAYING;
|
return m_nMissionAudioPlayStatus[slot] == PLAY_STATUS_PLAYING;
|
||||||
else
|
else
|
||||||
return TRUE;
|
return TRUE;
|
||||||
} else {
|
} else {
|
||||||
@ -11627,7 +11621,7 @@ cAudioManager::IsMissionAudioSampleFinished(uint8 slot)
|
|||||||
{
|
{
|
||||||
if (m_bIsInitialised) {
|
if (m_bIsInitialised) {
|
||||||
if (slot < MISSION_AUDIO_SLOTS)
|
if (slot < MISSION_AUDIO_SLOTS)
|
||||||
return m_sMissionAudio.m_nPlayStatus[slot] == PLAY_STATUS_FINISHED;
|
return m_nMissionAudioPlayStatus[slot] == PLAY_STATUS_FINISHED;
|
||||||
else
|
else
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -11641,14 +11635,14 @@ void
|
|||||||
cAudioManager::ClearMissionAudio(uint8 slot)
|
cAudioManager::ClearMissionAudio(uint8 slot)
|
||||||
{
|
{
|
||||||
if (m_bIsInitialised && slot < MISSION_AUDIO_SLOTS) {
|
if (m_bIsInitialised && slot < MISSION_AUDIO_SLOTS) {
|
||||||
m_sMissionAudio.m_nSampleIndex[slot] = NO_SAMPLE;
|
m_nMissionAudioSampleIndex[slot] = NO_SAMPLE;
|
||||||
m_sMissionAudio.m_nLoadingStatus[slot] = LOADING_STATUS_NOT_LOADED;
|
m_nMissionAudioLoadingStatus[slot] = LOADING_STATUS_NOT_LOADED;
|
||||||
m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_STOPPED;
|
m_nMissionAudioPlayStatus[slot] = PLAY_STATUS_STOPPED;
|
||||||
m_sMissionAudio.m_bIsPlaying[slot] = FALSE;
|
m_bIsMissionAudioPlaying[slot] = FALSE;
|
||||||
m_sMissionAudio.m_bIsPlayed[slot] = FALSE;
|
m_bIsMissionAudioAllowedToPlay[slot] = FALSE;
|
||||||
m_sMissionAudio.m_bPredefinedProperties[slot] = TRUE;
|
m_bIsMissionAudio2D[slot] = TRUE;
|
||||||
m_sMissionAudio.m_nMissionAudioCounter[slot] = 0;
|
m_nMissionAudioFramesToPlay[slot] = 0;
|
||||||
m_sMissionAudio.m_bIsMobile[slot] = FALSE;
|
m_bIsMissionAudioPhoneCall[slot] = FALSE;
|
||||||
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -11666,18 +11660,18 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
|||||||
static uint8 nFramesUntilFailedLoad[MISSION_AUDIO_SLOTS] = { 0, 0 };
|
static uint8 nFramesUntilFailedLoad[MISSION_AUDIO_SLOTS] = { 0, 0 };
|
||||||
static uint8 nFramesForPretendPlaying[MISSION_AUDIO_SLOTS] = { 0, 0 };
|
static uint8 nFramesForPretendPlaying[MISSION_AUDIO_SLOTS] = { 0, 0 };
|
||||||
|
|
||||||
if (m_sMissionAudio.m_nSampleIndex[slot] == NO_SAMPLE) return;
|
if (m_nMissionAudioSampleIndex[slot] == NO_SAMPLE) return;
|
||||||
|
|
||||||
switch (m_sMissionAudio.m_nLoadingStatus[slot]) {
|
switch (m_nMissionAudioLoadingStatus[slot]) {
|
||||||
case LOADING_STATUS_NOT_LOADED:
|
case LOADING_STATUS_NOT_LOADED:
|
||||||
// TODO: LoadMissionAudio
|
// TODO: LoadMissionAudio
|
||||||
SampleManager.LoadPedComment(m_sMissionAudio.m_nSampleIndex[slot]);
|
SampleManager.LoadPedComment(m_nMissionAudioSampleIndex[slot]);
|
||||||
SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, SampleManager.GetSampleBaseFrequency(m_sMissionAudio.m_nSampleIndex[slot]));
|
SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, SampleManager.GetSampleBaseFrequency(m_nMissionAudioSampleIndex[slot]));
|
||||||
m_sMissionAudio.m_nLoadingStatus[slot] = LOADING_STATUS_LOADED;
|
m_nMissionAudioLoadingStatus[slot] = LOADING_STATUS_LOADED;
|
||||||
nFramesUntilFailedLoad[slot] = 0;
|
nFramesUntilFailedLoad[slot] = 0;
|
||||||
break;
|
break;
|
||||||
case LOADING_STATUS_LOADED:
|
case LOADING_STATUS_LOADED:
|
||||||
if (!m_sMissionAudio.m_bIsPlayed[slot])
|
if (!m_bIsMissionAudioAllowedToPlay[slot])
|
||||||
return;
|
return;
|
||||||
if (g_bMissionAudioLoadFailed[slot]) {
|
if (g_bMissionAudioLoadFailed[slot]) {
|
||||||
if (m_bTimerJustReset) {
|
if (m_bTimerJustReset) {
|
||||||
@ -11689,35 +11683,35 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
|||||||
nFramesUntilFailedLoad[slot] = 0;
|
nFramesUntilFailedLoad[slot] = 0;
|
||||||
} else if (!m_nUserPause) {
|
} else if (!m_nUserPause) {
|
||||||
if (++nFramesForPretendPlaying[slot] < 90) {
|
if (++nFramesForPretendPlaying[slot] < 90) {
|
||||||
m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_PLAYING;
|
m_nMissionAudioPlayStatus[slot] = PLAY_STATUS_PLAYING;
|
||||||
} else {
|
} else {
|
||||||
m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_FINISHED;
|
m_nMissionAudioPlayStatus[slot] = PLAY_STATUS_FINISHED;
|
||||||
m_sMissionAudio.m_nSampleIndex[slot] = NO_SAMPLE;
|
m_nMissionAudioSampleIndex[slot] = NO_SAMPLE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch (m_sMissionAudio.m_nPlayStatus[slot]) {
|
switch (m_nMissionAudioPlayStatus[slot]) {
|
||||||
case PLAY_STATUS_STOPPED:
|
case PLAY_STATUS_STOPPED:
|
||||||
if (MissionScriptAudioUsesPoliceChannel(m_sMissionAudio.m_nSampleIndex[slot])) {
|
if (MissionScriptAudioUsesPoliceChannel(m_nMissionAudioSampleIndex[slot])) {
|
||||||
SetMissionScriptPoliceAudio(m_sMissionAudio.m_nSampleIndex[slot]);
|
SetMissionScriptPoliceAudio(m_nMissionAudioSampleIndex[slot]);
|
||||||
} else {
|
} else {
|
||||||
SampleManager.InitialiseChannel(slot + CHANNEL_MISSION_AUDIO_1, m_sMissionAudio.m_nSampleIndex[slot], SFX_BANK_PED_COMMENTS);
|
SampleManager.InitialiseChannel(slot + CHANNEL_MISSION_AUDIO_1, m_nMissionAudioSampleIndex[slot], SFX_BANK_PED_COMMENTS);
|
||||||
if(m_nUserPause)
|
if(m_nUserPause)
|
||||||
SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, 0);
|
SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, 0);
|
||||||
else
|
else
|
||||||
SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, SampleManager.GetSampleBaseFrequency(m_sMissionAudio.m_nSampleIndex[slot]));
|
SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, SampleManager.GetSampleBaseFrequency(m_nMissionAudioSampleIndex[slot]));
|
||||||
if (m_sMissionAudio.m_bPredefinedProperties[slot]) {
|
if (m_bIsMissionAudio2D[slot]) {
|
||||||
SampleManager.SetChannelVolume(slot + CHANNEL_MISSION_AUDIO_1, 127);
|
SampleManager.SetChannelVolume(slot + CHANNEL_MISSION_AUDIO_1, 127);
|
||||||
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 63);
|
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 63);
|
||||||
if (m_sMissionAudio.m_nSampleIndex[slot] == SFX_SFX_CAMERA_LEFT || m_sMissionAudio.m_nSampleIndex[slot] == SFX_SFX_AIRHORN_LEFT)
|
if (m_nMissionAudioSampleIndex[slot] == SFX_SFX_CAMERA_LEFT || m_nMissionAudioSampleIndex[slot] == SFX_SFX_AIRHORN_LEFT)
|
||||||
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 0);
|
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 0);
|
||||||
else if (m_sMissionAudio.m_nSampleIndex[slot] == SFX_SFX_CAMERA_RIGHT || m_sMissionAudio.m_nSampleIndex[slot] == SFX_SFX_AIRHORN_RIGHT)
|
else if (m_nMissionAudioSampleIndex[slot] == SFX_SFX_CAMERA_RIGHT || m_nMissionAudioSampleIndex[slot] == SFX_SFX_AIRHORN_RIGHT)
|
||||||
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 127);
|
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 127);
|
||||||
else
|
else
|
||||||
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 63);
|
SampleManager.SetChannelPan(slot + CHANNEL_MISSION_AUDIO_1, 63);
|
||||||
} else {
|
} else {
|
||||||
distSquared = GetDistanceSquared(m_sMissionAudio.m_vecPos[slot]);
|
distSquared = GetDistanceSquared(m_vecMissionAudioPosition[slot]);
|
||||||
if (distSquared >= SQR(80.0f)) {
|
if (distSquared >= SQR(80.0f)) {
|
||||||
emittingVol = 0;
|
emittingVol = 0;
|
||||||
pan = 63;
|
pan = 63;
|
||||||
@ -11727,7 +11721,7 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
|||||||
dist = Sqrt(distSquared);
|
dist = Sqrt(distSquared);
|
||||||
emittingVol = ComputeVolume(127, 80.0f, dist);
|
emittingVol = ComputeVolume(127, 80.0f, dist);
|
||||||
}
|
}
|
||||||
TranslateEntity(&m_sMissionAudio.m_vecPos[slot], &vec);
|
TranslateEntity(&m_vecMissionAudioPosition[slot], &vec);
|
||||||
pan = ComputePan(80.f, &vec);
|
pan = ComputePan(80.f, &vec);
|
||||||
}
|
}
|
||||||
SampleManager.SetChannelVolume(slot + CHANNEL_MISSION_AUDIO_1, emittingVol);
|
SampleManager.SetChannelVolume(slot + CHANNEL_MISSION_AUDIO_1, emittingVol);
|
||||||
@ -11735,7 +11729,7 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
|||||||
}
|
}
|
||||||
SampleManager.StartChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
SampleManager.StartChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
||||||
}
|
}
|
||||||
m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_PLAYING;
|
m_nMissionAudioPlayStatus[slot] = PLAY_STATUS_PLAYING;
|
||||||
nCheckPlayingDelay[slot] = 30;
|
nCheckPlayingDelay[slot] = 30;
|
||||||
break;
|
break;
|
||||||
case PLAY_STATUS_PLAYING:
|
case PLAY_STATUS_PLAYING:
|
||||||
@ -11745,27 +11739,28 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
|||||||
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (MissionScriptAudioUsesPoliceChannel(m_sMissionAudio.m_nSampleIndex[slot])) {
|
if (MissionScriptAudioUsesPoliceChannel(m_nMissionAudioSampleIndex[slot])) {
|
||||||
if (!m_nUserPause) {
|
if (!m_nUserPause) {
|
||||||
if (nCheckPlayingDelay[slot]) {
|
if (nCheckPlayingDelay[slot]) {
|
||||||
--nCheckPlayingDelay[slot];
|
--nCheckPlayingDelay[slot];
|
||||||
} else if ((g_bMissionAudioLoadFailed[slot] && m_sMissionAudio.m_nMissionAudioCounter[slot]-- == 0) || GetMissionScriptPoliceAudioPlayingStatus() == PLAY_STATUS_FINISHED) {
|
} else if ((g_bMissionAudioLoadFailed[slot] && m_nMissionAudioFramesToPlay[slot]-- == 0) || GetMissionScriptPoliceAudioPlayingStatus() == PLAY_STATUS_FINISHED) {
|
||||||
debug("FINISHED PLAYINGXXXXXXXXXXXXX");
|
debug("FINISHED PLAYINGXXXXXXXXXXXXX");
|
||||||
m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_FINISHED;
|
m_nMissionAudioPlayStatus[slot] = PLAY_STATUS_FINISHED;
|
||||||
m_sMissionAudio.m_nSampleIndex[slot] = NO_SAMPLE;
|
|
||||||
|
m_nMissionAudioSampleIndex[slot] = NO_SAMPLE;
|
||||||
SampleManager.StopChannel(CHANNEL_POLICE_RADIO);
|
SampleManager.StopChannel(CHANNEL_POLICE_RADIO);
|
||||||
m_sMissionAudio.m_nMissionAudioCounter[slot] = 0;
|
m_nMissionAudioFramesToPlay[slot] = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (m_sMissionAudio.m_bIsPlaying[slot]) {
|
} else if (m_bIsMissionAudioPlaying[slot]) {
|
||||||
if(SampleManager.GetChannelUsedFlag(slot + CHANNEL_MISSION_AUDIO_1) || m_nUserPause || m_nPreviousUserPause) {
|
if(SampleManager.GetChannelUsedFlag(slot + CHANNEL_MISSION_AUDIO_1) || m_nUserPause || m_nPreviousUserPause) {
|
||||||
if(m_nUserPause)
|
if(m_nUserPause)
|
||||||
SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, 0);
|
SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, 0);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, SampleManager.GetSampleBaseFrequency(m_sMissionAudio.m_nSampleIndex[slot]));
|
SampleManager.SetChannelFrequency(slot + CHANNEL_MISSION_AUDIO_1, SampleManager.GetSampleBaseFrequency(m_nMissionAudioSampleIndex[slot]));
|
||||||
if (!m_sMissionAudio.m_bPredefinedProperties[slot]) {
|
if (!m_bIsMissionAudio2D[slot]) {
|
||||||
distSquared = GetDistanceSquared(m_sMissionAudio.m_vecPos[slot]);
|
distSquared = GetDistanceSquared(m_vecMissionAudioPosition[slot]);
|
||||||
if (distSquared >= SQR(80.0f)) {
|
if (distSquared >= SQR(80.0f)) {
|
||||||
emittingVol = 0;
|
emittingVol = 0;
|
||||||
pan = 63;
|
pan = 63;
|
||||||
@ -11775,7 +11770,7 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
|||||||
dist = Sqrt(distSquared);
|
dist = Sqrt(distSquared);
|
||||||
emittingVol = ComputeVolume(127, 80.0f, dist);
|
emittingVol = ComputeVolume(127, 80.0f, dist);
|
||||||
}
|
}
|
||||||
TranslateEntity(&m_sMissionAudio.m_vecPos[slot], &vec);
|
TranslateEntity(&m_vecMissionAudioPosition[slot], &vec);
|
||||||
pan = ComputePan(80.f, &vec);
|
pan = ComputePan(80.f, &vec);
|
||||||
}
|
}
|
||||||
SampleManager.SetChannelVolume(slot + CHANNEL_MISSION_AUDIO_1, emittingVol);
|
SampleManager.SetChannelVolume(slot + CHANNEL_MISSION_AUDIO_1, emittingVol);
|
||||||
@ -11783,10 +11778,10 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
m_sMissionAudio.m_nPlayStatus[slot] = PLAY_STATUS_FINISHED;
|
m_nMissionAudioPlayStatus[slot] = PLAY_STATUS_FINISHED;
|
||||||
m_sMissionAudio.m_nSampleIndex[slot] = NO_SAMPLE;
|
m_nMissionAudioSampleIndex[slot] = NO_SAMPLE;
|
||||||
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
SampleManager.StopChannel(slot + CHANNEL_MISSION_AUDIO_1);
|
||||||
m_sMissionAudio.m_nMissionAudioCounter[slot] = 0;
|
m_nMissionAudioFramesToPlay[slot] = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (m_nUserPause)
|
if (m_nUserPause)
|
||||||
@ -11796,7 +11791,7 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
|||||||
break;
|
break;
|
||||||
nCheckPlayingDelay[slot] = 0;
|
nCheckPlayingDelay[slot] = 0;
|
||||||
}
|
}
|
||||||
m_sMissionAudio.m_bIsPlaying[slot] = TRUE;
|
m_bIsMissionAudioPlaying[slot] = TRUE;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -11808,7 +11803,7 @@ cAudioManager::ProcessMissionAudioSlot(uint8 slot)
|
|||||||
nFramesForPretendPlaying[slot] = 0;
|
nFramesForPretendPlaying[slot] = 0;
|
||||||
g_bMissionAudioLoadFailed[slot] = TRUE;
|
g_bMissionAudioLoadFailed[slot] = TRUE;
|
||||||
nFramesUntilFailedLoad[slot] = 0;
|
nFramesUntilFailedLoad[slot] = 0;
|
||||||
m_sMissionAudio.m_nLoadingStatus[slot] = LOADING_STATUS_LOADED;
|
m_nMissionAudioLoadingStatus[slot] = LOADING_STATUS_LOADED;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
@ -11824,12 +11819,12 @@ cAudioManager::ProcessMissionAudio()
|
|||||||
for (int i = 0; i < MISSION_AUDIO_SLOTS; i++)
|
for (int i = 0; i < MISSION_AUDIO_SLOTS; i++)
|
||||||
ProcessMissionAudioSlot(i);
|
ProcessMissionAudioSlot(i);
|
||||||
|
|
||||||
if (m_sMissionAudio.m_bIsMobile[0] || m_sMissionAudio.m_bIsMobile[1])
|
if (m_bIsMissionAudioPhoneCall[0] || m_bIsMissionAudioPhoneCall[1])
|
||||||
field_5538 = 64;
|
m_nGlobalSfxVolumeMultiplier = 64;
|
||||||
else if (field_5538 < 127) {
|
else if (m_nGlobalSfxVolumeMultiplier < 127) {
|
||||||
field_5538 += 5;
|
m_nGlobalSfxVolumeMultiplier += 5;
|
||||||
if (field_5538 > 127)
|
if (m_nGlobalSfxVolumeMultiplier > 127)
|
||||||
field_5538 = 127;
|
m_nGlobalSfxVolumeMultiplier = 127;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#pragma endregion All the mission audio stuff
|
#pragma endregion All the mission audio stuff
|
||||||
|
@ -495,17 +495,18 @@ cAudioManager::ServiceSoundEffects()
|
|||||||
#endif
|
#endif
|
||||||
m_bReduceReleasingPriority = (m_FrameCounter++ % 5) == 0;
|
m_bReduceReleasingPriority = (m_FrameCounter++ % 5) == 0;
|
||||||
if (m_nUserPause && !m_nPreviousUserPause) {
|
if (m_nUserPause && !m_nPreviousUserPause) {
|
||||||
for (int32 i = 0; i < NUM_CHANNELS_GENERIC; i++)
|
for (uint32 i = 0; i < NUM_CHANNELS_GENERIC; i++)
|
||||||
SampleManager.StopChannel(i);
|
SampleManager.StopChannel(i);
|
||||||
|
|
||||||
SampleManager.SetChannelFrequency(CHANNEL_POLICE_RADIO, 0);
|
SampleManager.SetChannelFrequency(CHANNEL_POLICE_RADIO, 0);
|
||||||
SampleManager.SetChannelFrequency(CHANNEL_MISSION_AUDIO_1, 0);
|
SampleManager.SetChannelFrequency(CHANNEL_MISSION_AUDIO_1, 0);
|
||||||
SampleManager.SetChannelFrequency(CHANNEL_MISSION_AUDIO_2, 0);
|
SampleManager.SetChannelFrequency(CHANNEL_MISSION_AUDIO_2, 0);
|
||||||
|
SampleManager.StopChannel(CHANNEL_PLAYER_VEHICLE_ENGINE);
|
||||||
// ps2 code just stops the sound here for some reason
|
#if defined(GTA_PS2) || defined(GTA_PSP)
|
||||||
//SampleManager.StopChannel(CHANNEL_MISSION_AUDIO_1);
|
// PSP and PS2 just stop the sound, mobile doesn't. Let's not have it on PC either
|
||||||
//SampleManager.StopChannel(CHANNEL_MISSION_AUDIO_2);
|
uint8 missionAudioChannel = m_bIsSurround ? CHANNEL_DTS_MISSION_AUDIO_1 : CHANNEL_MISSION_AUDIO_1;
|
||||||
|
SampleManager.StopChannel(missionAudioChannel);
|
||||||
|
SampleManager.StopChannel(missionAudioChannel+1);
|
||||||
|
#endif
|
||||||
ClearRequestedQueue();
|
ClearRequestedQueue();
|
||||||
if (m_nActiveSampleQueue) {
|
if (m_nActiveSampleQueue) {
|
||||||
m_nActiveSampleQueue = 0;
|
m_nActiveSampleQueue = 0;
|
||||||
@ -990,7 +991,7 @@ cAudioManager::ProcessActiveQueues()
|
|||||||
uint8 emittingVol;
|
uint8 emittingVol;
|
||||||
CVector position;
|
CVector position;
|
||||||
|
|
||||||
bool8 missionState;
|
bool8 isPhoneCall;
|
||||||
uint8 channelOffset = 0;
|
uint8 channelOffset = 0;
|
||||||
|
|
||||||
for (int32 i = 0; i < m_nActiveSamples; i++) {
|
for (int32 i = 0; i < m_nActiveSamples; i++) {
|
||||||
@ -1056,18 +1057,18 @@ cAudioManager::ProcessActiveQueues()
|
|||||||
#endif
|
#endif
|
||||||
emittingVol = m_bDoubleVolume ? 2 * Min(63, vol) : vol;
|
emittingVol = m_bDoubleVolume ? 2 * Min(63, vol) : vol;
|
||||||
|
|
||||||
missionState = FALSE;
|
isPhoneCall = FALSE;
|
||||||
for (int32 k = 0; k < MISSION_AUDIO_SLOTS; k++) {
|
for (int32 k = 0; k < MISSION_AUDIO_SLOTS; k++) {
|
||||||
if (m_sMissionAudio.m_bIsMobile[k]) {
|
if (m_bIsMissionAudioPhoneCall[k]) {
|
||||||
missionState = TRUE;
|
isPhoneCall = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (missionState) {
|
if (isPhoneCall) {
|
||||||
emittingVol = (emittingVol * field_5538) / 127;
|
emittingVol = (emittingVol * m_nGlobalSfxVolumeMultiplier) / 127;
|
||||||
} else {
|
} else {
|
||||||
if (field_5538 < 127)
|
if (m_nGlobalSfxVolumeMultiplier < 127)
|
||||||
emittingVol = (emittingVol * field_5538) / 127;
|
emittingVol = (emittingVol * m_nGlobalSfxVolumeMultiplier) / 127;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef EXTERNAL_3D_SOUND
|
#ifdef EXTERNAL_3D_SOUND
|
||||||
@ -1145,19 +1146,19 @@ cAudioManager::ProcessActiveQueues()
|
|||||||
if (SampleManager.InitialiseChannel(k, m_asActiveSamples[k].m_nSampleIndex, m_asActiveSamples[k].m_nBankIndex)) {
|
if (SampleManager.InitialiseChannel(k, m_asActiveSamples[k].m_nSampleIndex, m_asActiveSamples[k].m_nBankIndex)) {
|
||||||
#endif
|
#endif
|
||||||
SampleManager.SetChannelFrequency(k, m_asActiveSamples[k].m_nFrequency);
|
SampleManager.SetChannelFrequency(k, m_asActiveSamples[k].m_nFrequency);
|
||||||
bool8 isMobile = FALSE;
|
isPhoneCall = FALSE;
|
||||||
for (int32 l = 0; l < MISSION_AUDIO_SLOTS; l++) {
|
for (int32 l = 0; l < MISSION_AUDIO_SLOTS; l++) {
|
||||||
if (m_sMissionAudio.m_bIsMobile[l]) {
|
if (m_bIsMissionAudioPhoneCall[l]) {
|
||||||
isMobile = TRUE;
|
isPhoneCall = TRUE;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!isMobile || m_asActiveSamples[k].m_bIs2D) {
|
if (!isPhoneCall || m_asActiveSamples[k].m_bIs2D) {
|
||||||
if (field_5538 < 127)
|
if (m_nGlobalSfxVolumeMultiplier < 127)
|
||||||
emittingVol *= field_5538 / 127;
|
emittingVol = (emittingVol * m_nGlobalSfxVolumeMultiplier) / 127;
|
||||||
vol = emittingVol;
|
vol = emittingVol;
|
||||||
} else {
|
} else {
|
||||||
vol = (emittingVol * field_5538 / 127);
|
vol = (emittingVol * m_nGlobalSfxVolumeMultiplier) / 127;
|
||||||
}
|
}
|
||||||
#ifdef EXTERNAL_3D_SOUND
|
#ifdef EXTERNAL_3D_SOUND
|
||||||
SampleManager.SetChannelEmittingVolume(k, vol);
|
SampleManager.SetChannelEmittingVolume(k, vol);
|
||||||
|
@ -119,27 +119,8 @@ public:
|
|||||||
|
|
||||||
VALIDATE_SIZE(cPedComments, 0x490);
|
VALIDATE_SIZE(cPedComments, 0x490);
|
||||||
|
|
||||||
class CEntity;
|
|
||||||
|
|
||||||
#define MISSION_AUDIO_SLOTS (2)
|
#define MISSION_AUDIO_SLOTS (2)
|
||||||
|
|
||||||
// So instead of doing cMissionAudio [2] they've added [2] to every field of the struct...
|
|
||||||
// Only someone with a VERY EXTRAORDINARY mind could have come up with that
|
|
||||||
class cMissionAudio
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
CVector m_vecPos[MISSION_AUDIO_SLOTS];
|
|
||||||
bool8 m_bPredefinedProperties[MISSION_AUDIO_SLOTS];
|
|
||||||
uint32 m_nSampleIndex[MISSION_AUDIO_SLOTS];
|
|
||||||
uint8 m_nLoadingStatus[MISSION_AUDIO_SLOTS];
|
|
||||||
uint8 m_nPlayStatus[MISSION_AUDIO_SLOTS];
|
|
||||||
bool8 m_bIsPlaying[MISSION_AUDIO_SLOTS];
|
|
||||||
int32 m_nMissionAudioCounter[MISSION_AUDIO_SLOTS];
|
|
||||||
bool8 m_bIsPlayed[MISSION_AUDIO_SLOTS];
|
|
||||||
bool8 m_bIsMobile[MISSION_AUDIO_SLOTS];
|
|
||||||
};
|
|
||||||
VALIDATE_SIZE(cMissionAudio, 0x38);
|
|
||||||
|
|
||||||
// name made up
|
// name made up
|
||||||
class cAudioScriptObjectManager
|
class cAudioScriptObjectManager
|
||||||
{
|
{
|
||||||
@ -153,6 +134,7 @@ public:
|
|||||||
|
|
||||||
|
|
||||||
class cTransmission;
|
class cTransmission;
|
||||||
|
class CEntity;
|
||||||
class CPlane;
|
class CPlane;
|
||||||
class CVehicle;
|
class CVehicle;
|
||||||
class CPed;
|
class CPed;
|
||||||
@ -263,7 +245,7 @@ public:
|
|||||||
bool8 m_bIsPlayerShutUp;
|
bool8 m_bIsPlayerShutUp;
|
||||||
uint8 m_nPlayerMood;
|
uint8 m_nPlayerMood;
|
||||||
uint32 m_nPlayerMoodTimer;
|
uint32 m_nPlayerMoodTimer;
|
||||||
uint8 field_rest[4];
|
uint32 field_4B38_vc;
|
||||||
bool8 m_bGenericSfx;
|
bool8 m_bGenericSfx;
|
||||||
|
|
||||||
cPedComments m_sPedComments;
|
cPedComments m_sPedComments;
|
||||||
@ -271,17 +253,31 @@ public:
|
|||||||
int32 m_nWaterCannonEntity;
|
int32 m_nWaterCannonEntity;
|
||||||
int32 m_nPoliceChannelEntity;
|
int32 m_nPoliceChannelEntity;
|
||||||
cPoliceRadioQueue m_sPoliceRadioQueue;
|
cPoliceRadioQueue m_sPoliceRadioQueue;
|
||||||
|
cAMCrime m_aCrimes[10];
|
||||||
int32 m_nFrontEndEntity;
|
int32 m_nFrontEndEntity;
|
||||||
int32 m_nCollisionEntity;
|
int32 m_nCollisionEntity;
|
||||||
cAudioCollisionManager m_sCollisionManager;
|
cAudioCollisionManager m_sCollisionManager;
|
||||||
int32 m_nProjectileEntity;
|
int32 m_nProjectileEntity;
|
||||||
|
int32 m_nEscalatorEntity;
|
||||||
|
int32 m_nExtraSoundsEntity;
|
||||||
#ifdef GTA_BRIDGE
|
#ifdef GTA_BRIDGE
|
||||||
int32 m_nBridgeEntity;
|
int32 m_nBridgeEntity;
|
||||||
#endif
|
#endif
|
||||||
int32 m_nEscalatorEntity;
|
|
||||||
int32 m_nExtraSoundsEntity;
|
// Mission audio stuff
|
||||||
cMissionAudio m_sMissionAudio;
|
// So instead of making an array of struct they've added [MISSION_AUDIO_SLOTS] to every field...
|
||||||
uint8 field_5538; // something related to phone dialogues
|
// Only someone with a VERY EXTRAORDINARY mind could have come up with that
|
||||||
|
CVector m_vecMissionAudioPosition[MISSION_AUDIO_SLOTS];
|
||||||
|
bool8 m_bIsMissionAudio2D[MISSION_AUDIO_SLOTS];
|
||||||
|
uint32 m_nMissionAudioSampleIndex[MISSION_AUDIO_SLOTS];
|
||||||
|
uint8 m_nMissionAudioLoadingStatus[MISSION_AUDIO_SLOTS];
|
||||||
|
uint8 m_nMissionAudioPlayStatus[MISSION_AUDIO_SLOTS];
|
||||||
|
bool8 m_bIsMissionAudioPlaying[MISSION_AUDIO_SLOTS];
|
||||||
|
int32 m_nMissionAudioFramesToPlay[MISSION_AUDIO_SLOTS];
|
||||||
|
bool8 m_bIsMissionAudioAllowedToPlay[MISSION_AUDIO_SLOTS];
|
||||||
|
bool8 m_bIsMissionAudioPhoneCall[MISSION_AUDIO_SLOTS];
|
||||||
|
uint8 m_nGlobalSfxVolumeMultiplier; // used to lower sfx volume during phone calls
|
||||||
|
|
||||||
int32 m_anRandomTable[5];
|
int32 m_anRandomTable[5];
|
||||||
uint8 m_nTimeSpent;
|
uint8 m_nTimeSpent;
|
||||||
bool8 m_nUserPause;
|
bool8 m_nUserPause;
|
||||||
@ -641,6 +637,10 @@ public:
|
|||||||
#define SET_SOUND_REVERB(b)
|
#define SET_SOUND_REVERB(b)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef GTA_PS2
|
||||||
|
#define CHANNEL_PLAYER_VEHICLE_ENGINE m_nActiveSamples
|
||||||
|
#endif
|
||||||
|
|
||||||
//#if defined(AUDIO_MSS) && !defined(PS2_AUDIO_CHANNELS)
|
//#if defined(AUDIO_MSS) && !defined(PS2_AUDIO_CHANNELS)
|
||||||
//static_assert(sizeof(cAudioManager) == 0x5558, "cAudioManager: error");
|
//static_assert(sizeof(cAudioManager) == 0x5558, "cAudioManager: error");
|
||||||
//#endif
|
//#endif
|
||||||
|
@ -59,11 +59,9 @@ cAudioManager::InitialisePoliceRadioZones()
|
|||||||
void
|
void
|
||||||
cAudioManager::InitialisePoliceRadio()
|
cAudioManager::InitialisePoliceRadio()
|
||||||
{
|
{
|
||||||
m_sPoliceRadioQueue.policeChannelTimer = 0;
|
m_sPoliceRadioQueue.Reset();
|
||||||
m_sPoliceRadioQueue.policeChannelTimerSeconds = 0;
|
for (int32 i = 0; i < ARRAY_SIZE(m_aCrimes); i++)
|
||||||
m_sPoliceRadioQueue.policeChannelCounterSeconds = 0;
|
m_aCrimes[i].type = CRIME_NONE;
|
||||||
for (int32 i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++)
|
|
||||||
m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE;
|
|
||||||
#if !defined(GTA_PS2) || defined(AUDIO_REVERB)
|
#if !defined(GTA_PS2) || defined(AUDIO_REVERB)
|
||||||
SampleManager.SetChannelReverbFlag(CHANNEL_POLICE_RADIO, FALSE);
|
SampleManager.SetChannelReverbFlag(CHANNEL_POLICE_RADIO, FALSE);
|
||||||
#endif
|
#endif
|
||||||
@ -179,7 +177,7 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
|
|||||||
bMissionAudioPhysicalPlayingStatus == PLAY_STATUS_PLAYING) {
|
bMissionAudioPhysicalPlayingStatus == PLAY_STATUS_PLAYING) {
|
||||||
SampleManager.PauseStream(FALSE, 1);
|
SampleManager.PauseStream(FALSE, 1);
|
||||||
}
|
}
|
||||||
if (m_sPoliceRadioQueue.policeChannelTimer == 0) bChannelOpen = FALSE;
|
if (m_sPoliceRadioQueue.m_nSamplesInQueue == 0) bChannelOpen = FALSE;
|
||||||
if (cWait) {
|
if (cWait) {
|
||||||
#ifdef FIX_BUGS
|
#ifdef FIX_BUGS
|
||||||
cWait -= CTimer::GetLogicalFramesPassed();
|
cWait -= CTimer::GetLogicalFramesPassed();
|
||||||
@ -216,14 +214,8 @@ cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel)
|
|||||||
}
|
}
|
||||||
if (bChannelOpen) DoPoliceRadioCrackle();
|
if (bChannelOpen) DoPoliceRadioCrackle();
|
||||||
if ((g_nMissionAudioSfx == NO_SAMPLE || g_nMissionAudioPlayingStatus != PLAY_STATUS_PLAYING) &&
|
if ((g_nMissionAudioSfx == NO_SAMPLE || g_nMissionAudioPlayingStatus != PLAY_STATUS_PLAYING) &&
|
||||||
!SampleManager.GetChannelUsedFlag(CHANNEL_POLICE_RADIO) && m_sPoliceRadioQueue.policeChannelTimer) {
|
!SampleManager.GetChannelUsedFlag(CHANNEL_POLICE_RADIO) && m_sPoliceRadioQueue.m_nSamplesInQueue != 0) {
|
||||||
if (m_sPoliceRadioQueue.policeChannelTimer) {
|
sample = m_sPoliceRadioQueue.Remove();
|
||||||
sample = m_sPoliceRadioQueue.crimesSamples[m_sPoliceRadioQueue.policeChannelCounterSeconds];
|
|
||||||
m_sPoliceRadioQueue.policeChannelTimer--;
|
|
||||||
m_sPoliceRadioQueue.policeChannelCounterSeconds = (m_sPoliceRadioQueue.policeChannelCounterSeconds + 1) % 60;
|
|
||||||
} else {
|
|
||||||
sample = NO_SAMPLE;
|
|
||||||
}
|
|
||||||
if (wantedLevel == 0) {
|
if (wantedLevel == 0) {
|
||||||
if (gSpecialSuspectLastSeenReport) {
|
if (gSpecialSuspectLastSeenReport) {
|
||||||
gSpecialSuspectLastSeenReport = FALSE;
|
gSpecialSuspectLastSeenReport = FALSE;
|
||||||
@ -275,18 +267,18 @@ cAudioManager::SetupCrimeReport()
|
|||||||
|
|
||||||
if (MusicManager.m_nMusicMode == MUSICMODE_CUTSCENE) return FALSE;
|
if (MusicManager.m_nMusicMode == MUSICMODE_CUTSCENE) return FALSE;
|
||||||
|
|
||||||
if (60 - m_sPoliceRadioQueue.policeChannelTimer <= 9) {
|
if (60 - m_sPoliceRadioQueue.m_nSamplesInQueue <= 9) {
|
||||||
AgeCrimes();
|
AgeCrimes();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++) {
|
for (i = 0; i < ARRAY_SIZE(m_aCrimes); i++) {
|
||||||
if (m_sPoliceRadioQueue.crimes[i].type != CRIME_NONE)
|
if (m_aCrimes[i].type != CRIME_NONE)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i == ARRAY_SIZE(m_sPoliceRadioQueue.crimes)) return FALSE;
|
if (i == ARRAY_SIZE(m_aCrimes)) return FALSE;
|
||||||
audioZoneId = CTheZones::FindAudioZone(&m_sPoliceRadioQueue.crimes[i].position);
|
audioZoneId = CTheZones::FindAudioZone(&m_aCrimes[i].position);
|
||||||
if (audioZoneId >= 0 && audioZoneId < NUMAUDIOZONES) {
|
if (audioZoneId >= 0 && audioZoneId < NUMAUDIOZONES) {
|
||||||
zone = CTheZones::GetAudioZone(audioZoneId);
|
zone = CTheZones::GetAudioZone(audioZoneId);
|
||||||
for (int j = 0; j < NUMAUDIOZONES; j++) {
|
for (int j = 0; j < NUMAUDIOZONES; j++) {
|
||||||
@ -295,24 +287,24 @@ cAudioManager::SetupCrimeReport()
|
|||||||
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_MESSAGE_NOISE_1);
|
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_MESSAGE_NOISE_1);
|
||||||
m_sPoliceRadioQueue.Add(m_anRandomTable[0] % 3 + SFX_WEVE_GOT);
|
m_sPoliceRadioQueue.Add(m_anRandomTable[0] % 3 + SFX_WEVE_GOT);
|
||||||
m_sPoliceRadioQueue.Add(SFX_A_10);
|
m_sPoliceRadioQueue.Add(SFX_A_10);
|
||||||
switch (m_sPoliceRadioQueue.crimes[i].type) {
|
switch (m_aCrimes[i].type) {
|
||||||
case CRIME_PED_BURNED:
|
case CRIME_PED_BURNED:
|
||||||
case CRIME_HIT_PED_NASTYWEAPON:
|
case CRIME_HIT_PED_NASTYWEAPON:
|
||||||
m_sPoliceRadioQueue.crimes[i].type = CRIME_HIT_PED;
|
m_aCrimes[i].type = CRIME_HIT_PED;
|
||||||
break;
|
break;
|
||||||
case CRIME_COP_BURNED:
|
case CRIME_COP_BURNED:
|
||||||
case CRIME_HIT_COP_NASTYWEAPON:
|
case CRIME_HIT_COP_NASTYWEAPON:
|
||||||
m_sPoliceRadioQueue.crimes[i].type = CRIME_HIT_COP;
|
m_aCrimes[i].type = CRIME_HIT_COP;
|
||||||
break;
|
break;
|
||||||
case CRIME_VEHICLE_BURNED: m_sPoliceRadioQueue.crimes[i].type = CRIME_STEAL_CAR; break;
|
case CRIME_VEHICLE_BURNED: m_aCrimes[i].type = CRIME_STEAL_CAR; break;
|
||||||
case CRIME_DESTROYED_CESSNA: m_sPoliceRadioQueue.crimes[i].type = CRIME_SHOOT_HELI; break;
|
case CRIME_DESTROYED_CESSNA: m_aCrimes[i].type = CRIME_SHOOT_HELI; break;
|
||||||
case CRIME_EXPLOSION: m_sPoliceRadioQueue.crimes[i].type = CRIME_STEAL_CAR; break; // huh?
|
case CRIME_EXPLOSION: m_aCrimes[i].type = CRIME_STEAL_CAR; break; // huh?
|
||||||
default: break;
|
default: break;
|
||||||
}
|
}
|
||||||
#ifdef FIX_BUGS
|
#ifdef FIX_BUGS
|
||||||
m_sPoliceRadioQueue.Add(m_sPoliceRadioQueue.crimes[i].type + SFX_SFX_CRIME_1 - 1);
|
m_sPoliceRadioQueue.Add(m_aCrimes[i].type + SFX_SFX_CRIME_1 - 1);
|
||||||
#else
|
#else
|
||||||
m_sPoliceRadioQueue.Add(m_sPoliceRadioQueue.crimes[i].type + SFX_SFX_CRIME_1);
|
m_sPoliceRadioQueue.Add(m_aCrimes[i].type + SFX_SFX_CRIME_1);
|
||||||
#endif
|
#endif
|
||||||
m_sPoliceRadioQueue.Add(SFX_IN);
|
m_sPoliceRadioQueue.Add(SFX_IN);
|
||||||
rangeX = zone->maxx - zone->minx;
|
rangeX = zone->maxx - zone->minx;
|
||||||
@ -322,17 +314,17 @@ cAudioManager::SetupCrimeReport()
|
|||||||
quarterX = 0.25f * rangeX;
|
quarterX = 0.25f * rangeX;
|
||||||
quarterY = 0.25f * rangeY;
|
quarterY = 0.25f * rangeY;
|
||||||
|
|
||||||
if (m_sPoliceRadioQueue.crimes[i].position.y > halfY + quarterY) {
|
if (m_aCrimes[i].position.y > halfY + quarterY) {
|
||||||
m_sPoliceRadioQueue.Add(SFX_NORTH);
|
m_sPoliceRadioQueue.Add(SFX_NORTH);
|
||||||
processed = TRUE;
|
processed = TRUE;
|
||||||
} else if (m_sPoliceRadioQueue.crimes[i].position.y < halfY - quarterY) {
|
} else if (m_aCrimes[i].position.y < halfY - quarterY) {
|
||||||
m_sPoliceRadioQueue.Add(SFX_SOUTH);
|
m_sPoliceRadioQueue.Add(SFX_SOUTH);
|
||||||
processed = TRUE;
|
processed = TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_sPoliceRadioQueue.crimes[i].position.x > halfX + quarterX)
|
if (m_aCrimes[i].position.x > halfX + quarterX)
|
||||||
m_sPoliceRadioQueue.Add(SFX_EAST);
|
m_sPoliceRadioQueue.Add(SFX_EAST);
|
||||||
else if (m_sPoliceRadioQueue.crimes[i].position.x < halfX - quarterX)
|
else if (m_aCrimes[i].position.x < halfX - quarterX)
|
||||||
m_sPoliceRadioQueue.Add(SFX_WEST);
|
m_sPoliceRadioQueue.Add(SFX_WEST);
|
||||||
else if (!processed)
|
else if (!processed)
|
||||||
m_sPoliceRadioQueue.Add(SFX_CENTRAL);
|
m_sPoliceRadioQueue.Add(SFX_CENTRAL);
|
||||||
@ -344,7 +336,7 @@ cAudioManager::SetupCrimeReport()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE;
|
m_aCrimes[i].type = CRIME_NONE;
|
||||||
AgeCrimes();
|
AgeCrimes();
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
@ -461,7 +453,7 @@ cAudioManager::SetupSuspectLastSeenReport()
|
|||||||
if (MusicManager.m_nMusicMode != MUSICMODE_CUTSCENE) {
|
if (MusicManager.m_nMusicMode != MUSICMODE_CUTSCENE) {
|
||||||
veh = FindVehicleOfPlayer();
|
veh = FindVehicleOfPlayer();
|
||||||
if (veh != nil) {
|
if (veh != nil) {
|
||||||
if (60 - m_sPoliceRadioQueue.policeChannelTimer > 9) {
|
if (POLICE_RADIO_QUEUE_MAX_SAMPLES - m_sPoliceRadioQueue.m_nSamplesInQueue > 9) {
|
||||||
color1 = veh->m_currentColour1;
|
color1 = veh->m_currentColour1;
|
||||||
if (color1 >= ARRAY_SIZE(gCarColourTable)) {
|
if (color1 >= ARRAY_SIZE(gCarColourTable)) {
|
||||||
debug("\n *** UNKNOWN CAR COLOUR %d *** ", color1);
|
debug("\n *** UNKNOWN CAR COLOUR %d *** ", color1);
|
||||||
@ -646,7 +638,7 @@ cAudioManager::SetupSuspectLastSeenReport()
|
|||||||
m_sPoliceRadioQueue.Add(NO_SAMPLE);
|
m_sPoliceRadioQueue.Add(NO_SAMPLE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (60 - m_sPoliceRadioQueue.policeChannelTimer > 4) {
|
} else if (POLICE_RADIO_QUEUE_MAX_SAMPLES - m_sPoliceRadioQueue.m_nSamplesInQueue > 4) {
|
||||||
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_MESSAGE_NOISE_1);
|
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_MESSAGE_NOISE_1);
|
||||||
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_SUSPECT);
|
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_SUSPECT);
|
||||||
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_ON_FOOT);
|
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_ON_FOOT);
|
||||||
@ -659,24 +651,24 @@ cAudioManager::SetupSuspectLastSeenReport()
|
|||||||
void
|
void
|
||||||
cAudioManager::ReportCrime(eCrimeType type, const CVector &pos)
|
cAudioManager::ReportCrime(eCrimeType type, const CVector &pos)
|
||||||
{
|
{
|
||||||
int32 lastCrime = ARRAY_SIZE(m_sPoliceRadioQueue.crimes);
|
int32 lastCrime = ARRAY_SIZE(m_aCrimes);
|
||||||
if (m_bIsInitialised && MusicManager.m_nMusicMode != MUSICMODE_CUTSCENE && FindPlayerPed()->m_pWanted->GetWantedLevel() > 0 &&
|
if (m_bIsInitialised && MusicManager.m_nMusicMode != MUSICMODE_CUTSCENE && FindPlayerPed()->m_pWanted->GetWantedLevel() > 0 &&
|
||||||
(type > CRIME_NONE || type < NUM_CRIME_TYPES) && m_FrameCounter >= gMinTimeToNextReport[type]) {
|
(type > CRIME_NONE || type < NUM_CRIME_TYPES) && m_FrameCounter >= gMinTimeToNextReport[type]) {
|
||||||
for (int32 i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++) {
|
for (int32 i = 0; i < ARRAY_SIZE(m_aCrimes); i++) {
|
||||||
if (m_sPoliceRadioQueue.crimes[i].type != CRIME_NONE) {
|
if (m_aCrimes[i].type != CRIME_NONE) {
|
||||||
if (m_sPoliceRadioQueue.crimes[i].type == type) {
|
if (m_aCrimes[i].type == type) {
|
||||||
m_sPoliceRadioQueue.crimes[i].position = pos;
|
m_aCrimes[i].position = pos;
|
||||||
m_sPoliceRadioQueue.crimes[i].timer = 0;
|
m_aCrimes[i].timer = 0;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else
|
} else
|
||||||
lastCrime = i;
|
lastCrime = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lastCrime < ARRAY_SIZE(m_sPoliceRadioQueue.crimes)) {
|
if (lastCrime < ARRAY_SIZE(m_aCrimes)) {
|
||||||
m_sPoliceRadioQueue.crimes[lastCrime].type = type;
|
m_aCrimes[lastCrime].type = type;
|
||||||
m_sPoliceRadioQueue.crimes[lastCrime].position = pos;
|
m_aCrimes[lastCrime].position = pos;
|
||||||
m_sPoliceRadioQueue.crimes[lastCrime].timer = 0;
|
m_aCrimes[lastCrime].timer = 0;
|
||||||
gMinTimeToNextReport[type] = m_FrameCounter + 500;
|
gMinTimeToNextReport[type] = m_FrameCounter + 500;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -699,7 +691,7 @@ cAudioManager::PlaySuspectLastSeen(float x, float y, float z)
|
|||||||
|
|
||||||
if (!m_bIsInitialised) return;
|
if (!m_bIsInitialised) return;
|
||||||
|
|
||||||
if (MusicManager.m_nMusicMode != MUSICMODE_CUTSCENE && 60 - m_sPoliceRadioQueue.policeChannelTimer > 9) {
|
if (MusicManager.m_nMusicMode != MUSICMODE_CUTSCENE && POLICE_RADIO_QUEUE_MAX_SAMPLES - m_sPoliceRadioQueue.m_nSamplesInQueue > 9) {
|
||||||
audioZone = CTheZones::FindAudioZone(&vec);
|
audioZone = CTheZones::FindAudioZone(&vec);
|
||||||
if (audioZone >= 0 && audioZone < NUMAUDIOZONES) {
|
if (audioZone >= 0 && audioZone < NUMAUDIOZONES) {
|
||||||
zone = CTheZones::GetAudioZone(audioZone);
|
zone = CTheZones::GetAudioZone(audioZone);
|
||||||
@ -745,9 +737,9 @@ cAudioManager::PlaySuspectLastSeen(float x, float y, float z)
|
|||||||
void
|
void
|
||||||
cAudioManager::AgeCrimes()
|
cAudioManager::AgeCrimes()
|
||||||
{
|
{
|
||||||
for (uint8 i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++) {
|
for (uint8 i = 0; i < ARRAY_SIZE(m_aCrimes); i++) {
|
||||||
if (m_sPoliceRadioQueue.crimes[i].type != CRIME_NONE) {
|
if (m_aCrimes[i].type != CRIME_NONE) {
|
||||||
if (++m_sPoliceRadioQueue.crimes[i].timer > 1200) m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE;
|
if (++m_aCrimes[i].timer > 1200) m_aCrimes[i].type = CRIME_NONE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Crime.h"
|
#include "Crime.h"
|
||||||
|
#include "AudioSamples.h"
|
||||||
|
|
||||||
struct cAMCrime {
|
struct cAMCrime {
|
||||||
int32 type;
|
int32 type;
|
||||||
@ -17,30 +18,50 @@ struct cAMCrime {
|
|||||||
|
|
||||||
VALIDATE_SIZE(cAMCrime, 20);
|
VALIDATE_SIZE(cAMCrime, 20);
|
||||||
|
|
||||||
|
#define POLICE_RADIO_QUEUE_MAX_SAMPLES 60
|
||||||
|
|
||||||
class cPoliceRadioQueue
|
class cPoliceRadioQueue
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
int32 crimesSamples[60];
|
uint32 m_aSamples[POLICE_RADIO_QUEUE_MAX_SAMPLES];
|
||||||
uint8 policeChannelTimer;
|
uint8 m_nSamplesInQueue;
|
||||||
uint8 policeChannelTimerSeconds;
|
uint8 m_nAddOffset;
|
||||||
uint8 policeChannelCounterSeconds;
|
uint8 m_nRemoveOffset;
|
||||||
cAMCrime crimes[10];
|
|
||||||
|
|
||||||
cPoliceRadioQueue()
|
cPoliceRadioQueue()
|
||||||
{
|
{
|
||||||
policeChannelTimerSeconds = 0;
|
Reset();
|
||||||
policeChannelCounterSeconds = 0;
|
|
||||||
policeChannelTimer = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Add(uint32 sample)
|
void Reset()
|
||||||
{
|
{
|
||||||
if (policeChannelTimer != 60) {
|
m_nAddOffset = 0;
|
||||||
crimesSamples[policeChannelTimerSeconds] = sample;
|
m_nRemoveOffset = 0;
|
||||||
policeChannelTimer++;
|
m_nSamplesInQueue = 0;
|
||||||
policeChannelTimerSeconds = (policeChannelTimerSeconds + 1) % 60;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool8 Add(uint32 sample)
|
||||||
|
{
|
||||||
|
if (m_nSamplesInQueue != POLICE_RADIO_QUEUE_MAX_SAMPLES) {
|
||||||
|
m_aSamples[m_nAddOffset] = sample;
|
||||||
|
m_nSamplesInQueue++;
|
||||||
|
m_nAddOffset = (m_nAddOffset + 1) % POLICE_RADIO_QUEUE_MAX_SAMPLES;
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
uint32 Remove()
|
||||||
|
{
|
||||||
|
if (m_nSamplesInQueue != 0) {
|
||||||
|
uint32 sample = m_aSamples[m_nRemoveOffset];
|
||||||
|
m_nSamplesInQueue--;
|
||||||
|
m_nRemoveOffset = (m_nRemoveOffset + 1) % POLICE_RADIO_QUEUE_MAX_SAMPLES;
|
||||||
|
return sample;
|
||||||
|
}
|
||||||
|
return NO_SAMPLE;
|
||||||
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
VALIDATE_SIZE(cPoliceRadioQueue, 0x1BC);
|
VALIDATE_SIZE(cPoliceRadioQueue, 244);
|
||||||
|
@ -146,7 +146,13 @@ enum
|
|||||||
CHANNEL_MISSION_AUDIO_1,
|
CHANNEL_MISSION_AUDIO_1,
|
||||||
CHANNEL_MISSION_AUDIO_2,
|
CHANNEL_MISSION_AUDIO_2,
|
||||||
CHANNEL_PLAYER_VEHICLE_ENGINE,
|
CHANNEL_PLAYER_VEHICLE_ENGINE,
|
||||||
NUM_CHANNELS
|
NUM_CHANNELS,
|
||||||
|
|
||||||
|
NUM_CHANNELS_DTS_GENERIC = 18,
|
||||||
|
CHANNEL_DTS_POLICE_RADIO = NUM_CHANNELS_DTS_GENERIC,
|
||||||
|
CHANNEL_DTS_MISSION_AUDIO_1,
|
||||||
|
CHANNEL_DTS_MISSION_AUDIO_2,
|
||||||
|
CHANNEL_DTS_PLAYER_VEHICLE_ENGINE,
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
enum
|
enum
|
||||||
|
@ -205,9 +205,15 @@ CPedIK::PointGunInDirection(float targetYaw, float targetPitch)
|
|||||||
else if (status == ANGLES_SET_EXACTLY)
|
else if (status == ANGLES_SET_EXACTLY)
|
||||||
m_flags |= GUN_POINTED_SUCCESSFULLY;
|
m_flags |= GUN_POINTED_SUCCESSFULLY;
|
||||||
}
|
}
|
||||||
RwMatrix *m = GetBoneMatrix(m_ped, BONE_spine); // BUG: game uses index 2 directly, which happens to be identical to BONE_spine
|
#ifdef FIX_BUGS
|
||||||
|
RwMatrix *m = GetBoneMatrix(m_ped, BONE_spine);
|
||||||
|
#else
|
||||||
|
RpHAnimHierarchy* hier = GetAnimHierarchyFromSkinClump(m_ped->GetClump());
|
||||||
|
RwMatrix *mats = RpHAnimHierarchyGetMatrixArray(hier);
|
||||||
|
RwMatrix *m = &mats[2];
|
||||||
|
#endif
|
||||||
RwV3d axis = { 0.0f, 0.0f, 0.0f };
|
RwV3d axis = { 0.0f, 0.0f, 0.0f };
|
||||||
float axisangle = -CGeneral::LimitRadianAngle(Atan2(-m->at.y, -m->at.x) - m_ped->m_fRotationCur);
|
float axisangle = -CGeneral::LimitRadianAngle(Atan2(-m->up.y, -m->up.x) - m_ped->m_fRotationCur);
|
||||||
axis.y = -Sin(axisangle);
|
axis.y = -Sin(axisangle);
|
||||||
axis.z = Cos(axisangle);
|
axis.z = Cos(axisangle);
|
||||||
|
|
||||||
|
@ -777,7 +777,8 @@ spentAmmoCheck:
|
|||||||
|
|
||||||
// BUG: m_nSelectedWepSlot and GetWeapon(..) takes slot in VC but they compared them against weapon types in whole condition! jeez
|
// BUG: m_nSelectedWepSlot and GetWeapon(..) takes slot in VC but they compared them against weapon types in whole condition! jeez
|
||||||
#ifdef FIX_BUGS
|
#ifdef FIX_BUGS
|
||||||
if (m_nSelectedWepSlot == WEAPONSLOT_MELEE || GetWeapon(m_nSelectedWepSlot).m_nAmmoTotal > 0 && m_nSelectedWepSlot != WEAPONSLOT_PROJECTILE) {
|
if (m_nSelectedWepSlot == WEAPONSLOT_MELEE ||
|
||||||
|
GetWeapon(m_nSelectedWepSlot).m_nAmmoTotal > 0 && (m_nSelectedWepSlot != WEAPONSLOT_PROJECTILE || GetWeapon(WEAPONSLOT_PROJECTILE).m_eWeaponType == WEAPONTYPE_DETONATOR_GRENADE)) {
|
||||||
#else
|
#else
|
||||||
if (m_nSelectedWepSlot == WEAPONTYPE_BASEBALLBAT && GetWeapon(WEAPONTYPE_BASEBALLBAT).m_eWeaponType == WEAPONTYPE_BASEBALLBAT
|
if (m_nSelectedWepSlot == WEAPONTYPE_BASEBALLBAT && GetWeapon(WEAPONTYPE_BASEBALLBAT).m_eWeaponType == WEAPONTYPE_BASEBALLBAT
|
||||||
|| GetWeapon(m_nSelectedWepSlot).m_nAmmoTotal > 0
|
|| GetWeapon(m_nSelectedWepSlot).m_nAmmoTotal > 0
|
||||||
@ -1057,7 +1058,7 @@ CPlayerPed::FindNextWeaponLockOnTarget(CEntity *previousTarget, bool lookToLeft)
|
|||||||
// nextTarget = nil; // duplicate
|
// nextTarget = nil; // duplicate
|
||||||
float lastCloseness = -10000.0f;
|
float lastCloseness = -10000.0f;
|
||||||
// CGeneral::GetATanOfXY(GetForward().x, GetForward().y); // unused
|
// CGeneral::GetATanOfXY(GetForward().x, GetForward().y); // unused
|
||||||
CVector distVec = previousTarget->GetPosition() - GetPosition();
|
CVector distVec = previousTarget->GetPosition() - TheCamera.GetPosition();
|
||||||
float referenceBeta = CGeneral::GetATanOfXY(distVec.x, distVec.y);
|
float referenceBeta = CGeneral::GetATanOfXY(distVec.x, distVec.y);
|
||||||
|
|
||||||
for (int h = CPools::GetPedPool()->GetSize() - 1; h >= 0; h--) {
|
for (int h = CPools::GetPedPool()->GetSize() - 1; h >= 0; h--) {
|
||||||
@ -1069,7 +1070,7 @@ CPlayerPed::FindNextWeaponLockOnTarget(CEntity *previousTarget, bool lookToLeft)
|
|||||||
&& (!pedToCheck->bInVehicle || (pedToCheck->m_pMyVehicle && pedToCheck->m_pMyVehicle->IsBike()))
|
&& (!pedToCheck->bInVehicle || (pedToCheck->m_pMyVehicle && pedToCheck->m_pMyVehicle->IsBike()))
|
||||||
#endif
|
#endif
|
||||||
&& pedToCheck->m_leader != this && !pedToCheck->bNeverEverTargetThisPed
|
&& pedToCheck->m_leader != this && !pedToCheck->bNeverEverTargetThisPed
|
||||||
&& OurPedCanSeeThisOne(pedToCheck) && CanIKReachThisTarget(pedToCheck->GetPosition(), GetWeapon(), true)) {
|
&& OurPedCanSeeThisOne(pedToCheck, true) && CanIKReachThisTarget(pedToCheck->GetPosition(), GetWeapon(), true)) {
|
||||||
|
|
||||||
EvaluateNeighbouringTarget(pedToCheck, &nextTarget, &lastCloseness,
|
EvaluateNeighbouringTarget(pedToCheck, &nextTarget, &lastCloseness,
|
||||||
weaponRange, referenceBeta, lookToLeft, IsThisPedAnAimingPriority(pedToCheck));
|
weaponRange, referenceBeta, lookToLeft, IsThisPedAnAimingPriority(pedToCheck));
|
||||||
@ -1196,7 +1197,7 @@ CPlayerPed::ProcessAnimGroups(void)
|
|||||||
GetWeapon()->m_eWeaponType == WEAPONTYPE_MINIGUN)
|
GetWeapon()->m_eWeaponType == WEAPONTYPE_MINIGUN)
|
||||||
groupToSet = ASSOCGRP_PLAYERCHAINSAW;
|
groupToSet = ASSOCGRP_PLAYERCHAINSAW;
|
||||||
else if (GetWeapon()->m_eWeaponType != WEAPONTYPE_COLT45 && GetWeapon()->m_eWeaponType != WEAPONTYPE_UZI
|
else if (GetWeapon()->m_eWeaponType != WEAPONTYPE_COLT45 && GetWeapon()->m_eWeaponType != WEAPONTYPE_UZI
|
||||||
// I hope this is a inlined function...
|
// I hope this is an inlined function...
|
||||||
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_PYTHON && GetWeapon()->m_eWeaponType != WEAPONTYPE_TEC9
|
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_PYTHON && GetWeapon()->m_eWeaponType != WEAPONTYPE_TEC9
|
||||||
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_SILENCED_INGRAM && GetWeapon()->m_eWeaponType != WEAPONTYPE_MP5
|
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_SILENCED_INGRAM && GetWeapon()->m_eWeaponType != WEAPONTYPE_MP5
|
||||||
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_GOLFCLUB && GetWeapon()->m_eWeaponType != WEAPONTYPE_KATANA
|
&& GetWeapon()->m_eWeaponType != WEAPONTYPE_GOLFCLUB && GetWeapon()->m_eWeaponType != WEAPONTYPE_KATANA
|
||||||
|
Loading…
x
Reference in New Issue
Block a user