remove include <new> from common.h

This commit is contained in:
aap 2020-03-28 09:37:04 +01:00
parent 6a14457614
commit 739e80614d
23 changed files with 70 additions and 22 deletions

View File

@ -203,6 +203,15 @@ CAnimBlendAssociation::UpdateBlend(float timeDelta)
return true; return true;
} }
#include <new>
class CAnimBlendAssociation_ : public CAnimBlendAssociation
{
public:
CAnimBlendAssociation *ctor1(void) { return ::new (this) CAnimBlendAssociation(); }
CAnimBlendAssociation *ctor2(CAnimBlendAssociation &other) { return ::new (this) CAnimBlendAssociation(other); }
void dtor(void) { this->CAnimBlendAssociation::~CAnimBlendAssociation(); }
};
STARTPATCHES STARTPATCHES
InjectHook(0x4016A0, &CAnimBlendAssociation::AllocateAnimBlendNodeArray, PATCH_JUMP); InjectHook(0x4016A0, &CAnimBlendAssociation::AllocateAnimBlendNodeArray, PATCH_JUMP);
@ -219,7 +228,7 @@ STARTPATCHES
InjectHook(0x4031F0, &CAnimBlendAssociation::UpdateTime, PATCH_JUMP); InjectHook(0x4031F0, &CAnimBlendAssociation::UpdateTime, PATCH_JUMP);
InjectHook(0x4032B0, &CAnimBlendAssociation::UpdateBlend, PATCH_JUMP); InjectHook(0x4032B0, &CAnimBlendAssociation::UpdateBlend, PATCH_JUMP);
InjectHook(0x401460, &CAnimBlendAssociation::ctor1, PATCH_JUMP); InjectHook(0x401460, &CAnimBlendAssociation_::ctor1, PATCH_JUMP);
InjectHook(0x4014C0, &CAnimBlendAssociation::ctor2, PATCH_JUMP); InjectHook(0x4014C0, &CAnimBlendAssociation_::ctor2, PATCH_JUMP);
InjectHook(0x401520, &CAnimBlendAssociation::dtor, PATCH_JUMP); InjectHook(0x401520, &CAnimBlendAssociation_::dtor, PATCH_JUMP);
ENDPATCHES ENDPATCHES

View File

@ -85,9 +85,5 @@ public:
static CAnimBlendAssociation *FromLink(CAnimBlendLink *l) { static CAnimBlendAssociation *FromLink(CAnimBlendLink *l) {
return (CAnimBlendAssociation*)((uint8*)l - offsetof(CAnimBlendAssociation, link)); return (CAnimBlendAssociation*)((uint8*)l - offsetof(CAnimBlendAssociation, link));
} }
CAnimBlendAssociation *ctor1(void) { return ::new (this) CAnimBlendAssociation(); }
CAnimBlendAssociation *ctor2(CAnimBlendAssociation &other) { return ::new (this) CAnimBlendAssociation(other); }
void dtor(void) { this->CAnimBlendAssociation::~CAnimBlendAssociation(); }
}; };
static_assert(sizeof(CAnimBlendAssociation) == 0x40, "CAnimBlendAssociation: error"); static_assert(sizeof(CAnimBlendAssociation) == 0x40, "CAnimBlendAssociation: error");

View File

@ -36,9 +36,19 @@ CAnimBlendClumpData::ForAllFrames(void (*cb)(AnimBlendFrameData*, void*), void *
cb(&frames[i], arg); cb(&frames[i], arg);
} }
#include <new>
class CAnimBlendClumpData_ : public CAnimBlendClumpData
{
public:
CAnimBlendClumpData *ctor(void) { return ::new (this) CAnimBlendClumpData(); }
void dtor(void) { this->CAnimBlendClumpData::~CAnimBlendClumpData(); }
};
STARTPATCHES STARTPATCHES
InjectHook(0x401880, &CAnimBlendClumpData::ctor, PATCH_JUMP); InjectHook(0x401880, &CAnimBlendClumpData_::ctor, PATCH_JUMP);
InjectHook(0x4018B0, &CAnimBlendClumpData::dtor, PATCH_JUMP); InjectHook(0x4018B0, &CAnimBlendClumpData_::dtor, PATCH_JUMP);
InjectHook(0x4018F0, &CAnimBlendClumpData::SetNumberOfFrames, PATCH_JUMP); InjectHook(0x4018F0, &CAnimBlendClumpData::SetNumberOfFrames, PATCH_JUMP);
InjectHook(0x401930, &CAnimBlendClumpData::ForAllFrames, PATCH_JUMP); InjectHook(0x401930, &CAnimBlendClumpData::ForAllFrames, PATCH_JUMP);
ENDPATCHES ENDPATCHES

View File

