Merge pull request #149 from ShFil119/audio4

Audio4
This commit is contained in:
aap 2019-07-20 12:35:24 +02:00 committed by GitHub
commit 29d7b983d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
19 changed files with 3456 additions and 427 deletions

View File

@ -24,6 +24,7 @@ workspace "re3"
includedirs { "src/control" }
includedirs { "src/core" }
includedirs { "src/entities" }
includedirs { "src/math" }
includedirs { "src/modelinfo" }
includedirs { "src/objects" }
includedirs { "src/peds" }

View File

@ -1,6 +1,6 @@
#pragma once
#include "math/Quaternion.h"
#include "Quaternion.h"
// TODO: put them somewhere else?
struct KeyFrame {

File diff suppressed because it is too large Load Diff

View File

@ -7,48 +7,48 @@
class tActiveSample
{
public:
int m_nEntityIndex;
int field_4;
int m_nSampleIndex;
char m_bBankIndex;
char m_bIsDistant;
char field_14;
char field_15;
int field_16;
int m_nFrequency;
int32 m_nEntityIndex;
int32 field_4;
int32 m_nSampleIndex;
uint8 m_bBankIndex;
uint8 m_bIsDistant;
uint8 field_14;
uint8 field_15;
int32 field_16;
int32 m_nFrequency;
uint8 m_bVolume;
char field_25;
char field_26;
char field_27;
uint8 field_25;
uint8 field_26;
uint8 field_27;
float m_fDistance;
int m_nLoopCount;
int m_nLoopStart;
int m_nLoopEnd;
int32 m_nLoopCount;
int32 m_nLoopStart;
int32 m_nLoopEnd;
uint8 m_bEmittingVolume;
char field_45;
char field_46;
char field_47;
uint8 field_45;
uint8 field_46;
uint8 field_47;
float field_48;
float m_fSoundIntensity;
char field_56;
char field_57;
char field_58;
char field_59;
uint8 field_56;
uint8 field_57;
uint8 field_58;
uint8 field_59;
CVector m_vecPos;
char m_bReverbFlag;
char m_bLoopsRemaining;
char m_bRequireReflection;
uint8 m_bReverbFlag;
uint8 m_bLoopsRemaining;
uint8 m_bRequireReflection;
uint8 m_bOffset;
int field_76;
char m_bIsProcessed;
char m_bLoopEnded;
char field_82;
char field_83;
int calculatedVolume;
char field_88;
char field_89;
char field_90;
char field_91;
int32 field_76;
uint8 m_bIsProcessed;
uint8 m_bLoopEnded;
uint8 field_82;
uint8 field_83;
int32 calculatedVolume;
uint8 field_88;
uint8 field_89;
uint8 field_90;
uint8 field_91;
};
static_assert(sizeof(tActiveSample) == 0x5c, "tActiveSample: error");
@ -77,14 +77,14 @@ class tAudioEntity
{
public:
eAudioType m_nType;
CPhysical *m_pEntity;
void *m_pEntity;
bool m_bIsUsed;
char m_bStatus;
uint8 m_bStatus;
int16 m_awAudioEvent[4];
char gap_18[2];
uint8 gap_18[2];
float m_afVolume[4];
char field_24;
char field_25[3];
uint8 field_24;
uint8 field_25[3];
};
static_assert(sizeof(tAudioEntity) == 0x28, "tAudioEntity: error");
@ -96,9 +96,9 @@ public:
int field_4;
CVector m_vecPos;
float m_fDistance;
char m_bVolume;
char field_25;
char gap_26[2];
uint8 m_bVolume;
uint8 field_25;
uint8 gap_26[2];
};
static_assert(sizeof(tPedComment) == 0x1c, "tPedComment: error");
@ -107,10 +107,10 @@ class cPedComments
{
public:
tPedComment m_asPedComments[40];
char field_1120[40];
char field_1160[2];
char field_1162;
char gap_1163[1];
uint8 field_1120[40];
uint8 field_1160[2];
uint8 field_1162;
uint8 gap_1163[1];
};
static_assert(sizeof(cPedComments) == 0x48c, "cPedComments: error");
@ -122,15 +122,15 @@ class cAudioCollision
public:
CEntity *m_pEntity1;
CEntity *m_pEntity2;
char m_bSurface1;
char m_bSurface2;
char field_10;
char field_11;
uint8 m_bSurface1;
uint8 m_bSurface2;
uint8 field_10;
uint8 field_11;
float m_fIntensity1;
float m_fIntensity2;
CVector m_vecPosition;
float m_fDistance;
int m_nBaseVolume;
int32 m_nBaseVolume;
};
static_assert(sizeof(cAudioCollision) == 0x28, "cAudioCollision: error");
@ -140,95 +140,132 @@ class cAudioCollisionManager
public:
cAudioCollision m_asCollisions1[10];
cAudioCollision m_asCollisions2[10];
char m_bIndicesTable[10];
char m_bCollisionsInQueue;
char gap_811;
uint8 m_bIndicesTable[10];
uint8 m_bCollisionsInQueue;
uint8 gap_811;
cAudioCollision m_sQueue;
};
static_assert(sizeof(cAudioCollisionManager) == 0x354,
"cAudioCollisionManager: error");
static_assert(sizeof(cAudioCollisionManager) == 0x354, "cAudioCollisionManager: error");
class cMissionAudio
{
public:
CVector m_vecPos;
char field_12;
char gap_13[3];
uint8 field_12;
uint8 gap_13[3];
int m_nSampleIndex;
char m_bLoadingStatus;
char m_bPlayStatus;
char field_22;
char field_23;
uint8 m_bLoadingStatus;
uint8 m_bPlayStatus;
uint8 field_22;
uint8 field_23;
int field_24;
bool m_bIsPlayed;
char field_29;
char field_30;
char field_31;
uint8 field_29;
uint8 field_30;
uint8 field_31;
};
static_assert(sizeof(cMissionAudio) == 0x20, "cMissionAudio: error");
class cVehicleParams;
class CPlane;
class CVehicle;
class CPed;
struct cAudioScriptObject {
int16 m_wSound;
char gap_2[2];
CVector m_vecPos;
int m_nAudioEntityId;
};
static_assert(sizeof(cAudioScriptObject) == 0x14, "cAudioScriptObject: error");
class cAudioManager
{
public:
bool m_bIsInitialised;
char field_1;
char field_2;
char m_bActiveSamples;
char field_4;
uint8 field_1;
uint8 field_2;
uint8 m_bActiveSamples;
uint8 field_4;
bool m_bDynamicAcousticModelingStatus;
char field_6;
char field_7;
float field_8;
uint8 field_6;
uint8 field_7;
float speedOfSound;
bool m_bTimerJustReset;
char field_13;
char field_14;
char field_15;
int m_nTimer;
uint8 field_13;
uint8 field_14;
uint8 field_15;
int32 m_nTimer;
tActiveSample m_sQueueSample;
uint8 m_bActiveSampleQueue;
char gap_109[3];
tActiveSample m_asSamples[54];
char m_abSampleQueueIndexTable[54];
char m_bSampleRequestQueuesStatus[2];
uint8 gap_109[3];
tActiveSample m_asSamples[2][27];
uint8 m_abSampleQueueIndexTable[2][27];
uint8 m_bSampleRequestQueuesStatus[2];
tActiveSample m_asActiveSamples[27];
tAudioEntity m_asAudioEntities[200];
int m_anAudioEntityIndices[200];
int m_nAudioEntitiesTotal;
int32 m_anAudioEntityIndices[200];
int32 m_nAudioEntitiesTotal;
CVector m_avecReflectionsPos[5];
float m_afReflectionsDistances[5];
int m_anScriptObjectEntityIndices[40];
int m_nScriptObjectEntityTotal;
int32 m_anScriptObjectEntityIndices[40];
int32 m_nScriptObjectEntityTotal;
cPedComments m_sPedComments;
int m_nFireAudioEntity;
int m_nWaterCannonEntity;
int m_nPoliceChannelEntity;
char gap45B8[444];
int m_nFrontEndEntity;
int m_nCollisionEntity;
int32 m_nFireAudioEntity;
int32 m_nWaterCannonEntity;
int32 m_nPoliceChannelEntity;
uint8 gap45B8[444];
int32 m_nFrontEndEntity;
int32 m_nCollisionEntity;
cAudioCollisionManager m_sCollisionManager;
int m_nProjectileEntity;
int m_nBridgeEntity;
int32 m_nProjectileEntity;
int32 m_nBridgeEntity;
cMissionAudio m_sMissionAudio;
int m_anRandomTable[5];
char field_19192;
char m_bUserPause;
char m_bPreviousUserPause;
char field_19195;
int m_nTimeOfRecentCrime;
int32 m_anRandomTable[5];
uint8 field_19192;
uint8 m_bUserPause;
uint8 m_bPreviousUserPause;
uint8 field_19195;
int32 m_nTimeOfRecentCrime;
void AddSampleToRequestedQueue();
void AddDetailsToRequestedOrderList(uint8 sample); /// ok
void AddPlayerCarSample(uint8 emittingVolume, int32 freq, uint32 sample, uint8 unk1,
uint8 unk2, bool notLooping); /// ok
void AddReflectionsToRequestedQueue(); /// ok (check value)
void AddReleasingSounds(); // todo (difficult)
void AddSampleToRequestedQueue(); /// ok
void AgeCrimes(); // todo
int8 AutoDetect3DProviders(); /// ok
void AddDetailsToRequestedOrderList(uint8 sample);
void AddReflectionsToRequestedQueue();
void CalculateDistance(bool *ptr, float dist); /// ok
bool CheckForAnAudioFileOnCD(); /// ok
void ClearMissionAudio(); /// ok
void ClearRequestedQueue(); /// ok
int32 ComputeDopplerEffectedFrequency(uint32 oldFreq, float position1, float position2,
float speedMultiplier); /// ok
int32 ComputePan(float, CVector *); // todo
uint32 ComputeVolume(int emittingVolume, float soundIntensity, float distance); /// ok
int32 CreateEntity(int32 type, CPhysical *entity); /// ok
uint32 ComputeVolume(int emittingVolume, float soundIntensity, float distance);
void DestroyAllGameCreatedEntities(); /// ok
void DestroyEntity(int32 id); /// ok
void DoPoliceRadioCrackle(); /// ok
void GenerateIntegerRandomNumberTable(); /// ok
float GetDistanceSquared(CVector *v); /// ok
void TranslateEntity(CVector *v1, CVector *v2); /// ok
// done
void Initialise();
void PostInitialiseGameSpecificSetup();
void InitialisePoliceRadioZones(); // @todo
void ResetAudioLogicTimers(int32 timer); // @todo
void InitialisePoliceRadioZones(); // todo
void ResetAudioLogicTimers(int32 timer); // todo
void Terminate();
@ -236,7 +273,6 @@ public:
bool GetMissionAudioLoadingStatus();
uint8 GetNum3DProvidersAvailable();
int8 AutoDetect3DProviders();
bool IsMP3RadioChannelAvailable();
uint8 GetCDAudioDriveLetter();
@ -247,24 +283,21 @@ public:
void SetSpeakerConfig(int32 conf);
void ProcessJumboFlying();
bool SetupJumboEngineSound(uint8, int32); // todo
void PreInitialiseGameSpecificSetup();
void SetMissionScriptPoliceAudio(int32 sfx);
void CalculateDistance(bool *ptr, float dist);
bool UsesSiren(int32 model);
bool UsesSirenSwitching(int32 model);
bool MissionScriptAudioUsesPoliceChannel(int32 soundMission);
uint8 Get3DProviderName(uint8 id);
char* Get3DProviderName(uint8 id);
void ProcessJumboTaxi();
bool SetupJumboFlySound(uint8); // todo
bool SetupJumboTaxiSound(uint8); // todo
bool SetupJumboWhineSound(uint8, int32); // todo
bool SetupJumboFlySound(uint8 emittingVol); /// ok
bool SetupJumboRumbleSound(uint8 emittingVol); /// ok
bool SetupJumboTaxiSound(uint8 vol); /// ok
bool SetupJumboWhineSound(uint8 emittingVol, int32 freq); /// ok
void PlayLoadedMissionAudio();
@ -274,27 +307,14 @@ public:
void InterrogateAudioEntities();
void ClearRequestedQueue();
// void AgeCrimes(); //todo
bool UsesReverseWarning(int32 model);
bool HasAirBrakes(int32 model);
int32 GetJumboTaxiFreq();
void ProcessPhysical(int32 id);
void ProcessVehicle(CPhysical *); // todo
void ProcessPed(CPhysical *); // todo
void ProcessPlane(void *); // todo
void ClearMissionAudio();
// void ProcessReverb(); // todo
bool IsMissionAudioSampleFinished();
void ProcessEntity(int32);
void InitialisePoliceRadio();
void InitialisePoliceRadio(); // todo
int32 RandomDisplacement(uint32 seed);
@ -304,21 +324,20 @@ public:
bool IsAudioInitialised() const;
int32 CreateEntity(int32 type, CPhysical *entity);
void DestroyEntity(int32 id);
void SetEntityStatus(int32 id, bool status);
void PreTerminateGameSpecificShutdown();
void PostTerminateGameSpecificShutdown();
void GenerateIntegerRandomNumberTable();
void PlayerJustGotInCar();
void PlayerJustLeftCar();
void Service();
void GetPhrase(uint32 *phrase, uint32 *prevPhrase, uint32 sample,
uint32 maxOffset);
void GetPhrase(uint32 *phrase, uint32 *prevPhrase, uint32 sample, uint32 maxOffset);
void DoJumboVolOffset();
int32 GetPedCommentSfx(CPed *ped, int32 sound);
uint32 GetPlayerTalkSfx(int16 sound);
uint32 GetCopTalkSfx(int16 sound);
@ -396,9 +415,74 @@ public:
uint32 GetGenericMaleTalkSfx(int16 sound);
uint32 GetGenericFemaleTalkSfx(int16 sound);
void ProcessActiveQueues(); // todo
bool ProcessAirBrakes(cVehicleParams *params); /// ok
void ProcessAirportScriptObject(uint8 sound); /// ok
bool ProcessBoatEngine(cVehicleParams *params); // todo requires CBoat
bool ProcessBoatMovingOverWater(cVehicleParams *params); // todo requires CBoat
void ProcessBridge(); // todo requires CBridge
void ProcessBridgeMotor(); /// ok
void ProcessBridgeOneShots(); // todo requires CBridge
void ProcessBridgeWarning(); /// ok
bool ProcessCarBombTick(void *); // todo requires CVehicle
void ProcessCesna(void *); // todo requires CPlane
void ProcessCinemaScriptObject(uint8 sound); /// ok
void ProcessCrane(); // todo requires CCrane
void ProcessDocksScriptObject(uint8 sound); /// ok
// bool ProcessEngineDamage(void *); //todo requires CVehicle
void ProcessEntity(int32 sound); /// ok
void ProcessExplosions(int32 explosion); // todo requires CExplosion
void ProcessFireHydrant(); /// ok
void ProcessFires(int32 entity); // todo requires gFireManager
void ProcessFrontEnd(); /// ok
void ProcessGarages(); // todo requires CGarages::aGarages
// bool ProcessHelicopter(void *); // todo requires CVehicle
void ProcessHomeScriptObject(uint8 sound); /// ok
void ProcessJumbo(cVehicleParams *); /// ok
void ProcessJumboAccel(CPlane *plane); /// ok
void ProcessJumboDecel(CPlane *plane); /// ok
void ProcessJumboFlying(); /// ok
void ProcessJumboLanding(CPlane *plane); /// ok
void ProcessJumboTakeOff(CPlane *plane); /// ok
void ProcessJumboTaxi(); /// ok
void ProcessLaunderetteScriptObject(uint8 sound); /// ok
void ProcessLoopingScriptObject(uint8 sound); /// ok
// void ProcessMissionAudio();
// void ProcessModelVehicle(void *);
// void ProcessOneShotScriptObject(uint8 sound);
void ProcessPed(CPhysical *p); // todo
// void ProcessPedHeadphones(void *);
// void ProcessPedOneShots(void *);
void ProcessPhysical(int32 id); /// ok
void ProcessPlane(void *); // todo
// void ProcessPlayersVehicleEngine(void *, void *);
void ProcessPoliceCellBeatingScriptObject(uint8 sound); // todo
void ProcessPornCinema(uint8 sound); /// ok
void ProcessProjectiles(); // todo
// void ProcessRainOnVehicle(void *);
// void ProcessReverb();
// bool ProcessReverseGear(void *);
void ProcessSawMillScriptObject(uint8 sound); /// ok
void ProcessScriptObject(int32 id); // todo
void ProcessShopScriptObject(uint8 sound); /// ok
void ProcessSpecial(); /// ok
// bool ProcessTrainNoise(void *);
void ProcessVehicle(CVehicle *); // todo
// bool ProcessVehicleDoors(void *);
// bool ProcessVehicleEngine(void *);
// void ProcessVehicleHorn(void *);
// void ProcessVehicleOneShots(void *);
// bool ProcessVehicleReverseWarning(void *);
// bool ProcessVehicleRoadNoise(void *);
// void ProcessVehicleSirenOrAlarm(void *);
// void ProcessVehicleSkidding(void *);
void ProcessWaterCannon(int32); // todo
void ProcessWeather(int32 id); // todo
// bool ProcessWetRoadNoise(void *);
void ProcessWorkShopScriptObject(uint8 sound); /// ok
};
static_assert(sizeof(cAudioManager) == 0x4B14, "cAudioManager: error");
extern cAudioManager &AudioManager;
extern cAudioManager &Players;

