more audio process

This commit is contained in:
Filip Gawin 2019-07-16 17:03:37 +02:00
parent 113abec6fa
commit 88a6d67494
6 changed files with 1137 additions and 105 deletions

File diff suppressed because it is too large Load Diff

View File

@ -77,7 +77,7 @@ class tAudioEntity
{ {
public: public:
eAudioType m_nType; eAudioType m_nType;
CPhysical *m_pEntity; void *m_pEntity;
bool m_bIsUsed; bool m_bIsUsed;
uint8 m_bStatus; uint8 m_bStatus;
int16 m_awAudioEvent[4]; int16 m_awAudioEvent[4];
@ -166,10 +166,21 @@ public:
uint8 field_31; uint8 field_31;
}; };
class cVehicleParams;
static_assert(sizeof(cMissionAudio) == 0x20, "cMissionAudio: error"); static_assert(sizeof(cMissionAudio) == 0x20, "cMissionAudio: error");
class cVehicleParams;
class CPlane;
class CVehicle;
struct cAudioScriptObject {
int16 m_wSound;
char gap_2[2];
CVector m_vecPos;
int m_nAudioEntityId;
};
static_assert(sizeof(cAudioScriptObject) == 0x14, "cAudioScriptObject: error");
class cAudioManager class cAudioManager
{ {
public: public:
@ -219,37 +230,37 @@ public:
uint8 field_19195; uint8 field_19195;
int32 m_nTimeOfRecentCrime; int32 m_nTimeOfRecentCrime;
void AddDetailsToRequestedOrderList(uint8 sample); void AddDetailsToRequestedOrderList(uint8 sample); /// ok
void AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 unk1, void AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 unk1,
uint8 unk2, bool notLooping); uint8 unk2, bool notLooping); /// ok
void AddReflectionsToRequestedQueue(); void AddReflectionsToRequestedQueue(); /// ok (check value)
void AddReleasingSounds(); // todo void AddReleasingSounds(); // todo (difficult)
void AddSampleToRequestedQueue(); void AddSampleToRequestedQueue(); /// ok
void AgeCrimes(); // todo void AgeCrimes(); // todo
int8 AutoDetect3DProviders(); int8 AutoDetect3DProviders(); /// ok
void CalculateDistance(bool *ptr, float dist); void CalculateDistance(bool *ptr, float dist); /// ok
bool CheckForAnAudioFileOnCD(); bool CheckForAnAudioFileOnCD(); /// ok
void ClearMissionAudio(); void ClearMissionAudio(); /// ok
void ClearRequestedQueue(); void ClearRequestedQueue(); /// ok
int32 ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2, int32 ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2,
float speedMultiplier); float speedMultiplier); /// ok
int32 ComputePan(float, CVector *); // todo int32 ComputePan(float, CVector *); // todo
uint32 ComputeVolume(int emittingVolume, float soundIntensity, float distance); uint32 ComputeVolume(int emittingVolume, float soundIntensity, float distance); /// ok
int32 CreateEntity(int32 type, CPhysical *entity); int32 CreateEntity(int32 type, CPhysical *entity); /// ok
void DestroyAllGameCreatedEntities(); // todo, needs cAudioScriptObject void DestroyAllGameCreatedEntities(); /// ok
void DestroyEntity(int32 id); void DestroyEntity(int32 id); /// ok
void DoPoliceRadioCrackle(); // todo hook void DoPoliceRadioCrackle(); /// ok
void GenerateIntegerRandomNumberTable(); void GenerateIntegerRandomNumberTable(); /// ok
float GetDistanceSquared(CVector *v); // todo hook float GetDistanceSquared(CVector *v); /// ok
void TranslateEntity(CVector *v1, CVector *v2); /// ok
// done // done
void TranslateEntity(CVector *v1, CVector *v2); // todo hook
void Initialise(); void Initialise();
void PostInitialiseGameSpecificSetup(); void PostInitialiseGameSpecificSetup();
void InitialisePoliceRadioZones(); // todo void InitialisePoliceRadioZones(); // todo
@ -322,6 +333,8 @@ public:
void Service(); void Service();
void GetPhrase(uint32 *phrase, uint32 *prevPhrase, uint32 sample, uint32 maxOffset); void GetPhrase(uint32 *phrase, uint32 *prevPhrase, uint32 sample, uint32 maxOffset);
void DoJumboVolOffset();
uint32 GetPlayerTalkSfx(int16 sound); uint32 GetPlayerTalkSfx(int16 sound);
uint32 GetCopTalkSfx(int16 sound); uint32 GetCopTalkSfx(int16 sound);
uint32 GetSwatTalkSfx(int16 sound); uint32 GetSwatTalkSfx(int16 sound);
@ -400,58 +413,58 @@ public:
uint32 GetGenericFemaleTalkSfx(int16 sound); uint32 GetGenericFemaleTalkSfx(int16 sound);
void ProcessActiveQueues(); // todo void ProcessActiveQueues(); // todo
bool ProcessAirBrakes(cVehicleParams *params); // todo requires CVehicle bool ProcessAirBrakes(cVehicleParams *params); /// ok
void ProcessAirportScriptObject(uint8 sound); // done void ProcessAirportScriptObject(uint8 sound); /// ok
bool ProcessBoatEngine(cVehicleParams *params); // todo requires CVehicle bool ProcessBoatEngine(cVehicleParams *params); // todo requires CBoat
bool ProcessBoatMovingOverWater(cVehicleParams *params); // todo requires CVehicle bool ProcessBoatMovingOverWater(cVehicleParams *params); // todo requires CBoat
void ProcessBridge(); // todo void ProcessBridge(); // todo requires CBridge
void ProcessBridgeMotor(); // done void ProcessBridgeMotor(); /// ok
void ProcessBridgeOneShots(); // todo requires CBridge void ProcessBridgeOneShots(); // todo requires CBridge
void ProcessBridgeWarning(); // done void ProcessBridgeWarning(); /// ok
bool ProcessCarBombTick(void *); // todo requires CVehicle bool ProcessCarBombTick(void *); // todo requires CVehicle
void ProcessCesna(void *); // todo requires CPlane void ProcessCesna(void *); // todo requires CPlane
void ProcessCinemaScriptObject(uint8 sound); // done void ProcessCinemaScriptObject(uint8 sound); /// ok
void ProcessCrane(); // todo requires CCrane void ProcessCrane(); // todo requires CCrane
void ProcessDocksScriptObject(uint8 sound); // done void ProcessDocksScriptObject(uint8 sound); /// ok
// bool ProcessEngineDamage(void *); //todo requires CVehicle // bool ProcessEngineDamage(void *); //todo requires CVehicle
void ProcessEntity(int32 sound); // done void ProcessEntity(int32 sound); /// ok
void ProcessExplosions(int32 explosion); // todo requires CExplosion void ProcessExplosions(int32 explosion); // todo requires CExplosion
void ProcessFireHydrant(); // done void ProcessFireHydrant(); /// ok
void ProcessFires(int32 entity); // todo requires gFireManager void ProcessFires(int32 entity); // todo requires gFireManager
void ProcessFrontEnd(); // done void ProcessFrontEnd(); /// ok
void ProcessGarages(); // todo void ProcessGarages(); // todo requires CGarages::aGarages
// bool ProcessHelicopter(void *); // todo requires CVehicle // bool ProcessHelicopter(void *); // todo requires CVehicle
void ProcessHomeScriptObject(uint8 sound); void ProcessHomeScriptObject(uint8 sound); /// ok
// void ProcessJumbo(void *); void ProcessJumbo(cVehicleParams *); /// ok
// void ProcessJumboAccel(void *); void ProcessJumboAccel(CPlane *); // todo
// void ProcessJumboDecel(void *); void ProcessJumboDecel(CPlane *); // todo
void ProcessJumboFlying(); void ProcessJumboFlying(); /// ok
// void ProcessJumboLanding(void *); void ProcessJumboLanding(CPlane *); // todo
// void ProcessJumboTakeOff(void *); void ProcessJumboTakeOff(CPlane *); // todo
void ProcessJumboTaxi(); // done void ProcessJumboTaxi(); /// ok
// void ProcessLaunderetteScriptObject(uint8 sound); void ProcessLaunderetteScriptObject(uint8 sound); /// ok
// void ProcessLoopingScriptObject(uint8 sound); void ProcessLoopingScriptObject(uint8 sound); /// ok
// void ProcessMissionAudio(); // void ProcessMissionAudio();
// void ProcessModelVehicle(void *); // void ProcessModelVehicle(void *);
// void ProcessOneShotScriptObject(uint8 sound); // void ProcessOneShotScriptObject(uint8 sound);
void ProcessPed(CPhysical *p); // todo void ProcessPed(CPhysical *p); // todo
// void ProcessPedHeadphones(void *); // void ProcessPedHeadphones(void *);
// void ProcessPedOneShots(void *); // void ProcessPedOneShots(void *);
void ProcessPhysical(int32 id); // done void ProcessPhysical(int32 id); /// ok
void ProcessPlane(void *); // todo void ProcessPlane(void *); // todo
// void ProcessPlayersVehicleEngine(void *, void *); // void ProcessPlayersVehicleEngine(void *, void *);
// void ProcessPoliceCellBeatingScriptObject(uint8 sound); void ProcessPoliceCellBeatingScriptObject(uint8 sound); // todo
// void ProcessPornCinema(uint8 sound); void ProcessPornCinema(uint8 sound); // todo
void ProcessProjectiles(); // todo void ProcessProjectiles(); // todo
// void ProcessRainOnVehicle(void *); // void ProcessRainOnVehicle(void *);
// void ProcessReverb(); // void ProcessReverb();
// bool ProcessReverseGear(void *); // bool ProcessReverseGear(void *);
// void ProcessSawMillScriptObject(uint8 sound); void ProcessSawMillScriptObject(uint8 sound); // todo
void ProcessScriptObject(int32 id); // todo void ProcessScriptObject(int32 id); // todo
// void ProcessShopScriptObject(uint8 sound); void ProcessShopScriptObject(uint8 sound); // todo
// void ProcessSpecial(); void ProcessSpecial(); /// ok
// bool ProcessTrainNoise(void *); // bool ProcessTrainNoise(void *);
void ProcessVehicle(void *); // todo void ProcessVehicle(CVehicle *); // todo
// bool ProcessVehicleDoors(void *); // bool ProcessVehicleDoors(void *);
// bool ProcessVehicleEngine(void *); // bool ProcessVehicleEngine(void *);
// void ProcessVehicleHorn(void *); // void ProcessVehicleHorn(void *);
@ -462,11 +475,10 @@ public:
// void ProcessVehicleSkidding(void *); // void ProcessVehicleSkidding(void *);
void ProcessWaterCannon(int32); // todo void ProcessWaterCannon(int32); // todo
void ProcessWeather(int32 id); // todo void ProcessWeather(int32 id); // todo
// bool ProcessWetRoadNoise(void *); // bool ProcessWetRoadNoise(void *);
// void ProcessWorkShopScriptObject(uint8 sound); void ProcessWorkShopScriptObject(uint8 sound); /// ok
}; };
static_assert(sizeof(cAudioManager) == 0x4B14, "cAudioManager: error"); static_assert(sizeof(cAudioManager) == 0x4B14, "cAudioManager: error");
extern cAudioManager &AudioManager; extern cAudioManager &AudioManager;
extern cAudioManager &Players;

