From 99a5aa550ed68ae480da0a2298abcfcea09e6380 Mon Sep 17 00:00:00 2001 From: Robert MacGregor Date: Sun, 14 Jul 2019 17:57:36 -0700 Subject: [PATCH] * Implement type masking. --- CommonAPI/Common/include/DXAPI/SimObject.h | 35 +++++++++++++++++++++ CommonAPI/Common/source/DXAPI/SimObject.cpp | 3 +- 2 files changed, 37 insertions(+), 1 deletion(-) diff --git a/CommonAPI/Common/include/DXAPI/SimObject.h b/CommonAPI/Common/include/DXAPI/SimObject.h index 8dacf4b..03c6b3a 100644 --- a/CommonAPI/Common/include/DXAPI/SimObject.h +++ b/CommonAPI/Common/include/DXAPI/SimObject.h @@ -6,6 +6,40 @@ namespace DX { + //! All type masks used in the engine. + enum class TypeMasks : unsigned int + { + StaticObjectType = 1, + EnvironmentObjectType = 2, + TerrainObjectType = 4, + InteriorObjectType = 8, + WaterObjectType = 0x10, + TriggerObjectType = 0x40, + MarkerObjectType = 0x40, + ForceFieldObjectType = 0x100, + GameBaseObjectType = 0x400, + ShapeBaseObjectType = 0x800, + CameraObjectType = 0x1000, + StaticShapeObjectType = 0x2000, + PlayerObjectType = 0x4000, + ItemObjectType = 0x8000, + VehicleObjectType = 0x10000, + VehicleBlockerObject = 0x20000, + ProjectileObjectType = 0x40000, + ExplosionObjectType = 0x80000, + CorpseObjectType = 0x100000, + TurretObjectType = 0x200000, + DebrisObjectType = 0x400000, + PhysicalZoneObjectType = 0x800000, + StatocTSObjectType = 0x1000000, + GuiControlObjectType = 0x2000000, + StaticRenderedObjectType = 0x4000000, + DamagableItemObjectType = 0x8000000, + SensorObjectType = 0x10000000, + StationObjectType = 0x20000000, + GeneratorObjectType = 0x40000000 + }; + class SimObject { public: @@ -19,6 +53,7 @@ namespace DX const unsigned int &identifier; const unsigned int base_pointer_value; const unsigned int &dataBlock; + const TypeMasks &type; char& mName; }; diff --git a/CommonAPI/Common/source/DXAPI/SimObject.cpp b/CommonAPI/Common/source/DXAPI/SimObject.cpp index 33338a2..09b9634 100644 --- a/CommonAPI/Common/source/DXAPI/SimObject.cpp +++ b/CommonAPI/Common/source/DXAPI/SimObject.cpp @@ -11,7 +11,8 @@ namespace DX fieldDictionary(MEMBER_FIELD(obj, unsigned int, 0x2C)), dataBlock(MEMBER_FIELD(obj, unsigned int, 0x248)), base_pointer_value(MEMBER_FIELD(obj, unsigned int, 0)), - mName(MEMBER_FIELD(obj, char, 4)) + mName(MEMBER_FIELD(obj, char, 4)), + type(MEMBER_FIELD(obj, TypeMasks, 0x28)) { }