diff options
author | Nikolay Korolev <nickvnuk@gmail.com> | 2019-08-17 14:46:19 +0200 |
---|---|---|
committer | Nikolay Korolev <nickvnuk@gmail.com> | 2019-08-17 14:46:19 +0200 |
commit | 13233ccaed3fd7aad37c99326beee3ddfaf437f3 (patch) | |
tree | 82f5205ffe573d41060ec29646e821841f651837 /src/control | |
parent | more CCarCtrl (diff) | |
parent | Merge pull request #193 from erorcun/erorcun (diff) | |
download | re3-13233ccaed3fd7aad37c99326beee3ddfaf437f3.tar re3-13233ccaed3fd7aad37c99326beee3ddfaf437f3.tar.gz re3-13233ccaed3fd7aad37c99326beee3ddfaf437f3.tar.bz2 re3-13233ccaed3fd7aad37c99326beee3ddfaf437f3.tar.lz re3-13233ccaed3fd7aad37c99326beee3ddfaf437f3.tar.xz re3-13233ccaed3fd7aad37c99326beee3ddfaf437f3.tar.zst re3-13233ccaed3fd7aad37c99326beee3ddfaf437f3.zip |
Diffstat (limited to 'src/control')
-rw-r--r-- | src/control/CarCtrl.cpp | 1 | ||||
-rw-r--r-- | src/control/CarCtrl.h | 2 | ||||
-rw-r--r-- | src/control/Replay.cpp | 4 | ||||
-rw-r--r-- | src/control/Script.cpp | 14 |
4 files changed, 11 insertions, 10 deletions
diff --git a/src/control/CarCtrl.cpp b/src/control/CarCtrl.cpp index 064eab98..2609f8ca 100644 --- a/src/control/CarCtrl.cpp +++ b/src/control/CarCtrl.cpp @@ -63,6 +63,7 @@ WRAPPER void CCarCtrl::GenerateEmergencyServicesCar(void) { EAXJMP(0x41FC50); } WRAPPER void CCarCtrl::PickNextNodeAccordingStrategy(CVehicle*) { EAXJMP(0x41BA50); } WRAPPER void CCarCtrl::DragCarToPoint(CVehicle*, CVector*) { EAXJMP(0x41D450); } WRAPPER void CCarCtrl::SlowCarDownForCarsSectorList(CPtrList&, CVehicle*, float, float, float, float, float*, float) { EAXJMP(0x419B40); } +WRAPPER void CCarCtrl::Init(void) { EAXJMP(0x41D280); } void CCarCtrl::GenerateRandomCars() diff --git a/src/control/CarCtrl.h b/src/control/CarCtrl.h index 735dc89c..b28e6889 100644 --- a/src/control/CarCtrl.h +++ b/src/control/CarCtrl.h @@ -61,7 +61,7 @@ public: static float FindMaximumSpeedForThisCarInTraffic(CVehicle*); static void SlowCarDownForCarsSectorList(CPtrList&, CVehicle*, float, float, float, float, float*, float); static void SlowCarDownForPedsSectorList(CPtrList&, CVehicle*, float, float, float, float, float*, float); - + static void Init(void); static float GetOffsetOfLaneFromCenterOfRoad(int8 lane, CCarPathLink* pLink) { diff --git a/src/control/Replay.cpp b/src/control/Replay.cpp index 1e77da3a..12636d32 100644 --- a/src/control/Replay.cpp +++ b/src/control/Replay.cpp @@ -1166,7 +1166,7 @@ void CReplay::RestoreStuffFromMem(void) ped->m_modelIndex = -1; ped->SetModelIndex(mi); ped->m_pVehicleAnim = 0; - ped->m_audioEntityId = DMAudio.CreateEntity(0, ped); + ped->m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, ped); DMAudio.SetEntityStatus(ped->m_audioEntityId, true); CPopulation::UpdatePedCount(ped->m_nPedType, false); if (ped->m_wepModelID >= 0) @@ -1204,7 +1204,7 @@ void CReplay::RestoreStuffFromMem(void) car->SetDoorDamage(CAR_DOOR_LR, DOOR_REAR_LEFT, true); car->SetDoorDamage(CAR_DOOR_RR, DOOR_REAR_RIGHT, true); } - vehicle->m_audioEntityId = DMAudio.CreateEntity(0, vehicle); + vehicle->m_audioEntityId = DMAudio.CreateEntity(AUDIOTYPE_PHYSICAL, vehicle); DMAudio.SetEntityStatus(vehicle->m_audioEntityId, true); CCarCtrl::UpdateCarCount(vehicle, false); if ((mi == MI_AIRTRAIN || mi == MI_DEADDODO) && vehicle->m_rwObject){ diff --git a/src/control/Script.cpp b/src/control/Script.cpp index c3c3a154..c81cd050 100644 --- a/src/control/Script.cpp +++ b/src/control/Script.cpp @@ -3494,9 +3494,9 @@ int8 CRunningScript::ProcessCommandsFrom300To399(int32 command) break; } cAudioScriptObject* obj = new cAudioScriptObject(); - obj->m_vecPos = *(CVector*)&ScriptParams[0]; - obj->m_wSound = ScriptParams[3]; - obj->m_nAudioEntityId = -5; + obj->Posn = *(CVector*)&ScriptParams[0]; + obj->AudioId = ScriptParams[3]; + obj->AudioEntity = AEHANDLE_NONE; /* BUG: if audio is not initialized, this object will not be freed. */ /* Issue needs to be addressed in CreateOneShotScriptObject. */ DMAudio.CreateOneShotScriptObject(obj); @@ -3506,9 +3506,9 @@ int8 CRunningScript::ProcessCommandsFrom300To399(int32 command) { CollectParameters(&m_nIp, 4); cAudioScriptObject* obj = new cAudioScriptObject(); - obj->m_vecPos = *(CVector*)&ScriptParams[0]; - obj->m_wSound = ScriptParams[3]; - obj->m_nAudioEntityId = DMAudio.CreateLoopingScriptObject(obj); + obj->Posn = *(CVector*)&ScriptParams[0]; + obj->AudioId = ScriptParams[3]; + obj->AudioEntity = DMAudio.CreateLoopingScriptObject(obj); ScriptParams[0] = CPools::GetAudioScriptObjectPool()->GetIndex(obj); StoreParameters(&m_nIp, 1); return 0; @@ -3521,7 +3521,7 @@ int8 CRunningScript::ProcessCommandsFrom300To399(int32 command) debug("REMOVE_SOUND - Sound doesn't exist\n"); return 0; } - DMAudio.DestroyLoopingScriptObject(obj->m_nAudioEntityId); + DMAudio.DestroyLoopingScriptObject(obj->AudioEntity); delete obj; return 0; } |