From 9a75a1b69c216bad4b7bf65284826dbfb6730e98 Mon Sep 17 00:00:00 2001 From: dgelessus Date: Fri, 22 Mar 2024 00:34:04 +0100 Subject: [PATCH 1/8] Change plClothingItem index parameters from int to size_t --- Python/PRP/Avatar/pyClothingItem.cpp | 28 ++++++++++++++-------------- core/PRP/Avatar/plClothingItem.cpp | 2 +- core/PRP/Avatar/plClothingItem.h | 14 +++++++------- 3 files changed, 22 insertions(+), 22 deletions(-) diff --git a/Python/PRP/Avatar/pyClothingItem.cpp b/Python/PRP/Avatar/pyClothingItem.cpp index 51810f018..6f90aaa43 100644 --- a/Python/PRP/Avatar/pyClothingItem.cpp +++ b/Python/PRP/Avatar/pyClothingItem.cpp @@ -28,8 +28,8 @@ PY_METHOD_VA(ClothingItem, getMesh, "Params: lod\n" "Gets the Key of the mesh for the specified LOD") { - int lod = plClothingItem::kLODHigh; - if (!PyArg_ParseTuple(args, "i", &lod)) { + Py_ssize_t lod = plClothingItem::kLODHigh; + if (!PyArg_ParseTuple(args, "n", &lod)) { PyErr_SetString(PyExc_TypeError, "getMesh expects int"); return nullptr; } @@ -41,10 +41,10 @@ PY_METHOD_VA(ClothingItem, setMesh, "Params: lod, mesh\n" "Sets the Key of the mesh for the specified LOD") { - int lod = plClothingItem::kLODHigh; + Py_ssize_t lod = plClothingItem::kLODHigh; pyKey* key; - if (!PyArg_ParseTuple(args, "iO", &lod, &key)) { + if (!PyArg_ParseTuple(args, "nO", &lod, &key)) { PyErr_SetString(PyExc_TypeError, "setMesh expects int, plKey"); return nullptr; } @@ -61,8 +61,8 @@ PY_METHOD_VA(ClothingItem, getElementTexture, "Params: element, layer\n" "Gets the Key of the texture for the specified element and layer") { - int element, layer; - if (!PyArg_ParseTuple(args, "ii", &element, &layer)) { + Py_ssize_t element, layer; + if (!PyArg_ParseTuple(args, "nn", &element, &layer)) { PyErr_SetString(PyExc_TypeError, "getElementTexture expects int, int"); return nullptr; } @@ -74,10 +74,10 @@ PY_METHOD_VA(ClothingItem, setElementTexture, "Params: element idx, layer idx, texture\n" "Sets the texture of the specified element and layer") { - int element, layer; + Py_ssize_t element, layer; pyKey* key; - if (!PyArg_ParseTuple(args, "iiO", &element, &layer, &key)) { + if (!PyArg_ParseTuple(args, "nnO", &element, &layer, &key)) { PyErr_SetString(PyExc_TypeError, "setElementTexture expects int, int, plKey"); return nullptr; } @@ -94,8 +94,8 @@ PY_METHOD_VA(ClothingItem, getElementName, "Params: element idx\n" "Gets the name of the specified element") { - int element; - if (!PyArg_ParseTuple(args, "i", &element)) { + Py_ssize_t element; + if (!PyArg_ParseTuple(args, "n", &element)) { PyErr_SetString(PyExc_TypeError, "getElementName expects int"); return nullptr; } @@ -107,9 +107,9 @@ PY_METHOD_VA(ClothingItem, setElementName, "Params: element idx, name\n" "Sets the name of the specified element") { - int element; + Py_ssize_t element; const char* name; - if (!PyArg_ParseTuple(args, "is", &element, &name)) { + if (!PyArg_ParseTuple(args, "ns", &element, &name)) { PyErr_SetString(PyExc_TypeError, "setElementName expects int, string"); return nullptr; } @@ -136,8 +136,8 @@ PY_METHOD_VA(ClothingItem, delElement, "Params: element idx\n" "Remove an element from the clothingItem") { - int idx; - if (!PyArg_ParseTuple(args, "i", &idx)) { + Py_ssize_t idx; + if (!PyArg_ParseTuple(args, "n", &idx)) { PyErr_SetString(PyExc_TypeError, "delElement expects an int"); return nullptr; } diff --git a/core/PRP/Avatar/plClothingItem.cpp b/core/PRP/Avatar/plClothingItem.cpp index 6a928a314..a7b9bf9c0 100644 --- a/core/PRP/Avatar/plClothingItem.cpp +++ b/core/PRP/Avatar/plClothingItem.cpp @@ -286,7 +286,7 @@ void plClothingItem::addElement(const ST::string& elementName) fTextures.push_back(new plKey[kLayerMax]); } -void plClothingItem::delElement(int element) +void plClothingItem::delElement(size_t element) { delete[] fTextures[element]; fTextures.erase(fTextures.begin() + element); diff --git a/core/PRP/Avatar/plClothingItem.h b/core/PRP/Avatar/plClothingItem.h index 038450c45..71bacdcc7 100644 --- a/core/PRP/Avatar/plClothingItem.h +++ b/core/PRP/Avatar/plClothingItem.h @@ -127,7 +127,7 @@ class HSPLASMA_EXPORT plClothingItem : public hsKeyedObject * at LOD of \a lodLevel. * \sa LODLevels */ - plKey getMesh(int lodLevel) const { return fMeshes[lodLevel]; } + plKey getMesh(size_t lodLevel) const { return fMeshes[lodLevel]; } /** Returns the default first tint color for the item. */ hsColorRGBA getDefaultTint1() const @@ -184,7 +184,7 @@ class HSPLASMA_EXPORT plClothingItem : public hsKeyedObject * at LOD level \a lodLevel. * \sa LODLevels */ - void setMesh(int lodLevel, plKey mesh) { fMeshes[lodLevel] = std::move(mesh); } + void setMesh(size_t lodLevel, plKey mesh) { fMeshes[lodLevel] = std::move(mesh); } /** Set the default first tint color for this item. */ void setDefaultTint1(const hsColorRGBA& tint); @@ -203,7 +203,7 @@ class HSPLASMA_EXPORT plClothingItem : public hsKeyedObject * to \a texture. * \sa ClothingLayers */ - void setElementTexture(int element, int layer, plKey texture) + void setElementTexture(size_t element, size_t layer, plKey texture) { fTextures[element][layer] = std::move(texture); } @@ -211,7 +211,7 @@ class HSPLASMA_EXPORT plClothingItem : public hsKeyedObject /** * Sets the element name for element number \a element to \a elementName. */ - void setElementName(int element, const ST::string& elementName) + void setElementName(size_t element, const ST::string& elementName) { fElementNames[element] = elementName; } @@ -221,7 +221,7 @@ class HSPLASMA_EXPORT plClothingItem : public hsKeyedObject * \a layer. * \sa ClothingLayers */ - plKey getElementTexture(int element, int layer) const + plKey getElementTexture(size_t element, size_t layer) const { return fTextures[element][layer]; } @@ -229,13 +229,13 @@ class HSPLASMA_EXPORT plClothingItem : public hsKeyedObject /** * Returns the element name for element number \a element. */ - ST::string getElementName(int element) const + ST::string getElementName(size_t element) const { return fElementNames[element]; } /** Remove the specified element from the clothing item. */ - void delElement(int element); + void delElement(size_t element); }; #endif From fa2111430e19550936525950bf92893f9465c9fd Mon Sep 17 00:00:00 2001 From: dgelessus Date: Fri, 22 Mar 2024 01:13:31 +0100 Subject: [PATCH 2/8] Add plClothingItem::getNumElements Although there were already methods for getting, changing, adding, and removing elements, they couldn't be used safely from outside plClothingItem, because there was no way to get the number of elements, which is necessary to know which indices are valid for these methods. --- Python/PRP/Avatar/pyClothingItem.cpp | 2 ++ Python/PyHSPlasma.pyi | 1 + core/PRP/Avatar/plClothingItem.h | 3 +++ 3 files changed, 6 insertions(+) diff --git a/Python/PRP/Avatar/pyClothingItem.cpp b/Python/PRP/Avatar/pyClothingItem.cpp index 6f90aaa43..57e1c4443 100644 --- a/Python/PRP/Avatar/pyClothingItem.cpp +++ b/Python/PRP/Avatar/pyClothingItem.cpp @@ -176,6 +176,7 @@ PY_PROPERTY(plKey, ClothingItem, icon, getIcon, setIcon) PY_PROPERTY(plKey, ClothingItem, accessory, getAccessory, setAccessory) PY_PROPERTY(hsColorRGBA, ClothingItem, defaultTint1, getDefaultTint1, setDefaultTint1) PY_PROPERTY(hsColorRGBA, ClothingItem, defaultTint2, getDefaultTint2, setDefaultTint2) +PY_PROPERTY_RO(ClothingItem, numElements, getNumElements) PyGetSetDef pyClothingItem_GetSet[] = { pyClothingItem_itemName_getset, @@ -189,6 +190,7 @@ PyGetSetDef pyClothingItem_GetSet[] = { pyClothingItem_accessory_getset, pyClothingItem_defaultTint1_getset, pyClothingItem_defaultTint2_getset, + pyClothingItem_numElements_getset, PY_GETSET_TERMINATOR }; diff --git a/Python/PyHSPlasma.pyi b/Python/PyHSPlasma.pyi index cf72abc7f..9c22f34f3 100644 --- a/Python/PyHSPlasma.pyi +++ b/Python/PyHSPlasma.pyi @@ -1708,6 +1708,7 @@ class plClothingItem(hsKeyedObject): group: int = ... icon: Optional[plKey[plMipmap]] = ... itemName: str = ... + numElements: int = ... sortOrder: int = ... tileset: int = ... type: int = ... diff --git a/core/PRP/Avatar/plClothingItem.h b/core/PRP/Avatar/plClothingItem.h index 71bacdcc7..9f338ba4c 100644 --- a/core/PRP/Avatar/plClothingItem.h +++ b/core/PRP/Avatar/plClothingItem.h @@ -192,6 +192,9 @@ class HSPLASMA_EXPORT plClothingItem : public hsKeyedObject /** Set the default second tint color for this item. */ void setDefaultTint2(const hsColorRGBA& tint); + /** Returns the number of elements in this clothing item. */ + size_t getNumElements() const { return fElementNames.size(); } + /** Remove all elements from the clothing item. */ void clearElements(); From fac32e8c3ea0bf2a3756ee8500d7b690af3f4826 Mon Sep 17 00:00:00 2001 From: dgelessus Date: Sat, 23 Mar 2024 02:27:50 +0100 Subject: [PATCH 3/8] Add symbolic constant for number of wheels in plVehicleModifier --- core/PRP/Physics/plVehicleModifier.cpp | 10 +++++----- core/PRP/Physics/plVehicleModifier.h | 4 +++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/core/PRP/Physics/plVehicleModifier.cpp b/core/PRP/Physics/plVehicleModifier.cpp index dc05499cd..dd17cbc0b 100644 --- a/core/PRP/Physics/plVehicleModifier.cpp +++ b/core/PRP/Physics/plVehicleModifier.cpp @@ -21,7 +21,7 @@ void plVehicleModifier::read(hsStream* S, plResManager* mgr) plSingleModifier::read(S, mgr); fRoot = mgr->readKey(S); - for (size_t i=0; i<4; i++) { + for (size_t i=0; ireadKey(S); fWheels[i].fPosition.read(S); fWheels[i].fDirection.read(S); @@ -34,7 +34,7 @@ void plVehicleModifier::write(hsStream* S, plResManager* mgr) plSingleModifier::write(S, mgr); mgr->writeKey(S, fRoot); - for (size_t i=0; i<4; i++) { + for (size_t i=0; iwriteKey(S, fWheels[i].fWheelObj); fWheels[i].fPosition.write(S); fWheels[i].fDirection.write(S); @@ -51,7 +51,7 @@ void plVehicleModifier::IPrcWrite(pfPrcHelper* prc) prc->closeTag(); prc->writeSimpleTag("Wheels"); - for (size_t i=0; i<4; i++) { + for (size_t i=0; istartTag("Wheel"); prc->writeParam("Radius", fWheels[i].fRadius); prc->endTag(); @@ -72,10 +72,10 @@ void plVehicleModifier::IPrcParse(const pfPrcTag* tag, plResManager* mgr) if (tag->getName() == "Root") { fRoot = mgr->prcParseKey(tag->getFirstChild()); } else if (tag->getName() == "Wheels") { - if (tag->countChildren() != 4) + if (tag->countChildren() != kNumWheels) throw pfPrcParseException(__FILE__, __LINE__, "Wheels should contain 4 children"); const pfPrcTag* wheel = tag->getFirstChild(); - for (size_t i=0; i<4; i++) { + for (size_t i=0; igetName() != "Wheel") throw pfPrcTagException(__FILE__, __LINE__, wheel->getName()); fWheels[i].fRadius = wheel->getParam("Radius", "0").to_float(); diff --git a/core/PRP/Physics/plVehicleModifier.h b/core/PRP/Physics/plVehicleModifier.h index ad9742d2e..5b07a96f3 100644 --- a/core/PRP/Physics/plVehicleModifier.h +++ b/core/PRP/Physics/plVehicleModifier.h @@ -34,9 +34,11 @@ class HSPLASMA_EXPORT plVehicleModifier : public plSingleModifier Wheel() : fRadius(1.0f) { } }; + enum { kNumWheels = 4 }; + protected: plKey fRoot; - Wheel fWheels[4]; + Wheel fWheels[kNumWheels]; public: void read(hsStream* S, plResManager* mgr) HS_OVERRIDE; From 20015788a63af37bb577dd53244005f6ce403e40 Mon Sep 17 00:00:00 2001 From: dgelessus Date: Sat, 23 Mar 2024 19:06:16 +0100 Subject: [PATCH 4/8] Convert plMorphSpan::fUVWs from primitive array to std::vector --- core/PRP/Geometry/plMorphDelta.cpp | 22 ++++++---------------- core/PRP/Geometry/plMorphDelta.h | 5 ++--- 2 files changed, 8 insertions(+), 19 deletions(-) diff --git a/core/PRP/Geometry/plMorphDelta.cpp b/core/PRP/Geometry/plMorphDelta.cpp index ad5cd862d..1b8248044 100644 --- a/core/PRP/Geometry/plMorphDelta.cpp +++ b/core/PRP/Geometry/plMorphDelta.cpp @@ -75,24 +75,15 @@ void plVertDelta::prcParse(const pfPrcTag* tag) /* plMorphSpan */ -plMorphSpan::~plMorphSpan() -{ - delete[] fUVWs; -} - void plMorphSpan::read(hsStream* S) { fDeltas.resize(S->readInt()); fNumUVWChans = S->readInt(); - delete[] fUVWs; - if (fNumUVWChans > 0) - fUVWs = new hsVector3[fNumUVWChans * fDeltas.size()]; - else - fUVWs = nullptr; + fUVWs.resize(fNumUVWChans * fDeltas.size()); for (size_t i=0; istartTag("UVWs"); prc->writeParam("Channels", fNumUVWChans); prc->endTag(); - for (size_t i=0; i<(fDeltas.size() * fNumUVWChans); i++) + for (size_t i=0; icloseTag(); @@ -141,14 +132,13 @@ void plMorphSpan::prcParse(const pfPrcTag* tag) subchild = subchild->getNextSibling(); } } else if (child->getName() == "UVWs") { - delete[] fUVWs; fNumUVWChans = child->getParam("Channels", "0").to_uint(); size_t nUVWs = fDeltas.size() * fNumUVWChans; if (child->countChildren() != nUVWs) throw pfPrcParseException(__FILE__, __LINE__, "UVW count mismatch"); - fUVWs = new hsVector3[nUVWs]; + fUVWs.resize(nUVWs); const pfPrcTag* subchild = child->getFirstChild(); - for (size_t i=0; igetNextSibling(); } diff --git a/core/PRP/Geometry/plMorphDelta.h b/core/PRP/Geometry/plMorphDelta.h index 19b60aed2..4272a230d 100644 --- a/core/PRP/Geometry/plMorphDelta.h +++ b/core/PRP/Geometry/plMorphDelta.h @@ -39,11 +39,10 @@ class HSPLASMA_EXPORT plMorphSpan protected: std::vector fDeltas; unsigned short fNumUVWChans; - hsVector3* fUVWs; + std::vector fUVWs; public: - plMorphSpan() : fNumUVWChans(), fUVWs() { } - ~plMorphSpan(); + plMorphSpan() : fNumUVWChans() { } void read(hsStream* S); void write(hsStream* S); From c1ceef4e7bef8bfe9b191f719cc69b75eba05216 Mon Sep 17 00:00:00 2001 From: dgelessus Date: Sat, 23 Mar 2024 19:20:04 +0100 Subject: [PATCH 5/8] Convert plVertDelta and plMorphSpan to structs with public fields --- core/PRP/Geometry/plMorphDelta.h | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/core/PRP/Geometry/plMorphDelta.h b/core/PRP/Geometry/plMorphDelta.h index 4272a230d..b39437038 100644 --- a/core/PRP/Geometry/plMorphDelta.h +++ b/core/PRP/Geometry/plMorphDelta.h @@ -20,13 +20,11 @@ #include "PRP/plCreatable.h" #include "Math/hsGeometry3.h" -class HSPLASMA_EXPORT plVertDelta +struct HSPLASMA_EXPORT plVertDelta { -protected: unsigned short fIdx, fPadding; hsVector3 fPos, fNorm; -public: void read(hsStream* S); void write(hsStream* S); void prcWrite(pfPrcHelper* prc); @@ -34,14 +32,12 @@ class HSPLASMA_EXPORT plVertDelta }; -class HSPLASMA_EXPORT plMorphSpan +struct HSPLASMA_EXPORT plMorphSpan { -protected: std::vector fDeltas; unsigned short fNumUVWChans; std::vector fUVWs; -public: plMorphSpan() : fNumUVWChans() { } void read(hsStream* S); From b5b21711860dd5b5b87a1c33a0f6af5792359b2c Mon Sep 17 00:00:00 2001 From: dgelessus Date: Sat, 23 Mar 2024 19:55:57 +0100 Subject: [PATCH 6/8] Make plHardRegionPlanes::HardPlane a struct (it's all public anyway) --- core/PRP/Region/plHardRegionPlanes.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/PRP/Region/plHardRegionPlanes.h b/core/PRP/Region/plHardRegionPlanes.h index 4c36a28e0..b1b45763d 100644 --- a/core/PRP/Region/plHardRegionPlanes.h +++ b/core/PRP/Region/plHardRegionPlanes.h @@ -24,13 +24,11 @@ class HSPLASMA_EXPORT plHardRegionPlanes : public plHardRegion CREATABLE(plHardRegionPlanes, kHardRegionPlanes, plHardRegion) public: - class HSPLASMA_EXPORT HardPlane + struct HSPLASMA_EXPORT HardPlane { - public: hsVector3 fNorm, fWorldNorm; hsVector3 fPos, fWorldPos; - public: void read(hsStream* S); void write(hsStream* S); void prcWrite(pfPrcHelper* prc); From d42074acc3036057ed924875404f74cea7cdb8f3 Mon Sep 17 00:00:00 2001 From: dgelessus Date: Sat, 23 Mar 2024 21:50:35 +0100 Subject: [PATCH 7/8] Remove unused plRelevanceRegion fields that don't appear in the data --- core/PRP/Region/plRelevanceRegion.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/core/PRP/Region/plRelevanceRegion.h b/core/PRP/Region/plRelevanceRegion.h index 01bc26901..10ab67009 100644 --- a/core/PRP/Region/plRelevanceRegion.h +++ b/core/PRP/Region/plRelevanceRegion.h @@ -26,12 +26,8 @@ class HSPLASMA_EXPORT plRelevanceRegion : public plObjInterface protected: plKey fRegion; - hsBitVector fRegionsICareAbout; - unsigned int fMgrIdx; public: - plRelevanceRegion() : fMgrIdx((unsigned int)-1) { } - void read(hsStream* S, plResManager* mgr) HS_OVERRIDE; void write(hsStream* S, plResManager* mgr) HS_OVERRIDE; From 8ae6575d2c46c1956c2f035cad358d2485c20f9f Mon Sep 17 00:00:00 2001 From: dgelessus Date: Sat, 23 Mar 2024 00:08:31 +0100 Subject: [PATCH 8/8] Add missing public getters and setters to various classes --- core/PRP/Audio/plEAXListenerMod.h | 9 ++++++ core/PRP/Avatar/plArmatureEffects.h | 8 ++++++ core/PRP/Avatar/plArmatureMod.h | 36 ++++++++++++++++++++++++ core/PRP/Avatar/plAvatarClothing.h | 20 +++++++++++++ core/PRP/Geometry/plMorphArray.h | 3 ++ core/PRP/Geometry/plMorphDataSet.h | 4 +++ core/PRP/Geometry/plMorphDelta.h | 7 +++++ core/PRP/Geometry/plMorphSequence.h | 6 ++++ core/PRP/Modifier/plAnimEventModifier.h | 6 ++++ core/PRP/Modifier/plGameMarkerModifier.h | 15 ++++++++++ core/PRP/Modifier/plRandomSoundMod.h | 3 ++ core/PRP/Object/plDrawInterface.h | 7 +++++ core/PRP/Physics/plVehicleModifier.h | 7 +++++ core/PRP/Region/plHardRegion.h | 4 +++ core/PRP/Region/plHardRegionPlanes.h | 4 +++ core/PRP/Region/plRelevanceRegion.h | 5 ++++ 16 files changed, 144 insertions(+) diff --git a/core/PRP/Audio/plEAXListenerMod.h b/core/PRP/Audio/plEAXListenerMod.h index 49851db46..6c5ff478f 100644 --- a/core/PRP/Audio/plEAXListenerMod.h +++ b/core/PRP/Audio/plEAXListenerMod.h @@ -75,6 +75,15 @@ class HSPLASMA_EXPORT plEAXReverbEffect : public plEAXEffect protected: void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; + +public: + plKey getSoftRegion() const { return fSoftRegion; } + const EAXREVERBPROPERTIES& getListenerProps() const { return fListenerProps; } + EAXREVERBPROPERTIES& getListenerProps() { return fListenerProps; } + const std::vector& getApertures() const { return fApertures; } + std::vector& getApertures() { return fApertures; } + + void setSoftRegion(plKey region) { fSoftRegion = std::move(region); } }; #endif diff --git a/core/PRP/Avatar/plArmatureEffects.h b/core/PRP/Avatar/plArmatureEffects.h index 40189bb69..57298a78c 100644 --- a/core/PRP/Avatar/plArmatureEffects.h +++ b/core/PRP/Avatar/plArmatureEffects.h @@ -39,6 +39,10 @@ class HSPLASMA_EXPORT plArmatureEffectFootSound : public plArmatureEffect protected: void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; + +public: + const std::vector& getMods() const { return fMods; } + std::vector& getMods() { return fMods; } }; @@ -67,6 +71,10 @@ class HSPLASMA_EXPORT plArmatureEffectsMgr : public hsKeyedObject protected: void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; + +public: + const std::vector& getEffects() const { return fEffects; } + std::vector& getEffects() { return fEffects; } }; #endif diff --git a/core/PRP/Avatar/plArmatureMod.h b/core/PRP/Avatar/plArmatureMod.h index 97a5def3e..60701c4f2 100644 --- a/core/PRP/Avatar/plArmatureMod.h +++ b/core/PRP/Avatar/plArmatureMod.h @@ -43,7 +43,16 @@ class HSPLASMA_EXPORT plArmatureModBase : public plAGMasterMod void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; public: + const std::vector& getMeshes() const { return fMeshKeys; } + std::vector& getMeshes() { return fMeshKeys; } + const std::vector>& getUnusedBones() const { return fUnusedBones; } + std::vector>& getUnusedBones() { return fUnusedBones; } + const std::vector& getBrains() const { return fBrains; } + std::vector& getBrains() { return fBrains; } + plKey getDetector() const { return fDetector; } + void clearBrains(); + void setDetector(plKey detector) { fDetector = std::move(detector); } }; @@ -79,6 +88,33 @@ class HSPLASMA_EXPORT plArmatureMod : public plArmatureModBase protected: void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; + +public: + plKey getDefaultMesh() const { return fDefaultMesh; } + ST::string getRootName() const { return fRootName; } + plKey getClothingOutfit() const { return fClothingOutfit; } + int getBodyType() const { return fBodyType; } + plKey getEffects() const { return fEffects; } + hsVector3 getMins() const { return fMins; } + hsVector3 getMaxs() const { return fMaxs; } + float getPhysHeight() const { return fPhysHeight; } + float getPhysWidth() const { return fPhysWidth; } + ST::string getFootstepAge() const { return fFootstepAge; } + ST::string getFootstepPage() const { return fFootstepPage; } + ST::string getFootstepType() const { return fFootstepType; } + + void setDefaultMesh(plKey defaultMesh) { fDefaultMesh = std::move(defaultMesh); } + void setRootName(ST::string rootName) { fRootName = std::move(rootName); } + void setClothingOutfit(plKey clothingOutfit) { fClothingOutfit = std::move(clothingOutfit); } + void setBodyType(int bodyType) { fBodyType = bodyType; } + void setEffects(plKey effects) { fEffects = std::move(effects); } + void setMins(hsVector3 mins) { fMins = mins; } + void setMaxs(hsVector3 maxs) { fMaxs = maxs; } + void setPhysHeight(float physHeight) { fPhysHeight = physHeight; } + void setPhysWidth(float physWidth) { fPhysWidth = physWidth; } + void setFootstepAge(ST::string footstepAge) { fFootstepAge = std::move(footstepAge); } + void setFootstepPage(ST::string footstepPage) { fFootstepPage = std::move(footstepPage); } + void setFootstepType(ST::string footstepType) { fFootstepType = std::move(footstepType); } }; diff --git a/core/PRP/Avatar/plAvatarClothing.h b/core/PRP/Avatar/plAvatarClothing.h index 5beec5fef..c162e91dd 100644 --- a/core/PRP/Avatar/plAvatarClothing.h +++ b/core/PRP/Avatar/plAvatarClothing.h @@ -53,6 +53,17 @@ class HSPLASMA_EXPORT plClothingOutfit : public plSynchedObject protected: void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; + +public: + unsigned char getGroup() const { return fGroup; } + plKey getBase() const { return fBase; } + plKey getTargetTexture() const { return fTargetTexture; } + plKey getMaterial() const { return fMaterial; } + + void setGroup(unsigned char group) { fGroup = group; } + void setBase(plKey base) { fBase = std::move(base); } + void setTargetTexture(plKey targetTexture) { fTargetTexture = std::move(targetTexture); } + void setMaterial(plKey material) { fMaterial = std::move(material); } }; @@ -71,6 +82,15 @@ class HSPLASMA_EXPORT plClothingBase : public hsKeyedObject protected: void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; + +public: + ST::string getName() const { return fName; } + ST::string getLayoutName() const { return fLayoutName; } + plKey getBaseTexture() const { return fBaseTexture; } + + void setName(ST::string name) { fName = std::move(name); } + void setLayoutName(ST::string layoutName) { fLayoutName = std::move(layoutName); } + void setBaseTexture(plKey baseTexture) { fBaseTexture = std::move(baseTexture); } }; #endif diff --git a/core/PRP/Geometry/plMorphArray.h b/core/PRP/Geometry/plMorphArray.h index bf0633a13..1b8bde53f 100644 --- a/core/PRP/Geometry/plMorphArray.h +++ b/core/PRP/Geometry/plMorphArray.h @@ -29,6 +29,9 @@ class HSPLASMA_EXPORT plMorphArray void write(hsStream* S, plResManager* mgr); void prcWrite(pfPrcHelper* prc); void prcParse(const pfPrcTag* tag, plResManager* mgr); + + const std::vector& getDeltas() const { return fDeltas; } + std::vector& getDeltas() { return fDeltas; } }; #endif diff --git a/core/PRP/Geometry/plMorphDataSet.h b/core/PRP/Geometry/plMorphDataSet.h index 028bcd9e3..ddd1a6ab6 100644 --- a/core/PRP/Geometry/plMorphDataSet.h +++ b/core/PRP/Geometry/plMorphDataSet.h @@ -34,6 +34,10 @@ class HSPLASMA_EXPORT plMorphDataSet : public hsKeyedObject protected: void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; + +public: + const std::vector& getMorphs() const { return fMorphs; } + std::vector& getMorphs() { return fMorphs; } }; #endif diff --git a/core/PRP/Geometry/plMorphDelta.h b/core/PRP/Geometry/plMorphDelta.h index b39437038..cfd1b79c7 100644 --- a/core/PRP/Geometry/plMorphDelta.h +++ b/core/PRP/Geometry/plMorphDelta.h @@ -64,6 +64,13 @@ class HSPLASMA_EXPORT plMorphDelta : public plCreatable protected: void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; + +public: + const std::vector& getSpans() const { return fSpans; } + std::vector& getSpans() { return fSpans; } + float getWeight() const { return fWeight; } + + void setWeight(float weight) { fWeight = weight; } }; #endif diff --git a/core/PRP/Geometry/plMorphSequence.h b/core/PRP/Geometry/plMorphSequence.h index 11d3c06d6..f41be6487 100644 --- a/core/PRP/Geometry/plMorphSequence.h +++ b/core/PRP/Geometry/plMorphSequence.h @@ -36,6 +36,12 @@ class HSPLASMA_EXPORT plMorphSequence : public plSingleModifier protected: void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; + +public: + const std::vector& getMorphs() const { return fMorphs; } + std::vector& getMorphs() { return fMorphs; } + const std::vector& getSharedMeshes() const { return fSharedMeshes; } + std::vector& getSharedMeshes() { return fSharedMeshes; } }; #endif diff --git a/core/PRP/Modifier/plAnimEventModifier.h b/core/PRP/Modifier/plAnimEventModifier.h index 6beef3b1c..f0948cb06 100644 --- a/core/PRP/Modifier/plAnimEventModifier.h +++ b/core/PRP/Modifier/plAnimEventModifier.h @@ -41,7 +41,13 @@ class HSPLASMA_EXPORT plAnimEventModifier : public plSingleModifier void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; public: + const std::vector& getReceivers() const { return fReceivers; } + std::vector& getReceivers() { return fReceivers; } + plMessage* getCallback() const { return fCallback; } + bool isDisabled() const { return fDisabled; } + void setCallback(plMessage* callback); + void setDisabled(bool disabled) { fDisabled = disabled; } }; #endif diff --git a/core/PRP/Modifier/plGameMarkerModifier.h b/core/PRP/Modifier/plGameMarkerModifier.h index cb16c9421..44aa3f310 100644 --- a/core/PRP/Modifier/plGameMarkerModifier.h +++ b/core/PRP/Modifier/plGameMarkerModifier.h @@ -36,6 +36,21 @@ class HSPLASMA_EXPORT plGameMarkerModifier : public plSingleModifier protected: void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; + +public: + plKey getGreenAnimKey() const { return fGreenAnimKey; } + plKey getRedAnimKey() const { return fRedAnimKey; } + plKey getOpenAnimKey() const { return fOpenAnimKey; } + plKey getBounceAnimKey() const { return fBounceAnimKey; } + unsigned short getPlaceSoundIdx() const { return fPlaceSoundIdx; } + unsigned short getHitSoundIdx() const { return fHitSoundIdx; } + + void setGreenAnimKey(plKey greenAnimKey) { fGreenAnimKey = std::move(greenAnimKey); } + void setRedAnimKey(plKey redAnimKey) { fRedAnimKey = std::move(redAnimKey); } + void setOpenAnimKey(plKey openAnimKey) { fOpenAnimKey = std::move(openAnimKey); } + void setBounceAnimKey(plKey bounceAnimKey) { fBounceAnimKey = std::move(bounceAnimKey); } + void setPlaceSoundIdx(unsigned short placeSoundIdx) { fPlaceSoundIdx = placeSoundIdx; } + void setHitSoundIdx(unsigned short hitSoundIdx) { fHitSoundIdx = hitSoundIdx; } }; #endif diff --git a/core/PRP/Modifier/plRandomSoundMod.h b/core/PRP/Modifier/plRandomSoundMod.h index 4fedaf7cf..4555df3d0 100644 --- a/core/PRP/Modifier/plRandomSoundMod.h +++ b/core/PRP/Modifier/plRandomSoundMod.h @@ -38,6 +38,9 @@ class HSPLASMA_EXPORT plRandomSoundModGroup void addIndex(unsigned short index) { fIndices.push_back(index); } void delIndex(size_t idx) { fIndices.erase(fIndices.begin() + idx); } void clearIndices() { fIndices.clear(); } + + short getGroupedIdx() const { return fGroupedIdx; } + void setGroupedIdx(short groupedIdx) { fGroupedIdx = groupedIdx; } }; diff --git a/core/PRP/Object/plDrawInterface.h b/core/PRP/Object/plDrawInterface.h index a537208e2..640085f72 100644 --- a/core/PRP/Object/plDrawInterface.h +++ b/core/PRP/Object/plDrawInterface.h @@ -70,6 +70,13 @@ class HSPLASMA_EXPORT plInstanceDrawInterface : public plDrawInterface protected: void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; + +public: + unsigned int getTargetID() const { return fTargetID; } + plKey getDrawable() const { return fDrawable; } + + void setTargetID(unsigned int targetID) { fTargetID = targetID; } + void setDrawable(plKey drawable) { fDrawable = std::move(drawable); } }; #endif diff --git a/core/PRP/Physics/plVehicleModifier.h b/core/PRP/Physics/plVehicleModifier.h index 5b07a96f3..a83323dab 100644 --- a/core/PRP/Physics/plVehicleModifier.h +++ b/core/PRP/Physics/plVehicleModifier.h @@ -47,6 +47,13 @@ class HSPLASMA_EXPORT plVehicleModifier : public plSingleModifier protected: void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; + +public: + plKey getRoot() const { return fRoot; } + const Wheel& getWheel(size_t idx) const { return fWheels[idx]; } + Wheel& getWheel(size_t idx) { return fWheels[idx]; } + + void setRoot(plKey root) { fRoot = std::move(root); } }; #endif diff --git a/core/PRP/Region/plHardRegion.h b/core/PRP/Region/plHardRegion.h index db7d5fb69..0d8a027ed 100644 --- a/core/PRP/Region/plHardRegion.h +++ b/core/PRP/Region/plHardRegion.h @@ -39,6 +39,10 @@ class HSPLASMA_EXPORT plHardRegionComplex : public plHardRegion protected: void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; + +public: + const std::vector& getSubRegions() const { return fSubRegions; } + std::vector& getSubRegions() { return fSubRegions; } }; diff --git a/core/PRP/Region/plHardRegionPlanes.h b/core/PRP/Region/plHardRegionPlanes.h index b1b45763d..a06c63d58 100644 --- a/core/PRP/Region/plHardRegionPlanes.h +++ b/core/PRP/Region/plHardRegionPlanes.h @@ -47,6 +47,10 @@ class HSPLASMA_EXPORT plHardRegionPlanes : public plHardRegion protected: void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; + +public: + const std::vector& getPlanes() const { return fPlanes; } + std::vector& getPlanes() { return fPlanes; } }; #endif diff --git a/core/PRP/Region/plRelevanceRegion.h b/core/PRP/Region/plRelevanceRegion.h index 10ab67009..bc92d9ae8 100644 --- a/core/PRP/Region/plRelevanceRegion.h +++ b/core/PRP/Region/plRelevanceRegion.h @@ -34,6 +34,11 @@ class HSPLASMA_EXPORT plRelevanceRegion : public plObjInterface protected: void IPrcWrite(pfPrcHelper* prc) HS_OVERRIDE; void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE; + +public: + plKey getRegion() const { return fRegion; } + + void setRegion(plKey region) { fRegion = std::move(region); } }; #endif