Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 3 additions & 21 deletions AbstractClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ class NOVTABLE AbstractClass : public IPersistStream, public IRTTITypeInfo, publ
virtual HouseClass* GetOwningHouse() const R0;
virtual int GetArrayIndex() const R0;
virtual bool IsDead() const R0;
virtual CoordStruct* GetCoords(CoordStruct* pCrd) const R0;
virtual CoordStruct* GetDestination(CoordStruct* pCrd, TechnoClass* pDocker = nullptr) const R0; // where this is moving, or a building's dock for a techno. iow, a rendez-vous point
virtual CoordStruct GetCoords() const RT(CoordStruct);
virtual CoordStruct GetDestination(TechnoClass* pDocker = nullptr) const RT(CoordStruct); // where this is moving, or a building's dock for a techno. iow, a rendez-vous point
virtual bool IsOnFloor() const R0;
virtual bool IsInAir() const R0;
virtual CoordStruct* GetCenterCoords(CoordStruct* pCrd) const R0;
virtual CoordStruct GetCenterCoords() const RT(CoordStruct);
virtual void Update() RX;

//non-virtual
Expand All @@ -104,24 +104,6 @@ class NOVTABLE AbstractClass : public IPersistStream, public IRTTITypeInfo, publ
AnnounceExpiredPointer(this, removed);
}

CoordStruct GetCoords() const {
CoordStruct ret;
this->GetCoords(&ret);
return ret;
}

CoordStruct GetDestination(TechnoClass* pDocker = nullptr) const {
CoordStruct ret;
this->GetDestination(&ret, pDocker);
return ret;
}

CoordStruct GetCenterCoords() const {
CoordStruct ret;
this->GetCenterCoords(&ret);
return ret;
}

DirStruct* GetTargetDirection(DirStruct* pDir, AbstractClass* pTarget) const
{ JMP_THIS(0x5F3DB0); }

Expand Down
16 changes: 2 additions & 14 deletions BounceClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,24 +29,12 @@ class BounceClass
double maxVelocity, const Vector3D<float>& velocity, double angularVelocity)
{ JMP_THIS(0x4397E0); }

CoordStruct* GetCoords(CoordStruct* pBuffer) const
CoordStruct GetCoords() const
{ JMP_THIS(0x4399A0); }

CoordStruct GetCoords() const {
CoordStruct buffer;
this->GetCoords(&buffer);
return buffer;
}

Matrix3D* GetDrawingMatrix(Matrix3D* pBuffer) const
Matrix3D GetDrawingMatrix() const
{ JMP_THIS(0x4399E0); }

Matrix3D GetDrawingMatrix() const {
Matrix3D buffer;
this->GetDrawingMatrix(&buffer);
return buffer;
}

Status Update()
{ JMP_THIS(0x439B00); }

Expand Down
2 changes: 1 addition & 1 deletion BuildingClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class NOVTABLE BuildingClass : public TechnoClass
bool CheckFog()
{ JMP_THIS(0x457A10); }

Matrix3D* GetVoxelBarrelOffsetMatrix(Matrix3D& ret)
Matrix3D GetVoxelBarrelOffsetMatrix()
{ JMP_THIS(0x458810); }

// returns false if this is a gate that is closed, true otherwise
Expand Down
4 changes: 2 additions & 2 deletions CCINIClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -150,10 +150,10 @@ class NOVTABLE INIClass
//Reads three integer values.
int* Read3Integers(int* pBuffer, const char* pSection, const char* pKey, int* pDefault)
{ JMP_THIS(0x529CA0); }
CoordStruct* ReadPoint3D(CoordStruct& ret, const char* pSection, const char* pKey, CoordStruct& defValue)
CoordStruct ReadPoint3D(const char* pSection, const char* pKey, CoordStruct& defValue)
{ JMP_THIS(0x529CA0); }
void GetPoint3D(const char* pSection, const char* pKey, CoordStruct& value)
{ ReadPoint3D(value, pSection, pKey, value); }
{ value = ReadPoint3D(pSection, pKey, value); }

