mirror of
https://github.com/AxioDL/PrimeWorldEditor.git
synced 2025-07-03 03:36:10 +00:00
CScriptNode: Make use of size_t where applicable
This commit is contained in:
parent
8fbc92b0e0
commit
a48d3202b6
@ -72,8 +72,8 @@ public:
|
|||||||
CTexture* ActiveBillboard() const;
|
CTexture* ActiveBillboard() const;
|
||||||
bool UsesModel() const;
|
bool UsesModel() const;
|
||||||
|
|
||||||
uint32 NumAttachments() const { return mAttachments.size(); }
|
size_t NumAttachments() const { return mAttachments.size(); }
|
||||||
CScriptAttachNode* Attachment(uint32 Index) const { return mAttachments[Index]; }
|
CScriptAttachNode* Attachment(size_t Index) const { return mAttachments[Index]; }
|
||||||
CResource* DisplayAsset() const { return mpDisplayAsset; }
|
CResource* DisplayAsset() const { return mpDisplayAsset; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
@ -4,7 +4,7 @@ CSandwormExtra::CSandwormExtra(CScriptObject* pInstance, CScene* pScene, CScript
|
|||||||
: CScriptExtra(pInstance, pScene, pParent)
|
: CScriptExtra(pInstance, pScene, pParent)
|
||||||
{
|
{
|
||||||
// The back pincers need to be flipped 180 degrees
|
// The back pincers need to be flipped 180 degrees
|
||||||
for (uint32 AttachIdx = 0; AttachIdx < pParent->NumAttachments(); AttachIdx++)
|
for (size_t AttachIdx = 0; AttachIdx < pParent->NumAttachments(); AttachIdx++)
|
||||||
{
|
{
|
||||||
CScriptAttachNode *pAttach = pParent->Attachment(AttachIdx);
|
CScriptAttachNode *pAttach = pParent->Attachment(AttachIdx);
|
||||||
|
|
||||||
@ -14,17 +14,18 @@ CSandwormExtra::CSandwormExtra(CScriptObject* pInstance, CScene* pScene, CScript
|
|||||||
|
|
||||||
// Get pincers scale
|
// Get pincers scale
|
||||||
mPincersScale = CFloatRef(pInstance->PropertyData(), pInstance->Template()->Properties()->ChildByID(0x3DB583AE));
|
mPincersScale = CFloatRef(pInstance->PropertyData(), pInstance->Template()->Properties()->ChildByID(0x3DB583AE));
|
||||||
if (mPincersScale.IsValid()) PropertyModified(mPincersScale.Property());
|
if (mPincersScale.IsValid())
|
||||||
|
PropertyModified(mPincersScale.Property());
|
||||||
}
|
}
|
||||||
|
|
||||||
void CSandwormExtra::PropertyModified(IProperty* pProp)
|
void CSandwormExtra::PropertyModified(IProperty* pProp)
|
||||||
{
|
{
|
||||||
if (pProp == mPincersScale)
|
if (pProp == mPincersScale)
|
||||||
{
|
{
|
||||||
for (uint32 AttachIdx = 0; AttachIdx < mpScriptNode->NumAttachments(); AttachIdx++)
|
for (size_t AttachIdx = 0; AttachIdx < mpScriptNode->NumAttachments(); AttachIdx++)
|
||||||
{
|
{
|
||||||
CScriptAttachNode* pAttach = mpScriptNode->Attachment(AttachIdx);
|
CScriptAttachNode* pAttach = mpScriptNode->Attachment(AttachIdx);
|
||||||
pAttach->SetScale( CVector3f(mPincersScale) );
|
pAttach->SetScale(CVector3f(mPincersScale));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user