Skip to content
Merged
8 changes: 4 additions & 4 deletions Python/PRP/Avatar/pyClothingItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -45,10 +45,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;
}
Expand Down
9 changes: 9 additions & 0 deletions core/PRP/Audio/plEAXListenerMod.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<Aperture>& getApertures() const { return fApertures; }
std::vector<Aperture>& getApertures() { return fApertures; }

void setSoftRegion(plKey region) { fSoftRegion = std::move(region); }
};

#endif
8 changes: 8 additions & 0 deletions core/PRP/Avatar/plArmatureEffects.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<plKey>& getMods() const { return fMods; }
std::vector<plKey>& getMods() { return fMods; }
};


Expand Down Expand Up @@ -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<plKey>& getEffects() const { return fEffects; }
std::vector<plKey>& getEffects() { return fEffects; }
};

#endif
36 changes: 36 additions & 0 deletions core/PRP/Avatar/plArmatureMod.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,16 @@ class HSPLASMA_EXPORT plArmatureModBase : public plAGMasterMod
void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE;

public:
const std::vector<plKey>& getMeshes() const { return fMeshKeys; }
std::vector<plKey>& getMeshes() { return fMeshKeys; }
const std::vector<std::vector<plKey>>& getUnusedBones() const { return fUnusedBones; }
std::vector<std::vector<plKey>>& getUnusedBones() { return fUnusedBones; }
const std::vector<plArmatureBrain*>& getBrains() const { return fBrains; }
std::vector<plArmatureBrain*>& getBrains() { return fBrains; }
plKey getDetector() const { return fDetector; }

void clearBrains();
void setDetector(plKey detector) { fDetector = std::move(detector); }
};


Expand Down Expand Up @@ -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; }
const 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; }
const ST::string& getFootstepAge() const { return fFootstepAge; }
const ST::string& getFootstepPage() const { return fFootstepPage; }
const 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); }
};


Expand Down
20 changes: 20 additions & 0 deletions core/PRP/Avatar/plAvatarClothing.h
Original file line number Diff line number Diff line change
Expand Up @@ -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); }
};


Expand All @@ -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:
const ST::string& getName() const { return fName; }
const 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
2 changes: 1 addition & 1 deletion core/PRP/Avatar/plClothingItem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
14 changes: 7 additions & 7 deletions core/PRP/Avatar/plClothingItem.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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);
Expand All @@ -206,15 +206,15 @@ 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);
}

/**
* 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;
}
Expand All @@ -224,21 +224,21 @@ 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];
}

/**
* 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
3 changes: 3 additions & 0 deletions core/PRP/Geometry/plMorphArray.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<plMorphDelta>& getDeltas() const { return fDeltas; }
std::vector<plMorphDelta>& getDeltas() { return fDeltas; }
};

#endif
4 changes: 4 additions & 0 deletions core/PRP/Geometry/plMorphDataSet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<plMorphArray>& getMorphs() const { return fMorphs; }
std::vector<plMorphArray>& getMorphs() { return fMorphs; }
};

#endif
22 changes: 6 additions & 16 deletions core/PRP/Geometry/plMorphDelta.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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; i<fDeltas.size(); i++)
fDeltas[i].read(S);
for (size_t i=0; i<(fDeltas.size() * fNumUVWChans); i++)
for (size_t i=0; i<fUVWs.size(); i++)
fUVWs[i].read(S);
}

Expand All @@ -103,7 +94,7 @@ void plMorphSpan::write(hsStream* S)

for (size_t i=0; i<fDeltas.size(); i++)
fDeltas[i].write(S);
for (size_t i=0; i<(fDeltas.size() * fNumUVWChans); i++)
for (size_t i=0; i<fUVWs.size(); i++)
fUVWs[i].write(S);
}

Expand All @@ -119,7 +110,7 @@ void plMorphSpan::prcWrite(pfPrcHelper* prc)
prc->startTag("UVWs");
prc->writeParam("Channels", fNumUVWChans);
prc->endTag();
for (size_t i=0; i<(fDeltas.size() * fNumUVWChans); i++)
for (size_t i=0; i<fUVWs.size(); i++)
fUVWs[i].prcWrite(prc);
prc->closeTag();

Expand All @@ -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; i<nUVWs; i++) {
for (size_t i=0; i<fUVWs.size(); i++) {
fUVWs[i].prcParse(subchild);
subchild = subchild->getNextSibling();
}
Expand Down
20 changes: 11 additions & 9 deletions core/PRP/Geometry/plMorphDelta.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,30 +20,25 @@
#include "PRP/plCreatable.h"
#include "Math/hsGeometry3.h"

class HSPLASMA_EXPORT plVertDelta
struct HSPLASMA_EXPORT plVertDelta
Comment thread
zrax marked this conversation as resolved.
{
protected:
unsigned short fIdx, fPadding;
hsVector3 fPos, fNorm;

public:
void read(hsStream* S);
void write(hsStream* S);
void prcWrite(pfPrcHelper* prc);
void prcParse(const pfPrcTag* tag);
};


class HSPLASMA_EXPORT plMorphSpan
struct HSPLASMA_EXPORT plMorphSpan
{
protected:
std::vector<plVertDelta> fDeltas;
unsigned short fNumUVWChans;
hsVector3* fUVWs;
std::vector<hsVector3> fUVWs;

public:
plMorphSpan() : fNumUVWChans(), fUVWs() { }
~plMorphSpan();
plMorphSpan() : fNumUVWChans() { }

void read(hsStream* S);
void write(hsStream* S);
Expand All @@ -69,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<plMorphSpan>& getSpans() const { return fSpans; }
std::vector<plMorphSpan>& getSpans() { return fSpans; }
float getWeight() const { return fWeight; }

void setWeight(float weight) { fWeight = weight; }
};

#endif
6 changes: 6 additions & 0 deletions core/PRP/Geometry/plMorphSequence.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<plMorphArray>& getMorphs() const { return fMorphs; }
std::vector<plMorphArray>& getMorphs() { return fMorphs; }
const std::vector<plKey>& getSharedMeshes() const { return fSharedMeshes; }
std::vector<plKey>& getSharedMeshes() { return fSharedMeshes; }
};

#endif
6 changes: 6 additions & 0 deletions core/PRP/Modifier/plAnimEventModifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,13 @@ class HSPLASMA_EXPORT plAnimEventModifier : public plSingleModifier
void IPrcParse(const pfPrcTag* tag, plResManager* mgr) HS_OVERRIDE;

public:
const std::vector<plKey>& getReceivers() const { return fReceivers; }
std::vector<plKey>& getReceivers() { return fReceivers; }
plMessage* getCallback() const { return fCallback; }
bool isDisabled() const { return fDisabled; }

void setCallback(plMessage* callback);
void setDisabled(bool disabled) { fDisabled = disabled; }
};

#endif
15 changes: 15 additions & 0 deletions core/PRP/Modifier/plGameMarkerModifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Loading
Loading