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_pan(HSTREAM stream, S32 pan);
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;
int iTrackId;
} musicNameIdAssoc[] = {
{ "JB", STREAMED_SOUND_NEWS_INTRO },
{ "BET", STREAMED_SOUND_BANK_INTRO },
{ "L1_LG", STREAMED_SOUND_CUTSCENE_LUIGI1_LG },
{ "L2_DSB", STREAMED_SOUND_CUTSCENE_LUIGI2_DSB },
{ "L3_DM", STREAMED_SOUND_CUTSCENE_LUIGI3_DM },
{ "L4_PAP", STREAMED_SOUND_CUTSCENE_LUIGI4_PAP },
{ "L5_TFB", STREAMED_SOUND_CUTSCENE_LUIGI5_TFB },
{ "J0_DM2", STREAMED_SOUND_CUTSCENE_JOEY0_DM2 },
{ "J1_LFL", STREAMED_SOUND_CUTSCENE_JOEY1_LFL },
{ "J2_KCL", STREAMED_SOUND_CUTSCENE_JOEY2_KCL },
{ "J3_VH", STREAMED_SOUND_CUTSCENE_JOEY3_VH },
{ "J4_ETH", STREAMED_SOUND_CUTSCENE_JOEY4_ETH },
{ "J5_DST", STREAMED_SOUND_CUTSCENE_JOEY5_DST },
{ "J6_TBJ", STREAMED_SOUND_CUTSCENE_JOEY6_TBJ },
{ "T1_TOL", STREAMED_SOUND_CUTSCENE_TONI1_TOL },
{ "T2_TPU", STREAMED_SOUND_CUTSCENE_TONI2_TPU },
{ "T3_MAS", STREAMED_SOUND_CUTSCENE_TONI3_MAS },
{ "T4_TAT", STREAMED_SOUND_CUTSCENE_TONI4_TAT },
{ "T5_BF", STREAMED_SOUND_CUTSCENE_TONI5_BF },
{ "S0_MAS", STREAMED_SOUND_CUTSCENE_SAL0_MAS },
{ "S1_PF", STREAMED_SOUND_CUTSCENE_SAL1_PF },
{ "S2_CTG", STREAMED_SOUND_CUTSCENE_SAL2_CTG },
{ "S3_RTC", STREAMED_SOUND_CUTSCENE_SAL3_RTC },
{ "S5_LRQ", STREAMED_SOUND_CUTSCENE_SAL5_LRQ },
{ "S4_BDBA", STREAMED_SOUND_CUTSCENE_SAL4_BDBA },
{ "S4_BDBB", STREAMED_SOUND_CUTSCENE_SAL4_BDBB },
{ "S2_CTG2", STREAMED_SOUND_CUTSCENE_SAL2_CTG2 },
{ "S4_BDBD", STREAMED_SOUND_CUTSCENE_SAL4_BDBD },
{ "S5_LRQB", STREAMED_SOUND_CUTSCENE_SAL5_LRQB },
{ "S5_LRQC", STREAMED_SOUND_CUTSCENE_SAL5_LRQC },
{ "A1_SS0", STREAMED_SOUND_CUTSCENE_ASUKA_1_SSO },
{ "A2_PP", STREAMED_SOUND_CUTSCENE_ASUKA_2_PP },
{ "A3_SS", STREAMED_SOUND_CUTSCENE_ASUKA_3_SS },
{ "A4_PDR", STREAMED_SOUND_CUTSCENE_ASUKA_4_PDR },
{ "A5_K2FT", STREAMED_SOUND_CUTSCENE_ASUKA_5_K2FT},
{ "K1_KBO", STREAMED_SOUND_CUTSCENE_KENJI1_KBO },
{ "K2_GIS", STREAMED_SOUND_CUTSCENE_KENJI2_GIS },
{ "K3_DS", STREAMED_SOUND_CUTSCENE_KENJI3_DS },
{ "K4_SHI", STREAMED_SOUND_CUTSCENE_KENJI4_SHI },
{ "K5_SD", STREAMED_SOUND_CUTSCENE_KENJI5_SD },
{ "R0_PDR2", STREAMED_SOUND_CUTSCENE_RAY0_PDR2 },
{ "R1_SW", STREAMED_SOUND_CUTSCENE_RAY1_SW },
{ "R2_AP", STREAMED_SOUND_CUTSCENE_RAY2_AP },
{ "R3_ED", STREAMED_SOUND_CUTSCENE_RAY3_ED },
{ "R4_GF", STREAMED_SOUND_CUTSCENE_RAY4_GF },
{ "R5_PB", STREAMED_SOUND_CUTSCENE_RAY5_PB },
{ "R6_MM", STREAMED_SOUND_CUTSCENE_RAY6_MM },
{ "D1_STOG", STREAMED_SOUND_CUTSCENE_DONALD1_STOG },
{ "D2_KK", STREAMED_SOUND_CUTSCENE_DONALD2_KK },
{ "D3_ADO", STREAMED_SOUND_CUTSCENE_DONALD3_ADO },
{ "D5_ES", STREAMED_SOUND_CUTSCENE_DONALD5_ES },
{ "D7_MLD", STREAMED_SOUND_CUTSCENE_DONALD7_MLD },
{ "D4_GTA", STREAMED_SOUND_CUTSCENE_DONALD4_GTA },
{ "D4_GTA2", STREAMED_SOUND_CUTSCENE_DONALD4_GTA2 },
{ "D6_STS", STREAMED_SOUND_CUTSCENE_DONALD6_STS },
{ "A6_BAIT", STREAMED_SOUND_CUTSCENE_ASUKA6_BAIT },
{ "A7_ETG", STREAMED_SOUND_CUTSCENE_ASUKA7_ETG },
{ "A8_PS", STREAMED_SOUND_CUTSCENE_ASUKA8_PS },
{ "A9_ASD", STREAMED_SOUND_CUTSCENE_ASUKA9_ASD },
{ "K4_SHI2", STREAMED_SOUND_CUTSCENE_KENJI4_SHI2 },
{ "C1_TEX", STREAMED_SOUND_CUTSCENE_CATALINA1_TEX },
{ "EL_PH1", STREAMED_SOUND_CUTSCENE_ELBURRO1_PH1 },
{ "EL_PH2", STREAMED_SOUND_CUTSCENE_ELBURRO2_PH2 },
{ "EL_PH3", STREAMED_SOUND_CUTSCENE_ELBURRO3_PH3 },
{ "EL_PH4", STREAMED_SOUND_CUTSCENE_ELBURRO4_PH4 },
{ "YD_PH1", STREAMED_SOUND_CUTSCENE_YARDIE_PH1 },
{ "YD_PH2", STREAMED_SOUND_CUTSCENE_YARDIE_PH2 },
{ "YD_PH3", STREAMED_SOUND_CUTSCENE_YARDIE_PH3 },
{ "YD_PH4", STREAMED_SOUND_CUTSCENE_YARDIE_PH4 },
{ "HD_PH1", STREAMED_SOUND_CUTSCENE_HOODS_PH1 },
{ "HD_PH2", STREAMED_SOUND_CUTSCENE_HOODS_PH2 },
{ "HD_PH3", STREAMED_SOUND_CUTSCENE_HOODS_PH3 },
{ "HD_PH4", STREAMED_SOUND_CUTSCENE_HOODS_PH4 },
{ "HD_PH5", STREAMED_SOUND_CUTSCENE_HOODS_PH5 },
{ "MT_PH1", STREAMED_SOUND_CUTSCENE_MARTY_PH1 },
{ "MT_PH2", STREAMED_SOUND_CUTSCENE_MARTY_PH2 },
{ "MT_PH3", STREAMED_SOUND_CUTSCENE_MARTY_PH3 },
{ "MT_PH4", STREAMED_SOUND_CUTSCENE_MARTY_PH4 },
{ NULL, 0 }
{ "ASS_1", STREAMED_SOUND_CUTSCENE_ASS_1 },
{ "ASS_2", STREAMED_SOUND_CUTSCENE_ASS_2 },
{ "BANK_1", STREAMED_SOUND_CUTSCENE_BANK_1 },
{ "BANK_2A", STREAMED_SOUND_CUTSCENE_BANK_2A },
{ "BANK_2B", STREAMED_SOUND_CUTSCENE_BANK_2B },
{ "BANK_3A", STREAMED_SOUND_CUTSCENE_BANK_3A },
{ "BANK_3B", STREAMED_SOUND_CUTSCENE_BANK_3B },
{ "BANK_4", STREAMED_SOUND_CUTSCENE_BANK_4 },
{ "BIKE_1", STREAMED_SOUND_CUTSCENE_BIKE_1 },
{ "BIKE_2", STREAMED_SOUND_CUTSCENE_BIKE_2 },
{ "BIKE_3", STREAMED_SOUND_CUTSCENE_BIKE_3 },
{ "BUD_1", STREAMED_SOUND_CUTSCENE_BUD_1 },
{ "BUD_2", STREAMED_SOUND_CUTSCENE_BUD_2 },
{ "BUD_3", STREAMED_SOUND_CUTSCENE_BUD_3 },
{ "CAP_1", STREAMED_SOUND_CUTSCENE_CAP_1 },
{ "CAR_1", STREAMED_SOUND_CUTSCENE_CAR_1 },
{ "CNT_1A", STREAMED_SOUND_CUTSCENE_CNT_1A },
{ "CNT_1B", STREAMED_SOUND_CUTSCENE_CNT_1B },
{ "CNT_2", STREAMED_SOUND_CUTSCENE_CNT_2 },
{ "COK_1", STREAMED_SOUND_CUTSCENE_COK_1 },
{ "COK_2A", STREAMED_SOUND_CUTSCENE_COK_2A },
{ "COK_2B", STREAMED_SOUND_CUTSCENE_COK_2B },
{ "COK_3", STREAMED_SOUND_CUTSCENE_COK_3 },
{ "COK_4A", STREAMED_SOUND_CUTSCENE_COK_4A },
{ "COK_4A2", STREAMED_SOUND_CUTSCENE_COK_4A2 },
{ "COK_4B", STREAMED_SOUND_CUTSCENE_COK_4B },
{ "COL_1", STREAMED_SOUND_CUTSCENE_COL_1 },
{ "COL_2", STREAMED_SOUND_CUTSCENE_COL_2 },
{ "COL_3A", STREAMED_SOUND_CUTSCENE_COL_3A },
{ "COL_4A", STREAMED_SOUND_CUTSCENE_COL_4A },
{ "COL_5A", STREAMED_SOUND_CUTSCENE_COL_5A },
{ "COL_5B", STREAMED_SOUND_CUTSCENE_COL_5B },
{ "CUB_1", STREAMED_SOUND_CUTSCENE_CUB_1 },
{ "CUB_2", STREAMED_SOUND_CUTSCENE_CUB_2 },
{ "CUB_3", STREAMED_SOUND_CUTSCENE_CUB_3 },
{ "CUB_4", STREAMED_SOUND_CUTSCENE_CUB_4 },
{ "DRUG_1", STREAMED_SOUND_CUTSCENE_DRUG_1 },
{ "FIN", STREAMED_SOUND_CUTSCENE_FIN },
{ "FIN_2", STREAMED_SOUND_CUTSCENE_FIN2 },
{ "FINALE", STREAMED_SOUND_CUTSCENE_FINALE },
{ "HAT_1", STREAMED_SOUND_CUTSCENE_HAT_1 },
{ "HAT_2", STREAMED_SOUND_CUTSCENE_HAT_2 },
{ "HAT_3", STREAMED_SOUND_CUTSCENE_HAT_3 },
{ "ICE_1", STREAMED_SOUND_CUTSCENE_ICE_1 },
{ "INT_A", STREAMED_SOUND_CUTSCENE_INT_A },
{ "INT_B", STREAMED_SOUND_CUTSCENE_INT_B },
{ "INT_D", STREAMED_SOUND_CUTSCENE_INT_D },
{ "INT_M", STREAMED_SOUND_CUTSCENE_INT_M },
{ "LAW_1A", STREAMED_SOUND_CUTSCENE_LAW_1A },
{ "LAW_1B", STREAMED_SOUND_CUTSCENE_LAW_1B },
{ "LAW_2A", STREAMED_SOUND_CUTSCENE_LAW_2A },
{ "LAW_2B", STREAMED_SOUND_CUTSCENE_LAW_2B },
{ "LAW_2C", STREAMED_SOUND_CUTSCENE_LAW_2C },
{ "LAW_3", STREAMED_SOUND_CUTSCENE_LAW_3 },
{ "LAW_4", STREAMED_SOUND_CUTSCENE_LAW_4 },
{ "PHIL_1", STREAMED_SOUND_CUTSCENE_PHIL_1 },
{ "PHIL_2", STREAMED_SOUND_CUTSCENE_PHIL_2 },
{ "PORN_1", STREAMED_SOUND_CUTSCENE_PORN_1 },
{ "PORN_2", STREAMED_SOUND_CUTSCENE_PORN_2 },
{ "PORN_3", STREAMED_SOUND_CUTSCENE_PORN_3 },
{ "PORN_4", STREAMED_SOUND_CUTSCENE_PORN_4 },
{ "RESC_1A", STREAMED_SOUND_CUTSCENE_RESC_1A },
{ "ROK_1", STREAMED_SOUND_CUTSCENE_ROK_1 },
{ "ROK_2", STREAMED_SOUND_CUTSCENE_ROK_2 },
{ "ROK_3A", STREAMED_SOUND_CUTSCENE_ROK_3A },
{ "STRIPA", STREAMED_SOUND_CUTSCENE_STRIPA },
{ "TAX_1", STREAMED_SOUND_CUTSCENE_TAX_1 },
{ "TEX_1", STREAMED_SOUND_CUTSCENE_TEX_1 },
{ "TEX_2", STREAMED_SOUND_CUTSCENE_TEX_2 },
{ "TEX_3", STREAMED_SOUND_CUTSCENE_TEX_3 },
{ "GSPOT", STREAMED_SOUND_CUTSCENE_GLIGHT },
{ "FIST", STREAMED_SOUND_CUTSCENE_FIST },
{ "EL_PH1", STREAMED_SOUND_CUTSCENE_ELBURRO1_PH1 },
{ "EL_PH2", STREAMED_SOUND_CUTSCENE_ELBURRO2_PH2 },
{ NULL, 0 }
};
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
void ProcessActiveQueues();
bool ProcessAirBrakes(cVehicleParams *params);
void ProcessAirportScriptObject(uint8 sound);
bool ProcessBoatEngine(cVehicleParams *params);
bool ProcessBoatMovingOverWater(cVehicleParams *params);
#ifdef GTA_BRIDGE
void ProcessBridge();
void ProcessBridgeMotor();
void ProcessBridgeOneShots();
void ProcessBridgeWarning();
#endif
bool ProcessCarBombTick(cVehicleParams *params);
void ProcessCesna(cVehicleParams *params);
void ProcessCinemaScriptObject(uint8 sound);
void ProcessCrane();
void ProcessDocksScriptObject(uint8 sound);
//void ProcessCrane();
bool ProcessEngineDamage(cVehicleParams *params);
void ProcessEntity(int32 sound);
void ProcessExplosions(int32 explosion);
@ -308,7 +307,6 @@ public:
void ProcessFrontEnd();
void ProcessGarages();
bool ProcessHelicopter(cVehicleParams *params);
void ProcessHomeScriptObject(uint8 sound);
void ProcessJumbo(cVehicleParams *);
void ProcessJumboAccel(CPlane *plane);
void ProcessJumboDecel(CPlane *plane);
@ -316,7 +314,6 @@ public:
void ProcessJumboLanding(CPlane *plane);
void ProcessJumboTakeOff(CPlane *plane);
void ProcessJumboTaxi();
void ProcessLaunderetteScriptObject(uint8 sound);
void ProcessLoopingScriptObject(uint8 sound);
void ProcessMissionAudio();
void ProcessModelCarEngine(cVehicleParams *params);
@ -326,17 +323,15 @@ public:
void ProcessPhysical(int32 id);
void ProcessPlane(cVehicleParams *params);
void ProcessPlayersVehicleEngine(cVehicleParams *params, CAutomobile *automobile);
void ProcessPoliceCellBeatingScriptObject(uint8 sound);
void ProcessPornCinema(uint8 sound);
void ProcessProjectiles();
void ProcessRainOnVehicle(cVehicleParams *params);
void ProcessReverb() const;
bool ProcessReverseGear(cVehicleParams *params);
void ProcessSawMillScriptObject(uint8 sound);
void ProcessScriptObject(int32 id);
void ProcessShopScriptObject(uint8 sound);
void ProcessSpecial();
#ifdef GTA_TRAIN
bool ProcessTrainNoise(cVehicleParams *params);
#endif
void ProcessVehicle(CVehicle *vehicle);
bool ProcessVehicleDoors(cVehicleParams *params);
void ProcessVehicleEngine(cVehicleParams *params);
@ -349,7 +344,6 @@ public:
void ProcessWaterCannon(int32);
void ProcessWeather(int32 id);
bool ProcessWetRoadNoise(cVehicleParams *params);
void ProcessWorkShopScriptObject(uint8 sound);
int32 RandomDisplacement(uint32 seed) const;
void ReacquireDigitalHandle() const;

