finished CFileLoader, except a crash!

This commit is contained in:
aap
2019-06-18 09:50:26 +02:00
parent ad12240586
commit 3b64bd1b4a
17 changed files with 345 additions and 13 deletions

View File

@ -0,0 +1,5 @@
#include "common.h"
#include "patcher.h"
#include "ObjectData.h"
WRAPPER void CObjectData::Initialise(const char *filename) { EAXJMP(0x4BC0E0); }

7
src/control/ObjectData.h Normal file
View File

@ -0,0 +1,7 @@
#pragma once
class CObjectData
{
public:
static void Initialise(const char *filename);
};

View File

@ -76,6 +76,12 @@ CPathFind::StoreNodeInfoCar(int16 id, int16 node, int8 type, int8 next, int16 x,
InfoForTileCars[i].numRightLanes = numRight;
}
void
CPathFind::RegisterMapObject(CTreadable *mapObject)
{
m_mapObjects[m_numMapObjects++] = mapObject;
}
void
CPathFind::PreparePathData(void)
{

View File

@ -67,6 +67,8 @@ struct CPathInfoForObject
int8 numRightLanes;
uint8 crossing : 1;
};
extern CPathInfoForObject *&InfoForTileCars;
extern CPathInfoForObject *&InfoForTilePeds;
struct CTempNode
{
@ -125,6 +127,9 @@ public:
void CalcNodeCoors(int16 x, int16 y, int16 z, int32 id, CVector *out);
void StoreNodeInfoPed(int16 id, int16 node, int8 type, int8 next, int16 x, int16 y, int16 z, int16 width, bool crossing);
void StoreNodeInfoCar(int16 id, int16 node, int8 type, int8 next, int16 x, int16 y, int16 z, int16 width, int8 numLeft, int8 numRight);
void RegisterMapObject(CTreadable *mapObject);
bool IsPathObject(int id) { return id < PATHNODESIZE && (InfoForTileCars[id*12].type != 0 || InfoForTilePeds[id*12].type != 0); }
};
static_assert(sizeof(CPathFind) == 0x4c8f4, "CPathFind: error");