diff options
-rw-r--r-- | src/control/Script6.cpp | 4 | ||||
-rw-r--r-- | src/core/CdStream.cpp | 4 | ||||
-rw-r--r-- | src/entities/Physical.cpp | 7 | ||||
-rw-r--r-- | src/extras/screendroplets.cpp | 4 | ||||
-rw-r--r-- | src/peds/Population.cpp | 7 | ||||
-rw-r--r-- | src/vehicles/Bike.h | 30 |
6 files changed, 49 insertions, 7 deletions
diff --git a/src/control/Script6.cpp b/src/control/Script6.cpp index c2937e1d..77dae53a 100644 --- a/src/control/Script6.cpp +++ b/src/control/Script6.cpp @@ -3,6 +3,7 @@ #include "Script.h" #include "ScriptCommands.h" +#include "Bike.h" #include "CarCtrl.h" #include "Cranes.h" #include "Credits.h" @@ -415,8 +416,7 @@ int8 CRunningScript::ProcessCommands1000To1099(int32 command) ((CAutomobile*)pVehicle)->m_fTraction = fTraction; else // this is certainly not a boat, trane, heli or plane field - //((CBike*)pVehicle)->m_fTraction = fTraction; - *(float*)(((char*)pVehicle) + 1088) = fTraction; + ((CBike*)pVehicle)->m_fTraction = fTraction; return 0; } case COMMAND_ARE_MEASUREMENTS_IN_METRES: diff --git a/src/core/CdStream.cpp b/src/core/CdStream.cpp index f987dea5..4bb31ea4 100644 --- a/src/core/CdStream.cpp +++ b/src/core/CdStream.cpp @@ -73,7 +73,11 @@ CdStreamInitThread(void) gChannelRequestQ.size = gNumChannels + 1; ASSERT(gChannelRequestQ.items != nil ); +#ifdef FIX_BUGS + gCdStreamSema = CreateSemaphore(nil, 0, 5, nil); +#else gCdStreamSema = CreateSemaphore(nil, 0, 5, "CdStream"); +#endif if ( gCdStreamSema == nil ) { diff --git a/src/entities/Physical.cpp b/src/entities/Physical.cpp index 04cec96b..4fc53039 100644 --- a/src/entities/Physical.cpp +++ b/src/entities/Physical.cpp @@ -16,6 +16,7 @@ #include "DMAudio.h" #include "Automobile.h" #include "Physical.h" +#include "Bike.h" CPhysical::CPhysical(void) { @@ -1917,7 +1918,11 @@ CPhysical::ProcessCollision(void) car->m_aSuspensionSpringRatio[2] = 1.0f; car->m_aSuspensionSpringRatio[3] = 1.0f; }else if(veh->m_vehType == VEHICLE_TYPE_BIKE){ - assert(0 && "TODO - but unused"); + CBike* bike = (CBike*)this; + bike->m_aSuspensionSpringRatio[0] = 1.0f; + bike->m_aSuspensionSpringRatio[1] = 1.0f; + bike->m_aSuspensionSpringRatio[2] = 1.0f; + bike->m_aSuspensionSpringRatio[3] = 1.0f; } } } diff --git a/src/extras/screendroplets.cpp b/src/extras/screendroplets.cpp index 9ac60d4f..6ea72f09 100644 --- a/src/extras/screendroplets.cpp +++ b/src/extras/screendroplets.cpp @@ -12,6 +12,7 @@ #include "RwHelper.h" #include "Timer.h" #include "Camera.h" +#include "World.h" #include "ZoneCull.h" #include "Weather.h" #include "ParticleObject.h" @@ -416,7 +417,8 @@ ScreenDroplets::ProcessCameraMovement(void) uint16 mode = TheCamera.Cams[TheCamera.ActiveCam].Mode; bool isTopDown = mode == CCam::MODE_TOPDOWN || mode == CCam::MODE_GTACLASSIC || mode == CCam::MODE_TOP_DOWN_PED; - bool isLookingInDirection = CPad::GetPad(0)->GetLookBehindForCar() || CPad::GetPad(0)->GetLookLeft() || CPad::GetPad(0)->GetLookRight(); + bool isLookingInDirection = FindPlayerVehicle() && mode == CCam::MODE_1STPERSON && + (CPad::GetPad(0)->GetLookBehindForCar() || CPad::GetPad(0)->GetLookLeft() || CPad::GetPad(0)->GetLookRight()); ms_enabled = !isTopDown && !isLookingInDirection; ms_movingEnabled = !isTopDown && !isLookingInDirection; diff --git a/src/peds/Population.cpp b/src/peds/Population.cpp index 5dbde649..35443cb8 100644 --- a/src/peds/Population.cpp +++ b/src/peds/Population.cpp @@ -22,6 +22,7 @@ #include "DummyObject.h" #include "Script.h" #include "Shadows.h" +#include "Bike.h" #define MIN_CREATION_DIST 40.0f // not for start of the game (look at the GeneratePedsAtStartOfGame) #define CREATION_RANGE 10.0f // added over the MIN_CREATION_DIST. @@ -833,11 +834,11 @@ CPopulation::AddPedInCar(CVehicle* car) newPed->SetCurrentWeapon(WEAPONTYPE_COLT45); newPed->RemoveWeaponModel(CWeaponInfo::GetWeaponInfo(newPed->GetWeapon()->m_eWeaponType)->m_nModelId); } - /* + // Miami leftover if (car->m_vehType == VEHICLE_TYPE_BIKE) { - newPed->m_pVehicleAnim = CAnimManager::BlendAnimation(newPed->GetClump(), ASSOCGRP_STD, *((CBike*)car + 308h), 100.0f); - } else */ + newPed->m_pVehicleAnim = CAnimManager::BlendAnimation(newPed->GetClump(), ASSOCGRP_STD, ((CBike*)car)->m_bikeSitAnimation, 100.0f); + } else // FIX: Make peds comfortable while driving car/boat #ifdef FIX_BUGS diff --git a/src/vehicles/Bike.h b/src/vehicles/Bike.h index 4e7e5a0e..85ff211b 100644 --- a/src/vehicles/Bike.h +++ b/src/vehicles/Bike.h @@ -1,5 +1,7 @@ #pragma once +#include "Vehicle.h" + // some miami bike leftovers enum eBikeNodes { @@ -12,4 +14,32 @@ enum eBikeNodes { BIKE_MUDGUARD, BIKE_HANDLEBARS, BIKE_NUM_NODES +}; + +class CBike : public CVehicle +{ +public: + RwFrame *m_aBikeNodes[BIKE_NUM_NODES]; // assuming + uint8 unk1[96]; + AnimationId m_bikeSitAnimation; + uint8 unk2[180]; + float m_aSuspensionSpringRatio[4]; + + /* copied from VC, one of the floats here is gone, assuming m_bike_unused1 */ + float m_aSuspensionSpringRatioPrev[4]; + float m_aWheelTimer[4]; + //float m_bike_unused1; + int m_aWheelSkidmarkType[2]; + bool m_aWheelSkidmarkBloody[2]; + bool m_aWheelSkidmarkUnk[2]; + float m_aWheelRotation[2]; + float m_aWheelSpeed[2]; + float m_aWheelPosition[2]; + float m_aWheelBasePosition[2]; + float m_aSuspensionSpringLength[4]; + float m_aSuspensionLineLength[4]; + float m_fHeightAboveRoad; + /**/ + + float m_fTraction; };
\ No newline at end of file |