//Reads three byte values.
byte* Read3Bytes(byte* pBuffer, const char* pSection, const char* pKey, byte* pDefault)
Expand Down
11 changes: 2 additions & 9 deletions CellClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -186,15 +186,8 @@ class NOVTABLE CellClass : public AbstractClass
{ JMP_THIS(0x47B3A0); }

// Factors in cell height from ramps, level etc.
CoordStruct* GetCellCoords(CoordStruct* pOutBuffer) const
{ JMP_THIS(0x480A30); }

CoordStruct GetCellCoords() const
{
CoordStruct buffer;
GetCellCoords(&buffer);
return buffer;
}
{ JMP_THIS(0x480A30); }

void ActivateVeins()
{ JMP_THIS(0x486920); }
Expand Down Expand Up @@ -337,7 +330,7 @@ class NOVTABLE CellClass : public AbstractClass
CALL(0x489270);
}

CoordStruct* FindInfantrySubposition(CoordStruct* pOutBuffer, const CoordStruct& coords, bool ignoreContents, bool alt, bool useCellCoords)
CoordStruct FindInfantrySubposition(CoordStruct* pOutBuffer, const CoordStruct& coords, bool ignoreContents, bool alt, bool useCellCoords)
{ JMP_THIS(0x481180); }

CoordStruct FindInfantrySubposition(const CoordStruct& coords, bool ignoreContents, bool alt, bool useCellCoords)
Expand Down
8 changes: 1 addition & 7 deletions DisplayClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,9 @@ class NOVTABLE DisplayClass : public MapClass
{ JMP_THIS(0x692610); }

/* pass in CurrentFoundationData and receive the width/height of a bounding rectangle in cells */
CellStruct* FoundationBoundsSize(CellStruct& outBuffer, CellStruct const* const pFoundationData) const
CellStruct FoundationBoundsSize(CellStruct const* const pFoundationData) const
{ JMP_THIS(0x4A94F0); }

CellStruct FoundationBoundsSize(CellStruct const* const pFoundationData) const {
CellStruct outBuffer;
FoundationBoundsSize(outBuffer, pFoundationData);
return outBuffer;
}

/* marks or unmarks the cells pointed to by CurrentFoundationData as containing a building */
void MarkFoundation(CellStruct * BaseCell, bool Mark)
{ JMP_THIS(0x4A95A0); }
Expand Down
2 changes: 1 addition & 1 deletion DropPodLocomotionClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class NOVTABLE DropPodLocomotionClass : public LocomotionClass, public IPiggybac

//ILocomotion
virtual bool __stdcall Is_Moving() R0;
virtual CoordStruct* __stdcall Destination(CoordStruct* pcoord) R0;
virtual CoordStruct __stdcall Destination() RT(CoordStruct);
virtual bool __stdcall Process() R0;
virtual void __stdcall Move_To(CoordStruct to) RX;
virtual void __stdcall Stop_Moving() RX;
Expand Down
8 changes: 1 addition & 7 deletions EBolt.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,9 @@ class EBolt
void ClearOwner()
{ JMP_THIS(0x4C1E50); }

CoordStruct* GetSourceCoords(CoordStruct* outBuffer) const
CoordStruct GetSourceCoords() const
{ JMP_THIS(0x4C2B40); }

CoordStruct GetSourceCoords() const {
CoordStruct buffer;
GetSourceCoords(&buffer);
return buffer;
}

void Fire(CoordStruct P1, CoordStruct P2, DWORD arg18)
{ JMP_THIS(0x4C2A60); }

Expand Down
2 changes: 1 addition & 1 deletion FlyLocomotionClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class NOVTABLE FlyLocomotionClass : public LocomotionClass

//ILocomotion
virtual bool __stdcall Is_Moving() R0;
virtual CoordStruct* __stdcall Destination(CoordStruct* pcoord) R0;
virtual CoordStruct __stdcall Destination() RT(CoordStruct);
virtual bool __stdcall Process() R0;
virtual void __stdcall Move_To(CoordStruct to) RX;
virtual void __stdcall Stop_Moving() RX;
Expand Down
2 changes: 1 addition & 1 deletion FootClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class NOVTABLE FootClass : public TechnoClass
virtual bool CanDeployNow() const R0;
virtual void AddSensorsAt(CellStruct cell) RX;
virtual void RemoveSensorsAt(CellStruct cell) RX;
virtual CoordStruct* vt_entry_4F0(CoordStruct* pCrd) R0;
virtual CoordStruct vt_entry_4F0() RT(CoordStruct);
virtual void vt_entry_4F4() RX;
virtual bool vt_entry_4F8() R0;
virtual bool MoveTo(CoordStruct* pCrd) R0;
Expand Down
16 changes: 2 additions & 14 deletions HouseClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -657,24 +657,12 @@ class NOVTABLE HouseClass : public AbstractClass, public IHouse, public IPublicH
bool Fire_SW(int idx, const CellStruct &coords)
{ JMP_THIS(0x4FAE50); }

CellStruct* PickTargetByType(CellStruct &outBuffer, QuarryType targetType) const
CellStruct PickTargetByType(QuarryType targetType) const
{ JMP_THIS(0x50D170); }

CellStruct PickTargetByType(QuarryType targetType) const {
CellStruct outBuffer;
this->PickTargetByType(outBuffer, targetType);
return outBuffer;
}

CellStruct* PickIonCannonTarget(CellStruct &outBuffer) const
CellStruct PickIonCannonTarget() const
{ JMP_THIS(0x50CBF0); }

CellStruct PickIonCannonTarget() const {
CellStruct outBuffer;
this->PickIonCannonTarget(outBuffer);
return outBuffer;
}

bool IsIonCannonEligibleTarget(const TechnoClass* pTechno) const;

void UpdateFlagCoords(UnitClass *NewCarrier, DWORD dwUnk)
Expand Down
2 changes: 1 addition & 1 deletion IsometricTileTypeClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class NOVTABLE IsometricTileTypeClass : public ObjectTypeClass
virtual int GetArrayIndex() const R0;

//ObjectTypeClass
virtual CoordStruct* vt_entry_6C(CoordStruct* pDest, CoordStruct* pSrc) const R0;
virtual CoordStruct vt_entry_6C(CoordStruct* pSrc) const RT(CoordStruct);

virtual bool SpawnAtMapCoords(CellStruct* pMapCoords, HouseClass* pOwner) R0;

Expand Down
2 changes: 1 addition & 1 deletion JumpjetLocomotionClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class NOVTABLE JumpjetLocomotionClass : public LocomotionClass, public IPiggybac

//ILocomotion
virtual bool __stdcall Is_Moving() R0;
virtual CoordStruct* __stdcall Destination(CoordStruct* pcoord) R0;
virtual CoordStruct __stdcall Destination() RT(CoordStruct);
virtual bool __stdcall Process() R0;
virtual void __stdcall Move_To(CoordStruct to) RX;
virtual void __stdcall Stop_Moving() RX;
Expand Down
3 changes: 1 addition & 2 deletions MPGameModeClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -218,8 +218,7 @@ class MPGameModeClass
virtual void CreateMPTeams(DynamicVectorClass<MPTeam> *vecTeams)
{ JMP_THIS(0x5D6690); }

virtual CellStruct * AssignStartingPositionsToHouse(CellStruct *result, int idxHouse,
DynamicVectorClass<CellStruct> *vecCoords, byte *housesSatisfied)
virtual CellStruct AssignStartingPositionsToHouse(int idxHouse, DynamicVectorClass<CellStruct> *vecCoords, byte *housesSatisfied)
{ JMP_THIS(0x5D6890); }

virtual bool SpawnBaseUnits(HouseClass *House, DWORD dwUnused)
Expand Down
53 changes: 4 additions & 49 deletions MapClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,26 +255,13 @@ class NOVTABLE MapClass : public GScreenClass
}