View File

@ -3038,3 +3038,131 @@ enum eAudioSamples : uint32 {
TOTAL_AUDIO_SAMPLES = 3032,
NO_SAMPLE = 3033,
};
enum eScriptSounds : int16
{
SCRIPT_SOUND_0 = 0,
SCRIPT_SOUND_1 = 1,
SCRIPT_SOUND_2 = 2,
SCRIPT_SOUND_3 = 3,
SCRIPT_SOUND_PARTY_1_LOOP_S = 4,
SCRIPT_SOUND_PARTY_1_LOOP_L = 5,
SCRIPT_SOUND_PARTY_2_LOOP_S = 6,
SCRIPT_SOUND_PARTY_2_LOOP_L = 7,
SCRIPT_SOUND_PARTY_3_LOOP_S = 8,
SCRIPT_SOUND_PARTY_3_LOOP_L = 9,
SCRIPT_SOUND_PARTY_4_LOOP_S = 10,
SCRIPT_SOUND_PARTY_4_LOOP_L = 11,
SCRIPT_SOUND_PARTY_5_LOOP_S = 12,
SCRIPT_SOUND_PARTY_5_LOOP_L = 13,
SCRIPT_SOUND_PARTY_6_LOOP_S = 14,
SCRIPT_SOUND_PARTY_6_LOOP_L = 15,
SCRIPT_SOUND_PARTY_7_LOOP_S = 16,
SCRIPT_SOUND_PARTY_7_LOOP_L = 17,
SCRIPT_SOUND_PARTY_8_LOOP_S = 18,
SCRIPT_SOUND_PARTY_8_LOOP_L = 19,
SCRIPT_SOUND_PARTY_9_LOOP_S = 20,
SCRIPT_SOUND_PARTY_9_LOOP_L = 21,
SCRIPT_SOUND_PARTY_10_LOOP_S = 22,
SCRIPT_SOUND_PARTY_10_LOOP_L = 23,
SCRIPT_SOUND_PARTY_11_LOOP_S = 24,
SCRIPT_SOUND_PARTY_11_LOOP_L = 25,
SCRIPT_SOUND_PARTY_12_LOOP_S = 26,
SCRIPT_SOUND_PARTY_12_LOOP_L = 27,
SCRIPT_SOUND_PARTY_13_LOOP_S = 28,
SCRIPT_SOUND_PARTY_13_LOOP_L = 29,
SCRIPT_SOUND_STRIP_CLUB_LOOP_1_S = 30,
SCRIPT_SOUND_STRIP_CLUB_LOOP_1_L = 31,
SCRIPT_SOUND_STRIP_CLUB_LOOP_2_S = 32,
SCRIPT_SOUND_STRIP_CLUB_LOOP_2_L = 33,
SCRIPT_SOUND_WORK_SHOP_LOOP_S = 34,
SCRIPT_SOUND_WORK_SHOP_LOOP_L = 35,
SCRIPT_SOUND_SAWMILL_LOOP_S = 36,
SCRIPT_SOUND_SAWMILL_LOOP_L = 37,
SCRIPT_SOUND_38 = 38,
SCRIPT_SOUND_39 = 39,
SCRIPT_SOUND_LAUNDERETTE_LOOP_S = 40,
SCRIPT_SOUND_LAUNDERETTE_LOOP_L = 41,
SCRIPT_SOUND_CHINATOWN_RESTAURANT_S = 42,
SCRIPT_SOUND_CHINATOWN_RESTAURANT_L = 43,
SCRIPT_SOUND_CIPRIANI_RESAURANT_S = 44,
SCRIPT_SOUND_CIPRIANI_RESAURANT_L = 45,
SCRIPT_SOUND_46 = 46,
SCRIPT_SOUND_47 = 47,
SCRIPT_SOUND_MARCO_BISTRO_S = 48,
SCRIPT_SOUND_MARCO_BISTRO_L = 49,
SCRIPT_SOUND_AIRPORT_LOOP_S = 50,
SCRIPT_SOUND_AIRPORT_LOOP_L = 51,
SCRIPT_SOUND_SHOP_LOOP_S = 52,
SCRIPT_SOUND_SHOP_LOOP_L = 53,
SCRIPT_SOUND_CINEMA_LOOP_S = 54,
SCRIPT_SOUND_CINEMA_LOOP_L = 55,
SCRIPT_SOUND_DOCKS_LOOP_S = 56,
SCRIPT_SOUND_DOCKS_LOOP_L = 57,
SCRIPT_SOUND_HOME_LOOP_S = 58,
SCRIPT_SOUND_HOME_LOOP_L = 59,
SCRIPT_SOUND_FRANKIE_PIANO = 60,
SCRIPT_SOUND_PARTY_1_LOOP = 61,
SCRIPT_SOUND_PORN_CINEMA_1_S = 62,
SCRIPT_SOUND_PORN_CINEMA_1_L = 63,
SCRIPT_SOUND_PORN_CINEMA_2_S = 64,
SCRIPT_SOUND_PORN_CINEMA_2_L = 65,
SCRIPT_SOUND_PORN_CINEMA_3_S = 66,
SCRIPT_SOUND_PORN_CINEMA_3_L = 67,
SCRIPT_SOUND_BANK_ALARM_LOOP_S = 68,
SCRIPT_SOUND_BANK_ALARM_LOOP_L = 69,
SCRIPT_SOUND_POLICE_BALL_LOOP_S = 70,
SCRIPT_SOUND_POLICE_BALL_LOOP_L = 71,
SCRIPT_SOUND_RAVE_LOOP_INDUSTRIAL_S = 72,
SCRIPT_SOUND_RAVE_LOOP_INDUSTRIAL_L = 73,
SCRIPT_SOUND_74 = 74,
SCRIPT_SOUND_75 = 75,
SCRIPT_SOUND_POLICE_CELL_BEATING_LOOP_S = 76,
SCRIPT_SOUND_POLICE_CELL_BEATING_LOOP_L = 77,
SCRIPT_SOUND_INJURED_PED_MALE_OUCH_S = 78,
SCRIPT_SOUND_INJURED_PED_MALE_OUCH_L = 79,
SCRIPT_SOUND_INJURED_PED_FEMALE_OUCH_S = 80,
SCRIPT_SOUND_INJURED_PED_FEMALE_OUCH_L = 81,
SCRIPT_SOUND_EVIDENCE_PICKUP = 82,
SCRIPT_SOUND_UNLOAD_GOLD = 83,
SCRIPT_SOUND_RAVE_1_LOOP_S = 84,
SCRIPT_SOUND_RAVE_1_LOOP_L = 85,
SCRIPT_SOUND_RAVE_2_LOOP_S = 86,
SCRIPT_SOUND_RAVE_2_LOOP_L = 87,
SCRIPT_SOUND_RAVE_3_LOOP_S = 88,
SCRIPT_SOUND_RAVE_3_LOOP_L = 89,
SCRIPT_SOUND_MISTY_SEX_S = 90,
SCRIPT_SOUND_MISTY_SEX_L = 91,
SCRIPT_SOUND_GATE_START_CLUNK = 92,
SCRIPT_SOUND_GATE_STOP_CLUNK = 93,
SCRIPT_SOUND_PART_MISSION_COMPLETE = 94,
SCRIPT_SOUND_CHUNKY_RUN_SHOUT = 95,
SCRIPT_SOUND_SECURITY_GUARD_AWAY_SHOUT = 96,
SCRIPT_SOUND_RACE_START_3 = 97,
SCRIPT_SOUND_RACE_START_2 = 98,
SCRIPT_SOUND_RACE_START_1 = 99,
SCRIPT_SOUND_RACE_START_GO = 100,
SCRIPT_SOUND_SWAT_PED_SHOUT = 101,
SCRIPT_SOUND_PRETEND_FIRE_LOOP = 102,
SCRIPT_SOUND_AMMUNATION_CHAT_1 = 103,
SCRIPT_SOUND_AMMUNATION_CHAT_2 = 104,
SCRIPT_SOUND_AMMUNATION_CHAT_3 = 105,
SCRIPT_SOUND_BULLET_HIT_GROUND_1 = 106,
SCRIPT_SOUND_BULLET_HIT_GROUND_2 = 107,
SCRIPT_SOUND_BULLET_HIT_GROUND_3 = 108,
SCRIPT_SOUND_109 = 109,
SCRIPT_SOUND_110 = 110,
SCRIPT_SOUND_111 = 111,
SCRIPT_SOUND_PAYPHONE_RINGING = 112,
SCRIPT_SOUND_113 = 113,
SCRIPT_SOUND_GLASS_BREAK_L = 114,
SCRIPT_SOUND_GLASS_BREAK_S = 115,
SCRIPT_SOUND_GLASS_CRACK = 116,
SCRIPT_SOUND_GLASS_LIGHT_BREAK = 117,
SCRIPT_SOUND_BOX_DESTROYED_1 = 118,
SCRIPT_SOUND_BOX_DESTROYED_2 = 119,
SCRIPT_SOUND_METAL_COLLISION = 120,
SCRIPT_SOUND_TIRE_COLLISION = 121,
SCRIPT_SOUND_GUNSHELL_DROP = 122,
SCRIPT_SOUND_GUNSHELL_DROP_SOFT = 123,
};

