summaryrefslogtreecommitdiffstats
path: root/src/vehicles/HandlingMgr.cpp
diff options
context:
space:
mode:
authoreray orçunus <erayorcunus@gmail.com>2019-07-17 15:13:00 +0200
committereray orçunus <erayorcunus@gmail.com>2019-07-17 15:13:00 +0200
commit06ed308bb1a2383125cf04fd712b1753c4ba1d55 (patch)
tree713a8e10b3657d4c3a0d9c20c3704e0da8f9357e /src/vehicles/HandlingMgr.cpp
parentMerge branch 'master' of git://github.com/GTAmodding/re3 into erorcun (diff)
parentrenamed some variables and added files; more CAutomobile::ProcessControl (diff)
downloadre3-06ed308bb1a2383125cf04fd712b1753c4ba1d55.tar
re3-06ed308bb1a2383125cf04fd712b1753c4ba1d55.tar.gz
re3-06ed308bb1a2383125cf04fd712b1753c4ba1d55.tar.bz2
re3-06ed308bb1a2383125cf04fd712b1753c4ba1d55.tar.lz
re3-06ed308bb1a2383125cf04fd712b1753c4ba1d55.tar.xz
re3-06ed308bb1a2383125cf04fd712b1753c4ba1d55.tar.zst
re3-06ed308bb1a2383125cf04fd712b1753c4ba1d55.zip
Diffstat (limited to 'src/vehicles/HandlingMgr.cpp')
-rw-r--r--src/vehicles/HandlingMgr.cpp36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/vehicles/HandlingMgr.cpp b/src/vehicles/HandlingMgr.cpp
index 47d0564c..9bcaaf81 100644
--- a/src/vehicles/HandlingMgr.cpp
+++ b/src/vehicles/HandlingMgr.cpp
@@ -140,11 +140,11 @@ cHandlingDataMgr::LoadHandlingData(void)
case 9: handling->fTractionMultiplier = strtod(word, nil); break;
case 10: handling->fTractionLoss = strtod(word, nil); break;
case 11: handling->fTractionBias = strtod(word, nil); break;
- case 12: handling->TransmissionData.nNumberOfGears = atoi(word); break;
- case 13: handling->TransmissionData.fMaxVelocity = strtod(word, nil); break;
- case 14: handling->TransmissionData.fEngineAcceleration = strtod(word, nil) * 0.4f; break;
- case 15: handling->TransmissionData.nDriveType = word[0]; break;
- case 16: handling->TransmissionData.nEngineType = word[0]; break;
+ case 12: handling->Transmission.nNumberOfGears = atoi(word); break;
+ case 13: handling->Transmission.fMaxVelocity = strtod(word, nil); break;
+ case 14: handling->Transmission.fEngineAcceleration = strtod(word, nil) * 0.4f; break;
+ case 15: handling->Transmission.nDriveType = word[0]; break;
+ case 16: handling->Transmission.nEngineType = word[0]; break;
case 17: handling->fBrakeDeceleration = strtod(word, nil); break;
case 18: handling->fBrakeBias = strtod(word, nil); break;
case 19: handling->bABS = !!atoi(word); break;
@@ -159,7 +159,7 @@ cHandlingDataMgr::LoadHandlingData(void)
case 28: handling->fSuspensionBias = strtod(word, nil); break;
case 29:
sscanf(word, "%x", &handling->Flags);
- handling->TransmissionData.Flags = handling->Flags;
+ handling->Transmission.Flags = handling->Flags;
break;
case 30: handling->FrontLights = atoi(word); break;
case 31: handling->RearLights = atoi(word); break;
@@ -192,8 +192,8 @@ cHandlingDataMgr::ConvertDataToGameUnits(tHandlingData *handling)
// TODO: figure out what exactly is being converted here
float velocity, a, b, specificVolume;
- handling->TransmissionData.fEngineAcceleration /= 2500.0f;
- handling->TransmissionData.fMaxVelocity /= 180.0f;
+ handling->Transmission.fEngineAcceleration /= 2500.0f;
+ handling->Transmission.fMaxVelocity /= 180.0f;
handling->fBrakeDeceleration /= 2500.0f;
handling->fTurnMass = (sq(handling->Dimension.x) + sq(handling->Dimension.y)) * handling->fMass / 12.0f;
if(handling->fTurnMass < 10.0f)
@@ -205,27 +205,27 @@ cHandlingDataMgr::ConvertDataToGameUnits(tHandlingData *handling)
specificVolume = handling->Dimension.x*handling->Dimension.z*0.5f / handling->fMass; // ?
a = 0.0f;
b = 100.0f;
- velocity = handling->TransmissionData.fMaxVelocity;
+ velocity = handling->Transmission.fMaxVelocity;
while(a < b && velocity > 0.0f){
velocity -= 0.01;
- a = handling->TransmissionData.fEngineAcceleration/6.0f;
+ a = handling->Transmission.fEngineAcceleration/6.0f;
b = -velocity * (1.0f/(specificVolume * sq(velocity) + 1.0f) - 1.0f);
}
if(handling->nIdentifier == HANDLING_RCBANDIT){
- handling->TransmissionData.fUnkMaxVelocity = handling->TransmissionData.fMaxVelocity;
+ handling->Transmission.fUnkMaxVelocity = handling->Transmission.fMaxVelocity;
}else{
- handling->TransmissionData.fUnkMaxVelocity = velocity;
- handling->TransmissionData.fMaxVelocity = velocity * 1.2f;
+ handling->Transmission.fUnkMaxVelocity = velocity;
+ handling->Transmission.fMaxVelocity = velocity * 1.2f;
}
- handling->TransmissionData.fMaxReverseVelocity = -0.2f;
+ handling->Transmission.fMaxReverseVelocity = -0.2f;
- if(handling->TransmissionData.nDriveType == '4')
- handling->TransmissionData.fEngineAcceleration /= 4.0f;
+ if(handling->Transmission.nDriveType == '4')
+ handling->Transmission.fEngineAcceleration /= 4.0f;
else
- handling->TransmissionData.fEngineAcceleration /= 2.0f;
+ handling->Transmission.fEngineAcceleration /= 2.0f;
- handling->TransmissionData.InitGearRatios();
+ handling->Transmission.InitGearRatios();
}
int32