summaryrefslogtreecommitdiffstats
path: root/src/vehicles
diff options
context:
space:
mode:
Diffstat (limited to 'src/vehicles')
-rw-r--r--src/vehicles/Bike.h30
-rw-r--r--src/vehicles/Cranes.cpp4
-rw-r--r--src/vehicles/HandlingMgr.cpp13
-rw-r--r--src/vehicles/HandlingMgr.h2
-rw-r--r--src/vehicles/Vehicle.cpp5
5 files changed, 44 insertions, 10 deletions
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
diff --git a/src/vehicles/Cranes.cpp b/src/vehicles/Cranes.cpp
index 564f493d..1191465a 100644
--- a/src/vehicles/Cranes.cpp
+++ b/src/vehicles/Cranes.cpp
@@ -85,7 +85,7 @@ void CCranes::AddThisOneCrane(CEntity* pEntity)
pCrane->m_bWasMilitaryCrane = false;
pCrane->m_nAudioEntity = DMAudio.CreateEntity(AUDIOTYPE_CRANE, &aCranes[NumCranes]);
if (pCrane->m_nAudioEntity >= 0)
- DMAudio.SetEntityStatus(pCrane->m_nAudioEntity, 1);
+ DMAudio.SetEntityStatus(pCrane->m_nAudioEntity, true);
pCrane->m_bIsTop = (MODELID_CRANE_1 != pEntity->GetModelIndex());
// Is this used to avoid military crane?
if (pCrane->m_bIsTop || pEntity->GetPosition().y > 0.0f) {
@@ -669,7 +669,7 @@ void CCranes::Load(uint8* buf, uint32 size)
for (int i = 0; i < NUM_CRANES; i++) {
aCranes[i].m_nAudioEntity = DMAudio.CreateEntity(AUDIOTYPE_CRANE, &aCranes[i]);
if (aCranes[i].m_nAudioEntity != 0)
- DMAudio.SetEntityStatus(aCranes[i].m_nAudioEntity, 1);
+ DMAudio.SetEntityStatus(aCranes[i].m_nAudioEntity, true);
}
VALIDATESAVEBUF(size);
diff --git a/src/vehicles/HandlingMgr.cpp b/src/vehicles/HandlingMgr.cpp
index 18a2481e..3ac6f057 100644
--- a/src/vehicles/HandlingMgr.cpp
+++ b/src/vehicles/HandlingMgr.cpp
@@ -2,6 +2,7 @@
#include "main.h"
#include "FileMgr.h"
+#include "Physical.h"
#include "HandlingMgr.h"
cHandlingDataMgr mod_HandlingManager;
@@ -115,7 +116,7 @@ cHandlingDataMgr::LoadHandlingData(void)
end = start+1;
// yeah, this is kinda crappy
- if(strncmp(line, ";the end", 9) == 0)
+ if(strcmp(line, ";the end") == 0)
keepGoing = 0;
else if(line[0] != ';'){
field = 0;
@@ -189,17 +190,17 @@ cHandlingDataMgr::FindExactWord(const char *word, const char *words, int wordLen
void
cHandlingDataMgr::ConvertDataToGameUnits(tHandlingData *handling)
{
- // TODO: figure out what exactly is being converted here
+ // acceleration is in ms^-2, but we need mf^-2 where f is one frame time (50fps)
float velocity, a, b, specificVolume;
- handling->Transmission.fEngineAcceleration /= 2500.0f;
- handling->Transmission.fMaxVelocity /= 180.0f;
- handling->fBrakeDeceleration /= 2500.0f;
+ handling->Transmission.fEngineAcceleration *= 1.0f/(50.0f*50.0f);
+ handling->Transmission.fMaxVelocity *= 1000.0f/(60.0f*60.0f * 50.0f);
+ handling->fBrakeDeceleration *= 1.0f/(50.0f*50.0f);
handling->fTurnMass = (sq(handling->Dimension.x) + sq(handling->Dimension.y)) * handling->fMass / 12.0f;
if(handling->fTurnMass < 10.0f)
handling->fTurnMass *= 5.0f;
handling->fInvMass = 1.0f/handling->fMass;
- handling->fBuoyancy = 100.0f/handling->nPercentSubmerged * 0.008f*handling->fMass;
+ handling->fBuoyancy = 100.0f/handling->nPercentSubmerged * GRAVITY*handling->fMass;
// What the hell is going on here?
specificVolume = handling->Dimension.x*handling->Dimension.z*0.5f / handling->fMass; // ?
diff --git a/src/vehicles/HandlingMgr.h b/src/vehicles/HandlingMgr.h
index 23bd9681..05876201 100644
--- a/src/vehicles/HandlingMgr.h
+++ b/src/vehicles/HandlingMgr.h
@@ -108,7 +108,7 @@ struct tHandlingData
float fSteeringLock;
float fTractionLoss;
float fTractionBias;
- float fABS; // should be VC leftover
+ float fUnused;
float fSuspensionForceLevel;
float fSuspensionDampingLevel;
float fSuspensionUpperLimit;
diff --git a/src/vehicles/Vehicle.cpp b/src/vehicles/Vehicle.cpp
index 9adcf148..ba9348f0 100644
--- a/src/vehicles/Vehicle.cpp
+++ b/src/vehicles/Vehicle.cpp
@@ -1171,7 +1171,10 @@ CVehicle::AddPassenger(CPed *passenger, uint8 n)
void
CVehicle::RemoveDriver(void)
{
- SetStatus(STATUS_ABANDONED);
+#ifdef FIX_BUGS
+ if (GetStatus() != STATUS_WRECKED)
+#endif
+ SetStatus(STATUS_ABANDONED);
pDriver = nil;
}