View File

@ -96,8 +96,8 @@ enum eSound : int16
SOUND_RAMPAGE_FAILED = 91,
SOUND_RAMPAGE_KILL = 92,
SOUND_RAMPAGE_CAR_BLOWN = 93,
_SOUND_EVIDENCE_PICKUP = 94,
_SOUND_UNLOAD_GOLD = 95,
SOUND_EVIDENCE_PICKUP = 94,
SOUND_UNLOAD_GOLD = 95,
SOUND_PAGER = 96,
SOUND_PED_DEATH = 97,
SOUND_PED_DAMAGE = 98,
@ -141,16 +141,16 @@ enum eSound : int16
SOUND_INJURED_PED_MALE_OUCH = 136,
SOUND_INJURED_PED_FEMALE = 137,
SOUND_8A = 138,
_SOUND_RACE_START_3 = 139,
_SOUND_RACE_START_2 = 140,
_SOUND_RACE_START_1 = 141,
_SOUND_RACE_START_GO = 142,
SOUND_RACE_START_3 = 139,
SOUND_RACE_START_2 = 140,
SOUND_RACE_START_1 = 141,
SOUND_RACE_START_GO = 142,
SOUND_SPLASH = 143,
SOUND_WATER_FALL = 144,
SOUND_SPLATTER = 145,
SOUND_CAR_PED_COLLISION = 146,
SOUND_CLOCK_TICK = 147,
_SOUND_PART_MISSION_COMPLETE = 148,
SOUND_PART_MISSION_COMPLETE = 148,
SOUND_FRONTEND_MENU_STARTING = 149,
SOUND_FRONTEND_MENU_COMPLETED = 150,
SOUND_FRONTEND_MENU_DENIED = 151,

