diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp index 603f793b..c8301139 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp @@ -1045,10 +1045,10 @@ void plDrawableSpans::Read( hsStream* s, hsResMgr* mgr ) /// Read in the matrix palette (if any) count = s->ReadLE32(); - fLocalToWorlds.SetCount(count); - fWorldToLocals.SetCount(count); - fLocalToBones.SetCount(count); - fBoneToLocals.SetCount(count); + fLocalToWorlds.resize(count); + fWorldToLocals.resize(count); + fLocalToBones.resize(count); + fBoneToLocals.resize(count); for( i = 0; i < count; i++ ) { fLocalToWorlds[i].Read(s); @@ -2209,16 +2209,12 @@ uint32_t plDrawableSpans::AppendDIMatrixSpans(int n) if( fNeedCleanup ) IRemoveGarbage(); - uint32_t baseIdx = fLocalToWorlds.GetCount(); - fLocalToWorlds.Expand(baseIdx + n); - fLocalToWorlds.SetCount(baseIdx + n); - fWorldToLocals.Expand(baseIdx + n); - fWorldToLocals.SetCount(baseIdx + n); + uint32_t baseIdx = fLocalToWorlds.size(); + fLocalToWorlds.resize(baseIdx + n); + fWorldToLocals.resize(baseIdx + n); - fLocalToBones.Expand(baseIdx + n); - fLocalToBones.SetCount(baseIdx + n); - fBoneToLocals.Expand(baseIdx + n); - fBoneToLocals.SetCount(baseIdx + n); + fLocalToBones.resize(baseIdx + n); + fBoneToLocals.resize(baseIdx + n); int i; for( i = baseIdx; i < baseIdx + n; i++ ) @@ -2267,7 +2263,7 @@ uint32_t plDrawableSpans::FindBoneBaseMatrix(const hsTArray& initL2B // runtime, a sharable bone pallete won't be found by scanning fSpans. // We have to do a larger search through all bone matrices. int i; - for( i = 0; i + initL2B.GetCount() < fLocalToBones.GetCount(); i++ ) + for( i = 0; i + initL2B.GetCount() < fLocalToBones.size(); i++ ) { int j; for( j = 0; j < initL2B.GetCount(); j++ ) @@ -2894,7 +2890,7 @@ void plDrawableSpans::ICleanupMatrices() } } - for( j = 0; j < fLocalToWorlds.GetCount(); j++ ) + for( j = 0; j < fLocalToWorlds.size(); j++ ) { if( !usedMatrices.IsBitSet(j) ) { @@ -2910,7 +2906,7 @@ void plDrawableSpans::ICleanupMatrices() } } } - for( i = j+1; i < fLocalToWorlds.GetCount(); i++ ) + for( i = j+1; i < fLocalToWorlds.size(); i++ ) { fLocalToWorlds[i] = fLocalToWorlds[i-1]; fWorldToLocals[i] = fWorldToLocals[i-1]; diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.h b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.h index 58c054b2..3c1d12d7 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.h +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.h @@ -70,6 +70,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsBounds.h" #include "hsMatrix44.h" #include "plSpanTypes.h" +#include class plPipeline; class plMessage; @@ -131,11 +132,11 @@ class plDrawableSpans : public plDrawable hsMatrix44 fLocalToWorld; hsMatrix44 fWorldToLocal; - hsTArray fLocalToWorlds; - hsTArray fWorldToLocals; + std::vector fLocalToWorlds; + std::vector fWorldToLocals; - hsTArray fLocalToBones; - hsTArray fBoneToLocals; + std::vector fLocalToBones; + std::vector fBoneToLocals; hsTArray fMaterials; @@ -283,7 +284,7 @@ class plDrawableSpans : public plDrawable virtual uint32_t GetNumSpans( void ) const { return fSpans.GetCount(); } virtual const hsTArray &GetSpanArray( void ) const { return fSpans; } - hsMatrix44* GetMatrixPalette(int baseMatrix) const { return &fLocalToWorlds[baseMatrix]; } + hsMatrix44* GetMatrixPalette(int baseMatrix) const { return const_cast(&fLocalToWorlds[baseMatrix]); } const hsMatrix44& GetPaletteMatrix(int i) const { return fLocalToWorlds[i]; } void SetInitialBone(int i, const hsMatrix44& l2b, const hsMatrix44& b2l); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpansExport.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpansExport.cpp index 27078fb9..0abb0d8f 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpansExport.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpansExport.cpp @@ -163,7 +163,7 @@ void plDrawableSpans::Write( hsStream* s, hsResMgr* mgr ) fSourceSpans[ i ]->Write( s ); } - count = fLocalToWorlds.GetCount(); + count = fLocalToWorlds.size(); s->WriteLE32(count); for( i = 0; i < count; i++ ) {