View File

@ -188,3 +188,17 @@ cMusicManager::Terminate()
{ {
EAXJMP(0x57D140); EAXJMP(0x57D140);
} }
WRAPPER
void
cMusicManager::ChangeMusicMode(int32 mode)
{
EAXJMP(0x57D310);
}
WRAPPER
void
cMusicManager::StopFrontEndTrack()
{
EAXJMP(0x57E3D0);
}

View File

@ -267,6 +267,9 @@ public:
void Initialise(); void Initialise();
void Terminate(); void Terminate();
void ChangeMusicMode(int32 mode);
void StopFrontEndTrack();
char *Get3DProviderName(char); char *Get3DProviderName(char);
bool PlayerInCar(); bool PlayerInCar();
void DisplayRadioStationName(); void DisplayRadioStationName();

View File

@ -61,7 +61,7 @@ public:
float m_aSuspensionLineLength[4]; float m_aSuspensionLineLength[4];
float m_fHeightAboveRoad; float m_fHeightAboveRoad;
float m_fTraction; float m_fTraction;
int32 field_514; float m_fVelocityChangeForAudio;
float m_randomValues[6]; // used for what? float m_randomValues[6]; // used for what?
float m_fFireBlowUpTimer; float m_fFireBlowUpTimer;
CPhysical *m_aGroundPhysical[4]; // physicals touching wheels CPhysical *m_aGroundPhysical[4]; // physicals touching wheels

View File

@ -7,7 +7,17 @@ class CPlane : public CVehicle
{ {
public: public:
// 0x288 // 0x288
uint8 stuff[20]; int16 m_wIndex;
int16 field_650;
int16 m_wNextPathNode;
char field_654;
char field_655;
float field_656;
int m_nFrameWhenHit;
char m_bHasBeenHit;
char m_bIsIncomingCesna;
char m_bIsDropoffCesna;
char field_667;
CPlane(int, uint8); CPlane(int, uint8);
~CPlane(void); ~CPlane(void);