Merge pull request #2 from GTAmodding/miami

Miami
This commit is contained in:
Fire_Head 2020-05-27 21:51:40 +03:00 committed by GitHub
commit e4649b41e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 3735 additions and 4785 deletions

2
librw

@ -1 +1 @@
Subproject commit 84c582c1d7a64a213523b8e4c8211f8b7a4fdcd1 Subproject commit 6ff378bb16007ad003b1a71996944a20f2e76556

View file

@ -114,3 +114,17 @@ DLLEXPORT void WINAPI AIL_set_stream_ms_position(HSTREAM S, S32 milliseconds);
DLLEXPORT void WINAPI AIL_set_stream_volume(HSTREAM stream, S32 volume); DLLEXPORT void WINAPI AIL_set_stream_volume(HSTREAM stream, S32 volume);
DLLEXPORT void WINAPI AIL_set_stream_pan(HSTREAM stream, S32 pan); DLLEXPORT void WINAPI AIL_set_stream_pan(HSTREAM stream, S32 pan);
DLLEXPORT S32 WINAPI AIL_stream_status(HSTREAM stream); DLLEXPORT S32 WINAPI AIL_stream_status(HSTREAM stream);
typedef U32(WINAPI* AIL_file_open_callback)(char const * Filename, U32 * FileHandle);
typedef void (WINAPI* AIL_file_close_callback) (U32 FileHandle);
#define AIL_FILE_SEEK_BEGIN 0
#define AIL_FILE_SEEK_CURRENT 1
#define AIL_FILE_SEEK_END 2
typedef S32(WINAPI* AIL_file_seek_callback) (U32 FileHandle, S32 Offset, U32 Type);
typedef U32(WINAPI* AIL_file_read_callback) (U32 FileHandle, void* Buffer, U32 Bytes);
DLLEXPORT void WINAPI AIL_set_file_callbacks(AIL_file_open_callback opencb, AIL_file_close_callback closecb, AIL_file_seek_callback seekcb, AIL_file_read_callback readcb);

Binary file not shown.

View file

@ -24,85 +24,81 @@ const struct {
const char *szTrackName; const char *szTrackName;
int iTrackId; int iTrackId;
} musicNameIdAssoc[] = { } musicNameIdAssoc[] = {
{ "JB", STREAMED_SOUND_NEWS_INTRO }, { "ASS_1", STREAMED_SOUND_CUTSCENE_ASS_1 },
{ "BET", STREAMED_SOUND_BANK_INTRO }, { "ASS_2", STREAMED_SOUND_CUTSCENE_ASS_2 },
{ "L1_LG", STREAMED_SOUND_CUTSCENE_LUIGI1_LG }, { "BANK_1", STREAMED_SOUND_CUTSCENE_BANK_1 },
{ "L2_DSB", STREAMED_SOUND_CUTSCENE_LUIGI2_DSB }, { "BANK_2A", STREAMED_SOUND_CUTSCENE_BANK_2A },
{ "L3_DM", STREAMED_SOUND_CUTSCENE_LUIGI3_DM }, { "BANK_2B", STREAMED_SOUND_CUTSCENE_BANK_2B },
{ "L4_PAP", STREAMED_SOUND_CUTSCENE_LUIGI4_PAP }, { "BANK_3A", STREAMED_SOUND_CUTSCENE_BANK_3A },
{ "L5_TFB", STREAMED_SOUND_CUTSCENE_LUIGI5_TFB }, { "BANK_3B", STREAMED_SOUND_CUTSCENE_BANK_3B },
{ "J0_DM2", STREAMED_SOUND_CUTSCENE_JOEY0_DM2 }, { "BANK_4", STREAMED_SOUND_CUTSCENE_BANK_4 },
{ "J1_LFL", STREAMED_SOUND_CUTSCENE_JOEY1_LFL }, { "BIKE_1", STREAMED_SOUND_CUTSCENE_BIKE_1 },
{ "J2_KCL", STREAMED_SOUND_CUTSCENE_JOEY2_KCL }, { "BIKE_2", STREAMED_SOUND_CUTSCENE_BIKE_2 },
{ "J3_VH", STREAMED_SOUND_CUTSCENE_JOEY3_VH }, { "BIKE_3", STREAMED_SOUND_CUTSCENE_BIKE_3 },
{ "J4_ETH", STREAMED_SOUND_CUTSCENE_JOEY4_ETH }, { "BUD_1", STREAMED_SOUND_CUTSCENE_BUD_1 },
{ "J5_DST", STREAMED_SOUND_CUTSCENE_JOEY5_DST }, { "BUD_2", STREAMED_SOUND_CUTSCENE_BUD_2 },
{ "J6_TBJ", STREAMED_SOUND_CUTSCENE_JOEY6_TBJ }, { "BUD_3", STREAMED_SOUND_CUTSCENE_BUD_3 },
{ "T1_TOL", STREAMED_SOUND_CUTSCENE_TONI1_TOL }, { "CAP_1", STREAMED_SOUND_CUTSCENE_CAP_1 },
{ "T2_TPU", STREAMED_SOUND_CUTSCENE_TONI2_TPU }, { "CAR_1", STREAMED_SOUND_CUTSCENE_CAR_1 },
{ "T3_MAS", STREAMED_SOUND_CUTSCENE_TONI3_MAS }, { "CNT_1A", STREAMED_SOUND_CUTSCENE_CNT_1A },
{ "T4_TAT", STREAMED_SOUND_CUTSCENE_TONI4_TAT }, { "CNT_1B", STREAMED_SOUND_CUTSCENE_CNT_1B },
{ "T5_BF", STREAMED_SOUND_CUTSCENE_TONI5_BF }, { "CNT_2", STREAMED_SOUND_CUTSCENE_CNT_2 },
{ "S0_MAS", STREAMED_SOUND_CUTSCENE_SAL0_MAS }, { "COK_1", STREAMED_SOUND_CUTSCENE_COK_1 },
{ "S1_PF", STREAMED_SOUND_CUTSCENE_SAL1_PF }, { "COK_2A", STREAMED_SOUND_CUTSCENE_COK_2A },
{ "S2_CTG", STREAMED_SOUND_CUTSCENE_SAL2_CTG }, { "COK_2B", STREAMED_SOUND_CUTSCENE_COK_2B },
{ "S3_RTC", STREAMED_SOUND_CUTSCENE_SAL3_RTC }, { "COK_3", STREAMED_SOUND_CUTSCENE_COK_3 },
{ "S5_LRQ", STREAMED_SOUND_CUTSCENE_SAL5_LRQ }, { "COK_4A", STREAMED_SOUND_CUTSCENE_COK_4A },
{ "S4_BDBA", STREAMED_SOUND_CUTSCENE_SAL4_BDBA }, { "COK_4A2", STREAMED_SOUND_CUTSCENE_COK_4A2 },
{ "S4_BDBB", STREAMED_SOUND_CUTSCENE_SAL4_BDBB }, { "COK_4B", STREAMED_SOUND_CUTSCENE_COK_4B },
{ "S2_CTG2", STREAMED_SOUND_CUTSCENE_SAL2_CTG2 }, { "COL_1", STREAMED_SOUND_CUTSCENE_COL_1 },
{ "S4_BDBD", STREAMED_SOUND_CUTSCENE_SAL4_BDBD }, { "COL_2", STREAMED_SOUND_CUTSCENE_COL_2 },
{ "S5_LRQB", STREAMED_SOUND_CUTSCENE_SAL5_LRQB }, { "COL_3A", STREAMED_SOUND_CUTSCENE_COL_3A },
{ "S5_LRQC", STREAMED_SOUND_CUTSCENE_SAL5_LRQC }, { "COL_4A", STREAMED_SOUND_CUTSCENE_COL_4A },
{ "A1_SS0", STREAMED_SOUND_CUTSCENE_ASUKA_1_SSO }, { "COL_5A", STREAMED_SOUND_CUTSCENE_COL_5A },
{ "A2_PP", STREAMED_SOUND_CUTSCENE_ASUKA_2_PP }, { "COL_5B", STREAMED_SOUND_CUTSCENE_COL_5B },
{ "A3_SS", STREAMED_SOUND_CUTSCENE_ASUKA_3_SS }, { "CUB_1", STREAMED_SOUND_CUTSCENE_CUB_1 },
{ "A4_PDR", STREAMED_SOUND_CUTSCENE_ASUKA_4_PDR }, { "CUB_2", STREAMED_SOUND_CUTSCENE_CUB_2 },
{ "A5_K2FT", STREAMED_SOUND_CUTSCENE_ASUKA_5_K2FT}, { "CUB_3", STREAMED_SOUND_CUTSCENE_CUB_3 },
{ "K1_KBO", STREAMED_SOUND_CUTSCENE_KENJI1_KBO }, { "CUB_4", STREAMED_SOUND_CUTSCENE_CUB_4 },
{ "K2_GIS", STREAMED_SOUND_CUTSCENE_KENJI2_GIS }, { "DRUG_1", STREAMED_SOUND_CUTSCENE_DRUG_1 },
{ "K3_DS", STREAMED_SOUND_CUTSCENE_KENJI3_DS }, { "FIN", STREAMED_SOUND_CUTSCENE_FIN },
{ "K4_SHI", STREAMED_SOUND_CUTSCENE_KENJI4_SHI }, { "FIN_2", STREAMED_SOUND_CUTSCENE_FIN2 },
{ "K5_SD", STREAMED_SOUND_CUTSCENE_KENJI5_SD }, { "FINALE", STREAMED_SOUND_CUTSCENE_FINALE },
{ "R0_PDR2", STREAMED_SOUND_CUTSCENE_RAY0_PDR2 }, { "HAT_1", STREAMED_SOUND_CUTSCENE_HAT_1 },
{ "R1_SW", STREAMED_SOUND_CUTSCENE_RAY1_SW }, { "HAT_2", STREAMED_SOUND_CUTSCENE_HAT_2 },
{ "R2_AP", STREAMED_SOUND_CUTSCENE_RAY2_AP }, { "HAT_3", STREAMED_SOUND_CUTSCENE_HAT_3 },
{ "R3_ED", STREAMED_SOUND_CUTSCENE_RAY3_ED }, { "ICE_1", STREAMED_SOUND_CUTSCENE_ICE_1 },
{ "R4_GF", STREAMED_SOUND_CUTSCENE_RAY4_GF }, { "INT_A", STREAMED_SOUND_CUTSCENE_INT_A },
{ "R5_PB", STREAMED_SOUND_CUTSCENE_RAY5_PB }, { "INT_B", STREAMED_SOUND_CUTSCENE_INT_B },
{ "R6_MM", STREAMED_SOUND_CUTSCENE_RAY6_MM }, { "INT_D", STREAMED_SOUND_CUTSCENE_INT_D },
{ "D1_STOG", STREAMED_SOUND_CUTSCENE_DONALD1_STOG }, { "INT_M", STREAMED_SOUND_CUTSCENE_INT_M },
{ "D2_KK", STREAMED_SOUND_CUTSCENE_DONALD2_KK }, { "LAW_1A", STREAMED_SOUND_CUTSCENE_LAW_1A },
{ "D3_ADO", STREAMED_SOUND_CUTSCENE_DONALD3_ADO }, { "LAW_1B", STREAMED_SOUND_CUTSCENE_LAW_1B },
{ "D5_ES", STREAMED_SOUND_CUTSCENE_DONALD5_ES }, { "LAW_2A", STREAMED_SOUND_CUTSCENE_LAW_2A },
{ "D7_MLD", STREAMED_SOUND_CUTSCENE_DONALD7_MLD }, { "LAW_2B", STREAMED_SOUND_CUTSCENE_LAW_2B },
{ "D4_GTA", STREAMED_SOUND_CUTSCENE_DONALD4_GTA }, { "LAW_2C", STREAMED_SOUND_CUTSCENE_LAW_2C },
{ "D4_GTA2", STREAMED_SOUND_CUTSCENE_DONALD4_GTA2 }, { "LAW_3", STREAMED_SOUND_CUTSCENE_LAW_3 },
{ "D6_STS", STREAMED_SOUND_CUTSCENE_DONALD6_STS }, { "LAW_4", STREAMED_SOUND_CUTSCENE_LAW_4 },
{ "A6_BAIT", STREAMED_SOUND_CUTSCENE_ASUKA6_BAIT }, { "PHIL_1", STREAMED_SOUND_CUTSCENE_PHIL_1 },
{ "A7_ETG", STREAMED_SOUND_CUTSCENE_ASUKA7_ETG }, { "PHIL_2", STREAMED_SOUND_CUTSCENE_PHIL_2 },
{ "A8_PS", STREAMED_SOUND_CUTSCENE_ASUKA8_PS }, { "PORN_1", STREAMED_SOUND_CUTSCENE_PORN_1 },
{ "A9_ASD", STREAMED_SOUND_CUTSCENE_ASUKA9_ASD }, { "PORN_2", STREAMED_SOUND_CUTSCENE_PORN_2 },
{ "K4_SHI2", STREAMED_SOUND_CUTSCENE_KENJI4_SHI2 }, { "PORN_3", STREAMED_SOUND_CUTSCENE_PORN_3 },
{ "C1_TEX", STREAMED_SOUND_CUTSCENE_CATALINA1_TEX }, { "PORN_4", STREAMED_SOUND_CUTSCENE_PORN_4 },
{ "EL_PH1", STREAMED_SOUND_CUTSCENE_ELBURRO1_PH1 }, { "RESC_1A", STREAMED_SOUND_CUTSCENE_RESC_1A },
{ "EL_PH2", STREAMED_SOUND_CUTSCENE_ELBURRO2_PH2 }, { "ROK_1", STREAMED_SOUND_CUTSCENE_ROK_1 },
{ "EL_PH3", STREAMED_SOUND_CUTSCENE_ELBURRO3_PH3 }, { "ROK_2", STREAMED_SOUND_CUTSCENE_ROK_2 },
{ "EL_PH4", STREAMED_SOUND_CUTSCENE_ELBURRO4_PH4 }, { "ROK_3A", STREAMED_SOUND_CUTSCENE_ROK_3A },
{ "YD_PH1", STREAMED_SOUND_CUTSCENE_YARDIE_PH1 }, { "STRIPA", STREAMED_SOUND_CUTSCENE_STRIPA },
{ "YD_PH2", STREAMED_SOUND_CUTSCENE_YARDIE_PH2 }, { "TAX_1", STREAMED_SOUND_CUTSCENE_TAX_1 },
{ "YD_PH3", STREAMED_SOUND_CUTSCENE_YARDIE_PH3 }, { "TEX_1", STREAMED_SOUND_CUTSCENE_TEX_1 },
{ "YD_PH4", STREAMED_SOUND_CUTSCENE_YARDIE_PH4 }, { "TEX_2", STREAMED_SOUND_CUTSCENE_TEX_2 },
{ "HD_PH1", STREAMED_SOUND_CUTSCENE_HOODS_PH1 }, { "TEX_3", STREAMED_SOUND_CUTSCENE_TEX_3 },
{ "HD_PH2", STREAMED_SOUND_CUTSCENE_HOODS_PH2 }, { "GSPOT", STREAMED_SOUND_CUTSCENE_GLIGHT },
{ "HD_PH3", STREAMED_SOUND_CUTSCENE_HOODS_PH3 }, { "FIST", STREAMED_SOUND_CUTSCENE_FIST },
{ "HD_PH4", STREAMED_SOUND_CUTSCENE_HOODS_PH4 }, { "EL_PH1", STREAMED_SOUND_CUTSCENE_ELBURRO1_PH1 },
{ "HD_PH5", STREAMED_SOUND_CUTSCENE_HOODS_PH5 }, { "EL_PH2", STREAMED_SOUND_CUTSCENE_ELBURRO2_PH2 },
{ "MT_PH1", STREAMED_SOUND_CUTSCENE_MARTY_PH1 }, { NULL, 0 }
{ "MT_PH2", STREAMED_SOUND_CUTSCENE_MARTY_PH2 },
{ "MT_PH3", STREAMED_SOUND_CUTSCENE_MARTY_PH3 },
{ "MT_PH4", STREAMED_SOUND_CUTSCENE_MARTY_PH4 },
{ NULL, 0 }
}; };
int int