@ -49,9 +49,5 @@ public:
void SetNumberOfBones(int n) { SetNumberOfFrames(n); } void SetNumberOfBones(int n) { SetNumberOfFrames(n); }
#endif #endif
void ForAllFrames(void (*cb)(AnimBlendFrameData*, void*), void *arg); void ForAllFrames(void (*cb)(AnimBlendFrameData*, void*), void *arg);
CAnimBlendClumpData *ctor(void) { return ::new (this) CAnimBlendClumpData(); }
void dtor(void) { this->CAnimBlendClumpData::~CAnimBlendClumpData(); }
}; };
static_assert(sizeof(CAnimBlendClumpData) == 0x14, "CAnimBlendClumpData: error"); static_assert(sizeof(CAnimBlendClumpData) == 0x14, "CAnimBlendClumpData: error");

View File

@ -2061,6 +2061,19 @@ CColModel::operator=(const CColModel &other)
return *this; return *this;
} }
#include <new>
struct CColLine_ : public CColLine
{
CColLine *ctor(CVector *p0, CVector *p1) { return ::new (this) CColLine(*p0, *p1); }
};
struct CColModel_ : public CColModel
{
CColModel *ctor(void) { return ::new (this) CColModel(); }
void dtor(void) { this->CColModel::~CColModel(); }
};
STARTPATCHES STARTPATCHES
InjectHook(0x4B9C30, (CMatrix& (*)(const CMatrix &src, CMatrix &dst))Invert, PATCH_JUMP); InjectHook(0x4B9C30, (CMatrix& (*)(const CMatrix &src, CMatrix &dst))Invert, PATCH_JUMP);
@ -2099,15 +2112,15 @@ STARTPATCHES
InjectHook(0x411E40, (void (CColSphere::*)(float, const CVector&, uint8, uint8))&CColSphere::Set, PATCH_JUMP); InjectHook(0x411E40, (void (CColSphere::*)(float, const CVector&, uint8, uint8))&CColSphere::Set, PATCH_JUMP);
InjectHook(0x40B2A0, &CColBox::Set, PATCH_JUMP); InjectHook(0x40B2A0, &CColBox::Set, PATCH_JUMP);
InjectHook(0x40B320, &CColLine::ctor, PATCH_JUMP); InjectHook(0x40B320, &CColLine_::ctor, PATCH_JUMP);
InjectHook(0x40B350, &CColLine::Set, PATCH_JUMP); InjectHook(0x40B350, &CColLine::Set, PATCH_JUMP);
InjectHook(0x411E70, &CColTriangle::Set, PATCH_JUMP); InjectHook(0x411E70, &CColTriangle::Set, PATCH_JUMP);
InjectHook(0x411EA0, &CColTrianglePlane::Set, PATCH_JUMP); InjectHook(0x411EA0, &CColTrianglePlane::Set, PATCH_JUMP);
InjectHook(0x412140, &CColTrianglePlane::GetNormal, PATCH_JUMP); InjectHook(0x412140, &CColTrianglePlane::GetNormal, PATCH_JUMP);
InjectHook(0x411680, &CColModel::ctor, PATCH_JUMP); InjectHook(0x411680, &CColModel_::ctor, PATCH_JUMP);
InjectHook(0x4116E0, &CColModel::dtor, PATCH_JUMP); InjectHook(0x4116E0, &CColModel_::dtor, PATCH_JUMP);
InjectHook(0x411D80, &CColModel::RemoveCollisionVolumes, PATCH_JUMP); InjectHook(0x411D80, &CColModel::RemoveCollisionVolumes, PATCH_JUMP);
InjectHook(0x411CB0, &CColModel::CalculateTrianglePlanes, PATCH_JUMP); InjectHook(0x411CB0, &CColModel::CalculateTrianglePlanes, PATCH_JUMP);
InjectHook(0x411D10, &CColModel::RemoveTrianglePlanes, PATCH_JUMP); InjectHook(0x411D10, &CColModel::RemoveTrianglePlanes, PATCH_JUMP);

View File

@ -35,8 +35,6 @@ struct CColLine
CColLine(void) { }; CColLine(void) { };
CColLine(const CVector &p0, const CVector &p1) { this->p0 = p0; this->p1 = p1; }; CColLine(const CVector &p0, const CVector &p1) { this->p0 = p0; this->p1 = p1; };
void Set(const CVector &p0, const CVector &p1); void Set(const CVector &p0, const CVector &p1);
CColLine *ctor(CVector *p0, CVector *p1) { return ::new (this) CColLine(*p0, *p1); }
}; };
struct CColTriangle struct CColTriangle
@ -106,8 +104,6 @@ struct CColModel
void SetLinkPtr(CLink<CColModel*>*); void SetLinkPtr(CLink<CColModel*>*);
void GetTrianglePoint(CVector &v, int i) const; void GetTrianglePoint(CVector &v, int i) const;
CColModel *ctor(void) { return ::new (this) CColModel(); }
void dtor(void) { this->CColModel::~CColModel(); }
CColModel& operator=(const CColModel& other); CColModel& operator=(const CColModel& other);
}; };

View File