File diff suppressed because it is too large Load diff

View file

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

View file

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

View file

@ -24,8 +24,6 @@ struct tPoliceRadioZone {
};
tPoliceRadioZone ZoneSfx[NUMAUDIOZONES];
char SubZo2Label[8];
char SubZo3Label[8];
int32 g_nMissionAudioSfx = TOTAL_AUDIO_SAMPLES;
int8 g_nMissionAudioPlayingStatus = 2;
@ -42,48 +40,22 @@ cAudioManager::InitialisePoliceRadioZones()
strcpy(ZoneSfx[i].m_aName, name); \
ZoneSfx[i].m_nSampleIndex = sample;
SETZONESFX(0, "HOSPI_2", SFX_POLICE_RADIO_ROCKFORD);
SETZONESFX(1, "CONSTRU", SFX_POLICE_RADIO_FORT_STAUNTON);
SETZONESFX(2, "STADIUM", SFX_POLICE_RADIO_ASPATRIA);
SETZONESFX(3, "YAKUSA", SFX_POLICE_RADIO_TORRINGTON);
SETZONESFX(4, "SHOPING", SFX_POLICE_RADIO_BEDFORD_POINT);
SETZONESFX(5, "COM_EAS", SFX_POLICE_RADIO_NEWPORT);
SETZONESFX(6, "PARK", SFX_POLICE_RADIO_BELLEVILLE_PARK);
SETZONESFX(7, "UNIVERS", SFX_POLICE_RADIO_LIBERTY_CAMPUS);
SETZONESFX(8, "BIG_DAM", SFX_POLICE_RADIO_COCHRANE_DAM);
SETZONESFX(9, "SUB_IND", SFX_POLICE_RADIO_PIKE_CREEK);
SETZONESFX(10, "SWANKS", SFX_POLICE_RADIO_CEDAR_GROVE);
SETZONESFX(11, "PROJECT", SFX_POLICE_RADIO_WICHITA_GARDENS);
SETZONESFX(12, "AIRPORT", SFX_POLICE_RADIO_FRANCIS_INTERNATIONAL_AIRPORT);
SETZONESFX(13, "PORT_W", SFX_POLICE_RADIO_CALLAHAN_POINT);
/*
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);
*/
SETZONESFX(0, "VICE_C", SFX_POLICE_RADIO_VICE_CITY);
SETZONESFX(1, "IND_ZON", SFX_POLICE_RADIO_VICE_CITY_BEACH);
SETZONESFX(2, "COM_ZON", SFX_POLICE_RADIO_VICE_CITY_MAINLAND);
SETZONESFX(3, "BEACH1", SFX_POLICE_RADIO_OCEAN_BEACH);
SETZONESFX(4, "BEACH2", SFX_POLICE_RADIO_WASHINGTON_BEACH);
SETZONESFX(5, "BEACH3", SFX_POLICE_RADIO_VICE_POINT);
SETZONESFX(6, "GOLFC", SFX_POLICE_RADIO_LEAF_LINKS);
SETZONESFX(7, "STARI", SFX_POLICE_RADIO_STRAFISH_ISLAND);
SETZONESFX(8, "DOCKS", SFX_POLICE_RADIO_VICE_PORT);
SETZONESFX(9, "HAVANA", SFX_POLICE_RADIO_LITTLE_HAVANA);
SETZONESFX(10, "HAITI", SFX_POLICE_RADIO_LITTLE_HAITI);
SETZONESFX(11, "PORNI", SFX_POLICE_RADIO_PRAWN_ISLAND);
SETZONESFX(12, "DTOWN", SFX_POLICE_RADIO_DOWNTOWN);
SETZONESFX(13, "A_PORT", SFX_POLICE_RADIO_ESCOBAR_INTERNATIONAL);
#undef SETZONESFX
strcpy(SubZo2Label, "SUB_ZO2");
strcpy(SubZo3Label, "SUB_ZO3");
}
void
@ -246,7 +218,7 @@ cAudioManager::ServicePoliceRadioChannel(int32 wantedLevel)
if (!wantedLevel) {
if (gSpecialSuspectLastSeenReport) {
gSpecialSuspectLastSeenReport = 0;
} else if (((sample >= SFX_POLICE_RADIO_MESSAGE_NOISE_1) && (sample <= SFX_POLICE_RADIO_MESSAGE_NOISE_3)) || sample == TOTAL_AUDIO_SAMPLES) {
} else if (sample == SFX_POLICE_RADIO_MESSAGE_NOISE_1 || sample == TOTAL_AUDIO_SAMPLES) {
bChannelOpen = false;
processed = true;
}
@ -257,8 +229,6 @@ cAudioManager::ServicePoliceRadioChannel(int32 wantedLevel)
SampleManager.InitialiseChannel(policeChannel, sample, 0);
switch (sample) {
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;
bChannelOpen = bChannelOpen == false;
break;
@ -313,7 +283,7 @@ cAudioManager::SetupCrimeReport()
sampleIndex = ZoneSfx[j].m_nSampleIndex;
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[1] % 2 + SFX_A_10_1);
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;
@ -323,37 +293,31 @@ cAudioManager::SetupCrimeReport()
}
m_sPoliceRadioQueue.Add(m_sPoliceRadioQueue.crimes[i].type + SFX_CRIME_1 - 1);
m_sPoliceRadioQueue.Add(SFX_IN);
if (sampleIndex == SFX_POLICE_RADIO_SHORESIDE_VALE &&
(strcmp(zone->name, SubZo2Label) == 0 || strcmp(zone->name, SubZo3Label) == 0)) {
rangeX = zone->maxx - zone->minx;
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_EAST);
} else {
rangeX = zone->maxx - zone->minx;
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);
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);
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);
break;
}
}
@ -559,7 +523,7 @@ cAudioManager::SetupSuspectLastSeenReport()
// main_color = SFX_POLICE_RADIO_BLACK;
#endif
case MI_IDAHO:
case MI_STALLION: sample = SFX_POLICE_RADIO_CONVERTIBLE; break;
// case MI_STALLION: sample = SFX_POLICE_RADIO_CONVERTIBLE; break;
#ifdef FIX_BUGS
// case MI_YAKUZA:
// color_pre_modifier = TOTAL_AUDIO_SAMPLES;
@ -578,7 +542,7 @@ cAudioManager::SetupSuspectLastSeenReport()
#endif
case MI_PEREN:
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_BOBCAT: sample = SFX_POLICE_RADIO_PICKUP; break;
case MI_FIRETRUCK: sample = SFX_POLICE_RADIO_FIRE_TRUCK; break;
@ -588,7 +552,7 @@ cAudioManager::SetupSuspectLastSeenReport()
#endif
case MI_TRASH:
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_ESPERANT: sample = SFX_POLICE_RADIO_2_DOOR; break;
#ifdef FIX_BUGS
@ -631,12 +595,12 @@ cAudioManager::SetupSuspectLastSeenReport()
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;
// case MI_TRAIN:
// sample = SFX_POLICE_RADIO_SUBWAY_CAR;
// main_color = TOTAL_AUDIO_SAMPLES;
// color_post_modifier = TOTAL_AUDIO_SAMPLES;
break;
// break;
default:
debug("\n *** UNKNOWN CAR MODEL INDEX %d *** ", veh->GetModelIndex());
return;
@ -645,14 +609,7 @@ cAudioManager::SetupSuspectLastSeenReport()
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_SUSPECT);
if (m_anRandomTable[3] % 2)
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_LAST_SEEN);
#ifdef FIX_BUGS
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);
m_sPoliceRadioQueue.Add(SFX_POLICE_RADIO_IN_A);
if (color_pre_modifier != TOTAL_AUDIO_SAMPLES)
m_sPoliceRadioQueue.Add(color_pre_modifier);
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_LAST_SEEN);
m_sPoliceRadioQueue.Add(SFX_IN);
if (sample == SFX_POLICE_RADIO_SHORESIDE_VALE &&
(strcmp(zone->name, SubZo2Label) == 0 ||
strcmp(zone->name, SubZo3Label) == 0)) {
rangeX = zone->maxx - zone->minx;
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 (vec.y > halfY + quarterY) {
m_sPoliceRadioQueue.Add(SFX_NORTH);
m_sPoliceRadioQueue.Add(SFX_EAST);
} else {
rangeX = zone->maxx - zone->minx;
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 (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);
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);
m_sPoliceRadioQueue.Add(sample);
m_sPoliceRadioQueue.Add(m_anRandomTable[2] % 3 + SFX_POLICE_RADIO_MESSAGE_NOISE_1);
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
{
protected:
mpg123_handle *m_pMH;
bool m_bOpened;
uint32 m_nRate;
uint32 m_nChannels;
CMP3File() :
m_pMH(nil),
m_bOpened(false),
m_nRate(0),
m_nChannels(0) {}
public:
CMP3File(const char *path) :
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()
{
mpg123_init();
@ -217,6 +269,8 @@ CStream::CStream(char *filename, ALuint &source, ALuint (&buffers)[NUM_STREAMBUF
m_pSoundFile = new CMP3File(m_aFilename);
else if (!strcasecmp(&m_aFilename[strlen(m_aFilename) - strlen(".wav")], ".wav"))
m_pSoundFile = new CSndFile(m_aFilename);
else if (!strcasecmp(&m_aFilename[strlen(m_aFilename) - strlen(".adf")], ".adf"))
m_pSoundFile = new CADFFile(m_aFilename);
else
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;
}
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) :
m_nNumberOfProviders(0)
{
;
AIL_set_file_callbacks(vfs_open_callback, vfs_close_callback, vfs_seek_callback, vfs_read_callback);
}
cSampleManager::~cSampleManager(void)
@ -1500,7 +1553,7 @@ cSampleManager::LoadPedComment(uint32 nComment)
case MUSICMODE_FRONTEND:
{
if ( MusicManager.GetCurrentTrack() == STREAMED_SOUND_GAME_COMPLETED )
if ( MusicManager.GetCurrentTrack() == STREAMED_SOUND_CUTSCENE_FINALE )
return false;
break;
@ -1739,8 +1792,7 @@ cSampleManager::SetChannelEmittingVolume(uint32 nChannel, uint32 nVolume)
// increase the volume for JB.MP3 and S4_BDBD.MP3
if ( MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
&& MusicManager.GetCurrentTrack() != STREAMED_SOUND_NEWS_INTRO
&& MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_SAL4_BDBD )
&& MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_FINALE )
{
nChannelVolume[nChannel] >>= 2;
}
@ -1778,8 +1830,7 @@ cSampleManager::SetChannelVolume(uint32 nChannel, uint32 nVolume)
// increase the volume for JB.MP3 and S4_BDBD.MP3
if ( MusicManager.GetMusicMode() == MUSICMODE_CUTSCENE
&& MusicManager.GetCurrentTrack() != STREAMED_SOUND_NEWS_INTRO
&& MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_SAL4_BDBD )
&& MusicManager.GetCurrentTrack() != STREAMED_SOUND_CUTSCENE_FINALE )
{
nChannelVolume[nChannel] >>= 2;
}

View file

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

View file

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

View file

@ -9571,7 +9571,7 @@ int8 CRunningScript::ProcessCommands1100To1199(int32 command)
case COMMAND_LOAD_END_OF_GAME_TUNE:
DMAudio.ChangeMusicMode(MUSICMODE_CUTSCENE);
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");
return 0;
/*

View file

@ -486,9 +486,9 @@ CMenuManager::Initialise(void)
// TODO(Miami)
// DMAudio.SetMP3BoostVolume(m_PrefsMP3BoostVolume);
if (DMAudio.IsMP3RadioChannelAvailable()) {
if (m_PrefsRadioStation < HEAD_RADIO || m_PrefsRadioStation > USERTRACK)
if (m_PrefsRadioStation < WILDSTYLE || m_PrefsRadioStation > USERTRACK)
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;
CFileMgr::SetDir("");
@ -4413,7 +4413,7 @@ CMenuManager::ProcessButtonPresses(void)
m_PrefsSpeakers = 0;
m_PrefsMusicVolume = 102;
m_PrefsStereoMono = 0;
m_PrefsRadioStation = HEAD_RADIO;
m_PrefsRadioStation = WILDSTYLE;
DMAudio.SetMusicMasterVolume(102);
DMAudio.SetEffectsMasterVolume(m_PrefsSfxVolume);
DMAudio.SetRadioInCar(m_PrefsRadioStation);
@ -4609,15 +4609,15 @@ CMenuManager::ProcessButtonPresses(void)
m_PrefsRadioStation += changeValueBy;
DMAudio.PlayFrontEndSound(SOUND_FRONTEND_MENU_SUCCESS, 0);
if (DMAudio.IsMP3RadioChannelAvailable()) {
if (m_PrefsRadioStation < HEAD_RADIO)
if (m_PrefsRadioStation < WILDSTYLE)
m_PrefsRadioStation = USERTRACK;
if (m_PrefsRadioStation > USERTRACK)
m_PrefsRadioStation = HEAD_RADIO;
m_PrefsRadioStation = WILDSTYLE;
} else {
if (m_PrefsRadioStation < HEAD_RADIO)
m_PrefsRadioStation = CHATTERBOX;
if (m_PrefsRadioStation > CHATTERBOX)
m_PrefsRadioStation = HEAD_RADIO;
if (m_PrefsRadioStation < WILDSTYLE)
m_PrefsRadioStation = WAVE;
if (m_PrefsRadioStation > WAVE)
m_PrefsRadioStation = WILDSTYLE;
}
SaveSettings();
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
DebugMenuRender(void)
{
@ -1048,7 +1042,7 @@ DebugMenuRender(void)
RwRenderStateSet(rwRENDERSTATEFOGENABLE, 0);
RwRenderStateSet(rwRENDERSTATECULLMODE, (void*)rwCULLMODECULLNONE);
RwCamera *cam = CURRENTCAM;
RwCamera *cam = RwCameraGetCurrentCamera();
screenWidth = RwRasterGetWidth(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 RwIm2DVertex arrowVerts[4];
RwCamera *cam = CURRENTCAM;
RwCamera *cam = RwCameraGetCurrentCamera();
float recipz = 1.0f/RwCameraGetNearClipPlane(cam);
int width = RwRasterGetWidth(arrow);
@ -1183,7 +1177,7 @@ drawMouse(void)
static RwIm2DVertex vertices[4];
RwIm2DVertex *vert;
RwCamera *cam;
cam = CURRENTCAM;
cam = RwCameraGetCurrentCamera();
float x = mouseX;
float y = mouseY;
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; }
RwCamera *RwCameraSetFogDistance(RwCamera *camera, RwReal fogDistance) { camera->fogPlane = fogDistance; return camera; }
RwReal RwCameraGetFogDistance(const RwCamera *camera) { return camera->fogPlane; }
RwCamera *RwCameraGetCurrentCamera(void);
RwCamera *RwCameraGetCurrentCamera(void) { return rw::engine->currentCamera; }
RwCameraProjection RwCameraGetProjection(const RwCamera *camera);
const RwV2d *RwCameraGetViewWindow(const RwCamera *camera) { return &camera->viewWindow; }
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; }
RwSphere *RpMorphTargetGetBoundingSphere(RpMorphTarget *morphTarget) { return &morphTarget->boundingSphere; }
const RpMorphTarget *RpMorphTargetCalcBoundingSphere(const RpMorphTarget *morphTarget, RwSphere *boundingSphere) { *boundingSphere = morphTarget->calculateBoundingSphere(); return morphTarget; }
RwInt32 RpGeometryAddMorphTargets(RpGeometry *geometry, RwInt32 mtcount);
RwInt32 RpGeometryAddMorphTarget(RpGeometry *geometry);
RwInt32 RpGeometryAddMorphTargets(RpGeometry *geometry, RwInt32 mtcount) { RwInt32 n = geometry->numMorphTargets; geometry->addMorphTargets(mtcount); return n; }
RwInt32 RpGeometryAddMorphTarget(RpGeometry *geometry) { return RpGeometryAddMorphTargets(geometry, 1); }
RpGeometry *RpGeometryRemoveMorphTarget(RpGeometry *geometry, RwInt32 morphTarget);
RwInt32 RpGeometryGetNumMorphTargets(const RpGeometry *geometry);
RpMorphTarget *RpGeometryGetMorphTarget(const RpGeometry *geometry, RwInt32 morphTarget) { return &geometry->morphTargets[morphTarget]; }
@ -790,6 +790,12 @@ RpMaterial *RpMatFXMaterialSetEnvMapFrame( RpMaterial *material, RwFrame *frame
mfx->setEnvFrame(frame);
return material;
}
RpMaterial *RpMatFXMaterialSetEnvMapFrameBufferAlpha( RpMaterial *material, RwBool useFrameBufferAlpha )
{
MatFX *mfx = MatFX::get(material);
mfx->setEnvFBAlpha(useFrameBufferAlpha);
return material;
}
RpMaterial *RpMatFXMaterialSetEnvMapCoefficient( RpMaterial *material, RwReal coef )
{
MatFX *mfx = MatFX::get(material);

View file

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

View file

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

View file

@ -31,6 +31,8 @@
#include "Weather.h"
#include "Coronas.h"
//--MIAMI: done
bool CVehicle::bWheelsOnlyCheat;
bool CVehicle::bAllDodosCheat;
bool CVehicle::bCheat3;
@ -141,8 +143,26 @@ CVehicle::CVehicle(uint8 CreatedBy)
m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, this);
if(m_audioEntityId >= 0)
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_bRainAudioCounter = 0;
m_bRainSamplesCounter = 0;
@ -1212,8 +1232,7 @@ CVehicle::InflictDamage(CEntity *damagedBy, eWeaponType weaponType, float damage
SetStatus(STATUS_ABANDONED);
pDriver->bFleeAfterExitingCar = true;
pDriver->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this);
// TODO(MIAMI):
// pDriver->Say(120);
pDriver->Say(SOUND_PED_FLEE_SPRINT);
}
int time = 200;
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]->SetObjective(OBJECTIVE_LEAVE_VEHICLE, this);
pPassengers[i]->m_objectiveTimer = CTimer::GetTimeInMilliseconds() + time;
// TODO(MIAMI):
// pPassengers[i]->Say(120);
pPassengers[i]->Say(SOUND_PED_FLEE_SPRINT);
time += 200;
}
}