File diff suppressed because it is too large Load diff

View file

@ -288,18 +288,17 @@ public:
/// processX - main logic of adding new sounds /// processX - main logic of adding new sounds
void ProcessActiveQueues(); void ProcessActiveQueues();
bool ProcessAirBrakes(cVehicleParams *params); bool ProcessAirBrakes(cVehicleParams *params);
void ProcessAirportScriptObject(uint8 sound);
bool ProcessBoatEngine(cVehicleParams *params); bool ProcessBoatEngine(cVehicleParams *params);
bool ProcessBoatMovingOverWater(cVehicleParams *params); bool ProcessBoatMovingOverWater(cVehicleParams *params);
#ifdef GTA_BRIDGE
void ProcessBridge(); void ProcessBridge();
void ProcessBridgeMotor(); void ProcessBridgeMotor();
void ProcessBridgeOneShots(); void ProcessBridgeOneShots();
void ProcessBridgeWarning(); void ProcessBridgeWarning();
#endif
bool ProcessCarBombTick(cVehicleParams *params); bool ProcessCarBombTick(cVehicleParams *params);
void ProcessCesna(cVehicleParams *params); void ProcessCesna(cVehicleParams *params);
void ProcessCinemaScriptObject(uint8 sound); //void ProcessCrane();
void ProcessCrane();
void ProcessDocksScriptObject(uint8 sound);
bool ProcessEngineDamage(cVehicleParams *params); bool ProcessEngineDamage(cVehicleParams *params);
void ProcessEntity(int32 sound); void ProcessEntity(int32 sound);
void ProcessExplosions(int32 explosion); void ProcessExplosions(int32 explosion);
@ -308,7 +307,6 @@ public:
void ProcessFrontEnd(); void ProcessFrontEnd();
void ProcessGarages(); void ProcessGarages();
bool ProcessHelicopter(cVehicleParams *params); bool ProcessHelicopter(cVehicleParams *params);
void ProcessHomeScriptObject(uint8 sound);
void ProcessJumbo(cVehicleParams *); void ProcessJumbo(cVehicleParams *);
void ProcessJumboAccel(CPlane *plane); void ProcessJumboAccel(CPlane *plane);
void ProcessJumboDecel(CPlane *plane); void ProcessJumboDecel(CPlane *plane);
@ -316,7 +314,6 @@ public:
void ProcessJumboLanding(CPlane *plane); void ProcessJumboLanding(CPlane *plane);
void ProcessJumboTakeOff(CPlane *plane); void ProcessJumboTakeOff(CPlane *plane);
void ProcessJumboTaxi(); void ProcessJumboTaxi();
void ProcessLaunderetteScriptObject(uint8 sound);
void ProcessLoopingScriptObject(uint8 sound); void ProcessLoopingScriptObject(uint8 sound);
void ProcessMissionAudio(); void ProcessMissionAudio();
void ProcessModelCarEngine(cVehicleParams *params); void ProcessModelCarEngine(cVehicleParams *params);
@ -326,17 +323,15 @@ public:
void ProcessPhysical(int32 id); void ProcessPhysical(int32 id);
void ProcessPlane(cVehicleParams *params); void ProcessPlane(cVehicleParams *params);
void ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *automobile); void ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *automobile);
void ProcessPoliceCellBeatingScriptObject(uint8 sound);
void ProcessPornCinema(uint8 sound);
void ProcessProjectiles(); void ProcessProjectiles();
void ProcessRainOnVehicle(cVehicleParams *params); void ProcessRainOnVehicle(cVehicleParams *params);
void ProcessReverb() const; void ProcessReverb() const;
bool ProcessReverseGear(cVehicleParams *params); bool ProcessReverseGear(cVehicleParams *params);
void ProcessSawMillScriptObject(uint8 sound);
void ProcessScriptObject(int32 id); void ProcessScriptObject(int32 id);
void ProcessShopScriptObject(uint8 sound);
void ProcessSpecial(); void ProcessSpecial();
#ifdef GTA_TRAIN
bool ProcessTrainNoise(cVehicleParams *params); bool ProcessTrainNoise(cVehicleParams *params);
#endif
void ProcessVehicle(CVehicle *vehicle); void ProcessVehicle(CVehicle *vehicle);
bool ProcessVehicleDoors(cVehicleParams *params); bool ProcessVehicleDoors(cVehicleParams *params);
void ProcessVehicleEngine(cVehicleParams *params); void ProcessVehicleEngine(cVehicleParams *params);
@ -349,7 +344,6 @@ public:
void ProcessWaterCannon(int32); void ProcessWaterCannon(int32);
void ProcessWeather(int32 id); void ProcessWeather(int32 id);
bool ProcessWetRoadNoise(cVehicleParams *params); bool ProcessWetRoadNoise(cVehicleParams *params);
void ProcessWorkShopScriptObject(uint8 sound);
int32 RandomDisplacement(uint32 seed) const; int32 RandomDisplacement(uint32 seed) const;
void ReacquireDigitalHandle() const; void ReacquireDigitalHandle() const;