@ -63,6 +63,8 @@ CPlaceable::IsWithinArea(float x1, float y1, float z1, float x2, float y2, float
z1 <= GetPosition().z && GetPosition().z <= z2; z1 <= GetPosition().z && GetPosition().z <= z2;
} }
#include <new>
class CPlaceable_ : public CPlaceable class CPlaceable_ : public CPlaceable
{ {
public: public:

View File

@ -10,8 +10,6 @@
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
#include <math.h> #include <math.h>
//#include <assert.h>
#include <new>
#ifdef WITHWINDOWS #ifdef WITHWINDOWS
#include <Windows.h> #include <Windows.h>

View File

@ -21,6 +21,8 @@ CBuilding::ReplaceWithNewModel(int32 id)
CStreaming::RequestModel(id, STREAMFLAGS_DONT_REMOVE); CStreaming::RequestModel(id, STREAMFLAGS_DONT_REMOVE);
} }
#include <new>
class CBuilding_ : public CBuilding class CBuilding_ : public CBuilding
{ {
public: public:

View File

@ -865,6 +865,8 @@ CEntity::ModifyMatrixForBannerInWind(void)
UpdateRwFrame(); UpdateRwFrame();
} }
#include <new>
class CEntity_ : public CEntity class CEntity_ : public CEntity
{ {
public: public:

View File

@ -12,6 +12,8 @@ CDummyObject::CDummyObject(CObject *obj)
m_level = obj->m_level; m_level = obj->m_level;
} }
#include <new>
class CDummyObject_ : public CDummyObject class CDummyObject_ : public CDummyObject
{ {
public: public:

View File

@ -141,6 +141,8 @@ CObject::CanBeDeleted(void)
} }
} }
#include <new>
class CObject_ : public CObject class CObject_ : public CObject
{ {
public: public:

View File

@ -14,6 +14,8 @@ CProjectile::CProjectile(int32 model) : CObject()
ObjectCreatedBy = MISSION_OBJECT; ObjectCreatedBy = MISSION_OBJECT;
} }
#include <new>
class CProjectile_ : public CProjectile class CProjectile_ : public CProjectile
{ {
public: public:

View File

@ -377,6 +377,8 @@ CCivilianPed::ProcessControl(void)
Avoid(); Avoid();
} }
#include <new>
class CCivilianPed_ : public CCivilianPed class CCivilianPed_ : public CCivilianPed
{ {
public: public:

View File

@ -551,6 +551,8 @@ CCopPed::CopAI(void)
} }
} }
#include <new>
class CCopPed_ : public CCopPed class CCopPed_ : public CCopPed
{ {
public: public:

View File

@ -413,6 +413,8 @@ CEmergencyPed::MedicAI(void)
} }
} }
#include <new>
class CEmergencyPed_ : public CEmergencyPed class CEmergencyPed_ : public CEmergencyPed
{ {
public: public:

View File

@ -17455,6 +17455,8 @@ CPed::SetExitBoat(CVehicle *boat)
CWaterLevel::FreeBoatWakeArray(); CWaterLevel::FreeBoatWakeArray();
} }
#include <new>
class CPed_ : public CPed class CPed_ : public CPed
{ {
public: public:

View File

@ -1414,6 +1414,8 @@ CPlayerPed::ProcessControl(void)
} }
} }
#include <new>
class CPlayerPed_ : public CPlayerPed class CPlayerPed_ : public CPlayerPed
{ {
public: public:

View File

@ -4483,6 +4483,8 @@ CAutomobile::SetAllTaxiLights(bool set)
m_sAllTaxiLights = set; m_sAllTaxiLights = set;
} }
#include <new>
class CAutomobile_ : public CAutomobile class CAutomobile_ : public CAutomobile
{ {
public: public:

View File

@ -299,6 +299,8 @@ CBoat::FillBoatList()
} }
} }
#include <new>
class CBoat_ : public CBoat class CBoat_ : public CBoat
{ {
public: public:

View File

@ -1034,6 +1034,7 @@ bool CHeli::HasCatalinaBeenShotDown(void) { return CatalinaHasBeenShotDown; }
void CHeli::ActivateHeli(bool activate) { ScriptHeliOn = activate; } void CHeli::ActivateHeli(bool activate) { ScriptHeliOn = activate; }
#include <new>
class CHeli_ : public CHeli class CHeli_ : public CHeli
{ {

View File

@ -964,6 +964,7 @@ bool CPlane::HasCesnaLanded(void) { return CesnaMissionStatus == CESNA_STATUS_LA
bool CPlane::HasCesnaBeenDestroyed(void) { return CesnaMissionStatus == CESNA_STATUS_DESTROYED; } bool CPlane::HasCesnaBeenDestroyed(void) { return CesnaMissionStatus == CESNA_STATUS_DESTROYED; }
bool CPlane::HasDropOffCesnaBeenShotDown(void) { return DropOffCesnaMissionStatus == CESNA_STATUS_DESTROYED; } bool CPlane::HasDropOffCesnaBeenShotDown(void) { return DropOffCesnaMissionStatus == CESNA_STATUS_DESTROYED; }
#include <new>
class CPlane_ : public CPlane class CPlane_ : public CPlane
{ {

View File

@ -691,6 +691,8 @@ CTrain::UpdateTrains(void)
} }
} }
#include <new>
class CTrain_ : public CTrain class CTrain_ : public CTrain
{ {
public: public: