diff options
author | Shauren <shauren.trinity@gmail.com> | 2021-04-24 23:28:42 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-04-25 00:11:36 +0200 |
commit | bb8f22ed2013f8cb6b9d61c738f2ebd96b83722f (patch) | |
tree | 37e089d220d7c5967266fc71b30ef36de81e67c3 /src/common/Collision/Models/ModelInstance.h | |
parent | 4e00cb7c157a0bd25a0b48a80a1f71a1817010bf (diff) |
Core/Vmaps: Reduce memory used by vmaps (and their size, slightly)
Diffstat (limited to 'src/common/Collision/Models/ModelInstance.h')
-rw-r--r-- | src/common/Collision/Models/ModelInstance.h | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/common/Collision/Models/ModelInstance.h b/src/common/Collision/Models/ModelInstance.h index b342a14fdc6..bba48669d00 100644 --- a/src/common/Collision/Models/ModelInstance.h +++ b/src/common/Collision/Models/ModelInstance.h @@ -39,28 +39,35 @@ namespace VMAP MOD_PARENT_SPAWN = 1 << 2 }; - class TC_COMMON_API ModelSpawn + struct ModelMinimalData { - public: - //mapID, tileX, tileY, Flags, ID, Pos, Rot, Scale, Bound_lo, Bound_hi, name - uint32 flags; - uint16 adtId; + //Flags, ID, Pos, Rot, Scale, Bound_lo, Bound_hi + uint8 flags; + uint8 adtId; uint32 ID; G3D::Vector3 iPos; G3D::Vector3 iRot; float iScale; G3D::AABox iBound; +#ifdef VMAP_DEBUG std::string name; - bool operator==(ModelSpawn const& other) const { return ID == other.ID; } - //uint32 hashCode() const { return ID; } - // temp? +#endif + + bool operator==(ModelMinimalData const& other) const { return ID == other.ID; } G3D::AABox const& getBounds() const { return iBound; } + }; + + struct TC_COMMON_API ModelSpawn : public ModelMinimalData + { +#ifndef VMAP_DEBUG + std::string name; +#endif static bool readFromFile(FILE* rf, ModelSpawn& spawn); static bool writeToFile(FILE* rw, ModelSpawn const& spawn); }; - class TC_COMMON_API ModelInstance : public ModelSpawn + class TC_COMMON_API ModelInstance : public ModelMinimalData { public: ModelInstance() : iInvScale(0.0f), iModel(nullptr) { } @@ -70,6 +77,7 @@ namespace VMAP void intersectPoint(G3D::Vector3 const& p, AreaInfo& info) const; bool GetLocationInfo(G3D::Vector3 const& p, LocationInfo& info) const; bool GetLiquidLevel(G3D::Vector3 const& p, LocationInfo& info, float& liqHeight) const; + G3D::Matrix3 const& GetInvRot() { return iInvRot; } WorldModel* getWorldModel() { return iModel; } protected: G3D::Matrix3 iInvRot; |