mirror of
https://github.com/GTAmodding/re3.git
synced 2024-12-26 05:35:40 +00:00
replaced some ctors; made PreRender call game function
This commit is contained in:
parent
0b384356f9
commit
3b43c09578
5 changed files with 11 additions and 5 deletions
|
@ -501,7 +501,7 @@ CFileLoader::LoadObjectTypes(const char *filename)
|
||||||
CARS,
|
CARS,
|
||||||
PEDS,
|
PEDS,
|
||||||
PATH,
|
PATH,
|
||||||
TWO2FX
|
TWODFX
|
||||||
};
|
};
|
||||||
char *line;
|
char *line;
|
||||||
int fd;
|
int fd;
|
||||||
|
@ -528,7 +528,7 @@ CFileLoader::LoadObjectTypes(const char *filename)
|
||||||
else if(strncmp(line, "cars", 4) == 0) section = CARS;
|
else if(strncmp(line, "cars", 4) == 0) section = CARS;
|
||||||
else if(strncmp(line, "peds", 4) == 0) section = PEDS;
|
else if(strncmp(line, "peds", 4) == 0) section = PEDS;
|
||||||
else if(strncmp(line, "path", 4) == 0) section = PATH;
|
else if(strncmp(line, "path", 4) == 0) section = PATH;
|
||||||
else if(strncmp(line, "2dfx", 4) == 0) section = TWO2FX;
|
else if(strncmp(line, "2dfx", 4) == 0) section = TWODFX;
|
||||||
}else if(strncmp(line, "end", 3) == 0){
|
}else if(strncmp(line, "end", 3) == 0){
|
||||||
section = section == MLO ? OBJS : NONE;
|
section = section == MLO ? OBJS : NONE;
|
||||||
}else switch(section){
|
}else switch(section){
|
||||||
|
@ -571,7 +571,7 @@ CFileLoader::LoadObjectTypes(const char *filename)
|
||||||
pathIndex = -1;
|
pathIndex = -1;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TWO2FX:
|
case TWODFX:
|
||||||
Load2dEffect(line);
|
Load2dEffect(line);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -848,6 +848,7 @@ CFileLoader::LoadCarPathNode(const char *line, int id, int node)
|
||||||
ThePaths.StoreNodeInfoCar(id, node, type, next, x, y, z, 0, numLeft, numRight);
|
ThePaths.StoreNodeInfoCar(id, node, type, next, x, y, z, 0, numLeft, numRight);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
CFileLoader::Load2dEffect(const char *line)
|
CFileLoader::Load2dEffect(const char *line)
|
||||||
{
|
{
|
||||||
|
|
|
@ -22,5 +22,6 @@ CBuilding::ReplaceWithNewModel(int32 id)
|
||||||
}
|
}
|
||||||
|
|
||||||
STARTPATCHES
|
STARTPATCHES
|
||||||
|
InjectHook(0x4057D0, &CBuilding::ctor, PATCH_JUMP);
|
||||||
InjectHook(0x405850, &CBuilding::ReplaceWithNewModel, PATCH_JUMP);
|
InjectHook(0x405850, &CBuilding::ReplaceWithNewModel, PATCH_JUMP);
|
||||||
ENDPATCHES
|
ENDPATCHES
|
||||||
|
|
|
@ -15,5 +15,7 @@ public:
|
||||||
void ReplaceWithNewModel(int32 id);
|
void ReplaceWithNewModel(int32 id);
|
||||||
|
|
||||||
virtual bool GetIsATreadable(void) { return false; }
|
virtual bool GetIsATreadable(void) { return false; }
|
||||||
|
|
||||||
|
CBuilding *ctor(void) { return ::new (this) CBuilding(); }
|
||||||
};
|
};
|
||||||
static_assert(sizeof(CBuilding) == 0x64, "CBuilding: error");
|
static_assert(sizeof(CBuilding) == 0x64, "CBuilding: error");
|
||||||
|
|
|
@ -339,9 +339,9 @@ CEntity::GetBoundRect(void)
|
||||||
return rect;
|
return rect;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
WRAPPER void
|
||||||
CEntity::PreRender(void)
|
CEntity::PreRender(void)
|
||||||
{
|
{ EAXJMP(0x474350);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -448,6 +448,7 @@ CEntity::PruneReferences(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
STARTPATCHES
|
STARTPATCHES
|
||||||
|
InjectHook(0x473C30, &CEntity::ctor, PATCH_JUMP);
|
||||||
InjectHook(0x4742C0, (void (CEntity::*)(CVector&))&CEntity::GetBoundCentre, PATCH_JUMP);
|
InjectHook(0x4742C0, (void (CEntity::*)(CVector&))&CEntity::GetBoundCentre, PATCH_JUMP);
|
||||||
InjectHook(0x474310, &CEntity::GetBoundRadius, PATCH_JUMP);
|
InjectHook(0x474310, &CEntity::GetBoundRadius, PATCH_JUMP);
|
||||||
InjectHook(0x474C10, &CEntity::GetIsTouching, PATCH_JUMP);
|
InjectHook(0x474C10, &CEntity::GetIsTouching, PATCH_JUMP);
|
||||||
|
|
|
@ -155,6 +155,7 @@ public:
|
||||||
|
|
||||||
|
|
||||||
// to make patching virtual functions possible
|
// to make patching virtual functions possible
|
||||||
|
CEntity *ctor(void) { return ::new (this) CEntity(); }
|
||||||
void Add_(void) { CEntity::Add(); }
|
void Add_(void) { CEntity::Add(); }
|
||||||
void Remove_(void) { CEntity::Remove(); }
|
void Remove_(void) { CEntity::Remove(); }
|
||||||
void CreateRwObject_(void) { CEntity::CreateRwObject(); }
|
void CreateRwObject_(void) { CEntity::CreateRwObject(); }
|
||||||
|
|
Loading…
Reference in a new issue