// gets a coordinate in a random direction a fixed distance in leptons away from coords
static CoordStruct* __fastcall GetRandomCoordsNear(CoordStruct &outBuffer, const CoordStruct &coords, int distance, bool center) {
static CoordStruct __fastcall GetRandomCoordsNear(const CoordStruct &coords, int distance, bool center) {
JMP_STD(0x49F420);
}

// gets a coordinate in a random direction a fixed distance in leptons away from coords
static CoordStruct GetRandomCoordsNear(const CoordStruct &coords, int distance, bool center) {
CoordStruct outBuffer;
GetRandomCoordsNear(outBuffer, coords, distance, center);
return outBuffer;
}

static CoordStruct* __stdcall PickInfantrySublocation(CoordStruct &outBuffer, const CoordStruct &coords, bool ignoreContents = false)
static CoordStruct __stdcall PickInfantrySublocation(const CoordStruct &coords, bool ignoreContents = false)
{ JMP_STD(0x4ACA10); }

static CoordStruct PickInfantrySublocation(const CoordStruct &coords, bool ignoreContents = false) {
CoordStruct outBuffer;
PickInfantrySublocation(outBuffer, coords, ignoreContents);
return outBuffer;
}

static void __fastcall UnselectAll()
{ JMP_STD(0x48DC90); }

Expand Down Expand Up @@ -330,17 +317,9 @@ class NOVTABLE MapClass : public GScreenClass
int GetCellFloorHeight(const CoordStruct& crd) const
{ JMP_THIS(0x578080); }

CellStruct * PickCellOnEdge(CellStruct &buffer, Edge Edge, const CellStruct &CurrentLocation, const CellStruct &Fallback,
SpeedType SpeedType, bool ValidateReachability, MovementZone MovZone) const
{ JMP_THIS(0x4AA440); }

CellStruct PickCellOnEdge(Edge Edge, const CellStruct &CurrentLocation, const CellStruct &Fallback,
SpeedType SpeedType, bool ValidateReachability, MovementZone MovZone) const
{
CellStruct buffer;
this->PickCellOnEdge(buffer, Edge, CurrentLocation, Fallback, SpeedType, ValidateReachability, MovZone);
return buffer;
}
{ JMP_THIS(0x4AA440); }

// Pathfinding voodoo
// do not touch them, mmkay, they trigger ZoneConnection recalc which is a MUST for firestorm to work
Expand All @@ -352,15 +331,9 @@ class NOVTABLE MapClass : public GScreenClass
{ JMP_THIS(0x586990); }

// Find nearest spot
CellStruct* NearByLocation(CellStruct &outBuffer, const CellStruct &position, SpeedType SpeedType, int a5, MovementZone MovementZone, bool alt, int SpaceSizeX, int SpaceSizeY, bool disallowOverlay, bool a11, bool requireBurrowable, bool allowBridge, const CellStruct &closeTo, bool a15, bool buildable)
CellStruct NearByLocation(const CellStruct &position, SpeedType SpeedType, int a5, MovementZone MovementZone, bool alt, int SpaceSizeX, int SpaceSizeY, bool disallowOverlay, bool a11, bool requireBurrowable, bool allowBridge, const CellStruct &closeTo, bool a15, bool buildable)
{ JMP_THIS(0x56DC20); }

CellStruct NearByLocation(const CellStruct &position, SpeedType SpeedType, int a5, MovementZone MovementZone, bool alt, int SpaceSizeX, int SpaceSizeY, bool disallowOverlay, bool a11, bool requireBurrowable, bool allowBridge, const CellStruct &closeTo, bool a15, bool buildable) {
CellStruct outBuffer;
NearByLocation(outBuffer, position, SpeedType, a5, MovementZone, alt, SpaceSizeX, SpaceSizeY, disallowOverlay, a11, requireBurrowable, allowBridge, closeTo, a15, buildable);
return outBuffer;
}

void AddContentAt(CellStruct *coords, TechnoClass *Content)
{ JMP_THIS(0x5683C0); }

Expand All @@ -386,24 +359,6 @@ class NOVTABLE MapClass : public GScreenClass
bool PlacePowerupCrate(CellStruct cell, Powerup type)
{ JMP_THIS(0x56BEC0); }

// ====================================
// FIRESTORM RELATED
// ====================================

CoordStruct* FindFirstFirestorm(
CoordStruct* pOutBuffer, const CoordStruct& start,
const CoordStruct& end, HouseClass const* pHouse = nullptr) const
{ JMP_THIS(0x5880A0); }

CoordStruct FindFirstFirestorm(
const CoordStruct& start, const CoordStruct& end,
HouseClass const* pHouse = nullptr) const
{
CoordStruct outBuffer;
FindFirstFirestorm(&outBuffer, start, end, pHouse);
return outBuffer;
}

// ====================================
// MAP REVEAL BRAINDAMAGE
// ====================================
Expand Down
46 changes: 7 additions & 39 deletions ObjectClass.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,12 @@ class NOVTABLE ObjectClass : public AbstractClass
virtual bool IsControllable() const R0;

// On non-buildings this is same as GetCenterCoord(), on buildings it returns the target coordinate that is affected by TargetCoordOffset.
virtual CoordStruct* GetTargetCoords(CoordStruct* pCrd) const R0;
virtual CoordStruct GetTargetCoords() const RT(CoordStruct);
// gets a building's free dock coordinates for a unit. falls back to this->GetCoords(pCrd);
virtual CoordStruct* GetDockCoords(CoordStruct* pCrd, TechnoClass* docker) const R0;
virtual CoordStruct* GetRenderCoords(CoordStruct* pCrd) const { JMP_THIS(0x41BE00); }
virtual CoordStruct* GetFLH(CoordStruct *pDest, int idxWeapon, CoordStruct BaseCoords) const R0;
virtual CoordStruct* GetExitCoords(CoordStruct* pCrd, DWORD dwUnk) const R0;
virtual CoordStruct GetDockCoords(TechnoClass* docker) const RT(CoordStruct);
virtual CoordStruct GetRenderCoords() const { JMP_THIS(0x41BE00); }
virtual CoordStruct GetFLH(int idxWeapon, CoordStruct BaseCoords = CoordStruct {0, 0, 0}) const RT(CoordStruct);
virtual CoordStruct GetExitCoords(DWORD dwUnk) const RT(CoordStruct);
virtual int GetYSort() const { JMP_THIS(0x5F6BD0); }
virtual bool IsOnBridge(TechnoClass* pDocker = nullptr) const R0; // pDocker is passed to GetDestination
virtual bool IsStandingStill() const R0;
Expand Down Expand Up @@ -178,11 +178,11 @@ class NOVTABLE ObjectClass : public AbstractClass
virtual void SetLocation(const CoordStruct& crd) RX;

// these two work through the object's Location
virtual CellStruct* GetMapCoords(CellStruct* pUCell) const R0;
virtual CellStruct GetMapCoords() const RT(CellStruct);
virtual CellClass* GetCell() const R0;

// these two call ::GetCoords_() instead
virtual CellStruct* GetMapCoordsAgain(CellStruct* pUCell) const R0;
virtual CellStruct GetMapCoordsAgain() const RT(CellStruct);
virtual CellClass* GetCellAgain() const R0;

virtual int GetHeight() const R0;
Expand Down Expand Up @@ -233,38 +233,6 @@ class NOVTABLE ObjectClass : public AbstractClass
bool IsCrushable(TechnoClass* pCrusher)
{ JMP_THIS(0x5F6CD0); }

CellStruct GetMapCoords() const {
CellStruct ret;
this->GetMapCoords(&ret);
return ret;
}

CellStruct GetMapCoordsAgain() const {
CellStruct ret;
this->GetMapCoordsAgain(&ret);
return ret;
}

// On non-buildings this is same as GetCenterCoord(), on buildings it returns the target coordinate that is affected by TargetCoordOffset.
CoordStruct GetTargetCoords() const
{
CoordStruct ret;
this->GetTargetCoords(&ret);
return ret;
}

CoordStruct GetRenderCoords() const {
CoordStruct ret;
this->GetRenderCoords(&ret);
return ret;
}

CoordStruct GetFLH(int idxWeapon, const CoordStruct& base) const {
CoordStruct ret;
this->GetFLH(&ret, idxWeapon, base);
return ret;
}

//Constructor NEVER CALL IT DIRECTLY
/*ObjectClass() noexcept
{ JMP_THIS(0x5F3900); }*/
Expand Down
Loading