File diff suppressed because it is too large Load diff

View file

@ -117,7 +117,7 @@ cMusicManager::DisplayRadioStationName()
while(gRetuneCounter) { while(gRetuneCounter) {
if(pRetune == RADIO_OFF) { if(pRetune == RADIO_OFF) {
pRetune = HEAD_RADIO; pRetune = WILDSTYLE;
} else if(pRetune < USERTRACK) { } else if(pRetune < USERTRACK) {
pRetune = pRetune + 1; pRetune = pRetune + 1;
} }
@ -131,20 +131,20 @@ cMusicManager::DisplayRadioStationName()
wchar *string = nil; wchar *string = nil;
switch(pRetune) { switch(pRetune) {
case HEAD_RADIO: string = TheText.Get("FEA_FM0"); break; case WILDSTYLE: string = TheText.Get("FEA_FM0"); break;
case DOUBLE_CLEF: string = TheText.Get("FEA_FM1"); break; case FLASH_FM: string = TheText.Get("FEA_FM1"); break;
case JAH_RADIO: string = TheText.Get("FEA_FM2"); break; case KCHAT: string = TheText.Get("FEA_FM2"); break;
case RISE_FM: string = TheText.Get("FEA_FM3"); break; case FEVER: string = TheText.Get("FEA_FM3"); break;
case LIPS_106: string = TheText.Get("FEA_FM4"); break; case V_ROCK: string = TheText.Get("FEA_FM4"); break;
case GAME_FM: string = TheText.Get("FEA_FM5"); break; case VCPR: string = TheText.Get("FEA_FM5"); break;
case MSX_FM: string = TheText.Get("FEA_FM6"); break; case RADIO_ESPANTOSO: string = TheText.Get("FEA_FM6"); break;
case FLASHBACK: string = TheText.Get("FEA_FM7"); break; case EMOTION: string = TheText.Get("FEA_FM7"); break;
case CHATTERBOX: string = TheText.Get("FEA_FM8"); break; case WAVE: string = TheText.Get("FEA_FM8"); break;
case USERTRACK: string = TheText.Get("FEA_FM9"); break; case USERTRACK: string = TheText.Get("FEA_FM9"); break;
default: return; default: return;
}; };
if(pRetune > CHATTERBOX && !SampleManager.IsMP3RadioChannelAvailable()) { return; } if(pRetune > WAVE && !SampleManager.IsMP3RadioChannelAvailable()) { return; }
if(string && pCurrentStation != string || if(string && pCurrentStation != string ||
m_nCurrentStreamedSound == STREAMED_SOUND_RADIO_MP3_PLAYER && m_nCurrentStreamedSound == STREAMED_SOUND_RADIO_MP3_PLAYER &&
@ -223,7 +223,7 @@ cMusicManager::Initialise()
m_bDoTrackService = false; m_bDoTrackService = false;
m_bIgnoreTimeDelay = false; m_bIgnoreTimeDelay = false;
m_bRadioSetByScript = false; m_bRadioSetByScript = false;
m_nRadioStation = HEAD_RADIO; m_nRadioStation = WILDSTYLE;
m_nRadioPosition = -1; m_nRadioPosition = -1;
m_nRadioInCar = NO_STREAMED_SOUND; m_nRadioInCar = NO_STREAMED_SOUND;
gNumRetunePresses = 0; gNumRetunePresses = 0;
@ -297,19 +297,19 @@ cMusicManager::ChangeMusicMode(uint8 mode)
uint8 uint8
cMusicManager::GetRadioInCar(void) cMusicManager::GetRadioInCar(void)
{ {
if (!m_bIsInitialised) return HEAD_RADIO; if (!m_bIsInitialised) return WILDSTYLE;
if (PlayerInCar()) { if (PlayerInCar()) {
CVehicle *veh = FindPlayerVehicle(); CVehicle *veh = FindPlayerVehicle();
if (veh != nil){ if (veh != nil){
if (UsesPoliceRadio(veh)) { if (UsesPoliceRadio(veh)) {
if (m_nRadioInCar == NO_STREAMED_SOUND || CReplay::IsPlayingBack() && AudioManager.m_nUserPause) if (m_nRadioInCar == NO_STREAMED_SOUND || (CReplay::IsPlayingBack() && AudioManager.m_nUserPause == 0))
return POLICE_RADIO; return POLICE_RADIO;
return m_nRadioInCar; return m_nRadioInCar;
} else return veh->m_nRadioStation; } else return veh->m_nRadioStation;
} }
} }
if (m_nRadioInCar == NO_STREAMED_SOUND || CReplay::IsPlayingBack() && AudioManager.m_nUserPause) if (m_nRadioInCar == NO_STREAMED_SOUND || (CReplay::IsPlayingBack() && AudioManager.m_nUserPause == 0))
return RADIO_OFF; return RADIO_OFF;
return m_nRadioInCar; return m_nRadioInCar;
} }
@ -405,9 +405,6 @@ cMusicManager::ServiceFrontEndMode()
if (!AudioManager.m_nUserPause) if (!AudioManager.m_nUserPause)
ChangeMusicMode(MUSICMODE_GAME); ChangeMusicMode(MUSICMODE_GAME);
break; break;
case STREAMED_SOUND_GAME_COMPLETED:
ChangeMusicMode(MUSICMODE_GAME);
break;
default: default:
break; break;
} }
@ -626,14 +623,14 @@ cMusicManager::StopFrontEndTrack()
} }
void void
cMusicManager::PlayAnnouncement(uint8 announcement) cMusicManager::PlayAnnouncement(uint32 announcement)
{ {
if (IsInitialised() && !m_bDisabled && !m_bAnnouncementInProgress) if (IsInitialised() && !m_bDisabled && !m_bAnnouncementInProgress)
m_nAnnouncement = announcement; m_nAnnouncement = announcement;
} }
void void
cMusicManager::PlayFrontEndTrack(uint8 track, uint8 bPlayInFrontend) cMusicManager::PlayFrontEndTrack(uint32 track, uint8 bPlayInFrontend)
{ {
if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS) { if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS) {
if (m_nMusicMode == MUSICMODE_GAME) { if (m_nMusicMode == MUSICMODE_GAME) {
@ -668,7 +665,7 @@ cMusicManager::PlayFrontEndTrack(uint8 track, uint8 bPlayInFrontend)
} }
void void
cMusicManager::PreloadCutSceneMusic(uint8 track) cMusicManager::PreloadCutSceneMusic(uint32 track)
{ {
if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS && m_nMusicMode == MUSICMODE_CUTSCENE) { if (IsInitialised() && !m_bDisabled && track < TOTAL_STREAMED_SOUNDS && m_nMusicMode == MUSICMODE_CUTSCENE) {
AudioManager.ResetPoliceRadio(); AudioManager.ResetPoliceRadio();
@ -848,7 +845,7 @@ cMusicManager::ServiceAnnouncement()
return false; return false;
} }
uint8 uint32
cMusicManager::GetCarTuning() cMusicManager::GetCarTuning()
{ {
CVehicle *veh = FindPlayerVehicle(); CVehicle *veh = FindPlayerVehicle();
@ -859,12 +856,12 @@ cMusicManager::GetCarTuning()
return veh->m_nRadioStation; return veh->m_nRadioStation;
} }
uint8 uint32
cMusicManager::GetNextCarTuning() cMusicManager::GetNextCarTuning()
{ {
CVehicle *veh = FindPlayerVehicle(); CVehicle *veh = FindPlayerVehicle();
if (veh == nil) return RADIO_OFF; if (veh == nil) return RADIO_OFF;
if (UsesPoliceRadio(veh)) return POLICE_RADIO; if (UsesPoliceRadio(veh)) return STREAMED_SOUND_RADIO_POLICE;
if (gNumRetunePresses != 0) { if (gNumRetunePresses != 0) {
if (SampleManager.IsMP3RadioChannelAvailable()) { if (SampleManager.IsMP3RadioChannelAvailable()) {
if (veh->m_nRadioStation == RADIO_OFF) if (veh->m_nRadioStation == RADIO_OFF)
@ -877,7 +874,7 @@ cMusicManager::GetNextCarTuning()
} else if (gNumRetunePresses + veh->m_nRadioStation >= USERTRACK) { } else if (gNumRetunePresses + veh->m_nRadioStation >= USERTRACK) {
while (gNumRetunePresses) { while (gNumRetunePresses) {
if (veh->m_nRadioStation == RADIO_OFF) if (veh->m_nRadioStation == RADIO_OFF)
veh->m_nRadioStation = HEAD_RADIO; veh->m_nRadioStation = WILDSTYLE;
else if (veh->m_nRadioStation < USERTRACK) else if (veh->m_nRadioStation < USERTRACK)
++veh->m_nRadioStation; ++veh->m_nRadioStation;

View file

@ -18,12 +18,12 @@ public:
bool m_bIsInitialised; bool m_bIsInitialised;
bool m_bDisabled; bool m_bDisabled;
uint8 m_nMusicMode; uint8 m_nMusicMode;
uint8 m_nCurrentStreamedSound; uint32 m_nCurrentStreamedSound;
uint8 m_nPreviousStreamedSound; uint32 m_nPreviousStreamedSound;
bool m_bFrontendTrackFinished; bool m_bFrontendTrackFinished;
bool m_bPlayInFrontend; bool m_bPlayInFrontend;
bool m_bSetNextStation; bool m_bSetNextStation;
uint8 m_nAnnouncement; uint32 m_nAnnouncement;
bool m_bPreviousPlayerInCar; bool m_bPreviousPlayerInCar;
bool m_bPlayerInCar; bool m_bPlayerInCar;
bool m_bAnnouncementInProgress; bool m_bAnnouncementInProgress;
@ -36,9 +36,9 @@ public:
bool m_bIgnoreTimeDelay; bool m_bIgnoreTimeDelay;
bool m_bDontServiceAmbienceTrack; bool m_bDontServiceAmbienceTrack;
bool m_bRadioSetByScript; bool m_bRadioSetByScript;
uint8 m_nRadioStation; uint32 m_nRadioStation;
int32 m_nRadioPosition; int32 m_nRadioPosition;
uint8 m_nRadioInCar; uint32 m_nRadioInCar;
public: public:
cMusicManager(); cMusicManager();
@ -55,9 +55,9 @@ public:
bool PlayerInCar(); bool PlayerInCar();
void DisplayRadioStationName(); void DisplayRadioStationName();
void PlayAnnouncement(uint8); void PlayAnnouncement(uint32);
void PlayFrontEndTrack(uint8, uint8); void PlayFrontEndTrack(uint32, uint8);
void PreloadCutSceneMusic(uint8); void PreloadCutSceneMusic(uint32);
void PlayPreloadedCutSceneMusic(void); void PlayPreloadedCutSceneMusic(void);
void StopCutSceneMusic(void); void StopCutSceneMusic(void);
uint8 GetRadioInCar(void); uint8 GetRadioInCar(void);
@ -79,8 +79,8 @@ public:
void ComputeAmbienceVol(uint8 reset, uint8& outVolume); void ComputeAmbienceVol(uint8 reset, uint8& outVolume);
bool ServiceAnnouncement(); bool ServiceAnnouncement();
uint8 GetCarTuning(); uint32 GetCarTuning();
uint8 GetNextCarTuning(); uint32 GetNextCarTuning();
bool ChangeRadioChannel(); bool ChangeRadioChannel();
}; };

View file

@ -24,8 +24,6 @@ struct tPoliceRadioZone {
}; };
tPoliceRadioZone ZoneSfx[NUMAUDIOZONES]; tPoliceRadioZone ZoneSfx[NUMAUDIOZONES];
char SubZo2Label[8];
char SubZo3Label[8];
int32 g_nMissionAudioSfx = TOTAL_AUDIO_SAMPLES; int32 g_nMissionAudioSfx = TOTAL_AUDIO_SAMPLES;
int8 g_nMissionAudioPlayingStatus = 2; int8 g_nMissionAudioPlayingStatus = 2;
@ -42,48 +40,22 @@ cAudioManager::InitialisePoliceRadioZones()
strcpy(ZoneSfx[i].m_aName, name); \ strcpy(ZoneSfx[i].m_aName, name); \
ZoneSfx[i].m_nSampleIndex = sample; ZoneSfx[i].m_nSampleIndex = sample;
SETZONESFX(0, "HOSPI_2", SFX_POLICE_RADIO_ROCKFORD); SETZONESFX(0, "VICE_C", SFX_POLICE_RADIO_VICE_CITY);
SETZONESFX(1, "CONSTRU", SFX_POLICE_RADIO_FORT_STAUNTON); SETZONESFX(1, "IND_ZON", SFX_POLICE_RADIO_VICE_CITY_BEACH);
SETZONESFX(2, "STADIUM", SFX_POLICE_RADIO_ASPATRIA); SETZONESFX(2, "COM_ZON", SFX_POLICE_RADIO_VICE_CITY_MAINLAND);
SETZONESFX(3, "YAKUSA", SFX_POLICE_RADIO_TORRINGTON); SETZONESFX(3, "BEACH1", SFX_POLICE_RADIO_OCEAN_BEACH);
SETZONESFX(4, "SHOPING", SFX_POLICE_RADIO_BEDFORD_POINT); SETZONESFX(4, "BEACH2", SFX_POLICE_RADIO_WASHINGTON_BEACH);
SETZONESFX(5, "COM_EAS", SFX_POLICE_RADIO_NEWPORT); SETZONESFX(5, "BEACH3", SFX_POLICE_RADIO_VICE_POINT);
SETZONESFX(6, "PARK", SFX_POLICE_RADIO_BELLEVILLE_PARK); SETZONESFX(6, "GOLFC", SFX_POLICE_RADIO_LEAF_LINKS);
SETZONESFX(7, "UNIVERS", SFX_POLICE_RADIO_LIBERTY_CAMPUS); SETZONESFX(7, "STARI", SFX_POLICE_RADIO_STRAFISH_ISLAND);
SETZONESFX(8, "BIG_DAM", SFX_POLICE_RADIO_COCHRANE_DAM); SETZONESFX(8, "DOCKS", SFX_POLICE_RADIO_VICE_PORT);
SETZONESFX(9, "SUB_IND", SFX_POLICE_RADIO_PIKE_CREEK); SETZONESFX(9, "HAVANA", SFX_POLICE_RADIO_LITTLE_HAVANA);
SETZONESFX(10, "SWANKS", SFX_POLICE_RADIO_CEDAR_GROVE); SETZONESFX(10, "HAITI", SFX_POLICE_RADIO_LITTLE_HAITI);
SETZONESFX(11, "PROJECT", SFX_POLICE_RADIO_WICHITA_GARDENS); SETZONESFX(11, "PORNI", SFX_POLICE_RADIO_PRAWN_ISLAND);
SETZONESFX(12, "AIRPORT", SFX_POLICE_RADIO_FRANCIS_INTERNATIONAL_AIRPORT); SETZONESFX(12, "DTOWN", SFX_POLICE_RADIO_DOWNTOWN);
SETZONESFX(13, "PORT_W", SFX_POLICE_RADIO_CALLAHAN_POINT); SETZONESFX(13, "A_PORT", SFX_POLICE_RADIO_ESCOBAR_INTERNATIONAL);
/*
SETZONESFX(14, "PORT_S", SFX_POLICE_RADIO_ATLANTIC_QUAYS);
SETZONESFX(15, "PORT_E", SFX_POLICE_RADIO_PORTLAND_HARBOUR);
SETZONESFX(16, "PORT_I", SFX_POLICE_RADIO_TRENTON);
SETZONESFX(17, "CHINA", SFX_POLICE_RADIO_CHINATOWN);
SETZONESFX(18, "REDLIGH", SFX_POLICE_RADIO_RED_LIGHT_DISTRICT);
SETZONESFX(19, "TOWERS", SFX_POLICE_RADIO_HEPBURN_HEIGHTS);
SETZONESFX(20, "LITTLEI", SFX_POLICE_RADIO_SAINT_MARKS);
SETZONESFX(21, "HARWOOD", SFX_POLICE_RADIO_HARWOOD);
SETZONESFX(22, "EASTBAY", SFX_POLICE_RADIO_PORTLAND_BEACH);
SETZONESFX(23, "S_VIEW", SFX_POLICE_RADIO_PORTLAND_STRAIGHTS);
SETZONESFX(24, "CITYZON", SFX_POLICE_RADIO_LIBERTY_CITY);
SETZONESFX(25, "IND_ZON", SFX_POLICE_RADIO_PORTLAND);
SETZONESFX(26, "COM_ZON", SFX_POLICE_RADIO_STAUNTON_ISLAND);
SETZONESFX(27, "SUB_ZON", SFX_POLICE_RADIO_SHORESIDE_VALE);
SETZONESFX(28, "SUB_ZO2", SFX_POLICE_RADIO_SHORESIDE_VALE);
SETZONESFX(29, "SUB_ZO3", SFX_POLICE_RADIO_SHORESIDE_VALE);
SETZONESFX(30, "A", SFX_POLICE_RADIO_ROCKFORD);
SETZONESFX(31, "A", SFX_POLICE_RADIO_ROCKFORD);
SETZONESFX(32, "A", SFX_POLICE_RADIO_ROCKFORD);
SETZONESFX(33, "A", SFX_POLICE_RADIO_ROCKFORD);
SETZONESFX(34, "A", SFX_POLICE_RADIO_ROCKFORD);
*/
#undef SETZONESFX #undef SETZONESFX
strcpy(SubZo2Label, "SUB_ZO2");
strcpy(SubZo3Label, "SUB_ZO3");
} }
void void
@ -246,7 +218,7 @@ cAudioManager::ServicePoliceRadioChannel(int32 wantedLevel)
if (!wantedLevel) { if (!wantedLevel) {
if (gSpecialSuspectLastSeenReport) { if (gSpecialSuspectLastSeenReport) {
gSpecialSuspectLastSeenReport = 0; gSpecialSuspectLastSeenReport = 0;
} else if (((sample >= SFX_POLICE_RADIO_MESSAGE_NOISE_1) && (sample <= SFX_POLICE_RADIO_MESSAGE_NOISE_3)) || sample == TOTAL_AUDIO_SAMPLES) { } else if (sample == SFX_POLICE_RADIO_MESSAGE_NOISE_1 || sample == TOTAL_AUDIO_SAMPLES) {
bChannelOpen = false; bChannelOpen = false;
processed = true; processed = true;
} }
@ -257,8 +229,6 @@ cAudioManager::ServicePoliceRadioChannel(int32 wantedLevel)
SampleManager.InitialiseChannel(policeChannel, sample, 0); SampleManager.InitialiseChannel(policeChannel, sample, 0);
switch (sample) { switch (sample) {
case SFX_POLICE_RADIO_MESSAGE_NOISE_1: case SFX_POLICE_RADIO_MESSAGE_NOISE_1:
case SFX_POLICE_RADIO_MESSAGE_NOISE_2:
case SFX_POLICE_RADIO_MESSAGE_NOISE_3:
freq = m_anRandomTable[4] % 2000 + 10025; freq = m_anRandomTable[4] % 2000 + 10025;
bChannelOpen = bChannelOpen == false; bChannelOpen = bChannelOpen == false;
break; break;
@ -313,7 +283,7 @@ cAudioManager::SetupCrimeReport()
sampleIndex = ZoneSfx[j].m_nSampleIndex; sampleIndex = ZoneSfx[j].m_nSampleIndex;
m_sPoliceRadioQueue.Add(m_anRandomTable[4] % 3 + SFX_POLICE_RADIO_MESSAGE_NOISE_1); m_sPoliceRadioQueue.Add(m_anRandomTable[4] % 3 + SFX_POLICE_RADIO_MESSAGE_NOISE_1);
m_sPoliceRadioQueue.Add(m_anRandomTable[0] % 3 + SFX_WEVE_GOT); m_sPoliceRadioQueue.Add(m_anRandomTable[0] % 3 + SFX_WEVE_GOT);
m_sPoliceRadioQueue.Add(m_anRandomTable[1] % 2 + SFX_A_10_1); m_sPoliceRadioQueue.Add(SFX_A_10);
switch (m_sPoliceRadioQueue.crimes[i].type) { switch (m_sPoliceRadioQueue.crimes[i].type) {
case CRIME_PED_BURNED: m_sPoliceRadioQueue.crimes[i].type = CRIME_HIT_PED; break; 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_COP_BURNED: m_sPoliceRadioQueue.crimes[i].type = CRIME_HIT_COP; break;
@ -323,37 +293,31 @@ cAudioManager::SetupCrimeReport()
} }
m_sPoliceRadioQueue.Add(m_sPoliceRadioQueue.crimes[i].type + SFX_CRIME_1 - 1); m_sPoliceRadioQueue.Add(m_sPoliceRadioQueue.crimes[i].type + SFX_CRIME_1 - 1);
m_sPoliceRadioQueue.Add(SFX_IN); m_sPoliceRadioQueue.Add(SFX_IN);
if (sampleIndex == SFX_POLICE_RADIO_SHORESIDE_VALE && rangeX = zone->maxx - zone->minx;
(strcmp(zone->name, SubZo2Label) == 0 || strcmp(zone->name, SubZo3Label) == 0)) { rangeY = zone->maxy - zone->miny;
halfX = 0.5f * rangeX + zone->minx;
halfY = 0.5f * rangeY + zone->miny;
quarterX = 0.25f * rangeX;
quarterY = 0.25f * rangeY;
if (m_sPoliceRadioQueue.crimes[i].position.y > halfY + quarterY) {
m_sPoliceRadioQueue.Add(SFX_NORTH); m_sPoliceRadioQueue.Add(SFX_NORTH);
m_sPoliceRadioQueue.Add(SFX_EAST); processed = true;
} else { } else if (m_sPoliceRadioQueue.crimes[i].position.y < halfY - quarterY) {
rangeX = zone->maxx - zone->minx; m_sPoliceRadioQueue.Add(SFX_SOUTH);
rangeY = zone->maxy - zone->miny; processed = true;
halfX = 0.5f * rangeX + zone->minx;
halfY = 0.5f * rangeY + zone->miny;
quarterX = 0.25f * rangeX;
quarterY = 0.25f * rangeY;
if (m_sPoliceRadioQueue.crimes[i].position.y > halfY + quarterY) {
m_sPoliceRadioQueue.Add(SFX_NORTH);
processed = true;
} else if (m_sPoliceRadioQueue.crimes[i].position.y < halfY - quarterY) {
m_sPoliceRadioQueue.Add(SFX_SOUTH);
processed = true;
}
if (m_sPoliceRadioQueue.crimes[i].position.x > halfX + quarterX)
m_sPoliceRadioQueue.Add(SFX_EAST);
else if (m_sPoliceRadioQueue.crimes[i].position.x < halfX - quarterX)
m_sPoliceRadioQueue.Add(SFX_WEST);
else if (!processed)
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);
} }
if (m_sPoliceRadioQueue.crimes[i].position.x > halfX + quarterX)
m_sPoliceRadioQueue.Add(SFX_EAST);
else if (m_sPoliceRadioQueue.crimes[i].position.x < halfX - quarterX)
m_sPoliceRadioQueue.Add(SFX_WEST);
else if (!processed)
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);
break; break;
} }
} }
@ -559,7 +523,7 @@ cAudioManager::SetupSuspectLastSeenReport()
// main_color = SFX_POLICE_RADIO_BLACK; // main_color = SFX_POLICE_RADIO_BLACK;
#endif #endif
case MI_IDAHO: case MI_IDAHO:
case MI_STALLION: sample = SFX_POLICE_RADIO_CONVERTIBLE; break; // case MI_STALLION: sample = SFX_POLICE_RADIO_CONVERTIBLE; break;
#ifdef FIX_BUGS #ifdef FIX_BUGS
// case MI_YAKUZA: // case MI_YAKUZA:
// color_pre_modifier = TOTAL_AUDIO_SAMPLES; // color_pre_modifier = TOTAL_AUDIO_SAMPLES;
@ -578,7 +542,7 @@ cAudioManager::SetupSuspectLastSeenReport()
#endif #endif
case MI_PEREN: case MI_PEREN:
case MI_SENTINEL: case MI_SENTINEL:
case MI_FBICAR: sample = SFX_POLICE_RADIO_SALOON; break; // case MI_FBICAR: sample = SFX_POLICE_RADIO_SALOON; break;
case MI_PATRIOT: case MI_PATRIOT:
case MI_BOBCAT: sample = SFX_POLICE_RADIO_PICKUP; break; case MI_BOBCAT: sample = SFX_POLICE_RADIO_PICKUP; break;
case MI_FIRETRUCK: sample = SFX_POLICE_RADIO_FIRE_TRUCK; break; case MI_FIRETRUCK: sample = SFX_POLICE_RADIO_FIRE_TRUCK; break;
@ -588,7 +552,7 @@ cAudioManager::SetupSuspectLastSeenReport()
#endif #endif
case MI_TRASH: case MI_TRASH:
case MI_BARRACKS: sample = SFX_POLICE_RADIO_TRUCK; break; case MI_BARRACKS: sample = SFX_POLICE_RADIO_TRUCK; break;
case MI_STRETCH: sample = SFX_POLICE_RADIO_LIMO; break; // case MI_STRETCH: sample = SFX_POLICE_RADIO_LIMO; break;
case MI_MANANA: case MI_MANANA:
case MI_ESPERANT: sample = SFX_POLICE_RADIO_2_DOOR; break; case MI_ESPERANT: sample = SFX_POLICE_RADIO_2_DOOR; break;
#ifdef FIX_BUGS #ifdef FIX_BUGS
@ -631,12 +595,12 @@ cAudioManager::SetupSuspectLastSeenReport()
main_color = TOTAL_AUDIO_SAMPLES; main_color = TOTAL_AUDIO_SAMPLES;
color_post_modifier = TOTAL_AUDIO_SAMPLES; color_post_modifier = TOTAL_AUDIO_SAMPLES;
break; break;
case MI_TRAIN: // case MI_TRAIN:
sample = SFX_POLICE_RADIO_SUBWAY_CAR; // sample = SFX_POLICE_RADIO_SUBWAY_CAR;
main_color = TOTAL_AUDIO_SAMPLES; // main_color = TOTAL_AUDIO_SAMPLES;
color_post_modifier = TOTAL_AUDIO_SAMPLES; // color_post_modifier = TOTAL_AUDIO_SAMPLES;
break; // break;
default: default:
debug("\n *** UNKNOWN CAR MODEL INDEX %d *** ", veh->GetModelIndex()); debug("\n *** UNKNOWN CAR MODEL INDEX %d *** ", veh->GetModelIndex());
return; return;
@ -645,14 +609,7 @@ cAudioManager::SetupSuspectLastSeenReport()
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_SUSPECT); m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_SUSPECT);
if (m_anRandomTable[3] % 2) if (m_anRandomTable[3] % 2)
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_LAST_SEEN); m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_LAST_SEEN);
#ifdef FIX_BUGS m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_IN_A);
if (main_color == SFX_POLICE_RADIO_ORANGE && color_pre_modifier == TOTAL_AUDIO_SAMPLES)
#else
if (main_color == SFX_POLICE_RADIO_ORANGE)
#endif
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_IN_AN);
else
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_IN_A);
if (color_pre_modifier != TOTAL_AUDIO_SAMPLES) if (color_pre_modifier != TOTAL_AUDIO_SAMPLES)
m_sPoliceRadioQueue.Add(color_pre_modifier); m_sPoliceRadioQueue.Add(color_pre_modifier);
if (main_color != TOTAL_AUDIO_SAMPLES) if (main_color != TOTAL_AUDIO_SAMPLES)
@ -731,34 +688,27 @@ cAudioManager::PlaySuspectLastSeen(float x, float y, float z)
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_SUSPECT); m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_SUSPECT);
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_LAST_SEEN); m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_LAST_SEEN);
m_sPoliceRadioQueue.Add(SFX_IN); m_sPoliceRadioQueue.Add(SFX_IN);
if (sample == SFX_POLICE_RADIO_SHORESIDE_VALE && rangeX = zone->maxx - zone->minx;
(strcmp(zone->name, SubZo2Label) == 0 || rangeY = zone->maxy - zone->miny;
strcmp(zone->name, SubZo3Label) == 0)) { halfX = 0.5f * rangeX + zone->minx;
halfY = 0.5f * rangeY + zone->miny;
quarterX = 0.25f * rangeX;
quarterY = 0.25f * rangeY;
if (vec.y > halfY + quarterY) {
m_sPoliceRadioQueue.Add(SFX_NORTH); m_sPoliceRadioQueue.Add(SFX_NORTH);
m_sPoliceRadioQueue.Add(SFX_EAST); processed = true;
} else { } else if (vec.y < halfY - quarterY) {
rangeX = zone->maxx - zone->minx; m_sPoliceRadioQueue.Add(SFX_SOUTH);
rangeY = zone->maxy - zone->miny; processed = true;
halfX = 0.5f * rangeX + zone->minx;
halfY = 0.5f * rangeY + zone->miny;
quarterX = 0.25f * rangeX;
quarterY = 0.25f * rangeY;
if (vec.y > halfY + quarterY) {
m_sPoliceRadioQueue.Add(SFX_NORTH);
processed = true;
} else if (vec.y < halfY - quarterY) {
m_sPoliceRadioQueue.Add(SFX_SOUTH);
processed = true;
}
if (vec.x > halfX + quarterX)
m_sPoliceRadioQueue.Add(SFX_EAST);
else if (vec.x < halfX - quarterX)
m_sPoliceRadioQueue.Add(SFX_WEST);
else if (!processed)
m_sPoliceRadioQueue.Add(SFX_CENTRAL);
} }
if (vec.x > halfX + quarterX)
m_sPoliceRadioQueue.Add(SFX_EAST);
else if (vec.x < halfX - quarterX)
m_sPoliceRadioQueue.Add(SFX_WEST);
else if (!processed)
m_sPoliceRadioQueue.Add(SFX_CENTRAL);
m_sPoliceRadioQueue.Add(sample); m_sPoliceRadioQueue.Add(sample);
m_sPoliceRadioQueue.Add(m_anRandomTable[2] % 3 + SFX_POLICE_RADIO_MESSAGE_NOISE_1); m_sPoliceRadioQueue.Add(m_anRandomTable[2] % 3 + SFX_POLICE_RADIO_MESSAGE_NOISE_1);
m_sPoliceRadioQueue.Add(TOTAL_AUDIO_SAMPLES); m_sPoliceRadioQueue.Add(TOTAL_AUDIO_SAMPLES);

