summaryrefslogtreecommitdiffstats
path: root/src/vehicles/Train.cpp
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2020-04-26 21:03:15 +0200
committerSergeanur <s.anureev@yandex.ua>2020-04-26 21:03:15 +0200
commitf0890b11122291a22d6a65f349281cf1aed49bd0 (patch)
tree3b418b522c5fd097abac916693e59808ea4f5b4f /src/vehicles/Train.cpp
parentMore japanese (diff)
parentRemove little hack (diff)
downloadre3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.gz
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.bz2
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.lz
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.xz
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.tar.zst
re3-f0890b11122291a22d6a65f349281cf1aed49bd0.zip
Diffstat (limited to '')
-rw-r--r--src/vehicles/Train.cpp61
1 files changed, 16 insertions, 45 deletions
diff --git a/src/vehicles/Train.cpp b/src/vehicles/Train.cpp
index 7d81fd57..0d1ff9b0 100644
--- a/src/vehicles/Train.cpp
+++ b/src/vehicles/Train.cpp
@@ -1,6 +1,6 @@
#include "common.h"
#include "main.h"
-#include "patcher.h"
+
#include "Timer.h"
#include "ModelIndices.h"
#include "FileMgr.h"
@@ -14,23 +14,23 @@
#include "HandlingMgr.h"
#include "Train.h"
-static CTrainNode *&pTrackNodes = *(CTrainNode**)0x8F4338;
-static int16 &NumTrackNodes = *(int16*)0x95CC5C;
+static CTrainNode* pTrackNodes;
+static int16 NumTrackNodes;
static float StationDist[3] = { 873.0f, 1522.0f, 2481.0f };
-static float &TotalLengthOfTrack = *(float*)0x64D000;
-static float &TotalDurationOfTrack = *(float*)0x64D004;
-static CTrainInterpolationLine *aLineBits = (CTrainInterpolationLine*)0x70D838; // [17]
-static float *EngineTrackPosition = (float*)0x64D008; //[2]
-static float *EngineTrackSpeed = (float*)0x880848; //[2]
-
-static CTrainNode *&pTrackNodes_S = *(CTrainNode**)0x8F2560;
-static int16 &NumTrackNodes_S = *(int16*)0x95CC6A;
+static float TotalLengthOfTrack;
+static float TotalDurationOfTrack;
+static CTrainInterpolationLine aLineBits[17];
+static float EngineTrackPosition[2];
+static float EngineTrackSpeed[2];
+
+static CTrainNode* pTrackNodes_S;
+static int16 NumTrackNodes_S;
static float StationDist_S[4] = { 55.0f, 1388.0f, 2337.0f, 3989.0f };
-static float &TotalLengthOfTrack_S = *(float*)0x64D010;
-static float &TotalDurationOfTrack_S = *(float*)0x64D014;
-static CTrainInterpolationLine *aLineBits_S = (CTrainInterpolationLine*)0x726600; // [18]
-static float *EngineTrackPosition_S = (float*)0x64D018; //[4]
-static float *EngineTrackSpeed_S = (float*)0x87C7C8; //[4]
+static float TotalLengthOfTrack_S;
+static float TotalDurationOfTrack_S;
+static CTrainInterpolationLine aLineBits_S[18];
+static float EngineTrackPosition_S[4];
+static float EngineTrackSpeed_S[4];
CVector CTrain::aStationCoors[3];
CVector CTrain::aStationCoors_S[4];
@@ -691,32 +691,3 @@ CTrain::UpdateTrains(void)
time += 0x40000/4;
}
}
-
-#include <new>
-
-class CTrain_ : public CTrain
-{
-public:
- void ctor(int32 id, uint8 CreatedBy) { ::new (this) CTrain(id, CreatedBy); }
- void SetModelIndex_(uint32 id) { CTrain::SetModelIndex(id); }
- void ProcessControl_(void) { CTrain::ProcessControl(); }
- void PreRender_(void) { CTrain::PreRender(); }
- void Render_(void) { CTrain::Render(); }
- void dtor(void) { CTrain::~CTrain(); }
-};
-
-STARTPATCHES
- InjectHook(0x54E470, &CTrain_::SetModelIndex_, PATCH_JUMP);
- InjectHook(0x54E4C0, &CTrain_::PreRender_, PATCH_JUMP);
- InjectHook(0x54EAA0, &CTrain_::Render_, PATCH_JUMP);
- InjectHook(0x54E450, &CTrain_::dtor, PATCH_JUMP);
- InjectHook(0x54E2A0, &CTrain_::ctor, PATCH_JUMP);
- InjectHook(0x550300, &CTrain::TrainHitStuff, PATCH_JUMP);
- InjectHook(0x5504A0, &CTrain::AddPassenger, PATCH_JUMP);
- InjectHook(0x550360, &CTrain::OpenTrainDoor, PATCH_JUMP);
-
- InjectHook(0x54F000, CTrain::InitTrains, PATCH_JUMP);
- InjectHook(0x54F360, CTrain::Shutdown, PATCH_JUMP);
- InjectHook(0x54EAB0, CTrain::ReadAndInterpretTrackFile, PATCH_JUMP);
- InjectHook(0x54F3A0, CTrain::UpdateTrains, PATCH_JUMP);
-ENDPATCHES