diff options
Diffstat (limited to '')
-rw-r--r-- | src/audio/AudioLogic.cpp | 8 | ||||
-rw-r--r-- | src/audio/AudioManager.cpp | 3 | ||||
-rw-r--r-- | src/audio/AudioManager.h | 7 | ||||
-rw-r--r-- | src/audio/DMAudio.cpp | 2 | ||||
-rw-r--r-- | src/audio/MusicManager.cpp | 18 | ||||
-rw-r--r-- | src/audio/PoliceRadio.cpp | 563 | ||||
-rw-r--r-- | src/audio/oal/stream.cpp | 2 | ||||
-rw-r--r-- | src/audio/soundlist.h | 157 | ||||
-rw-r--r-- | src/control/Script.cpp | 32 | ||||
-rw-r--r-- | src/core/Game.h | 4 | ||||
-rw-r--r-- | src/core/Pad.h | 4 | ||||
-rw-r--r-- | src/core/TempColModels.cpp | 18 | ||||
-rw-r--r-- | src/core/Timer.cpp | 4 | ||||
-rw-r--r-- | src/core/Zones.h | 2 | ||||
-rw-r--r-- | src/core/config.h | 2 | ||||
-rw-r--r-- | src/core/main.cpp | 104 | ||||
-rw-r--r-- | src/modelinfo/PedModelInfo.cpp | 27 | ||||
-rw-r--r-- | src/objects/ObjectData.cpp | 73 | ||||
-rw-r--r-- | src/peds/EmergencyPed.cpp | 48 | ||||
-rw-r--r-- | src/peds/PedDebug.cpp | 57 | ||||
-rw-r--r-- | src/render/Fluff.cpp | 693 | ||||
-rw-r--r-- | src/render/Fluff.h | 50 | ||||
-rw-r--r-- | src/skel/crossplatform.cpp | 34 | ||||
-rw-r--r-- | src/text/Messages.cpp | 5 | ||||
-rw-r--r-- | src/vehicles/Train.cpp | 2 | ||||
-rw-r--r-- | src/weapons/Weapon.cpp | 9 |
26 files changed, 762 insertions, 1166 deletions
diff --git a/src/audio/AudioLogic.cpp b/src/audio/AudioLogic.cpp index 6ea93f6d..d4ddbda8 100644 --- a/src/audio/AudioLogic.cpp +++ b/src/audio/AudioLogic.cpp @@ -5085,7 +5085,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) static uint8 iSound = 0; switch (sound) { - case SCRIPT_SOUND_INJURED_PED_MALE_OUCH_S: + /*case SCRIPT_SOUND_INJURED_PED_MALE_OUCH_S: case SCRIPT_SOUND_INJURED_PED_MALE_OUCH_L: male.m_pPed = nil; male.m_bDistanceCalculated = false; @@ -5113,7 +5113,7 @@ cAudioManager::ProcessOneShotScriptObject(uint8 sound) m_sQueueSample.m_bIs2D = false; m_sQueueSample.m_bRequireReflection = true; emittingVolume = RandomDisplacement(10) + 50; - break; + break;*/ case SCRIPT_SOUND_BULLET_HIT_GROUND_1: case SCRIPT_SOUND_BULLET_HIT_GROUND_2: case SCRIPT_SOUND_BULLET_HIT_GROUND_3: @@ -5328,7 +5328,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) float distSquared; switch (sound) { - case SCRIPT_SOUND_PARTY_1_LOOP_S: + /*case SCRIPT_SOUND_PARTY_1_LOOP_S: m_sQueueSample.m_fSoundIntensity = SCRIPT_OBJECT_INTENSITY_S; m_sQueueSample.m_nSampleIndex = SFX_CLUB_1; m_sQueueSample.m_nBankIndex = SFX_BANK_0;//SAMPLEBANK_BUILDING_CLUB_1; @@ -5427,7 +5427,7 @@ cAudioManager::ProcessLoopingScriptObject(uint8 sound) m_sQueueSample.m_nReleasingVolumeModificator = 8; m_sQueueSample.m_nReleasingVolumeDivider = 10; m_sQueueSample.m_fSpeedMultiplier = 2.0f; - break; + break;*/ default: return; } diff --git a/src/audio/AudioManager.cpp b/src/audio/AudioManager.cpp index d36316eb..4b7039c6 100644 --- a/src/audio/AudioManager.cpp +++ b/src/audio/AudioManager.cpp @@ -437,7 +437,6 @@ cAudioManager::IsAudioInitialised() const void cAudioManager::ServiceSoundEffects() { - field_5554++; m_bFifthFrameFlag = (m_FrameCounter++ % 5) == 0; if (m_nUserPause && !m_nPreviousUserPause) { for (int32 i = 0; i < allChannels; i++) @@ -838,7 +837,7 @@ cAudioManager::ProcessActiveQueues() sample.m_nSampleIndex == m_asActiveSamples[j].m_nSampleIndex) { if (sample.m_nLoopCount) { - if (field_5554 & 1) { + if (m_FrameCounter & 1) { if (!(j & 1)) { flag = false; } else { diff --git a/src/audio/AudioManager.h b/src/audio/AudioManager.h index ae130b85..d7a744cd 100644 --- a/src/audio/AudioManager.h +++ b/src/audio/AudioManager.h @@ -76,6 +76,8 @@ public: uint8 m_nIndexMap[NUM_PED_COMMENTS_BANKS][NUM_PED_COMMENTS_SLOTS]; uint8 m_nCommentsInBank[NUM_PED_COMMENTS_BANKS]; uint8 m_nActiveBank; + bool m_bDelay; + uint32 m_nDelayTimer; cPedComments() { @@ -221,7 +223,6 @@ public: uint8 m_nUserPause; uint8 m_nPreviousUserPause; uint32 m_FrameCounter; - uint32 field_5554; cAudioManager(); ~cAudioManager(); @@ -370,7 +371,7 @@ public: void ReacquireDigitalHandle() const; // done void ReleaseDigitalHandle() const; // done void ReportCollision(CEntity *entity1, CEntity *entity2, uint8 surface1, uint8 surface2, float collisionPower, float intensity2); // done - void ReportCrime(int32 crime, const CVector *pos); // done + void ReportCrime(eCrimeType crime, const CVector &pos); // done void ResetAudioLogicTimers(uint32 timer); void ResetPoliceRadio(); void ResetTimers(uint32 time); @@ -378,7 +379,7 @@ public: void Service(); void ServiceCollisions(); void ServicePoliceRadio(); - void ServicePoliceRadioChannel(int32 wantedLevel); + void ServicePoliceRadioChannel(uint8 wantedLevel); void ServiceSoundEffects(); int8 SetCurrent3DProvider(uint8 which); void SetDynamicAcousticModelingStatus(uint8 status); diff --git a/src/audio/DMAudio.cpp b/src/audio/DMAudio.cpp index a4db2862..ade53d9b 100644 --- a/src/audio/DMAudio.cpp +++ b/src/audio/DMAudio.cpp @@ -190,7 +190,7 @@ cDMAudio::IsAudioInitialised(void) void cDMAudio::ReportCrime(eCrimeType crime, const CVector &pos) { - AudioManager.ReportCrime(crime, &pos); + AudioManager.ReportCrime(crime, pos); } int32 diff --git a/src/audio/MusicManager.cpp b/src/audio/MusicManager.cpp index fde92590..adae2708 100644 --- a/src/audio/MusicManager.cpp +++ b/src/audio/MusicManager.cpp @@ -374,7 +374,7 @@ cMusicManager::Service() field_399A = true; if (!field_3999 && !AudioManager.m_nUserPause && AudioManager.m_nPreviousUserPause) field_3999 = true; - if (AudioManager.field_5554 % 4 == 0) { + if (AudioManager.m_FrameCounter % 4 == 0) { gNumRetunePresses = 0; gRetuneCounter = 0; field_2 = false; @@ -422,7 +422,7 @@ cMusicManager::ServiceFrontEndMode() m_nPlayingTrack = NO_TRACK; } - if (AudioManager.field_5554 % 4 != 0) return; + if (AudioManager.m_FrameCounter % 4 != 0) return; if (!field_398F && !field_3995) { m_nStreamedTrack = m_nFrontendTrack; @@ -893,7 +893,7 @@ cMusicManager::ServiceTrack(CVehicle *veh, CPed *ped) { field_398F = true; SampleManager.SetStreamedVolumeAndPan(0, 63, 0, 0); - if (!(AudioManager.field_5554 & 1)) { + if (!(AudioManager.m_FrameCounter & 1)) { if (field_3995 || !SampleManager.IsStreamPlaying(0)) { bRadioStatsRecorded2 = false; if (SampleManager.IsStreamPlaying(0)) { @@ -1160,13 +1160,13 @@ cMusicManager::SetMalibuClubTrackPos(uint8 scriptObject) if (m_nStreamedTrack != STREAMED_SOUND_MALIBU_AMBIENT && m_nPlayingTrack != STREAMED_SOUND_MALIBU_AMBIENT) { switch (scriptObject) { - case SCRIPT_SOUND_MALIBU_1: + case SCRIPT_SOUND_NEW_BUILDING_MALIBU_1: m_aTracks[STREAMED_SOUND_MALIBU_AMBIENT].m_nPosition = (AudioManager.m_anRandomTable[0] % 128) + 8640; break; - case SCRIPT_SOUND_MALIBU_2: + case SCRIPT_SOUND_NEW_BUILDING_MALIBU_2: m_aTracks[STREAMED_SOUND_MALIBU_AMBIENT].m_nPosition = (AudioManager.m_anRandomTable[0] % 128) + 286720; break; - case SCRIPT_SOUND_MALIBU_3: + case SCRIPT_SOUND_NEW_BUILDING_MALIBU_3: m_aTracks[STREAMED_SOUND_MALIBU_AMBIENT].m_nPosition = (AudioManager.m_anRandomTable[0] % 128) + 509120; break; } @@ -1183,13 +1183,13 @@ cMusicManager::SetStripClubTrackPos(uint8 scriptObject) { switch (scriptObject) { - case SCRIPT_SOUND_STRIPCLUB_1: + case SCRIPT_SOUND_NEW_BUILDING_STRIP_1: m_aTracks[STREAMED_SOUND_STRIPCLUB_AMBIENT].m_nPosition = AudioManager.m_anRandomTable[0] % 128; break; - case SCRIPT_SOUND_STRIPCLUB_2: + case SCRIPT_SOUND_NEW_BUILDING_STRIP_2: m_aTracks[STREAMED_SOUND_STRIPCLUB_AMBIENT].m_nPosition = (AudioManager.m_anRandomTable[0] % 128) + 320200; break; - case SCRIPT_SOUND_STRIPCLUB_3: + case SCRIPT_SOUND_NEW_BUILDING_STRIP_3: m_aTracks[STREAMED_SOUND_STRIPCLUB_AMBIENT].m_nPosition = (AudioManager.m_anRandomTable[0] % 128) + 672000; break; } diff --git a/src/audio/PoliceRadio.cpp b/src/audio/PoliceRadio.cpp index bd29ad4b..781040d6 100644 --- a/src/audio/PoliceRadio.cpp +++ b/src/audio/PoliceRadio.cpp @@ -65,7 +65,7 @@ cAudioManager::InitialisePoliceRadio() m_sPoliceRadioQueue.policeChannelTimerSeconds = 0; m_sPoliceRadioQueue.policeChannelCounterSeconds = 0; for (int32 i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++) - m_sPoliceRadioQueue.crimes[i].type = 0; + m_sPoliceRadioQueue.crimes[i].type = CRIME_NONE; SampleManager.SetChannelReverbFlag(policeChannel, 0); gSpecialSuspectLastSeenReport = false; @@ -128,20 +128,23 @@ cAudioManager::ServicePoliceRadio() if(!m_bIsInitialised) return; - if(!m_nUserPause) { + if(m_nUserPause == 0) { bool crimeReport = SetupCrimeReport(); #ifdef FIX_BUGS // Crash at 0x5fe6ef if(CReplay::IsPlayingBack() || !FindPlayerPed() || !FindPlayerPed()->m_pWanted) return; #endif - wantedLevel = FindPlayerPed()->m_pWanted->m_nWantedLevel; - if(!crimeReport) { - if(wantedLevel) { - if(nLastSeen) { - --nLastSeen; - } else { - nLastSeen = m_anRandomTable[1] % 1000 + 2000; - SetupSuspectLastSeenReport(); + CPlayerPed *playerPed = FindPlayerPed(); + if (playerPed) { + wantedLevel = playerPed->m_pWanted->m_nWantedLevel; + if (!crimeReport) { + if (wantedLevel != 0) { + if (nLastSeen != 0) + --nLastSeen; + else { + nLastSeen = m_anRandomTable[1] % 1000 + 2000; + SetupSuspectLastSeenReport(); + } } } } @@ -150,7 +153,7 @@ cAudioManager::ServicePoliceRadio() } void -cAudioManager::ServicePoliceRadioChannel(int32 wantedLevel) +cAudioManager::ServicePoliceRadioChannel(uint8 wantedLevel) { bool processed = false; uint32 sample; @@ -159,18 +162,18 @@ cAudioManager::ServicePoliceRadioChannel(int32 wantedLevel) static int cWait = 0; static bool bChannelOpen = false; static uint8 bMissionAudioPhysicalPlayingStatus = 0; - static int32 PoliceChannelFreq = 5500; + static int32 PoliceChannelFreq = 22050; if (!m_bIsInitialised) return; - if (m_nUserPause) { + if (m_nUserPause != 0) { if (SampleManager.GetChannelUsedFlag(policeChannel)) SampleManager.StopChannel(policeChannel); - if (g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && bMissionAudioPhysicalPlayingStatus == 1 && + if (g_nMissionAudioSfx != NO_SAMPLE && bMissionAudioPhysicalPlayingStatus == 1 && SampleManager.IsStreamPlaying(1)) { SampleManager.PauseStream(1, 1); } } else { - if (m_nPreviousUserPause && g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && + if (m_nPreviousUserPause && g_nMissionAudioSfx != NO_SAMPLE && bMissionAudioPhysicalPlayingStatus == 1) { SampleManager.PauseStream(0, 1); } @@ -179,7 +182,7 @@ cAudioManager::ServicePoliceRadioChannel(int32 wantedLevel) --cWait; return; } - if (g_nMissionAudioSfx != TOTAL_AUDIO_SAMPLES && !bChannelOpen) { + if (g_nMissionAudioSfx != NO_SAMPLE && !bChannelOpen) { if (g_nMissionAudioPlayingStatus) { if (g_nMissionAudioPlayingStatus == 1 && !bMissionAudioPhysicalPlayingStatus && SampleManager.IsStreamPlaying(1)) { @@ -191,7 +194,7 @@ cAudioManager::ServicePoliceRadioChannel(int32 wantedLevel) } else { bMissionAudioPhysicalPlayingStatus = 2; g_nMissionAudioPlayingStatus = 2; - g_nMissionAudioSfx = TOTAL_AUDIO_SAMPLES; + g_nMissionAudioSfx = NO_SAMPLE; cWait = 30; } return; @@ -206,24 +209,24 @@ cAudioManager::ServicePoliceRadioChannel(int32 wantedLevel) } } if (bChannelOpen) DoPoliceRadioCrackle(); - if ((g_nMissionAudioSfx == TOTAL_AUDIO_SAMPLES || g_nMissionAudioPlayingStatus != 1) && + if ((g_nMissionAudioSfx == NO_SAMPLE || g_nMissionAudioPlayingStatus != 1) && !SampleManager.GetChannelUsedFlag(policeChannel) && m_sPoliceRadioQueue.policeChannelTimer) { if (m_sPoliceRadioQueue.policeChannelTimer) { sample = m_sPoliceRadioQueue.crimesSamples[m_sPoliceRadioQueue.policeChannelCounterSeconds]; m_sPoliceRadioQueue.policeChannelTimer--; m_sPoliceRadioQueue.policeChannelCounterSeconds = (m_sPoliceRadioQueue.policeChannelCounterSeconds + 1) % 60; } else { - sample = TOTAL_AUDIO_SAMPLES; + sample = NO_SAMPLE; } - if (!wantedLevel) { + if (wantedLevel == 0) { if (gSpecialSuspectLastSeenReport) { gSpecialSuspectLastSeenReport = 0; - } else if (sample == SFX_POLICE_RADIO_MESSAGE_NOISE_1 || sample == TOTAL_AUDIO_SAMPLES) { + } else if (sample == SFX_POLICE_RADIO_MESSAGE_NOISE_1) { bChannelOpen = false; processed = true; } } - if (sample == TOTAL_AUDIO_SAMPLES) { + if (sample == NO_SAMPLE) { if (!processed) cWait = 30; } else { SampleManager.InitialiseChannel(policeChannel, sample, 0); @@ -281,17 +284,28 @@ cAudioManager::SetupCrimeReport() for (int j = 0; j < NUMAUDIOZONES; j++) { if (strcmp(zone->name, ZoneSfx[j].m_aName) == 0) { sampleIndex = ZoneSfx[j].m_nSampleIndex; - m_sPoliceRadioQueue.Add(m_anRandomTable[4] % 3 + 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(SFX_A_10); switch (m_sPoliceRadioQueue.crimes[i].type) { - case CRIME_PED_BURNED: m_sPoliceRadioQueue.crimes[i].type = CRIME_HIT_PED; break; - case CRIME_COP_BURNED: m_sPoliceRadioQueue.crimes[i].type = CRIME_HIT_COP; break; + case CRIME_PED_BURNED: + case CRIME_HIT_PED_NASTYWEAPON: + m_sPoliceRadioQueue.crimes[i].type = CRIME_HIT_PED; + break; + case CRIME_COP_BURNED: + case CRIME_HIT_COP_NASTYWEAPON: + m_sPoliceRadioQueue.crimes[i].type = CRIME_HIT_COP; + break; case CRIME_VEHICLE_BURNED: m_sPoliceRadioQueue.crimes[i].type = CRIME_STEAL_CAR; break; case CRIME_DESTROYED_CESSNA: m_sPoliceRadioQueue.crimes[i].type = CRIME_SHOOT_HELI; break; + case CRIME_EXPLOSION: m_sPoliceRadioQueue.crimes[i].type = CRIME_STEAL_CAR; break; // huh? default: break; } +#ifdef FIX_BUGS m_sPoliceRadioQueue.Add(m_sPoliceRadioQueue.crimes[i].type + SFX_CRIME_1 - 1); +#else + m_sPoliceRadioQueue.Add(m_sPoliceRadioQueue.crimes[i].type + SFX_CRIME_1); +#endif m_sPoliceRadioQueue.Add(SFX_IN); rangeX = zone->maxx - zone->minx; rangeY = zone->maxy - zone->miny; @@ -316,8 +330,8 @@ cAudioManager::SetupCrimeReport() m_sPoliceRadioQueue.Add(SFX_CENTRAL); m_sPoliceRadioQueue.Add(sampleIndex); - m_sPoliceRadioQueue.Add(m_anRandomTable[2] % 3 + SFX_POLICE_RADIO_MESSAGE_NOISE_1); - m_sPoliceRadioQueue.Add(TOTAL_AUDIO_SAMPLES); + m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_MESSAGE_NOISE_1); + m_sPoliceRadioQueue.Add(NO_SAMPLE); break; } } @@ -339,161 +353,105 @@ cAudioManager::SetupSuspectLastSeenReport() int32 color_post_modifier; const int32 gCarColourTable[][3] = { - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_BLACK, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_WHITE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_BLUE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_RED, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_BLUE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_PURPLE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_YELLOW, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_BRIGHT, SFX_POLICE_RADIO_BLUE, TOTAL_AUDIO_SAMPLES}, + {NO_SAMPLE, SFX_POLICE_RADIO_BLACK, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_WHITE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_BLUE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_RED, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_BLUE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_PURPLE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_YELLOW, NO_SAMPLE}, + {SFX_POLICE_RADIO_BRIGHT, SFX_POLICE_RADIO_BLUE, NO_SAMPLE}, {SFX_POLICE_RADIO_LIGHT, SFX_POLICE_RADIO_BLUE, SFX_POLICE_RADIO_GREY}, -#ifdef FIX_BUGS - {SFX_POLICE_RADIO_LIGHT, SFX_POLICE_RADIO_RED, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_RED, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_RED, TOTAL_AUDIO_SAMPLES}, -#else - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, -#endif - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_RED, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_RED, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_RED, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_RED, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_RED, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_RED, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_RED, TOTAL_AUDIO_SAMPLES}, -#ifdef FIX_BUGS - {SFX_POLICE_RADIO_LIGHT, SFX_POLICE_RADIO_RED, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_ORANGE, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_ORANGE, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_ORANGE, TOTAL_AUDIO_SAMPLES}, -#else - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, -#endif - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_ORANGE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_ORANGE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_ORANGE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_ORANGE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_ORANGE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_ORANGE, TOTAL_AUDIO_SAMPLES}, -#ifdef FIX_BUGS - {SFX_POLICE_RADIO_LIGHT, SFX_POLICE_RADIO_ORANGE, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_YELLOW, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_YELLOW, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_YELLOW, TOTAL_AUDIO_SAMPLES}, -#else - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, -#endif - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_YELLOW, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_YELLOW, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_YELLOW, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_YELLOW, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_YELLOW, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_YELLOW, TOTAL_AUDIO_SAMPLES}, -#ifdef FIX_BUGS - {SFX_POLICE_RADIO_LIGHT, SFX_POLICE_RADIO_YELLOW, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_GREEN, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_GREEN, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_GREEN, TOTAL_AUDIO_SAMPLES}, -#else - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, -#endif - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_GREEN, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_GREEN, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_GREEN, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_GREEN, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_GREEN, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_GREEN, TOTAL_AUDIO_SAMPLES}, -#ifdef FIX_BUGS - {SFX_POLICE_RADIO_LIGHT, SFX_POLICE_RADIO_GREEN, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_BLUE, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_BLUE, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_BLUE, TOTAL_AUDIO_SAMPLES}, -#else - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, -#endif - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_BLUE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_BLUE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_BLUE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_BLUE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_BLUE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_BLUE, TOTAL_AUDIO_SAMPLES}, -#ifdef FIX_BUGS - {SFX_POLICE_RADIO_LIGHT, SFX_POLICE_RADIO_BLUE, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_PURPLE, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_PURPLE, SFX_POLICE_RADIO_BLUE}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_PURPLE, TOTAL_AUDIO_SAMPLES}, -#else - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, -#endif - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_PURPLE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_PURPLE, TOTAL_AUDIO_SAMPLES}, -#ifdef FIX_BUGS - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_PURPLE, SFX_POLICE_RADIO_GREY}, -#else - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_PURPLE, TOTAL_AUDIO_SAMPLES}, -#endif - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_PURPLE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_PURPLE, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_PURPLE, TOTAL_AUDIO_SAMPLES}, -#ifdef FIX_BUGS - {SFX_POLICE_RADIO_LIGHT, SFX_POLICE_RADIO_PURPLE, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_SILVER, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_SILVER, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_SILVER, TOTAL_AUDIO_SAMPLES}, -#else - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, -#endif - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_SILVER, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_SILVER, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_SILVER, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_SILVER, TOTAL_AUDIO_SAMPLES}, - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_SILVER, TOTAL_AUDIO_SAMPLES}, -#ifdef FIX_BUGS - {SFX_POLICE_RADIO_LIGHT, SFX_POLICE_RADIO_SILVER, TOTAL_AUDIO_SAMPLES}, -#else - {TOTAL_AUDIO_SAMPLES, SFX_POLICE_RADIO_SILVER, TOTAL_AUDIO_SAMPLES}, -#endif - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_LIGHT, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES}, - {SFX_POLICE_RADIO_DARK, TOTAL_AUDIO_SAMPLES, TOTAL_AUDIO_SAMPLES} + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, SFX_POLICE_RADIO_RED, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_RED, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_RED, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_RED, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_RED, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_RED, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_RED, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_ORANGE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_ORANGE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_ORANGE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_ORANGE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_ORANGE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_ORANGE, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_YELLOW, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_YELLOW, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_YELLOW, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_YELLOW, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_YELLOW, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_YELLOW, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_GREEN, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_GREEN, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_GREEN, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_GREEN, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_GREEN, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_GREEN, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_BLUE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_BLUE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_BLUE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_BLUE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_BLUE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_BLUE, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_PURPLE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_PURPLE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_PURPLE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_PURPLE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_PURPLE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_PURPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_SILVER, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_SILVER, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_SILVER, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_SILVER, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_SILVER, NO_SAMPLE}, + {NO_SAMPLE, SFX_POLICE_RADIO_SILVER, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_LIGHT, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE}, + {SFX_POLICE_RADIO_DARK, NO_SAMPLE, NO_SAMPLE} }; if (MusicManager.m_nMusicMode != MUSICMODE_CUTSCENE) { - veh = FindPlayerVehicle(); + veh = FindVehicleOfPlayer(); if (veh != nil) { if (60 - m_sPoliceRadioQueue.policeChannelTimer > 9) { color1 = veh->m_currentColour1; @@ -504,156 +462,213 @@ cAudioManager::SetupSuspectLastSeenReport() color_pre_modifier = gCarColourTable[color1][0]; color_post_modifier = gCarColourTable[color1][2]; switch (veh->GetModelIndex()) { -// TODO(MIAMI): just making this compile -#ifdef FIX_BUGS - // case MI_COLUMB: - // main_color = SFX_POLICE_RADIO_BLUE; - // color_pre_modifier = color_post_modifier = TOTAL_AUDIO_SAMPLES; -#endif case MI_LANDSTAL: - // case MI_BLISTA: - sample = SFX_POLICE_RADIO_CRUISER; break; -#ifdef FIX_BUGS - // case MI_YARDIE: - // color_pre_modifier = TOTAL_AUDIO_SAMPLES; - // main_color = SFX_POLICE_RADIO_RED; - // color_post_modifier = SFX_POLICE_RADIO_YELLOW; - // sample = SFX_POLICE_RADIO_CONVERTIBLE; break; - // case MI_DIABLOS: - // main_color = SFX_POLICE_RADIO_BLACK; -#endif + case MI_PATRIOT: + case MI_RANCHER: + case MI_FBIRANCH: + case MI_SANDKING: + sample = SFX_POLICE_RADIO_OFFROAD; + break; case MI_IDAHO: - // case MI_STALLION: sample = SFX_POLICE_RADIO_CONVERTIBLE; break; -#ifdef FIX_BUGS - // case MI_YAKUZA: - // color_pre_modifier = TOTAL_AUDIO_SAMPLES; - // main_color = SFX_POLICE_RADIO_SILVER; - // color_post_modifier = SFX_POLICE_RADIO_RED; -#endif + case MI_MANANA: + case MI_ESPERANT: + case MI_CUBAN: + case MI_STALLION: + case MI_SABRE: + case MI_SABRETUR: + case MI_VIRGO: + case MI_BLISTAC: + sample = SFX_POLICE_RADIO_2_DOOR; + break; case MI_STINGER: case MI_INFERNUS: case MI_CHEETAH: - case MI_BANSHEE: sample = SFX_POLICE_RADIO_SPORTS_CAR; break; -#ifdef FIX_BUGS - // case MI_MAFIA: - // color_pre_modifier = color_post_modifier = TOTAL_AUDIO_SAMPLES; - // main_color = SFX_POLICE_RADIO_GREY; - case MI_WASHING: -#endif + case MI_BANSHEE: + case MI_PHEONIX: + case MI_COMET: + case MI_DELUXO: + case MI_HOTRING: + sample = SFX_POLICE_RADIO_SPORTS_CAR; + break; + case MI_LINERUN: + sample = SFX_POLICE_RADIO_RIG; + break; case MI_PEREN: + case MI_REGINA: + sample = SFX_POLICE_RADIO_STATION_WAGON; + break; case MI_SENTINEL: - // case MI_FBICAR: sample = SFX_POLICE_RADIO_SALOON; break; - case MI_PATRIOT: - case MI_BOBCAT: sample = SFX_POLICE_RADIO_PICKUP; break; - case MI_FIRETRUCK: sample = SFX_POLICE_RADIO_FIRE_TRUCK; break; -#ifdef FIX_BUGS - case MI_LINERUN: - case MI_FLATBED: -#endif + case MI_FBICAR: + case MI_WASHING: + case MI_SENTXS: + case MI_ADMIRAL: + case MI_GLENDALE: + case MI_OCEANIC: + case MI_HERMES: + case MI_GREENWOO: + sample = SFX_POLICE_RADIO_SEDAN; + break; + case MI_RIO: + sample = SFX_POLICE_RADIO_CRUISER; + break; + case MI_FIRETRUCK: + sample = SFX_POLICE_RADIO_FIRE_TRUCK; + break; case MI_TRASH: - case MI_BARRACKS: sample = SFX_POLICE_RADIO_TRUCK; break; - // case MI_STRETCH: sample = SFX_POLICE_RADIO_LIMO; break; - case MI_MANANA: - case MI_ESPERANT: sample = SFX_POLICE_RADIO_2_DOOR; break; -#ifdef FIX_BUGS - // case MI_HOODS: - // color_pre_modifier = TOTAL_AUDIO_SAMPLES; - // main_color = SFX_POLICE_RADIO_BLUE; - // color_post_modifier = SFX_POLICE_RADIO_GREEN; - // case MI_BELLYUP: - case MI_YANKEE: - case MI_TOPFUN: - // case MI_MRWONGS: - // case MI_PANLANT: -#endif + sample = SFX_POLICE_RADIO_GARBAGE_TRUCK; + break; + case MI_STRETCH: + case MI_LOVEFIST: + sample = SFX_POLICE_RADIO_STRETCH; + break; + case MI_VOODOO: + sample = SFX_POLICE_RADIO_LOWRIDER; + break; case MI_PONY: - case MI_MULE: case MI_MOONBEAM: - case MI_ENFORCER: case MI_SECURICA: - case MI_RUMPO: sample = SFX_POLICE_RADIO_VAN; break; - case MI_AMBULAN: sample = SFX_POLICE_RADIO_AMBULANCE; break; + case MI_RUMPO: + case MI_GANGBUR: + case MI_YANKEE: + case MI_TOPFUN: + case MI_BURRITO: + case MI_SPAND: + sample = SFX_POLICE_RADIO_VAN; + break; + case MI_MULE: + case MI_BARRACKS: + case MI_PACKER: + case MI_FLATBED: + sample = SFX_POLICE_RADIO_TRUCK; + break; + case MI_AMBULAN: + sample = SFX_POLICE_RADIO_AMBULANCE; + break; case MI_TAXI: case MI_CABBIE: - case MI_ZEBRA: sample = SFX_POLICE_RADIO_TAXI; break; - case MI_KAUFMAN: sample = SFX_POLICE_RADIO_TAXI; break; + case MI_ZEBRA: + case MI_KAUFMAN: + sample = SFX_POLICE_RADIO_TAXI; + break; + case MI_BOBCAT: + case MI_WALTON: + sample = SFX_POLICE_RADIO_PICKUP; + break; case MI_MRWHOOP: sample = SFX_POLICE_RADIO_ICE_CREAM_VAN; break; - case MI_BFINJECT: sample = SFX_POLICE_RADIO_BUGGY; break; - case MI_POLICE: sample = SFX_POLICE_RADIO_POLICE_CAR; break; -#ifdef FIX_BUGS + case MI_BFINJECT: + sample = SFX_POLICE_RADIO_BUGGY; + break; + case MI_HUNTER: + case MI_CHOPPER: + case MI_SEASPAR: + case MI_SPARROW: + case MI_MAVERICK: + case MI_VCNMAV: + case MI_POLMAV: + sample = SFX_POLICE_RADIO_HELICOPTER; + break; + case MI_POLICE: + sample = SFX_POLICE_RADIO_POLICE_CAR; + break; + case MI_ENFORCER: + sample = SFX_POLICE_RADIO_SWAT_VAN; + break; + case MI_PREDATOR: + case MI_SQUALO: case MI_SPEEDER: - case MI_REEFER: - // case MI_GHOST: -#endif - case MI_PREDATOR: sample = SFX_POLICE_RADIO_BOAT; break; + sample = SFX_POLICE_RADIO_SPEEDBOAT; + break; case MI_BUS: - case MI_COACH: sample = SFX_POLICE_RADIO_BUS; break; + sample = SFX_POLICE_RADIO_BUS; + break; case MI_RHINO: sample = SFX_POLICE_RADIO_TANK; - main_color = TOTAL_AUDIO_SAMPLES; - color_post_modifier = TOTAL_AUDIO_SAMPLES; break; - // case MI_TRAIN: - // sample = SFX_POLICE_RADIO_SUBWAY_CAR; - // main_color = TOTAL_AUDIO_SAMPLES; - // color_post_modifier = TOTAL_AUDIO_SAMPLES; - - // break; + case MI_ANGEL: + case MI_PCJ600: + case MI_FREEWAY: + case MI_SANCHEZ: + sample = SFX_POLICE_RADIO_MOTOBIKE; + break; + case MI_COACH: + sample = SFX_POLICE_RADIO_COACH; + break; + case MI_ROMERO: + sample = SFX_POLICE_RADIO_HEARSE; + break; + case MI_PIZZABOY: + case MI_FAGGIO: + sample = SFX_POLICE_RADIO_MOPED; + break; + case MI_DEADDODO: + case MI_SKIMMER: + sample = SFX_POLICE_RADIO_PLANE; + break; + case MI_REEFER: + case MI_TROPIC: + case MI_COASTG: + case MI_MARQUIS: + case MI_JETMAX: + sample = SFX_POLICE_RADIO_BOAT; + break; + case MI_CADDY: + sample = SFX_POLICE_RADIO_GOLF_CART; + break; + case MI_DINGHY: + sample = SFX_POLICE_RADIO_DINGHY; + break; default: - debug("\n *** UNKNOWN CAR MODEL INDEX %d *** ", veh->GetModelIndex()); + //debug("\n *** UNKNOWN CAR MODEL INDEX %d *** ", veh->GetModelIndex()); return; } - m_sPoliceRadioQueue.Add(m_anRandomTable[4] % 3 + SFX_POLICE_RADIO_MESSAGE_NOISE_1); + m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_MESSAGE_NOISE_1); m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_SUSPECT); if (m_anRandomTable[3] % 2) m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_LAST_SEEN); m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_IN_A); - if (color_pre_modifier != TOTAL_AUDIO_SAMPLES) + if (color_pre_modifier != NO_SAMPLE) m_sPoliceRadioQueue.Add(color_pre_modifier); - if (main_color != TOTAL_AUDIO_SAMPLES) + if (main_color != NO_SAMPLE) m_sPoliceRadioQueue.Add(main_color); - if (color_post_modifier != TOTAL_AUDIO_SAMPLES) + if (color_post_modifier != NO_SAMPLE) m_sPoliceRadioQueue.Add(color_post_modifier); m_sPoliceRadioQueue.Add(sample); - m_sPoliceRadioQueue.Add(m_anRandomTable[0] % 3 + SFX_POLICE_RADIO_MESSAGE_NOISE_1); - m_sPoliceRadioQueue.Add(TOTAL_AUDIO_SAMPLES); + m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_MESSAGE_NOISE_1); + m_sPoliceRadioQueue.Add(NO_SAMPLE); } } } else if (60 - m_sPoliceRadioQueue.policeChannelTimer > 4) { m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_MESSAGE_NOISE_1); m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_SUSPECT); m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_ON_FOOT); - m_sPoliceRadioQueue.Add(m_anRandomTable[0] % 3 + SFX_POLICE_RADIO_MESSAGE_NOISE_1); - m_sPoliceRadioQueue.Add(TOTAL_AUDIO_SAMPLES); + m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_MESSAGE_NOISE_1); + m_sPoliceRadioQueue.Add(NO_SAMPLE); } } } - - void -cAudioManager::ReportCrime(int32 type, const CVector *pos) +cAudioManager::ReportCrime(eCrimeType type, const CVector &pos) { int32 lastCrime = ARRAY_SIZE(m_sPoliceRadioQueue.crimes); if (m_bIsInitialised && MusicManager.m_nMusicMode != MUSICMODE_CUTSCENE && FindPlayerPed()->m_pWanted->m_nWantedLevel > 0 && (type > CRIME_NONE || type < NUM_CRIME_TYPES) && m_FrameCounter >= gMinTimeToNextReport[type]) { for (int32 i = 0; i < ARRAY_SIZE(m_sPoliceRadioQueue.crimes); i++) { - if (m_sPoliceRadioQueue.crimes[i].type) { + if (m_sPoliceRadioQueue.crimes[i].type != CRIME_NONE) { if (m_sPoliceRadioQueue.crimes[i].type == type) { - m_sPoliceRadioQueue.crimes[i].position = *pos; + m_sPoliceRadioQueue.crimes[i].position = pos; m_sPoliceRadioQueue.crimes[i].timer = 0; return; } - } else { + } else lastCrime = i; - } } if (lastCrime < ARRAY_SIZE(m_sPoliceRadioQueue.crimes)) { m_sPoliceRadioQueue.crimes[lastCrime].type = type; - m_sPoliceRadioQueue.crimes[lastCrime].position = *pos; + m_sPoliceRadioQueue.crimes[lastCrime].position = pos; m_sPoliceRadioQueue.crimes[lastCrime].timer = 0; gMinTimeToNextReport[type] = m_FrameCounter + 500; } @@ -684,7 +699,7 @@ cAudioManager::PlaySuspectLastSeen(float x, float y, float z) for (int i = 0; i < NUMAUDIOZONES; i++) { if (strcmp(zone->name, ZoneSfx[i].m_aName) == 0) { sample = ZoneSfx[i].m_nSampleIndex; - m_sPoliceRadioQueue.Add(m_anRandomTable[4] % 3 + 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_LAST_SEEN); m_sPoliceRadioQueue.Add(SFX_IN); @@ -710,8 +725,8 @@ cAudioManager::PlaySuspectLastSeen(float x, float y, float z) else if (!processed) m_sPoliceRadioQueue.Add(SFX_CENTRAL); m_sPoliceRadioQueue.Add(sample); - m_sPoliceRadioQueue.Add(m_anRandomTable[2] % 3 + SFX_POLICE_RADIO_MESSAGE_NOISE_1); - m_sPoliceRadioQueue.Add(TOTAL_AUDIO_SAMPLES); + m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_MESSAGE_NOISE_1); + m_sPoliceRadioQueue.Add(NO_SAMPLE); gSpecialSuspectLastSeenReport = true; break; } diff --git a/src/audio/oal/stream.cpp b/src/audio/oal/stream.cpp index 58b5dc02..06a38c29 100644 --- a/src/audio/oal/stream.cpp +++ b/src/audio/oal/stream.cpp @@ -202,7 +202,7 @@ public: if (m_FileH) { m_nChannels = op_head(m_FileH, 0)->channel_count; - m_nRate = op_head(m_FileH, 0)->input_sample_rate; + m_nRate = 48000; const OpusTags *tags = op_tags(m_FileH, 0); for (int i = 0; i < tags->comments; i++) { if (strncmp(tags->user_comments[i], "SAMPLERATE", sizeof("SAMPLERATE")-1) == 0) diff --git a/src/audio/soundlist.h b/src/audio/soundlist.h index bc5d3ba9..973a1585 100644 --- a/src/audio/soundlist.h +++ b/src/audio/soundlist.h @@ -142,7 +142,7 @@ enum eSound : uint16 SOUND_PED_TAXI_WAIT, SOUND_PED_ATTACK, SOUND_PED_DEFEND, - SOUND_140, + SOUND_PED_HEALING, SOUND_PED_LEAVE_VEHICLE, SOUND_PED_EVADE, SOUND_PED_FLEE_RUN, @@ -212,123 +212,63 @@ enum eSound : uint16 enum eScriptSounds : uint16 { - SCRIPT_SOUND_0 = 0, - SCRIPT_SOUND_1, - SCRIPT_SOUND_2, - SCRIPT_SOUND_3, - SCRIPT_SOUND_PARTY_1_LOOP_S, - SCRIPT_SOUND_PARTY_1_LOOP_L, - SCRIPT_SOUND_PARTY_2_LOOP_S, - SCRIPT_SOUND_PARTY_2_LOOP_L, - SCRIPT_SOUND_PARTY_3_LOOP_S, - SCRIPT_SOUND_PARTY_3_LOOP_L, - SCRIPT_SOUND_PARTY_4_LOOP_S, - SCRIPT_SOUND_PARTY_4_LOOP_L, - SCRIPT_SOUND_PARTY_5_LOOP_S, - SCRIPT_SOUND_PARTY_5_LOOP_L, - SCRIPT_SOUND_PARTY_6_LOOP_S, - SCRIPT_SOUND_PARTY_6_LOOP_L, - SCRIPT_SOUND_PARTY_7_LOOP_S, - SCRIPT_SOUND_PARTY_7_LOOP_L, - SCRIPT_SOUND_PARTY_8_LOOP_S, - SCRIPT_SOUND_PARTY_8_LOOP_L, - SCRIPT_SOUND_PARTY_9_LOOP_S, - SCRIPT_SOUND_PARTY_9_LOOP_L, - SCRIPT_SOUND_PARTY_10_LOOP_S, - SCRIPT_SOUND_PARTY_10_LOOP_L, - SCRIPT_SOUND_PARTY_11_LOOP_S, - SCRIPT_SOUND_PARTY_11_LOOP_L, - SCRIPT_SOUND_PARTY_12_LOOP_S, - SCRIPT_SOUND_PARTY_12_LOOP_L, - SCRIPT_SOUND_PARTY_13_LOOP_S, - SCRIPT_SOUND_PARTY_13_LOOP_L, - SCRIPT_SOUND_STRIP_CLUB_LOOP_1_S, - SCRIPT_SOUND_STRIP_CLUB_LOOP_1_L, - SCRIPT_SOUND_STRIP_CLUB_LOOP_2_S, - SCRIPT_SOUND_STRIP_CLUB_LOOP_2_L, - SCRIPT_SOUND_WORK_SHOP_LOOP_S, - SCRIPT_SOUND_WORK_SHOP_LOOP_L, - SCRIPT_SOUND_SAWMILL_LOOP_S, - SCRIPT_SOUND_SAWMILL_LOOP_L, - SCRIPT_SOUND_38, - SCRIPT_SOUND_39, - - // MIAMI: only these are true so far - SCRIPT_SOUND_MALIBU_1, - SCRIPT_SOUND_MALIBU_2, - SCRIPT_SOUND_MALIBU_3, - SCRIPT_SOUND_STRIPCLUB_1, - SCRIPT_SOUND_STRIPCLUB_2, - SCRIPT_SOUND_STRIPCLUB_3, - - SCRIPT_SOUND_46_S, - SCRIPT_SOUND_47_L, - SCRIPT_SOUND_MARCO_BISTRO_S, - SCRIPT_SOUND_MARCO_BISTRO_L, - SCRIPT_SOUND_AIRPORT_LOOP_S, - SCRIPT_SOUND_AIRPORT_LOOP_L, - SCRIPT_SOUND_SHOP_LOOP_S, - SCRIPT_SOUND_SHOP_LOOP_L, - SCRIPT_SOUND_CINEMA_LOOP_S, - SCRIPT_SOUND_CINEMA_LOOP_L, - SCRIPT_SOUND_DOCKS_LOOP_S, - SCRIPT_SOUND_DOCKS_LOOP_L, - SCRIPT_SOUND_HOME_LOOP_S, - SCRIPT_SOUND_HOME_LOOP_L, - SCRIPT_SOUND_FRANKIE_PIANO, - SCRIPT_SOUND_PARTY_1_LOOP, - SCRIPT_SOUND_PORN_CINEMA_1_S, - SCRIPT_SOUND_PORN_CINEMA_1_L, - SCRIPT_SOUND_PORN_CINEMA_2_S, - SCRIPT_SOUND_PORN_CINEMA_2_L, - SCRIPT_SOUND_PORN_CINEMA_3_S, - SCRIPT_SOUND_PORN_CINEMA_3_L, - SCRIPT_SOUND_BANK_ALARM_LOOP_S, - SCRIPT_SOUND_BANK_ALARM_LOOP_L, - SCRIPT_SOUND_POLICE_BALL_LOOP_S, - SCRIPT_SOUND_POLICE_BALL_LOOP_L, - SCRIPT_SOUND_RAVE_LOOP_INDUSTRIAL_S, - SCRIPT_SOUND_RAVE_LOOP_INDUSTRIAL_L, - SCRIPT_SOUND_74, - SCRIPT_SOUND_75, - SCRIPT_SOUND_POLICE_CELL_BEATING_LOOP_S, - SCRIPT_SOUND_POLICE_CELL_BEATING_LOOP_L, - SCRIPT_SOUND_INJURED_PED_MALE_OUCH_S, - SCRIPT_SOUND_INJURED_PED_MALE_OUCH_L, - SCRIPT_SOUND_INJURED_PED_FEMALE_OUCH_S, - SCRIPT_SOUND_INJURED_PED_FEMALE_OUCH_L, - SCRIPT_SOUND_EVIDENCE_PICKUP, - SCRIPT_SOUND_UNLOAD_GOLD, - SCRIPT_SOUND_RAVE_1_LOOP_S, - SCRIPT_SOUND_RAVE_1_LOOP_L, - SCRIPT_SOUND_RAVE_2_LOOP_S, - SCRIPT_SOUND_RAVE_2_LOOP_L, - SCRIPT_SOUND_RAVE_3_LOOP_S, - SCRIPT_SOUND_RAVE_3_LOOP_L, - SCRIPT_SOUND_MISTY_SEX_S, - SCRIPT_SOUND_MISTY_SEX_L, - SCRIPT_SOUND_GATE_START_CLUNK, - SCRIPT_SOUND_GATE_STOP_CLUNK, + SCRIPT_SOUND_BANK_ALARM_LOOP = 0, SCRIPT_SOUND_PART_MISSION_COMPLETE, - SCRIPT_SOUND_CHUNKY_RUN_SHOUT, - SCRIPT_SOUND_SECURITY_GUARD_AWAY_SHOUT, + SCRIPT_SOUND_POLICE_CELL_DOOR_SLIDING_LOOP, + SCRIPT_SOUND_POLICE_CELL_DOOR_CLUNK, + SCRIPT_SOUND_GARAGE_DOOR_SLIDING_LOOP, + SCRIPT_SOUND_GARAGE_DOOR_CLUNK, + SCRIPT_SOUND_SNORING_LOOP, SCRIPT_SOUND_RACE_START_3, SCRIPT_SOUND_RACE_START_2, SCRIPT_SOUND_RACE_START_1, SCRIPT_SOUND_RACE_START_GO, - SCRIPT_SOUND_SWAT_PED_SHOUT, - SCRIPT_SOUND_PRETEND_FIRE_LOOP, - SCRIPT_SOUND_AMMUNATION_CHAT_1, - SCRIPT_SOUND_AMMUNATION_CHAT_2, - SCRIPT_SOUND_AMMUNATION_CHAT_3, + SCRIPT_SOUND_SHOOTING_RANGE_TARGET_MOVING_LOOP, + SCRIPT_SOUND_SHOOTING_RANGE_TARGET_HIT, + SCRIPT_SOUND_AMMUNATION_BUY_WEAPON, + SCRIPT_SOUND_AMMUNATION_BUY_WEAPON_DENIED, + SCRIPT_SOUND_WMYCW_TICKET_SPEECH, + SCRIPT_SOUND_IMRAN_ARM_BOMB, + SCRIPT_SOUND_ANDY_SNIPER_SHOT, + SCRIPT_SOUND_WILLIE_CARD_SWIPE, + SCRIPT_SOUND_MALE_AMBULANCE_OUCH, + SCRIPT_SOUND_FEMALE_AMBULANCE_OUCH, + SCRIPT_SOUND_BUILDING_BAR_1, + SCRIPT_SOUND_BUILDING_BAR_2, + SCRIPT_SOUND_BUILDING_BAR_3, + SCRIPT_SOUND_BUILDING_BAR_4, + SCRIPT_SOUND_BUILDING_BIKER_BAR, + SCRIPT_SOUND_BUILDING_CHURCH, + SCRIPT_SOUND_BUILDING_CLUB, + SCRIPT_SOUND_BUILDING_CUBA_1, + SCRIPT_SOUND_BUILDING_CUBA_2, + SCRIPT_SOUND_BUILDING_VOODOO, + SCRIPT_SOUND_BUILDING_MUSIC_SHOP, + SCRIPT_SOUND_BUILDING_STRIPCLUB_1, + SCRIPT_SOUND_BUILDING_STRIPCLUB_2, + SCRIPT_SOUND_BUILDING_SUPERSWEEP, + SCRIPT_SOUND_SEAPLANE_LOW_FUEL, + SCRIPT_SOUND_NEW_BUILDING_BAR_1, + SCRIPT_SOUND_NEW_BUILDING_BAR_2, + SCRIPT_SOUND_NEW_BUILDING_BAR_3, + SCRIPT_SOUND_NEW_BUILDING_BAR_4, + SCRIPT_SOUND_NEW_BUILDING_MALIBU_1, + SCRIPT_SOUND_NEW_BUILDING_MALIBU_2, + SCRIPT_SOUND_NEW_BUILDING_MALIBU_3, + SCRIPT_SOUND_NEW_BUILDING_STRIP_1, + SCRIPT_SOUND_NEW_BUILDING_STRIP_2, + SCRIPT_SOUND_NEW_BUILDING_STRIP_3, + SCRIPT_SOUND_NEW_BUILDING_CHURCH, + SCRIPT_SOUND_NEW_BUILDING_FAN_1, + SCRIPT_SOUND_NEW_BUILDING_FAN_2, + SCRIPT_SOUND_NEW_BUILDING_INSECT_1, + SCRIPT_SOUND_NEW_BUILDING_INSECT_2, + SCRIPT_SOUND_NEW_WATERFALL, SCRIPT_SOUND_BULLET_HIT_GROUND_1, SCRIPT_SOUND_BULLET_HIT_GROUND_2, SCRIPT_SOUND_BULLET_HIT_GROUND_3, SCRIPT_SOUND_BULLET_HIT_WATER, // no sound - SCRIPT_SOUND_TRAIN_ANNOUNCEMENT_1, - SCRIPT_SOUND_TRAIN_ANNOUNCEMENT_2, SCRIPT_SOUND_PAYPHONE_RINGING, - SCRIPT_SOUND_113, SCRIPT_SOUND_GLASS_BREAK_L, SCRIPT_SOUND_GLASS_BREAK_S, SCRIPT_SOUND_GLASS_CRACK, @@ -337,6 +277,7 @@ enum eScriptSounds : uint16 { SCRIPT_SOUND_BOX_DESTROYED_2, SCRIPT_SOUND_METAL_COLLISION, SCRIPT_SOUND_TIRE_COLLISION, + SCRIPT_SOUND_HIT_BALL, SCRIPT_SOUND_GUNSHELL_DROP, SCRIPT_SOUND_GUNSHELL_DROP_SOFT, SCRIPT_SOUND_TOTAL, diff --git a/src/control/Script.cpp b/src/control/Script.cpp index 8b046bf2..86c9e86e 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -1817,7 +1817,7 @@ void CMissionCleanup::Process() CStreaming::SetMissionDoesntRequireModel(MI_CUTOBJ01 + i); CStreaming::ms_disableStreaming = false; CHud::m_ItemToFlash = -1; - CHud::SetHelpMessage(nil, false); // TODO(MIAMI): third parameter is false + CHud::SetHelpMessage(nil, false); CUserDisplay::OnscnTimer.m_bDisabled = false; CTheScripts::RemoveScriptTextureDictionary(); CWorld::Players[0].m_pPed->m_pWanted->m_bIgnoredByCops = false; @@ -5387,22 +5387,7 @@ int8 CRunningScript::ProcessCommands300To399(int32 command) case COMMAND_ADD_ONE_OFF_SOUND: { CollectParameters(&m_nIp, 4); - // TODO(MIAMI) - // SOUND_PART_MISSION_COMPLETE == 1 - // SOUND_RACE_START_3 == 7 - // SOUND_RACE_START_2 == 8 - // SOUND_RACE_START_1 == 9 - // SOUND_RACE_START_GO == 10 - // SOUND_AMMUNATION_BUY_WEAPON == 13 - // SOUND_AMMUNATION_BUY_WEAPON_DENIED == 14 - // SOUND_AMMUNATION_IMRAN_ARM_BOMB == 16 switch (ScriptParams[3]) { - case SCRIPT_SOUND_EVIDENCE_PICKUP: - DMAudio.PlayFrontEndSound(SOUND_EVIDENCE_PICKUP, 0); - return 0; - case SCRIPT_SOUND_UNLOAD_GOLD: - DMAudio.PlayFrontEndSound(SOUND_UNLOAD_GOLD, 0); - return 0; case SCRIPT_SOUND_PART_MISSION_COMPLETE: DMAudio.PlayFrontEndSound(SOUND_PART_MISSION_COMPLETE, 0); return 0; @@ -5418,6 +5403,15 @@ int8 CRunningScript::ProcessCommands300To399(int32 command) case SCRIPT_SOUND_RACE_START_GO: DMAudio.PlayFrontEndSound(SOUND_RACE_START_GO, 0); return 0; + case SCRIPT_SOUND_AMMUNATION_BUY_WEAPON: + DMAudio.PlayFrontEndSound(SOUND_PICKUP_WEAPON_BOUGHT, 0); + return 0; + case SCRIPT_SOUND_AMMUNATION_BUY_WEAPON_DENIED: + DMAudio.PlayFrontEndSound(SOUND_GARAGE_NO_MONEY, 0); + return 0; + case SCRIPT_SOUND_IMRAN_ARM_BOMB: + DMAudio.PlayFrontEndSound(SOUND_AMMUNATION_IMRAN_ARM_BOMB, 0); + return 0; default: break; } @@ -8763,11 +8757,11 @@ int8 CRunningScript::ProcessCommands800To899(int32 command) } case COMMAND_INDUSTRIAL_PASSED: CStats::IndustrialPassed = true; - DMAudio.PlayRadioAnnouncement(13); //TODO: enum? + DMAudio.PlayRadioAnnouncement(STREAMED_SOUND_ANNOUNCE_COMMERCIAL_OPEN); return 0; case COMMAND_COMMERCIAL_PASSED: CStats::CommercialPassed = true; - DMAudio.PlayRadioAnnouncement(14); //TODO: enum? + DMAudio.PlayRadioAnnouncement(STREAMED_SOUND_ANNOUNCE_SUBURBAN_OPEN); return 0; case COMMAND_SUBURBAN_PASSED: CStats::SuburbanPassed = true; @@ -12909,7 +12903,7 @@ int8 CRunningScript::ProcessCommands1200To1299(int32 command) case COMMAND_PRINT_HELP_FOREVER: { wchar* text = CTheScripts::GetTextByKeyFromScript(&m_nIp); - CHud::SetHelpMessage(text, false); // TODO(MIAMI): third param is true + CHud::SetHelpMessage(text, false, true); return 0; } //case COMMAND_PRINT_HELP_FOREVER_WITH_NUMBER: diff --git a/src/core/Game.h b/src/core/Game.h index 67d83c00..ee9ca943 100644 --- a/src/core/Game.h +++ b/src/core/Game.h @@ -4,7 +4,9 @@ enum eLevelName { LEVEL_IGNORE = -1, // beware, this is only used in CPhysical's m_nZoneLevel LEVEL_GENERIC = 0, LEVEL_BEACH, - LEVEL_MAINLAND + LEVEL_MAINLAND, + + NUM_LEVELS }; enum eAreaName { diff --git a/src/core/Pad.h b/src/core/Pad.h index 01f5bb9b..9f9f81b6 100644 --- a/src/core/Pad.h +++ b/src/core/Pad.h @@ -436,6 +436,7 @@ public: bool GetLeftShockJustDown() { return !!(NewState.LeftShock && !OldState.LeftShock); } bool GetRightShockJustDown() { return !!(NewState.RightShock && !OldState.RightShock); } bool GetStartJustDown() { return !!(NewState.Start && !OldState.Start); } + bool GetSelectJustDown() { return !!(NewState.Select && !OldState.Select); } bool GetLeftStickXJustDown() { return !!(NewState.LeftStickX && !OldState.LeftStickX); } bool GetLeftStickYJustDown() { return !!(NewState.LeftStickY && !OldState.LeftStickY); } @@ -461,6 +462,7 @@ public: bool GetRightShoulder1(void) { return !!NewState.RightShoulder1; } bool GetRightShoulder2(void) { return !!NewState.RightShoulder2; } bool GetStart() { return !!NewState.Start; } + bool GetSelect() { return !!NewState.Select; } int16 GetLeftStickX(void) { return NewState.LeftStickX; } int16 GetLeftStickY(void) { return NewState.LeftStickY; } int16 GetRightStickX(void) { return NewState.RightStickX; } @@ -478,4 +480,4 @@ public: }; VALIDATE_SIZE(CPad, 0xFC); -extern CPad Pads[MAX_PADS];
\ No newline at end of file +extern CPad Pads[MAX_PADS]; diff --git a/src/core/TempColModels.cpp b/src/core/TempColModels.cpp index e12b48dd..203d24d0 100644 --- a/src/core/TempColModels.cpp +++ b/src/core/TempColModels.cpp @@ -22,7 +22,11 @@ CColModel CTempColModels::ms_colModelWeapon; CColSphere s_aPedSpheres[3]; CColSphere s_aPed2Spheres[3]; CColSphere s_aPedGSpheres[4]; +#ifdef FIX_BUGS +CColSphere s_aDoorSpheres[3]; +#else CColSphere s_aDoorSpheres[4]; +#endif CColSphere s_aBumperSpheres[4]; CColSphere s_aPanelSpheres[4]; CColSphere s_aBonnetSpheres[4]; @@ -130,7 +134,11 @@ CTempColModels::Initialise(void) s_aDoorSpheres[1].center = CVector(0.0f, -0.95f, -0.35f); s_aDoorSpheres[2].center = CVector(0.0f, -0.6f, 0.25f); +#ifdef FIX_BUGS for (i = 0; i < ARRAY_SIZE(s_aDoorSpheres); i++) { +#else + for (i = 0; i < ARRAY_SIZE(s_aPed2Spheres); i++) { +#endif s_aDoorSpheres[i].surface = SURFACE_CAR_PANEL; s_aDoorSpheres[i].piece = 0; } @@ -286,9 +294,13 @@ CTempColModels::Initialise(void) SET_COLMODEL_SPHERES(ms_colModelBodyPart2, s_aBodyPartSpheres2); - - ms_colModelWeapon.boundingSphere.Set(0.25f, CVector(0.0f, 0.0f, 0.0f)); - ms_colModelWeapon.boundingBox.Set(CVector(-0.25f, -0.25, -0.25f), CVector(0.25f, 0.25, 0.25f)); + ms_colModelWeapon.boundingSphere.radius = 0.25f; + ms_colModelWeapon.boundingBox.min.x = -0.25f; + ms_colModelWeapon.boundingBox.min.y = -0.25f; + ms_colModelWeapon.boundingBox.min.z = -0.25f; + ms_colModelWeapon.boundingBox.max.x = 0.25f; + ms_colModelWeapon.boundingBox.max.y = 0.25f; + ms_colModelWeapon.boundingBox.max.z = 0.25f; #undef SET_COLMODEL_SPHERES } diff --git a/src/core/Timer.cpp b/src/core/Timer.cpp index 5adc36b5..bdef6187 100644 --- a/src/core/Timer.cpp +++ b/src/core/Timer.cpp @@ -7,6 +7,8 @@ #include "Timer.h" #include "SpecialFX.h" +// --MIAMI: file done + uint32 CTimer::m_snTimeInMilliseconds; PauseModeTime CTimer::m_snTimeInMillisecondsPauseMode = 1; @@ -96,7 +98,7 @@ void CTimer::Update(void) _oldPerfCounter = pc; - float updInCyclesScaled = updInCycles * ms_fTimeScale; + float updInCyclesScaled = GetIsPaused() ? updInCycles : updInCycles * ms_fTimeScale; // We need that real frame time to fix transparent menu bug. #ifndef FIX_HIGH_FPS_BUGS_ON_FRONTEND diff --git a/src/core/Zones.h b/src/core/Zones.h index 3a74427d..5306d9f1 100644 --- a/src/core/Zones.h +++ b/src/core/Zones.h @@ -77,7 +77,7 @@ public: static CZone *GetInfoZone(uint16 i) { return &InfoZoneArray[i]; } static CZone *GetNavigationZone(uint16 i) { return &NavigationZoneArray[i]; } static CZone *GetMapZone(uint16 i) { return &MapZoneArray[i]; } - static CZone *GetAudioZone(uint16 i) { return &InfoZoneArray[AudioZoneArray[i]]; } + static CZone *GetAudioZone(uint16 i) { return &NavigationZoneArray[AudioZoneArray[i]]; } static void PostZoneCreation(void); static void CheckZonesForOverlap(void); static void InsertZoneIntoZoneHierarchy(CZone *zone); diff --git a/src/core/config.h b/src/core/config.h index 770a7c2e..0ef921ca 100644 --- a/src/core/config.h +++ b/src/core/config.h @@ -23,7 +23,7 @@ enum Config { MAXVEHICLESLOADED = 50, // 70 on mobile - NUMOBJECTINFO = 400, // TODO(MIAMI): fantasy // object.dat + NUMOBJECTINFO = 210, // Pool sizes NUMPTRNODES = 50000, diff --git a/src/core/main.cpp b/src/core/main.cpp index fa5a5000..012dda2e 100644 --- a/src/core/main.cpp +++ b/src/core/main.cpp @@ -644,7 +644,7 @@ ProcessSlowMode(void) do { - if ( CPad::GetPad(1)->GetLeftShoulder1JustDown() || CPad::GetPad(1)->GetRightShoulder1() ) + if ( CPad::GetPad(1)->GetSelectJustDown() || CPad::GetPad(1)->GetStart() ) break; if ( stop ) @@ -658,10 +658,7 @@ ProcessSlowMode(void) RwCameraBeginUpdate(Scene.camera); RwCameraEndUpdate(Scene.camera); - if ( CPad::GetPad(1)->GetLeftShoulder1JustDown() || CPad::GetPad(1)->GetRightShoulder1() ) - break; - - } while (!CPad::GetPad(1)->GetRightShoulder1()); + } while (!CPad::GetPad(1)->GetSelectJustDown() && !CPad::GetPad(1)->GetStart()); CPad::GetPad(0)->OldState.LeftStickX = lX; @@ -714,22 +711,32 @@ int32 FrameSamples; struct tZonePrint { - char name[12]; - CRect rect; + char name[11]; + char area[5]; + CRect rect; }; tZonePrint ZonePrint[] = { - { "suburban", CRect(-1639.4f, 1014.3f, -226.23f, -1347.9f) }, - { "comntop", CRect(-223.52f, 203.62f, 616.79f, -413.6f) }, - { "comnbtm", CRect(-227.24f, -413.6f, 620.51f, -911.84f) }, - { "comse", CRect( 200.35f, -911.84f, 620.51f, -1737.3f) }, - { "comsw", CRect(-223.52f, -911.84f, 200.35f, -1737.3f) }, - { "industsw", CRect( 744.05f, -473.0f, 1067.5f, -1331.5f) }, - { "industne", CRect( 1067.5f, 282.19f, 1915.3f, -473.0f) }, - { "industnw", CRect( 744.05f, 324.95f, 1067.5f, -473.0f) }, - { "industse", CRect( 1070.3f, -473.0f, 1918.1f, -1331.5f) }, - { "no zone", CRect( 0.0f, 0.0f, 0.0f, 0.0f) } + { "DOWNTOWN", "GM", CRect(-1500.0f, 1500.0f, -300.0f, 980.0f)}, + { "DOWNTOWS", "KB", CRect(-1200.0f, 980.0f, -300.0f, 435.0f)}, + { "GOLF", "NT", CRect(-300.0f, 660.0f, 320.0f, -255.0f)}, + { "LITTLEHA", "AG", CRect(-1250.0f, -310.0f, -746.0f, -926.0f)}, + { "HAITI", "CJ", CRect(-1355.0f, 30.0f, -637.0f, -304.0f)}, + { "HAITIN", "SM", CRect(-1355.0f, 435.0f, -637.0f, 30.0f)}, + { "DOCKS", "AW", CRect(-1122.0f, -926.0f, -609.0f, -1575.0f)}, + { "AIRPORT", "NT", CRect(-2000.0f, 200.0f, -871.0f, -2000.0f)}, + { "STARISL", "CJ", CRect(-724.0f, -320.0f, -40.0f, -380.0f)}, + { "CENT.ISLA", "NT", CRect(-163.0f, 1260.0f, 120.0f, 830.0f)}, + { "MALL", "AW", CRect( 300.0f, 1266.0f, 483.0f, 995.0f)}, + { "MANSION", "KB", CRect(-724.0f, -500.0f, -40.0f, -670.0f)}, + { "NBEACH", "AS", CRect( 120.0f, 1340.0f, 900.0f, 600.0f)}, + { "NBEACHBT", "AS", CRect( 200.0f, 680.0f, 660.0f, -50.0f)}, + { "NBEACHW", "AS", CRect(-93.0f, 80.0f, 410.0f, -680.0f)}, + { "OCEANDRV", "AC", CRect( 200.0f, -964.0f, 955.0f, -1797.0f)}, + { "OCEANDN", "WS", CRect( 400.0f, 50.0f, 955.0f, -964.0f)}, + { "WASHINGTN", "AC", CRect(-320.0f, -487.0f, 500.0f, -1200.0f)}, + { "WASHINBTM", "AC", CRect(-255.0f, -1200.0f, 500.0f, -1690.0f)} }; #ifndef MASTER @@ -737,14 +744,12 @@ void DisplayGameDebugText() { static bool bDisplayPosn = false; - static bool bDisplayRate = false; - static bool bDisplayCheatStr = false; + static bool bDisplayCheatStr = false; // custom #ifndef FINAL { SETTWEAKPATH("GameDebugText"); TWEAKBOOL(bDisplayPosn); - TWEAKBOOL(bDisplayRate); TWEAKBOOL(bDisplayCheatStr); } #endif @@ -777,23 +782,8 @@ DisplayGameDebugText() FramesPerSecondCounter = 0.0f; FrameSamples = 0; } - - if ( !TheCamera.WorldViewerBeingUsed - && CPad::GetPad(1)->GetSquare() - && CPad::GetPad(1)->GetTriangle() - && CPad::GetPad(1)->GetLeftShoulder2JustDown() ) - { - bDisplayPosn = !bDisplayPosn; - } - if ( CPad::GetPad(1)->GetSquare() - && CPad::GetPad(1)->GetTriangle() - && CPad::GetPad(1)->GetRightShoulder2JustDown() ) - { - bDisplayRate = !bDisplayRate; - } - - if ( bDisplayPosn || bDisplayRate ) + if ( bDisplayPosn ) { CVector pos = FindPlayerCoors(); int32 ZoneId = ARRAY_SIZE(ZonePrint)-1; // no zone @@ -810,43 +800,42 @@ DisplayGameDebugText() } //NOTE: fps should be 30, but its 29 due to different fp2int conversion - if ( bDisplayRate ) - sprintf(str, "X:%5.1f, Y:%5.1f, Z:%5.1f, F-%d, %s", pos.x, pos.y, pos.z, (int32)FramesPerSecond, ZonePrint[ZoneId].name); - else - sprintf(str, "X:%5.1f, Y:%5.1f, Z:%5.1f, %s", pos.x, pos.y, pos.z, ZonePrint[ZoneId].name); - + sprintf(str, "X:%4.0f Y:%4.0f Z:%4.0f F-%d %s-%s", pos.x, pos.y, pos.z, (int32)FramesPerSecond, + ZonePrint[ZoneId].name, ZonePrint[ZoneId].area); + AsciiToUnicode(str, ustr); - // Let's not scale those numbers, they look better that way :eyes: - CFont::SetPropOff(); + CFont::SetPropOn(); CFont::SetBackgroundOff(); - CFont::SetScale(0.7f, 1.5f); + CFont::SetScale(SCREEN_SCALE_X(0.6f), SCREEN_SCALE_Y(0.8f)); CFont::SetCentreOff(); CFont::SetRightJustifyOff(); CFont::SetJustifyOff(); CFont::SetBackGroundOnlyTextOff(); - CFont::SetWrapx(640.0f); - CFont::SetFontStyle(FONT_HEADING); - + CFont::SetWrapx(SCREEN_STRETCH_X(DEFAULT_SCREEN_WIDTH)); + CFont::SetFontStyle(FONT_STANDARD); + CFont::SetDropColor(CRGBA(0, 0, 0, 255)); + CFont::SetDropShadowPosition(2); CFont::SetColor(CRGBA(0, 0, 0, 255)); - CFont::PrintString(42.0f, 42.0f, ustr); + CFont::PrintString(41.0f, 41.0f, ustr); - CFont::SetColor(CRGBA(255, 108, 0, 255)); + CFont::SetColor(CRGBA(205, 205, 0, 255)); CFont::PrintString(40.0f, 40.0f, ustr); } + // custom if (bDisplayCheatStr) { sprintf(str, "%s", CPad::KeyBoardCheatString); AsciiToUnicode(str, ustr); - CFont::SetPropOff(); + CFont::SetPropOn(); CFont::SetBackgroundOff(); - CFont::SetScale(0.7f, 1.5f); + CFont::SetScale(SCREEN_SCALE_X(0.6f), SCREEN_SCALE_Y(0.8f)); CFont::SetCentreOn(); CFont::SetBackGroundOnlyTextOff(); - CFont::SetWrapx(640.0f); - CFont::SetFontStyle(FONT_HEADING); + CFont::SetWrapx(SCREEN_STRETCH_X(DEFAULT_SCREEN_WIDTH)); + CFont::SetFontStyle(FONT_STANDARD); CFont::SetColor(CRGBA(0, 0, 0, 255)); CFont::PrintString(SCREEN_SCALE_X(DEFAULT_SCREEN_WIDTH * 0.5f)+2.f, SCREEN_SCALE_FROM_BOTTOM(20.0f)+2.f, ustr); @@ -968,7 +957,7 @@ Render2dStuff(void) CSceneEdit::Draw(); else CHud::Draw(); - // TODO(Miami) + CSpecialFX::Render2DFXs(); CUserDisplay::OnscnTimer.ProcessForDisplay(); CMessages::Display(); @@ -1007,6 +996,9 @@ Render2dStuffAfterFade(void) DisplayGameDebugText(); #endif +#ifdef MOBILE_IMPROVEMENTS + if (CDraw::FadeValue != 0) +#endif CHud::DrawAfterFade(); CFont::DrawFonts(); CCredits::Render(); @@ -1065,9 +1057,7 @@ Idle(void *arg) if(arg == nil) return; - // m_bRenderGameInMenu is there in III PS2 but I don't know about VC PS2. - if((!FrontEndMenuManager.m_bMenuActive/* || FrontEndMenuManager.m_bRenderGameInMenu*/) && - TheCamera.GetScreenFadeStatus() != FADE_2) + if(!FrontEndMenuManager.m_bMenuActive && TheCamera.GetScreenFadeStatus() != FADE_2) { #ifdef GTA_PC // This is from SA, but it's nice for windowed mode diff --git a/src/modelinfo/PedModelInfo.cpp b/src/modelinfo/PedModelInfo.cpp index e4758a96..bd515391 100644 --- a/src/modelinfo/PedModelInfo.cpp +++ b/src/modelinfo/PedModelInfo.cpp @@ -78,7 +78,6 @@ ColNodeInfo m_pColNodeInfos[NUMPEDINFONODES] = { void CPedModelInfo::CreateHitColModelSkinned(RpClump *clump) { - CVector center; RpHAnimHierarchy *hier = GetAnimHierarchyFromSkinClump(clump); CColModel *colmodel = new CColModel; CColSphere *spheres = (CColSphere*)RwMalloc(NUMPEDINFONODES*sizeof(CColSphere)); @@ -97,23 +96,17 @@ CPedModelInfo::CreateHitColModelSkinned(RpClump *clump) RwV3d pos = { 0.0f, 0.0f, 0.0f }; RwV3dTransformPoints(&pos, &pos, 1, mat); - center.x = pos.x + m_pColNodeInfos[i].x; - center.y = pos.y + 0.0f; - center.z = pos.z + m_pColNodeInfos[i].z; - spheres[i].Set(m_pColNodeInfos[i].radius, center, SURFACE_PED, m_pColNodeInfos[i].pieceType); + spheres[i].center = pos + CVector(m_pColNodeInfos[i].x, 0.0f, m_pColNodeInfos[i].z); + spheres[i].radius = m_pColNodeInfos[i].radius; + spheres[i].surface = SURFACE_PED; + spheres[i].piece = m_pColNodeInfos[i].pieceType; } RwMatrixDestroy(invmat); RwMatrixDestroy(mat); colmodel->spheres = spheres; colmodel->numSpheres = NUMPEDINFONODES; - center.x = center.y = center.z = 0.0f; - colmodel->boundingSphere.Set(2.0f, center); - CVector min, max; - min.x = min.y = -0.5f; - min.z = -1.2f; - max.x = max.y = 0.5f; - max.z = 1.2f; - colmodel->boundingBox.Set(min, max); + colmodel->boundingSphere.Set(2.0f, CVector(0.0f, 0.0f, 0.0f)); + colmodel->boundingBox.Set(CVector(-0.5f, -0.5f, -1.2f), CVector(0.5f, 0.5f, 1.2f)); colmodel->level = LEVEL_GENERIC; m_hitColModel = colmodel; } @@ -141,9 +134,7 @@ CPedModelInfo::AnimatePedColModelSkinned(RpClump *clump) RwV3d pos = { 0.0f, 0.0f, 0.0f }; RwV3dTransformPoints(&pos, &pos, 1, mat); - spheres[i].center.x = pos.x + m_pColNodeInfos[i].x; - spheres[i].center.y = pos.y + 0.0f; - spheres[i].center.z = pos.z + m_pColNodeInfos[i].z; + spheres[i].center = pos + CVector(m_pColNodeInfos[i].x, 0.0f, m_pColNodeInfos[i].z); } RwMatrixDestroy(invmat); RwMatrixDestroy(mat); @@ -167,9 +158,7 @@ CPedModelInfo::AnimatePedColModelSkinnedWorld(RpClump *clump) RwV3d pos = { 0.0f, 0.0f, 0.0f }; RwV3dTransformPoints(&pos, &pos, 1, mat); - spheres[i].center.x = pos.x + m_pColNodeInfos[i].x; - spheres[i].center.y = pos.y + 0.0f; - spheres[i].center.z = pos.z + m_pColNodeInfos[i].z; + spheres[i].center = pos + CVector(m_pColNodeInfos[i].x, 0.0f, m_pColNodeInfos[i].z); } return m_hitColModel; } diff --git a/src/objects/ObjectData.cpp b/src/objects/ObjectData.cpp index 589cc3f7..04ac0b9c 100644 --- a/src/objects/ObjectData.cpp +++ b/src/objects/ObjectData.cpp @@ -6,6 +6,8 @@ #include "FileMgr.h" #include "ObjectData.h" +//--MIAMI: file done + CObjectInfo CObjectData::ms_aObjectInfo[NUMOBJECTINFO]; // Another ugly file reader @@ -18,11 +20,55 @@ CObjectData::Initialise(const char *filename) float percentSubmerged; int damageEffect, responseCase, camAvoid; CBaseModelInfo *mi; + + ms_aObjectInfo[0].m_fMass = 99999.0f; + ms_aObjectInfo[0].m_fTurnMass = 99999.0f; + ms_aObjectInfo[0].m_fAirResistance = 0.99f; + ms_aObjectInfo[0].m_fElasticity = 0.1f; + ms_aObjectInfo[0].m_fBuoyancy = GRAVITY * ms_aObjectInfo[0].m_fMass * 2.0f; + ms_aObjectInfo[0].m_fUprootLimit = 0.0f; + ms_aObjectInfo[0].m_fCollisionDamageMultiplier = 1.0f; + ms_aObjectInfo[0].m_nCollisionDamageEffect = 0; + ms_aObjectInfo[0].m_nSpecialCollisionResponseCases = 0; + ms_aObjectInfo[0].m_bCameraToAvoidThisObject = false; + + ms_aObjectInfo[1].m_fMass = 99999.0f; + ms_aObjectInfo[1].m_fTurnMass = 99999.0f; + ms_aObjectInfo[1].m_fAirResistance = 0.99f; + ms_aObjectInfo[1].m_fElasticity = 0.1f; + ms_aObjectInfo[1].m_fBuoyancy = ms_aObjectInfo[0].m_fBuoyancy; + ms_aObjectInfo[1].m_fUprootLimit = 0.0f; + ms_aObjectInfo[1].m_fCollisionDamageMultiplier = 1.0f; + ms_aObjectInfo[1].m_nCollisionDamageEffect = 0; + ms_aObjectInfo[1].m_nSpecialCollisionResponseCases = 0; + ms_aObjectInfo[1].m_bCameraToAvoidThisObject = true; + + ms_aObjectInfo[2].m_fMass = 99999.0f; + ms_aObjectInfo[2].m_fTurnMass = 99999.0f; + ms_aObjectInfo[2].m_fAirResistance = 0.99f; + ms_aObjectInfo[2].m_fElasticity = 0.1f; + ms_aObjectInfo[2].m_fBuoyancy = ms_aObjectInfo[0].m_fBuoyancy; + ms_aObjectInfo[2].m_fUprootLimit = 0.0f; + ms_aObjectInfo[2].m_fCollisionDamageMultiplier = 1.0f; + ms_aObjectInfo[2].m_nCollisionDamageEffect = 0; + ms_aObjectInfo[2].m_bCameraToAvoidThisObject = false; + ms_aObjectInfo[2].m_nSpecialCollisionResponseCases = 4; + + ms_aObjectInfo[3].m_fMass = 99999.0f; + ms_aObjectInfo[3].m_fTurnMass = 99999.0f; + ms_aObjectInfo[3].m_fAirResistance = 0.99f; + ms_aObjectInfo[3].m_fElasticity = 0.1f; + ms_aObjectInfo[3].m_fBuoyancy = ms_aObjectInfo[0].m_fBuoyancy; + ms_aObjectInfo[3].m_fUprootLimit = 0.0f; + ms_aObjectInfo[3].m_fCollisionDamageMultiplier = 1.0f; + ms_aObjectInfo[3].m_nCollisionDamageEffect = 0; + ms_aObjectInfo[3].m_nSpecialCollisionResponseCases = 4; + ms_aObjectInfo[3].m_bCameraToAvoidThisObject = true; CFileMgr::SetDir(""); CFileMgr::LoadFile(filename, work_buff, sizeof(work_buff), "r"); - id = 0; + id = 4; p = (char*)work_buff; while(*p != '*'){ // skip over white space and comments @@ -44,7 +90,11 @@ CObjectData::Initialise(const char *filename) } if(*p == '\n') p++; +#ifdef FIX_BUGS *lp = '\0'; // FIX: game wrote '\n' here +#else + *lp = '\n'; +#endif assert(id < NUMOBJECTINFO); sscanf(line, "%s %f %f %f %f %f %f %f %d %d %d", name, @@ -63,9 +113,23 @@ CObjectData::Initialise(const char *filename) ms_aObjectInfo[id].m_bCameraToAvoidThisObject = camAvoid; mi = CModelInfo::GetModelInfo(name, nil); - if(mi) - mi->SetObjectID(id++); - else + if (mi) { + if (ms_aObjectInfo[0].m_fMass != ms_aObjectInfo[id].m_fMass + || ms_aObjectInfo[0].m_fCollisionDamageMultiplier != ms_aObjectInfo[id].m_fCollisionDamageMultiplier + || ms_aObjectInfo[0].m_nCollisionDamageEffect != ms_aObjectInfo[id].m_nCollisionDamageEffect + || ((ms_aObjectInfo[0].m_nSpecialCollisionResponseCases != ms_aObjectInfo[id].m_nSpecialCollisionResponseCases) + && (ms_aObjectInfo[2].m_nSpecialCollisionResponseCases != ms_aObjectInfo[id].m_nSpecialCollisionResponseCases))) { + mi->SetObjectID(id++); + } else if (ms_aObjectInfo[0].m_nSpecialCollisionResponseCases == ms_aObjectInfo[id].m_nSpecialCollisionResponseCases) { + if (ms_aObjectInfo[0].m_bCameraToAvoidThisObject == ms_aObjectInfo[id].m_bCameraToAvoidThisObject) + mi->SetObjectID(0); + else + mi->SetObjectID(1); + } else if (ms_aObjectInfo[2].m_bCameraToAvoidThisObject == ms_aObjectInfo[id].m_bCameraToAvoidThisObject) + mi->SetObjectID(2); + else + mi->SetObjectID(3); + } else debug("CObjectData: Cannot find object %s\n", name); } } @@ -92,6 +156,7 @@ CObjectData::SetObjectData(int32 modelId, CObject &object) object.m_bCameraToAvoidThisObject = objinfo->m_bCameraToAvoidThisObject; if(object.m_fMass >= 99998.0f){ object.bInfiniteMass = true; + object.m_phy_flagA08 = true; object.bAffectedByGravity = false; object.bExplosionProof = true; } diff --git a/src/peds/EmergencyPed.cpp b/src/peds/EmergencyPed.cpp index 5b91daad..24d9a6a1 100644 --- a/src/peds/EmergencyPed.cpp +++ b/src/peds/EmergencyPed.cpp @@ -9,6 +9,8 @@ #include "CarCtrl.h" #include "Accident.h" +// --MIAMI: file done + CEmergencyPed::CEmergencyPed(uint32 type) : CPed(type) { switch (type){ @@ -97,7 +99,7 @@ CEmergencyPed::FiremanAI(void) case EMERGENCY_PED_READY: nearestFire = gFireManager.FindNearestFire(GetPosition(), &fireDist); if (nearestFire) { - m_nPedState = PED_NONE; + SetPedState(PED_NONE); SetSeek(nearestFire->m_vecPos, 1.0f); SetMoveState(PEDMOVE_RUN); m_nEmergencyPedState = EMERGENCY_PED_DETERMINE_NEXT_STATE; @@ -110,7 +112,7 @@ CEmergencyPed::FiremanAI(void) case EMERGENCY_PED_DETERMINE_NEXT_STATE: nearestFire = gFireManager.FindNearestFire(GetPosition(), &fireDist); if (nearestFire && nearestFire != m_pAttendedFire) { - m_nPedState = PED_NONE; + SetPedState(PED_NONE); SetSeek(nearestFire->m_vecPos, 1.0f); SetMoveState(PEDMOVE_RUN); #ifdef FIX_BUGS @@ -149,7 +151,7 @@ CEmergencyPed::FiremanAI(void) #ifdef FIX_BUGS bIsRunning = false; #endif - m_nPedState = PED_NONE; + SetPedState(PED_NONE); SetWanderPath(CGeneral::GetRandomNumber() & 7); m_pAttendedFire = nil; m_nEmergencyPedState = EMERGENCY_PED_READY; @@ -164,15 +166,20 @@ CEmergencyPed::MedicAI(void) { float distToEmergency; if (!bInVehicle && IsPedInControl()) { - ScanForThreats(); - if (m_threatEntity && m_threatEntity->IsPed() && ((CPed*)m_threatEntity)->IsPlayer()) { - if (((CPed*)m_threatEntity)->GetWeapon()->IsTypeMelee()) { - SetObjective(OBJECTIVE_KILL_CHAR_ON_FOOT, m_threatEntity); - } else { - SetFlee(m_threatEntity, 6000); - Say(SOUND_PED_FLEE_SPRINT); + ScanForDelayedResponseThreats(); + if (m_threatFlags && CTimer::GetTimeInMilliseconds() > m_threatCheckTimer) { + CheckThreatValidity(); + m_threatFlags = 0; + m_threatCheckTimer = 0; + if (m_threatEntity && m_threatEntity->IsPed() && ((CPed*)m_threatEntity)->IsPlayer()) { + if (((CPed*)m_threatEntity)->GetWeapon()->IsTypeMelee()) { + SetObjective(OBJECTIVE_KILL_CHAR_ON_FOOT, m_threatEntity); + } else { + SetFlee(m_threatEntity, 6000); + Say(SOUND_PED_FLEE_SPRINT); + } + return; } - return; } } @@ -225,8 +232,7 @@ CEmergencyPed::MedicAI(void) m_pRevivedPed->RegisterReference((CEntity**)&m_pRevivedPed); m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&midPos, PED_MID); m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&headPos, PED_HEAD); - SetSeek((headPos + midPos) * 0.5f, 1.0f); - SetObjective(OBJECTIVE_NONE); + SetObjective(OBJECTIVE_GOTO_AREA_ON_FOOT, CVector((headPos + midPos) * 0.5f)); bIsRunning = true; m_nEmergencyPedState = EMERGENCY_PED_DETERMINE_NEXT_STATE; m_pAttendedAccident = nearestAccident; @@ -239,6 +245,7 @@ CEmergencyPed::MedicAI(void) CPed* driver = m_pMyVehicle->pDriver; if (driver && driver->m_nPedType != PEDTYPE_EMERGENCY && m_objective != OBJECTIVE_KILL_CHAR_ON_FOOT) { SetObjective(OBJECTIVE_KILL_CHAR_ON_FOOT, driver); + } else if (m_objective != OBJECTIVE_ENTER_CAR_AS_DRIVER && m_objective != OBJECTIVE_ENTER_CAR_AS_PASSENGER && m_objective != OBJECTIVE_KILL_CHAR_ON_FOOT) { @@ -265,8 +272,7 @@ CEmergencyPed::MedicAI(void) } m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&midPos, PED_MID); m_pRevivedPed->m_pedIK.GetComponentPosition(*(RwV3d *)&headPos, PED_HEAD); - SetSeek((headPos + midPos) * 0.5f, nearestAccident->m_nMedicsPerformingCPR * 0.5f + 1.0f); - SetObjective(OBJECTIVE_NONE); + SetObjective(OBJECTIVE_GOTO_AREA_ON_FOOT, CVector((headPos + midPos) * 0.5f)); bIsRunning = true; --m_pAttendedAccident->m_nMedicsAttending; ++nearestAccident->m_nMedicsAttending; @@ -296,11 +302,11 @@ CEmergencyPed::MedicAI(void) } else { m_pRevivedPed->m_bloodyFootprintCountOrDeathTime = CTimer::GetTimeInMilliseconds(); SetMoveState(PEDMOVE_STILL); - m_nPedState = PED_CPR; + SetPedState(PED_CPR); m_nLastPedState = PED_CPR; SetLookFlag(m_pRevivedPed, 0); SetLookTimer(500); - //Say(SOUND_PED_HEALING); + Say(SOUND_PED_HEALING); if (m_pAttendedAccident->m_nMedicsPerformingCPR) { SetIdle(); m_nEmergencyPedState = EMERGENCY_PED_STAND_STILL; @@ -355,12 +361,12 @@ CEmergencyPed::MedicAI(void) break; } m_nEmergencyPedState = EMERGENCY_PED_STOP_CPR; - m_nPedState = PED_NONE; + SetPedState(PED_NONE); SetMoveState(PEDMOVE_WALK); m_pVehicleAnim = nil; if (!m_pRevivedPed->bBodyPartJustCameOff) { m_pRevivedPed->m_fHealth = 100.0f; - m_pRevivedPed->m_nPedState = PED_NONE; + m_pRevivedPed->SetPedState(PED_NONE); m_pRevivedPed->m_nLastPedState = PED_WANDER_PATH; m_pRevivedPed->SetGetUp(); m_pRevivedPed->bUsesCollision = true; @@ -369,6 +375,8 @@ CEmergencyPed::MedicAI(void) m_pRevivedPed->bIsPedDieAnimPlaying = false; m_pRevivedPed->bKnockedUpIntoAir = false; m_pRevivedPed->m_pCollidingEntity = nil; + m_pRevivedPed->bKnockedOffBike = false; + m_pRevivedPed->Say(SOUND_PED_ACCIDENTREACTION1); } break; case EMERGENCY_PED_STOP_CPR: @@ -389,7 +397,7 @@ CEmergencyPed::MedicAI(void) break; case EMERGENCY_PED_STOP: m_bStartedToCPR = false; - m_nPedState = PED_NONE; + SetPedState(PED_NONE); if (m_pAttendedAccident) { m_pAttendedAccident->m_pVictim = nil; --m_pAttendedAccident->m_nMedicsAttending; diff --git a/src/peds/PedDebug.cpp b/src/peds/PedDebug.cpp index 0809581b..aed11357 100644 --- a/src/peds/PedDebug.cpp +++ b/src/peds/PedDebug.cpp @@ -7,11 +7,10 @@ #include "Sprite.h" #include "Text.h" -// TODO(Miami) static char ObjectiveText[][28] = { "No Obj", "Wait on Foot", - "Wait on Foot For Cop", + "Wait on Foot for cop", "Flee on Foot Till Safe", "Guard Spot", "Guard Area", @@ -22,8 +21,8 @@ static char ObjectiveText[][28] = { "Flee Char on Foot Till Safe", "Flee Char on Foot Always", "GoTo Char on Foot", - "GoTo Char on Foot Walking", - "Hassle Char", + "GoTo Char on Foot walking", + "Hassle char", "Follow Char in Formation", "Leave Car", "Enter Car as Passenger", @@ -40,14 +39,30 @@ static char ObjectiveText[][28] = { "Guard Attack", "Set Leader", "Follow Route", - "Solicit", + "Solicit vehicle", "Take Taxi", "Catch Train", "Buy IceCream", "Steal Any Car", - "Steal Any Mission Car", + "Steal any mission car", "Mug Char", - "Leave Car and Die", + "Lv car die", + "Goto seat", + "Goto atm", + "Flee car", + "Sunbathe", + "Goto bus stop", + "Goto pizza", + "Goto shelter", + "Aim gun at", + "Wander", + "Wait on foot at shltr", + "Sprint to area", + "Kill char on boat", + "Solicit ped", + "Wait at bus stop", + "Goto ice cream van foot", + "Wait foot icecream van" }; static char StateText[][18] = { @@ -84,11 +99,11 @@ static char StateText[][18] = { "Investigate", "Step away", "On Fire", - "Sun Bathe", + "Bathe", "Flash", "Jog", - "Answer Mobile", - "Unknown", + "Answer mobile", + "Hang out", "STATES_NO_AI", "Abseil", "Sit", @@ -114,7 +129,7 @@ static char StateText[][18] = { "Exit Car", "Hands Up", "Arrested", - "Deploying Stinger" + "Deply stgr" }; static char PersonalityTypeText[][18] = { @@ -141,8 +156,7 @@ static char PersonalityTypeText[][18] = { "Geek Girl", "Old Girl", "Tough Girl", - "Tramp Male", - "Tramp Female", + "Tramp", "Tourist", "Prostitute", "Criminal", @@ -151,8 +165,6 @@ static char PersonalityTypeText[][18] = { "Psycho", "Steward", "Sports Fan", - "Shopper", - "Old Shopper" }; static char WaitStateText[][16] = { @@ -177,6 +189,21 @@ static char WaitStateText[][16] = { "Play HandsCower", "Play Chat", "Finish Flee", + "Sit down", + "Sit down rvrs", + "Sit up", + "Sit idle", + "Use atm", + "Sunbth pre", + "Sunbth down", + "Sunbth idle", + "Riot", + "Fast fall", + "Bomber", + "Stripper", + "Ground attack", + "Lance sitting", + "Handsup simple" }; void diff --git a/src/render/Fluff.cpp b/src/render/Fluff.cpp index 19a172fb..b765675f 100644 --- a/src/render/Fluff.cpp +++ b/src/render/Fluff.cpp @@ -22,6 +22,7 @@ #include "Bones.h" #include "World.h" #include "Replay.h" +#include "Coronas.h" CPlaneTrail CPlaneTrails::aArray[6]; RwImVertexIndex TrailIndices[32] = { @@ -369,18 +370,10 @@ uint8 ScrollCharSet[59][5] = { // ---------- CMovingThings ---------- enum eScrollBarTypes { - SCROLL_BUSINESS, - SCROLL_TRAFFIC, - SCROLL_ENTERTAINMENT, - SCROLL_AIRPORT_DOORS, - SCROLL_AIRPORT_FRONT, - SCROLL_STORE, - SCROLL_USED_CARS + SCROLL_ARENA_STRING }; -CScrollBar aScrollBars[11]; -CTowerClock aTowerClocks[2]; -CDigitalClock aDigitalClocks[3]; +CScrollBar aScrollBars[1]; CMovingThing CMovingThings::StartCloseList; CMovingThing CMovingThings::EndCloseList; @@ -391,66 +384,47 @@ int32 CScrollBar::TonightsEvent; void CMovingThings::Init() { + StartCloseList.m_pNext = &CMovingThings::EndCloseList; + StartCloseList.m_pPrev = nil; + EndCloseList.m_pNext = nil; + EndCloseList.m_pPrev = &CMovingThings::StartCloseList; + CPlaneTrails::Init(); CSmokeTrails::Init(); CPlaneBanners::Init(); CPointLights::Init(); - StartCloseList.m_pNext = &CMovingThings::EndCloseList; - StartCloseList.m_pPrev = nil; - EndCloseList.m_pNext = nil; - EndCloseList.m_pPrev = &CMovingThings::StartCloseList; Num = 0; - CEscalators::Init(); + for (int32 i = 0; i < NUMMOVINGTHINGS; i++) { + aMovingThings[i].m_nType = 0; + aMovingThings[i].m_nHidden = 0; + } -#ifndef MIAMI // something is still used here actually - // Initialize scroll bars - aScrollBars[0].Init(CVector( 228.3f, -669.0f, 39.0f ), SCROLL_BUSINESS, 0.0f, 0.5f, 0.5f, 255, 128, 0, 0.3f); - aScrollBars[1].Init(CVector( 772.0f, 164.0f, -9.5f ), SCROLL_TRAFFIC, 0.0f, 0.5f, 0.25f, 128, 255, 0, 0.3f); - aScrollBars[2].Init(CVector(-1089.61f, -584.224f, 13.246f), SCROLL_AIRPORT_DOORS, 0.0f, -0.1706f, 0.107f, 255, 0, 0, 0.11f); - aScrollBars[3].Init(CVector(-1089.61f, -602.04602f, 13.246f), SCROLL_AIRPORT_DOORS, 0.0f, -0.1706f, 0.107f, 0, 255, 0, 0.11f); - aScrollBars[4].Init(CVector(-1089.61f, -619.81702f, 13.246f), SCROLL_AIRPORT_DOORS, 0.0f, -0.1706f, 0.107f, 255, 128, 0, 0.11f); - aScrollBars[5].Init(CVector(-754.578f, -633.50897f, 18.411f), SCROLL_AIRPORT_FRONT, 0.0f, 0.591f, 0.52f, 100, 100, 255, 0.3f); - aScrollBars[6].Init(CVector( -754.578f, -586.672f, 18.411f), SCROLL_AIRPORT_FRONT, 0.0f, 0.591f, 0.52f, 100, 100, 255, 0.3f); - aScrollBars[7].Init(CVector( 85.473f, -1069.512f, 30.5f ), SCROLL_STORE, 0.625f, -0.3125f, 0.727f, 100, 100, 255, 0.5f); - aScrollBars[8].Init(CVector( 74.823f, -1086.879f, 31.495f), SCROLL_ENTERTAINMENT, -0.2083f, 0.1041f, 0.5f, 255, 255, 128, 0.3f); - aScrollBars[9].Init(CVector( -36.459f, -1031.2371f, 32.534f), SCROLL_ENTERTAINMENT, -0.1442f, 0.0721f, 0.229f, 150, 255, 50, 0.3f); - aScrollBars[10].Init(CVector( 1208.0f, -62.208f, 19.157f), SCROLL_USED_CARS, 0.0642f, -0.20365f, 0.229f, 255, 128, 0, 0.3f); - - // Initialize tower clocks - aTowerClocks[0].Init(CVector(59.4f, -1081.3f, 54.15f), -1.0f, 0.0f, 0, 0, 0, 80.0f, 2.0f); - aTowerClocks[1].Init(CVector(55.4f, -1083.6f, 54.15f), 0.0f, -1.0f, 0, 0, 0, 80.0f, 2.0f); - - // Initialize digital clocks - CVector2D sz(3.7f, 2.144f); - sz.Normalise(); - aDigitalClocks[0].Init( - CVector(54.485f - sz.x * 0.05f + sz.y * 0.3f, -1081.679f - sz.y * 0.05f - sz.x * 0.3f, 32.803f), - sz.y, -sz.x, 255, 0, 0, 100.0f, 0.8f - ); - aDigitalClocks[1].Init( - CVector(60.564f + sz.x * 0.05f - sz.y * 0.3f, -1083.089f + sz.y * 0.05f + sz.x * 0.3f, 32.803f), - -sz.y, sz.x, 0, 0, 255, 100.0f, 0.8f - ); - aDigitalClocks[2].Init( - CVector(58.145f - sz.y * 0.05f - sz.x * 0.3f, -1079.268f + sz.x * 0.05f - sz.y * 0.3f, 32.803f), - -sz.x, -sz.y, 0, 255, 0, 100.0f, 0.8f - ); -#endif + for (int i = 0; i < NUMSECTORS_X; i++) { + for (int j = 0; j < NUMSECTORS_Y; j++) { + for (CPtrNode *pNode = CWorld::GetSector(i, j)->m_lists[ENTITYLIST_BUILDINGS].first; pNode; pNode = pNode->next) { + CEntity *pEntity = (CEntity *)pNode->item; + PossiblyAddThisEntity(pEntity); + } + } + } + + for (int32 i = 0; i < NUM_LEVELS; i++) { + for (CPtrNode *pNode = CWorld::GetBigBuildingList((eLevelName)i).first; pNode; pNode = pNode->next) { + CEntity *pEntity = (CEntity *)pNode->item; + PossiblyAddThisEntity(pEntity); + } + } + + CEscalators::Init(); + aScrollBars[0].Init(CVector(-1069.209f, 1320.126f, 18.848f), CVector(-1069.209f, 1342.299f, 22.612), SCROLL_ARENA_STRING, 128, 255, 0, 0.3f); } void CMovingThings::Shutdown() { - int i; - for (i = 0; i < ARRAY_SIZE(aScrollBars); ++i) - aScrollBars[i].SetVisibility(false); -/* - for (i = 0; i < ARRAY_SIZE(aTowerClocks); ++i) - aTowerClocks[i].SetVisibility(false); - for (i = 0; i < ARRAY_SIZE(aDigitalClocks); ++i) - aDigitalClocks[i].SetVisibility(false); -*/ + + aScrollBars[0].SetVisibility(false); CEscalators::Shutdown(); } @@ -475,23 +449,12 @@ void CMovingThings::Update() if (aMovingThings[i].m_nHidden == 0) aMovingThings[i].Update(); } - /* I don't think these are done yet? + for (i = 0; i < ARRAY_SIZE(aScrollBars); ++i) { if (aScrollBars[i].IsVisible() || (CTimer::GetFrameCounter() + i) % 8 == 0) aScrollBars[i].Update(); } - for (i = 0; i < ARRAY_SIZE(aTowerClocks); ++i) - { - if (aTowerClocks[i].IsVisible() || (CTimer::GetFrameCounter() + i) % 8 == 0) - aTowerClocks[i].Update(); - } - for (i = 0; i < ARRAY_SIZE(aDigitalClocks); ++i) - { - if (aDigitalClocks[i].IsVisible() || (CTimer::GetFrameCounter() + i) % 8 == 0) - aDigitalClocks[i].Update(); - } - */ } void CMovingThings::Render() @@ -504,18 +467,6 @@ void CMovingThings::Render() if (aScrollBars[i].IsVisible()) aScrollBars[i].Render(); } -/* - for (i = 0; i < ARRAY_SIZE(aTowerClocks); ++i) - { - if (aTowerClocks[i].IsVisible()) - aTowerClocks[i].Render(); - } - for (i = 0; i < ARRAY_SIZE(aDigitalClocks); ++i) - { - if (aDigitalClocks[i].IsVisible()) - aDigitalClocks[i].Render(); - } -*/ CPlaneTrails::Render(); CSmokeTrails::Render(); @@ -523,22 +474,72 @@ void CMovingThings::Render() } // ---------- CMovingThing ---------- +float lengths[5] = { 100.0f, 1500.0f, 400.0f, 100.0f, 2000.0f }; + void CMovingThing::Update() { + switch (m_nType) { + case 1: { + float angle = (CTimer::GetTimeInMilliseconds() % 0x3FFF) * TWOPI / 0x3FFF; + m_pEntity->GetRight() = CVector(-Sin(angle), Cos(angle), 0.0f); + m_pEntity->GetForward() = CVector(0.0f, 0.0f, 1.0f); + m_pEntity->GetUp() = CVector(Cos(angle), Sin(angle), 0.0f); + + if (CClock::GetHours() >= 20 || CClock::GetHours() < 5) { + if (Abs(TheCamera.GetPosition().x - m_pEntity->GetPosition().x) < 600.0f && + Abs(TheCamera.GetPosition().y - m_pEntity->GetPosition().y) < 600.0f) { + CVector delta = m_pEntity->GetPosition() - TheCamera.GetPosition(); + delta.Normalise(); + + if (delta.x * Cos(angle) + delta.y * Sin(angle) < -0.92f) { + CVector coors = m_pEntity->GetPosition() - 10.0f * delta; + CCoronas::RegisterCorona(43, 128, 128, 100, 255, coors, 70.0f, 600.0f, 0.0f, CCoronas::TYPE_STAR, CCoronas::REFLECTION_OFF, CCoronas::LOSCHECK_OFF, CCoronas::STREAK_OFF, 0.0f, false, 1.5f); + } + } + } + } + break; + case 2: { + float angle = (CTimer::GetTimeInMilliseconds() % 0x7FF) * TWOPI / 0x7FF; + m_pEntity->GetRight() = CVector(Cos(angle), Sin(angle), 0.0f); + m_pEntity->GetForward() = CVector(-Sin(angle), Cos(angle), 0.0f); + m_pEntity->GetUp() = CVector(0.0f, 0.0f, 1.0f); + } + break; + case 3: { + float angle = (CTimer::GetTimeInMilliseconds() % 0x3FF) * TWOPI / 0x3FF; + m_pEntity->GetRight() = CVector(Cos(angle), Sin(angle), 0.0f); + m_pEntity->GetForward() = CVector(-Sin(angle), Cos(angle), 0.0f); + m_pEntity->GetUp() = CVector(0.0f, 0.0f, 1.0f); + } + break; + case 4: { + float angle = (CTimer::GetTimeInMilliseconds() % 0x3FFFF) * TWOPI / 0x3FFFF; + m_pEntity->GetRight() = CVector(-Cos(angle), -Sin(angle), 0.0f); + m_pEntity->GetForward() = CVector(Sin(angle), -Cos(angle), 0.0f); + m_pEntity->GetUp() = CVector(0.0f, 0.0f, 1.0f); + m_pEntity->SetPosition(CVector(350.0f * Cos(angle) - 465.0f, 350.0f * Sin(angle) + 1163.0f, 260.0f)); + } + break; + default: + break; + } + m_pEntity->GetMatrix().UpdateRW(); m_pEntity->UpdateRwFrame(); - if (SQR(m_pEntity->GetPosition().x - TheCamera.GetPosition().x) + SQR(m_pEntity->GetPosition().y - TheCamera.GetPosition().y) < 40000.0f) { - if (m_nHidden == 1) { - AddToList(&CMovingThings::StartCloseList); - m_nHidden = 0; - } - } else { + if (SQR(m_pEntity->GetPosition().x - TheCamera.GetPosition().x) + SQR(m_pEntity->GetPosition().y - TheCamera.GetPosition().y) >= SQR(lengths[m_nType])) { if (m_nHidden == 0) { RemoveFromList(); m_nHidden = 1; } } + else { + if (m_nHidden == 1) { + AddToList(&CMovingThings::StartCloseList); + m_nHidden = 0; + } + } } void CMovingThing::AddToList(CMovingThing *pThing) @@ -568,27 +569,32 @@ int16 CMovingThing::SizeList() return count; } -// ---------- Find message functions ---------- -const char* FindTunnelMessage() -{ - if (CStats::CommercialPassed) - return "LIBERTY TUNNEL HAS BEEN OPENED TO ALL TRAFFIC . . . "; - - if (CStats::IndustrialPassed) - return "FIRST PHASE LIBERTY TUNNEL HAS BEEN COMPLETED . . . "; +void CMovingThings::RegisterOne(CEntity *pEnt, uint16 nType) { + if (Num >= NUMMOVINGTHINGS) + return; - return "FIRST PHASE LIBERTY TUNNEL ABOUT TO BE COMPLETED . . . "; + aMovingThings[Num].m_pEntity = pEnt; + aMovingThings[Num].m_nType = nType; + aMovingThings[Num].m_nHidden = 0; + aMovingThings[Num].m_vecPosn = pEnt->GetPosition(); + aMovingThings[Num].AddToList(&CMovingThings::StartCloseList); + Num++; } -const char* FindBridgeMessage() -{ - if (CStats::CommercialPassed) - return "STAUNTON LIFT BRIDGE IS OPERATIONAL AGAIN "; - - if (CStats::IndustrialPassed) - return "LONG DELAYS BEHIND US AS CALLAHAN BRIDGE IS FIXED . . . STAUNTON LIFT BRIDGE STUCK OPEN "; - - return "CHAOS AS CALLAHAN BRIDGE IS UNDER REPAIR. . . "; +void CMovingThings::PossiblyAddThisEntity(CEntity *pEnt) { + if (pEnt->GetModelIndex() == MI_LIGHTBEAM) { + RegisterOne(pEnt, 1); + } + else if (pEnt->GetModelIndex() == MI_AIRPORTRADAR) { + RegisterOne(pEnt, 2); + } + else if (pEnt->GetModelIndex() == MI_MALLFAN || pEnt->GetModelIndex() == MI_HOTELFAN_NIGHT + || pEnt->GetModelIndex() == MI_HOTELFAN_DAY || pEnt->GetModelIndex() == MI_HOTROOMFAN) { + RegisterOne(pEnt, 3); + } + else if (pEnt->GetModelIndex() == MI_BLIMP_NIGHT || pEnt->GetModelIndex() == MI_BLIMP_DAY) { + RegisterOne(pEnt, 4); + } } char String_Time[] = "THE TIME IS 12:34 "; @@ -601,49 +607,23 @@ const char* FindTimeMessage() return String_Time; } -char String_DigitalClock[] = "12:34"; -const char* FindDigitalClockMessage() -{ - if (((CTimer::GetTimeInMilliseconds() >> 10) & 7) < 6) - { - String_DigitalClock[0] = '0' + CClock::GetHours() / 10; - String_DigitalClock[1] = '0' + CClock::GetHours() % 10; - String_DigitalClock[2] = CTimer::GetTimeInMilliseconds() & 0x200 ? ':' : ' '; - String_DigitalClock[3] = '0' + CClock::GetMinutes() / 10; - String_DigitalClock[4] = '0' + CClock::GetMinutes() % 10; - } - else - { - // they didn't use rad2deg here because of 3.14 - int temperature = 13.0f - 6.0f * Cos((CClock::GetMinutes() + 60.0f * CClock::GetHours()) / (4.0f * 180.0f / 3.14f) - 1.0f); - String_DigitalClock[0] = '0' + temperature / 10; - if (String_DigitalClock[0] == '0') - String_DigitalClock[0] = ' '; - String_DigitalClock[1] = '0' + temperature % 10; - String_DigitalClock[2] = ' '; - String_DigitalClock[3] = '@'; - String_DigitalClock[4] = 'C'; - } - return String_DigitalClock; -} - // ---------- CScrollBar ---------- -void CScrollBar::Init(CVector position, uint8 type, float sizeX, float sizeY, float sizeZ, uint8 red, uint8 green, uint8 blue, float scale) +void CScrollBar::Init(CVector pos1, CVector pos2, uint8 type, uint8 red, uint8 green, uint8 blue, float scale) { for (int i = 0; i < ARRAY_SIZE(m_MessageBar); ++i) m_MessageBar[i] = 0; m_pMessage = ". "; m_MessageCurrentChar = 0; - m_MessageLength = 2; + m_MessageLength = strlen(m_pMessage); m_Counter = 0; m_bVisible = false; - m_Position = position; + m_Position = pos1; m_Type = type; - m_Size.x = sizeX; - m_Size.y = sizeY; - m_Size.z = sizeZ; + m_Size.x = (pos2.x - pos1.x) * 0.025f; + m_Size.y = (pos2.y - pos1.y) * 0.025f; + m_Size.z = (pos2.z - pos1.z) * 0.2f; m_uRed = red; m_uGreen = green; m_uBlue = blue; @@ -672,263 +652,48 @@ void CScrollBar::Update() if (m_Counter == 0 && ++m_MessageCurrentChar >= m_MessageLength) { const char* previousMessage = m_pMessage; - switch (m_Type) - { - case SCROLL_BUSINESS: - while (previousMessage == m_pMessage) - { - switch (CGeneral::GetRandomNumber() % 7) - { - case 0: - m_pMessage = "SHARES UYE<10% DWD<20% NDWE>22% . . . "; - break; - case 1: - m_pMessage = "CRIME WAVE HITS LIBERTY CITY . . . "; - break; - case 2: - m_pMessage = "SHARES OBR>29% MADD<76% LEZ<11% ADAMSKI>53% AAG>110%. . . "; - break; - case 3: - m_pMessage = FindTunnelMessage(); - break; - case 4: - m_pMessage = FindBridgeMessage(); - break; - case 5: - m_pMessage = FindTimeMessage(); - break; - case 6: - if (FrontEndMenuManager.m_PrefsLanguage == CMenuManager::LANGUAGE_FRENCH || FrontEndMenuManager.m_PrefsLanguage == CMenuManager::LANGUAGE_GERMAN) - m_pMessage = FindTimeMessage(); - else - m_pMessage = "WWW.GRANDTHEFTAUTO3.COM "; - break; - } - } - break; - case SCROLL_TRAFFIC: - while (previousMessage == m_pMessage) - { - switch (CGeneral::GetRandomNumber() % 8) - { - case 0: - m_pMessage = "DRIVE CAREFULLY . . . "; - break; - case 1: - m_pMessage = "RECENT WAVE OF CARJACKINGS. KEEP YOUR DOORS LOCKED !!! "; - break; - case 2: - m_pMessage = "CHECK YOUR SPEED . . . "; - break; - case 3: - m_pMessage = "KEEP YOUR EYES ON THE ROAD AND NOT ON THIS SIGN "; - break; - case 4: - if (CWeather::Foggyness > 0.5f) - m_pMessage = "POOR VISIBILITY ! "; - else if (CWeather::WetRoads > 0.5f) - m_pMessage = "ROADS ARE SLIPPERY ! "; - else - m_pMessage = "ENJOY YOUR TRIP "; - break; - case 5: - m_pMessage = FindTunnelMessage(); - break; - case 6: - m_pMessage = FindBridgeMessage(); - break; - case 7: - m_pMessage = FindTimeMessage(); - break; - } - } - break; - case SCROLL_ENTERTAINMENT: - while (previousMessage == m_pMessage) - { - switch (CGeneral::GetRandomNumber() % 12) - { - case 0: - m_pMessage = " )69TH STREET) STILL HOLDS TOP POSITION THIS MONTH AT THE BOX-OFFICE WITH )MY FAIR LADYBOY) JUST CREEPING UP BEHIND. "; - break; - case 1: - m_pMessage = " TALKING OF )FANNIE). THERE IS STILL TIME TO CATCH THIS LOVELY FAMILY MUSICAL, ABOUT THE ORPHAN WHO IS SO EASILY TAKEN IN BY ANY MAN WITH LOADS OF MONEY. "; - break; - case 2: - m_pMessage = " DO NOT MISS )GTA3, THE MUSICAL) . . . "; - break; - case 3: - m_pMessage = - " STILL RUNNING ARE )RATS) AND )GUYS AND DOGS), BETWEEN THEN THEY SHOULD HAVE THE LEGS TO LAST TILL THE AND OF THE YEAR. . . " - " ALSO FOR FOUR LEGGED FANS, THE STAGE VERSION OF THE GRITTY REALISTIC )SATERDAY NIGHT BEAVER) OPENED LAST WEEKEND," - " AND I FOR ONE CERTAINLY ENJOYED THAT. "; - break; - case 4: - m_pMessage = - " NOW SHOWING STATE-WIDE, ARNOLD STEELONE, HOLLYWOODS BEST LIVING SPECIAL EFFECT, APPEARS AGAIN AS A HALF_MAN," - " HALF ANDROID IN THE HALF-BAKED ROMP, )TOP DOWN CITY). AN HOMAGE TO HIS EARLIER TWO MULTI_MILLION MAKING MOVIES," - " IN WHICH HE PLAYED TWO-DEE, AN OUT OF CONTROL MONSTER, INTENT ON CORRUPTING CIVILISATION! "; - break; - case 5: - m_pMessage = - " ALSO APPEARING THIS WEEK )HALF-COCKED) SEES CHUCK SCHWARTZ UP TO HIS USUAL NONSENSE AS HE TAKES ON HALF OF LIBERTY CITY" - " IN AN ATTEMPT TO SAVE HIS CROSS-DRESSING LADY-BOY SIDEKICK, )MISS PING-PONG), FROM A GANG OF RUTHLESS COSMETIC SURGEONS. "; - break; - case 6: - m_pMessage = - " STILL SHOWING: )SOLDIERS OF MISFORTUNE), ATTROCIOUS ACTING WHICH SEES BOYZ 2 GIRLZ) TRANSITION FROM THE CHARTS TO THE BIG SCREEN," - " AT LEAST THEY ALL DIE AT THE END. . . "; - break; - case 7: - m_pMessage = - " )BADFELLAS) IS STILL GOING STRONG WITH CROWDS ALMOST BEING PUSHED INTO CINEMAS TO SEE THIS ONE." - " ANOTHER ONE WORTH LOOKING INTO IS )THE TUNNEL). "; - break; - case 8: - m_pMessage = FindTunnelMessage(); - break; - case 9: - m_pMessage = FindBridgeMessage(); - break; - case 10: - m_pMessage = FindTimeMessage(); - break; - case 11: - m_pMessage = "WWW.ROCKSTARGAMES.COM "; - break; - } - } - break; - case SCROLL_AIRPORT_DOORS: - while (previousMessage == m_pMessage) - { - switch (CGeneral::GetRandomNumber() % 4) - { - case 0: - m_pMessage = "WELCOME TO LIBERTY CITY . . . "; - break; - case 1: - m_pMessage = "PLEASE HAVE YOUR PASSPORT READY . . . "; - break; - case 2: - m_pMessage = "PLACE KEYS, FIREARMS, CHANGE AND OTHER METAL OBJECTS ON THE TRAY PLEASE . . . "; - break; - case 3: - m_pMessage = FindTimeMessage(); - break; - } - } - break; - case SCROLL_AIRPORT_FRONT: + if (m_Type == SCROLL_ARENA_STRING) { while (previousMessage == m_pMessage) { switch (CGeneral::GetRandomNumber() % 4) { case 0: - m_pMessage = "WELCOME TO FRANCIS INTERNATIONAL AIRPORT . . . "; + switch (TonightsEvent) { + case 0: + m_pMessage = "MAIN EVENT TONIGHT: CAR RACING . . . "; + break; + case 1: + m_pMessage = "MAIN EVENT TONIGHT: DESTRUCTION DERBY . . . "; + break; + case 2: + m_pMessage = "MAIN EVENT TONIGHT: BIKE RACING . . . "; + break; + } break; case 1: - m_pMessage = "PLEASE DO NOT LEAVE LUGGAGE UNATTENDED . . . "; + switch (TonightsEvent) { + case 0: + m_pMessage = "FOR TICKETS TO THE HOT RING EVENT CALL 555-3764 . . . "; + break; + case 1: + m_pMessage = "FOR TICKETS TO THE BLOOD RING EVENT CALL 555-3765 . . . "; + break; + case 2: + m_pMessage = "FOR TICKETS TO THE DIRT RING EVENT CALL 555-3766 . . . "; + break; + } break; case 2: - m_pMessage = "FOLLOW 1 FOR LONG AND SHORT TERM PARKING "; + m_pMessage = "HYMAN MEMORIAL STADIUM. HOME TO SOME OF THE BIGGEST EVENTS OF" + " THE WESTERN HEMISPHERE. ALSO AVAILABLE FOR CHILDREN PARTIES. . . "; break; case 3: m_pMessage = FindTimeMessage(); break; - } - } - break; - case SCROLL_STORE: - while (previousMessage == m_pMessage) - { - switch (CGeneral::GetRandomNumber() % 10) - { - case 0: - m_pMessage = "WWW.ROCKSTARGAMES.COM "; - break; - case 1: - m_pMessage = "GTA3 OUT NOW . . . "; - break; - case 2: - m_pMessage = "OUR STUFF IS CHEAP CHEAP CHEAP "; - break; - case 3: - m_pMessage = "BUY 12 CDS GET ONE FREE . . . "; - break; - case 4: - m_pMessage = "APPEARING IN SHOP SOON, )THE BLOODY CHOPPERS), WITH THEIR NEW ALBUM, )IS THAT MY DAUGHTER?) "; - break; - case 5: - m_pMessage = "THIS MONTH IS OUR CRAZY CLEAROUT MONTH, EVERYTHING MUST GO, CDS, DVDS, STAFF, EVEN OUR CARPETS! "; - break; - case 6: - m_pMessage = - "OUT THIS WEEK: THE THEME TUNE TO )BOYS TO GIRLS) FIRST MOVIE )SOLDIERS OF MISFORTUNE), " - "THE SINGLE )LET ME IN YOU)RE BODY-BAG) IS TAKEN FROM THE SOUNDTRACK ALBUM, )BOOT CAMP BOYS). " - "ALSO INCLUDES THE SMASH SINGLE, )PRAY IT GOES OK). "; - break; - case 7: - m_pMessage = - "ALBUMS OUT THIS WEEK: MARYDANCING, )MUTHA O) CHRIST), FEATURING THE SINGLE )WASH HIM OFF), " - "ALSO CRAIG GRAYS) DEBUT, )FADE AWAY), INCLUDES THE SINGLE OF THE SAME NAME. . . "; - break; - case 8: - m_pMessage = - "ON THE FILM FRONT, A NELY COMPILED COMPILATION OF ARNOLD STEELONES GREATEST MOVIES ON DVD. " - "THE PACK INCLUDES THE EARLY )BY-CEP), THE CULT CLASSIC )FUTURE ANNHILATOR), AND THE HILARIOUS CROSS-DRESSING COMEDY )SISTERS). " - "ONE FOR ALL THE FAMILY. . . "; - break; - case 9: - m_pMessage = FindTimeMessage(); + default: break; } } - break; - case SCROLL_USED_CARS: - while (previousMessage == m_pMessage) - { - switch (CGeneral::GetRandomNumber() % 11) - { - case 0: - m_pMessage = "QUICK, TAKE A LOOK AT OUR CURRENT STOCK )CAUSE THESE AUTOS ARE MOVIN) FAST . . . "; - break; - case 1: - m_pMessage = "THAT)S RIGHT, HERE AT )CAPITAL AUTO SALES) OUR VEHICLES ARE SO GOOD THAT THEY PRACTICALLY DRIVE THEMSELVES OFF OUR LOT . . . "; - break; - case 2: - m_pMessage = "EASY CREDIT ON ALL CARS . . . "; - break; - case 3: - m_pMessage = "FEEL LIKE A STUD IN ONE OF OUR STALLIONS OR TEST-DRIVE OUR BANSHEE, IT)S A REAL STEAL!!! "; - break; - case 4: - m_pMessage = "TRY OUR HARDY PERENNIAL, IT)LL LAST YOU THE WHOLE YEAR. OUR BOBCATS AIN)T NO PUSSIES EITHER!!! "; - break; - case 5: - m_pMessage = "IF IT)S A GUARANTEE YOU'RE AFTER, GO SOMEWHERE ELSE, )CAPITAL) CARS ARE THAT GOOD THEY DON)T NEED GUARANTEES!!! "; - break; - case 6: - m_pMessage = "TOP DOLLAR OFFERED FOR YOUR OLD WHEELS, NOT YOUR CAR, JUST IT)S WHEELS. . . "; - break; - case 7: - m_pMessage = "THAT)S RIGHT WE)RE CAR SILLY. TEST DRIVE ANY CAR, YOU WON)T WANT TO BRING IT BACK!!! "; - break; - case 8: - m_pMessage = "FREE FLUFFY DICE WITH ALL PURCHASES. . ."; - break; - case 9: - if (FrontEndMenuManager.m_PrefsLanguage == CMenuManager::LANGUAGE_FRENCH || FrontEndMenuManager.m_PrefsLanguage == CMenuManager::LANGUAGE_GERMAN) - m_pMessage = "QUICK, TAKE A LOOK AT OUR CURRENT STOCK )CAUSE THESE AUTOS ARE MOVIN) FAST . . . "; - else - m_pMessage = "HTTP:((ROCKSTARGAMES.COM(GRANDTHEFTAUTO3(CAPITALAUTOS "; - break; - case 10: - m_pMessage = FindTimeMessage(); - break; - } - } - break; } m_MessageLength = (uint32)strlen(m_pMessage); @@ -1013,176 +778,6 @@ void CScrollBar::Render() CSprite::FlushSpriteBuffer(); } -// ---------- CTowerClock ---------- -void CTowerClock::Init(CVector position, float sizeX, float sizeY, uint8 red, uint8 green, uint8 blue, float drawDistance, float scale) -{ - m_bVisible = false; - m_Position = position; - m_Size.x = sizeX; - m_Size.y = sizeY; - m_Size.z = 0.0f; - m_uRed = red; - m_uGreen = green; - m_uBlue = blue; - m_fDrawDistance = drawDistance; - m_fScale = scale; -} - -void CTowerClock::Update() -{ - float distanceFromCamera = (TheCamera.GetPosition() - m_Position).Magnitude(); - if (distanceFromCamera < m_fDrawDistance) - { - m_bVisible = true; - if (distanceFromCamera < 0.75f * m_fDrawDistance) - m_fIntensity = 1.0f; - else - m_fIntensity = 1.0f - (distanceFromCamera - 0.75f * m_fDrawDistance) * 4.0f / m_fDrawDistance; - } - else - m_bVisible = false; -} - -RwIm3DVertex TempV[4]; -void CTowerClock::Render() -{ - if (TheCamera.IsSphereVisible(m_Position, m_fScale)) - { - // Calculate angle for each clock index - float angleHour = 2.0f * (float)PI * (CClock::GetMinutes() + 60.0f * CClock::GetHours()) / 720.0f; - float angleMinute = 2.0f * (float)PI * (CClock::GetSeconds() + 60.0f * CClock::GetMinutes()) / 3600.0f; - - // Prepare render states - RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)TRUE); - RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE); - RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); - RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDSRCALPHA); - RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDINVSRCALPHA); - RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR); - RwRenderStateSet(rwRENDERSTATETEXTURERASTER, nil); - - // Set vertices colors - RwIm3DVertexSetRGBA(&TempV[0], m_uRed, m_uGreen, m_uBlue, (uint8)(m_fIntensity * 255.0f)); - RwIm3DVertexSetRGBA(&TempV[1], m_uRed, m_uGreen, m_uBlue, (uint8)(m_fIntensity * 255.0f)); - RwIm3DVertexSetRGBA(&TempV[2], m_uRed, m_uGreen, m_uBlue, (uint8)(m_fIntensity * 255.0f)); - RwIm3DVertexSetRGBA(&TempV[3], m_uRed, m_uGreen, m_uBlue, (uint8)(m_fIntensity * 255.0f)); - - // Set vertices position - RwIm3DVertexSetPos(&TempV[0], m_Position.x, m_Position.y, m_Position.z); - RwIm3DVertexSetPos( - &TempV[1], - m_Position.x + Sin(angleMinute) * m_fScale * m_Size.x, - m_Position.y + Sin(angleMinute) * m_fScale * m_Size.y, - m_Position.z + Cos(angleMinute) * m_fScale - ); - RwIm3DVertexSetPos(&TempV[2], m_Position.x, m_Position.y, m_Position.z); - RwIm3DVertexSetPos( - &TempV[3], - m_Position.x + Sin(angleHour) * 0.75f * m_fScale * m_Size.x, - m_Position.y + Sin(angleHour) * 0.75f * m_fScale * m_Size.y, - m_Position.z + Cos(angleHour) * 0.75f * m_fScale - ); - - LittleTest(); - - // Draw lines - if (RwIm3DTransform(TempV, 4, nil, 0)) - { - RwIm3DRenderLine(0, 1); - RwIm3DRenderLine(2, 3); - RwIm3DEnd(); - } - } -} - -// ---------- CDigitalClock ---------- -void CDigitalClock::Init(CVector position, float sizeX, float sizeY, uint8 red, uint8 green, uint8 blue, float drawDistance, float scale) -{ - m_bVisible = false; - m_Position = position; - m_Size.x = sizeX; - m_Size.y = sizeY; - m_Size.z = 0.0f; - m_uRed = red; - m_uGreen = green; - m_uBlue = blue; - m_fDrawDistance = drawDistance; - m_fScale = scale; -} - -void CDigitalClock::Update() -{ - float distanceFromCamera = (TheCamera.GetPosition() - m_Position).Magnitude(); - if (distanceFromCamera < m_fDrawDistance) - { - m_bVisible = true; - if (distanceFromCamera < 0.75f * m_fDrawDistance) - m_fIntensity = 1.0f; - else - m_fIntensity = 1.0f - (distanceFromCamera - 0.75f * m_fDrawDistance) * 4.0f / m_fDrawDistance; - } - else - m_bVisible = false; -} - -void CDigitalClock::Render() -{ - if (TheCamera.IsSphereVisible(m_Position, 5.0f * m_fScale)) - { - CSprite::InitSpriteBuffer(); - - // Simulate flicker - float currentIntensity = m_fIntensity * CGeneral::GetRandomNumberInRange(0x300, 0x400) / 1024.0f; - - uint8 r = currentIntensity * m_uRed; - uint8 g = currentIntensity * m_uGreen; - uint8 b = currentIntensity * m_uBlue; - - // Set render states - RwRenderStateSet(rwRENDERSTATEZWRITEENABLE, (void*)FALSE); - RwRenderStateSet(rwRENDERSTATEVERTEXALPHAENABLE, (void*)TRUE); - RwRenderStateSet(rwRENDERSTATESRCBLEND, (void*)rwBLENDONE); - RwRenderStateSet(rwRENDERSTATEDESTBLEND, (void*)rwBLENDONE); - RwRenderStateSet(rwRENDERSTATETEXTUREFILTER, (void*)rwFILTERLINEAR); - RwRenderStateSet(rwRENDERSTATETEXTURERASTER, RwTextureGetRaster(gpCoronaTexture[0])); - RwRenderStateSet(rwRENDERSTATEZTESTENABLE, (void*)TRUE); - - const char* clockMessage = FindDigitalClockMessage(); - - CVector coronaCoord, screenCoord; - float screenW, screenH; - for (int c = 0; c < 5; ++c) // for each char to be displayed - { - for (int i = 0; i < 5; ++i) // for each column of coronas - { - for (int j = 0; j < 5; ++j) // for each row of coronas - { - if (ScrollCharSet[clockMessage[c] - ' '][i] & (1 << j)) - { - coronaCoord.x = m_Position.x + (8 * c + i) * m_Size.x * m_fScale / 8.0f; - coronaCoord.y = m_Position.y + (8 * c + i) * m_Size.y * m_fScale / 8.0f; - coronaCoord.z = m_Position.z + j * m_fScale / 8.0f; - - if (CSprite::CalcScreenCoors(coronaCoord, screenCoord, &screenW, &screenH, true)) - { - CSprite::RenderBufferedOneXLUSprite( - screenCoord.x, screenCoord.y, screenCoord.z, - screenW * m_fScale * 0.12f, - screenW * m_fScale * 0.12f, - r, g, b, - 255, - 1.0f / screenCoord.z, - 255); - } - } - } - } - } - - CSprite::FlushSpriteBuffer(); - } -} - void CSmokeTrail::RegisterPoint(CVector regPosition, float opacity) { bool bAddedNewPoint = false; diff --git a/src/render/Fluff.h b/src/render/Fluff.h index f61da350..98fb9f92 100644 --- a/src/render/Fluff.h +++ b/src/render/Fluff.h @@ -135,7 +135,7 @@ public: int16 SizeList(); }; -#define NUMMOVINGTHINGS 128 +#define NUMMOVINGTHINGS 48 class CMovingThings { @@ -149,6 +149,8 @@ public: static void Shutdown(); static void Update(); static void Render(); + static void PossiblyAddThisEntity(CEntity *pEnt); + static void RegisterOne(CEntity *pEnt, uint16 nType); }; class CScrollBar @@ -176,51 +178,7 @@ public: void SetVisibility(bool visible) { m_bVisible = visible; } bool IsVisible() { return m_bVisible; } - void Init(CVector, uint8, float, float, float, uint8, uint8, uint8, float); - void Update(); - void Render(); -}; - -class CTowerClock -{ -private: - CVector m_Position; - CVector m_Size; - float m_fDrawDistance; - float m_fScale; - uint8 m_uRed; - uint8 m_uGreen; - uint8 m_uBlue; - bool m_bVisible; - float m_fIntensity; - -public: - void SetVisibility(bool visible) { m_bVisible = visible; } - bool IsVisible() { return m_bVisible; } - - void Init(CVector, float, float, uint8, uint8, uint8, float, float); - void Update(); - void Render(); -}; - -class CDigitalClock -{ -private: - CVector m_Position; - CVector m_Size; - float m_fDrawDistance; - float m_fScale; - uint8 m_uRed; - uint8 m_uGreen; - uint8 m_uBlue; - bool m_bVisible; - float m_fIntensity; - -public: - void SetVisibility(bool visible) { m_bVisible = visible; } - bool IsVisible() { return m_bVisible; } - - void Init(CVector, float, float, uint8, uint8, uint8, float, float); + void Init(CVector pos1, CVector pos2, uint8 type, uint8 red, uint8 green, uint8 blue, float scale); void Update(); void Render(); }; diff --git a/src/skel/crossplatform.cpp b/src/skel/crossplatform.cpp index e9320c05..4b7d3d9a 100644 --- a/src/skel/crossplatform.cpp +++ b/src/skel/crossplatform.cpp @@ -26,28 +26,21 @@ void GetLocalTime_CP(SYSTEMTIME *out) { // Compatible with Linux/POSIX and MinGW on Windows #ifndef _WIN32 HANDLE FindFirstFile(const char* pathname, WIN32_FIND_DATA* firstfile) { - char pathCopy[32]; + char pathCopy[MAX_PATH]; + strcpy(pathCopy, pathname); - strncpy(pathCopy, pathname, 32); - char* folder = strtok(pathCopy, "*"); + char *folder = strtok(pathCopy, "*"); + char *extension = strtok(NULL, "*"); + // because strtok doesn't return NULL for last delimiter + if (extension - folder == strlen(pathname)) + extension = nil; + // Case-sensitivity and backslashes... - char *realFolder = casepath(folder); - char *extension = nil; + // Will be freed at the bottom + char *realFolder = casepath(folder); if (realFolder) { - realFolder[strlen(realFolder)] = '*'; - extension = strtok(NULL, "*"); - if (extension) { - strcat(realFolder, extension); - } - - strncpy(pathCopy, realFolder, 32); - free(realFolder); - folder = strtok(pathCopy, "*"); - } else { - // Wildcard (*) - if (strlen(folder) + 1 != strlen(pathname)) - extension = strtok(NULL, "*"); + folder = realFolder; } strncpy(firstfile->folder, folder, sizeof(firstfile->folder)); @@ -57,8 +50,11 @@ HANDLE FindFirstFile(const char* pathname, WIN32_FIND_DATA* firstfile) { else firstfile->extension[0] = '\0'; + if (realFolder) + free(realFolder); + HANDLE d; - if ((d = (HANDLE)opendir(folder)) == NULL || !FindNextFile(d, firstfile)) + if ((d = (HANDLE)opendir(firstfile->folder)) == NULL || !FindNextFile(d, firstfile)) return NULL; return d; diff --git a/src/text/Messages.cpp b/src/text/Messages.cpp index 257a47ce..a2409289 100644 --- a/src/text/Messages.cpp +++ b/src/text/Messages.cpp @@ -390,12 +390,11 @@ CMessages::InsertNumberInString(wchar *str, int32 n1, int32 n2, int32 n3, int32 if (str[c] == '~' && str[c + 1] == '1' && str[c + 2] == '~') { #endif c += 3; - for (int j = 0; j < outLen; j++) + for (int j = 0; j < outLen; ) *(outstr++) = wNumStr[j++]; i++; switch (i) { - case 0: sprintf(numStr, "%d", n1); break; case 1: sprintf(numStr, "%d", n2); break; case 2: sprintf(numStr, "%d", n3); break; case 3: sprintf(numStr, "%d", n4); break; @@ -805,7 +804,7 @@ CMessages::ClearThisBigPrint(wchar *str) } BIGMessages[style].m_Stack[i].m_pText = nil; } else { - BIGMessages[style].m_Stack[0].m_pText = 0; + BIGMessages[style].m_Stack[0].m_pText = nil; i = 0; while (i < 3) { if (BIGMessages[style].m_Stack[i + 1].m_pText == nil) diff --git a/src/vehicles/Train.cpp b/src/vehicles/Train.cpp index 546f72c2..fb8361c5 100644 --- a/src/vehicles/Train.cpp +++ b/src/vehicles/Train.cpp @@ -663,6 +663,7 @@ PlayAnnouncement(uint8 sound, uint8 station) void ProcessTrainAnnouncements(void) { +#ifdef GTA_TRAIN for (int i = 0; i < ARRAY_SIZE(StationDist); i++) { for (int j = 0; j < ARRAY_SIZE(EngineTrackPosition); j++) { if (!bTrainArrivalAnnounced[i]) { @@ -691,6 +692,7 @@ ProcessTrainAnnouncements(void) } } } +#endif } void diff --git a/src/weapons/Weapon.cpp b/src/weapons/Weapon.cpp index 5d9686b5..1d32487b 100644 --- a/src/weapons/Weapon.cpp +++ b/src/weapons/Weapon.cpp @@ -933,26 +933,25 @@ CWeapon::FireInstantHit(CEntity *shooter, CVector *fireSource) } else if ( shooter == FindPlayerPed() && TheCamera.Cams[0].Using3rdPersonMouseCam() ) { - CVector src, trgt; - TheCamera.Find3rdPersonCamTargetVector(info->m_fRange, *fireSource, src, trgt); + TheCamera.Find3rdPersonCamTargetVector(info->m_fRange, *fireSource, source, target); CWorld::bIncludeBikers = true; CWorld::bIncludeDeadPeds = true; CWorld::bIncludeCarTyres = true; - CWorld::ProcessLineOfSight(src, trgt, point, victim, true, true, true, true, true, false, false, true); + CWorld::ProcessLineOfSight(source, target, point, victim, true, true, true, true, true, false, false, true); CWorld::bIncludeBikers = false; CWorld::bIncludeDeadPeds = false; CWorld::bIncludeCarTyres = false; if (victim) - CheckForShootingVehicleOccupant(&victim, &point, m_eWeaponType, src, trgt); + CheckForShootingVehicleOccupant(&victim, &point, m_eWeaponType, source, target); int32 rotSpeed = 1; if ( m_eWeaponType == WEAPONTYPE_M4 ) rotSpeed = 4; CVector bulletPos; - if ( CHeli::TestBulletCollision(&src, &trgt, &bulletPos, 4) ) + if ( CHeli::TestBulletCollision(&source, &target, &bulletPos, 4) ) { for ( int32 i = 0; i < 16; i++ ) CParticle::AddParticle(PARTICLE_SPARK, bulletPos, CVector(0.0f, 0.0f, 0.0f), nil, 0.0f, rotSpeed); |