File diff suppressed because it is too large Load diff

View file

@ -81,10 +81,17 @@ public:
class CMP3File : public IDecoder class CMP3File : public IDecoder
{ {
protected:
mpg123_handle *m_pMH; mpg123_handle *m_pMH;
bool m_bOpened; bool m_bOpened;
uint32 m_nRate; uint32 m_nRate;
uint32 m_nChannels; uint32 m_nChannels;
CMP3File() :
m_pMH(nil),
m_bOpened(false),
m_nRate(0),
m_nChannels(0) {}
public: public:
CMP3File(const char *path) : CMP3File(const char *path) :
m_pMH(nil), m_pMH(nil),
@ -171,6 +178,51 @@ public:
} }
}; };
class CADFFile : public CMP3File
{
static ssize_t r_read(void* fh, void* buf, size_t size)
{
size_t bytesRead = fread(buf, 1, size, (FILE*)fh);
uint8* _buf = (uint8*)buf;
for (int i = 0; i < size; i++)
_buf[i] ^= 0x22;
return bytesRead;
}
static off_t r_seek(void* fh, off_t pos, int seekType)
{
fseek((FILE*)fh, pos, seekType);
return ftell((FILE*)fh);
}
static void r_close(void* fh)
{
fclose((FILE*)fh);
}
public:
CADFFile(const char* path)
{
m_pMH = mpg123_new(nil, nil);
if (m_pMH)
{
long rate = 0;
int channels = 0;
int encoding = 0;
FILE* f = fopen(path, "rb");
m_bOpened = mpg123_replace_reader_handle(m_pMH, r_read, r_seek, r_close) == MPG123_OK
&& mpg123_open_handle(m_pMH, f) == MPG123_OK && mpg123_getformat(m_pMH, &rate, &channels, &encoding) == MPG123_OK;
m_nRate = rate;
m_nChannels = channels;
if (IsOpened())
{
mpg123_format_none(m_pMH);
mpg123_format(m_pMH, rate, channels, encoding);
}
}
}
};
void CStream::Initialise() void CStream::Initialise()
{ {
mpg123_init(); mpg123_init();
@ -217,6 +269,8 @@ CStream::CStream(char *filename, ALuint &source, ALuint (&buffers)[NUM_STREAMBUF
m_pSoundFile = new CMP3File(m_aFilename); m_pSoundFile = new CMP3File(m_aFilename);
else if (!strcasecmp(&m_aFilename[strlen(m_aFilename) - strlen(".wav")], ".wav")) else if (!strcasecmp(&m_aFilename[strlen(m_aFilename) - strlen(".wav")], ".wav"))
m_pSoundFile = new CSndFile(m_aFilename); m_pSoundFile = new CSndFile(m_aFilename);
else if (!strcasecmp(&m_aFilename[strlen(m_aFilename) - strlen(".adf")], ".adf"))
m_pSoundFile = new CADFFile(m_aFilename);
else else
m_pSoundFile = nil; m_pSoundFile = nil;
ASSERT(m_pSoundFile != nil); ASSERT(m_pSoundFile != nil);

File diff suppressed because it is too large Load diff

View file

@ -264,10 +264,63 @@ set_new_provider(S32 index)
return false; return false;
} }
U32 RadioHandlers[9];
U32 WINAPI vfs_open_callback(char const* Filename, U32* FileHandle)
{
*FileHandle = (U32)fopen(Filename, "rb");
// couldn't they just use stricmp once? and strlen? this is very inefficient
if ((strcmp(Filename + strlen(Filename) - 4, ".adf") == 0) || (strcmp(Filename + strlen(Filename) - 4, ".ADF") == 0)) {
for (int i = 0; i < ARRAY_SIZE(RadioHandlers); i++) {
if (RadioHandlers[i] == NULL) {
RadioHandlers[i] = *FileHandle;
break;
}
}
strcpy((char*)Filename + strlen(Filename) - 4, ".mp3");
}
return *FileHandle;
}
void WINAPI vfs_close_callback(U32 FileHandle)
{
for (int i = 0; i < ARRAY_SIZE(RadioHandlers); i++) {
if (RadioHandlers[i] == FileHandle) {
RadioHandlers[i] = NULL;
break;
}
}
fclose((FILE*)FileHandle);
}
S32 WINAPI vfs_seek_callback(U32 FileHandle, S32 Offset, U32 Type)
{
fseek((FILE*)FileHandle, Offset, Type);
return ftell((FILE*)FileHandle);
}
U32 WINAPI vfs_read_callback(U32 FileHandle, void* Buffer, U32 Bytes)
{
fread(Buffer, Bytes, 1, (FILE*)FileHandle);
uint8* _Buffer = (uint8*)Buffer;
for (int i = 0; i < ARRAY_SIZE(RadioHandlers); i++) {
if (FileHandle == RadioHandlers[i]) {
for (U32 k = 0; k < Bytes; k++)
_Buffer[k] ^= 0x22;
break;
}
}
return Bytes;
}
cSampleManager::cSampleManager(void) : cSampleManager::cSampleManager(void) :
m_nNumberOfProviders(0) m_nNumberOfProviders(0)
{ {
; ;
AIL_set_file_callbacks(vfs_open_callback, vfs_close_callback, vfs_seek_callback, vfs_read_callback);
} }
cSampleManager::~cSampleManager(void) cSampleManager::~cSampleManager(void)
@ -1500,7 +1553,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
case MUSICMODE_FRONTEND: case MUSICMODE_FRONTEND:
{ {
if ( MusicManager.GetCurrentTrack() == STREAMED_SOUND_GAME_COMPLETED ) if ( MusicManager.GetCurrentTrack() == STREAMED_SOUND_CUTSCENE_FINALE )
return false; return false;
break; break;
@ -1739,8 +1792,7 @@ cSampleManager::SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume)
// increase the volume for JB.MP3 and S4_BDBD.MP3 // increase the volume for JB.MP3 and S4_BDBD.MP3
if ( MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE if ( MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
&& MusicManager.GetCurrentTrack() != STREAMED_SOUND_NEWS_INTRO && MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_FINALE )
&& MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_SAL4_BDBD )
{ {
nChannelVolume[nChannel] >>= 2; nChannelVolume[nChannel] >>= 2;
} }
@ -1778,8 +1830,7 @@ cSampleManager::SetChannelVolume(uint32 nChannel, uint32 nVolume)
// increase the volume for JB.MP3 and S4_BDBD.MP3 // increase the volume for JB.MP3 and S4_BDBD.MP3
if ( MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE if ( MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
&& MusicManager.GetCurrentTrack() != STREAMED_SOUND_NEWS_INTRO && MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_FINALE )
&& MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_SAL4_BDBD )
{ {
nChannelVolume[nChannel] >>= 2; nChannelVolume[nChannel] >>= 2;
} }

View file

@ -833,7 +833,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
case MUSICMODE_FRONTEND: case MUSICMODE_FRONTEND:
{ {
if ( MusicManager.GetCurrentTrack() == STREAMED_SOUND_GAME_COMPLETED ) if ( MusicManager.GetCurrentTrack() == STREAMED_SOUND_CUTSCENE_FINALE)
return false; return false;
break; break;
@ -1057,10 +1057,8 @@ cSampleManager::SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume)
nChannelVolume[nChannel] = vol; nChannelVolume[nChannel] = vol;
// reduce channel volume when JB.MP3 or S4_BDBD.MP3 playing
if ( MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE if ( MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
&& MusicManager.GetCurrentTrack() != STREAMED_SOUND_NEWS_INTRO && MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_FINALE )
&& MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_SAL4_BDBD )
{ {
nChannelVolume[nChannel] = vol / 4; nChannelVolume[nChannel] = vol / 4;
} }
@ -1099,10 +1097,8 @@ cSampleManager::SetChannelVolume(uint32 nChannel, uint32 nVolume)
nChannelVolume[nChannel] = vol; nChannelVolume[nChannel] = vol;
// reduce the volume for JB.MP3 and S4_BDBD.MP3
if ( MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE if ( MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
&& MusicManager.GetCurrentTrack() != STREAMED_SOUND_NEWS_INTRO && MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_FINALE )
&& MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_SAL4_BDBD )
{ {
nChannelVolume[nChannel] = vol / 4; nChannelVolume[nChannel] = vol / 4;
} }

View file

@ -840,6 +840,7 @@ CPickups::RenderPickUpText()
if (aMessages[i].m_weaponType == WEAPONTYPE_TOTALWEAPONS) { // unreachable code? if (aMessages[i].m_weaponType == WEAPONTYPE_TOTALWEAPONS) { // unreachable code?
// what is this?? // what is this??
sprintf(gString, "%d/%d", CWorld::Players[CWorld::PlayerInFocus].m_nCollectedPackages, 2903); sprintf(gString, "%d/%d", CWorld::Players[CWorld::PlayerInFocus].m_nCollectedPackages, 2903);
strToPrint = nil;
} else { } else {
if (aMessages[i].m_bOutOfStock) if (aMessages[i].m_bOutOfStock)
strToPrint = TheText.Get("STOCK"); strToPrint = TheText.Get("STOCK");
@ -971,6 +972,8 @@ CPickups::RenderPickUpText()
break; break;
} }
} }
if (strToPrint == nil)
continue;
CFont::SetPropOn(); CFont::SetPropOn();
CFont::SetBackgroundOff(); CFont::SetBackgroundOff();

View file

@ -9571,7 +9571,7 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command)
case COMMAND_LOAD_END_OF_GAME_TUNE: case COMMAND_LOAD_END_OF_GAME_TUNE:
DMAudio.ChangeMusicMode(MUSICMODE_CUTSCENE); DMAudio.ChangeMusicMode(MUSICMODE_CUTSCENE);
printf("Start preload end of game audio\n"); printf("Start preload end of game audio\n");
DMAudio.PreloadCutSceneMusic(STREAMED_SOUND_GAME_COMPLETED); DMAudio.PreloadCutSceneMusic(STREAMED_SOUND_CUTSCENE_FINALE);
printf("End preload end of game audio\n"); printf("End preload end of game audio\n");
return 0; return 0;
/* /*

View file

@ -486,9 +486,9 @@ CMenuManager::Initialise(void)
// TODO(Miami) // TODO(Miami)
// DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume); // DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume);
if (DMAudio.IsMP3RadioChannelAvailable()) { if (DMAudio.IsMP3RadioChannelAvailable()) {
if (m_PrefsRadioStation < HEAD_RADIO || m_PrefsRadioStation > USERTRACK) if (m_PrefsRadioStation < WILDSTYLE || m_PrefsRadioStation > USERTRACK)
m_PrefsRadioStation = CGeneral::GetRandomNumber() % 10; m_PrefsRadioStation = CGeneral::GetRandomNumber() % 10;
} else if (m_PrefsRadioStation < HEAD_RADIO || m_PrefsRadioStation > CHATTERBOX) } else if (m_PrefsRadioStation < WILDSTYLE || m_PrefsRadioStation > WAVE)
m_PrefsRadioStation = CGeneral::GetRandomNumber() % 9; m_PrefsRadioStation = CGeneral::GetRandomNumber() % 9;
CFileMgr::SetDir(""); CFileMgr::SetDir("");
@ -4413,7 +4413,7 @@ CMenuManager::ProcessButtonPresses(void)
m_PrefsSpeakers = 0; m_PrefsSpeakers = 0;
m_PrefsMusicVolume = 102; m_PrefsMusicVolume = 102;
m_PrefsStereoMono = 0; m_PrefsStereoMono = 0;
m_PrefsRadioStation = HEAD_RADIO; m_PrefsRadioStation = WILDSTYLE;
DMAudio.SetMusicMasterVolume(102); DMAudio.SetMusicMasterVolume(102);
DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume); DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume);
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);
@ -4609,15 +4609,15 @@ CMenuManager::ProcessButtonPresses(void)
m_PrefsRadioStation += changeValueBy; m_PrefsRadioStation += changeValueBy;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0); DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
if (DMAudio.IsMP3RadioChannelAvailable()) { if (DMAudio.IsMP3RadioChannelAvailable()) {
if (m_PrefsRadioStation < HEAD_RADIO) if (m_PrefsRadioStation < WILDSTYLE)
m_PrefsRadioStation = USERTRACK; m_PrefsRadioStation = USERTRACK;
if (m_PrefsRadioStation > USERTRACK) if (m_PrefsRadioStation > USERTRACK)
m_PrefsRadioStation = HEAD_RADIO; m_PrefsRadioStation = WILDSTYLE;
} else { } else {
if (m_PrefsRadioStation < HEAD_RADIO) if (m_PrefsRadioStation < WILDSTYLE)
m_PrefsRadioStation = CHATTERBOX; m_PrefsRadioStation = WAVE;
if (m_PrefsRadioStation > CHATTERBOX) if (m_PrefsRadioStation > WAVE)
m_PrefsRadioStation = HEAD_RADIO; m_PrefsRadioStation = WILDSTYLE;
} }
SaveSettings(); SaveSettings();
DMAudio.SetRadioInCar(m_PrefsRadioStation); DMAudio.SetRadioInCar(m_PrefsRadioStation);

View file

@ -1028,12 +1028,6 @@ DebugMenuProcess(void)
} }
#ifdef LIBRW
#define CURRENTCAM (rw::engine->currentCamera)
#else
#define CURRENTCAM ((RwCamera*)RWSRCGLOBAL(curCamera))
#endif
void void
DebugMenuRender(void) DebugMenuRender(void)
{ {
@ -1048,7 +1042,7 @@ DebugMenuRender(void)
RwRenderStateSet(rwRENDERSTATEFOGENABLE, 0); RwRenderStateSet(rwRENDERSTATEFOGENABLE, 0);
RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE); RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
RwCamera *cam = CURRENTCAM; RwCamera *cam = RwCameraGetCurrentCamera();
screenWidth = RwRasterGetWidth(RwCameraGetRaster(cam)); screenWidth = RwRasterGetWidth(RwCameraGetRaster(cam));
screenHeight = RwRasterGetHeight(RwCameraGetRaster(cam)); screenHeight = RwRasterGetHeight(RwCameraGetRaster(cam));
@ -1080,7 +1074,7 @@ drawArrow(RwRect r, int direction, int style)
static RwImVertexIndex indices[] = { 0, 1, 2, 2, 1, 3 }; static RwImVertexIndex indices[] = { 0, 1, 2, 2, 1, 3 };
static RwIm2DVertex arrowVerts[4]; static RwIm2DVertex arrowVerts[4];
RwCamera *cam = CURRENTCAM; RwCamera *cam = RwCameraGetCurrentCamera();
float recipz = 1.0f/RwCameraGetNearClipPlane(cam); float recipz = 1.0f/RwCameraGetNearClipPlane(cam);
int width = RwRasterGetWidth(arrow); int width = RwRasterGetWidth(arrow);
@ -1183,7 +1177,7 @@ drawMouse(void)
static RwIm2DVertex vertices[4]; static RwIm2DVertex vertices[4];
RwIm2DVertex *vert; RwIm2DVertex *vert;
RwCamera *cam; RwCamera *cam;
cam = CURRENTCAM; cam = RwCameraGetCurrentCamera();
float x = mouseX; float x = mouseX;
float y = mouseY; float y = mouseY;
float w = RwRasterGetWidth(cursor); float w = RwRasterGetWidth(cursor);

View file

@ -152,7 +152,7 @@ RwReal RwCameraGetNearClipPlane(const RwCamera *camera) { return camera->n
RwReal RwCameraGetFarClipPlane(const RwCamera *camera) { return camera->farPlane; } RwReal RwCameraGetFarClipPlane(const RwCamera *camera) { return camera->farPlane; }
RwCamera *RwCameraSetFogDistance(RwCamera *camera, RwReal fogDistance) { camera->fogPlane = fogDistance; return camera; } RwCamera *RwCameraSetFogDistance(RwCamera *camera, RwReal fogDistance) { camera->fogPlane = fogDistance; return camera; }
RwReal RwCameraGetFogDistance(const RwCamera *camera) { return camera->fogPlane; } RwReal RwCameraGetFogDistance(const RwCamera *camera) { return camera->fogPlane; }
RwCamera *RwCameraGetCurrentCamera(void); RwCamera *RwCameraGetCurrentCamera(void) { return rw::engine->currentCamera; }
RwCameraProjection RwCameraGetProjection(const RwCamera *camera); RwCameraProjection RwCameraGetProjection(const RwCamera *camera);
const RwV2d *RwCameraGetViewWindow(const RwCamera *camera) { return &camera->viewWindow; } const RwV2d *RwCameraGetViewWindow(const RwCamera *camera) { return &camera->viewWindow; }
RwMatrix *RwCameraGetViewMatrix(RwCamera *camera) { return &camera->viewMatrix; } RwMatrix *RwCameraGetViewMatrix(RwCamera *camera) { return &camera->viewMatrix; }
@ -615,8 +615,8 @@ RpGeometry *RpGeometryCreateSpace(RwReal radius);
RpMorphTarget *RpMorphTargetSetBoundingSphere(RpMorphTarget *morphTarget, const RwSphere *boundingSphere) { morphTarget->boundingSphere = *boundingSphere; return morphTarget; } RpMorphTarget *RpMorphTargetSetBoundingSphere(RpMorphTarget *morphTarget, const RwSphere *boundingSphere) { morphTarget->boundingSphere = *boundingSphere; return morphTarget; }
RwSphere *RpMorphTargetGetBoundingSphere(RpMorphTarget *morphTarget) { return &morphTarget->boundingSphere; } RwSphere *RpMorphTargetGetBoundingSphere(RpMorphTarget *morphTarget) { return &morphTarget->boundingSphere; }
const RpMorphTarget *RpMorphTargetCalcBoundingSphere(const RpMorphTarget *morphTarget, RwSphere *boundingSphere) { *boundingSphere = morphTarget->calculateBoundingSphere(); return morphTarget; } const RpMorphTarget *RpMorphTargetCalcBoundingSphere(const RpMorphTarget *morphTarget, RwSphere *boundingSphere) { *boundingSphere = morphTarget->calculateBoundingSphere(); return morphTarget; }
RwInt32 RpGeometryAddMorphTargets(RpGeometry *geometry, RwInt32 mtcount); RwInt32 RpGeometryAddMorphTargets(RpGeometry *geometry, RwInt32 mtcount) { RwInt32 n = geometry->numMorphTargets; geometry->addMorphTargets(mtcount); return n; }
RwInt32 RpGeometryAddMorphTarget(RpGeometry *geometry); RwInt32 RpGeometryAddMorphTarget(RpGeometry *geometry) { return RpGeometryAddMorphTargets(geometry, 1); }
RpGeometry *RpGeometryRemoveMorphTarget(RpGeometry *geometry, RwInt32 morphTarget); RpGeometry *RpGeometryRemoveMorphTarget(RpGeometry *geometry, RwInt32 morphTarget);
RwInt32 RpGeometryGetNumMorphTargets(const RpGeometry *geometry); RwInt32 RpGeometryGetNumMorphTargets(const RpGeometry *geometry);
RpMorphTarget *RpGeometryGetMorphTarget(const RpGeometry *geometry, RwInt32 morphTarget) { return &geometry->morphTargets[morphTarget]; } RpMorphTarget *RpGeometryGetMorphTarget(const RpGeometry *geometry, RwInt32 morphTarget) { return &geometry->morphTargets[morphTarget]; }
@ -790,6 +790,12 @@ RpMaterial *RpMatFXMaterialSetEnvMapFrame( RpMaterial *material, RwFrame *frame
mfx->setEnvFrame(frame); mfx->setEnvFrame(frame);
return material; return material;
} }
RpMaterial *RpMatFXMaterialSetEnvMapFrameBufferAlpha( RpMaterial *material, RwBool useFrameBufferAlpha )
{
MatFX *mfx = MatFX::get(material);
mfx->setEnvFBAlpha(useFrameBufferAlpha);
return material;
}
RpMaterial *RpMatFXMaterialSetEnvMapCoefficient( RpMaterial *material, RwReal coef ) RpMaterial *RpMatFXMaterialSetEnvMapCoefficient( RpMaterial *material, RwReal coef )
{ {
MatFX *mfx = MatFX::get(material); MatFX *mfx = MatFX::get(material);

View file

@ -15767,17 +15767,18 @@ CPed::SetEnterCar(CVehicle *car, uint32 unused)
void void
CPed::SetRadioStation(void) CPed::SetRadioStation(void)
{ {
// TODO: this should be gone
static const uint8 radiosPerRadioCategories[10][4] = { static const uint8 radiosPerRadioCategories[10][4] = {
{JAH_RADIO, RISE_FM, GAME_FM, MSX_FM}, {KCHAT, FEVER, VCPR, RADIO_ESPANTOSO},
{HEAD_RADIO, DOUBLE_CLEF, LIPS_106, FLASHBACK}, {WILDSTYLE, FLASH_FM, V_ROCK, EMOTION},
{RISE_FM, GAME_FM, MSX_FM, FLASHBACK}, {FEVER, VCPR, RADIO_ESPANTOSO, EMOTION},
{HEAD_RADIO, RISE_FM, LIPS_106, MSX_FM}, {WILDSTYLE, FEVER, V_ROCK, RADIO_ESPANTOSO},
{HEAD_RADIO, RISE_FM, MSX_FM, FLASHBACK}, {WILDSTYLE, FEVER, RADIO_ESPANTOSO, EMOTION},
{JAH_RADIO, RISE_FM, LIPS_106, FLASHBACK}, {KCHAT, FEVER, V_ROCK, EMOTION},
{HEAD_RADIO, RISE_FM, LIPS_106, FLASHBACK}, {WILDSTYLE, FEVER, V_ROCK, EMOTION},
{HEAD_RADIO, JAH_RADIO, LIPS_106, FLASHBACK}, {WILDSTYLE, KCHAT, V_ROCK, EMOTION},
{HEAD_RADIO, DOUBLE_CLEF, LIPS_106, FLASHBACK}, {WILDSTYLE, FLASH_FM, V_ROCK, EMOTION},
{CHATTERBOX, HEAD_RADIO, LIPS_106, GAME_FM} {WAVE, WILDSTYLE, V_ROCK, VCPR}
}; };
uint8 orderInCat = 0; // BUG: this wasn't initialized uint8 orderInCat = 0; // BUG: this wasn't initialized

View file

@ -273,12 +273,13 @@ CAutomobile::ProcessControl(void)
} }
// Process driver // Process driver
if(IsUpsideDown() && CanPedEnterCar()){ if(pDriver)
if(!pDriver->IsPlayer() && if(IsUpsideDown() && CanPedEnterCar()){
!(pDriver->m_leader && pDriver->m_leader->bInVehicle) && if(!pDriver->IsPlayer() &&
pDriver->CharCreatedBy != MISSION_CHAR) !(pDriver->m_leader && pDriver->m_leader->bInVehicle) &&
pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this); pDriver->CharCreatedBy != MISSION_CHAR)
} pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this);
}
ActivateBombWhenEntered(); ActivateBombWhenEntered();

View file

@ -31,6 +31,8 @@
#include "Weather.h" #include "Weather.h"
#include "Coronas.h" #include "Coronas.h"
//--MIAMI: done
bool CVehicle::bWheelsOnlyCheat; bool CVehicle::bWheelsOnlyCheat;
bool CVehicle::bAllDodosCheat; bool CVehicle::bAllDodosCheat;
bool CVehicle::bCheat3; bool CVehicle::bCheat3;
@ -141,8 +143,26 @@ CVehicle::CVehicle(uint8 CreatedBy)
m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, this); m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, this);
if(m_audioEntityId >= 0) if(m_audioEntityId >= 0)
DMAudio.SetEntityStatus(m_audioEntityId, true); DMAudio.SetEntityStatus(m_audioEntityId, true);
// TODO(MIAMI): //m_nRadioStation = CGeneral::GetRandomNumber() % USERTRACK;
m_nRadioStation = CGeneral::GetRandomNumber() % USERTRACK; switch(GetModelIndex()){
case MI_HUNTER:
case MI_ANGEL:
case MI_FREEWAY:
m_nRadioStation = V_ROCK;
break;
case MI_RCBARON:
case MI_RCBANDIT:
case MI_RCRAIDER:
case MI_RCGOBLIN:
case MI_TOPFUN:
case MI_CADDY:
case MI_BAGGAGE:
m_nRadioStation = RADIO_OFF;
break;
default:
m_nRadioStation = CGeneral::GetRandomNumber() % USERTRACK;
break;
}
m_pCurGroundEntity = nil; m_pCurGroundEntity = nil;
m_bRainAudioCounter = 0; m_bRainAudioCounter = 0;
m_bRainSamplesCounter = 0; m_bRainSamplesCounter = 0;
@ -1212,8 +1232,7 @@ CVehicle::InflictDamage(CEntity *damagedBy, eWeaponType weaponType, float damage
SetStatus(STATUS_ABANDONED); SetStatus(STATUS_ABANDONED);
pDriver->bFleeAfterExitingCar = true; pDriver->bFleeAfterExitingCar = true;
pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this); pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this);
// TODO(MIAMI): pDriver->Say(SOUND_PED_FLEE_SPRINT);
// pDriver->Say(120);
} }
int time = 200; int time = 200;
for (int i = 0; i < m_nNumMaxPassengers; i++) { for (int i = 0; i < m_nNumMaxPassengers; i++) {
@ -1223,8 +1242,7 @@ CVehicle::InflictDamage(CEntity *damagedBy, eWeaponType weaponType, float damage
pPassengers[i]->bFleeAfterExitingCar = true; pPassengers[i]->bFleeAfterExitingCar = true;
pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this); pPassengers[i]->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this);
pPassengers[i]->m_objectiveTimer = CTimer::GetTimeInMilliseconds() + time; pPassengers[i]->m_objectiveTimer = CTimer::GetTimeInMilliseconds() + time;
// TODO(MIAMI): pPassengers[i]->Say(SOUND_PED_FLEE_SPRINT);
// pPassengers[i]->Say(120);
time += 200; time += 200;
} }
} }