View File

@ -188,3 +188,17 @@ cMusicManager::Terminate()
{
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 Terminate();
void ChangeMusicMode(int32 mode);
void StopFrontEndTrack();
char *Get3DProviderName(char);
bool PlayerInCar();
void DisplayRadioStationName();

View File

@ -1,17 +1,66 @@
#include "SampleManager.h"
#include "common.h"
#include "patcher.h"
#include "SampleManager.h"
CSampleManager &cSampleManager = *(CSampleManager *)0x7341E0;
uint32 &nNumOfMp3Files = *(uint32 *)0x95CC00;
uint8 &num3DProvidersAvailable = *(uint8 *)0x734237;
uint32 *asName3DProviders = (uint32 *)0x734238;
char **asName3DProviders = (char **)0x734238;
bool CSampleManager::IsMP3RadioChannelAvailable() {
bool
CSampleManager::IsMP3RadioChannelAvailable()
{
return nNumOfMp3Files != 0;
}
WRAPPER
void CSampleManager::SetChannelFrequency(int32, int32) { EAXJMP(0x5679D0); }
WRAPPER
void CSampleManager::SetChannelEmittingVolume(int32, uint32) { EAXJMP(0x567820); }
WRAPPER
void
CSampleManager::SetChannel3DPosition(int32, float, float, float)
{
EAXJMP(0x567890);
}
WRAPPER
void CSampleManager::SetChannelLoopCount(int32, int32) { EAXJMP(0x567AA0); }
WRAPPER
void CSampleManager::SetChannel3DDistances(int32, int32, int32) { EAXJMP(0x5678D0); }
WRAPPER
void CSampleManager::SetChannelReverbFlag(int32, uint8) { EAXJMP(0x567630); }
WRAPPER
int32 CSampleManager::GetSampleLength(int32) { EAXJMP(0x567300); }
WRAPPER
bool CSampleManager::InitialiseChannel(int32, int32, uint32, uint32) { EAXJMP(0x5676A0); }
WRAPPER
void CSampleManager::SetChannelLoopPoints(int32, int32, int32) { EAXJMP(0x567A30); }
WRAPPER
bool
CSampleManager::CheckForAnAudioFileOnCD()
{
EAXJMP(0x566EA0);
}
WRAPPER
int32 CSampleManager::GetSampleBaseFrequency(int32) { EAXJMP(0x5672A0); }
WRAPPER
int32 CSampleManager::GetSampleLoopStartOffset(int32) { EAXJMP(0x5672C0); }
WRAPPER
int32 CSampleManager::GetSampleLoopEndOffset(int32) { EAXJMP(0x5672E0); }
WRAPPER
bool CSampleManager::IsSampleBankLoaded(uint8) { EAXJMP(0x567130); }
@ -108,6 +157,13 @@ CSampleManager::GetChannelUsedFlag(int32 id)
EAXJMP(0x567B00);
}
WRAPPER
void
CSampleManager::StartChannel(int32 id)
{
EAXJMP(0x567B80);
}
WRAPPER
void
CSampleManager::StopChannel(int32 id)

View File

@ -1,5 +1,7 @@
#pragma once
#include "common.h"
struct tSample {
int m_nOffset;
unsigned int m_nSize;
@ -11,6 +13,26 @@ struct tSample {
class CSampleManager
{
public:
void SetChannelFrequency(int32, int32);
void SetChannelEmittingVolume(int32, uint32);
void SetChannel3DPosition(int32, float, float, float);
void SetChannelLoopCount(int32, int32);
void SetChannel3DDistances(int32, int32, int32);
void SetChannelReverbFlag(int32, uint8);
int32 GetSampleLength(int32);
bool InitialiseChannel(int32, int32, uint32, uint32 something = 0);
void SetChannelLoopPoints(int32, int32, int32);
bool CheckForAnAudioFileOnCD();
int32 GetSampleBaseFrequency(int32);
int32 GetSampleLoopStartOffset(int32);
int32 GetSampleLoopEndOffset(int32);
bool IsSampleBankLoaded(uint8);
void UnloadSampleBank(uint8);
void Terminate();
@ -32,6 +54,8 @@ public:
void SetSpeakerConfig(uint32 config);
bool GetChannelUsedFlag(int32 id);
void StartChannel(int32 id);
void StopChannel(int32 id);
static bool IsMP3RadioChannelAvailable();
@ -39,6 +63,6 @@ public:
extern uint32 &nNumOfMp3Files;
extern uint8 &num3DProvidersAvailable;
extern uint32* asName3DProviders;
extern char **asName3DProviders;
extern CSampleManager &cSampleManager;

View File

@ -11,7 +11,7 @@
#include "FileMgr.h"
#include "Heli.h"
#include "main.h"
#include "math/Matrix.h"
#include "Matrix.h"
#include "ModelIndices.h"
#include "ModelInfo.h"
#include "Object.h"
@ -25,7 +25,7 @@
#include "RpAnimBlend.h"
#include "RwHelper.h"
#include "CutsceneMgr.h"
#include "render/Skidmarks.h"
#include "Skidmarks.h"
#include "Streaming.h"
#include "Timer.h"
#include "Train.h"

View File

@ -441,6 +441,7 @@ int m_iModeObbeCamIsInForCar;
static bool &m_bUseMouse3rdPerson;
bool Get_Just_Switched_Status() { return m_bJust_Switched; }
CMatrix &GetCameraMatrix(void) { return m_cameraMatrix; }
CVector &GetGameCamPosition(void) { return m_vecGameCamPos; }
bool IsPointVisible(const CVector &center, const CMatrix *mat);

View File

@ -1,7 +1,7 @@
#include "common.h"
#include "main.h"
#include "patcher.h"
#include "math/Quaternion.h"
#include "Quaternion.h"
#include "ModelInfo.h"
#include "ModelIndices.h"
#include "TempColModels.h"

View File

@ -97,11 +97,11 @@ extern void **rwengine;
#define SCREEN_SCALE_AR(a) (a)
#endif
#include "math/maths.h"
#include "math/Vector.h"
#include "math/Vector2D.h"
#include "math/Matrix.h"
#include "math/Rect.h"
#include "maths.h"
#include "Vector.h"
#include "Vector2D.h"
#include "Matrix.h"
#include "Rect.h"
class CRGBA
{

View File

@ -13,11 +13,11 @@
#include "Glass.h"
#include "Clock.h"
#include "Weather.h"
#include "TimeCycle.h"
#include "Timecycle.h"
#include "Bridge.h"
#include "TrafficLights.h"
#include "Coronas.h"
#include "Pointlights.h"
#include "PointLights.h"
#include "Shadows.h"
#include "Pickups.h"
#include "SpecialFX.h"

View File

@ -115,7 +115,7 @@ CAutomobile::CAutomobile(int32 id, uint8 CreatedBy)
field_594 = 0;
bNotDamagedUpsideDown = false;
bMoreResistantToDamage = false;
field_514 = 0;
m_fVelocityChangeForAudio = 0.f;
field_4E2 = 0;
for(i = 0; i < 4; i++){

View File

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

View File

@ -7,7 +7,17 @@ class CPlane : public CVehicle
{
public:
// 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(void);

View File

@ -320,3 +320,19 @@ inline uint8 GetVehDoorFlag(int32 carnode) {
return 0;
}
}
class cTransmission;
class cVehicleParams
{
public:
char m_bDistanceCalculated;
char gap_1[3];
float m_fDistance;
CVehicle *m_pVehicle;
cTransmission *m_pTransmission;
int m_nIndex;
float m_fVelocityChange;
};
static_assert(sizeof(cVehicleParams) == 0x18, "CVehicle: error");