diff --git a/Engine/source/T3D/accumulationVolume.cpp b/Engine/source/T3D/accumulationVolume.cpp index 2d44d7178..4c2e8b009 100644 --- a/Engine/source/T3D/accumulationVolume.cpp +++ b/Engine/source/T3D/accumulationVolume.cpp @@ -206,11 +206,11 @@ void AccumulationVolume::buildSilhouette( const SceneCameraState& cameraState, V if( mTransformDirty ) { - const U32 numPoints = mPolyhedron.getNumPoints(); + const U32 numPolyPoints = mPolyhedron.getNumPoints(); const PolyhedronType::PointType* points = getPolyhedron().getPoints(); - mWSPoints.setSize( numPoints ); - for( U32 i = 0; i < numPoints; ++ i ) + mWSPoints.setSize(numPolyPoints); + for( U32 i = 0; i < numPolyPoints; ++ i ) { Point3F p = points[ i ]; p.convolve( getScale() ); diff --git a/Engine/source/T3D/components/animation/animationComponent.cpp b/Engine/source/T3D/components/animation/animationComponent.cpp index 42871259d..cb7808b8b 100644 --- a/Engine/source/T3D/components/animation/animationComponent.cpp +++ b/Engine/source/T3D/components/animation/animationComponent.cpp @@ -645,12 +645,12 @@ void AnimationComponent::advanceThreads(F32 dt) if (mOwnerShapeInstance && !isClientObject()) { - for (U32 i = 1; i < 32; i++) + for (U32 stateIDx = 1; stateIDx < 32; stateIDx++) { - if (mOwnerShapeInstance->getTriggerState(i)) + if (mOwnerShapeInstance->getTriggerState(stateIDx)) { const char* animName = st.thread->getSequenceName().c_str(); - onAnimationTrigger_callback(this, animName, i); + onAnimationTrigger_callback(this, animName, stateIDx); } } } diff --git a/Engine/source/T3D/components/collision/collisionTrigger.cpp b/Engine/source/T3D/components/collision/collisionTrigger.cpp index 7d1f50706..efac30b55 100644 --- a/Engine/source/T3D/components/collision/collisionTrigger.cpp +++ b/Engine/source/T3D/components/collision/collisionTrigger.cpp @@ -357,12 +357,12 @@ void CollisionTrigger::setTriggerPolyhedron(const Polyhedron& rPolyhedron) { mCollisionTriggerPolyhedron = rPolyhedron; - if (mCollisionTriggerPolyhedron.pointList.size() != 0) { + if (mCollisionTriggerPolyhedron.mPointList.size() != 0) { mObjBox.minExtents.set(1e10, 1e10, 1e10); mObjBox.maxExtents.set(-1e10, -1e10, -1e10); - for (U32 i = 0; i < mCollisionTriggerPolyhedron.pointList.size(); i++) { - mObjBox.minExtents.setMin(mCollisionTriggerPolyhedron.pointList[i]); - mObjBox.maxExtents.setMax(mCollisionTriggerPolyhedron.pointList[i]); + for (U32 i = 0; i < mCollisionTriggerPolyhedron.mPointList.size(); i++) { + mObjBox.minExtents.setMin(mCollisionTriggerPolyhedron.mPointList[i]); + mObjBox.maxExtents.setMax(mCollisionTriggerPolyhedron.mPointList[i]); } } else { @@ -374,7 +374,7 @@ void CollisionTrigger::setTriggerPolyhedron(const Polyhedron& rPolyhedron) setTransform(xform); mClippedList.clear(); - mClippedList.mPlaneList = mCollisionTriggerPolyhedron.planeList; + mClippedList.mPlaneList = mCollisionTriggerPolyhedron.mPlaneList; // for (U32 i = 0; i < mClippedList.mPlaneList.size(); i++) // mClippedList.mPlaneList[i].neg(); @@ -412,7 +412,7 @@ void CollisionTrigger::setTriggerPolyhedron(const Polyhedron& rPolyhedron) bool CollisionTrigger::testObject(GameBase* enter) { - if (mCollisionTriggerPolyhedron.pointList.size() == 0) + if (mCollisionTriggerPolyhedron.mPointList.size() == 0) return false; mClippedList.clear(); @@ -507,17 +507,17 @@ U32 CollisionTrigger::packUpdate(NetConnection* con, U32 mask, BitStream* stream // Write the polyhedron if (stream->writeFlag(mask & PolyMask)) { - stream->write(mCollisionTriggerPolyhedron.pointList.size()); - for (i = 0; i < mCollisionTriggerPolyhedron.pointList.size(); i++) - mathWrite(*stream, mCollisionTriggerPolyhedron.pointList[i]); + stream->write(mCollisionTriggerPolyhedron.mPointList.size()); + for (i = 0; i < mCollisionTriggerPolyhedron.mPointList.size(); i++) + mathWrite(*stream, mCollisionTriggerPolyhedron.mPointList[i]); - stream->write(mCollisionTriggerPolyhedron.planeList.size()); - for (i = 0; i < mCollisionTriggerPolyhedron.planeList.size(); i++) - mathWrite(*stream, mCollisionTriggerPolyhedron.planeList[i]); + stream->write(mCollisionTriggerPolyhedron.mPlaneList.size()); + for (i = 0; i < mCollisionTriggerPolyhedron.mPlaneList.size(); i++) + mathWrite(*stream, mCollisionTriggerPolyhedron.mPlaneList[i]); - stream->write(mCollisionTriggerPolyhedron.edgeList.size()); - for (i = 0; i < mCollisionTriggerPolyhedron.edgeList.size(); i++) { - const Polyhedron::Edge& rEdge = mCollisionTriggerPolyhedron.edgeList[i]; + stream->write(mCollisionTriggerPolyhedron.mEdgeList.size()); + for (i = 0; i < mCollisionTriggerPolyhedron.mEdgeList.size(); i++) { + const Polyhedron::Edge& rEdge = mCollisionTriggerPolyhedron.mEdgeList[i]; stream->write(rEdge.face[0]); stream->write(rEdge.face[1]); @@ -555,19 +555,19 @@ void CollisionTrigger::unpackUpdate(NetConnection* con, BitStream* stream) { Polyhedron tempPH; stream->read(&size); - tempPH.pointList.setSize(size); - for (i = 0; i < tempPH.pointList.size(); i++) - mathRead(*stream, &tempPH.pointList[i]); + tempPH.mPointList.setSize(size); + for (i = 0; i < tempPH.mPointList.size(); i++) + mathRead(*stream, &tempPH.mPointList[i]); stream->read(&size); - tempPH.planeList.setSize(size); - for (i = 0; i < tempPH.planeList.size(); i++) - mathRead(*stream, &tempPH.planeList[i]); + tempPH.mPlaneList.setSize(size); + for (i = 0; i < tempPH.mPlaneList.size(); i++) + mathRead(*stream, &tempPH.mPlaneList[i]); stream->read(&size); - tempPH.edgeList.setSize(size); - for (i = 0; i < tempPH.edgeList.size(); i++) { - Polyhedron::Edge& rEdge = tempPH.edgeList[i]; + tempPH.mEdgeList.setSize(size); + for (i = 0; i < tempPH.mEdgeList.size(); i++) { + Polyhedron::Edge& rEdge = tempPH.mEdgeList[i]; stream->read(&rEdge.face[0]); stream->read(&rEdge.face[1]); diff --git a/Engine/source/T3D/components/physics/playerControllerComponent.cpp b/Engine/source/T3D/components/physics/playerControllerComponent.cpp index 761ac570c..5b7455bfc 100644 --- a/Engine/source/T3D/components/physics/playerControllerComponent.cpp +++ b/Engine/source/T3D/components/physics/playerControllerComponent.cpp @@ -441,16 +441,15 @@ void PlayerControllerComponent::updateMove() // get the head pitch and add it to the moveVec // This more accurate swim vector calc comes from Matt Fairfax - MatrixF xRot, zRot; + MatrixF xRot; xRot.set(EulerF(mOwner->getRotation().asEulerF().x, 0, 0)); - zRot.set(EulerF(0, 0, mOwner->getRotation().asEulerF().z)); + zRot.set(EulerF(0, 0, mOwner->getRotation().asEulerF().z));//reset prior uses MatrixF rot; rot.mul(zRot, xRot); rot.getColumn(0, &moveVec); moveVec *= move->x; - VectorF tv; - rot.getColumn(1, &tv); + rot.getColumn(1, &tv);//reset prior uses moveVec += tv * move->y; rot.getColumn(2, &tv); moveVec += tv * move->z; diff --git a/Engine/source/T3D/components/render/meshComponent.cpp b/Engine/source/T3D/components/render/meshComponent.cpp index c87733bf8..ad7ce0a5c 100644 --- a/Engine/source/T3D/components/render/meshComponent.cpp +++ b/Engine/source/T3D/components/render/meshComponent.cpp @@ -254,8 +254,8 @@ void MeshComponent::updateShape() mOwner->getWorldToObj().mulP(pos); - min = mMeshAsset->getShape()->bounds.minExtents; - max = mMeshAsset->getShape()->bounds.maxExtents; + min = mMeshAsset->getShape()->mBounds.minExtents; + max = mMeshAsset->getShape()->mBounds.maxExtents; if (mInterfaceData) { diff --git a/Engine/source/T3D/convexShape.cpp b/Engine/source/T3D/convexShape.cpp index bc23798d0..33e2bc65c 100644 --- a/Engine/source/T3D/convexShape.cpp +++ b/Engine/source/T3D/convexShape.cpp @@ -492,7 +492,6 @@ void ConvexShape::unpackUpdate( NetConnection *conn, BitStream *stream ) void ConvexShape::prepRenderImage( SceneRenderState *state ) { - /* if ( state->isDiffusePass() ) { ObjectRenderInst *ri2 = state->getRenderPass()->allocInst(); @@ -500,8 +499,7 @@ void ConvexShape::prepRenderImage( SceneRenderState *state ) ri2->type = RenderPassManager::RIT_Editor; state->getRenderPass()->addInst( ri2 ); } - */ - + if ( mVertexBuffer.isNull() || !state) return; @@ -795,21 +793,10 @@ bool ConvexShape::castRay( const Point3F &start, const Point3F &end, RayInfo *in F32 t; F32 tmin = F32_MAX; S32 hitFace = -1; - Point3F hitPnt, pnt; + Point3F pnt; VectorF rayDir( end - start ); rayDir.normalizeSafe(); - - if ( false ) - { - PlaneF plane( Point3F(0,0,0), Point3F(0,0,1) ); - Point3F sp( 0,0,-1 ); - Point3F ep( 0,0,1 ); - - F32 t = plane.intersect( sp, ep ); - Point3F hitPnt; - hitPnt.interpolate( sp, ep, t ); - } - + for ( S32 i = 0; i < planeCount; i++ ) { // Don't hit the back-side of planes. @@ -1228,11 +1215,11 @@ void ConvexShape::_renderDebug( ObjectRenderInst *ri, SceneRenderState *state, B GFX->setTexture( 0, NULL ); // Render world box. - if ( false ) + if (Con::getBoolVariable("$pref::convexDBG::ShowWorldBox", false)) { Box3F wbox( mWorldBox ); - //if ( getServerObject() ) - // Box3F wbox = static_cast( getServerObject() )->mWorldBox; + if ( getServerObject() ) + wbox = static_cast( getServerObject() )->mWorldBox; GFXStateBlockDesc desc; desc.setCullMode( GFXCullNone ); desc.setFillModeWireframe(); @@ -1244,7 +1231,7 @@ void ConvexShape::_renderDebug( ObjectRenderInst *ri, SceneRenderState *state, B const Vector< ConvexShape::Face > &faceList = mGeometry.faces; // Render Edges. - if ( false ) + if (Con::getBoolVariable("$pref::convexDBG::ShowEdges", false)) { GFXTransformSaver saver; //GFXFrustumSaver fsaver; @@ -1298,7 +1285,7 @@ void ConvexShape::_renderDebug( ObjectRenderInst *ri, SceneRenderState *state, B objToWorld.scale( mObjScale ); // Render faces centers/colors. - if ( false ) + if (Con::getBoolVariable("$pref::convexDBG::ShowFaceColors", false)) { GFXStateBlockDesc desc; desc.setCullMode( GFXCullNone ); @@ -1322,7 +1309,7 @@ void ConvexShape::_renderDebug( ObjectRenderInst *ri, SceneRenderState *state, B } // Render winding order. - if ( false ) + if (Con::getBoolVariable("$pref::convexDBG::ShowWinding", false)) { GFXStateBlockDesc desc; desc.setCullMode( GFXCullNone ); @@ -1379,7 +1366,7 @@ void ConvexShape::_renderDebug( ObjectRenderInst *ri, SceneRenderState *state, B } // Render surface transforms. - if ( false ) + if (Con::getBoolVariable("$pref::convexDBG::ShowSurfaceTransforms", false)) { GFXStateBlockDesc desc; desc.setBlend( false ); @@ -1389,7 +1376,7 @@ void ConvexShape::_renderDebug( ObjectRenderInst *ri, SceneRenderState *state, B for ( S32 i = 0; i < mSurfaces.size(); i++ ) { - MatrixF objToWorld( mObjToWorld ); + objToWorld = mObjToWorld; objToWorld.scale( mObjScale ); MatrixF renderMat; diff --git a/Engine/source/T3D/debris.cpp b/Engine/source/T3D/debris.cpp index 57d9a0577..24014d5c8 100644 --- a/Engine/source/T3D/debris.cpp +++ b/Engine/source/T3D/debris.cpp @@ -396,7 +396,7 @@ void DebrisData::packData(BitStream* stream) if( stream->writeFlag( explosion ) ) { - stream->writeRangedU32(packed? SimObjectId((uintptr_t)explosion): + stream->writeRangedU32(mPacked ? SimObjectId((uintptr_t)explosion): explosion->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast); } @@ -669,7 +669,7 @@ bool Debris::onAdd() // Setup our bounding box if( mDataBlock->shape ) { - mObjBox = mDataBlock->shape->bounds; + mObjBox = mDataBlock->shape->mBounds; } else { diff --git a/Engine/source/T3D/decal/decalManager.cpp b/Engine/source/T3D/decal/decalManager.cpp index 2a286ea37..c11faf325 100644 --- a/Engine/source/T3D/decal/decalManager.cpp +++ b/Engine/source/T3D/decal/decalManager.cpp @@ -1302,14 +1302,14 @@ void DecalManager::prepRenderImage( SceneRenderState* state ) // Loop through batches allocating buffers and submitting render instances. for ( U32 i = 0; i < batches.size(); i++ ) { - DecalBatch ¤tBatch = batches[i]; + currentBatch = &batches[i]; // Copy data into the system memory arrays, from all decals in this batch... DecalVertex *vpPtr = vertData; U16 *pbPtr = indexData; - U32 lastDecal = currentBatch.startDecal + currentBatch.decalCount; + U32 lastDecal = currentBatch->startDecal + currentBatch->decalCount; U32 voffset = 0; U32 ioffset = 0; @@ -1317,13 +1317,13 @@ void DecalManager::prepRenderImage( SceneRenderState* state ) // This is an ugly hack for ProjectedShadow! GFXTextureObject *customTex = NULL; - for ( U32 j = currentBatch.startDecal; j < lastDecal; j++ ) + for ( U32 j = currentBatch->startDecal; j < lastDecal; j++ ) { - DecalInstance *dinst = mDecalQueue[j]; + dinst = mDecalQueue[j]; const U32 indxCount = - (dinst->mIndxCount > currentBatch.iCount) ? - currentBatch.iCount : dinst->mIndxCount; + (dinst->mIndxCount > currentBatch->iCount) ? + currentBatch->iCount : dinst->mIndxCount; for ( U32 k = 0; k < indxCount; k++ ) { *( pbPtr + ioffset + k ) = dinst->mIndices[k] + voffset; @@ -1332,8 +1332,8 @@ void DecalManager::prepRenderImage( SceneRenderState* state ) ioffset += indxCount; const U32 vertCount = - (dinst->mVertCount > currentBatch.vCount) ? - currentBatch.vCount : dinst->mVertCount; + (dinst->mVertCount > currentBatch->vCount) ? + currentBatch->vCount : dinst->mVertCount; dMemcpy( vpPtr + voffset, dinst->mVerts, sizeof( DecalVertex ) * vertCount ); voffset += vertCount; @@ -1342,8 +1342,8 @@ void DecalManager::prepRenderImage( SceneRenderState* state ) customTex = *dinst->mCustomTex; } - AssertFatal( ioffset == currentBatch.iCount, "bad" ); - AssertFatal( voffset == currentBatch.vCount, "bad" ); + AssertFatal( ioffset == currentBatch->iCount, "bad" ); + AssertFatal( voffset == currentBatch->vCount, "bad" ); // Get handles to video memory buffers we will be filling... @@ -1385,9 +1385,9 @@ void DecalManager::prepRenderImage( SceneRenderState* state ) pb->lock( &pbPtr ); // Memcpy from system to video memory. - const U32 vpCount = sizeof( DecalVertex ) * currentBatch.vCount; + const U32 vpCount = sizeof( DecalVertex ) * currentBatch->vCount; dMemcpy( vpPtr, vertData, vpCount ); - const U32 pbCount = sizeof( U16 ) * currentBatch.iCount; + const U32 pbCount = sizeof( U16 ) * currentBatch->iCount; dMemcpy( pbPtr, indexData, pbCount ); pb->unlock(); @@ -1400,7 +1400,7 @@ void DecalManager::prepRenderImage( SceneRenderState* state ) // Get the best lights for the current camera position // if the materail is forward lit and we haven't got them yet. - if ( currentBatch.matInst->isForwardLit() && !baseRenderInst.lights[0] ) + if ( currentBatch->matInst->isForwardLit() && !baseRenderInst.lights[0] ) { LightQuery query; query.init( rootFrustum.getPosition(), @@ -1416,15 +1416,15 @@ void DecalManager::prepRenderImage( SceneRenderState* state ) ri->primBuff = pb; ri->vertBuff = vb; - ri->matInst = currentBatch.matInst; + ri->matInst = currentBatch->matInst; ri->prim = renderPass->allocPrim(); ri->prim->type = GFXTriangleList; ri->prim->minIndex = 0; ri->prim->startIndex = 0; - ri->prim->numPrimitives = currentBatch.iCount / 3; + ri->prim->numPrimitives = currentBatch->iCount / 3; ri->prim->startVertex = 0; - ri->prim->numVertices = currentBatch.vCount; + ri->prim->numVertices = currentBatch->vCount; // Ugly hack for ProjectedShadow! if ( customTex ) @@ -1433,7 +1433,7 @@ void DecalManager::prepRenderImage( SceneRenderState* state ) // The decal bin will contain render instances for both decals and decalRoad's. // Dynamic decals render last, then editor decals and roads in priority order. // DefaultKey is sorted in descending order. - ri->defaultKey = currentBatch.dynamic ? 0xFFFFFFFF : (U32)currentBatch.priority; + ri->defaultKey = currentBatch->dynamic ? 0xFFFFFFFF : (U32)currentBatch->priority; ri->defaultKey2 = 1;//(U32)lastDecal->mDataBlock; renderPass->addInst( ri ); diff --git a/Engine/source/T3D/entity.cpp b/Engine/source/T3D/entity.cpp index 62c0b031f..8e9426a23 100644 --- a/Engine/source/T3D/entity.cpp +++ b/Engine/source/T3D/entity.cpp @@ -1542,11 +1542,9 @@ void Entity::write(Stream &stream, U32 tabStop, U32 flags) if (mComponents.size() > 0) { // Pack out the behaviors into fields - U32 i = 0; for (U32 i = 0; i < mComponents.size(); i++) { writeTabs(stream, tabStop + 1); - char buffer[1024]; dSprintf(buffer, sizeof(buffer), "new %s() {\r\n", mComponents[i]->getClassName()); stream.write(dStrlen(buffer), buffer); //bi->writeFields( stream, tabStop + 2 ); diff --git a/Engine/source/T3D/examples/renderShapeExample.cpp b/Engine/source/T3D/examples/renderShapeExample.cpp index 0e60c3801..5f0847b90 100644 --- a/Engine/source/T3D/examples/renderShapeExample.cpp +++ b/Engine/source/T3D/examples/renderShapeExample.cpp @@ -213,7 +213,7 @@ void RenderShapeExample::createShape() } // Update the bounding box - mObjBox = mShape->bounds; + mObjBox = mShape->mBounds; resetWorldBox(); setRenderTransform(mObjToWorld); diff --git a/Engine/source/T3D/fx/explosion.cpp b/Engine/source/T3D/fx/explosion.cpp index 0236da6e9..4da7b2902 100644 --- a/Engine/source/T3D/fx/explosion.cpp +++ b/Engine/source/T3D/fx/explosion.cpp @@ -1384,7 +1384,7 @@ bool Explosion::explode() mEndingMS = U32(mExplosionInstance->getScaledDuration(mExplosionThread) * 1000.0f); mObjScale.convolve(mDataBlock->explosionScale); - mObjBox = mDataBlock->explosionShape->bounds; + mObjBox = mDataBlock->explosionShape->mBounds; resetWorldBox(); } diff --git a/Engine/source/T3D/fx/groundCover.cpp b/Engine/source/T3D/fx/groundCover.cpp index 63b5e3a2f..52ea5ef17 100644 --- a/Engine/source/T3D/fx/groundCover.cpp +++ b/Engine/source/T3D/fx/groundCover.cpp @@ -1142,7 +1142,7 @@ GroundCoverCell* GroundCover::_generateCell( const Point2I& index, const F32 typeMaxElevation = mMaxElevation[type]; const F32 typeMinElevation = mMinElevation[type]; const bool typeIsShape = mShapeInstances[ type ] != NULL; - const Box3F typeShapeBounds = typeIsShape ? mShapeInstances[ type ]->getShape()->bounds : Box3F(); + const Box3F typeShapeBounds = typeIsShape ? mShapeInstances[ type ]->getShape()->mBounds : Box3F(); const F32 typeWindScale = mWindScale[type]; StringTableEntry typeLayer = mLayer[type]; const bool typeInvertLayer = mInvertLayer[type]; @@ -1184,9 +1184,9 @@ GroundCoverCell* GroundCover::_generateCell( const Point2I& index, terrainBlock = dynamic_cast< TerrainBlock* >( terrainBlocks.first() ); else { - for ( U32 i = 0; i < terrainBlocks.size(); i++ ) + for ( U32 blockIDx = 0; blockIDx < terrainBlocks.size(); blockIDx++ ) { - TerrainBlock *terrain = dynamic_cast< TerrainBlock* >( terrainBlocks[ i ] ); + TerrainBlock *terrain = dynamic_cast< TerrainBlock* >( terrainBlocks[ blockIDx ] ); if( !terrain ) continue; diff --git a/Engine/source/T3D/fx/particleEmitter.cpp b/Engine/source/T3D/fx/particleEmitter.cpp index cab153574..079ea84b8 100644 --- a/Engine/source/T3D/fx/particleEmitter.cpp +++ b/Engine/source/T3D/fx/particleEmitter.cpp @@ -412,7 +412,7 @@ void ParticleEmitterData::packData(BitStream* stream) #if defined(AFX_CAP_PARTICLE_POOLS) if (stream->writeFlag(pool_datablock)) { - stream->writeRangedU32(packed ? SimObjectId((uintptr_t)pool_datablock) : pool_datablock->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast); + stream->writeRangedU32(mPacked ? SimObjectId((uintptr_t)pool_datablock) : pool_datablock->getId(), DataBlockObjectIdFirst, DataBlockObjectIdLast); stream->write(pool_index); stream->writeFlag(pool_depth_fade); stream->writeFlag(pool_radial_fade); diff --git a/Engine/source/T3D/fx/ribbon.cpp b/Engine/source/T3D/fx/ribbon.cpp index 9dddd8131..a3d788590 100644 --- a/Engine/source/T3D/fx/ribbon.cpp +++ b/Engine/source/T3D/fx/ribbon.cpp @@ -508,10 +508,10 @@ void Ribbon::prepRenderImage(SceneRenderState *state) // Set up our vertex buffer and primitive buffer if(mUpdateBuffers) - createBuffers(state, verts, primBuffer, segments); + createBuffers(state, mVerts, mPrimBuffer, segments); - ri->vertBuff = &verts; - ri->primBuff = &primBuffer; + ri->vertBuff = &mVerts; + ri->primBuff = &mPrimBuffer; ri->visibility = 1.0f; ri->prim = renderPass->allocPrim(); diff --git a/Engine/source/T3D/fx/ribbon.h b/Engine/source/T3D/fx/ribbon.h index 36faf03c1..954dd3cf0 100644 --- a/Engine/source/T3D/fx/ribbon.h +++ b/Engine/source/T3D/fx/ribbon.h @@ -99,8 +99,8 @@ class Ribbon : public GameBase BaseMatInstance *mRibbonMat; MaterialParameterHandle* mRadiusSC; MaterialParameterHandle* mRibbonProjSC; - GFXPrimitiveBufferHandle primBuffer; - GFXVertexBufferHandle verts; + GFXPrimitiveBufferHandle mPrimBuffer; + GFXVertexBufferHandle mVerts; protected: diff --git a/Engine/source/T3D/gameBase/gameBase.cpp b/Engine/source/T3D/gameBase/gameBase.cpp index 23b8a67bb..17c050309 100644 --- a/Engine/source/T3D/gameBase/gameBase.cpp +++ b/Engine/source/T3D/gameBase/gameBase.cpp @@ -127,13 +127,13 @@ IMPLEMENT_CALLBACK( GameBase, setControl, void, ( bool controlled ), ( controlle GameBaseData::GameBaseData() { - category = ""; - packed = false; + mCategory = ""; + mPacked = false; } GameBaseData::GameBaseData(const GameBaseData& other, bool temp_clone) : SimDataBlock(other, temp_clone) { - packed = other.packed; - category = other.category; + mPacked = other.mPacked; + mCategory = other.mCategory; //mReloadSignal = other.mReloadSignal; // DO NOT copy the mReloadSignal member. } @@ -158,7 +158,7 @@ void GameBaseData::initPersistFields() { addGroup("Scripting"); - addField( "category", TypeCaseString, Offset( category, GameBaseData ), + addField( "category", TypeCaseString, Offset(mCategory, GameBaseData ), "The group that this datablock will show up in under the \"Scripted\" " "tab in the World Editor Library." ); @@ -171,14 +171,14 @@ bool GameBaseData::preload(bool server, String &errorStr) { if (!Parent::preload(server, errorStr)) return false; - packed = false; + mPacked = false; return true; } void GameBaseData::unpackData(BitStream* stream) { Parent::unpackData(stream); - packed = true; + mPacked = true; } //---------------------------------------------------------------------------- @@ -259,7 +259,7 @@ GameBase::GameBase() GameBase::~GameBase() { #ifdef TORQUE_AFX_ENABLED - if (scope_registered) + if (mScope_registered) arcaneFX::unregisterScopedObject(this); #endif } @@ -277,7 +277,7 @@ bool GameBase::onAdd() #ifdef TORQUE_AFX_ENABLED if (isClientObject()) { - if (scope_id > 0 && !scope_registered) + if (mScope_id > 0 && !mScope_registered) arcaneFX::registerScopedObject(this); } else @@ -298,7 +298,7 @@ bool GameBase::onAdd() void GameBase::onRemove() { #ifdef TORQUE_AFX_ENABLED - if (scope_registered) + if (mScope_registered) arcaneFX::unregisterScopedObject(this); #endif // EDITOR FEATURE: Remove us from the reload signal of our datablock. @@ -455,7 +455,7 @@ F32 GameBase::getUpdatePriority(CameraScopeQuery *camInfo, U32 updateMask, S32 u // Projectiles are more interesting if they // are heading for us. wInterest = 0.30f; - F32 dot = -mDot(pos,getVelocity()); + dot = -mDot(pos,getVelocity()); if (dot > 0.0f) wInterest += 0.20 * dot; } @@ -586,8 +586,8 @@ U32 GameBase::packUpdate( NetConnection *connection, U32 mask, BitStream *stream #ifdef TORQUE_AFX_ENABLED if (stream->writeFlag(mask & ScopeIdMask)) { - if (stream->writeFlag(scope_refs > 0)) - stream->writeInt(scope_id, SCOPE_ID_BITS); + if (stream->writeFlag(mScope_refs > 0)) + stream->writeInt(mScope_id, SCOPE_ID_BITS); } #endif return retMask; @@ -631,8 +631,8 @@ void GameBase::unpackUpdate(NetConnection *con, BitStream *stream) #ifdef TORQUE_AFX_ENABLED if (stream->readFlag()) { - scope_id = (stream->readFlag()) ? (U16) stream->readInt(SCOPE_ID_BITS) : 0; - scope_refs = 0; + mScope_id = (stream->readFlag()) ? (U16) stream->readInt(SCOPE_ID_BITS) : 0; + mScope_refs = 0; } #endif } diff --git a/Engine/source/T3D/gameBase/gameBase.h b/Engine/source/T3D/gameBase/gameBase.h index e6cf5c973..2571c1426 100644 --- a/Engine/source/T3D/gameBase/gameBase.h +++ b/Engine/source/T3D/gameBase/gameBase.h @@ -91,8 +91,8 @@ private: public: - bool packed; - StringTableEntry category; + bool mPacked; + StringTableEntry mCategory; // Signal triggered when this datablock is modified. // GameBase objects referencing this datablock notify with this signal. diff --git a/Engine/source/T3D/guiMaterialPreview.cpp b/Engine/source/T3D/guiMaterialPreview.cpp index 1fa053a12..05d42b87f 100644 --- a/Engine/source/T3D/guiMaterialPreview.cpp +++ b/Engine/source/T3D/guiMaterialPreview.cpp @@ -269,7 +269,7 @@ void GuiMaterialPreview::setObjectModel(const char* modelName) // Initialize camera values: mOrbitPos = mModel->getShape()->center; - mMinOrbitDist = mModel->getShape()->radius; + mMinOrbitDist = mModel->getShape()->mRadius; lastRenderTime = Platform::getVirtualMilliseconds(); } diff --git a/Engine/source/T3D/guiObjectView.cpp b/Engine/source/T3D/guiObjectView.cpp index 13c46380c..5330a1ee6 100644 --- a/Engine/source/T3D/guiObjectView.cpp +++ b/Engine/source/T3D/guiObjectView.cpp @@ -367,7 +367,7 @@ void GuiObjectView::setObjectModel( const String& modelName ) // Initialize camera values. mOrbitPos = mModel->getShape()->center; - mMinOrbitDist = mModel->getShape()->radius; + mMinOrbitDist = mModel->getShape()->mRadius; // Initialize animation. diff --git a/Engine/source/T3D/item.cpp b/Engine/source/T3D/item.cpp index b710842d7..f31e2e8e0 100644 --- a/Engine/source/T3D/item.cpp +++ b/Engine/source/T3D/item.cpp @@ -320,8 +320,8 @@ Item::Item() mAtRest = true; mAtRestCounter = 0; mInLiquid = false; - delta.warpTicks = 0; - delta.dt = 1; + mDelta.warpTicks = 0; + mDelta.dt = 1; mCollisionObject = 0; mCollisionTimeout = 0; mPhysicsRep = NULL; @@ -350,7 +350,7 @@ bool Item::onAdd() if (mStatic) mAtRest = true; - mObjToWorld.getColumn(3,&delta.pos); + mObjToWorld.getColumn(3,&mDelta.pos); // Setup the box for our convex object... mObjBox.getCenter(&mConvex.mCenter); @@ -564,21 +564,21 @@ void Item::processTick(const Move* move) mCollisionObject = 0; // Warp to catch up to server - if (delta.warpTicks > 0) + if (mDelta.warpTicks > 0) { - delta.warpTicks--; + mDelta.warpTicks--; // Set new pos. MatrixF mat = mObjToWorld; - mat.getColumn(3,&delta.pos); - delta.pos += delta.warpOffset; - mat.setColumn(3,delta.pos); + mat.getColumn(3,&mDelta.pos); + mDelta.pos += mDelta.warpOffset; + mat.setColumn(3, mDelta.pos); Parent::setTransform(mat); // Backstepping - delta.posVec.x = -delta.warpOffset.x; - delta.posVec.y = -delta.warpOffset.y; - delta.posVec.z = -delta.warpOffset.z; + mDelta.posVec.x = -mDelta.warpOffset.x; + mDelta.posVec.y = -mDelta.warpOffset.y; + mDelta.posVec.z = -mDelta.warpOffset.z; } else { @@ -601,7 +601,7 @@ void Item::processTick(const Move* move) else { // Need to clear out last updatePos or warp interpolation - delta.posVec.set(0,0,0); + mDelta.posVec.set(0,0,0); } } } @@ -613,11 +613,11 @@ void Item::interpolateTick(F32 dt) return; // Client side interpolation - Point3F pos = delta.pos + delta.posVec * dt; + Point3F pos = mDelta.pos + mDelta.posVec * dt; MatrixF mat = mRenderObjToWorld; mat.setColumn(3,pos); setRenderTransform(mat); - delta.dt = dt; + mDelta.dt = dt; } @@ -733,7 +733,7 @@ void Item::updatePos(const U32 /*mask*/, const F32 dt) // Try and move Point3F pos; mObjToWorld.getColumn(3,&pos); - delta.posVec = pos; + mDelta.posVec = pos; bool contact = false; bool nonStatic = false; @@ -891,9 +891,9 @@ void Item::updatePos(const U32 /*mask*/, const F32 dt) if (collisionList.getTime() < 1.0) { // Set to collision point - F32 dt = time * collisionList.getTime(); - pos += mVelocity * dt; - time -= dt; + F32 cdt = time * collisionList.getTime(); + pos += mVelocity * cdt; + time -= cdt; // Pick the most resistant surface F32 bd = 0; @@ -959,9 +959,9 @@ void Item::updatePos(const U32 /*mask*/, const F32 dt) // If on the client, calculate delta for backstepping if (isGhost()) { - delta.pos = pos; - delta.posVec -= pos; - delta.dt = 1; + mDelta.pos = pos; + mDelta.posVec -= pos; + mDelta.dt = 1; } // Update transform @@ -1131,40 +1131,40 @@ void Item::unpackUpdate(NetConnection *connection, BitStream *stream) if (stream->readFlag() && isProperlyAdded()) { // Determin number of ticks to warp based on the average // of the client and server velocities. - delta.warpOffset = pos - delta.pos; + mDelta.warpOffset = pos - mDelta.pos; F32 as = (speed + mVelocity.len()) * 0.5f * TickSec; - F32 dt = (as > 0.00001f) ? delta.warpOffset.len() / as: sMaxWarpTicks; - delta.warpTicks = (S32)((dt > sMinWarpTicks)? getMax(mFloor(dt + 0.5f), 1.0f): 0.0f); + F32 dt = (as > 0.00001f) ? mDelta.warpOffset.len() / as: sMaxWarpTicks; + mDelta.warpTicks = (S32)((dt > sMinWarpTicks)? getMax(mFloor(dt + 0.5f), 1.0f): 0.0f); - if (delta.warpTicks) + if (mDelta.warpTicks) { // Setup the warp to start on the next tick, only the // object's position is warped. - if (delta.warpTicks > sMaxWarpTicks) - delta.warpTicks = sMaxWarpTicks; - delta.warpOffset /= (F32)delta.warpTicks; + if (mDelta.warpTicks > sMaxWarpTicks) + mDelta.warpTicks = sMaxWarpTicks; + mDelta.warpOffset /= (F32)mDelta.warpTicks; } else { // Going to skip the warp, server and client are real close. // Adjust the frame interpolation to move smoothly to the // new position within the current tick. - Point3F cp = delta.pos + delta.posVec * delta.dt; - VectorF vec = delta.pos - cp; + Point3F cp = mDelta.pos + mDelta.posVec * mDelta.dt; + VectorF vec = mDelta.pos - cp; F32 vl = vec.len(); if (vl) { - F32 s = delta.posVec.len() / vl; - delta.posVec = (cp - pos) * s; + F32 s = mDelta.posVec.len() / vl; + mDelta.posVec = (cp - pos) * s; } - delta.pos = pos; + mDelta.pos = pos; mat.setColumn(3,pos); } } else { // Set the item to the server position - delta.warpTicks = 0; - delta.posVec.set(0,0,0); - delta.pos = pos; - delta.dt = 0; + mDelta.warpTicks = 0; + mDelta.posVec.set(0,0,0); + mDelta.pos = pos; + mDelta.dt = 0; mat.setColumn(3,pos); } } diff --git a/Engine/source/T3D/item.h b/Engine/source/T3D/item.h index 68720952b..be79e7f9d 100644 --- a/Engine/source/T3D/item.h +++ b/Engine/source/T3D/item.h @@ -88,7 +88,7 @@ class Item: public ShapeBase Point3F warpOffset; F32 dt; }; - StateDelta delta; + StateDelta mDelta; // Static attributes ItemData* mDataBlock; diff --git a/Engine/source/T3D/occlusionVolume.cpp b/Engine/source/T3D/occlusionVolume.cpp index 7accbd507..9d55042e2 100644 --- a/Engine/source/T3D/occlusionVolume.cpp +++ b/Engine/source/T3D/occlusionVolume.cpp @@ -167,11 +167,11 @@ void OcclusionVolume::buildSilhouette( const SceneCameraState& cameraState, Vect if( mTransformDirty ) { - const U32 numPoints = mPolyhedron.getNumPoints(); + const U32 numPolyPoints = mPolyhedron.getNumPoints(); const PolyhedronType::PointType* points = getPolyhedron().getPoints(); - mWSPoints.setSize( numPoints ); - for( U32 i = 0; i < numPoints; ++ i ) + mWSPoints.setSize(numPolyPoints); + for( U32 i = 0; i < numPolyPoints; ++ i ) { Point3F p = points[ i ]; p.convolve( getScale() ); diff --git a/Engine/source/T3D/physicalZone.cpp b/Engine/source/T3D/physicalZone.cpp index fac190b67..f3028ee45 100644 --- a/Engine/source/T3D/physicalZone.cpp +++ b/Engine/source/T3D/physicalZone.cpp @@ -342,17 +342,17 @@ U32 PhysicalZone::packUpdate(NetConnection* con, U32 mask, BitStream* stream) if (stream->writeFlag(mask & PolyhedronMask)) { // Write the polyhedron - stream->write(mPolyhedron.pointList.size()); - for (i = 0; i < mPolyhedron.pointList.size(); i++) - mathWrite(*stream, mPolyhedron.pointList[i]); + stream->write(mPolyhedron.mPointList.size()); + for (i = 0; i < mPolyhedron.mPointList.size(); i++) + mathWrite(*stream, mPolyhedron.mPointList[i]); - stream->write(mPolyhedron.planeList.size()); - for (i = 0; i < mPolyhedron.planeList.size(); i++) - mathWrite(*stream, mPolyhedron.planeList[i]); + stream->write(mPolyhedron.mPlaneList.size()); + for (i = 0; i < mPolyhedron.mPlaneList.size(); i++) + mathWrite(*stream, mPolyhedron.mPlaneList[i]); - stream->write(mPolyhedron.edgeList.size()); - for (i = 0; i < mPolyhedron.edgeList.size(); i++) { - const Polyhedron::Edge& rEdge = mPolyhedron.edgeList[i]; + stream->write(mPolyhedron.mEdgeList.size()); + for (i = 0; i < mPolyhedron.mEdgeList.size(); i++) { + const Polyhedron::Edge& rEdge = mPolyhedron.mEdgeList[i]; stream->write(rEdge.face[0]); stream->write(rEdge.face[1]); @@ -399,19 +399,19 @@ void PhysicalZone::unpackUpdate(NetConnection* con, BitStream* stream) // Read the polyhedron stream->read(&size); - tempPH.pointList.setSize(size); - for (i = 0; i < tempPH.pointList.size(); i++) - mathRead(*stream, &tempPH.pointList[i]); + tempPH.mPointList.setSize(size); + for (i = 0; i < tempPH.mPointList.size(); i++) + mathRead(*stream, &tempPH.mPointList[i]); stream->read(&size); - tempPH.planeList.setSize(size); - for (i = 0; i < tempPH.planeList.size(); i++) - mathRead(*stream, &tempPH.planeList[i]); + tempPH.mPlaneList.setSize(size); + for (i = 0; i < tempPH.mPlaneList.size(); i++) + mathRead(*stream, &tempPH.mPlaneList[i]); stream->read(&size); - tempPH.edgeList.setSize(size); - for (i = 0; i < tempPH.edgeList.size(); i++) { - Polyhedron::Edge& rEdge = tempPH.edgeList[i]; + tempPH.mEdgeList.setSize(size); + for (i = 0; i < tempPH.mEdgeList.size(); i++) { + Polyhedron::Edge& rEdge = tempPH.mEdgeList[i]; stream->read(&rEdge.face[0]); stream->read(&rEdge.face[1]); @@ -467,12 +467,12 @@ void PhysicalZone::setPolyhedron(const Polyhedron& rPolyhedron) { mPolyhedron = rPolyhedron; - if (mPolyhedron.pointList.size() != 0) { + if (mPolyhedron.mPointList.size() != 0) { mObjBox.minExtents.set(1e10, 1e10, 1e10); mObjBox.maxExtents.set(-1e10, -1e10, -1e10); - for (U32 i = 0; i < mPolyhedron.pointList.size(); i++) { - mObjBox.minExtents.setMin(mPolyhedron.pointList[i]); - mObjBox.maxExtents.setMax(mPolyhedron.pointList[i]); + for (U32 i = 0; i < mPolyhedron.mPointList.size(); i++) { + mObjBox.minExtents.setMin(mPolyhedron.mPointList[i]); + mObjBox.maxExtents.setMax(mPolyhedron.mPointList[i]); } } else { mObjBox.minExtents.set(-0.5, -0.5, -0.5); @@ -483,7 +483,7 @@ void PhysicalZone::setPolyhedron(const Polyhedron& rPolyhedron) setTransform(xform); mClippedList.clear(); - mClippedList.mPlaneList = mPolyhedron.planeList; + mClippedList.mPlaneList = mPolyhedron.mPlaneList; MatrixF base(true); base.scale(Point3F(1.0/mObjScale.x, @@ -540,7 +540,7 @@ bool PhysicalZone::testObject(SceneObject* enter) // all. And whats the point of building a convex if no collision methods // are implemented? - if (mPolyhedron.pointList.size() == 0) + if (mPolyhedron.mPointList.size() == 0) return false; mClippedList.clear(); diff --git a/Engine/source/T3D/physics/physicsDebris.cpp b/Engine/source/T3D/physics/physicsDebris.cpp index a2e2026b3..44d421c86 100644 --- a/Engine/source/T3D/physics/physicsDebris.cpp +++ b/Engine/source/T3D/physics/physicsDebris.cpp @@ -358,7 +358,7 @@ bool PhysicsDebris::onAdd() } // Setup our bounding box - mObjBox = mDataBlock->shape->bounds; + mObjBox = mDataBlock->shape->mBounds; resetWorldBox(); // Add it to the client scene. diff --git a/Engine/source/T3D/physics/physicsShape.cpp b/Engine/source/T3D/physics/physicsShape.cpp index 574707003..d4e0a3313 100644 --- a/Engine/source/T3D/physics/physicsShape.cpp +++ b/Engine/source/T3D/physics/physicsShape.cpp @@ -308,10 +308,10 @@ bool PhysicsShapeData::preload( bool server, String &errorBuffer ) { //no collision so we create a simple box collision shape from the shapes bounds and alert the user Con::warnf( "PhysicsShapeData::preload - No collision found for shape '%s', auto-creating one", shapeName ); - Point3F halfWidth = shape->bounds.getExtents() * 0.5f; + Point3F halfWidth = shape->mBounds.getExtents() * 0.5f; colShape = PHYSICSMGR->createCollision(); MatrixF centerXfm(true); - centerXfm.setPosition(shape->bounds.getCenter()); + centerXfm.setPosition(shape->mBounds.getCenter()); colShape->addBox(halfWidth, centerXfm); return true; } @@ -707,7 +707,7 @@ bool PhysicsShape::_createShape() return false; // Set the world box. - mObjBox = db->shape->bounds; + mObjBox = db->shape->mBounds; resetWorldBox(); // If this is the server and its a client only simulation diff --git a/Engine/source/T3D/player.cpp b/Engine/source/T3D/player.cpp index 7f537d65d..be3be3bc0 100644 --- a/Engine/source/T3D/player.cpp +++ b/Engine/source/T3D/player.cpp @@ -1577,20 +1577,20 @@ Player::Player() { mTypeMask |= PlayerObjectType | DynamicShapeObjectType; - delta.pos = mAnchorPoint = Point3F(0,0,100); - delta.rot = delta.head = Point3F(0,0,0); - delta.rotOffset.set(0.0f,0.0f,0.0f); - delta.warpOffset.set(0.0f,0.0f,0.0f); - delta.posVec.set(0.0f,0.0f,0.0f); - delta.rotVec.set(0.0f,0.0f,0.0f); - delta.headVec.set(0.0f,0.0f,0.0f); - delta.warpTicks = 0; - delta.dt = 1.0f; - delta.move = NullMove; + mDelta.pos = mAnchorPoint = Point3F(0,0,100); + mDelta.rot = mDelta.head = Point3F(0,0,0); + mDelta.rotOffset.set(0.0f,0.0f,0.0f); + mDelta.warpOffset.set(0.0f,0.0f,0.0f); + mDelta.posVec.set(0.0f,0.0f,0.0f); + mDelta.rotVec.set(0.0f,0.0f,0.0f); + mDelta.headVec.set(0.0f,0.0f,0.0f); + mDelta.warpTicks = 0; + mDelta.dt = 1.0f; + mDelta.move = NullMove; mPredictionCount = sMaxPredictionTicks; - mObjToWorld.setColumn(3,delta.pos); - mRot = delta.rot; - mHead = delta.head; + mObjToWorld.setColumn(3, mDelta.pos); + mRot = mDelta.rot; + mHead = mDelta.head; mVelocity.set(0.0f, 0.0f, 0.0f); mDataBlock = 0; mHeadHThread = mHeadVThread = mRecoilThread = mImageStateThread = 0; @@ -2104,30 +2104,30 @@ void Player::processTick(const Move* move) } } // Warp to catch up to server - if (delta.warpTicks > 0) { - delta.warpTicks--; + if (mDelta.warpTicks > 0) { + mDelta.warpTicks--; // Set new pos - getTransform().getColumn(3, &delta.pos); - delta.pos += delta.warpOffset; - delta.rot += delta.rotOffset; + getTransform().getColumn(3, &mDelta.pos); + mDelta.pos += mDelta.warpOffset; + mDelta.rot += mDelta.rotOffset; // Wrap yaw to +/-PI - if (delta.rot.z < - M_PI_F) - delta.rot.z += M_2PI_F; - else if (delta.rot.z > M_PI_F) - delta.rot.z -= M_2PI_F; + if (mDelta.rot.z < - M_PI_F) + mDelta.rot.z += M_2PI_F; + else if (mDelta.rot.z > M_PI_F) + mDelta.rot.z -= M_2PI_F; if (!ignore_updates) { - setPosition(delta.pos,delta.rot); + setPosition(mDelta.pos, mDelta.rot); } updateDeathOffsets(); updateLookAnimation(); // Backstepping - delta.posVec = -delta.warpOffset; - delta.rotVec = -delta.rotOffset; + mDelta.posVec = -mDelta.warpOffset; + mDelta.rotVec = -mDelta.rotOffset; } else { // If there is no move, the player is either an @@ -2140,7 +2140,7 @@ void Player::processTick(const Move* move) if (mPredictionCount-- <= 0) return; - move = &delta.move; + move = &mDelta.move; } else move = &NullMove; @@ -2216,8 +2216,8 @@ void Player::interpolateTick(F32 dt) // Client side interpolation Parent::interpolateTick(dt); - Point3F pos = delta.pos + delta.posVec * dt; - Point3F rot = delta.rot + delta.rotVec * dt; + Point3F pos = mDelta.pos + mDelta.posVec * dt; + Point3F rot = mDelta.rot + mDelta.rotVec * dt; if (!ignore_updates) setRenderPosition(pos,rot,dt); @@ -2238,7 +2238,7 @@ void Player::interpolateTick(F32 dt) */ updateLookAnimation(dt); - delta.dt = dt; + mDelta.dt = dt; } void Player::advanceTime(F32 dt) @@ -2562,7 +2562,7 @@ void Player::updateMove(const Move* move) } move = &my_move; } - delta.move = *move; + mDelta.move = *move; #ifdef TORQUE_OPENVR if (mControllers[0]) @@ -2612,7 +2612,7 @@ void Player::updateMove(const Move* move) // Update current orientation if (mDamageState == Enabled) { F32 prevZRot = mRot.z; - delta.headVec = mHead; + mDelta.headVec = mHead; bool doStandardMove = true; bool absoluteDelta = false; @@ -2773,29 +2773,29 @@ void Player::updateMove(const Move* move) mRot.z -= M_2PI_F; } - delta.rot = mRot; - delta.rotVec.x = delta.rotVec.y = 0.0f; - delta.rotVec.z = prevZRot - mRot.z; - if (delta.rotVec.z > M_PI_F) - delta.rotVec.z -= M_2PI_F; - else if (delta.rotVec.z < -M_PI_F) - delta.rotVec.z += M_2PI_F; + mDelta.rot = mRot; + mDelta.rotVec.x = mDelta.rotVec.y = 0.0f; + mDelta.rotVec.z = prevZRot - mRot.z; + if (mDelta.rotVec.z > M_PI_F) + mDelta.rotVec.z -= M_2PI_F; + else if (mDelta.rotVec.z < -M_PI_F) + mDelta.rotVec.z += M_2PI_F; - delta.head = mHead; - delta.headVec -= mHead; + mDelta.head = mHead; + mDelta.headVec -= mHead; if (absoluteDelta) { - delta.headVec = Point3F(0, 0, 0); - delta.rotVec = Point3F(0, 0, 0); + mDelta.headVec = Point3F(0, 0, 0); + mDelta.rotVec = Point3F(0, 0, 0); } for(U32 i=0; i<3; ++i) { - if (delta.headVec[i] > M_PI_F) - delta.headVec[i] -= M_2PI_F; - else if (delta.headVec[i] < -M_PI_F) - delta.headVec[i] += M_2PI_F; + if (mDelta.headVec[i] > M_PI_F) + mDelta.headVec[i] -= M_2PI_F; + else if (mDelta.headVec[i] < -M_PI_F) + mDelta.headVec[i] += M_2PI_F; } } MatrixF zRot; @@ -3029,7 +3029,7 @@ void Player::updateMove(const Move* move) // get the head pitch and add it to the moveVec // This more accurate swim vector calc comes from Matt Fairfax - MatrixF xRot, zRot; + MatrixF xRot; xRot.set(EulerF(mHead.x, 0, 0)); zRot.set(EulerF(0, 0, mRot.z)); MatrixF rot; @@ -3584,7 +3584,7 @@ void Player::updateLookAnimation(F32 dt) return; } // Calculate our interpolated head position. - Point3F renderHead = delta.head + delta.headVec * dt; + Point3F renderHead = mDelta.head + mDelta.headVec * dt; // Adjust look pos. This assumes that the animations match // the min and max look angles provided in the datablock. @@ -4422,8 +4422,8 @@ void Player::onImageStateAnimation(U32 imageSlot, const char* seqName, bool dire if (!found && hasImageBasePrefix && hasScriptPrefix) { - String seqName = String(imageBasePrefix) + String("_") + String(scriptPrefix) + String("_") + baseSeqName; - S32 index = mShapeInstance->getShape()->findSequence(seqName); + String comboSeqName = String(imageBasePrefix) + String("_") + String(scriptPrefix) + String("_") + baseSeqName; + S32 index = mShapeInstance->getShape()->findSequence(comboSeqName); if (index != -1) { seqIndex = index; @@ -4433,8 +4433,8 @@ void Player::onImageStateAnimation(U32 imageSlot, const char* seqName, bool dire if (!found && hasImageBasePrefix) { - String seqName = String(imageBasePrefix) + String("_") + baseSeqName; - S32 index = mShapeInstance->getShape()->findSequence(seqName); + String imgSeqName = String(imageBasePrefix) + String("_") + baseSeqName; + S32 index = mShapeInstance->getShape()->findSequence(imgSeqName); if (index != -1) { seqIndex = index; @@ -4444,8 +4444,8 @@ void Player::onImageStateAnimation(U32 imageSlot, const char* seqName, bool dire if (!found && hasScriptPrefix) { - String seqName = String(scriptPrefix) + String("_") + baseSeqName; - S32 index = mShapeInstance->getShape()->findSequence(seqName); + String scriptSeqName = String(scriptPrefix) + String("_") + baseSeqName; + S32 index = mShapeInstance->getShape()->findSequence(scriptSeqName); if (index != -1) { seqIndex = index; @@ -5114,7 +5114,7 @@ void Player::_handleCollision( const Collision &collision ) bool Player::updatePos(const F32 travelTime) { PROFILE_SCOPE(Player_UpdatePos); - getTransform().getColumn(3,&delta.posVec); + getTransform().getColumn(3,&mDelta.posVec); // When mounted to another object, only Z rotation used. if (isMounted()) { @@ -5206,7 +5206,7 @@ bool Player::updatePos(const F32 travelTime) else { if ( mVelocity.isZero() ) - newPos = delta.posVec; + newPos = mDelta.posVec; else newPos = _move( travelTime, &col ); @@ -5223,9 +5223,9 @@ bool Player::updatePos(const F32 travelTime) // If on the client, calc delta for backstepping if (isClientObject()) { - delta.pos = newPos; - delta.posVec = delta.posVec - delta.pos; - delta.dt = 1.0f; + mDelta.pos = newPos; + mDelta.posVec = mDelta.posVec - mDelta.pos; + mDelta.dt = 1.0f; } setPosition( newPos, mRot ); @@ -5461,8 +5461,8 @@ bool Player::displaceObject(const Point3F& displacement) sBalance--; - getTransform().getColumn(3, &delta.pos); - delta.posVec.set(0.0f, 0.0f, 0.0f); + getTransform().getColumn(3, &mDelta.pos); + mDelta.posVec.set(0.0f, 0.0f, 0.0f); return result; } @@ -5481,8 +5481,8 @@ bool Player::displaceObject(const Point3F& displacement) bool result = updatePos(dt); - mObjToWorld.getColumn(3, &delta.pos); - delta.posVec.set(0.0f, 0.0f, 0.0f); + mObjToWorld.getColumn(3, &mDelta.pos); + mDelta.posVec.set(0.0f, 0.0f, 0.0f); return result; } @@ -5685,10 +5685,10 @@ void Player::getRenderEyeBaseTransform(MatrixF* mat, bool includeBank) // Eye transform in world space. We only use the eye position // from the animation and supply our own rotation. MatrixF pmat,xmat,zmat; - xmat.set(EulerF(delta.head.x + delta.headVec.x * delta.dt, 0.0f, 0.0f)); + xmat.set(EulerF(mDelta.head.x + mDelta.headVec.x * mDelta.dt, 0.0f, 0.0f)); if (mUseHeadZCalc) - zmat.set(EulerF(0.0f, 0.0f, delta.head.z + delta.headVec.z * delta.dt)); + zmat.set(EulerF(0.0f, 0.0f, mDelta.head.z + mDelta.headVec.z * mDelta.dt)); else zmat.identity(); @@ -5698,7 +5698,7 @@ void Player::getRenderEyeBaseTransform(MatrixF* mat, bool includeBank) MatrixF imat; imat.mul(zmat, xmat); MatrixF ymat; - ymat.set(EulerF(0.0f, delta.head.y + delta.headVec.y * delta.dt, 0.0f)); + ymat.set(EulerF(0.0f, mDelta.head.y + mDelta.headVec.y * mDelta.dt, 0.0f)); pmat.mul(imat, ymat); } else @@ -6235,7 +6235,7 @@ void Player::readPacketData(GameConnection *connection, BitStream *stream) stream->read(&mVelocity.y); stream->read(&mVelocity.z); stream->setCompressionPoint(pos); - delta.pos = pos; + mDelta.pos = pos; mJumpSurfaceLastContact = stream->readInt(4); if (stream->readFlag()) @@ -6258,7 +6258,7 @@ void Player::readPacketData(GameConnection *connection, BitStream *stream) } } else - pos = delta.pos; + pos = mDelta.pos; stream->read(&mHead.x); if(stream->readFlag()) { @@ -6270,8 +6270,8 @@ void Player::readPacketData(GameConnection *connection, BitStream *stream) rot.x = rot.y = 0; if (!ignore_updates) setPosition(pos,rot); - delta.head = mHead; - delta.rot = rot; + mDelta.head = mHead; + mDelta.rot = rot; if (stream->readFlag()) { S32 gIndex = stream->readInt(NetConnection::GhostIdBitSize); @@ -6349,7 +6349,7 @@ U32 Player::packUpdate(NetConnection *con, U32 mask, BitStream *stream) stream->writeFloat(mRot.z / M_2PI_F, 7); stream->writeSignedFloat(mHead.x / (mDataBlock->maxLookAngle - mDataBlock->minLookAngle), 6); stream->writeSignedFloat(mHead.z / mDataBlock->maxFreelookAngle, 6); - delta.move.pack(stream); + mDelta.move.pack(stream); stream->writeFlag(!(mask & NoWarpMask)); } // Ghost need energy to predict reliably @@ -6455,67 +6455,67 @@ void Player::unpackUpdate(NetConnection *con, BitStream *stream) rot.z = stream->readFloat(7) * M_2PI_F; mHead.x = stream->readSignedFloat(6) * (mDataBlock->maxLookAngle - mDataBlock->minLookAngle); mHead.z = stream->readSignedFloat(6) * mDataBlock->maxFreelookAngle; - delta.move.unpack(stream); + mDelta.move.unpack(stream); - delta.head = mHead; - delta.headVec.set(0.0f, 0.0f, 0.0f); + mDelta.head = mHead; + mDelta.headVec.set(0.0f, 0.0f, 0.0f); if (stream->readFlag() && isProperlyAdded()) { // Determine number of ticks to warp based on the average // of the client and server velocities. - delta.warpOffset = pos - delta.pos; + mDelta.warpOffset = pos - mDelta.pos; F32 as = (speed + mVelocity.len()) * 0.5f * TickSec; - F32 dt = (as > 0.00001f) ? delta.warpOffset.len() / as: sMaxWarpTicks; - delta.warpTicks = (S32)((dt > sMinWarpTicks) ? getMax(mFloor(dt + 0.5f), 1.0f) : 0.0f); + F32 dt = (as > 0.00001f) ? mDelta.warpOffset.len() / as: sMaxWarpTicks; + mDelta.warpTicks = (S32)((dt > sMinWarpTicks) ? getMax(mFloor(dt + 0.5f), 1.0f) : 0.0f); - if (delta.warpTicks) + if (mDelta.warpTicks) { // Setup the warp to start on the next tick. - if (delta.warpTicks > sMaxWarpTicks) - delta.warpTicks = sMaxWarpTicks; - delta.warpOffset /= (F32)delta.warpTicks; + if (mDelta.warpTicks > sMaxWarpTicks) + mDelta.warpTicks = sMaxWarpTicks; + mDelta.warpOffset /= (F32)mDelta.warpTicks; - delta.rotOffset = rot - delta.rot; + mDelta.rotOffset = rot - mDelta.rot; // Ignore small rotation differences - if (mFabs(delta.rotOffset.z) < 0.001f) - delta.rotOffset.z = 0; + if (mFabs(mDelta.rotOffset.z) < 0.001f) + mDelta.rotOffset.z = 0; // Wrap rotation to +/-PI - if(delta.rotOffset.z < - M_PI_F) - delta.rotOffset.z += M_2PI_F; - else if(delta.rotOffset.z > M_PI_F) - delta.rotOffset.z -= M_2PI_F; + if(mDelta.rotOffset.z < - M_PI_F) + mDelta.rotOffset.z += M_2PI_F; + else if(mDelta.rotOffset.z > M_PI_F) + mDelta.rotOffset.z -= M_2PI_F; - delta.rotOffset /= (F32)delta.warpTicks; + mDelta.rotOffset /= (F32)mDelta.warpTicks; } else { // Going to skip the warp, server and client are real close. // Adjust the frame interpolation to move smoothly to the // new position within the current tick. - Point3F cp = delta.pos + delta.posVec * delta.dt; - if (delta.dt == 0) + Point3F cp = mDelta.pos + mDelta.posVec * mDelta.dt; + if (mDelta.dt == 0) { - delta.posVec.set(0.0f, 0.0f, 0.0f); - delta.rotVec.set(0.0f, 0.0f, 0.0f); + mDelta.posVec.set(0.0f, 0.0f, 0.0f); + mDelta.rotVec.set(0.0f, 0.0f, 0.0f); } else { - F32 dti = 1.0f / delta.dt; - delta.posVec = (cp - pos) * dti; - delta.rotVec.z = mRot.z - rot.z; + F32 dti = 1.0f / mDelta.dt; + mDelta.posVec = (cp - pos) * dti; + mDelta.rotVec.z = mRot.z - rot.z; - if(delta.rotVec.z > M_PI_F) - delta.rotVec.z -= M_2PI_F; - else if(delta.rotVec.z < -M_PI_F) - delta.rotVec.z += M_2PI_F; + if(mDelta.rotVec.z > M_PI_F) + mDelta.rotVec.z -= M_2PI_F; + else if(mDelta.rotVec.z < -M_PI_F) + mDelta.rotVec.z += M_2PI_F; - delta.rotVec.z *= dti; + mDelta.rotVec.z *= dti; } - delta.pos = pos; - delta.rot = rot; + mDelta.pos = pos; + mDelta.rot = rot; if (!ignore_updates) setPosition(pos,rot); } @@ -6523,12 +6523,12 @@ void Player::unpackUpdate(NetConnection *con, BitStream *stream) else { // Set the player to the server position - delta.pos = pos; - delta.rot = rot; - delta.posVec.set(0.0f, 0.0f, 0.0f); - delta.rotVec.set(0.0f, 0.0f, 0.0f); - delta.warpTicks = 0; - delta.dt = 0.0f; + mDelta.pos = pos; + mDelta.rot = rot; + mDelta.posVec.set(0.0f, 0.0f, 0.0f); + mDelta.rotVec.set(0.0f, 0.0f, 0.0f); + mDelta.warpTicks = 0; + mDelta.dt = 0.0f; if (!ignore_updates) setPosition(pos,rot); } diff --git a/Engine/source/T3D/player.h b/Engine/source/T3D/player.h index 0b4545114..3e1cb5e50 100644 --- a/Engine/source/T3D/player.h +++ b/Engine/source/T3D/player.h @@ -436,7 +436,7 @@ protected: Point3F rotOffset; /// @} }; - StateDelta delta; ///< Used for interpolation on the client. @see StateDelta + StateDelta mDelta; ///< Used for interpolation on the client. @see StateDelta S32 mPredictionCount; ///< Number of ticks to predict // Current pos, vel etc. diff --git a/Engine/source/T3D/projectile.cpp b/Engine/source/T3D/projectile.cpp index 7e77385a2..e457f6b2d 100644 --- a/Engine/source/T3D/projectile.cpp +++ b/Engine/source/T3D/projectile.cpp @@ -828,7 +828,7 @@ bool Projectile::onAdd() // Setup our bounding box if (bool(mDataBlock->projectileShape) == true) - mObjBox = mDataBlock->projectileShape->bounds; + mObjBox = mDataBlock->projectileShape->mBounds; else mObjBox = Box3F(Point3F(0, 0, 0), Point3F(0, 0, 0)); diff --git a/Engine/source/T3D/proximityMine.cpp b/Engine/source/T3D/proximityMine.cpp index bf43ab8c9..2102ef7e1 100644 --- a/Engine/source/T3D/proximityMine.cpp +++ b/Engine/source/T3D/proximityMine.cpp @@ -386,8 +386,8 @@ void ProximityMine::setDeployedPos( const Point3F& pos, const Point3F& normal ) MathUtils::getMatrixFromUpVector( normal, &mat ); mat.setPosition( pos + normal * mObjBox.minExtents.z ); - delta.pos = pos; - delta.posVec.set(0, 0, 0); + mDelta.pos = pos; + mDelta.posVec.set(0, 0, 0); ShapeBase::setTransform( mat ); if ( mPhysicsRep ) diff --git a/Engine/source/T3D/rigidShape.cpp b/Engine/source/T3D/rigidShape.cpp index c7f876305..69144461f 100644 --- a/Engine/source/T3D/rigidShape.cpp +++ b/Engine/source/T3D/rigidShape.cpp @@ -1194,7 +1194,7 @@ bool RigidShape::updateCollision(F32 dt) mCollisionList.clear(); CollisionState *state = mConvex.findClosestState(cmat, getScale(), mDataBlock->collisionTol); - if (state && state->dist <= mDataBlock->collisionTol) + if (state && state->mDist <= mDataBlock->collisionTol) { //resolveDisplacement(ns,state,dt); mConvex.getCollisionInfo(cmat, getScale(), &mCollisionList, mDataBlock->collisionTol); @@ -1326,8 +1326,8 @@ bool RigidShape::resolveContacts(Rigid& ns,CollisionList& cList,F32 dt) bool RigidShape::resolveDisplacement(Rigid& ns,CollisionState *state, F32 dt) { - SceneObject* obj = (state->a->getObject() == this)? - state->b->getObject(): state->a->getObject(); + SceneObject* obj = (state->mA->getObject() == this)? + state->mB->getObject(): state->mA->getObject(); if (obj->isDisplacable() && ((obj->getTypeMask() & ShapeBaseObjectType) != 0)) { diff --git a/Engine/source/T3D/shapeBase.cpp b/Engine/source/T3D/shapeBase.cpp index 0541bce55..3e88c482f 100644 --- a/Engine/source/T3D/shapeBase.cpp +++ b/Engine/source/T3D/shapeBase.cpp @@ -405,17 +405,17 @@ bool ShapeBaseData::preload(bool server, String &errorStr) mShape->computeBounds(collisionDetails.last(), collisionBounds.last()); mShape->getAccelerator(collisionDetails.last()); - if (!mShape->bounds.isContained(collisionBounds.last())) + if (!mShape->mBounds.isContained(collisionBounds.last())) { if (!silent_bbox_check) Con::warnf("Warning: shape %s collision detail %d (Collision-%d) bounds exceed that of shape.", shapeName, collisionDetails.size() - 1, collisionDetails.last()); - collisionBounds.last() = mShape->bounds; + collisionBounds.last() = mShape->mBounds; } else if (collisionBounds.last().isValidBox() == false) { if (!silent_bbox_check) Con::errorf("Error: shape %s-collision detail %d (Collision-%d) bounds box invalid!", shapeName, collisionDetails.size() - 1, collisionDetails.last()); - collisionBounds.last() = mShape->bounds; + collisionBounds.last() = mShape->mBounds; } // The way LOS works is that it will check to see if there is a LOS detail that matches @@ -482,7 +482,7 @@ bool ShapeBaseData::preload(bool server, String &errorStr) damageSequence = mShape->findSequence("Damage"); // - F32 w = mShape->bounds.len_y() / 2; + F32 w = mShape->mBounds.len_y() / 2; if (cameraMaxDist < w) cameraMaxDist = w; // just parse up the string and collect the remappings in txr_tag_remappings. @@ -707,7 +707,7 @@ DefineEngineMethod( ShapeBaseData, checkDeployPos, bool, ( TransformF txfm ),, MatrixF mat = txfm.getMatrix(); - Box3F objBox = object->mShape->bounds; + Box3F objBox = object->mShape->mBounds; Point3F boxCenter = (objBox.minExtents + objBox.maxExtents) * 0.5f; objBox.minExtents = boxCenter + (objBox.minExtents - boxCenter) * 0.9f; objBox.maxExtents = boxCenter + (objBox.maxExtents - boxCenter) * 0.9f; @@ -808,7 +808,7 @@ void ShapeBaseData::packData(BitStream* stream) if( stream->writeFlag( debris != NULL ) ) { - stream->writeRangedU32(packed? SimObjectId((uintptr_t)debris): + stream->writeRangedU32(mPacked? SimObjectId((uintptr_t)debris): debris->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast); } @@ -1275,7 +1275,7 @@ bool ShapeBase::onNewDataBlock( GameBaseData *dptr, bool reload ) } } - mObjBox = mDataBlock->mShape->bounds; + mObjBox = mDataBlock->mShape->mBounds; resetWorldBox(); // Set the initial mesh hidden state. @@ -2801,7 +2801,7 @@ void ShapeBase::_renderBoundingBox( ObjectRenderInst *ri, SceneRenderState *stat MatrixF mat; getRenderImageTransform( ri->objectIndex, &mat ); - const Box3F &objBox = image.shapeInstance[getImageShapeIndex(image)]->getShape()->bounds; + const Box3F &objBox = image.shapeInstance[getImageShapeIndex(image)]->getShape()->mBounds; drawer->drawCube( desc, objBox, ColorI( 255, 255, 255 ), &mat ); } @@ -3315,23 +3315,23 @@ void ShapeBase::unpackUpdate(NetConnection *con, BitStream *stream) bool datablockChange = image.dataBlock != imageData; if (datablockChange || (image.skinNameHandle != skinDesiredNameHandle)) { - MountedImage& image = mMountedImageList[i]; - image.scriptAnimPrefix = scriptDesiredAnimPrefix; + MountedImage& neoImage = mMountedImageList[i]; + neoImage.scriptAnimPrefix = scriptDesiredAnimPrefix; setImage( i, imageData, - skinDesiredNameHandle, image.loaded, - image.ammo, image.triggerDown, image.altTriggerDown, - image.motion, image.genericTrigger[0], image.genericTrigger[1], image.genericTrigger[2], image.genericTrigger[3], - image.target); + skinDesiredNameHandle, neoImage.loaded, + neoImage.ammo, neoImage.triggerDown, neoImage.altTriggerDown, + neoImage.motion, neoImage.genericTrigger[0], neoImage.genericTrigger[1], neoImage.genericTrigger[2], neoImage.genericTrigger[3], + neoImage.target); } if (!datablockChange && image.scriptAnimPrefix != scriptDesiredAnimPrefix) { // We don't have a new image, but we do have a new script anim prefix to work with. // Notify the image of this change. - MountedImage& image = mMountedImageList[i]; - image.scriptAnimPrefix = scriptDesiredAnimPrefix; - updateAnimThread(i, getImageShapeIndex(image)); + MountedImage& animImage = mMountedImageList[i]; + animImage.scriptAnimPrefix = scriptDesiredAnimPrefix; + updateAnimThread(i, getImageShapeIndex(animImage)); } bool isFiring = stream->readFlag(); @@ -3586,8 +3586,8 @@ void ShapeBaseConvex::getFeatures(const MatrixF& mat, const VectorF& n, ConvexFe U32 numVerts = emitString[currPos++]; for (i = 0; i < numVerts; i++) { cf->mVertexList.increment(); - U32 index = emitString[currPos++]; - mat.mulP(pAccel->vertexList[index], &cf->mVertexList.last()); + U32 vListIDx = emitString[currPos++]; + mat.mulP(pAccel->vertexList[vListIDx], &cf->mVertexList.last()); } U32 numEdges = emitString[currPos++]; diff --git a/Engine/source/T3D/shapeImage.cpp b/Engine/source/T3D/shapeImage.cpp index 4319baa4e..56d413a2b 100644 --- a/Engine/source/T3D/shapeImage.cpp +++ b/Engine/source/T3D/shapeImage.cpp @@ -1019,7 +1019,7 @@ void ShapeBaseImageData::packData(BitStream* stream) // Write the projectile datablock if (stream->writeFlag(projectile)) - stream->writeRangedU32(packed? SimObjectId((uintptr_t)projectile): + stream->writeRangedU32(mPacked ? SimObjectId((uintptr_t)projectile): projectile->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast); stream->writeFlag(cloakable); @@ -1050,7 +1050,7 @@ void ShapeBaseImageData::packData(BitStream* stream) if( stream->writeFlag( casing ) ) { - stream->writeRangedU32(packed? SimObjectId((uintptr_t)casing): + stream->writeRangedU32(mPacked ? SimObjectId((uintptr_t)casing): casing->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast); } @@ -1139,7 +1139,7 @@ void ShapeBaseImageData::packData(BitStream* stream) if (stream->writeFlag(s.emitter)) { - stream->writeRangedU32(packed? SimObjectId((uintptr_t)s.emitter): + stream->writeRangedU32(mPacked ? SimObjectId((uintptr_t)s.emitter): s.emitter->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast); stream->write(s.emitterTime); diff --git a/Engine/source/T3D/systems/render/meshRenderSystem.cpp b/Engine/source/T3D/systems/render/meshRenderSystem.cpp index fe1ec6f84..39b163601 100644 --- a/Engine/source/T3D/systems/render/meshRenderSystem.cpp +++ b/Engine/source/T3D/systems/render/meshRenderSystem.cpp @@ -350,9 +350,9 @@ void MeshRenderSystem::rebuildBuffers() U16 *pIndex; buffers.primitiveBuffer.lock(&pIndex); - for (U16 i = 0; i < buffers.primData.size(); i++) + for (U16 primDataIDx = 0; primDataIDx < buffers.primData.size(); primDataIDx++) { - *pIndex = i; + *pIndex = primDataIDx; pIndex++; } diff --git a/Engine/source/T3D/trigger.cpp b/Engine/source/T3D/trigger.cpp index 64305314f..52d6898eb 100644 --- a/Engine/source/T3D/trigger.cpp +++ b/Engine/source/T3D/trigger.cpp @@ -245,16 +245,16 @@ ConsoleGetType( TypeTriggerPolyhedron ) Polyhedron* pPoly = reinterpret_cast(dptr); // First point is corner, need to find the three vectors...` - Point3F origin = pPoly->pointList[0]; + Point3F origin = pPoly->mPointList[0]; U32 currVec = 0; Point3F vecs[3]; - for (i = 0; i < pPoly->edgeList.size(); i++) { - const U32 *vertex = pPoly->edgeList[i].vertex; + for (i = 0; i < pPoly->mEdgeList.size(); i++) { + const U32 *vertex = pPoly->mEdgeList[i].vertex; if (vertex[0] == 0) - vecs[currVec++] = pPoly->pointList[vertex[1]] - origin; + vecs[currVec++] = pPoly->mPointList[vertex[1]] - origin; else if (vertex[1] == 0) - vecs[currVec++] = pPoly->pointList[vertex[0]] - origin; + vecs[currVec++] = pPoly->mPointList[vertex[0]] - origin; } AssertFatal(currVec == 3, "Internal error: Bad trigger polyhedron"); @@ -302,45 +302,45 @@ ConsoleSetType( TypeTriggerPolyhedron ) // edges with CCW instead of CW order for face[0] and that it b) lets plane // normals face outwards rather than inwards. - pPoly->pointList.setSize(8); - pPoly->pointList[0] = origin; - pPoly->pointList[1] = origin + vecs[0]; - pPoly->pointList[2] = origin + vecs[1]; - pPoly->pointList[3] = origin + vecs[2]; - pPoly->pointList[4] = origin + vecs[0] + vecs[1]; - pPoly->pointList[5] = origin + vecs[0] + vecs[2]; - pPoly->pointList[6] = origin + vecs[1] + vecs[2]; - pPoly->pointList[7] = origin + vecs[0] + vecs[1] + vecs[2]; + pPoly->mPointList.setSize(8); + pPoly->mPointList[0] = origin; + pPoly->mPointList[1] = origin + vecs[0]; + pPoly->mPointList[2] = origin + vecs[1]; + pPoly->mPointList[3] = origin + vecs[2]; + pPoly->mPointList[4] = origin + vecs[0] + vecs[1]; + pPoly->mPointList[5] = origin + vecs[0] + vecs[2]; + pPoly->mPointList[6] = origin + vecs[1] + vecs[2]; + pPoly->mPointList[7] = origin + vecs[0] + vecs[1] + vecs[2]; Point3F normal; - pPoly->planeList.setSize(6); + pPoly->mPlaneList.setSize(6); mCross(vecs[2], vecs[0], &normal); - pPoly->planeList[0].set(origin, normal); + pPoly->mPlaneList[0].set(origin, normal); mCross(vecs[0], vecs[1], &normal); - pPoly->planeList[1].set(origin, normal); + pPoly->mPlaneList[1].set(origin, normal); mCross(vecs[1], vecs[2], &normal); - pPoly->planeList[2].set(origin, normal); + pPoly->mPlaneList[2].set(origin, normal); mCross(vecs[1], vecs[0], &normal); - pPoly->planeList[3].set(pPoly->pointList[7], normal); + pPoly->mPlaneList[3].set(pPoly->mPointList[7], normal); mCross(vecs[2], vecs[1], &normal); - pPoly->planeList[4].set(pPoly->pointList[7], normal); + pPoly->mPlaneList[4].set(pPoly->mPointList[7], normal); mCross(vecs[0], vecs[2], &normal); - pPoly->planeList[5].set(pPoly->pointList[7], normal); + pPoly->mPlaneList[5].set(pPoly->mPointList[7], normal); - pPoly->edgeList.setSize(12); - pPoly->edgeList[0].vertex[0] = 0; pPoly->edgeList[0].vertex[1] = 1; pPoly->edgeList[0].face[0] = 0; pPoly->edgeList[0].face[1] = 1; - pPoly->edgeList[1].vertex[0] = 1; pPoly->edgeList[1].vertex[1] = 5; pPoly->edgeList[1].face[0] = 0; pPoly->edgeList[1].face[1] = 4; - pPoly->edgeList[2].vertex[0] = 5; pPoly->edgeList[2].vertex[1] = 3; pPoly->edgeList[2].face[0] = 0; pPoly->edgeList[2].face[1] = 3; - pPoly->edgeList[3].vertex[0] = 3; pPoly->edgeList[3].vertex[1] = 0; pPoly->edgeList[3].face[0] = 0; pPoly->edgeList[3].face[1] = 2; - pPoly->edgeList[4].vertex[0] = 3; pPoly->edgeList[4].vertex[1] = 6; pPoly->edgeList[4].face[0] = 3; pPoly->edgeList[4].face[1] = 2; - pPoly->edgeList[5].vertex[0] = 6; pPoly->edgeList[5].vertex[1] = 2; pPoly->edgeList[5].face[0] = 2; pPoly->edgeList[5].face[1] = 5; - pPoly->edgeList[6].vertex[0] = 2; pPoly->edgeList[6].vertex[1] = 0; pPoly->edgeList[6].face[0] = 2; pPoly->edgeList[6].face[1] = 1; - pPoly->edgeList[7].vertex[0] = 1; pPoly->edgeList[7].vertex[1] = 4; pPoly->edgeList[7].face[0] = 4; pPoly->edgeList[7].face[1] = 1; - pPoly->edgeList[8].vertex[0] = 4; pPoly->edgeList[8].vertex[1] = 2; pPoly->edgeList[8].face[0] = 1; pPoly->edgeList[8].face[1] = 5; - pPoly->edgeList[9].vertex[0] = 4; pPoly->edgeList[9].vertex[1] = 7; pPoly->edgeList[9].face[0] = 4; pPoly->edgeList[9].face[1] = 5; - pPoly->edgeList[10].vertex[0] = 5; pPoly->edgeList[10].vertex[1] = 7; pPoly->edgeList[10].face[0] = 3; pPoly->edgeList[10].face[1] = 4; - pPoly->edgeList[11].vertex[0] = 7; pPoly->edgeList[11].vertex[1] = 6; pPoly->edgeList[11].face[0] = 3; pPoly->edgeList[11].face[1] = 5; + pPoly->mEdgeList.setSize(12); + pPoly->mEdgeList[0].vertex[0] = 0; pPoly->mEdgeList[0].vertex[1] = 1; pPoly->mEdgeList[0].face[0] = 0; pPoly->mEdgeList[0].face[1] = 1; + pPoly->mEdgeList[1].vertex[0] = 1; pPoly->mEdgeList[1].vertex[1] = 5; pPoly->mEdgeList[1].face[0] = 0; pPoly->mEdgeList[1].face[1] = 4; + pPoly->mEdgeList[2].vertex[0] = 5; pPoly->mEdgeList[2].vertex[1] = 3; pPoly->mEdgeList[2].face[0] = 0; pPoly->mEdgeList[2].face[1] = 3; + pPoly->mEdgeList[3].vertex[0] = 3; pPoly->mEdgeList[3].vertex[1] = 0; pPoly->mEdgeList[3].face[0] = 0; pPoly->mEdgeList[3].face[1] = 2; + pPoly->mEdgeList[4].vertex[0] = 3; pPoly->mEdgeList[4].vertex[1] = 6; pPoly->mEdgeList[4].face[0] = 3; pPoly->mEdgeList[4].face[1] = 2; + pPoly->mEdgeList[5].vertex[0] = 6; pPoly->mEdgeList[5].vertex[1] = 2; pPoly->mEdgeList[5].face[0] = 2; pPoly->mEdgeList[5].face[1] = 5; + pPoly->mEdgeList[6].vertex[0] = 2; pPoly->mEdgeList[6].vertex[1] = 0; pPoly->mEdgeList[6].face[0] = 2; pPoly->mEdgeList[6].face[1] = 1; + pPoly->mEdgeList[7].vertex[0] = 1; pPoly->mEdgeList[7].vertex[1] = 4; pPoly->mEdgeList[7].face[0] = 4; pPoly->mEdgeList[7].face[1] = 1; + pPoly->mEdgeList[8].vertex[0] = 4; pPoly->mEdgeList[8].vertex[1] = 2; pPoly->mEdgeList[8].face[0] = 1; pPoly->mEdgeList[8].face[1] = 5; + pPoly->mEdgeList[9].vertex[0] = 4; pPoly->mEdgeList[9].vertex[1] = 7; pPoly->mEdgeList[9].face[0] = 4; pPoly->mEdgeList[9].face[1] = 5; + pPoly->mEdgeList[10].vertex[0] = 5; pPoly->mEdgeList[10].vertex[1] = 7; pPoly->mEdgeList[10].face[0] = 3; pPoly->mEdgeList[10].face[1] = 4; + pPoly->mEdgeList[11].vertex[0] = 7; pPoly->mEdgeList[11].vertex[1] = 6; pPoly->mEdgeList[11].face[0] = 3; pPoly->mEdgeList[11].face[1] = 5; } @@ -569,12 +569,12 @@ void Trigger::setTriggerPolyhedron(const Polyhedron& rPolyhedron) { mTriggerPolyhedron = rPolyhedron; - if (mTriggerPolyhedron.pointList.size() != 0) { + if (mTriggerPolyhedron.mPointList.size() != 0) { mObjBox.minExtents.set(1e10, 1e10, 1e10); mObjBox.maxExtents.set(-1e10, -1e10, -1e10); - for (U32 i = 0; i < mTriggerPolyhedron.pointList.size(); i++) { - mObjBox.minExtents.setMin(mTriggerPolyhedron.pointList[i]); - mObjBox.maxExtents.setMax(mTriggerPolyhedron.pointList[i]); + for (U32 i = 0; i < mTriggerPolyhedron.mPointList.size(); i++) { + mObjBox.minExtents.setMin(mTriggerPolyhedron.mPointList[i]); + mObjBox.maxExtents.setMax(mTriggerPolyhedron.mPointList[i]); } } else { mObjBox.minExtents.set(-0.5, -0.5, -0.5); @@ -585,7 +585,7 @@ void Trigger::setTriggerPolyhedron(const Polyhedron& rPolyhedron) setTransform(xform); mClippedList.clear(); - mClippedList.mPlaneList = mTriggerPolyhedron.planeList; + mClippedList.mPlaneList = mTriggerPolyhedron.mPlaneList; // for (U32 i = 0; i < mClippedList.mPlaneList.size(); i++) // mClippedList.mPlaneList[i].neg(); @@ -623,7 +623,7 @@ void Trigger::setTriggerPolyhedron(const Polyhedron& rPolyhedron) bool Trigger::testObject(GameBase* enter) { - if (mTriggerPolyhedron.pointList.size() == 0) + if (mTriggerPolyhedron.mPointList.size() == 0) return false; mClippedList.clear(); @@ -731,17 +731,17 @@ U32 Trigger::packUpdate(NetConnection* con, U32 mask, BitStream* stream) // Write the polyhedron if( stream->writeFlag( mask & PolyMask ) ) { - stream->write(mTriggerPolyhedron.pointList.size()); - for (i = 0; i < mTriggerPolyhedron.pointList.size(); i++) - mathWrite(*stream, mTriggerPolyhedron.pointList[i]); + stream->write(mTriggerPolyhedron.mPointList.size()); + for (i = 0; i < mTriggerPolyhedron.mPointList.size(); i++) + mathWrite(*stream, mTriggerPolyhedron.mPointList[i]); - stream->write(mTriggerPolyhedron.planeList.size()); - for (i = 0; i < mTriggerPolyhedron.planeList.size(); i++) - mathWrite(*stream, mTriggerPolyhedron.planeList[i]); + stream->write(mTriggerPolyhedron.mPlaneList.size()); + for (i = 0; i < mTriggerPolyhedron.mPlaneList.size(); i++) + mathWrite(*stream, mTriggerPolyhedron.mPlaneList[i]); - stream->write(mTriggerPolyhedron.edgeList.size()); - for (i = 0; i < mTriggerPolyhedron.edgeList.size(); i++) { - const Polyhedron::Edge& rEdge = mTriggerPolyhedron.edgeList[i]; + stream->write(mTriggerPolyhedron.mEdgeList.size()); + for (i = 0; i < mTriggerPolyhedron.mEdgeList.size(); i++) { + const Polyhedron::Edge& rEdge = mTriggerPolyhedron.mEdgeList[i]; stream->write(rEdge.face[0]); stream->write(rEdge.face[1]); @@ -779,19 +779,19 @@ void Trigger::unpackUpdate(NetConnection* con, BitStream* stream) { Polyhedron tempPH; stream->read(&size); - tempPH.pointList.setSize(size); - for (i = 0; i < tempPH.pointList.size(); i++) - mathRead(*stream, &tempPH.pointList[i]); + tempPH.mPointList.setSize(size); + for (i = 0; i < tempPH.mPointList.size(); i++) + mathRead(*stream, &tempPH.mPointList[i]); stream->read(&size); - tempPH.planeList.setSize(size); - for (i = 0; i < tempPH.planeList.size(); i++) - mathRead(*stream, &tempPH.planeList[i]); + tempPH.mPlaneList.setSize(size); + for (i = 0; i < tempPH.mPlaneList.size(); i++) + mathRead(*stream, &tempPH.mPlaneList[i]); stream->read(&size); - tempPH.edgeList.setSize(size); - for (i = 0; i < tempPH.edgeList.size(); i++) { - Polyhedron::Edge& rEdge = tempPH.edgeList[i]; + tempPH.mEdgeList.setSize(size); + for (i = 0; i < tempPH.mEdgeList.size(); i++) { + Polyhedron::Edge& rEdge = tempPH.mEdgeList[i]; stream->read(&rEdge.face[0]); stream->read(&rEdge.face[1]); diff --git a/Engine/source/T3D/tsStatic.cpp b/Engine/source/T3D/tsStatic.cpp index d88207eb0..7797795a5 100644 --- a/Engine/source/T3D/tsStatic.cpp +++ b/Engine/source/T3D/tsStatic.cpp @@ -373,7 +373,7 @@ bool TSStatic::_createShape() NetConnection::filesWereDownloaded() ) return false; - mObjBox = mShape->bounds; + mObjBox = mShape->mBounds; resetWorldBox(); mShapeInstance = new TSShapeInstance( mShape, isClientObject() ); diff --git a/Engine/source/T3D/vehicles/flyingVehicle.cpp b/Engine/source/T3D/vehicles/flyingVehicle.cpp index 855850ea8..2ee5bc375 100644 --- a/Engine/source/T3D/vehicles/flyingVehicle.cpp +++ b/Engine/source/T3D/vehicles/flyingVehicle.cpp @@ -244,7 +244,7 @@ void FlyingVehicleData::packData(BitStream* stream) { if (stream->writeFlag(sound[i])) { - SimObjectId writtenId = packed ? SimObjectId((uintptr_t)sound[i]) : sound[i]->getId(); + SimObjectId writtenId = mPacked ? SimObjectId((uintptr_t)sound[i]) : sound[i]->getId(); stream->writeRangedU32(writtenId, DataBlockObjectIdFirst, DataBlockObjectIdLast); } } @@ -253,7 +253,7 @@ void FlyingVehicleData::packData(BitStream* stream) { if (stream->writeFlag(jetEmitter[j])) { - SimObjectId writtenId = packed ? SimObjectId((uintptr_t)jetEmitter[j]) : jetEmitter[j]->getId(); + SimObjectId writtenId = mPacked ? SimObjectId((uintptr_t)jetEmitter[j]) : jetEmitter[j]->getId(); stream->writeRangedU32(writtenId, DataBlockObjectIdFirst,DataBlockObjectIdLast); } } @@ -731,10 +731,10 @@ void FlyingVehicle::updateEmitter(bool active,F32 dt,ParticleEmitterData *emitte } } else { - for (S32 j = idx; j < idx + count; j++) - if (bool(mJetEmitter[j])) { - mJetEmitter[j]->deleteWhenEmpty(); - mJetEmitter[j] = 0; + for (S32 k = idx; k < idx + count; k++) + if (bool(mJetEmitter[k])) { + mJetEmitter[k]->deleteWhenEmpty(); + mJetEmitter[k] = 0; } } } diff --git a/Engine/source/T3D/vehicles/hoverVehicle.cpp b/Engine/source/T3D/vehicles/hoverVehicle.cpp index 35784d26b..1f1d259b5 100644 --- a/Engine/source/T3D/vehicles/hoverVehicle.cpp +++ b/Engine/source/T3D/vehicles/hoverVehicle.cpp @@ -362,14 +362,14 @@ void HoverVehicleData::packData(BitStream* stream) for (S32 i = 0; i < MaxSounds; i++) if (stream->writeFlag(sound[i])) - stream->writeRangedU32(packed? SimObjectId((uintptr_t)sound[i]): + stream->writeRangedU32(mPacked ? SimObjectId((uintptr_t)sound[i]): sound[i]->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast); for (S32 j = 0; j < MaxJetEmitters; j++) { if (stream->writeFlag(jetEmitter[j])) { - SimObjectId writtenId = packed ? SimObjectId((uintptr_t)jetEmitter[j]) : jetEmitter[j]->getId(); + SimObjectId writtenId = mPacked ? SimObjectId((uintptr_t)jetEmitter[j]) : jetEmitter[j]->getId(); stream->writeRangedU32(writtenId, DataBlockObjectIdFirst,DataBlockObjectIdLast); } } @@ -965,10 +965,10 @@ void HoverVehicle::updateEmitter(bool active,F32 dt,ParticleEmitterData *emitter } } else { - for (S32 j = idx; j < idx + count; j++) - if (bool(mJetEmitter[j])) { - mJetEmitter[j]->deleteWhenEmpty(); - mJetEmitter[j] = 0; + for (S32 k = idx; k < idx + count; k++) + if (bool(mJetEmitter[k])) { + mJetEmitter[k]->deleteWhenEmpty(); + mJetEmitter[k] = 0; } } } diff --git a/Engine/source/T3D/vehicles/vehicle.cpp b/Engine/source/T3D/vehicles/vehicle.cpp index cdfff2827..18a7c4466 100644 --- a/Engine/source/T3D/vehicles/vehicle.cpp +++ b/Engine/source/T3D/vehicles/vehicle.cpp @@ -277,7 +277,7 @@ void VehicleData::packData(BitStream* stream) stream->write(body.friction); for (i = 0; i < Body::MaxSounds; i++) if (stream->writeFlag(body.sound[i])) - stream->writeRangedU32(packed? SimObjectId((uintptr_t)body.sound[i]): + stream->writeRangedU32(mPacked ? SimObjectId((uintptr_t)body.sound[i]): body.sound[i]->getId(),DataBlockObjectIdFirst, DataBlockObjectIdLast); @@ -1364,7 +1364,7 @@ bool Vehicle::updateCollision(F32 dt) mCollisionList.clear(); CollisionState *state = mConvex.findClosestState(cmat, getScale(), mDataBlock->collisionTol); - if (state && state->dist <= mDataBlock->collisionTol) + if (state && state->mDist <= mDataBlock->collisionTol) { //resolveDisplacement(ns,state,dt); mConvex.getCollisionInfo(cmat, getScale(), &mCollisionList, mDataBlock->collisionTol); @@ -1497,8 +1497,8 @@ bool Vehicle::resolveDisplacement(Rigid& ns,CollisionState *state, F32 dt) { PROFILE_SCOPE( Vehicle_ResolveDisplacement ); - SceneObject* obj = (state->a->getObject() == this)? - state->b->getObject(): state->a->getObject(); + SceneObject* obj = (state->mA->getObject() == this)? + state->mB->getObject(): state->mA->getObject(); if (obj->isDisplacable() && ((obj->getTypeMask() & ShapeBaseObjectType) != 0)) { diff --git a/Engine/source/T3D/vehicles/wheeledVehicle.cpp b/Engine/source/T3D/vehicles/wheeledVehicle.cpp index 17cfdfe6a..f4f272fd3 100644 --- a/Engine/source/T3D/vehicles/wheeledVehicle.cpp +++ b/Engine/source/T3D/vehicles/wheeledVehicle.cpp @@ -111,7 +111,7 @@ bool WheeledVehicleTire::preload(bool server, String &errorStr) // Determinw wheel radius from the shape's bounding box. // The tire should be built with it's hub axis along the // object's Y axis. - radius = shape->bounds.len_z() / 2; + radius = shape->mBounds.len_z() / 2; } return true; @@ -400,7 +400,7 @@ bool WheeledVehicleData::preload(bool server, String &errorStr) MatrixF imat(1); SphereF sphere; sphere.center = mShape->center; - sphere.radius = mShape->radius; + sphere.radius = mShape->mRadius; PlaneExtractorPolyList polyList; polyList.mPlaneList = &rigidBody.mPlaneList; polyList.setTransform(&imat, Point3F(1,1,1)); @@ -477,7 +477,7 @@ void WheeledVehicleData::packData(BitStream* stream) Parent::packData(stream); if (stream->writeFlag(tireEmitter)) - stream->writeRangedU32(packed? SimObjectId((uintptr_t)tireEmitter): + stream->writeRangedU32(mPacked ? SimObjectId((uintptr_t)tireEmitter): tireEmitter->getId(),DataBlockObjectIdFirst,DataBlockObjectIdLast); for (S32 i = 0; i < MaxSounds; i++) diff --git a/Engine/source/afx/afxCamera.cpp b/Engine/source/afx/afxCamera.cpp index 63ad635ac..84acee518 100644 --- a/Engine/source/afx/afxCamera.cpp +++ b/Engine/source/afx/afxCamera.cpp @@ -99,11 +99,11 @@ afxCamera::afxCamera() { mNetFlags.clear(Ghostable); mTypeMask |= CameraObjectType; - delta.pos = Point3F(0,0,100); - delta.rot = Point3F(0,0,0); - delta.posVec = delta.rotVec = VectorF(0,0,0); - mObjToWorld.setColumn(3,delta.pos); - mRot = delta.rot; + mDelta.pos = Point3F(0,0,100); + mDelta.rot = Point3F(0,0,0); + mDelta.posVec = mDelta.rotVec = VectorF(0,0,0); + mObjToWorld.setColumn(3, mDelta.pos); + mRot = mDelta.rot; mMinOrbitDist = 0; mMaxOrbitDist = 0; @@ -111,19 +111,19 @@ afxCamera::afxCamera() mOrbitObject = NULL; mPosition.set(0.f, 0.f, 0.f); mObservingClientObject = false; - mode = FlyMode; + mMode = FlyMode; - cam_subject = NULL; - coi_offset.set(0, 0, 2); - cam_offset.set(0, 0, 0); - cam_distance = 0.0f; - cam_angle = 0.0f; - cam_dirty = false; + mCam_subject = NULL; + mCoi_offset.set(0, 0, 2); + mCam_offset.set(0, 0, 0); + mCam_distance = 0.0f; + mCam_angle = 0.0f; + mCam_dirty = false; - flymode_saved = false; - third_person_snap_s = 1; - third_person_snap_c = 1; - flymode_saved_pos.zero(); + mFlymode_saved = false; + mThird_person_snap_s = 1; + mThird_person_snap_c = 1; + mFlymode_saved_pos.zero(); mDamageState = Disabled; } @@ -136,7 +136,7 @@ afxCamera::~afxCamera() void afxCamera::cam_update(F32 dt, bool on_server) { - if (mode == ThirdPersonMode && cam_subject) + if (mMode == ThirdPersonMode && mCam_subject) cam_update_3pov(dt, on_server); } @@ -176,9 +176,9 @@ Point3F &afxCamera::getPosition() //---------------------------------------------------------------------------- void afxCamera::setFlyMode() { - mode = FlyMode; - if (flymode_saved) - snapToPosition(flymode_saved_pos); + mMode = FlyMode; + if (mFlymode_saved) + snapToPosition(mFlymode_saved_pos); if (bool(mOrbitObject)) { @@ -202,11 +202,11 @@ void afxCamera::setOrbitMode(GameBase *obj, Point3F &pos, AngAxisF &rot, F32 min processAfter(mOrbitObject); deleteNotify(mOrbitObject); mOrbitObject->getWorldBox().getCenter(&mPosition); - mode = OrbitObjectMode; + mMode = OrbitObjectMode; } else { - mode = OrbitPointMode; + mMode = OrbitPointMode; mPosition = pos; } @@ -278,14 +278,14 @@ void afxCamera::snapToPosition(const Point3F& tPos) { MatrixF transMat; - if (cam_subject) + if (mCam_subject) { // get the subject's transform - MatrixF objToWorld = cam_subject->getRenderTransform(); + MatrixF objToWorld = mCam_subject->getRenderTransform(); // transform the center-of-interest to world-space Point3F objPos; - objToWorld.mulP(coi_offset, &objPos); + objToWorld.mulP(mCoi_offset, &objPos); // find normalized direction vector looking from camera to coi VectorF dirVec = objPos - tPos; @@ -308,31 +308,31 @@ void afxCamera::snapToPosition(const Point3F& tPos) void afxCamera::setCameraSubject(SceneObject* new_subject) { // cleanup any existing chase subject - if (cam_subject) + if (mCam_subject) { - if (dynamic_cast(cam_subject)) + if (dynamic_cast(mCam_subject)) clearProcessAfter(); - clearNotify(cam_subject); + clearNotify(mCam_subject); } - cam_subject = new_subject; + mCam_subject = new_subject; // set associations with new chase subject - if (cam_subject) + if (mCam_subject) { - if (dynamic_cast(cam_subject)) - processAfter((GameBase*)cam_subject); - deleteNotify(cam_subject); + if (dynamic_cast(mCam_subject)) + processAfter((GameBase*)mCam_subject); + deleteNotify(mCam_subject); } - mode = (cam_subject) ? ThirdPersonMode : FlyMode; + mMode = (mCam_subject) ? ThirdPersonMode : FlyMode; setMaskBits(SubjectMask); } void afxCamera::setThirdPersonOffset(const Point3F& offset) { // new method - if (cam_distance > 0.0f) + if (mCam_distance > 0.0f) { if (isClientObject()) { @@ -342,25 +342,25 @@ void afxCamera::setThirdPersonOffset(const Point3F& offset) // this auto switches to/from first person if (conn->isFirstPerson()) { - if (cam_distance >= 1.0f) + if (mCam_distance >= 1.0f) conn->setFirstPerson(false); } else { - if (cam_distance < 1.0f) + if (mCam_distance < 1.0f) conn->setFirstPerson(true); } } } - cam_offset = offset; - cam_dirty = true; + mCam_offset = offset; + mCam_dirty = true; return; } // old backwards-compatible method - if (offset.y != cam_offset.y && isClientObject()) + if (offset.y != mCam_offset.y && isClientObject()) { GameConnection* conn = GameConnection::getConnectionToServer(); if (conn) @@ -379,62 +379,62 @@ void afxCamera::setThirdPersonOffset(const Point3F& offset) } } - cam_offset = offset; - cam_dirty = true; + mCam_offset = offset; + mCam_dirty = true; } void afxCamera::setThirdPersonOffset(const Point3F& offset, const Point3F& coi_offset) { - this->coi_offset = coi_offset; + mCoi_offset = coi_offset; setThirdPersonOffset(offset); } void afxCamera::setThirdPersonDistance(F32 distance) { - cam_distance = distance; - cam_dirty = true; + mCam_distance = distance; + mCam_dirty = true; } F32 afxCamera::getThirdPersonDistance() { - return cam_distance; + return mCam_distance; } void afxCamera::setThirdPersonAngle(F32 angle) { - cam_angle = angle; - cam_dirty = true; + mCam_angle = angle; + mCam_dirty = true; } F32 afxCamera::getThirdPersonAngle() { - return cam_angle; + return mCam_angle; } void afxCamera::setThirdPersonMode() { - mode = ThirdPersonMode; - flymode_saved_pos = getPosition(); - flymode_saved = true; - cam_dirty = true; - third_person_snap_s++; + mMode = ThirdPersonMode; + mFlymode_saved_pos = getPosition(); + mFlymode_saved = true; + mCam_dirty = true; + mThird_person_snap_s++; } void afxCamera::setThirdPersonSnap() { - if (mode == ThirdPersonMode) - third_person_snap_s += 2; + if (mMode == ThirdPersonMode) + mThird_person_snap_s += 2; } void afxCamera::setThirdPersonSnapClient() { - if (mode == ThirdPersonMode) - third_person_snap_c++; + if (mMode == ThirdPersonMode) + mThird_person_snap_c++; } const char* afxCamera::getMode() { - switch (mode) + switch (mMode) { case ThirdPersonMode: return "ThirdPerson"; @@ -450,8 +450,6 @@ const char* afxCamera::getMode() //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// // Console Methods -static char buffer[100]; - ConsoleMethod(afxCamera, setOrbitMode, void, 7, 8, "(GameBase orbitObject, TransformF mat, float minDistance, float maxDistance, float curDistance, bool ownClientObject)" "Set the camera to orbit around some given object.\n\n" @@ -493,6 +491,7 @@ ConsoleMethod( afxCamera, getPosition, const char *, 2, 2, "()" "@returns A string of form \"x y z\".") { Point3F& pos = object->getPosition(); + char buffer[100]; dSprintf(buffer, sizeof(buffer),"%f %f %f",pos.x,pos.y,pos.z); return buffer; } @@ -558,6 +557,7 @@ ConsoleMethod(afxCamera, setThirdPersonOffset, void, 3, 4, "(Point3F offset [, P ConsoleMethod(afxCamera, getThirdPersonOffset, const char *, 2, 2, "()") { const Point3F& pos = object->getThirdPersonOffset(); + char buffer[100]; dSprintf(buffer, sizeof(buffer),"%f %f %f",pos.x,pos.y,pos.z); return buffer; } @@ -565,6 +565,7 @@ ConsoleMethod(afxCamera, getThirdPersonOffset, const char *, 2, 2, "()") ConsoleMethod(afxCamera, getThirdPersonCOIOffset, const char *, 2, 2, "()") { const Point3F& pos = object->getThirdPersonCOIOffset(); + char buffer[100]; dSprintf(buffer, sizeof(buffer),"%f %f %f",pos.x,pos.y,pos.z); return buffer; } @@ -592,17 +593,17 @@ void afxCamera::cam_update_3pov(F32 dt, bool on_server) { Point3F goal_pos; Point3F curr_pos = getRenderPosition(); - MatrixF xfm = cam_subject->getRenderTransform(); - Point3F coi = cam_subject->getRenderPosition() + coi_offset; + MatrixF xfm = mCam_subject->getRenderTransform(); + Point3F coi = mCam_subject->getRenderPosition() + mCoi_offset; // for player subjects, pitch is adjusted - Player* player_subj = dynamic_cast(cam_subject); + Player* player_subj = dynamic_cast(mCam_subject); if (player_subj) { - if (cam_distance > 0.0f) + if (mCam_distance > 0.0f) { // rotate xfm by amount of cam_angle - F32 look_yaw = player_subj->getHeadRotation().z + mDegToRad(-cam_angle); + F32 look_yaw = player_subj->getHeadRotation().z + mDegToRad(-mCam_angle); MatrixF look_yaw_mtx(EulerF(0,0,look_yaw)); xfm.mul(look_yaw_mtx); @@ -611,9 +612,9 @@ void afxCamera::cam_update_3pov(F32 dt, bool on_server) MatrixF head_pitch_mtx(EulerF(head_pitch,0,0)); xfm.mul(head_pitch_mtx); - VectorF behind_vec(0, -cam_distance, 0); + VectorF behind_vec(0, -mCam_distance, 0); xfm.mulP(behind_vec, &goal_pos); - goal_pos += cam_offset; + goal_pos += mCam_offset; } else // old backwards-compatible method { @@ -622,15 +623,15 @@ void afxCamera::cam_update_3pov(F32 dt, bool on_server) MatrixF head_pitch_mtx(EulerF(head_pitch,0,0)); xfm.mul(head_pitch_mtx); - VectorF behind_vec(0, cam_offset.y, 0); + VectorF behind_vec(0, mCam_offset.y, 0); xfm.mulP(behind_vec, &goal_pos); - goal_pos.z += cam_offset.z; + goal_pos.z += mCam_offset.z; } } // for non-player subjects, camera will follow, but pitch won't adjust. else { - xfm.mulP(cam_offset, &goal_pos); + xfm.mulP(mCam_offset, &goal_pos); } // avoid view occlusion @@ -638,7 +639,7 @@ void afxCamera::cam_update_3pov(F32 dt, bool on_server) { // snap to final position if path to goal is blocked if (test_blocked_line(curr_pos, goal_pos)) - third_person_snap_c++; + mThird_person_snap_c++; } // place camera into its final position @@ -652,11 +653,11 @@ void afxCamera::cam_update_3pov(F32 dt, bool on_server) F32 time_inc = 1.0f/speed_factor; // snap to final position - if (on_server || (third_person_snap_c > 0 || dt > time_inc)) + if (on_server || (mThird_person_snap_c > 0 || dt > time_inc)) { snapToPosition(goal_pos); - if (!on_server && third_person_snap_c > 0) - third_person_snap_c--; + if (!on_server && mThird_person_snap_c > 0) + mThird_person_snap_c--; return; } // interpolate to final position @@ -731,13 +732,13 @@ void afxCamera::onDeleteNotify(SimObject *obj) if (obj == (SimObject*)mOrbitObject) { mOrbitObject = NULL; - if (mode == OrbitObjectMode) - mode = OrbitPointMode; + if (mMode == OrbitObjectMode) + mMode = OrbitPointMode; } - if (obj == cam_subject) + if (obj == mCam_subject) { - cam_subject = NULL; + mCam_subject = NULL; } } @@ -747,12 +748,12 @@ void afxCamera::advanceTime(F32 dt) if (gSFX3DWorld) { - if (mode == ThirdPersonMode && cam_subject) + if (mMode == ThirdPersonMode && mCam_subject) { - if (gSFX3DWorld->getListener() != cam_subject) - gSFX3DWorld->setListener(cam_subject); + if (gSFX3DWorld->getListener() != mCam_subject) + gSFX3DWorld->setListener(mCam_subject); } - else if (mode == FlyMode) + else if (mMode == FlyMode) { if (gSFX3DWorld->getListener() != this) gSFX3DWorld->setListener(this); @@ -771,15 +772,15 @@ void afxCamera::processTick(const Move* move) if (move) { // UPDATE ORIENTATION // - delta.rotVec = mRot; - mObjToWorld.getColumn(3, &delta.posVec); + mDelta.rotVec = mRot; + mObjToWorld.getColumn(3, &mDelta.posVec); mRot.x = mClampF(mRot.x + move->pitch, -MaxPitch, MaxPitch); mRot.z += move->yaw; // ORBIT MODE // - if (mode == OrbitObjectMode || mode == OrbitPointMode) + if (mMode == OrbitObjectMode || mMode == OrbitPointMode) { - if(mode == OrbitObjectMode && bool(mOrbitObject)) + if(mMode == OrbitObjectMode && bool(mOrbitObject)) { // If this is a shapebase, use its render eye transform // to avoid jittering. @@ -822,10 +823,10 @@ void afxCamera::processTick(const Move* move) // If on the client, calc delta for backstepping if (isClientObject()) { - delta.pos = pos; - delta.rot = mRot; - delta.posVec = delta.posVec - delta.pos; - delta.rotVec = delta.rotVec - delta.rot; + mDelta.pos = pos; + mDelta.rot = mRot; + mDelta.posVec = mDelta.posVec - mDelta.pos; + mDelta.rotVec = mDelta.rotVec - mDelta.rot; } else { @@ -846,14 +847,14 @@ void afxCamera::interpolateTick(F32 dt) { Parent::interpolateTick(dt); - if (mode == ThirdPersonMode) + if (mMode == ThirdPersonMode) return; - Point3F rot = delta.rot + delta.rotVec * dt; + Point3F rot = mDelta.rot + mDelta.rotVec * dt; - if(mode == OrbitObjectMode || mode == OrbitPointMode) + if(mMode == OrbitObjectMode || mMode == OrbitPointMode) { - if(mode == OrbitObjectMode && bool(mOrbitObject)) + if(mMode == OrbitObjectMode && bool(mOrbitObject)) { // If this is a shapebase, use its render eye transform // to avoid jittering. @@ -879,7 +880,7 @@ void afxCamera::interpolateTick(F32 dt) { // NOTE - posVec is 0,0,0 unless cam is control-object and process tick is // updating the delta - Point3F pos = delta.pos + delta.posVec * dt; + Point3F pos = mDelta.pos + mDelta.posVec * dt; set_cam_pos(pos,rot); } } @@ -895,19 +896,19 @@ void afxCamera::writePacketData(GameConnection *connection, BitStream *bstream) bstream->write(mRot.x); // SND X ROT bstream->write(mRot.z); // SND Z ROT - if (bstream->writeFlag(cam_dirty)) + if (bstream->writeFlag(mCam_dirty)) { - mathWrite(*bstream, cam_offset); // SND CAM_OFFSET - mathWrite(*bstream, coi_offset); // SND COI_OFFSET - bstream->write(cam_distance); - bstream->write(cam_angle); - cam_dirty = false; + mathWrite(*bstream, mCam_offset); // SND CAM_OFFSET + mathWrite(*bstream, mCoi_offset); // SND COI_OFFSET + bstream->write(mCam_distance); + bstream->write(mCam_angle); + mCam_dirty = false; } - U32 writeMode = mode; + U32 writeMode = mMode; Point3F writePos = mPosition; S32 gIndex = -1; - if (mode == OrbitObjectMode) + if (mMode == OrbitObjectMode) { gIndex = bool(mOrbitObject) ? connection->getGhostIndex(mOrbitObject): -1; if(gIndex == -1) @@ -920,9 +921,9 @@ void afxCamera::writePacketData(GameConnection *connection, BitStream *bstream) bstream->writeRangedU32(writeMode, CameraFirstMode, CameraLastMode); // SND MODE if (writeMode == ThirdPersonMode) { - bstream->write(third_person_snap_s > 0); // SND SNAP - if (third_person_snap_s > 0) - third_person_snap_s--; + bstream->write(mThird_person_snap_s > 0); // SND SNAP + if (mThird_person_snap_s > 0) + mThird_person_snap_s--; } if (writeMode == OrbitObjectMode || writeMode == OrbitPointMode) @@ -955,34 +956,34 @@ void afxCamera::readPacketData(GameConnection *connection, BitStream *bstream) Point3F new_cam_offset, new_coi_offset; mathRead(*bstream, &new_cam_offset); // RCV CAM_OFFSET mathRead(*bstream, &new_coi_offset); // RCV COI_OFFSET - bstream->read(&cam_distance); - bstream->read(&cam_angle); + bstream->read(&mCam_distance); + bstream->read(&mCam_angle); setThirdPersonOffset(new_cam_offset, new_coi_offset); } GameBase* obj = 0; - mode = bstream->readRangedU32(CameraFirstMode, // RCV MODE + mMode = bstream->readRangedU32(CameraFirstMode, // RCV MODE CameraLastMode); - if (mode == ThirdPersonMode) + if (mMode == ThirdPersonMode) { bool snap; bstream->read(&snap); if (snap) - third_person_snap_c++; + mThird_person_snap_c++; } mObservingClientObject = false; - if (mode == OrbitObjectMode || mode == OrbitPointMode) { + if (mMode == OrbitObjectMode || mMode == OrbitPointMode) { bstream->read(&mMinOrbitDist); bstream->read(&mMaxOrbitDist); bstream->read(&mCurOrbitDist); - if(mode == OrbitObjectMode) + if(mMode == OrbitObjectMode) { mObservingClientObject = bstream->readFlag(); S32 gIndex = bstream->readInt(NetConnection::GhostIdBitSize); obj = static_cast(connection->resolveGhost(gIndex)); } - if (mode == OrbitPointMode) + if (mMode == OrbitPointMode) bstream->readCompressedPoint(&mPosition); } if (obj != (GameBase*)mOrbitObject) { @@ -997,14 +998,14 @@ void afxCamera::readPacketData(GameConnection *connection, BitStream *bstream) } } - if (mode == ThirdPersonMode) + if (mMode == ThirdPersonMode) return; set_cam_pos(pos,rot); - delta.pos = pos; - delta.rot = rot; - delta.rotVec.set(0,0,0); - delta.posVec.set(0,0,0); + mDelta.pos = pos; + mDelta.rot = rot; + mDelta.rotVec.set(0,0,0); + mDelta.posVec.set(0,0,0); } U32 afxCamera::packUpdate(NetConnection* conn, U32 mask, BitStream *bstream) @@ -1028,10 +1029,10 @@ U32 afxCamera::packUpdate(NetConnection* conn, U32 mask, BitStream *bstream) if (bstream->writeFlag(mask & SubjectMask)) { - S32 ghost_id = (cam_subject) ? conn->getGhostIndex(cam_subject) : -1; + S32 ghost_id = (mCam_subject) ? conn->getGhostIndex(mCam_subject) : -1; if (bstream->writeFlag(ghost_id != -1)) bstream->writeRangedU32(U32(ghost_id), 0, NetConnection::MaxGhostCount); - else if (cam_subject) + else if (mCam_subject) retMask |= SubjectMask; } @@ -1056,9 +1057,9 @@ void afxCamera::unpackUpdate(NetConnection *conn, BitStream *bstream) set_cam_pos(pos,rot); // New delta for client side interpolation - delta.pos = pos; - delta.rot = rot; - delta.posVec = delta.rotVec = VectorF(0,0,0); + mDelta.pos = pos; + mDelta.rot = rot; + mDelta.posVec = mDelta.rotVec = VectorF(0,0,0); } if (bstream->readFlag()) @@ -1066,18 +1067,18 @@ void afxCamera::unpackUpdate(NetConnection *conn, BitStream *bstream) if (bstream->readFlag()) { S32 ghost_id = bstream->readRangedU32(0, NetConnection::MaxGhostCount); - cam_subject = dynamic_cast(conn->resolveGhost(ghost_id)); + mCam_subject = dynamic_cast(conn->resolveGhost(ghost_id)); } else - cam_subject = NULL; + mCam_subject = NULL; } } // Override to ensure both are kept in scope void afxCamera::onCameraScopeQuery(NetConnection* conn, CameraScopeQuery* query) { - if (cam_subject) - conn->objectInScope(cam_subject); + if (mCam_subject) + conn->objectInScope(mCam_subject); Parent::onCameraScopeQuery(conn, query); } @@ -1155,7 +1156,7 @@ void afxCamera::setCameraFov(F32 fov) F32 afxCamera::getDamageFlash() const { - if (mode == OrbitObjectMode && isServerObject() && bool(mOrbitObject)) + if (mMode == OrbitObjectMode && isServerObject() && bool(mOrbitObject)) { const GameBase *castObj = mOrbitObject; const ShapeBase* psb = dynamic_cast(castObj); @@ -1168,7 +1169,7 @@ F32 afxCamera::getDamageFlash() const F32 afxCamera::getWhiteOut() const { - if (mode == OrbitObjectMode && isServerObject() && bool(mOrbitObject)) + if (mMode == OrbitObjectMode && isServerObject() && bool(mOrbitObject)) { const GameBase *castObj = mOrbitObject; const ShapeBase* psb = dynamic_cast(castObj); diff --git a/Engine/source/afx/afxCamera.h b/Engine/source/afx/afxCamera.h index 934f293cf..957f182f6 100644 --- a/Engine/source/afx/afxCamera.h +++ b/Engine/source/afx/afxCamera.h @@ -88,9 +88,9 @@ class afxCamera: public ShapeBase }; private: - int mode; + int mMode; Point3F mRot; - StateDelta delta; + StateDelta mDelta; SimObjectPtr mOrbitObject; F32 mMinOrbitDist; @@ -99,17 +99,17 @@ private: Point3F mPosition; bool mObservingClientObject; - SceneObject* cam_subject; - Point3F cam_offset; - Point3F coi_offset; - F32 cam_distance; - F32 cam_angle; - bool cam_dirty; + SceneObject* mCam_subject; + Point3F mCam_offset; + Point3F mCoi_offset; + F32 mCam_distance; + F32 mCam_angle; + bool mCam_dirty; - bool flymode_saved; - Point3F flymode_saved_pos; - S8 third_person_snap_c; - S8 third_person_snap_s; + bool mFlymode_saved; + Point3F mFlymode_saved_pos; + S8 mThird_person_snap_c; + S8 mThird_person_snap_s; void set_cam_pos(const Point3F& pos, const Point3F& viewRot); void cam_update(F32 dt, bool on_server); @@ -130,8 +130,8 @@ public: void setCameraSubject(SceneObject* subject); void setThirdPersonOffset(const Point3F& offset); void setThirdPersonOffset(const Point3F& offset, const Point3F& coi_offset); - const Point3F& getThirdPersonOffset() const { return cam_offset; } - const Point3F& getThirdPersonCOIOffset() const { return coi_offset; } + const Point3F& getThirdPersonOffset() const { return mCam_offset; } + const Point3F& getThirdPersonCOIOffset() const { return mCoi_offset; } void setThirdPersonDistance(F32 distance); F32 getThirdPersonDistance(); void setThirdPersonAngle(F32 angle); @@ -147,7 +147,7 @@ public: DECLARE_CATEGORY("AFX"); private: // 3POV SECTION - U32 blockers_mask_3pov; + U32 mBlockers_mask_3pov; void cam_update_3pov(F32 dt, bool on_server); bool avoid_blocked_view(const Point3F& start, const Point3F& end, Point3F& newpos); diff --git a/Engine/source/afx/afxChoreographer.cpp b/Engine/source/afx/afxChoreographer.cpp index 5473552f5..d1b4d9069 100644 --- a/Engine/source/afx/afxChoreographer.cpp +++ b/Engine/source/afx/afxChoreographer.cpp @@ -142,7 +142,7 @@ afxChoreographer::afxChoreographer() lod = 0; exec_conds_mask = 0; choreographer_id = 0; - extra = 0; + mExtra = 0; started_with_newop = false; postpone_activation = false; remapped_cons_sent = false; // CONSTRAINT REMAPPING @@ -179,7 +179,7 @@ afxChoreographer::~afxChoreographer() void afxChoreographer::initPersistFields() { // conditionals - addField("extra", TYPEID(), Offset(extra, afxChoreographer), + addField("extra", TYPEID(), Offset(mExtra, afxChoreographer), "..."); addField("postponeActivation", TypeBool, Offset(postpone_activation, afxChoreographer), "..."); @@ -331,9 +331,9 @@ void afxChoreographer::unpack_constraint_info(NetConnection* conn, BitStream* st { if (stream->readFlag()) { - U16 scope_id = stream->readInt(NetObject::SCOPE_ID_BITS); + mScope_id = stream->readInt(NetObject::SCOPE_ID_BITS); bool is_shape = stream->readFlag(); - addObjectConstraint(scope_id, cons_name, is_shape); + addObjectConstraint(mScope_id, cons_name, is_shape); } } } diff --git a/Engine/source/afx/afxChoreographer.h b/Engine/source/afx/afxChoreographer.h index 3665e1306..e3b83585e 100644 --- a/Engine/source/afx/afxChoreographer.h +++ b/Engine/source/afx/afxChoreographer.h @@ -121,7 +121,7 @@ protected: U8 ranking; U8 lod; U32 exec_conds_mask; - SimObject* extra; + SimObject* mExtra; Vector explicit_clients; bool started_with_newop; bool postpone_activation; @@ -182,7 +182,7 @@ public: void clearChoreographerId() { choreographer_id = 0; } U32 getChoreographerId() { return choreographer_id; } void setGhostConstraintObject(SceneObject*, StringTableEntry cons_name); - void setExtra(SimObject* extra) { this->extra = extra; } + void setExtra(SimObject* extra) { mExtra = extra; } void addExplicitClient(NetConnection* conn); void removeExplicitClient(NetConnection* conn); U32 getExplicitClientCount() { return explicit_clients.size(); } diff --git a/Engine/source/afx/afxConstraint.cpp b/Engine/source/afx/afxConstraint.cpp index 78a506c02..a739148f5 100644 --- a/Engine/source/afx/afxConstraint.cpp +++ b/Engine/source/afx/afxConstraint.cpp @@ -56,25 +56,25 @@ afxConstraintDef::afxConstraintDef() bool afxConstraintDef::isDefined() { - return (def_type != CONS_UNDEFINED); + return (mDef_type != CONS_UNDEFINED); } bool afxConstraintDef::isArbitraryObject() { - return ((cons_src_name != ST_NULLSTRING) && (def_type == CONS_SCENE)); + return ((mCons_src_name != ST_NULLSTRING) && (mDef_type == CONS_SCENE)); } void afxConstraintDef::reset() { - cons_src_name = ST_NULLSTRING; - cons_node_name = ST_NULLSTRING; - def_type = CONS_UNDEFINED; - history_time = 0; - sample_rate = 30; - runs_on_server = false; - runs_on_client = false; - pos_at_box_center = false; - treat_as_camera = false; + mCons_src_name = ST_NULLSTRING; + mCons_node_name = ST_NULLSTRING; + mDef_type = CONS_UNDEFINED; + mHistory_time = 0; + mSample_rate = 30; + mRuns_on_server = false; + mRuns_on_client = false; + mPos_at_box_center = false; + mTreat_as_camera = false; } bool afxConstraintDef::parseSpec(const char* spec, bool runs_on_server, @@ -85,11 +85,11 @@ bool afxConstraintDef::parseSpec(const char* spec, bool runs_on_server, if (spec == 0 || spec[0] == '\0') return false; - history_time = 0.0f; - sample_rate = 30; + mHistory_time = 0.0f; + mSample_rate = 30; - this->runs_on_server = runs_on_server; - this->runs_on_client = runs_on_client; + mRuns_on_server = runs_on_server; + mRuns_on_client = runs_on_client; // spec should be in one of these forms: // CONSTRAINT_NAME (only) @@ -157,7 +157,7 @@ bool afxConstraintDef::parseSpec(const char* spec, bool runs_on_server, for (S32 i = 0; i < n_words; i++) { if (dStrcmp(words[i], "#center") == 0) - pos_at_box_center = true; + mPos_at_box_center = true; else if (dStrncmp(words[i], "#history(", 9) == 0) hist_spec = words[i]; else @@ -193,9 +193,9 @@ bool afxConstraintDef::parseSpec(const char* spec, bool runs_on_server, S32 args = dSscanf(hist_spec,"%g %d", &hist_age, &hist_rate); if (args > 0) - history_time = hist_age; + mHistory_time = hist_age; if (args > 1) - sample_rate = hist_rate; + mSample_rate = hist_rate; } } } @@ -212,8 +212,8 @@ bool afxConstraintDef::parseSpec(const char* spec, bool runs_on_server, return false; } - cons_src_name = cons_name_key; - def_type = CONS_PREDEFINED; + mCons_src_name = cons_name_key; + mDef_type = CONS_PREDEFINED; dFree(buffer); return true; } @@ -221,10 +221,10 @@ bool afxConstraintDef::parseSpec(const char* spec, bool runs_on_server, // "#scene.NAME" or "#scene.NAME.NODE"" if (cons_name_key == SCENE_CONS_KEY) { - cons_src_name = StringTable->insert(words2[1]); + mCons_src_name = StringTable->insert(words2[1]); if (n_words2 > 2) - cons_node_name = StringTable->insert(words2[2]); - def_type = CONS_SCENE; + mCons_node_name = StringTable->insert(words2[2]); + mDef_type = CONS_SCENE; dFree(buffer); return true; } @@ -232,10 +232,10 @@ bool afxConstraintDef::parseSpec(const char* spec, bool runs_on_server, // "#effect.NAME" or "#effect.NAME.NODE" if (cons_name_key == EFFECT_CONS_KEY) { - cons_src_name = StringTable->insert(words2[1]); + mCons_src_name = StringTable->insert(words2[1]); if (n_words2 > 2) - cons_node_name = StringTable->insert(words2[2]); - def_type = CONS_EFFECT; + mCons_node_name = StringTable->insert(words2[2]); + mDef_type = CONS_EFFECT; dFree(buffer); return true; } @@ -249,10 +249,10 @@ bool afxConstraintDef::parseSpec(const char* spec, bool runs_on_server, return false; } - cons_src_name = StringTable->insert(words2[1]); + mCons_src_name = StringTable->insert(words2[1]); if (n_words2 > 2) - cons_node_name = StringTable->insert(words2[2]); - def_type = CONS_GHOST; + mCons_node_name = StringTable->insert(words2[2]); + mDef_type = CONS_GHOST; dFree(buffer); return true; } @@ -260,9 +260,9 @@ bool afxConstraintDef::parseSpec(const char* spec, bool runs_on_server, // "CONSTRAINT_NAME.NODE" if (n_words2 == 2) { - cons_src_name = cons_name_key; - cons_node_name = StringTable->insert(words2[1]); - def_type = CONS_PREDEFINED; + mCons_src_name = cons_name_key; + mCons_node_name = StringTable->insert(words2[1]); + mDef_type = CONS_PREDEFINED; dFree(buffer); return true; } @@ -287,15 +287,15 @@ void afxConstraintDef::gather_cons_defs(Vector& defs, afxEffec afxConstraint::afxConstraint(afxConstraintMgr* mgr) { - this->mgr = mgr; - is_defined = false; - is_valid = false; - last_pos.zero(); - last_xfm.identity(); - history_time = 0.0f; - is_alive = true; - gone_missing = false; - change_code = 0; + mMgr = mgr; + mIs_defined = false; + mIs_valid = false; + mLast_pos.zero(); + mLast_xfm.identity(); + mHistory_time = 0.0f; + mIs_alive = true; + mGone_missing = false; + mChange_code = 0; } afxConstraint::~afxConstraint() @@ -342,26 +342,26 @@ inline afxObjectConstraint* newObjectCons(afxConstraintMgr* mgr, StringTableEntr //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// // afxConstraintMgr -#define CONS_BY_ID(id) ((*constraints_v[(id).index])[(id).sub_index]) -#define CONS_BY_IJ(i,j) ((*constraints_v[(i)])[(j)]) +#define CONS_BY_ID(id) ((*mConstraints_v[(id).index])[(id).sub_index]) +#define CONS_BY_IJ(i,j) ((*mConstraints_v[(i)])[(j)]) afxConstraintMgr::afxConstraintMgr() { - starttime = 0; - on_server = false; - initialized = false; - scoping_dist_sq = 1000.0f*1000.0f; + mStartTime = 0; + mOn_server = false; + mInitialized = false; + mScoping_dist_sq = 1000.0f*1000.0f; missing_objs = &missing_objs_a; missing_objs2 = &missing_objs_b; } afxConstraintMgr::~afxConstraintMgr() { - for (S32 i = 0; i < constraints_v.size(); i++) + for (S32 i = 0; i < mConstraints_v.size(); i++) { - for (S32 j = 0; j < (*constraints_v[i]).size(); j++) + for (S32 j = 0; j < (*mConstraints_v[i]).size(); j++) delete CONS_BY_IJ(i,j); - delete constraints_v[i]; + delete mConstraints_v[i]; } } @@ -369,11 +369,11 @@ afxConstraintMgr::~afxConstraintMgr() S32 afxConstraintMgr::find_cons_idx_from_name(StringTableEntry which) { - for (S32 i = 0; i < constraints_v.size(); i++) + for (S32 i = 0; i < mConstraints_v.size(); i++) { afxConstraint* cons = CONS_BY_IJ(i,0); - if (cons && afxConstraintDef::CONS_EFFECT != cons->cons_def.def_type && - which == cons->cons_def.cons_src_name) + if (cons && afxConstraintDef::CONS_EFFECT != cons->mCons_def.mDef_type && + which == cons->mCons_def.mCons_src_name) { return i; } @@ -384,11 +384,11 @@ S32 afxConstraintMgr::find_cons_idx_from_name(StringTableEntry which) S32 afxConstraintMgr::find_effect_cons_idx_from_name(StringTableEntry which) { - for (S32 i = 0; i < constraints_v.size(); i++) + for (S32 i = 0; i < mConstraints_v.size(); i++) { afxConstraint* cons = CONS_BY_IJ(i,0); - if (cons && afxConstraintDef::CONS_EFFECT == cons->cons_def.def_type && - which == cons->cons_def.cons_src_name) + if (cons && afxConstraintDef::CONS_EFFECT == cons->mCons_def.mDef_type && + which == cons->mCons_def.mCons_src_name) { return i; } @@ -401,7 +401,7 @@ S32 afxConstraintMgr::find_effect_cons_idx_from_name(StringTableEntry which) void afxConstraintMgr::defineConstraint(U32 type, StringTableEntry name) { preDef predef = { name, type }; - predefs.push_back(predef); + mPredefs.push_back(predef); } afxConstraintID afxConstraintMgr::setReferencePoint(StringTableEntry which, Point3F point, @@ -472,11 +472,11 @@ afxConstraintID afxConstraintMgr::createReferenceEffect(StringTableEntry which, { afxEffectConstraint* cons = new afxEffectConstraint(this, which); //cons->cons_def = def; - cons->cons_def.def_type = afxConstraintDef::CONS_EFFECT; - cons->cons_def.cons_src_name = which; + cons->mCons_def.mDef_type = afxConstraintDef::CONS_EFFECT; + cons->mCons_def.mCons_src_name = which; afxConstraintList* list = new afxConstraintList(); list->push_back(cons); - constraints_v.push_back(list); + mConstraints_v.push_back(list); return setReferenceEffect(which, ew); } @@ -489,8 +489,8 @@ void afxConstraintMgr::setReferencePoint(afxConstraintID id, Point3F point, Poin if (!pt_cons) { afxConstraint* cons = CONS_BY_ID(id); - pt_cons = newPointCons(this, cons->cons_def.history_time > 0.0f); - pt_cons->cons_def = cons->cons_def; + pt_cons = newPointCons(this, cons->mCons_def.mHistory_time > 0.0f); + pt_cons->mCons_def = cons->mCons_def; CONS_BY_ID(id) = pt_cons; delete cons; } @@ -498,7 +498,7 @@ void afxConstraintMgr::setReferencePoint(afxConstraintID id, Point3F point, Poin pt_cons->set(point, vector); // nullify all subnodes - for (S32 j = 1; j < (*constraints_v[id.index]).size(); j++) + for (S32 j = 1; j < (*mConstraints_v[id.index]).size(); j++) { afxConstraint* cons = CONS_BY_IJ(id.index,j); if (cons) @@ -514,8 +514,8 @@ void afxConstraintMgr::setReferenceTransform(afxConstraintID id, MatrixF& xfm) if (!xfm_cons) { afxConstraint* cons = CONS_BY_ID(id); - xfm_cons = newTransformCons(this, cons->cons_def.history_time > 0.0f); - xfm_cons->cons_def = cons->cons_def; + xfm_cons = newTransformCons(this, cons->mCons_def.mHistory_time > 0.0f); + xfm_cons->mCons_def = cons->mCons_def; CONS_BY_ID(id) = xfm_cons; delete cons; } @@ -523,7 +523,7 @@ void afxConstraintMgr::setReferenceTransform(afxConstraintID id, MatrixF& xfm) xfm_cons->set(xfm); // nullify all subnodes - for (S32 j = 1; j < (*constraints_v[id.index]).size(); j++) + for (S32 j = 1; j < (*mConstraints_v[id.index]).size(); j++) { afxConstraint* cons = CONS_BY_IJ(id.index,j); if (cons) @@ -541,8 +541,8 @@ void afxConstraintMgr::set_ref_shape(afxConstraintID id, ShapeBase* shape) if (!shape_cons) { afxConstraint* cons = CONS_BY_ID(id); - shape_cons = newShapeCons(this, cons->cons_def.history_time > 0.0f); - shape_cons->cons_def = cons->cons_def; + shape_cons = newShapeCons(this, cons->mCons_def.mHistory_time > 0.0f); + shape_cons->mCons_def = cons->mCons_def; CONS_BY_ID(id) = shape_cons; delete cons; } @@ -551,7 +551,7 @@ void afxConstraintMgr::set_ref_shape(afxConstraintID id, ShapeBase* shape) shape_cons->set(shape); // update all subnodes - for (S32 j = 1; j < (*constraints_v[id.index]).size(); j++) + for (S32 j = 1; j < (*mConstraints_v[id.index]).size(); j++) { afxConstraint* cons = CONS_BY_IJ(id.index,j); if (cons) @@ -578,8 +578,8 @@ void afxConstraintMgr::set_ref_shape(afxConstraintID id, U16 scope_id) if (!shape_cons) { afxConstraint* cons = CONS_BY_ID(id); - shape_cons = newShapeCons(this, cons->cons_def.history_time > 0.0f); - shape_cons->cons_def = cons->cons_def; + shape_cons = newShapeCons(this, cons->mCons_def.mHistory_time > 0.0f); + shape_cons->mCons_def = cons->mCons_def; CONS_BY_ID(id) = shape_cons; delete cons; } @@ -588,7 +588,7 @@ void afxConstraintMgr::set_ref_shape(afxConstraintID id, U16 scope_id) shape_cons->set_scope_id(scope_id); // update all subnodes - for (S32 j = 1; j < (*constraints_v[id.index]).size(); j++) + for (S32 j = 1; j < (*mConstraints_v[id.index]).size(); j++) { afxConstraint* cons = CONS_BY_IJ(id.index,j); if (cons) @@ -599,10 +599,10 @@ void afxConstraintMgr::set_ref_shape(afxConstraintID id, U16 scope_id) // Assigns an existing scene-object to the constraint matching the given constraint-id. void afxConstraintMgr::setReferenceObject(afxConstraintID id, SceneObject* obj) { - if (!initialized) + if (!mInitialized) Con::errorf("afxConstraintMgr::setReferenceObject() -- constraint manager not initialized"); - if (!CONS_BY_ID(id)->cons_def.treat_as_camera) + if (!CONS_BY_ID(id)->mCons_def.mTreat_as_camera) { ShapeBase* shape = dynamic_cast(obj); if (shape) @@ -618,8 +618,8 @@ void afxConstraintMgr::setReferenceObject(afxConstraintID id, SceneObject* obj) if (!obj_cons) { afxConstraint* cons = CONS_BY_ID(id); - obj_cons = newObjectCons(this, cons->cons_def.history_time > 0.0f); - obj_cons->cons_def = cons->cons_def; + obj_cons = newObjectCons(this, cons->mCons_def.mHistory_time > 0.0f); + obj_cons->mCons_def = cons->mCons_def; CONS_BY_ID(id) = obj_cons; delete cons; } @@ -627,7 +627,7 @@ void afxConstraintMgr::setReferenceObject(afxConstraintID id, SceneObject* obj) obj_cons->set(obj); // update all subnodes - for (S32 j = 1; j < (*constraints_v[id.index]).size(); j++) + for (S32 j = 1; j < (*mConstraints_v[id.index]).size(); j++) { afxConstraint* cons = CONS_BY_IJ(id.index,j); if (cons) @@ -644,7 +644,7 @@ void afxConstraintMgr::setReferenceObject(afxConstraintID id, SceneObject* obj) // given constraint-id. void afxConstraintMgr::setReferenceObjectByScopeId(afxConstraintID id, U16 scope_id, bool is_shape) { - if (!initialized) + if (!mInitialized) Con::errorf("afxConstraintMgr::setReferenceObject() -- constraint manager not initialized"); if (is_shape) @@ -659,8 +659,8 @@ void afxConstraintMgr::setReferenceObjectByScopeId(afxConstraintID id, U16 scope if (!obj_cons) { afxConstraint* cons = CONS_BY_ID(id); - obj_cons = newObjectCons(this, cons->cons_def.history_time > 0.0f); - obj_cons->cons_def = cons->cons_def; + obj_cons = newObjectCons(this, cons->mCons_def.mHistory_time > 0.0f); + obj_cons->mCons_def = cons->mCons_def; CONS_BY_ID(id) = obj_cons; delete cons; } @@ -668,7 +668,7 @@ void afxConstraintMgr::setReferenceObjectByScopeId(afxConstraintID id, U16 scope obj_cons->set_scope_id(scope_id); // update all subnodes - for (S32 j = 1; j < (*constraints_v[id.index]).size(); j++) + for (S32 j = 1; j < (*mConstraints_v[id.index]).size(); j++) { afxConstraint* cons = CONS_BY_IJ(id.index,j); if (cons) @@ -685,7 +685,7 @@ void afxConstraintMgr::setReferenceEffect(afxConstraintID id, afxEffectWrapper* eff_cons->set(ew); // update all subnodes - for (S32 j = 1; j < (*constraints_v[id.index]).size(); j++) + for (S32 j = 1; j < (*mConstraints_v[id.index]).size(); j++) { afxConstraint* cons = CONS_BY_IJ(id.index,j); if (cons) @@ -704,69 +704,69 @@ void afxConstraintMgr::invalidateReference(afxConstraintID id) { afxConstraint* cons = CONS_BY_ID(id); if (cons) - cons->is_valid = false; + cons->mIs_valid = false; } void afxConstraintMgr::create_constraint(const afxConstraintDef& def) { - if (def.def_type == afxConstraintDef::CONS_UNDEFINED) + if (def.mDef_type == afxConstraintDef::CONS_UNDEFINED) return; //Con::printf("CON - %s [%s] [%s] h=%g", def.cons_type_name, def.cons_src_name, def.cons_node_name, def.history_time); - bool want_history = (def.history_time > 0.0f); + bool want_history = (def.mHistory_time > 0.0f); // constraint is an arbitrary named scene object // - if (def.def_type == afxConstraintDef::CONS_SCENE) + if (def.mDef_type == afxConstraintDef::CONS_SCENE) { - if (def.cons_src_name == ST_NULLSTRING) + if (def.mCons_src_name == ST_NULLSTRING) return; // find the arbitrary object by name SceneObject* arb_obj; - if (on_server) + if (mOn_server) { - arb_obj = dynamic_cast(Sim::findObject(def.cons_src_name)); + arb_obj = dynamic_cast(Sim::findObject(def.mCons_src_name)); if (!arb_obj) Con::errorf("afxConstraintMgr -- failed to find scene constraint source, \"%s\" on server.", - def.cons_src_name); + def.mCons_src_name); } else { - arb_obj = find_object_from_name(def.cons_src_name); + arb_obj = find_object_from_name(def.mCons_src_name); if (!arb_obj) Con::errorf("afxConstraintMgr -- failed to find scene constraint source, \"%s\" on client.", - def.cons_src_name); + def.mCons_src_name); } // if it's a shapeBase object, create a Shape or ShapeNode constraint if (dynamic_cast(arb_obj)) { - if (def.cons_node_name == ST_NULLSTRING && !def.pos_at_box_center) + if (def.mCons_node_name == ST_NULLSTRING && !def.mPos_at_box_center) { - afxShapeConstraint* cons = newShapeCons(this, def.cons_src_name, want_history); - cons->cons_def = def; + afxShapeConstraint* cons = newShapeCons(this, def.mCons_src_name, want_history); + cons->mCons_def = def; cons->set((ShapeBase*)arb_obj); afxConstraintList* list = new afxConstraintList(); list->push_back(cons); - constraints_v.push_back(list); + mConstraints_v.push_back(list); } - else if (def.pos_at_box_center) + else if (def.mPos_at_box_center) { - afxShapeConstraint* cons = newShapeCons(this, def.cons_src_name, want_history); - cons->cons_def = def; + afxShapeConstraint* cons = newShapeCons(this, def.mCons_src_name, want_history); + cons->mCons_def = def; cons->set((ShapeBase*)arb_obj); - afxConstraintList* list = constraints_v[constraints_v.size()-1]; // SHAPE-NODE CONS-LIST (#scene)(#center) + afxConstraintList* list = mConstraints_v[mConstraints_v.size()-1]; // SHAPE-NODE CONS-LIST (#scene)(#center) if (list && (*list)[0]) list->push_back(cons); } else { - afxShapeNodeConstraint* sub = newShapeNodeCons(this, def.cons_src_name, def.cons_node_name, want_history); - sub->cons_def = def; + afxShapeNodeConstraint* sub = newShapeNodeCons(this, def.mCons_src_name, def.mCons_node_name, want_history); + sub->mCons_def = def; sub->set((ShapeBase*)arb_obj); - afxConstraintList* list = constraints_v[constraints_v.size()-1]; + afxConstraintList* list = mConstraints_v[mConstraints_v.size()-1]; if (list && (*list)[0]) list->push_back(sub); } @@ -774,21 +774,21 @@ void afxConstraintMgr::create_constraint(const afxConstraintDef& def) // if it's not a shapeBase object, create an Object constraint else if (arb_obj) { - if (!def.pos_at_box_center) + if (!def.mPos_at_box_center) { - afxObjectConstraint* cons = newObjectCons(this, def.cons_src_name, want_history); - cons->cons_def = def; + afxObjectConstraint* cons = newObjectCons(this, def.mCons_src_name, want_history); + cons->mCons_def = def; cons->set(arb_obj); afxConstraintList* list = new afxConstraintList(); // OBJECT CONS-LIST (#scene) list->push_back(cons); - constraints_v.push_back(list); + mConstraints_v.push_back(list); } else // if (def.pos_at_box_center) { - afxObjectConstraint* cons = newObjectCons(this, def.cons_src_name, want_history); - cons->cons_def = def; + afxObjectConstraint* cons = newObjectCons(this, def.mCons_src_name, want_history); + cons->mCons_def = def; cons->set(arb_obj); - afxConstraintList* list = constraints_v[constraints_v.size()-1]; // OBJECT CONS-LIST (#scene)(#center) + afxConstraintList* list = mConstraints_v[mConstraints_v.size()-1]; // OBJECT CONS-LIST (#scene)(#center) if (list && (*list)[0]) list->push_back(cons); } @@ -797,35 +797,35 @@ void afxConstraintMgr::create_constraint(const afxConstraintDef& def) // constraint is an arbitrary named effect // - else if (def.def_type == afxConstraintDef::CONS_EFFECT) + else if (def.mDef_type == afxConstraintDef::CONS_EFFECT) { - if (def.cons_src_name == ST_NULLSTRING) + if (def.mCons_src_name == ST_NULLSTRING) return; // create an Effect constraint - if (def.cons_node_name == ST_NULLSTRING && !def.pos_at_box_center) + if (def.mCons_node_name == ST_NULLSTRING && !def.mPos_at_box_center) { - afxEffectConstraint* cons = new afxEffectConstraint(this, def.cons_src_name); - cons->cons_def = def; + afxEffectConstraint* cons = new afxEffectConstraint(this, def.mCons_src_name); + cons->mCons_def = def; afxConstraintList* list = new afxConstraintList(); list->push_back(cons); - constraints_v.push_back(list); + mConstraints_v.push_back(list); } // create an Effect #center constraint - else if (def.pos_at_box_center) + else if (def.mPos_at_box_center) { - afxEffectConstraint* cons = new afxEffectConstraint(this, def.cons_src_name); - cons->cons_def = def; - afxConstraintList* list = constraints_v[constraints_v.size()-1]; // EFFECT-NODE CONS-LIST (#effect) + afxEffectConstraint* cons = new afxEffectConstraint(this, def.mCons_src_name); + cons->mCons_def = def; + afxConstraintList* list = mConstraints_v[mConstraints_v.size()-1]; // EFFECT-NODE CONS-LIST (#effect) if (list && (*list)[0]) list->push_back(cons); } // create an EffectNode constraint else { - afxEffectNodeConstraint* sub = new afxEffectNodeConstraint(this, def.cons_src_name, def.cons_node_name); - sub->cons_def = def; - afxConstraintList* list = constraints_v[constraints_v.size()-1]; + afxEffectNodeConstraint* sub = new afxEffectNodeConstraint(this, def.mCons_src_name, def.mCons_node_name); + sub->mCons_def = def; + afxConstraintList* list = mConstraints_v[mConstraints_v.size()-1]; if (list && (*list)[0]) list->push_back(sub); } @@ -839,26 +839,26 @@ void afxConstraintMgr::create_constraint(const afxConstraintDef& def) afxConstraint* cons_ctr = 0; afxConstraint* sub = 0; - if (def.def_type == afxConstraintDef::CONS_GHOST) + if (def.mDef_type == afxConstraintDef::CONS_GHOST) { - for (S32 i = 0; i < predefs.size(); i++) + for (S32 i = 0; i < mPredefs.size(); i++) { - if (predefs[i].name == def.cons_src_name) + if (mPredefs[i].name == def.mCons_src_name) { - if (def.cons_node_name == ST_NULLSTRING && !def.pos_at_box_center) + if (def.mCons_node_name == ST_NULLSTRING && !def.mPos_at_box_center) { cons = newShapeCons(this, want_history); - cons->cons_def = def; + cons->mCons_def = def; } - else if (def.pos_at_box_center) + else if (def.mPos_at_box_center) { cons_ctr = newShapeCons(this, want_history); - cons_ctr->cons_def = def; + cons_ctr->mCons_def = def; } else { - sub = newShapeNodeCons(this, ST_NULLSTRING, def.cons_node_name, want_history); - sub->cons_def = def; + sub = newShapeNodeCons(this, ST_NULLSTRING, def.mCons_node_name, want_history); + sub->mCons_def = def; } break; } @@ -866,41 +866,41 @@ void afxConstraintMgr::create_constraint(const afxConstraintDef& def) } else { - for (S32 i = 0; i < predefs.size(); i++) + for (S32 i = 0; i < mPredefs.size(); i++) { - if (predefs[i].name == def.cons_src_name) + if (mPredefs[i].name == def.mCons_src_name) { - switch (predefs[i].type) + switch (mPredefs[i].type) { case POINT_CONSTRAINT: cons = newPointCons(this, want_history); - cons->cons_def = def; + cons->mCons_def = def; break; case TRANSFORM_CONSTRAINT: cons = newTransformCons(this, want_history); - cons->cons_def = def; + cons->mCons_def = def; break; case OBJECT_CONSTRAINT: - if (def.cons_node_name == ST_NULLSTRING && !def.pos_at_box_center) + if (def.mCons_node_name == ST_NULLSTRING && !def.mPos_at_box_center) { cons = newShapeCons(this, want_history); - cons->cons_def = def; + cons->mCons_def = def; } - else if (def.pos_at_box_center) + else if (def.mPos_at_box_center) { cons_ctr = newShapeCons(this, want_history); - cons_ctr->cons_def = def; + cons_ctr->mCons_def = def; } else { - sub = newShapeNodeCons(this, ST_NULLSTRING, def.cons_node_name, want_history); - sub->cons_def = def; + sub = newShapeNodeCons(this, ST_NULLSTRING, def.mCons_node_name, want_history); + sub->mCons_def = def; } break; case CAMERA_CONSTRAINT: cons = newObjectCons(this, want_history); - cons->cons_def = def; - cons->cons_def.treat_as_camera = true; + cons->mCons_def = def; + cons->mCons_def.mTreat_as_camera = true; break; } break; @@ -912,44 +912,44 @@ void afxConstraintMgr::create_constraint(const afxConstraintDef& def) { afxConstraintList* list = new afxConstraintList(); list->push_back(cons); - constraints_v.push_back(list); + mConstraints_v.push_back(list); } - else if (cons_ctr && constraints_v.size() > 0) + else if (cons_ctr && mConstraints_v.size() > 0) { - afxConstraintList* list = constraints_v[constraints_v.size()-1]; // PREDEF-NODE CONS-LIST + afxConstraintList* list = mConstraints_v[mConstraints_v.size()-1]; // PREDEF-NODE CONS-LIST if (list && (*list)[0]) list->push_back(cons_ctr); } - else if (sub && constraints_v.size() > 0) + else if (sub && mConstraints_v.size() > 0) { - afxConstraintList* list = constraints_v[constraints_v.size()-1]; + afxConstraintList* list = mConstraints_v[mConstraints_v.size()-1]; if (list && (*list)[0]) list->push_back(sub); } else - Con::printf("predef not found %s", def.cons_src_name); + Con::printf("predef not found %s", def.mCons_src_name); } } afxConstraintID afxConstraintMgr::getConstraintId(const afxConstraintDef& def) { - if (def.def_type == afxConstraintDef::CONS_UNDEFINED) + if (def.mDef_type == afxConstraintDef::CONS_UNDEFINED) return afxConstraintID(); - if (def.cons_src_name != ST_NULLSTRING) + if (def.mCons_src_name != ST_NULLSTRING) { - for (S32 i = 0; i < constraints_v.size(); i++) + for (S32 i = 0; i < mConstraints_v.size(); i++) { - afxConstraintList* list = constraints_v[i]; + afxConstraintList* list = mConstraints_v[i]; afxConstraint* cons = (*list)[0]; - if (def.cons_src_name == cons->cons_def.cons_src_name) + if (def.mCons_src_name == cons->mCons_def.mCons_src_name) { for (S32 j = 0; j < list->size(); j++) { afxConstraint* sub = (*list)[j]; - if (def.cons_node_name == sub->cons_def.cons_node_name && - def.pos_at_box_center == sub->cons_def.pos_at_box_center && - def.cons_src_name == sub->cons_def.cons_src_name) + if (def.mCons_node_name == sub->mCons_def.mCons_node_name && + def.mPos_at_box_center == sub->mCons_def.mPos_at_box_center && + def.mCons_src_name == sub->mCons_def.mCons_src_name) { return afxConstraintID(i, j); } @@ -957,16 +957,16 @@ afxConstraintID afxConstraintMgr::getConstraintId(const afxConstraintDef& def) // if we're here, it means the root object name matched but the node name // did not. - if (def.def_type == afxConstraintDef::CONS_PREDEFINED && !def.pos_at_box_center) + if (def.mDef_type == afxConstraintDef::CONS_PREDEFINED && !def.mPos_at_box_center) { afxShapeConstraint* shape_cons = dynamic_cast(cons); if (shape_cons) { //Con::errorf("Append a Node constraint [%s.%s] [%d,%d]", def.cons_src_name, def.cons_node_name, i, list->size()); - bool want_history = (def.history_time > 0.0f); - afxConstraint* sub = newShapeNodeCons(this, ST_NULLSTRING, def.cons_node_name, want_history); - sub->cons_def = def; - ((afxShapeConstraint*)sub)->set(shape_cons->shape); + bool want_history = (def.mHistory_time > 0.0f); + afxConstraint* sub = newShapeNodeCons(this, ST_NULLSTRING, def.mCons_node_name, want_history); + sub->mCons_def = def; + ((afxShapeConstraint*)sub)->set(shape_cons->mShape); list->push_back(sub); return afxConstraintID(i, list->size()-1); @@ -995,11 +995,11 @@ afxConstraint* afxConstraintMgr::getConstraint(afxConstraintID id) void afxConstraintMgr::sample(F32 dt, U32 now, const Point3F* cam_pos) { - U32 elapsed = now - starttime; + U32 elapsed = now - mStartTime; - for (S32 i = 0; i < constraints_v.size(); i++) + for (S32 i = 0; i < mConstraints_v.size(); i++) { - afxConstraintList* list = constraints_v[i]; + afxConstraintList* list = mConstraints_v[i]; for (S32 j = 0; j < list->size(); j++) (*list)[j]->sample(dt, elapsed, cam_pos); } @@ -1010,33 +1010,33 @@ S32 QSORT_CALLBACK cmp_cons_defs(const void* a, const void* b) afxConstraintDef* def_a = (afxConstraintDef*) a; afxConstraintDef* def_b = (afxConstraintDef*) b; - if (def_a->def_type == def_b->def_type) + if (def_a->mDef_type == def_b->mDef_type) { - if (def_a->cons_src_name == def_b->cons_src_name) + if (def_a->mCons_src_name == def_b->mCons_src_name) { - if (def_a->pos_at_box_center == def_b->pos_at_box_center) - return (def_a->cons_node_name - def_b->cons_node_name); + if (def_a->mPos_at_box_center == def_b->mPos_at_box_center) + return (def_a->mCons_node_name - def_b->mCons_node_name); else - return (def_a->pos_at_box_center) ? 1 : -1; + return (def_a->mPos_at_box_center) ? 1 : -1; } - return (def_a->cons_src_name - def_b->cons_src_name); + return (def_a->mCons_src_name - def_b->mCons_src_name); } - return (def_a->def_type - def_b->def_type); + return (def_a->mDef_type - def_b->mDef_type); } void afxConstraintMgr::initConstraintDefs(Vector& all_defs, bool on_server, F32 scoping_dist) { - initialized = true; - this->on_server = on_server; + mInitialized = true; + mOn_server = on_server; if (scoping_dist > 0.0) - scoping_dist_sq = scoping_dist*scoping_dist; + mScoping_dist_sq = scoping_dist*scoping_dist; else { SceneManager* sg = (on_server) ? gServerSceneGraph : gClientSceneGraph; F32 vis_dist = (sg) ? sg->getVisibleDistance() : 1000.0f; - scoping_dist_sq = vis_dist*vis_dist; + mScoping_dist_sq = vis_dist*vis_dist; } if (all_defs.size() < 1) @@ -1048,7 +1048,7 @@ void afxConstraintMgr::initConstraintDefs(Vector& all_defs, bo Vector ghost_defs; for (S32 i = 0; i < all_defs.size(); i++) - if (all_defs[i].def_type == afxConstraintDef::CONS_GHOST && all_defs[i].cons_src_name != ST_NULLSTRING) + if (all_defs[i].mDef_type == afxConstraintDef::CONS_GHOST && all_defs[i].mCons_src_name != ST_NULLSTRING) ghost_defs.push_back(all_defs[i]); if (ghost_defs.size() > 0) @@ -1058,13 +1058,13 @@ void afxConstraintMgr::initConstraintDefs(Vector& all_defs, bo dQsort(ghost_defs.address(), ghost_defs.size(), sizeof(afxConstraintDef), cmp_cons_defs); S32 last = 0; - defineConstraint(OBJECT_CONSTRAINT, ghost_defs[0].cons_src_name); + defineConstraint(OBJECT_CONSTRAINT, ghost_defs[0].mCons_src_name); for (S32 i = 1; i < ghost_defs.size(); i++) { - if (ghost_defs[last].cons_src_name != ghost_defs[i].cons_src_name) + if (ghost_defs[last].mCons_src_name != ghost_defs[i].mCons_src_name) { - defineConstraint(OBJECT_CONSTRAINT, ghost_defs[i].cons_src_name); + defineConstraint(OBJECT_CONSTRAINT, ghost_defs[i].mCons_src_name); last++; } } @@ -1077,13 +1077,13 @@ void afxConstraintMgr::initConstraintDefs(Vector& all_defs, bo if (on_server) { for (S32 i = 0; i < all_defs.size(); i++) - if (all_defs[i].runs_on_server) + if (all_defs[i].mRuns_on_server) defs.push_back(all_defs[i]); } else { for (S32 i = 0; i < all_defs.size(); i++) - if (all_defs[i].runs_on_client) + if (all_defs[i].mRuns_on_client) defs.push_back(all_defs[i]); } @@ -1099,17 +1099,17 @@ void afxConstraintMgr::initConstraintDefs(Vector& all_defs, bo S32 last = 0; // manufacture root-object def if absent - if (defs[0].cons_node_name != ST_NULLSTRING) + if (defs[0].mCons_node_name != ST_NULLSTRING) { afxConstraintDef root_def = defs[0]; - root_def.cons_node_name = ST_NULLSTRING; + root_def.mCons_node_name = ST_NULLSTRING; unique_defs.push_back(root_def); last++; } - else if (defs[0].pos_at_box_center) + else if (defs[0].mPos_at_box_center) { afxConstraintDef root_def = defs[0]; - root_def.pos_at_box_center = false; + root_def.mPos_at_box_center = false; unique_defs.push_back(root_def); last++; } @@ -1118,19 +1118,19 @@ void afxConstraintMgr::initConstraintDefs(Vector& all_defs, bo for (S32 i = 1; i < defs.size(); i++) { - if (unique_defs[last].cons_node_name != defs[i].cons_node_name || - unique_defs[last].cons_src_name != defs[i].cons_src_name || - unique_defs[last].pos_at_box_center != defs[i].pos_at_box_center || - unique_defs[last].def_type != defs[i].def_type) + if (unique_defs[last].mCons_node_name != defs[i].mCons_node_name || + unique_defs[last].mCons_src_name != defs[i].mCons_src_name || + unique_defs[last].mPos_at_box_center != defs[i].mPos_at_box_center || + unique_defs[last].mDef_type != defs[i].mDef_type) { // manufacture root-object def if absent - if (defs[i].cons_src_name != ST_NULLSTRING && unique_defs[last].cons_src_name != defs[i].cons_src_name) + if (defs[i].mCons_src_name != ST_NULLSTRING && unique_defs[last].mCons_src_name != defs[i].mCons_src_name) { - if (defs[i].cons_node_name != ST_NULLSTRING || defs[i].pos_at_box_center) + if (defs[i].mCons_node_name != ST_NULLSTRING || defs[i].mPos_at_box_center) { afxConstraintDef root_def = defs[i]; - root_def.cons_node_name = ST_NULLSTRING; - root_def.pos_at_box_center = false; + root_def.mCons_node_name = ST_NULLSTRING; + root_def.mPos_at_box_center = false; unique_defs.push_back(root_def); last++; } @@ -1140,10 +1140,10 @@ void afxConstraintMgr::initConstraintDefs(Vector& all_defs, bo } else { - if (defs[i].history_time > unique_defs[last].history_time) - unique_defs[last].history_time = defs[i].history_time; - if (defs[i].sample_rate > unique_defs[last].sample_rate) - unique_defs[last].sample_rate = defs[i].sample_rate; + if (defs[i].mHistory_time > unique_defs[last].mHistory_time) + unique_defs[last].mHistory_time = defs[i].mHistory_time; + if (defs[i].mSample_rate > unique_defs[last].mSample_rate) + unique_defs[last].mSample_rate = defs[i].mSample_rate; } } @@ -1157,11 +1157,11 @@ void afxConstraintMgr::initConstraintDefs(Vector& all_defs, bo // if (on_server) { - names_on_server.clear(); + mNames_on_server.clear(); defs.clear(); for (S32 i = 0; i < all_defs.size(); i++) - if (all_defs[i].runs_on_client && all_defs[i].isArbitraryObject()) + if (all_defs[i].mRuns_on_client && all_defs[i].isArbitraryObject()) defs.push_back(all_defs[i]); if (defs.size() < 1) @@ -1172,13 +1172,13 @@ void afxConstraintMgr::initConstraintDefs(Vector& all_defs, bo dQsort(defs.address(), defs.size(), sizeof(afxConstraintDef), cmp_cons_defs); S32 last = 0; - names_on_server.push_back(defs[0].cons_src_name); + mNames_on_server.push_back(defs[0].mCons_src_name); for (S32 i = 1; i < defs.size(); i++) { - if (names_on_server[last] != defs[i].cons_src_name) + if (mNames_on_server[last] != defs[i].mCons_src_name) { - names_on_server.push_back(defs[i].cons_src_name); + mNames_on_server.push_back(defs[i].mCons_src_name); last++; } } @@ -1188,13 +1188,13 @@ void afxConstraintMgr::initConstraintDefs(Vector& all_defs, bo void afxConstraintMgr::packConstraintNames(NetConnection* conn, BitStream* stream) { // pack any named constraint names and ghost indices - if (stream->writeFlag(names_on_server.size() > 0)) //-- ANY NAMED CONS_BY_ID? + if (stream->writeFlag(mNames_on_server.size() > 0)) //-- ANY NAMED CONS_BY_ID? { - stream->write(names_on_server.size()); - for (S32 i = 0; i < names_on_server.size(); i++) + stream->write(mNames_on_server.size()); + for (S32 i = 0; i < mNames_on_server.size(); i++) { - stream->writeString(names_on_server[i]); - NetObject* obj = dynamic_cast(Sim::findObject(names_on_server[i])); + stream->writeString(mNames_on_server[i]); + NetObject* obj = dynamic_cast(Sim::findObject(mNames_on_server[i])); if (!obj) { //Con::printf("CONSTRAINT-OBJECT %s does not exist.", names_on_server[i]); @@ -1219,13 +1219,13 @@ void afxConstraintMgr::unpackConstraintNames(BitStream* stream) { if (stream->readFlag()) //-- ANY NAMED CONS_BY_ID? { - names_on_server.clear(); + mNames_on_server.clear(); S32 sz; stream->read(&sz); for (S32 i = 0; i < sz; i++) { - names_on_server.push_back(stream->readSTString()); + mNames_on_server.push_back(stream->readSTString()); S32 ghost_id; stream->read(&ghost_id); - ghost_ids.push_back(ghost_id); + mGhost_ids.push_back(ghost_id); } } } @@ -1234,17 +1234,17 @@ void afxConstraintMgr::unpackConstraintNames(BitStream* stream) SceneObject* afxConstraintMgr::find_object_from_name(StringTableEntry name) { - if (names_on_server.size() > 0) + if (mNames_on_server.size() > 0) { - for (S32 i = 0; i < names_on_server.size(); i++) - if (names_on_server[i] == name) + for (S32 i = 0; i < mNames_on_server.size(); i++) + if (mNames_on_server[i] == name) { - if (ghost_ids[i] == -1) + if (mGhost_ids[i] == -1) return 0; NetConnection* conn = NetConnection::getConnectionToServer(); if (!conn) return 0; - return dynamic_cast(conn->resolveGhost(ghost_ids[i])); + return dynamic_cast(conn->resolveGhost(mGhost_ids[i])); } } @@ -1283,7 +1283,7 @@ void afxConstraintMgr::clearAllScopeableObjs() void afxConstraintMgr::postMissingConstraintObject(afxConstraint* cons, bool is_deleting) { - if (cons->gone_missing) + if (cons->mGone_missing) return; if (!is_deleting) @@ -1296,7 +1296,7 @@ void afxConstraintMgr::postMissingConstraintObject(afxConstraint* cons, bool is_ } } - cons->gone_missing = true; + cons->mGone_missing = true; missing_objs->push_back(cons); } @@ -1306,7 +1306,7 @@ void afxConstraintMgr::restoreScopedObject(SceneObject* obj, afxChoreographer* c { if ((*missing_objs)[i]->getScopeId() == obj->getScopeId()) { - (*missing_objs)[i]->gone_missing = false; + (*missing_objs)[i]->mGone_missing = false; (*missing_objs)[i]->restoreObject(obj); if (ch) ch->restoreObject(obj); @@ -1329,9 +1329,9 @@ void afxConstraintMgr::adjustProcessOrdering(afxChoreographer* ch) cons_sources.push_back(ch); // collect all the ProcessObject related constraint sources - for (S32 i = 0; i < constraints_v.size(); i++) + for (S32 i = 0; i < mConstraints_v.size(); i++) { - afxConstraintList* list = constraints_v[i]; + afxConstraintList* list = mConstraints_v[i]; afxConstraint* cons = (*list)[0]; if (cons) { @@ -1375,8 +1375,8 @@ void afxConstraintMgr::adjustProcessOrdering(afxChoreographer* ch) afxPointConstraint::afxPointConstraint(afxConstraintMgr* mgr) : afxConstraint(mgr) { - point.zero(); - vector.set(0,0,1); + mPoint.zero(); + mVector.set(0,0,1); } afxPointConstraint::~afxPointConstraint() @@ -1385,11 +1385,11 @@ afxPointConstraint::~afxPointConstraint() void afxPointConstraint::set(Point3F point, Point3F vector) { - this->point = point; - this->vector = vector; - is_defined = true; - is_valid = true; - change_code++; + mPoint = point; + mVector = vector; + mIs_defined = true; + mIs_valid = true; + mChange_code++; sample(0.0f, 0, 0); } @@ -1397,19 +1397,19 @@ void afxPointConstraint::sample(F32 dt, U32 elapsed_ms, const Point3F* cam_pos) { if (cam_pos) { - Point3F dir = (*cam_pos) - point; + Point3F dir = (*cam_pos) - mPoint; F32 dist_sq = dir.lenSquared(); - if (dist_sq > mgr->getScopingDistanceSquared()) + if (dist_sq > mMgr->getScopingDistanceSquared()) { - is_valid = false; + mIs_valid = false; return; } - is_valid = true; + mIs_valid = true; } - last_pos = point; - last_xfm.identity(); - last_xfm.setPosition(point); + mLast_pos = mPoint; + mLast_xfm.identity(); + mLast_xfm.setPosition(mPoint); } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// @@ -1418,7 +1418,7 @@ void afxPointConstraint::sample(F32 dt, U32 elapsed_ms, const Point3F* cam_pos) afxTransformConstraint::afxTransformConstraint(afxConstraintMgr* mgr) : afxConstraint(mgr) { - xfm.identity(); + mXfm.identity(); } afxTransformConstraint::~afxTransformConstraint() @@ -1427,10 +1427,10 @@ afxTransformConstraint::~afxTransformConstraint() void afxTransformConstraint::set(const MatrixF& xfm) { - this->xfm = xfm; - is_defined = true; - is_valid = true; - change_code++; + mXfm = xfm; + mIs_defined = true; + mIs_valid = true; + mChange_code++; sample(0.0f, 0, 0); } @@ -1438,18 +1438,18 @@ void afxTransformConstraint::sample(F32 dt, U32 elapsed_ms, const Point3F* cam_p { if (cam_pos) { - Point3F dir = (*cam_pos) - xfm.getPosition(); + Point3F dir = (*cam_pos) - mXfm.getPosition(); F32 dist_sq = dir.lenSquared(); - if (dist_sq > mgr->getScopingDistanceSquared()) + if (dist_sq > mMgr->getScopingDistanceSquared()) { - is_valid = false; + mIs_valid = false; return; } - is_valid = true; + mIs_valid = true; } - last_xfm = xfm; - last_pos = xfm.getPosition(); + mLast_xfm = mXfm; + mLast_pos = mXfm.getPosition(); } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// @@ -1458,115 +1458,115 @@ void afxTransformConstraint::sample(F32 dt, U32 elapsed_ms, const Point3F* cam_p afxShapeConstraint::afxShapeConstraint(afxConstraintMgr* mgr) : afxConstraint(mgr) { - arb_name = ST_NULLSTRING; - shape = 0; - scope_id = 0; - clip_tag = 0; - lock_tag = 0; + mArb_name = ST_NULLSTRING; + mShape = 0; + mScope_id = 0; + mClip_tag = 0; + mLock_tag = 0; } afxShapeConstraint::afxShapeConstraint(afxConstraintMgr* mgr, StringTableEntry arb_name) : afxConstraint(mgr) { - this->arb_name = arb_name; - shape = 0; - scope_id = 0; - clip_tag = 0; - lock_tag = 0; + mArb_name = arb_name; + mShape = 0; + mScope_id = 0; + mClip_tag = 0; + mLock_tag = 0; } afxShapeConstraint::~afxShapeConstraint() { - if (shape) - clearNotify(shape); + if (mShape) + clearNotify(mShape); } void afxShapeConstraint::set(ShapeBase* shape) { - if (this->shape) + if (mShape) { - scope_id = 0; - clearNotify(this->shape); - if (clip_tag > 0) - remapAnimation(clip_tag, shape); - if (lock_tag > 0) - unlockAnimation(lock_tag); + mScope_id = 0; + clearNotify(mShape); + if (mClip_tag > 0) + remapAnimation(mClip_tag, shape); + if (mLock_tag > 0) + unlockAnimation(mLock_tag); } - this->shape = shape; + mShape = shape; - if (this->shape) + if (mShape) { - deleteNotify(this->shape); - scope_id = this->shape->getScopeId(); + deleteNotify(mShape); + mScope_id = mShape->getScopeId(); } - if (this->shape != NULL) + if (mShape != NULL) { - is_defined = true; - is_valid = true; - change_code++; + mIs_defined = true; + mIs_valid = true; + mChange_code++; sample(0.0f, 0, 0); } else - is_valid = false; + mIs_valid = false; } void afxShapeConstraint::set_scope_id(U16 scope_id) { - if (shape) - clearNotify(shape); + if (mShape) + clearNotify(mShape); - shape = 0; - this->scope_id = scope_id; + mShape = 0; + mScope_id = scope_id; - is_defined = (this->scope_id > 0); - is_valid = false; - mgr->postMissingConstraintObject(this); + mIs_defined = (mScope_id > 0); + mIs_valid = false; + mMgr->postMissingConstraintObject(this); } void afxShapeConstraint::sample(F32 dt, U32 elapsed_ms, const Point3F* cam_pos) { - if (gone_missing) + if (mGone_missing) return; - if (shape) + if (mShape) { - last_xfm = shape->getRenderTransform(); - if (cons_def.pos_at_box_center) - last_pos = shape->getBoxCenter(); + mLast_xfm = mShape->getRenderTransform(); + if (mCons_def.mPos_at_box_center) + mLast_pos = mShape->getBoxCenter(); else - last_pos = shape->getRenderPosition(); + mLast_pos = mShape->getRenderPosition(); } } void afxShapeConstraint::restoreObject(SceneObject* obj) { - if (this->shape) + if (mShape) { - scope_id = 0; - clearNotify(this->shape); + mScope_id = 0; + clearNotify(mShape); } - this->shape = (ShapeBase* )obj; + mShape = (ShapeBase* )obj; - if (this->shape) + if (mShape) { - deleteNotify(this->shape); - scope_id = this->shape->getScopeId(); + deleteNotify(mShape); + mScope_id = mShape->getScopeId(); } - is_valid = (this->shape != NULL); + mIs_valid = (mShape != NULL); } void afxShapeConstraint::onDeleteNotify(SimObject* obj) { - if (shape == dynamic_cast(obj)) + if (mShape == dynamic_cast(obj)) { - shape = 0; - is_valid = false; - if (scope_id > 0) - mgr->postMissingConstraintObject(this, true); + mShape = 0; + mIs_valid = false; + if (mScope_id > 0) + mMgr->postMissingConstraintObject(this, true); } Parent::onDeleteNotify(obj); @@ -1574,12 +1574,12 @@ void afxShapeConstraint::onDeleteNotify(SimObject* obj) U32 afxShapeConstraint::setAnimClip(const char* clip, F32 pos, F32 rate, F32 trans, bool is_death_anim) { - if (!shape) + if (!mShape) return 0; - if (shape->isServerObject()) + if (mShape->isServerObject()) { - AIPlayer* ai_player = dynamic_cast(shape); + AIPlayer* ai_player = dynamic_cast(mShape); if (ai_player && !ai_player->isBlendAnimation(clip)) { ai_player->saveMoveState(); @@ -1587,16 +1587,16 @@ U32 afxShapeConstraint::setAnimClip(const char* clip, F32 pos, F32 rate, F32 tra } } - clip_tag = shape->playAnimation(clip, pos, rate, trans, false/*hold*/, true/*wait*/, is_death_anim); - return clip_tag; + mClip_tag = mShape->playAnimation(clip, pos, rate, trans, false/*hold*/, true/*wait*/, is_death_anim); + return mClip_tag; } void afxShapeConstraint::remapAnimation(U32 tag, ShapeBase* other_shape) { - if (clip_tag == 0) + if (mClip_tag == 0) return; - if (!shape) + if (!mShape) return; if (!other_shape) @@ -1605,83 +1605,83 @@ void afxShapeConstraint::remapAnimation(U32 tag, ShapeBase* other_shape) return; } - Con::errorf("remapAnimation -- Clip name, %s.", shape->getLastClipName(tag)); + Con::errorf("remapAnimation -- Clip name, %s.", mShape->getLastClipName(tag)); - if (shape->isClientObject()) + if (mShape->isClientObject()) { - shape->restoreAnimation(tag); + mShape->restoreAnimation(tag); } else { - AIPlayer* ai_player = dynamic_cast(shape); + AIPlayer* ai_player = dynamic_cast(mShape); if (ai_player) ai_player->restartMove(tag); else - shape->restoreAnimation(tag); + mShape->restoreAnimation(tag); } - clip_tag = 0; + mClip_tag = 0; } void afxShapeConstraint::resetAnimation(U32 tag) { - if (clip_tag == 0) + if (mClip_tag == 0) return; - if (!shape) + if (!mShape) return; - if (shape->isClientObject()) + if (mShape->isClientObject()) { - shape->restoreAnimation(tag); + mShape->restoreAnimation(tag); } else { - AIPlayer* ai_player = dynamic_cast(shape); + AIPlayer* ai_player = dynamic_cast(mShape); if (ai_player) ai_player->restartMove(tag); else - shape->restoreAnimation(tag); + mShape->restoreAnimation(tag); } - if ((tag & 0x80000000) == 0 && tag == clip_tag) - clip_tag = 0; + if ((tag & 0x80000000) == 0 && tag == mClip_tag) + mClip_tag = 0; } U32 afxShapeConstraint::lockAnimation() { - if (!shape) + if (!mShape) return 0; - lock_tag = shape->lockAnimation(); - return lock_tag; + mLock_tag = mShape->lockAnimation(); + return mLock_tag; } void afxShapeConstraint::unlockAnimation(U32 tag) { - if (lock_tag == 0) + if (mLock_tag == 0) return; - if (!shape) + if (!mShape) return; - shape->unlockAnimation(tag); - lock_tag = 0; + mShape->unlockAnimation(tag); + mLock_tag = 0; } F32 afxShapeConstraint::getAnimClipDuration(const char* clip) { - return (shape) ? shape->getAnimationDuration(clip) : 0.0f; + return (mShape) ? mShape->getAnimationDuration(clip) : 0.0f; } S32 afxShapeConstraint::getDamageState() { - return (shape) ? shape->getDamageState() : -1; + return (mShape) ? mShape->getDamageState() : -1; } U32 afxShapeConstraint::getTriggers() { - return (shape) ? shape->getShapeInstance()->getTriggerStateMask() : 0; + return (mShape) ? mShape->getShapeInstance()->getTriggerStateMask() : 0; } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// @@ -1690,45 +1690,45 @@ U32 afxShapeConstraint::getTriggers() afxShapeNodeConstraint::afxShapeNodeConstraint(afxConstraintMgr* mgr) : afxShapeConstraint(mgr) { - arb_node = ST_NULLSTRING; - shape_node_ID = -1; + mArb_node = ST_NULLSTRING; + mShape_node_ID = -1; } afxShapeNodeConstraint::afxShapeNodeConstraint(afxConstraintMgr* mgr, StringTableEntry arb_name, StringTableEntry arb_node) : afxShapeConstraint(mgr, arb_name) { - this->arb_node = arb_node; - shape_node_ID = -1; + mArb_node = arb_node; + mShape_node_ID = -1; } void afxShapeNodeConstraint::set(ShapeBase* shape) { if (shape) { - shape_node_ID = shape->getShape()->findNode(arb_node); - if (shape_node_ID == -1) - Con::errorf("Failed to find node [%s]", arb_node); + mShape_node_ID = shape->getShape()->findNode(mArb_node); + if (mShape_node_ID == -1) + Con::errorf("Failed to find node [%s]", mArb_node); } else - shape_node_ID = -1; + mShape_node_ID = -1; Parent::set(shape); } void afxShapeNodeConstraint::set_scope_id(U16 scope_id) { - shape_node_ID = -1; + mShape_node_ID = -1; Parent::set_scope_id(scope_id); } void afxShapeNodeConstraint::sample(F32 dt, U32 elapsed_ms, const Point3F* cam_pos) { - if (shape && shape_node_ID != -1) + if (mShape && mShape_node_ID != -1) { - last_xfm = shape->getRenderTransform(); - last_xfm.scale(shape->getScale()); - last_xfm.mul(shape->getShapeInstance()->mNodeTransforms[shape_node_ID]); - last_pos = last_xfm.getPosition(); + mLast_xfm = mShape->getRenderTransform(); + mLast_xfm.scale(mShape->getScale()); + mLast_xfm.mul(mShape->getShapeInstance()->mNodeTransforms[mShape_node_ID]); + mLast_pos = mLast_xfm.getPosition(); } } @@ -1737,12 +1737,12 @@ void afxShapeNodeConstraint::restoreObject(SceneObject* obj) ShapeBase* shape = dynamic_cast(obj); if (shape) { - shape_node_ID = shape->getShape()->findNode(arb_node); - if (shape_node_ID == -1) - Con::errorf("Failed to find node [%s]", arb_node); + mShape_node_ID = shape->getShape()->findNode(mArb_node); + if (mShape_node_ID == -1) + Con::errorf("Failed to find node [%s]", mArb_node); } else - shape_node_ID = -1; + mShape_node_ID = -1; Parent::restoreObject(obj); } @@ -1757,121 +1757,121 @@ void afxShapeNodeConstraint::onDeleteNotify(SimObject* obj) afxObjectConstraint::afxObjectConstraint(afxConstraintMgr* mgr) : afxConstraint(mgr) { - arb_name = ST_NULLSTRING; - obj = 0; - scope_id = 0; - is_camera = false; + mArb_name = ST_NULLSTRING; + mObj = 0; + mScope_id = 0; + mIs_camera = false; } afxObjectConstraint::afxObjectConstraint(afxConstraintMgr* mgr, StringTableEntry arb_name) : afxConstraint(mgr) { - this->arb_name = arb_name; - obj = 0; - scope_id = 0; - is_camera = false; + mArb_name = arb_name; + mObj = 0; + mScope_id = 0; + mIs_camera = false; } afxObjectConstraint::~afxObjectConstraint() { - if (obj) - clearNotify(obj); + if (mObj) + clearNotify(mObj); } void afxObjectConstraint::set(SceneObject* obj) { - if (this->obj) + if (mObj) { - scope_id = 0; - clearNotify(this->obj); + mScope_id = 0; + clearNotify(mObj); } - this->obj = obj; + mObj = obj; - if (this->obj) + if (mObj) { - deleteNotify(this->obj); - scope_id = this->obj->getScopeId(); + deleteNotify(mObj); + mScope_id = mObj->getScopeId(); } - if (this->obj != NULL) + if (mObj != NULL) { - is_camera = this->obj->isCamera(); + mIs_camera = mObj->isCamera(); - is_defined = true; - is_valid = true; - change_code++; + mIs_defined = true; + mIs_valid = true; + mChange_code++; sample(0.0f, 0, 0); } else - is_valid = false; + mIs_valid = false; } void afxObjectConstraint::set_scope_id(U16 scope_id) { - if (obj) - clearNotify(obj); + if (mObj) + clearNotify(mObj); - obj = 0; - this->scope_id = scope_id; + mObj = 0; + mScope_id = scope_id; - is_defined = (scope_id > 0); - is_valid = false; - mgr->postMissingConstraintObject(this); + mIs_defined = (scope_id > 0); + mIs_valid = false; + mMgr->postMissingConstraintObject(this); } void afxObjectConstraint::sample(F32 dt, U32 elapsed_ms, const Point3F* cam_pos) { - if (gone_missing) + if (mGone_missing) return; - if (obj) + if (mObj) { - if (!is_camera && cons_def.treat_as_camera && dynamic_cast(obj)) + if (!mIs_camera && mCons_def.mTreat_as_camera && dynamic_cast(mObj)) { - ShapeBase* cam_obj = (ShapeBase*) obj; + ShapeBase* cam_obj = (ShapeBase*) mObj; F32 pov = 1.0f; - cam_obj->getCameraTransform(&pov, &last_xfm); - last_xfm.getColumn(3, &last_pos); + cam_obj->getCameraTransform(&pov, &mLast_xfm); + mLast_xfm.getColumn(3, &mLast_pos); } else { - last_xfm = obj->getRenderTransform(); - if (cons_def.pos_at_box_center) - last_pos = obj->getBoxCenter(); + mLast_xfm = mObj->getRenderTransform(); + if (mCons_def.mPos_at_box_center) + mLast_pos = mObj->getBoxCenter(); else - last_pos = obj->getRenderPosition(); + mLast_pos = mObj->getRenderPosition(); } } } void afxObjectConstraint::restoreObject(SceneObject* obj) { - if (this->obj) + if (mObj) { - scope_id = 0; - clearNotify(this->obj); + mScope_id = 0; + clearNotify(mObj); } - this->obj = obj; + mObj = obj; - if (this->obj) + if (mObj) { - deleteNotify(this->obj); - scope_id = this->obj->getScopeId(); + deleteNotify(mObj); + mScope_id = mObj->getScopeId(); } - is_valid = (this->obj != NULL); + mIs_valid = (mObj != NULL); } void afxObjectConstraint::onDeleteNotify(SimObject* obj) { - if (this->obj == dynamic_cast(obj)) + if (mObj == dynamic_cast(obj)) { - this->obj = 0; - is_valid = false; - if (scope_id > 0) - mgr->postMissingConstraintObject(this, true); + mObj = 0; + mIs_valid = false; + if (mScope_id > 0) + mMgr->postMissingConstraintObject(this, true); } Parent::onDeleteNotify(obj); @@ -1879,14 +1879,14 @@ void afxObjectConstraint::onDeleteNotify(SimObject* obj) U32 afxObjectConstraint::getTriggers() { - TSStatic* ts_static = dynamic_cast(obj); + TSStatic* ts_static = dynamic_cast(mObj); if (ts_static) { TSShapeInstance* obj_inst = ts_static->getShapeInstance(); return (obj_inst) ? obj_inst->getTriggerStateMask() : 0; } - ShapeBase* shape_base = dynamic_cast(obj); + ShapeBase* shape_base = dynamic_cast(mObj); if (shape_base) { TSShapeInstance* obj_inst = shape_base->getShapeInstance(); @@ -1902,15 +1902,15 @@ U32 afxObjectConstraint::getTriggers() afxEffectConstraint::afxEffectConstraint(afxConstraintMgr* mgr) : afxConstraint(mgr) { - effect_name = ST_NULLSTRING; - effect = 0; + mEffect_name = ST_NULLSTRING; + mEffect = 0; } afxEffectConstraint::afxEffectConstraint(afxConstraintMgr* mgr, StringTableEntry effect_name) : afxConstraint(mgr) { - this->effect_name = effect_name; - effect = 0; + mEffect_name = effect_name; + mEffect = 0; } afxEffectConstraint::~afxEffectConstraint() @@ -1919,68 +1919,68 @@ afxEffectConstraint::~afxEffectConstraint() bool afxEffectConstraint::getPosition(Point3F& pos, F32 hist) { - if (!effect || !effect->inScope()) + if (!mEffect || !mEffect->inScope()) return false; - if (cons_def.pos_at_box_center) - effect->getUpdatedBoxCenter(pos); + if (mCons_def.mPos_at_box_center) + mEffect->getUpdatedBoxCenter(pos); else - effect->getUpdatedPosition(pos); + mEffect->getUpdatedPosition(pos); return true; } bool afxEffectConstraint::getTransform(MatrixF& xfm, F32 hist) { - if (!effect || !effect->inScope()) + if (!mEffect || !mEffect->inScope()) return false; - effect->getUpdatedTransform(xfm); + mEffect->getUpdatedTransform(xfm); return true; } bool afxEffectConstraint::getAltitudes(F32& terrain_alt, F32& interior_alt) { - if (!effect) + if (!mEffect) return false; - effect->getAltitudes(terrain_alt, interior_alt); + mEffect->getAltitudes(terrain_alt, interior_alt); return true; } void afxEffectConstraint::set(afxEffectWrapper* effect) { - this->effect = effect; + mEffect = effect; - if (this->effect != NULL) + if (mEffect != NULL) { - is_defined = true; - is_valid = true; - change_code++; + mIs_defined = true; + mIs_valid = true; + mChange_code++; } else - is_valid = false; + mIs_valid = false; } U32 afxEffectConstraint::setAnimClip(const char* clip, F32 pos, F32 rate, F32 trans, bool is_death_anim) { - return (effect) ? effect->setAnimClip(clip, pos, rate, trans) : 0; + return (mEffect) ? mEffect->setAnimClip(clip, pos, rate, trans) : 0; } void afxEffectConstraint::resetAnimation(U32 tag) { - if (effect) - effect->resetAnimation(tag); + if (mEffect) + mEffect->resetAnimation(tag); } F32 afxEffectConstraint::getAnimClipDuration(const char* clip) { - return (effect) ? getAnimClipDuration(clip) : 0; + return (mEffect) ? getAnimClipDuration(clip) : 0; } U32 afxEffectConstraint::getTriggers() { - return (effect) ? effect->getTriggers() : 0; + return (mEffect) ? mEffect->getTriggers() : 0; } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// @@ -1989,47 +1989,47 @@ U32 afxEffectConstraint::getTriggers() afxEffectNodeConstraint::afxEffectNodeConstraint(afxConstraintMgr* mgr) : afxEffectConstraint(mgr) { - effect_node = ST_NULLSTRING; - effect_node_ID = -1; + mEffect_node = ST_NULLSTRING; + mEffect_node_ID = -1; } afxEffectNodeConstraint::afxEffectNodeConstraint(afxConstraintMgr* mgr, StringTableEntry name, StringTableEntry node) : afxEffectConstraint(mgr, name) { - this->effect_node = node; - effect_node_ID = -1; + mEffect_node = node; + mEffect_node_ID = -1; } bool afxEffectNodeConstraint::getPosition(Point3F& pos, F32 hist) { - if (!effect || !effect->inScope()) + if (!mEffect || !mEffect->inScope()) return false; - TSShapeInstance* ts_shape_inst = effect->getTSShapeInstance(); + TSShapeInstance* ts_shape_inst = mEffect->getTSShapeInstance(); if (!ts_shape_inst) return false; - if (effect_node_ID == -1) + if (mEffect_node_ID == -1) { - TSShape* ts_shape = effect->getTSShape(); - effect_node_ID = (ts_shape) ? ts_shape->findNode(effect_node) : -1; + TSShape* ts_shape = mEffect->getTSShape(); + mEffect_node_ID = (ts_shape) ? ts_shape->findNode(mEffect_node) : -1; } - if (effect_node_ID == -1) + if (mEffect_node_ID == -1) return false; - effect->getUpdatedTransform(last_xfm); + mEffect->getUpdatedTransform(mLast_xfm); Point3F scale; - effect->getUpdatedScale(scale); + mEffect->getUpdatedScale(scale); - MatrixF gag = ts_shape_inst->mNodeTransforms[effect_node_ID]; + MatrixF gag = ts_shape_inst->mNodeTransforms[mEffect_node_ID]; gag.setPosition( gag.getPosition()*scale ); MatrixF xfm; - xfm.mul(last_xfm, gag); + xfm.mul(mLast_xfm, gag); // pos = xfm.getPosition(); @@ -2038,31 +2038,31 @@ bool afxEffectNodeConstraint::getPosition(Point3F& pos, F32 hist) bool afxEffectNodeConstraint::getTransform(MatrixF& xfm, F32 hist) { - if (!effect || !effect->inScope()) + if (!mEffect || !mEffect->inScope()) return false; - TSShapeInstance* ts_shape_inst = effect->getTSShapeInstance(); + TSShapeInstance* ts_shape_inst = mEffect->getTSShapeInstance(); if (!ts_shape_inst) return false; - if (effect_node_ID == -1) + if (mEffect_node_ID == -1) { - TSShape* ts_shape = effect->getTSShape(); - effect_node_ID = (ts_shape) ? ts_shape->findNode(effect_node) : -1; + TSShape* ts_shape = mEffect->getTSShape(); + mEffect_node_ID = (ts_shape) ? ts_shape->findNode(mEffect_node) : -1; } - if (effect_node_ID == -1) + if (mEffect_node_ID == -1) return false; - effect->getUpdatedTransform(last_xfm); + mEffect->getUpdatedTransform(mLast_xfm); Point3F scale; - effect->getUpdatedScale(scale); + mEffect->getUpdatedScale(scale); - MatrixF gag = ts_shape_inst->mNodeTransforms[effect_node_ID]; + MatrixF gag = ts_shape_inst->mNodeTransforms[mEffect_node_ID]; gag.setPosition( gag.getPosition()*scale ); - xfm.mul(last_xfm, gag); + xfm.mul(mLast_xfm, gag); return true; } @@ -2072,10 +2072,10 @@ void afxEffectNodeConstraint::set(afxEffectWrapper* effect) if (effect) { TSShape* ts_shape = effect->getTSShape(); - effect_node_ID = (ts_shape) ? ts_shape->findNode(effect_node) : -1; + mEffect_node_ID = (ts_shape) ? ts_shape->findNode(mEffect_node) : -1; } else - effect_node_ID = -1; + mEffect_node_ID = -1; Parent::set(effect); } @@ -2085,13 +2085,13 @@ void afxEffectNodeConstraint::set(afxEffectWrapper* effect) afxSampleBuffer::afxSampleBuffer() { - buffer_sz = 0; - buffer_ms = 0; - ms_per_sample = 33; - elapsed_ms = 0; - last_sample_ms = 0; - next_sample_num = 0; - n_samples = 0; + mBuffer_sz = 0; + mBuffer_ms = 0; + mMS_per_sample = 33; + mElapsed_ms = 0; + mLast_sample_ms = 0; + mNext_sample_num = 0; + mNum_samples = 0; } afxSampleBuffer::~afxSampleBuffer() @@ -2100,27 +2100,27 @@ afxSampleBuffer::~afxSampleBuffer() void afxSampleBuffer::configHistory(F32 hist_len, U8 sample_rate) { - buffer_sz = mCeil(hist_len*sample_rate) + 1; - ms_per_sample = mCeil(1000.0f/sample_rate); - buffer_ms = buffer_sz*ms_per_sample; + mBuffer_sz = mCeil(hist_len*sample_rate) + 1; + mMS_per_sample = mCeil(1000.0f/sample_rate); + mBuffer_ms = mBuffer_sz*mMS_per_sample; } void afxSampleBuffer::recordSample(F32 dt, U32 elapsed_ms, void* data) { - this->elapsed_ms = elapsed_ms; + mElapsed_ms = elapsed_ms; if (!data) return; - U32 now_sample_num = elapsed_ms/ms_per_sample; - if (next_sample_num <= now_sample_num) + U32 now_sample_num = elapsed_ms/mMS_per_sample; + if (mNext_sample_num <= now_sample_num) { - last_sample_ms = elapsed_ms; - while (next_sample_num <= now_sample_num) + mLast_sample_ms = elapsed_ms; + while (mNext_sample_num <= now_sample_num) { - recSample(next_sample_num % buffer_sz, data); - next_sample_num++; - n_samples++; + recSample(mNext_sample_num % mBuffer_sz, data); + mNext_sample_num++; + mNum_samples++; } } } @@ -2130,7 +2130,7 @@ inline bool afxSampleBuffer::compute_idx_from_lag(F32 lag, U32& idx) bool in_bounds = true; U32 lag_ms = lag*1000.0f; - U32 rec_ms = (elapsed_ms < buffer_ms) ? elapsed_ms : buffer_ms; + U32 rec_ms = (mElapsed_ms < mBuffer_ms) ? mElapsed_ms : mBuffer_ms; if (lag_ms > rec_ms) { // hasn't produced enough history @@ -2138,8 +2138,8 @@ inline bool afxSampleBuffer::compute_idx_from_lag(F32 lag, U32& idx) in_bounds = false; } - U32 latest_sample_num = last_sample_ms/ms_per_sample; - U32 then_sample_num = (elapsed_ms - lag_ms)/ms_per_sample; + U32 latest_sample_num = mLast_sample_ms/mMS_per_sample; + U32 then_sample_num = (mElapsed_ms - lag_ms)/mMS_per_sample; if (then_sample_num > latest_sample_num) { @@ -2148,7 +2148,7 @@ inline bool afxSampleBuffer::compute_idx_from_lag(F32 lag, U32& idx) in_bounds = false; } - idx = then_sample_num % buffer_sz; + idx = then_sample_num % mBuffer_sz; return in_bounds; } @@ -2157,7 +2157,7 @@ inline bool afxSampleBuffer::compute_idx_from_lag(F32 lag, U32& idx1, U32& idx2, bool in_bounds = true; F32 lag_ms = lag*1000.0f; - F32 rec_ms = (elapsed_ms < buffer_ms) ? elapsed_ms : buffer_ms; + F32 rec_ms = (mElapsed_ms < mBuffer_ms) ? mElapsed_ms : mBuffer_ms; if (lag_ms > rec_ms) { // hasn't produced enough history @@ -2165,9 +2165,9 @@ inline bool afxSampleBuffer::compute_idx_from_lag(F32 lag, U32& idx1, U32& idx2, in_bounds = false; } - F32 per_samp = ms_per_sample; - F32 latest_sample_num = last_sample_ms/per_samp; - F32 then_sample_num = (elapsed_ms - lag_ms)/per_samp; + F32 per_samp = mMS_per_sample; + F32 latest_sample_num = mLast_sample_ms/per_samp; + F32 then_sample_num = (mElapsed_ms - lag_ms)/per_samp; U32 latest_sample_num_i = latest_sample_num; U32 then_sample_num_i = then_sample_num; @@ -2177,14 +2177,14 @@ inline bool afxSampleBuffer::compute_idx_from_lag(F32 lag, U32& idx1, U32& idx2, if (latest_sample_num_i < then_sample_num_i) in_bounds = false; t = 0.0; - idx1 = then_sample_num_i % buffer_sz; + idx1 = then_sample_num_i % mBuffer_sz; idx2 = idx1; } else { t = then_sample_num - then_sample_num_i; - idx1 = then_sample_num_i % buffer_sz; - idx2 = (then_sample_num_i+1) % buffer_sz; + idx1 = then_sample_num_i % mBuffer_sz; + idx2 = (then_sample_num_i+1) % mBuffer_sz; } return in_bounds; @@ -2195,27 +2195,27 @@ inline bool afxSampleBuffer::compute_idx_from_lag(F32 lag, U32& idx1, U32& idx2, afxSampleXfmBuffer::afxSampleXfmBuffer() { - xfm_buffer = 0; + mXfm_buffer = 0; } afxSampleXfmBuffer::~afxSampleXfmBuffer() { - delete [] xfm_buffer; + delete [] mXfm_buffer; } void afxSampleXfmBuffer::configHistory(F32 hist_len, U8 sample_rate) { - if (!xfm_buffer) + if (!mXfm_buffer) { afxSampleBuffer::configHistory(hist_len, sample_rate); - if (buffer_sz > 0) - xfm_buffer = new MatrixF[buffer_sz]; + if (mBuffer_sz > 0) + mXfm_buffer = new MatrixF[mBuffer_sz]; } } void afxSampleXfmBuffer::recSample(U32 idx, void* data) { - xfm_buffer[idx] = *((MatrixF*)data); + mXfm_buffer[idx] = *((MatrixF*)data); } void afxSampleXfmBuffer::getSample(F32 lag, void* data, bool& in_bounds) @@ -2226,13 +2226,13 @@ void afxSampleXfmBuffer::getSample(F32 lag, void* data, bool& in_bounds) if (idx1 == idx2) { - MatrixF* m1 = &xfm_buffer[idx1]; + MatrixF* m1 = &mXfm_buffer[idx1]; *((MatrixF*)data) = *m1; } else { - MatrixF* m1 = &xfm_buffer[idx1]; - MatrixF* m2 = &xfm_buffer[idx2]; + MatrixF* m1 = &mXfm_buffer[idx1]; + MatrixF* m2 = &mXfm_buffer[idx2]; Point3F p1 = m1->getPosition(); Point3F p2 = m2->getPosition(); @@ -2253,20 +2253,20 @@ void afxSampleXfmBuffer::getSample(F32 lag, void* data, bool& in_bounds) afxPointHistConstraint::afxPointHistConstraint(afxConstraintMgr* mgr) : afxPointConstraint(mgr) { - samples = 0; + mSamples = 0; } afxPointHistConstraint::~afxPointHistConstraint() { - delete samples; + delete mSamples; } void afxPointHistConstraint::set(Point3F point, Point3F vector) { - if (!samples) + if (!mSamples) { - samples = new afxSampleXfmBuffer; - samples->configHistory(cons_def.history_time, cons_def.sample_rate); + mSamples = new afxSampleXfmBuffer; + mSamples->configHistory(mCons_def.mHistory_time, mCons_def.mSample_rate); } Parent::set(point, vector); @@ -2279,9 +2279,9 @@ void afxPointHistConstraint::sample(F32 dt, U32 elapsed_ms, const Point3F* cam_p if (isDefined()) { if (isValid()) - samples->recordSample(dt, elapsed_ms, &last_xfm); + mSamples->recordSample(dt, elapsed_ms, &mLast_xfm); else - samples->recordSample(dt, elapsed_ms, 0); + mSamples->recordSample(dt, elapsed_ms, 0); } } @@ -2290,7 +2290,7 @@ bool afxPointHistConstraint::getPosition(Point3F& pos, F32 hist) bool in_bounds; MatrixF xfm; - samples->getSample(hist, &xfm, in_bounds); + mSamples->getSample(hist, &xfm, in_bounds); pos = xfm.getPosition(); @@ -2301,7 +2301,7 @@ bool afxPointHistConstraint::getTransform(MatrixF& xfm, F32 hist) { bool in_bounds; - samples->getSample(hist, &xfm, in_bounds); + mSamples->getSample(hist, &xfm, in_bounds); return in_bounds; } @@ -2312,20 +2312,20 @@ bool afxPointHistConstraint::getTransform(MatrixF& xfm, F32 hist) afxTransformHistConstraint::afxTransformHistConstraint(afxConstraintMgr* mgr) : afxTransformConstraint(mgr) { - samples = 0; + mSamples = 0; } afxTransformHistConstraint::~afxTransformHistConstraint() { - delete samples; + delete mSamples; } void afxTransformHistConstraint::set(const MatrixF& xfm) { - if (!samples) + if (!mSamples) { - samples = new afxSampleXfmBuffer; - samples->configHistory(cons_def.history_time, cons_def.sample_rate); + mSamples = new afxSampleXfmBuffer; + mSamples->configHistory(mCons_def.mHistory_time, mCons_def.mSample_rate); } Parent::set(xfm); @@ -2338,9 +2338,9 @@ void afxTransformHistConstraint::sample(F32 dt, U32 elapsed_ms, const Point3F* c if (isDefined()) { if (isValid()) - samples->recordSample(dt, elapsed_ms, &last_xfm); + mSamples->recordSample(dt, elapsed_ms, &mLast_xfm); else - samples->recordSample(dt, elapsed_ms, 0); + mSamples->recordSample(dt, elapsed_ms, 0); } } @@ -2349,7 +2349,7 @@ bool afxTransformHistConstraint::getPosition(Point3F& pos, F32 hist) bool in_bounds; MatrixF xfm; - samples->getSample(hist, &xfm, in_bounds); + mSamples->getSample(hist, &xfm, in_bounds); pos = xfm.getPosition(); @@ -2360,7 +2360,7 @@ bool afxTransformHistConstraint::getTransform(MatrixF& xfm, F32 hist) { bool in_bounds; - samples->getSample(hist, &xfm, in_bounds); + mSamples->getSample(hist, &xfm, in_bounds); return in_bounds; } @@ -2371,26 +2371,26 @@ bool afxTransformHistConstraint::getTransform(MatrixF& xfm, F32 hist) afxShapeHistConstraint::afxShapeHistConstraint(afxConstraintMgr* mgr) : afxShapeConstraint(mgr) { - samples = 0; + mSamples = 0; } afxShapeHistConstraint::afxShapeHistConstraint(afxConstraintMgr* mgr, StringTableEntry arb_name) : afxShapeConstraint(mgr, arb_name) { - samples = 0; + mSamples = 0; } afxShapeHistConstraint::~afxShapeHistConstraint() { - delete samples; + delete mSamples; } void afxShapeHistConstraint::set(ShapeBase* shape) { - if (shape && !samples) + if (shape && !mSamples) { - samples = new afxSampleXfmBuffer; - samples->configHistory(cons_def.history_time, cons_def.sample_rate); + mSamples = new afxSampleXfmBuffer; + mSamples->configHistory(mCons_def.mHistory_time, mCons_def.mSample_rate); } Parent::set(shape); @@ -2398,10 +2398,10 @@ void afxShapeHistConstraint::set(ShapeBase* shape) void afxShapeHistConstraint::set_scope_id(U16 scope_id) { - if (scope_id > 0 && !samples) + if (scope_id > 0 && !mSamples) { - samples = new afxSampleXfmBuffer; - samples->configHistory(cons_def.history_time, cons_def.sample_rate); + mSamples = new afxSampleXfmBuffer; + mSamples->configHistory(mCons_def.mHistory_time, mCons_def.mSample_rate); } Parent::set_scope_id(scope_id); @@ -2414,9 +2414,9 @@ void afxShapeHistConstraint::sample(F32 dt, U32 elapsed_ms, const Point3F* cam_p if (isDefined()) { if (isValid()) - samples->recordSample(dt, elapsed_ms, &last_xfm); + mSamples->recordSample(dt, elapsed_ms, &mLast_xfm); else - samples->recordSample(dt, elapsed_ms, 0); + mSamples->recordSample(dt, elapsed_ms, 0); } } @@ -2425,7 +2425,7 @@ bool afxShapeHistConstraint::getPosition(Point3F& pos, F32 hist) bool in_bounds; MatrixF xfm; - samples->getSample(hist, &xfm, in_bounds); + mSamples->getSample(hist, &xfm, in_bounds); pos = xfm.getPosition(); @@ -2436,7 +2436,7 @@ bool afxShapeHistConstraint::getTransform(MatrixF& xfm, F32 hist) { bool in_bounds; - samples->getSample(hist, &xfm, in_bounds); + mSamples->getSample(hist, &xfm, in_bounds); return in_bounds; } @@ -2452,27 +2452,27 @@ void afxShapeHistConstraint::onDeleteNotify(SimObject* obj) afxShapeNodeHistConstraint::afxShapeNodeHistConstraint(afxConstraintMgr* mgr) : afxShapeNodeConstraint(mgr) { - samples = 0; + mSamples = 0; } afxShapeNodeHistConstraint::afxShapeNodeHistConstraint(afxConstraintMgr* mgr, StringTableEntry arb_name, StringTableEntry arb_node) : afxShapeNodeConstraint(mgr, arb_name, arb_node) { - samples = 0; + mSamples = 0; } afxShapeNodeHistConstraint::~afxShapeNodeHistConstraint() { - delete samples; + delete mSamples; } void afxShapeNodeHistConstraint::set(ShapeBase* shape) { - if (shape && !samples) + if (shape && !mSamples) { - samples = new afxSampleXfmBuffer; - samples->configHistory(cons_def.history_time, cons_def.sample_rate); + mSamples = new afxSampleXfmBuffer; + mSamples->configHistory(mCons_def.mHistory_time, mCons_def.mSample_rate); } Parent::set(shape); @@ -2480,10 +2480,10 @@ void afxShapeNodeHistConstraint::set(ShapeBase* shape) void afxShapeNodeHistConstraint::set_scope_id(U16 scope_id) { - if (scope_id > 0 && !samples) + if (scope_id > 0 && !mSamples) { - samples = new afxSampleXfmBuffer; - samples->configHistory(cons_def.history_time, cons_def.sample_rate); + mSamples = new afxSampleXfmBuffer; + mSamples->configHistory(mCons_def.mHistory_time, mCons_def.mSample_rate); } Parent::set_scope_id(scope_id); @@ -2496,9 +2496,9 @@ void afxShapeNodeHistConstraint::sample(F32 dt, U32 elapsed_ms, const Point3F* c if (isDefined()) { if (isValid()) - samples->recordSample(dt, elapsed_ms, &last_xfm); + mSamples->recordSample(dt, elapsed_ms, &mLast_xfm); else - samples->recordSample(dt, elapsed_ms, 0); + mSamples->recordSample(dt, elapsed_ms, 0); } } @@ -2507,7 +2507,7 @@ bool afxShapeNodeHistConstraint::getPosition(Point3F& pos, F32 hist) bool in_bounds; MatrixF xfm; - samples->getSample(hist, &xfm, in_bounds); + mSamples->getSample(hist, &xfm, in_bounds); pos = xfm.getPosition(); @@ -2518,7 +2518,7 @@ bool afxShapeNodeHistConstraint::getTransform(MatrixF& xfm, F32 hist) { bool in_bounds; - samples->getSample(hist, &xfm, in_bounds); + mSamples->getSample(hist, &xfm, in_bounds); return in_bounds; } @@ -2534,26 +2534,26 @@ void afxShapeNodeHistConstraint::onDeleteNotify(SimObject* obj) afxObjectHistConstraint::afxObjectHistConstraint(afxConstraintMgr* mgr) : afxObjectConstraint(mgr) { - samples = 0; + mSamples = 0; } afxObjectHistConstraint::afxObjectHistConstraint(afxConstraintMgr* mgr, StringTableEntry arb_name) : afxObjectConstraint(mgr, arb_name) { - samples = 0; + mSamples = 0; } afxObjectHistConstraint::~afxObjectHistConstraint() { - delete samples; + delete mSamples; } void afxObjectHistConstraint::set(SceneObject* obj) { - if (obj && !samples) + if (obj && !mSamples) { - samples = new afxSampleXfmBuffer; - samples->configHistory(cons_def.history_time, cons_def.sample_rate); + mSamples = new afxSampleXfmBuffer; + mSamples->configHistory(mCons_def.mHistory_time, mCons_def.mSample_rate); } Parent::set(obj); @@ -2561,10 +2561,10 @@ void afxObjectHistConstraint::set(SceneObject* obj) void afxObjectHistConstraint::set_scope_id(U16 scope_id) { - if (scope_id > 0 && !samples) + if (scope_id > 0 && !mSamples) { - samples = new afxSampleXfmBuffer; - samples->configHistory(cons_def.history_time, cons_def.sample_rate); + mSamples = new afxSampleXfmBuffer; + mSamples->configHistory(mCons_def.mHistory_time, mCons_def.mSample_rate); } Parent::set_scope_id(scope_id); @@ -2577,9 +2577,9 @@ void afxObjectHistConstraint::sample(F32 dt, U32 elapsed_ms, const Point3F* cam_ if (isDefined()) { if (isValid()) - samples->recordSample(dt, elapsed_ms, &last_xfm); + mSamples->recordSample(dt, elapsed_ms, &mLast_xfm); else - samples->recordSample(dt, elapsed_ms, 0); + mSamples->recordSample(dt, elapsed_ms, 0); } } @@ -2588,7 +2588,7 @@ bool afxObjectHistConstraint::getPosition(Point3F& pos, F32 hist) bool in_bounds; MatrixF xfm; - samples->getSample(hist, &xfm, in_bounds); + mSamples->getSample(hist, &xfm, in_bounds); pos = xfm.getPosition(); @@ -2599,7 +2599,7 @@ bool afxObjectHistConstraint::getTransform(MatrixF& xfm, F32 hist) { bool in_bounds; - samples->getSample(hist, &xfm, in_bounds); + mSamples->getSample(hist, &xfm, in_bounds); return in_bounds; } diff --git a/Engine/source/afx/afxConstraint.h b/Engine/source/afx/afxConstraint.h index d2ea324ae..a17ed3b29 100644 --- a/Engine/source/afx/afxConstraint.h +++ b/Engine/source/afx/afxConstraint.h @@ -47,17 +47,17 @@ struct afxConstraintDef : public afxEffectDefs CONS_GHOST }; - DefType def_type; + DefType mDef_type; - StringTableEntry cons_src_name; - StringTableEntry cons_node_name; - F32 history_time; - U8 sample_rate; + StringTableEntry mCons_src_name; + StringTableEntry mCons_node_name; + F32 mHistory_time; + U8 mSample_rate; - bool runs_on_server; - bool runs_on_client; - bool pos_at_box_center; - bool treat_as_camera; + bool mRuns_on_server; + bool mRuns_on_client; + bool mPos_at_box_center; + bool mTreat_as_camera; /*C*/ afxConstraintDef(); @@ -94,30 +94,30 @@ class afxConstraint : public SimObject, public afxEffectDefs typedef SimObject Parent; protected: - afxConstraintMgr* mgr; - afxConstraintDef cons_def; - bool is_defined; - bool is_valid; - Point3F last_pos; - MatrixF last_xfm; - F32 history_time; - bool is_alive; - bool gone_missing; - U32 change_code; + afxConstraintMgr* mMgr; + afxConstraintDef mCons_def; + bool mIs_defined; + bool mIs_valid; + Point3F mLast_pos; + MatrixF mLast_xfm; + F32 mHistory_time; + bool mIs_alive; + bool mGone_missing; + U32 mChange_code; public: /*C*/ afxConstraint(afxConstraintMgr*); virtual ~afxConstraint(); virtual bool getPosition(Point3F& pos, F32 hist=0.0f) - { pos = last_pos; return is_valid; } + { pos = mLast_pos; return mIs_valid; } virtual bool getTransform(MatrixF& xfm, F32 hist=0.0f) - { xfm = last_xfm; return is_valid;} + { xfm = mLast_xfm; return mIs_valid;} virtual bool getAltitudes(F32& terrain_alt, F32& interior_alt) { return false; } - virtual bool isDefined() { return is_defined; } - virtual bool isValid() { return is_valid; } - virtual U32 getChangeCode() { return change_code; } + virtual bool isDefined() { return mIs_defined; } + virtual bool isValid() { return mIs_valid; } + virtual U32 getChangeCode() { return mChange_code; } virtual U32 setAnimClip(const char* clip, F32 pos, F32 rate, F32 trans, bool is_death_anim) { return 0; }; @@ -127,8 +127,8 @@ public: virtual F32 getAnimClipDuration(const char* clip) { return 0.0f; } virtual S32 getDamageState() { return -1; } - virtual void setLivingState(bool state) { is_alive = state; }; - virtual bool getLivingState() { return is_alive; }; + virtual void setLivingState(bool state) { mIs_alive = state; }; + virtual bool getLivingState() { return mIs_alive; }; virtual void sample(F32 dt, U32 elapsed_ms, const Point3F* cam_pos)=0; @@ -175,15 +175,15 @@ class afxConstraintMgr : public afxEffectDefs U32 type; }; - Vector constraints_v; + Vector mConstraints_v; - Vector names_on_server; - Vector ghost_ids; - Vector predefs; - U32 starttime; - bool on_server; - bool initialized; - F32 scoping_dist_sq; + Vector mNames_on_server; + Vector mGhost_ids; + Vector mPredefs; + U32 mStartTime; + bool mOn_server; + bool mInitialized; + F32 mScoping_dist_sq; SceneObject* find_object_from_name(StringTableEntry); S32 find_cons_idx_from_name(StringTableEntry); @@ -221,7 +221,7 @@ public: void sample(F32 dt, U32 now, const Point3F* cam_pos=0); - void setStartTime(U32 timestamp) { starttime = timestamp; } + void setStartTime(U32 timestamp) { mStartTime = timestamp; } void initConstraintDefs(Vector&, bool on_server, F32 scoping_dist=-1.0f); void packConstraintNames(NetConnection* conn, BitStream* stream); void unpackConstraintNames(BitStream* stream); @@ -245,7 +245,7 @@ public: void restoreScopedObject(SceneObject*, afxChoreographer* ch); void adjustProcessOrdering(afxChoreographer*); - F32 getScopingDistanceSquared() const { return scoping_dist_sq; } + F32 getScopingDistanceSquared() const { return mScoping_dist_sq; } }; inline afxConstraintID afxConstraintMgr::setReferencePoint(StringTableEntry which, Point3F point) @@ -270,8 +270,8 @@ class afxPointConstraint : public afxConstraint typedef afxConstraint Parent; protected: - Point3F point; - Point3F vector; + Point3F mPoint; + Point3F mVector; public: /*C*/ afxPointConstraint(afxConstraintMgr*); @@ -298,7 +298,7 @@ class afxTransformConstraint : public afxConstraint typedef afxConstraint Parent; protected: - MatrixF xfm; + MatrixF mXfm; public: /*C*/ afxTransformConstraint(afxConstraintMgr*); @@ -329,11 +329,11 @@ class afxShapeConstraint : public afxConstraint typedef afxConstraint Parent; protected: - StringTableEntry arb_name; - ShapeBase* shape; - U16 scope_id; - U32 clip_tag; - U32 lock_tag; + StringTableEntry mArb_name; + ShapeBase* mShape; + U16 mScope_id; + U32 mClip_tag; + U32 mLock_tag; public: /*C*/ afxShapeConstraint(afxConstraintMgr*); @@ -354,9 +354,9 @@ public: virtual S32 getDamageState(); - virtual SceneObject* getSceneObject() { return shape; } + virtual SceneObject* getSceneObject() { return mShape; } virtual void restoreObject(SceneObject*); - virtual U16 getScopeId() { return scope_id; } + virtual U16 getScopeId() { return mScope_id; } virtual U32 getTriggers(); virtual void onDeleteNotify(SimObject*); @@ -373,8 +373,8 @@ class afxShapeNodeConstraint : public afxShapeConstraint typedef afxShapeConstraint Parent; protected: - StringTableEntry arb_node; - S32 shape_node_ID; + StringTableEntry mArb_node; + S32 mShape_node_ID; public: /*C*/ afxShapeNodeConstraint(afxConstraintMgr*); @@ -385,7 +385,7 @@ public: virtual void sample(F32 dt, U32 elapsed_ms, const Point3F* cam_pos); virtual void restoreObject(SceneObject*); - S32 getNodeID() const { return shape_node_ID; } + S32 getNodeID() const { return mShape_node_ID; } virtual void onDeleteNotify(SimObject*); }; @@ -404,10 +404,10 @@ class afxObjectConstraint : public afxConstraint typedef afxConstraint Parent; protected: - StringTableEntry arb_name; - SceneObject* obj; - U16 scope_id; - bool is_camera; + StringTableEntry mArb_name; + SceneObject* mObj; + U16 mScope_id; + bool mIs_camera; public: afxObjectConstraint(afxConstraintMgr*); @@ -418,9 +418,9 @@ public: virtual void set_scope_id(U16 scope_id); virtual void sample(F32 dt, U32 elapsed_ms, const Point3F* cam_pos); - virtual SceneObject* getSceneObject() { return obj; } + virtual SceneObject* getSceneObject() { return mObj; } virtual void restoreObject(SceneObject*); - virtual U16 getScopeId() { return scope_id; } + virtual U16 getScopeId() { return mScope_id; } virtual U32 getTriggers(); virtual void onDeleteNotify(SimObject*); @@ -441,11 +441,11 @@ class afxEffectConstraint : public afxConstraint typedef afxConstraint Parent; protected: - StringTableEntry effect_name; - afxEffectWrapper* effect; - U32 clip_tag; - bool is_death_clip; - U32 lock_tag; + StringTableEntry mEffect_name; + afxEffectWrapper* mEffect; + U32 mClip_tag; + bool mIs_death_clip; + U32 mLock_tag; public: /*C*/ afxEffectConstraint(afxConstraintMgr*); @@ -480,8 +480,8 @@ class afxEffectNodeConstraint : public afxEffectConstraint typedef afxEffectConstraint Parent; protected: - StringTableEntry effect_node; - S32 effect_node_ID; + StringTableEntry mEffect_node; + S32 mEffect_node_ID; public: /*C*/ afxEffectNodeConstraint(afxConstraintMgr*); @@ -492,7 +492,7 @@ public: virtual void set(afxEffectWrapper* effect); - S32 getNodeID() const { return effect_node_ID; } + S32 getNodeID() const { return mEffect_node_ID; } }; //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// @@ -501,13 +501,13 @@ public: class afxSampleBuffer { protected: - U32 buffer_sz; - U32 buffer_ms; - U32 ms_per_sample; - U32 elapsed_ms; - U32 last_sample_ms; - U32 next_sample_num; - U32 n_samples; + U32 mBuffer_sz; + U32 mBuffer_ms; + U32 mMS_per_sample; + U32 mElapsed_ms; + U32 mLast_sample_ms; + U32 mNext_sample_num; + U32 mNum_samples; virtual void recSample(U32 idx, void* data) = 0; bool compute_idx_from_lag(F32 lag, U32& idx); @@ -530,7 +530,7 @@ class afxSampleXfmBuffer : public afxSampleBuffer typedef afxSampleBuffer Parent; protected: - MatrixF* xfm_buffer; + MatrixF* mXfm_buffer; virtual void recSample(U32 idx, void* data); @@ -552,7 +552,7 @@ class afxPointHistConstraint : public afxPointConstraint typedef afxPointConstraint Parent; protected: - afxSampleBuffer* samples; + afxSampleBuffer* mSamples; public: /*C*/ afxPointHistConstraint(afxConstraintMgr*); @@ -575,7 +575,7 @@ class afxTransformHistConstraint : public afxTransformConstraint typedef afxTransformConstraint Parent; protected: - afxSampleBuffer* samples; + afxSampleBuffer* mSamples; public: /*C*/ afxTransformHistConstraint(afxConstraintMgr*); @@ -598,7 +598,7 @@ class afxShapeHistConstraint : public afxShapeConstraint typedef afxShapeConstraint Parent; protected: - afxSampleBuffer* samples; + afxSampleBuffer* mSamples; public: /*C*/ afxShapeHistConstraint(afxConstraintMgr*); @@ -625,7 +625,7 @@ class afxShapeNodeHistConstraint : public afxShapeNodeConstraint typedef afxShapeNodeConstraint Parent; protected: - afxSampleBuffer* samples; + afxSampleBuffer* mSamples; public: /*C*/ afxShapeNodeHistConstraint(afxConstraintMgr*); @@ -654,7 +654,7 @@ class afxObjectHistConstraint : public afxObjectConstraint typedef afxObjectConstraint Parent; protected: - afxSampleBuffer* samples; + afxSampleBuffer* mSamples; public: afxObjectHistConstraint(afxConstraintMgr*); diff --git a/Engine/source/afx/afxEffectGroup.cpp b/Engine/source/afx/afxEffectGroup.cpp index a7e97f25e..749dbbddb 100644 --- a/Engine/source/afx/afxEffectGroup.cpp +++ b/Engine/source/afx/afxEffectGroup.cpp @@ -184,7 +184,7 @@ void afxEffectGroupData::packData(BitStream* stream) stream->write(timing.fade_in_time); stream->write(timing.fade_out_time); - pack_fx(stream, fx_list, packed); + pack_fx(stream, fx_list, mPacked); } void afxEffectGroupData::unpackData(BitStream* stream) diff --git a/Engine/source/afx/afxEffectVector.cpp b/Engine/source/afx/afxEffectVector.cpp index b3d03e4c6..5de0a5e40 100644 --- a/Engine/source/afx/afxEffectVector.cpp +++ b/Engine/source/afx/afxEffectVector.cpp @@ -38,52 +38,52 @@ void afxEffectVector::filter_client_server() if (empty()) return; - for (S32 i = 0; i < fx_v->size(); i++) + for (S32 i = 0; i < mFX_v->size(); i++) { - if ((*fx_v)[i]->datablock->runsHere(on_server)) - fx_v2->push_back((*fx_v)[i]); + if ((*mFX_v)[i]->mDatablock->runsHere(mOn_server)) + mFX_v2->push_back((*mFX_v)[i]); else { - delete (*fx_v)[i]; - (*fx_v)[i] = 0; + delete (*mFX_v)[i]; + (*mFX_v)[i] = 0; } } swap_vecs(); - fx_v2->clear(); + mFX_v2->clear(); } void afxEffectVector::calc_fx_dur_and_afterlife() { - total_fx_dur = 0.0f; - after_life = 0.0f; + mTotal_fx_dur = 0.0f; + mAfter_life = 0.0f; if (empty()) return; - for (S32 i = 0; i < fx_v->size(); i++) + for (S32 i = 0; i < mFX_v->size(); i++) { - afxEffectWrapper* ew = (*fx_v)[i]; + afxEffectWrapper* ew = (*mFX_v)[i]; if (ew) { F32 ew_dur; - if (ew->ew_timing.lifetime < 0) + if (ew->mEW_timing.lifetime < 0) { - if (phrase_dur > ew->ew_timing.delay) - ew_dur = phrase_dur + ew->afterStopTime(); + if (mPhrase_dur > ew->mEW_timing.delay) + ew_dur = mPhrase_dur + ew->afterStopTime(); else - ew_dur = ew->ew_timing.delay + ew->afterStopTime(); + ew_dur = ew->mEW_timing.delay + ew->afterStopTime(); } else - ew_dur = ew->ew_timing.delay + ew->ew_timing.lifetime + ew->ew_timing.fade_out_time; + ew_dur = ew->mEW_timing.delay + ew->mEW_timing.lifetime + ew->mEW_timing.fade_out_time; - if (ew_dur > total_fx_dur) - total_fx_dur = ew_dur; + if (ew_dur > mTotal_fx_dur) + mTotal_fx_dur = ew_dur; F32 after = ew->afterStopTime(); - if (after > after_life) - after_life = after; + if (after > mAfter_life) + mAfter_life = after; } } } @@ -92,19 +92,19 @@ void afxEffectVector::calc_fx_dur_and_afterlife() afxEffectVector::afxEffectVector() { - fx_v = 0; - fx_v2 = 0; - active = false; - on_server = false; - total_fx_dur = 0; - after_life = 0; + mFX_v = 0; + mFX_v2 = 0; + mActive = false; + mOn_server = false; + mTotal_fx_dur = 0; + mAfter_life = 0; } afxEffectVector::~afxEffectVector() { stop(true); - delete fx_v; - delete fx_v2; + delete mFX_v; + delete mFX_v2; } void afxEffectVector::effects_init(afxChoreographer* chor, afxEffectList& effects, bool will_stop, F32 time_factor, @@ -189,7 +189,7 @@ void afxEffectVector::effects_init(afxChoreographer* chor, afxEffectList& effect afxEffectWrapper* effect; effect = afxEffectWrapper::ew_create(chor, ewd, cons_mgr, time_factor, group_index); if (effect) - fx_v->push_back(effect); + mFX_v->push_back(effect); } } else @@ -205,14 +205,14 @@ void afxEffectVector::effects_init(afxChoreographer* chor, afxEffectList& effect void afxEffectVector::ev_init(afxChoreographer* chor, afxEffectList& effects, bool on_server, bool will_stop, F32 time_factor, F32 phrase_dur, S32 group_index) { - this->on_server = on_server; - this->phrase_dur = phrase_dur; + mOn_server = on_server; + mPhrase_dur = phrase_dur; - fx_v = new Vector; + mFX_v = new Vector; effects_init(chor, effects, will_stop, time_factor, group_index); - fx_v2 = new Vector(fx_v->size()); + mFX_v2 = new Vector(mFX_v->size()); } void afxEffectVector::start(F32 timestamp) @@ -222,8 +222,8 @@ void afxEffectVector::start(F32 timestamp) // At this point both client and server effects are in the list. // Timing adjustments are made during prestart(). - for (S32 i = 0; i < fx_v->size(); i++) - (*fx_v)[i]->prestart(); + for (S32 i = 0; i < mFX_v->size(); i++) + (*mFX_v)[i]->prestart(); // duration and afterlife values are pre-calculated here calc_fx_dur_and_afterlife(); @@ -232,58 +232,58 @@ void afxEffectVector::start(F32 timestamp) // don't belong here, filter_client_server(); - active = true; + mActive = true; - for (S32 j = 0; j < fx_v->size(); j++) + for (S32 j = 0; j < mFX_v->size(); j++) { - if ((*fx_v)[j]->start(timestamp)) - fx_v2->push_back((*fx_v)[j]); + if ((*mFX_v)[j]->start(timestamp)) + mFX_v2->push_back((*mFX_v)[j]); else { - delete (*fx_v)[j]; - (*fx_v)[j] = 0; + delete (*mFX_v)[j]; + (*mFX_v)[j] = 0; } } swap_vecs(); - fx_v2->clear(); + mFX_v2->clear(); } void afxEffectVector::update(F32 dt) { if (empty()) { - active = false; + mActive = false; return; } - for (int i = 0; i < fx_v->size(); i++) + for (int i = 0; i < mFX_v->size(); i++) { - (*fx_v)[i]->update(dt); + (*mFX_v)[i]->update(dt); - if ((*fx_v)[i]->isDone() || (*fx_v)[i]->isAborted()) + if ((*mFX_v)[i]->isDone() || (*mFX_v)[i]->isAborted()) { // effect has ended, cleanup and delete - (*fx_v)[i]->cleanup(); - delete (*fx_v)[i]; - (*fx_v)[i] = 0; + (*mFX_v)[i]->cleanup(); + delete (*mFX_v)[i]; + (*mFX_v)[i] = 0; } else { // effect is still going, so keep it around - fx_v2->push_back((*fx_v)[i]); + mFX_v2->push_back((*mFX_v)[i]); } } swap_vecs(); - fx_v2->clear(); + mFX_v2->clear(); if (empty()) { - active = false; - delete fx_v; fx_v =0; - delete fx_v2; fx_v2 = 0; + mActive = false; + delete mFX_v; mFX_v =0; + delete mFX_v2; mFX_v2 = 0; } } @@ -291,37 +291,37 @@ void afxEffectVector::stop(bool force_cleanup) { if (empty()) { - active = false; + mActive = false; return; } - for (int i = 0; i < fx_v->size(); i++) + for (int i = 0; i < mFX_v->size(); i++) { - (*fx_v)[i]->stop(); + (*mFX_v)[i]->stop(); - if (force_cleanup || (*fx_v)[i]->deleteWhenStopped()) + if (force_cleanup || (*mFX_v)[i]->deleteWhenStopped()) { // effect is over when stopped, cleanup and delete - (*fx_v)[i]->cleanup(); - delete (*fx_v)[i]; - (*fx_v)[i] = 0; + (*mFX_v)[i]->cleanup(); + delete (*mFX_v)[i]; + (*mFX_v)[i] = 0; } else { // effect needs to fadeout or something, so keep it around - fx_v2->push_back((*fx_v)[i]); + mFX_v2->push_back((*mFX_v)[i]); } } swap_vecs(); - fx_v2->clear(); + mFX_v2->clear(); if (empty()) { - active = false; - delete fx_v; fx_v =0; - delete fx_v2; fx_v2 = 0; + mActive = false; + delete mFX_v; mFX_v =0; + delete mFX_v2; mFX_v2 = 0; } } @@ -329,27 +329,27 @@ void afxEffectVector::interrupt() { if (empty()) { - active = false; + mActive = false; return; } - for (int i = 0; i < fx_v->size(); i++) + for (int i = 0; i < mFX_v->size(); i++) { - (*fx_v)[i]->stop(); - (*fx_v)[i]->cleanup(); - delete (*fx_v)[i]; - (*fx_v)[i] = 0; + (*mFX_v)[i]->stop(); + (*mFX_v)[i]->cleanup(); + delete (*mFX_v)[i]; + (*mFX_v)[i] = 0; } swap_vecs(); - fx_v2->clear(); + mFX_v2->clear(); if (empty()) { - active = false; - delete fx_v; fx_v =0; - delete fx_v2; fx_v2 = 0; + mActive = false; + delete mFX_v; mFX_v =0; + delete mFX_v2; mFX_v2 = 0; } } diff --git a/Engine/source/afx/afxEffectVector.h b/Engine/source/afx/afxEffectVector.h index 49dc11908..837dfe2ce 100644 --- a/Engine/source/afx/afxEffectVector.h +++ b/Engine/source/afx/afxEffectVector.h @@ -37,14 +37,14 @@ class afxChoreographer; class afxEffectVector { - Vector* fx_v; - Vector* fx_v2; + Vector* mFX_v; + Vector* mFX_v2; - bool active; - bool on_server; - F32 phrase_dur; - F32 total_fx_dur; - F32 after_life; + bool mActive; + bool mOn_server; + F32 mPhrase_dur; + F32 mTotal_fx_dur; + F32 mAfter_life; void swap_vecs(); void filter_client_server(); @@ -64,21 +64,21 @@ public: void update(F32 dt); void stop(bool force_cleanup=false); void interrupt(); - bool empty() { return (!fx_v || fx_v->empty()); } - bool isActive() { return active; } - S32 count() { return (fx_v) ? fx_v->size() : 0; } + bool empty() { return (!mFX_v || mFX_v->empty()); } + bool isActive() { return mActive; } + S32 count() { return (mFX_v) ? mFX_v->size() : 0; } - F32 getTotalDur() { return total_fx_dur; } - F32 getAfterLife() { return after_life; } + F32 getTotalDur() { return mTotal_fx_dur; } + F32 getAfterLife() { return mAfter_life; } - Vector* getFX() { return fx_v; } + Vector* getFX() { return mFX_v; } }; inline void afxEffectVector::swap_vecs() { - Vector* tmp = fx_v; - fx_v = fx_v2; - fx_v2 = tmp; + Vector* tmp = mFX_v; + mFX_v = mFX_v2; + mFX_v2 = tmp; } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// diff --git a/Engine/source/afx/afxEffectWrapper.cpp b/Engine/source/afx/afxEffectWrapper.cpp index 7011b5f06..5906947ee 100644 --- a/Engine/source/afx/afxEffectWrapper.cpp +++ b/Engine/source/afx/afxEffectWrapper.cpp @@ -380,7 +380,7 @@ void afxEffectWrapperData::packData(BitStream* stream) { Parent::packData(stream); - writeDatablockID(stream, effect_data, packed); + writeDatablockID(stream, effect_data, mPacked); stream->writeString(effect_name); @@ -419,7 +419,7 @@ void afxEffectWrapperData::packData(BitStream* stream) stream->write(scale_factor); // modifiers - pack_mods(stream, xfm_modifiers, packed); + pack_mods(stream, xfm_modifiers, mPacked); mathWrite(*stream, forced_bbox); stream->write(update_forced_bbox); @@ -681,55 +681,55 @@ ConsoleDocClass( afxEffectWrapper, afxEffectWrapper::afxEffectWrapper() { - choreographer = 0; - datablock = 0; - cons_mgr = 0; + mChoreographer = 0; + mDatablock = 0; + mCons_mgr = 0; - cond_alive = true; - elapsed = 0; - life_end = 0; - life_elapsed = 0; - stopped = false; - n_updates = 0; - fade_value = 1.0f; - last_fade_value = 0.0f; - fade_in_end = 0.0; - fade_out_start = 0.0f; - in_scope = true; - is_aborted = false; - do_fade_inout = false; - do_fades = false; - full_lifetime = 0; + mCond_alive = true; + mElapsed = 0; + mLife_end = 0; + mLife_elapsed = 0; + mStopped = false; + mNum_updates = 0; + mFade_value = 1.0f; + mLast_fade_value = 0.0f; + mFade_in_end = 0.0; + mFade_out_start = 0.0f; + mIn_scope = true; + mIs_aborted = false; + mDo_fade_inout = false; + mDo_fades = false; + mFull_lifetime = 0; - time_factor = 1.0f; - prop_time_factor = 1.0f; + mTime_factor = 1.0f; + mProp_time_factor = 1.0f; - live_scale_factor = 1.0f; - live_fade_factor = 1.0f; - terrain_altitude = -1.0f; - interior_altitude = -1.0f; + mLive_scale_factor = 1.0f; + mLive_fade_factor = 1.0f; + mTerrain_altitude = -1.0f; + mInterior_altitude = -1.0f; - group_index = 0; + mGroup_index = 0; - dMemset(xfm_modifiers, 0, sizeof(xfm_modifiers)); + dMemset(mXfm_modifiers, 0, sizeof(mXfm_modifiers)); } afxEffectWrapper::~afxEffectWrapper() { for (S32 i = 0; i < MAX_XFM_MODIFIERS; i++) - if (xfm_modifiers[i]) - delete xfm_modifiers[i]; + if (mXfm_modifiers[i]) + delete mXfm_modifiers[i]; - if (datablock && datablock->effect_name != ST_NULLSTRING) + if (mDatablock && mDatablock->effect_name != ST_NULLSTRING) { - choreographer->removeNamedEffect(this); - if (datablock->use_as_cons_obj && !effect_cons_id.undefined()) - cons_mgr->setReferenceEffect(effect_cons_id, 0); + mChoreographer->removeNamedEffect(this); + if (mDatablock->use_as_cons_obj && !mEffect_cons_id.undefined()) + mCons_mgr->setReferenceEffect(mEffect_cons_id, 0); } - if (datablock && datablock->isTempClone()) - delete datablock; - datablock = 0; + if (mDatablock && mDatablock->isTempClone()) + delete mDatablock; + mDatablock = 0; } #undef myOffset @@ -737,9 +737,9 @@ afxEffectWrapper::~afxEffectWrapper() void afxEffectWrapper::initPersistFields() { - addField("liveScaleFactor", TypeF32, myOffset(live_scale_factor), + addField("liveScaleFactor", TypeF32, myOffset(mLive_scale_factor), "..."); - addField("liveFadeFactor", TypeF32, myOffset(live_fade_factor), + addField("liveFadeFactor", TypeF32, myOffset(mLive_fade_factor), "..."); Parent::initPersistFields(); @@ -754,37 +754,37 @@ void afxEffectWrapper::ew_init(afxChoreographer* choreographer, AssertFatal(datablock != NULL, "Datablock is missing."); AssertFatal(cons_mgr != NULL, "Constraint manager is missing."); - this->choreographer = choreographer; - this->datablock = datablock; - this->cons_mgr = cons_mgr; + mChoreographer = choreographer; + mDatablock = datablock; + mCons_mgr = cons_mgr; ea_set_datablock(datablock->effect_data); - ew_timing = datablock->ewd_timing; - if (ew_timing.life_bias != 1.0f) + mEW_timing = datablock->ewd_timing; + if (mEW_timing.life_bias != 1.0f) { - if (ew_timing.lifetime > 0) - ew_timing.lifetime *= ew_timing.life_bias; - ew_timing.fade_in_time *= ew_timing.life_bias; - ew_timing.fade_out_time *= ew_timing.life_bias; + if (mEW_timing.lifetime > 0) + mEW_timing.lifetime *= mEW_timing.life_bias; + mEW_timing.fade_in_time *= mEW_timing.life_bias; + mEW_timing.fade_out_time *= mEW_timing.life_bias; } - pos_cons_id = cons_mgr->getConstraintId(datablock->pos_cons_def); - orient_cons_id = cons_mgr->getConstraintId(datablock->orient_cons_def); - aim_cons_id = cons_mgr->getConstraintId(datablock->aim_cons_def); - life_cons_id = cons_mgr->getConstraintId(datablock->life_cons_def); + mPos_cons_id = cons_mgr->getConstraintId(datablock->pos_cons_def); + mOrient_cons_id = cons_mgr->getConstraintId(datablock->orient_cons_def); + mAim_cons_id = cons_mgr->getConstraintId(datablock->aim_cons_def); + mLife_cons_id = cons_mgr->getConstraintId(datablock->life_cons_def); - this->time_factor = (datablock->ignore_time_factor) ? 1.0f : time_factor; + mTime_factor = (datablock->ignore_time_factor) ? 1.0f : time_factor; if (datablock->propagate_time_factor) - prop_time_factor = time_factor; + mProp_time_factor = time_factor; if (datablock->runsHere(choreographer->isServerObject())) { for (int i = 0; i < MAX_XFM_MODIFIERS && datablock->xfm_modifiers[i] != 0; i++) { - xfm_modifiers[i] = datablock->xfm_modifiers[i]->create(this, choreographer->isServerObject()); - AssertFatal(xfm_modifiers[i] != 0, avar("Error, creation failed for xfm_modifiers[%d] of %s.", i, datablock->getName())); - if (xfm_modifiers[i] == 0) + mXfm_modifiers[i] = datablock->xfm_modifiers[i]->create(this, choreographer->isServerObject()); + AssertFatal(mXfm_modifiers[i] != 0, avar("Error, creation failed for xfm_modifiers[%d] of %s.", i, datablock->getName())); + if (mXfm_modifiers[i] == 0) Con::errorf("Error, creation failed for xfm_modifiers[%d] of %s.", i, datablock->getName()); } } @@ -795,9 +795,9 @@ void afxEffectWrapper::ew_init(afxChoreographer* choreographer, choreographer->addNamedEffect(this); if (datablock->use_as_cons_obj) { - effect_cons_id = cons_mgr->setReferenceEffect(datablock->effect_name, this); - if (effect_cons_id.undefined() && datablock->isTempClone() && datablock->runsHere(choreographer->isServerObject())) - effect_cons_id = cons_mgr->createReferenceEffect(datablock->effect_name, this); + mEffect_cons_id = cons_mgr->setReferenceEffect(datablock->effect_name, this); + if (mEffect_cons_id.undefined() && datablock->isTempClone() && datablock->runsHere(choreographer->isServerObject())) + mEffect_cons_id = cons_mgr->createReferenceEffect(datablock->effect_name, this); } } } @@ -805,37 +805,37 @@ void afxEffectWrapper::ew_init(afxChoreographer* choreographer, void afxEffectWrapper::prestart() { // modify timing values by time_factor - if (ew_timing.lifetime > 0) - ew_timing.lifetime *= time_factor; - ew_timing.delay *= time_factor; - ew_timing.fade_in_time *= time_factor; - ew_timing.fade_out_time *= time_factor; + if (mEW_timing.lifetime > 0) + mEW_timing.lifetime *= mTime_factor; + mEW_timing.delay *= mTime_factor; + mEW_timing.fade_in_time *= mTime_factor; + mEW_timing.fade_out_time *= mTime_factor; - if (ew_timing.lifetime < 0) + if (mEW_timing.lifetime < 0) { - full_lifetime = INFINITE_LIFETIME; - life_end = INFINITE_LIFETIME; + mFull_lifetime = INFINITE_LIFETIME; + mLife_end = INFINITE_LIFETIME; } else { - full_lifetime = ew_timing.lifetime + ew_timing.fade_out_time; - life_end = ew_timing.delay + ew_timing.lifetime; + mFull_lifetime = mEW_timing.lifetime + mEW_timing.fade_out_time; + mLife_end = mEW_timing.delay + mEW_timing.lifetime; } - if ((ew_timing.fade_in_time + ew_timing.fade_out_time) > 0.0f) + if ((mEW_timing.fade_in_time + mEW_timing.fade_out_time) > 0.0f) { - fade_in_end = ew_timing.delay + ew_timing.fade_in_time; - if (full_lifetime == INFINITE_LIFETIME) - fade_out_start = INFINITE_LIFETIME; + mFade_in_end = mEW_timing.delay + mEW_timing.fade_in_time; + if (mFull_lifetime == INFINITE_LIFETIME) + mFade_out_start = INFINITE_LIFETIME; else - fade_out_start = ew_timing.delay + ew_timing.lifetime; - do_fade_inout = true; + mFade_out_start = mEW_timing.delay + mEW_timing.lifetime; + mDo_fade_inout = true; } - if (!do_fade_inout && datablock->vis_keys != NULL && datablock->vis_keys->numKeys() > 0) + if (!mDo_fade_inout && mDatablock->vis_keys != NULL && mDatablock->vis_keys->numKeys() > 0) { //do_fades = true; - fade_out_start = ew_timing.delay + ew_timing.lifetime; + mFade_out_start = mEW_timing.delay + mEW_timing.lifetime; } } @@ -843,22 +843,22 @@ bool afxEffectWrapper::start(F32 timestamp) { if (!ea_is_enabled()) { - Con::warnf("afxEffectWrapper::start() -- effect type of %s is currently disabled.", datablock->getName()); + Con::warnf("afxEffectWrapper::start() -- effect type of %s is currently disabled.", mDatablock->getName()); return false; } afxConstraint* life_constraint = getLifeConstraint(); if (life_constraint) - cond_alive = life_constraint->getLivingState(); + mCond_alive = life_constraint->getLivingState(); - elapsed = timestamp; + mElapsed = timestamp; for (S32 i = 0; i < MAX_XFM_MODIFIERS; i++) { - if (!xfm_modifiers[i]) + if (!mXfm_modifiers[i]) break; else - xfm_modifiers[i]->start(timestamp); + mXfm_modifiers[i]->start(timestamp); } if (!ea_start()) @@ -874,109 +874,109 @@ bool afxEffectWrapper::start(F32 timestamp) bool afxEffectWrapper::test_life_conds() { afxConstraint* life_constraint = getLifeConstraint(); - if (!life_constraint || datablock->life_conds == 0) + if (!life_constraint || mDatablock->life_conds == 0) return true; S32 now_state = life_constraint->getDamageState(); - if ((datablock->life_conds & DEAD) != 0 && now_state == ShapeBase::Disabled) + if ((mDatablock->life_conds & DEAD) != 0 && now_state == ShapeBase::Disabled) return true; - if ((datablock->life_conds & ALIVE) != 0 && now_state == ShapeBase::Enabled) + if ((mDatablock->life_conds & ALIVE) != 0 && now_state == ShapeBase::Enabled) return true; - if ((datablock->life_conds & DYING) != 0) - return (cond_alive && now_state == ShapeBase::Disabled); + if ((mDatablock->life_conds & DYING) != 0) + return (mCond_alive && now_state == ShapeBase::Disabled); return false; } bool afxEffectWrapper::update(F32 dt) { - elapsed += dt; + mElapsed += dt; // life_elapsed won't exceed full_lifetime - life_elapsed = getMin(elapsed - ew_timing.delay, full_lifetime); + mLife_elapsed = getMin(mElapsed - mEW_timing.delay, mFull_lifetime); // update() returns early if elapsed is outside of active timing range // (delay <= elapsed <= delay+lifetime) // note: execution is always allowed beyond this point at least once, // even if elapsed exceeds the lifetime. - if (elapsed < ew_timing.delay) + if (mElapsed < mEW_timing.delay) { setScopeStatus(false); return false; } - if (!datablock->requiresStop(ew_timing) && ew_timing.lifetime < 0) + if (!mDatablock->requiresStop(mEW_timing) && mEW_timing.lifetime < 0) { - F32 afterlife = elapsed - ew_timing.delay; - if (afterlife > 1.0f || ((afterlife > 0.0f) && (n_updates > 0))) + F32 afterlife = mElapsed - mEW_timing.delay; + if (afterlife > 1.0f || ((afterlife > 0.0f) && (mNum_updates > 0))) { - setScopeStatus(ew_timing.residue_lifetime > 0.0f); + setScopeStatus(mEW_timing.residue_lifetime > 0.0f); return false; } } else { - F32 afterlife = elapsed - (full_lifetime + ew_timing.delay); - if (afterlife > 1.0f || ((afterlife > 0.0f) && (n_updates > 0))) + F32 afterlife = mElapsed - (mFull_lifetime + mEW_timing.delay); + if (afterlife > 1.0f || ((afterlife > 0.0f) && (mNum_updates > 0))) { - setScopeStatus(ew_timing.residue_lifetime > 0.0f); + setScopeStatus(mEW_timing.residue_lifetime > 0.0f); return false; } } // first time here, test if required conditions for effect are met - if (n_updates == 0) + if (mNum_updates == 0) { if (!test_life_conds()) { - elapsed = full_lifetime + ew_timing.delay; + mElapsed = mFull_lifetime + mEW_timing.delay; setScopeStatus(false); - n_updates++; + mNum_updates++; return false; } } setScopeStatus(true); - n_updates++; + mNum_updates++; // calculate current fade value if enabled - if (do_fade_inout) + if (mDo_fade_inout) { - if (ew_timing.fade_in_time > 0 && elapsed <= fade_in_end) + if (mEW_timing.fade_in_time > 0 && mElapsed <= mFade_in_end) { - F32 t = mClampF((elapsed-ew_timing.delay)/ew_timing.fade_in_time, 0.0f, 1.0f); - fade_value = afxEase::t(t, ew_timing.fadein_ease.x,ew_timing.fadein_ease.y); - do_fades = true; + F32 t = mClampF((mElapsed - mEW_timing.delay)/ mEW_timing.fade_in_time, 0.0f, 1.0f); + mFade_value = afxEase::t(t, mEW_timing.fadein_ease.x, mEW_timing.fadein_ease.y); + mDo_fades = true; } - else if (elapsed > fade_out_start) + else if (mElapsed > mFade_out_start) { - if (ew_timing.fade_out_time == 0) - fade_value = 0.0f; + if (mEW_timing.fade_out_time == 0) + mFade_value = 0.0f; else { - F32 t = mClampF(1.0f-(elapsed-fade_out_start)/ew_timing.fade_out_time, 0.0f, 1.0f); - fade_value = afxEase::t(t, ew_timing.fadeout_ease.x,ew_timing.fadeout_ease.y); + F32 t = mClampF(1.0f-(mElapsed - mFade_out_start)/ mEW_timing.fade_out_time, 0.0f, 1.0f); + mFade_value = afxEase::t(t, mEW_timing.fadeout_ease.x, mEW_timing.fadeout_ease.y); } - do_fades = true; + mDo_fades = true; } else { - fade_value = 1.0f; - do_fades = false; + mFade_value = 1.0f; + mDo_fades = false; } } else { - fade_value = 1.0; - do_fades = false; + mFade_value = 1.0; + mDo_fades = false; } - if (datablock->vis_keys && datablock->vis_keys->numKeys() > 0) + if (mDatablock->vis_keys && mDatablock->vis_keys->numKeys() > 0) { - F32 vis = datablock->vis_keys->evaluate(elapsed-ew_timing.delay); - fade_value *= mClampF(vis, 0.0f, 1.0f); - do_fades = (fade_value < 1.0f); + F32 vis = mDatablock->vis_keys->evaluate(mElapsed - mEW_timing.delay); + mFade_value *= mClampF(vis, 0.0f, 1.0f); + mDo_fades = (mFade_value < 1.0f); } // DEAL WITH CONSTRAINTS @@ -990,17 +990,17 @@ bool afxEffectWrapper::update(F32 dt) afxConstraint* pos_constraint = getPosConstraint(); if (pos_constraint) { - bool valid = pos_constraint->getPosition(CONS_POS, datablock->pos_cons_def.history_time); + bool valid = pos_constraint->getPosition(CONS_POS, mDatablock->pos_cons_def.mHistory_time); if (!valid) getUnconstrainedPosition(CONS_POS); setScopeStatus(valid); - if (valid && datablock->borrow_altitudes) + if (valid && mDatablock->borrow_altitudes) { F32 terr_alt, inter_alt; if (pos_constraint->getAltitudes(terr_alt, inter_alt)) { - terrain_altitude = terr_alt; - interior_altitude = inter_alt; + mTerrain_altitude = terr_alt; + mInterior_altitude = inter_alt; } } } @@ -1013,7 +1013,7 @@ bool afxEffectWrapper::update(F32 dt) afxConstraint* orient_constraint = getOrientConstraint(); if (orient_constraint) { - orient_constraint->getTransform(CONS_XFM, datablock->pos_cons_def.history_time); + orient_constraint->getTransform(CONS_XFM, mDatablock->pos_cons_def.mHistory_time); } else { @@ -1022,11 +1022,11 @@ bool afxEffectWrapper::update(F32 dt) afxConstraint* aim_constraint = getAimConstraint(); if (aim_constraint) - aim_constraint->getPosition(CONS_AIM, datablock->pos_cons_def.history_time); + aim_constraint->getPosition(CONS_AIM, mDatablock->pos_cons_def.mHistory_time); else CONS_AIM.zero(); - CONS_SCALE.set(datablock->scale_factor, datablock->scale_factor, datablock->scale_factor); + CONS_SCALE.set(mDatablock->scale_factor, mDatablock->scale_factor, mDatablock->scale_factor); /* if (datablock->isPositional() && CONS_POS.isZero() && in_scope) @@ -1035,44 +1035,44 @@ bool afxEffectWrapper::update(F32 dt) getBaseColor(CONS_COLOR); - params.vis = fade_value; + params.vis = mFade_value; // apply modifiers for (int i = 0; i < MAX_XFM_MODIFIERS; i++) { - if (!xfm_modifiers[i]) + if (!mXfm_modifiers[i]) break; else - xfm_modifiers[i]->updateParams(dt, life_elapsed, params); + mXfm_modifiers[i]->updateParams(dt, mLife_elapsed, params); } // final pos/orient is determined - updated_xfm = CONS_XFM; - updated_pos = CONS_POS; - updated_aim = CONS_AIM; - updated_xfm.setPosition(updated_pos); - updated_scale = CONS_SCALE; - updated_color = CONS_COLOR; + mUpdated_xfm = CONS_XFM; + mUpdated_pos = CONS_POS; + mUpdated_aim = CONS_AIM; + mUpdated_xfm.setPosition(mUpdated_pos); + mUpdated_scale = CONS_SCALE; + mUpdated_color = CONS_COLOR; if (params.vis > 1.0f) - fade_value = 1.0f; + mFade_value = 1.0f; else - fade_value = params.vis; + mFade_value = params.vis; - if (last_fade_value != fade_value) + if (mLast_fade_value != mFade_value) { - do_fades = true; - last_fade_value = fade_value; + mDo_fades = true; + mLast_fade_value = mFade_value; } else { - do_fades = (fade_value < 1.0f); + mDo_fades = (mFade_value < 1.0f); } if (!ea_update(dt)) { - is_aborted = true; - Con::errorf("afxEffectWrapper::update() -- effect %s ended unexpectedly.", datablock->getName()); + mIs_aborted = true; + Con::errorf("afxEffectWrapper::update() -- effect %s ended unexpectedly.", mDatablock->getName()); } return true; @@ -1080,44 +1080,44 @@ bool afxEffectWrapper::update(F32 dt) void afxEffectWrapper::stop() { - if (!datablock->requiresStop(ew_timing)) + if (!mDatablock->requiresStop(mEW_timing)) return; - stopped = true; + mStopped = true; // this resets full_lifetime so it starts to shrink or fade - if (full_lifetime == INFINITE_LIFETIME) + if (mFull_lifetime == INFINITE_LIFETIME) { - full_lifetime = (elapsed - ew_timing.delay) + afterStopTime(); - life_end = elapsed; - if (ew_timing.fade_out_time > 0) - fade_out_start = elapsed; + mFull_lifetime = (mElapsed - mEW_timing.delay) + afterStopTime(); + mLife_end = mElapsed; + if (mEW_timing.fade_out_time > 0) + mFade_out_start = mElapsed; } } void afxEffectWrapper::cleanup(bool was_stopped) { ea_finish(was_stopped); - if (!effect_cons_id.undefined()) + if (!mEffect_cons_id.undefined()) { - cons_mgr->setReferenceEffect(effect_cons_id, 0); - effect_cons_id = afxConstraintID(); + mCons_mgr->setReferenceEffect(mEffect_cons_id, 0); + mEffect_cons_id = afxConstraintID(); } } void afxEffectWrapper::setScopeStatus(bool in_scope) { - if (this->in_scope != in_scope) + if (mIn_scope != in_scope) { - this->in_scope = in_scope; + mIn_scope = in_scope; ea_set_scope_status(in_scope); } } bool afxEffectWrapper::isDone() { - if (!datablock->is_looping) - return (elapsed >= (life_end + ew_timing.fade_out_time)); + if (!mDatablock->is_looping) + return (mElapsed >= (mLife_end + mEW_timing.fade_out_time)); return false; } @@ -1136,7 +1136,7 @@ afxEffectWrapper* afxEffectWrapper::ew_create(afxChoreographer* choreograph if (adapter) { - adapter->group_index = (datablock->group_index != -1) ? datablock->group_index : group_index; + adapter->mGroup_index = (datablock->group_index != -1) ? datablock->group_index : group_index; adapter->ew_init(choreographer, datablock, cons_mgr, time_factor); } diff --git a/Engine/source/afx/afxEffectWrapper.h b/Engine/source/afx/afxEffectWrapper.h index 8d5ef646c..79459f76f 100644 --- a/Engine/source/afx/afxEffectWrapper.h +++ b/Engine/source/afx/afxEffectWrapper.h @@ -255,59 +255,59 @@ private: bool test_life_conds(); protected: - afxEffectWrapperData* datablock; + afxEffectWrapperData* mDatablock; - afxEffectTimingData ew_timing; + afxEffectTimingData mEW_timing; - F32 fade_in_end; - F32 fade_out_start; - F32 full_lifetime; + F32 mFade_in_end; + F32 mFade_out_start; + F32 mFull_lifetime; - F32 time_factor; - F32 prop_time_factor; + F32 mTime_factor; + F32 mProp_time_factor; - afxChoreographer* choreographer; - afxConstraintMgr* cons_mgr; + afxChoreographer* mChoreographer; + afxConstraintMgr* mCons_mgr; - afxConstraintID pos_cons_id; - afxConstraintID orient_cons_id; - afxConstraintID aim_cons_id; - afxConstraintID life_cons_id; + afxConstraintID mPos_cons_id; + afxConstraintID mOrient_cons_id; + afxConstraintID mAim_cons_id; + afxConstraintID mLife_cons_id; - afxConstraintID effect_cons_id; + afxConstraintID mEffect_cons_id; - F32 elapsed; - F32 life_elapsed; - F32 life_end; - bool stopped; - bool cond_alive; + F32 mElapsed; + F32 mLife_elapsed; + F32 mLife_end; + bool mStopped; + bool mCond_alive; - U32 n_updates; + U32 mNum_updates; - MatrixF updated_xfm; - Point3F updated_pos; - Point3F updated_aim; - Point3F updated_scale; - LinearColorF updated_color; + MatrixF mUpdated_xfm; + Point3F mUpdated_pos; + Point3F mUpdated_aim; + Point3F mUpdated_scale; + LinearColorF mUpdated_color; - F32 fade_value; - F32 last_fade_value; + F32 mFade_value; + F32 mLast_fade_value; - bool do_fade_inout; - bool do_fades; - bool in_scope; - bool is_aborted; + bool mDo_fade_inout; + bool mDo_fades; + bool mIn_scope; + bool mIs_aborted; - U8 effect_flags; + U8 mEffect_flags; - afxXM_Base* xfm_modifiers[MAX_XFM_MODIFIERS]; + afxXM_Base* mXfm_modifiers[MAX_XFM_MODIFIERS]; - F32 live_scale_factor; - F32 live_fade_factor; - F32 terrain_altitude; - F32 interior_altitude; + F32 mLive_scale_factor; + F32 mLive_fade_factor; + F32 mTerrain_altitude; + F32 mInterior_altitude; - S32 group_index; + S32 mGroup_index; public: /*C*/ afxEffectWrapper(); @@ -316,18 +316,18 @@ public: void ew_init(afxChoreographer*, afxEffectWrapperData*, afxConstraintMgr*, F32 time_factor); - F32 getFullLifetime() { return ew_timing.lifetime + ew_timing.fade_out_time; } - F32 getTimeFactor() { return time_factor; } - afxConstraint* getPosConstraint() { return cons_mgr->getConstraint(pos_cons_id); } - afxConstraint* getOrientConstraint() { return cons_mgr->getConstraint(orient_cons_id); } - afxConstraint* getAimConstraint() { return cons_mgr->getConstraint(aim_cons_id); } - afxConstraint* getLifeConstraint() { return cons_mgr->getConstraint(life_cons_id); } - afxChoreographer* getChoreographer() { return choreographer; } + F32 getFullLifetime() { return mEW_timing.lifetime + mEW_timing.fade_out_time; } + F32 getTimeFactor() { return mTime_factor; } + afxConstraint* getPosConstraint() { return mCons_mgr->getConstraint(mPos_cons_id); } + afxConstraint* getOrientConstraint() { return mCons_mgr->getConstraint(mOrient_cons_id); } + afxConstraint* getAimConstraint() { return mCons_mgr->getConstraint(mAim_cons_id); } + afxConstraint* getLifeConstraint() { return mCons_mgr->getConstraint(mLife_cons_id); } + afxChoreographer* getChoreographer() { return mChoreographer; } virtual bool isDone(); virtual bool deleteWhenStopped() { return false; } - F32 afterStopTime() { return ew_timing.fade_out_time; } - bool isAborted() const { return is_aborted; } + F32 afterStopTime() { return mEW_timing.fade_out_time; } + bool isAborted() const { return mIs_aborted; } void prestart(); bool start(F32 timestamp); @@ -345,11 +345,11 @@ public: virtual SceneObject* ea_get_scene_object() const { return 0; } U32 ea_get_triggers() const { return 0; } - void getUpdatedPosition(Point3F& pos) { pos = updated_pos;} - void getUpdatedTransform(MatrixF& xfm) { xfm = updated_xfm; } - void getUpdatedScale(Point3F& scale) { scale = updated_scale; } - void getUpdatedColor(LinearColorF& color) { color = updated_color; } - virtual void getUpdatedBoxCenter(Point3F& pos) { pos = updated_pos;} + void getUpdatedPosition(Point3F& pos) { pos = mUpdated_pos;} + void getUpdatedTransform(MatrixF& xfm) { xfm = mUpdated_xfm; } + void getUpdatedScale(Point3F& scale) { scale = mUpdated_scale; } + void getUpdatedColor(LinearColorF& color) { color = mUpdated_color; } + virtual void getUpdatedBoxCenter(Point3F& pos) { pos = mUpdated_pos;} virtual void getUnconstrainedPosition(Point3F& pos) { pos.zero();} virtual void getUnconstrainedTransform(MatrixF& xfm) { xfm.identity(); } @@ -358,9 +358,9 @@ public: SceneObject* getSceneObject() const { return ea_get_scene_object(); } U32 getTriggers() const { return ea_get_triggers(); } - F32 getMass() { return datablock->mass; } - Point3F getDirection() { return datablock->direction; } - F32 getSpeed() { return datablock->speed; } + F32 getMass() { return mDatablock->mass; } + Point3F getDirection() { return mDatablock->direction; } + F32 getSpeed() { return mDatablock->speed; } virtual TSShape* getTSShape() { return 0; } virtual TSShapeInstance* getTSShapeInstance() { return 0; } @@ -369,14 +369,14 @@ public: virtual void resetAnimation(U32 tag) { } virtual F32 getAnimClipDuration(const char* clip) { return 0.0f; } - void setTerrainAltitude(F32 alt) { terrain_altitude = alt; } - void setInteriorAltitude(F32 alt) { interior_altitude = alt; } - void getAltitudes(F32& terr_alt, F32& inter_alt) const { terr_alt = terrain_altitude; inter_alt = interior_altitude; } + void setTerrainAltitude(F32 alt) { mTerrain_altitude = alt; } + void setInteriorAltitude(F32 alt) { mInterior_altitude = alt; } + void getAltitudes(F32& terr_alt, F32& inter_alt) const { terr_alt = mTerrain_altitude; inter_alt = mInterior_altitude; } - void setGroupIndex(S32 idx) { group_index = idx; } - S32 getGroupIndex() const { return group_index; } + void setGroupIndex(S32 idx) { mGroup_index = idx; } + S32 getGroupIndex() const { return mGroup_index; } - bool inScope() const { return in_scope; } + bool inScope() const { return mIn_scope; } public: static void initPersistFields(); diff --git a/Engine/source/afx/afxEffectron.cpp b/Engine/source/afx/afxEffectron.cpp index b33fd9d99..b1b7f7eff 100644 --- a/Engine/source/afx/afxEffectron.cpp +++ b/Engine/source/afx/afxEffectron.cpp @@ -157,7 +157,7 @@ void afxEffectronData::packData(BitStream* stream) stream->write(duration); stream->write(n_loops); - pack_fx(stream, fx_list, packed); + pack_fx(stream, fx_list, mPacked); } void afxEffectronData::unpackData(BitStream* stream) @@ -407,9 +407,9 @@ U32 afxEffectron::packUpdate(NetConnection* conn, U32 mask, BitStream* stream) if (stream->writeFlag(mask & InitialUpdateMask)) { // pack extra object's ghost index or scope id if not yet ghosted - if (stream->writeFlag(dynamic_cast(extra) != 0)) + if (stream->writeFlag(dynamic_cast(mExtra) != 0)) { - NetObject* net_extra = (NetObject*)extra; + NetObject* net_extra = (NetObject*)mExtra; S32 ghost_idx = conn->getGhostIndex(net_extra); if (stream->writeFlag(ghost_idx != -1)) stream->writeRangedU32(U32(ghost_idx), 0, NetConnection::MaxGhostCount); @@ -476,7 +476,7 @@ void afxEffectron::unpackUpdate(NetConnection * conn, BitStream * stream) if (stream->readFlag()) // is ghost_idx { S32 ghost_idx = stream->readRangedU32(0, NetConnection::MaxGhostCount); - extra = dynamic_cast(conn->resolveGhost(ghost_idx)); + mExtra = dynamic_cast(conn->resolveGhost(ghost_idx)); } else { diff --git a/Engine/source/afx/afxMagicMissile.cpp b/Engine/source/afx/afxMagicMissile.cpp index be42a9941..87d919510 100644 --- a/Engine/source/afx/afxMagicMissile.cpp +++ b/Engine/source/afx/afxMagicMissile.cpp @@ -532,9 +532,9 @@ bool afxMagicMissileData::preload(bool server, String &errorStr) Con::errorf(ConsoleLogEntry::General, "ProjectileData::preload: Invalid packet, bad datablockId(decal): %d", decalId); */ - String errorStr; - if( !sfxResolve( &sound, errorStr ) ) - Con::errorf(ConsoleLogEntry::General, "afxMagicMissileData::preload: Invalid packet: %s", errorStr.c_str()); + String sfxErrorStr; + if( !sfxResolve( &sound, sfxErrorStr) ) + Con::errorf(ConsoleLogEntry::General, "afxMagicMissileData::preload: Invalid packet: %s", sfxErrorStr.c_str()); if (!lightDesc && lightDescId != 0) if (Sim::findObject(lightDescId, lightDesc) == false) @@ -1117,7 +1117,7 @@ bool afxMagicMissile::onAdd() // Setup our bounding box if (bool(mDataBlock->projectileShape) == true) - mObjBox = mDataBlock->projectileShape->bounds; + mObjBox = mDataBlock->projectileShape->mBounds; else mObjBox = Box3F(Point3F(0, 0, 0), Point3F(0, 0, 0)); resetWorldBox(); @@ -1864,7 +1864,7 @@ SceneObject* afxMagicMissile::get_default_launcher() const if (mDataBlock->reverse_targeting) { if (dynamic_cast(choreographer)) - launch_cons_obj = ((afxMagicSpell*)choreographer)->target; + launch_cons_obj = ((afxMagicSpell*)choreographer)->mTarget; if (!launch_cons_obj) { Con::errorf("afxMagicMissile::get_launch_data(): missing target constraint object for reverse targeted missile."); @@ -1874,7 +1874,7 @@ SceneObject* afxMagicMissile::get_default_launcher() const else { if (dynamic_cast(choreographer)) - launch_cons_obj = ((afxMagicSpell*)choreographer)->caster; + launch_cons_obj = ((afxMagicSpell*)choreographer)->mCaster; if (!launch_cons_obj) { Con::errorf("afxMagicMissile::get_launch_data(): missing launch constraint object missile."); @@ -2036,17 +2036,17 @@ void afxMagicMissile::launch() { if (mDataBlock->reverse_targeting) { - missile_target = spell->caster; - collide_exempt = spell->target; + missile_target = spell->mCaster; + collide_exempt = spell->mTarget; } else { - missile_target = spell->target; - collide_exempt = spell->caster; + missile_target = spell->mTarget; + collide_exempt = spell->mCaster; } - if (spell->caster) - processAfter(spell->caster); + if (spell->mCaster) + processAfter(spell->mCaster); if (missile_target) deleteNotify(missile_target); if (collide_exempt) diff --git a/Engine/source/afx/afxMagicSpell.cpp b/Engine/source/afx/afxMagicSpell.cpp index 7aeb93da8..513df0d13 100644 --- a/Engine/source/afx/afxMagicSpell.cpp +++ b/Engine/source/afx/afxMagicSpell.cpp @@ -53,19 +53,19 @@ void afxMagicSpellData::ewValidator::validateType(SimObject* object, void* typeP switch (id) { case CASTING_PHRASE: - spelldata->casting_fx_list.push_back(*ew); + spelldata->mCasting_fx_list.push_back(*ew); break; case LAUNCH_PHRASE: - spelldata->launch_fx_list.push_back(*ew); + spelldata->mLaunch_fx_list.push_back(*ew); break; case DELIVERY_PHRASE: - spelldata->delivery_fx_list.push_back(*ew); + spelldata->mDelivery_fx_list.push_back(*ew); break; case IMPACT_PHRASE: - spelldata->impact_fx_list.push_back(*ew); + spelldata->mImpact_fx_list.push_back(*ew); break; case LINGER_PHRASE: - spelldata->linger_fx_list.push_back(*ew); + spelldata->mLinger_fx_list.push_back(*ew); break; } *ew = 0; @@ -140,70 +140,70 @@ IMPLEMENT_CALLBACK( afxMagicSpellData, onActivate, void, afxMagicSpellData::afxMagicSpellData() { - casting_dur = 0.0f; - delivery_dur = 0.0f; - linger_dur = 0.0f; + mCasting_dur = 0.0f; + mDelivery_dur = 0.0f; + mLinger_dur = 0.0f; - n_casting_loops = 1; - n_delivery_loops = 1; - n_linger_loops = 1; + mNum_casting_loops = 1; + mNum_delivery_loops = 1; + mNum_linger_loops = 1; - extra_casting_time = 0.0f; - extra_delivery_time = 0.0f; - extra_linger_time = 0.0f; + mExtra_casting_time = 0.0f; + mExtra_delivery_time = 0.0f; + mExtra_linger_time = 0.0f; // interrupt flags - do_move_interrupts = true; - move_interrupt_speed = 2.0f; + mDo_move_interrupts = true; + mMove_interrupt_speed = 2.0f; // delivers projectile spells - missile_db = 0; - launch_on_server_signal = false; - primary_target_types = PlayerObjectType; + mMissile_db = 0; + mLaunch_on_server_signal = false; + mPrimary_target_types = PlayerObjectType; // dummy entry holds effect-wrapper pointer while a special validator // grabs it and adds it to an appropriate effects list - dummy_fx_entry = NULL; + mDummy_fx_entry = NULL; // marked true if datablock ids need to // be converted into pointers - do_id_convert = false; + mDo_id_convert = false; } afxMagicSpellData::afxMagicSpellData(const afxMagicSpellData& other, bool temp_clone) : afxChoreographerData(other, temp_clone) { - casting_dur = other.casting_dur; - delivery_dur = other.delivery_dur; - linger_dur = other.linger_dur; - n_casting_loops = other.n_casting_loops; - n_delivery_loops = other.n_delivery_loops; - n_linger_loops = other.n_linger_loops; - extra_casting_time = other.extra_casting_time; - extra_delivery_time = other.extra_delivery_time; - extra_linger_time = other.extra_linger_time; - do_move_interrupts = other.do_move_interrupts; - move_interrupt_speed = other.move_interrupt_speed; - missile_db = other.missile_db; - launch_on_server_signal = other.launch_on_server_signal; - primary_target_types = other.primary_target_types; + mCasting_dur = other.mCasting_dur; + mDelivery_dur = other.mDelivery_dur; + mLinger_dur = other.mLinger_dur; + mNum_casting_loops = other.mNum_casting_loops; + mNum_delivery_loops = other.mNum_delivery_loops; + mNum_linger_loops = other.mNum_linger_loops; + mExtra_casting_time = other.mExtra_casting_time; + mExtra_delivery_time = other.mExtra_delivery_time; + mExtra_linger_time = other.mExtra_linger_time; + mDo_move_interrupts = other.mDo_move_interrupts; + mMove_interrupt_speed = other.mMove_interrupt_speed; + mMissile_db = other.mMissile_db; + mLaunch_on_server_signal = other.mLaunch_on_server_signal; + mPrimary_target_types = other.mPrimary_target_types; - dummy_fx_entry = other.dummy_fx_entry; - do_id_convert = other.do_id_convert; + mDummy_fx_entry = other.mDummy_fx_entry; + mDo_id_convert = other.mDo_id_convert; - casting_fx_list = other.casting_fx_list; - launch_fx_list = other.launch_fx_list; - delivery_fx_list = other.delivery_fx_list; - impact_fx_list = other.impact_fx_list; - linger_fx_list = other.linger_fx_list; + mCasting_fx_list = other.mCasting_fx_list; + mLaunch_fx_list = other.mLaunch_fx_list; + mDelivery_fx_list = other.mDelivery_fx_list; + mImpact_fx_list = other.mImpact_fx_list; + mLinger_fx_list = other.mLinger_fx_list; } void afxMagicSpellData::reloadReset() { - casting_fx_list.clear(); - launch_fx_list.clear(); - delivery_fx_list.clear(); - impact_fx_list.clear(); - linger_fx_list.clear(); + mCasting_fx_list.clear(); + mLaunch_fx_list.clear(); + mDelivery_fx_list.clear(); + mImpact_fx_list.clear(); + mLinger_fx_list.clear(); } #define myOffset(field) Offset(field, afxMagicSpellData) @@ -219,54 +219,54 @@ void afxMagicSpellData::initPersistFields() // for each effect list, dummy_fx_entry is set and then a validator adds it to the appropriate effects list addGroup("Casting Stage"); - addField("castingDur", TypeF32, myOffset(casting_dur), + addField("castingDur", TypeF32, myOffset(mCasting_dur), "..."); - addField("numCastingLoops", TypeS32, myOffset(n_casting_loops), + addField("numCastingLoops", TypeS32, myOffset(mNum_casting_loops), "..."); - addField("extraCastingTime", TypeF32, myOffset(extra_casting_time), + addField("extraCastingTime", TypeF32, myOffset(mExtra_casting_time), "..."); - addFieldV("addCastingEffect", TYPEID(), Offset(dummy_fx_entry, afxMagicSpellData), &_castingPhrase, + addFieldV("addCastingEffect", TYPEID(), Offset(mDummy_fx_entry, afxMagicSpellData), &_castingPhrase, "..."); endGroup("Casting Stage"); addGroup("Delivery Stage"); - addField("deliveryDur", TypeF32, myOffset(delivery_dur), + addField("deliveryDur", TypeF32, myOffset(mDelivery_dur), "..."); - addField("numDeliveryLoops", TypeS32, myOffset(n_delivery_loops), + addField("numDeliveryLoops", TypeS32, myOffset(mNum_delivery_loops), "..."); - addField("extraDeliveryTime", TypeF32, myOffset(extra_delivery_time), + addField("extraDeliveryTime", TypeF32, myOffset(mExtra_delivery_time), "..."); - addFieldV("addLaunchEffect", TYPEID(), Offset(dummy_fx_entry, afxMagicSpellData), &_launchPhrase, + addFieldV("addLaunchEffect", TYPEID(), Offset(mDummy_fx_entry, afxMagicSpellData), &_launchPhrase, "..."); - addFieldV("addDeliveryEffect", TYPEID(), Offset(dummy_fx_entry, afxMagicSpellData), &_deliveryPhrase, + addFieldV("addDeliveryEffect", TYPEID(), Offset(mDummy_fx_entry, afxMagicSpellData), &_deliveryPhrase, "..."); endGroup("Delivery Stage"); addGroup("Linger Stage"); - addField("lingerDur", TypeF32, myOffset(linger_dur), + addField("lingerDur", TypeF32, myOffset(mLinger_dur), "..."); - addField("numLingerLoops", TypeS32, myOffset(n_linger_loops), + addField("numLingerLoops", TypeS32, myOffset(mNum_linger_loops), "..."); - addField("extraLingerTime", TypeF32, myOffset(extra_linger_time), + addField("extraLingerTime", TypeF32, myOffset(mExtra_linger_time), "..."); - addFieldV("addImpactEffect", TYPEID(), Offset(dummy_fx_entry, afxMagicSpellData), &_impactPhrase, + addFieldV("addImpactEffect", TYPEID(), Offset(mDummy_fx_entry, afxMagicSpellData), &_impactPhrase, "..."); - addFieldV("addLingerEffect", TYPEID(), Offset(dummy_fx_entry, afxMagicSpellData), &_lingerPhrase, + addFieldV("addLingerEffect", TYPEID(), Offset(mDummy_fx_entry, afxMagicSpellData), &_lingerPhrase, "..."); endGroup("Linger Stage"); // interrupt flags - addField("allowMovementInterrupts", TypeBool, myOffset(do_move_interrupts), + addField("allowMovementInterrupts", TypeBool, myOffset(mDo_move_interrupts), "..."); - addField("movementInterruptSpeed", TypeF32, myOffset(move_interrupt_speed), + addField("movementInterruptSpeed", TypeF32, myOffset(mMove_interrupt_speed), "..."); // delivers projectile spells - addField("missile", TYPEID(), myOffset(missile_db), + addField("missile", TYPEID(), myOffset(mMissile_db), "..."); - addField("launchOnServerSignal", TypeBool, myOffset(launch_on_server_signal), + addField("launchOnServerSignal", TypeBool, myOffset(mLaunch_on_server_signal), "..."); - addField("primaryTargetTypes", TypeS32, myOffset(primary_target_types), + addField("primaryTargetTypes", TypeS32, myOffset(mPrimary_target_types), "..."); @@ -286,8 +286,8 @@ bool afxMagicSpellData::onAdd() if (Parent::onAdd() == false) return false; - if (missile_db != NULL && delivery_dur == 0.0) - delivery_dur = -1; + if (mMissile_db != NULL && mDelivery_dur == 0.0) + mDelivery_dur = -1; return true; } @@ -311,61 +311,61 @@ void afxMagicSpellData::packData(BitStream* stream) { Parent::packData(stream); - stream->write(casting_dur); - stream->write(delivery_dur); - stream->write(linger_dur); + stream->write(mCasting_dur); + stream->write(mDelivery_dur); + stream->write(mLinger_dur); // - stream->write(n_casting_loops); - stream->write(n_delivery_loops); - stream->write(n_linger_loops); + stream->write(mNum_casting_loops); + stream->write(mNum_delivery_loops); + stream->write(mNum_linger_loops); // - stream->write(extra_casting_time); - stream->write(extra_delivery_time); - stream->write(extra_linger_time); + stream->write(mExtra_casting_time); + stream->write(mExtra_delivery_time); + stream->write(mExtra_linger_time); - stream->writeFlag(do_move_interrupts); - stream->write(move_interrupt_speed); + stream->writeFlag(mDo_move_interrupts); + stream->write(mMove_interrupt_speed); - writeDatablockID(stream, missile_db, packed); - stream->write(launch_on_server_signal); - stream->write(primary_target_types); + writeDatablockID(stream, mMissile_db, mPacked); + stream->write(mLaunch_on_server_signal); + stream->write(mPrimary_target_types); - pack_fx(stream, casting_fx_list, packed); - pack_fx(stream, launch_fx_list, packed); - pack_fx(stream, delivery_fx_list, packed); - pack_fx(stream, impact_fx_list, packed); - pack_fx(stream, linger_fx_list, packed); + pack_fx(stream, mCasting_fx_list, mPacked); + pack_fx(stream, mLaunch_fx_list, mPacked); + pack_fx(stream, mDelivery_fx_list, mPacked); + pack_fx(stream, mImpact_fx_list, mPacked); + pack_fx(stream, mLinger_fx_list, mPacked); } void afxMagicSpellData::unpackData(BitStream* stream) { Parent::unpackData(stream); - stream->read(&casting_dur); - stream->read(&delivery_dur); - stream->read(&linger_dur); + stream->read(&mCasting_dur); + stream->read(&mDelivery_dur); + stream->read(&mLinger_dur); // - stream->read(&n_casting_loops); - stream->read(&n_delivery_loops); - stream->read(&n_linger_loops); + stream->read(&mNum_casting_loops); + stream->read(&mNum_delivery_loops); + stream->read(&mNum_linger_loops); // - stream->read(&extra_casting_time); - stream->read(&extra_delivery_time); - stream->read(&extra_linger_time); + stream->read(&mExtra_casting_time); + stream->read(&mExtra_delivery_time); + stream->read(&mExtra_linger_time); - do_move_interrupts = stream->readFlag(); - stream->read(&move_interrupt_speed); + mDo_move_interrupts = stream->readFlag(); + stream->read(&mMove_interrupt_speed); - missile_db = (afxMagicMissileData*) readDatablockID(stream); - stream->read(&launch_on_server_signal); - stream->read(&primary_target_types); + mMissile_db = (afxMagicMissileData*) readDatablockID(stream); + stream->read(&mLaunch_on_server_signal); + stream->read(&mPrimary_target_types); - do_id_convert = true; - unpack_fx(stream, casting_fx_list); - unpack_fx(stream, launch_fx_list); - unpack_fx(stream, delivery_fx_list); - unpack_fx(stream, impact_fx_list); - unpack_fx(stream, linger_fx_list); + mDo_id_convert = true; + unpack_fx(stream, mCasting_fx_list); + unpack_fx(stream, mLaunch_fx_list); + unpack_fx(stream, mDelivery_fx_list); + unpack_fx(stream, mImpact_fx_list); + unpack_fx(stream, mLinger_fx_list); } bool afxMagicSpellData::writeField(StringTableEntry fieldname, const char* value) @@ -414,25 +414,25 @@ bool afxMagicSpellData::preload(bool server, String &errorStr) // Resolve objects transmitted from server if (!server) { - if (do_id_convert) + if (mDo_id_convert) { - SimObjectId missile_id = SimObjectId((uintptr_t)missile_db); + SimObjectId missile_id = SimObjectId((uintptr_t)mMissile_db); if (missile_id != 0) { // try to convert id to pointer - if (!Sim::findObject(missile_id, missile_db)) + if (!Sim::findObject(missile_id, mMissile_db)) { Con::errorf(ConsoleLogEntry::General, "afxMagicSpellData::preload() -- bad datablockId: 0x%x (missile)", missile_id); } } - expand_fx_list(casting_fx_list, "casting"); - expand_fx_list(launch_fx_list, "launch"); - expand_fx_list(delivery_fx_list, "delivery"); - expand_fx_list(impact_fx_list, "impact"); - expand_fx_list(linger_fx_list, "linger"); - do_id_convert = false; + expand_fx_list(mCasting_fx_list, "casting"); + expand_fx_list(mLaunch_fx_list, "launch"); + expand_fx_list(mDelivery_fx_list, "delivery"); + expand_fx_list(mImpact_fx_list, "impact"); + expand_fx_list(mLinger_fx_list, "linger"); + mDo_id_convert = false; } } @@ -441,14 +441,14 @@ bool afxMagicSpellData::preload(bool server, String &errorStr) void afxMagicSpellData::gatherConstraintDefs(Vector& defs) { - afxConstraintDef::gather_cons_defs(defs, casting_fx_list); - afxConstraintDef::gather_cons_defs(defs, launch_fx_list); - afxConstraintDef::gather_cons_defs(defs, delivery_fx_list); - afxConstraintDef::gather_cons_defs(defs, impact_fx_list); - afxConstraintDef::gather_cons_defs(defs, linger_fx_list); + afxConstraintDef::gather_cons_defs(defs, mCasting_fx_list); + afxConstraintDef::gather_cons_defs(defs, mLaunch_fx_list); + afxConstraintDef::gather_cons_defs(defs, mDelivery_fx_list); + afxConstraintDef::gather_cons_defs(defs, mImpact_fx_list); + afxConstraintDef::gather_cons_defs(defs, mLinger_fx_list); - if (missile_db) - missile_db->gather_cons_defs(defs); + if (mMissile_db) + mMissile_db->gather_cons_defs(defs); } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~// @@ -472,7 +472,7 @@ DefineEngineMethod(afxMagicSpellData, addCastingEffect, void, (afxEffectBaseData return; } - object->casting_fx_list.push_back(effect); + object->mCasting_fx_list.push_back(effect); } DefineEngineMethod(afxMagicSpellData, addLaunchEffect, void, (afxEffectBaseData* effect),, @@ -488,7 +488,7 @@ DefineEngineMethod(afxMagicSpellData, addLaunchEffect, void, (afxEffectBaseData* return; } - object->launch_fx_list.push_back(effect); + object->mLaunch_fx_list.push_back(effect); } DefineEngineMethod(afxMagicSpellData, addDeliveryEffect, void, (afxEffectBaseData* effect),, @@ -504,7 +504,7 @@ DefineEngineMethod(afxMagicSpellData, addDeliveryEffect, void, (afxEffectBaseDat return; } - object->delivery_fx_list.push_back(effect); + object->mDelivery_fx_list.push_back(effect); } DefineEngineMethod(afxMagicSpellData, addImpactEffect, void, (afxEffectBaseData* effect),, @@ -520,7 +520,7 @@ DefineEngineMethod(afxMagicSpellData, addImpactEffect, void, (afxEffectBaseData* return; } - object->impact_fx_list.push_back(effect); + object->mImpact_fx_list.push_back(effect); } DefineEngineMethod(afxMagicSpellData, addLingerEffect, void, (afxEffectBaseData* effect),, @@ -536,7 +536,7 @@ DefineEngineMethod(afxMagicSpellData, addLingerEffect, void, (afxEffectBaseData* return; } - object->linger_fx_list.push_back(effect); + object->mLinger_fx_list.push_back(effect); } @@ -568,9 +568,9 @@ IMPLEMENT_GLOBAL_CALLBACK( onCastingEnd, void, (), (), class CastingPhrase_C : public afxPhrase { typedef afxPhrase Parent; - ShapeBase* caster; - bool notify_castbar; - F32 castbar_progress; + ShapeBase* mCaster; + bool mNotify_castbar; + F32 mCastbar_progress; public: /*C*/ CastingPhrase_C(ShapeBase* caster, bool notify_castbar); virtual void start(F32 startstamp, F32 timestamp); @@ -582,17 +582,17 @@ public: CastingPhrase_C::CastingPhrase_C(ShapeBase* c, bool notify) : afxPhrase(false, true) { - caster = c; - notify_castbar = notify; - castbar_progress = 0.0f; + mCaster = c; + mNotify_castbar = notify; + mCastbar_progress = 0.0f; } void CastingPhrase_C::start(F32 startstamp, F32 timestamp) { Parent::start(startstamp, timestamp); //START - if (notify_castbar) + if (mNotify_castbar) { - castbar_progress = 0.0f; + mCastbar_progress = 0.0f; onCastingStart_callback(); } } @@ -601,16 +601,16 @@ void CastingPhrase_C::update(F32 dt, F32 timestamp) { Parent::update(dt, timestamp); - if (!notify_castbar) + if (!mNotify_castbar) return; - if (dur > 0 && n_loops > 0) + if (mDur > 0 && mNum_loops > 0) { - F32 nfrac = (timestamp - starttime)/(dur*n_loops); - if (nfrac - castbar_progress > 1.0f/200.0f) + F32 nfrac = (timestamp - mStartTime)/(mDur*mNum_loops); + if (nfrac - mCastbar_progress > 1.0f/200.0f) { - castbar_progress = (nfrac < 1.0f) ? nfrac : 1.0f; - onCastingProgressUpdate_callback(castbar_progress); + mCastbar_progress = (nfrac < 1.0f) ? nfrac : 1.0f; + onCastingProgressUpdate_callback(mCastbar_progress); } } } @@ -618,20 +618,20 @@ void CastingPhrase_C::update(F32 dt, F32 timestamp) void CastingPhrase_C::stop(F32 timestamp) { Parent::stop(timestamp); - if (notify_castbar) + if (mCastbar_progress) { onCastingEnd_callback(); - notify_castbar = false; + mNotify_castbar = false; } } void CastingPhrase_C::interrupt(F32 timestamp) { Parent::interrupt(timestamp); - if (notify_castbar) + if (mNotify_castbar) { onCastingEnd_callback(); - notify_castbar = false; + mNotify_castbar = false; } } @@ -733,25 +733,25 @@ void afxMagicSpell::init() //mNetFlags.set(Ghostable | ScopeAlways); mNetFlags.clear(Ghostable | ScopeAlways); - datablock = NULL; - exeblock = NULL; - missile_db = NULL; + mDatablock = NULL; + mExeblock = NULL; + mMissile_db = NULL; - caster = NULL; - target = NULL; + mCaster = NULL; + mTarget = NULL; - caster_field = NULL; - target_field = NULL; + mCaster_field = NULL; + mTarget_field = NULL; - caster_scope_id = 0; - target_scope_id = 0; - target_is_shape = false; + mCaster_scope_id = 0; + mTarget_scope_id = 0; + mTarget_is_shape = false; - constraints_initialized = false; - scoping_initialized = false; + mConstraints_initialized = false; + mScoping_initialized = false; - spell_state = (U8) INACTIVE_STATE; - spell_elapsed = 0; + mSpell_state = (U8) INACTIVE_STATE; + mSpell_elapsed = 0; // define named constraints constraint_mgr->defineConstraint(OBJECT_CONSTRAINT, CASTER_CONS); @@ -764,24 +764,24 @@ void afxMagicSpell::init() for (S32 i = 0; i < NUM_PHRASES; i++) { - phrases[i] = NULL; - tfactors[i] = 1.0f; + mPhrases[i] = NULL; + mTfactors[i] = 1.0f; } - notify_castbar = false; - overall_time_factor = 1.0f; + mNotify_castbar = false; + mOverall_time_factor = 1.0f; - camera_cons_obj = 0; + mCamera_cons_obj = 0; - marks_mask = 0; + mMarks_mask = 0; - missile = NULL; - missile_is_armed = false; - impacted_obj = NULL; - impact_pos.zero(); - impact_norm.set(0,0,1); - impacted_scope_id = 0; - impacted_is_shape = false; + mMissile = NULL; + mMissile_is_armed = false; + mImpacted_obj = NULL; + mImpact_pos.zero(); + mImpact_norm.set(0,0,1); + mImpacted_scope_id = 0; + mImpacted_is_shape = false; } afxMagicSpell::afxMagicSpell() @@ -795,18 +795,18 @@ afxMagicSpell::afxMagicSpell(ShapeBase* caster, SceneObject* target) started_with_newop = false; init(); - this->caster = caster; + mCaster = caster; if (caster) { - caster_field = caster; + mCaster_field = caster; deleteNotify(caster); processAfter(caster); } - this->target = target; + mTarget = target; if (target) { - target_field = target; + mTarget_field = target; deleteNotify(target); } } @@ -815,26 +815,26 @@ afxMagicSpell::~afxMagicSpell() { for (S32 i = 0; i < NUM_PHRASES; i++) { - if (phrases[i]) + if (mPhrases[i]) { - phrases[i]->interrupt(spell_elapsed); - delete phrases[i]; + mPhrases[i]->interrupt(mSpell_elapsed); + delete mPhrases[i]; } } - if (missile) - missile->deleteObject(); + if (mMissile) + mMissile->deleteObject(); - if (missile_db && missile_db->isTempClone()) + if (mMissile_db && mMissile_db->isTempClone()) { - delete missile_db; - missile_db = 0; + delete mMissile_db; + mMissile_db = 0; } - if (datablock && datablock->isTempClone()) + if (mDatablock && mDatablock->isTempClone()) { - delete datablock; - datablock = 0; + delete mDatablock; + mDatablock = 0; } } @@ -844,8 +844,8 @@ afxMagicSpell::~afxMagicSpell() bool afxMagicSpell::onNewDataBlock(GameBaseData* dptr, bool reload) { - datablock = dynamic_cast(dptr); - if (!datablock || !Parent::onNewDataBlock(dptr, reload)) + mDatablock = dynamic_cast(dptr); + if (!mDatablock || !Parent::onNewDataBlock(dptr, reload)) return false; if (isServerObject() && started_with_newop) @@ -855,18 +855,18 @@ bool afxMagicSpell::onNewDataBlock(GameBaseData* dptr, bool reload) assignDynamicFieldsFrom(dptr, arcaneFX::sParameterFieldPrefix, true); } - exeblock = datablock; - missile_db = datablock->missile_db; + mExeblock = mDatablock; + mMissile_db = mDatablock->mMissile_db; if (isClientObject()) { // make a temp datablock clone if there are substitutions - if (datablock->getSubstitutionCount() > 0) + if (mDatablock->getSubstitutionCount() > 0) { - afxMagicSpellData* orig_db = datablock; - datablock = new afxMagicSpellData(*orig_db, true); - exeblock = orig_db; - missile_db = datablock->missile_db; + afxMagicSpellData* orig_db = mDatablock; + mDatablock = new afxMagicSpellData(*orig_db, true); + mExeblock = orig_db; + mMissile_db = mDatablock->mMissile_db; // Don't perform substitutions yet, the spell's dynamic fields haven't // arrived yet and the substitutions may refer to them. Hold off and do // in in the onAdd() method. @@ -875,13 +875,13 @@ bool afxMagicSpell::onNewDataBlock(GameBaseData* dptr, bool reload) else if (started_with_newop) { // make a temp datablock clone if there are substitutions - if (datablock->getSubstitutionCount() > 0) + if (mDatablock->getSubstitutionCount() > 0) { - afxMagicSpellData* orig_db = datablock; - datablock = new afxMagicSpellData(*orig_db, true); - exeblock = orig_db; - orig_db->performSubstitutions(datablock, this, ranking); - missile_db = datablock->missile_db; + afxMagicSpellData* orig_db = mDatablock; + mDatablock = new afxMagicSpellData(*orig_db, true); + mExeblock = orig_db; + orig_db->performSubstitutions(mDatablock, this, ranking); + mMissile_db = mDatablock->mMissile_db; } } @@ -913,12 +913,12 @@ bool afxMagicSpell::onAdd() if (isClientObject()) { - if (datablock->isTempClone()) + if (mDatablock->isTempClone()) { - afxMagicSpellData* orig_db = (afxMagicSpellData*)exeblock; - orig_db->performSubstitutions(datablock, this, ranking); - missile_db = datablock->missile_db; - notify_castbar = (notify_castbar && (datablock->casting_dur > 0.0f)); + afxMagicSpellData* orig_db = (afxMagicSpellData*)mExeblock; + orig_db->performSubstitutions(mDatablock, this, ranking); + mMissile_db = mDatablock->mMissile_db; + mNotify_castbar = (mNotify_castbar && (mDatablock->mCasting_dur > 0.0f)); } } else if (started_with_newop && !postpone_activation) @@ -940,37 +940,37 @@ void afxMagicSpell::onDeleteNotify(SimObject* obj) { // caster deleted? ShapeBase* shape = dynamic_cast(obj); - if (shape == caster) + if (shape == mCaster) { clearProcessAfter(); - caster = NULL; - caster_field = NULL; - caster_scope_id = 0; + mCaster = NULL; + mCaster_field = NULL; + mCaster_scope_id = 0; } // target deleted? SceneObject* scene_obj = dynamic_cast(obj); - if (scene_obj == target) + if (scene_obj == mTarget) { - target = NULL; - target_field = NULL; - target_scope_id = 0; - target_is_shape = false; + mTarget = NULL; + mTarget_field = NULL; + mTarget_scope_id = 0; + mTarget_is_shape = false; } // impacted_obj deleted? - if (scene_obj == impacted_obj) + if (scene_obj == mImpacted_obj) { - impacted_obj = NULL; - impacted_scope_id = 0; - impacted_is_shape = false; + mImpacted_obj = NULL; + mImpacted_scope_id = 0; + mImpacted_is_shape = false; } // missile deleted? afxMagicMissile* missile = dynamic_cast(obj); - if (missile != NULL && missile == this->missile) + if (missile != NULL && missile == mMissile) { - this->missile = NULL; + mMissile = NULL; } // something else @@ -980,9 +980,9 @@ void afxMagicSpell::onDeleteNotify(SimObject* obj) // static void afxMagicSpell::initPersistFields() { - addField("caster", TYPEID(), Offset(caster_field, afxMagicSpell), + addField("caster", TYPEID(), Offset(mCaster_field, afxMagicSpell), "..."); - addField("target", TYPEID(), Offset(target_field, afxMagicSpell), + addField("target", TYPEID(), Offset(mTarget_field, afxMagicSpell), "..."); Parent::initPersistFields(); @@ -993,31 +993,31 @@ void afxMagicSpell::initPersistFields() void afxMagicSpell::pack_constraint_info(NetConnection* conn, BitStream* stream) { // pack caster's ghost index or scope id if not yet ghosted - if (stream->writeFlag(caster != NULL)) + if (stream->writeFlag(mCaster != NULL)) { - S32 ghost_idx = conn->getGhostIndex(caster); + S32 ghost_idx = conn->getGhostIndex(mCaster); if (stream->writeFlag(ghost_idx != -1)) stream->writeRangedU32(U32(ghost_idx), 0, NetConnection::MaxGhostCount); else { - bool bit = (caster) ? (caster->getScopeId() > 0) : false; + bool bit = (mCaster) ? (mCaster->getScopeId() > 0) : false; if (stream->writeFlag(bit)) - stream->writeInt(caster->getScopeId(), NetObject::SCOPE_ID_BITS); + stream->writeInt(mCaster->getScopeId(), NetObject::SCOPE_ID_BITS); } } // pack target's ghost index or scope id if not yet ghosted - if (stream->writeFlag(target != NULL)) + if (stream->writeFlag(mTarget != NULL)) { - S32 ghost_idx = conn->getGhostIndex(target); + S32 ghost_idx = conn->getGhostIndex(mTarget); if (stream->writeFlag(ghost_idx != -1)) stream->writeRangedU32(U32(ghost_idx), 0, NetConnection::MaxGhostCount); else { - if (stream->writeFlag(target->getScopeId() > 0)) + if (stream->writeFlag(mTarget->getScopeId() > 0)) { - stream->writeInt(target->getScopeId(), NetObject::SCOPE_ID_BITS); - stream->writeFlag(dynamic_cast(target) != NULL); // is shape? + stream->writeInt(mTarget->getScopeId(), NetObject::SCOPE_ID_BITS); + stream->writeFlag(dynamic_cast(mTarget) != NULL); // is shape? } } } @@ -1027,51 +1027,51 @@ void afxMagicSpell::pack_constraint_info(NetConnection* conn, BitStream* stream) void afxMagicSpell::unpack_constraint_info(NetConnection* conn, BitStream* stream) { - caster = NULL; - caster_field = NULL; - caster_scope_id = 0; + mCaster = NULL; + mCaster_field = NULL; + mCaster_scope_id = 0; if (stream->readFlag()) // has caster { if (stream->readFlag()) // has ghost_idx { S32 ghost_idx = stream->readRangedU32(0, NetConnection::MaxGhostCount); - caster = dynamic_cast(conn->resolveGhost(ghost_idx)); - if (caster) + mCaster = dynamic_cast(conn->resolveGhost(ghost_idx)); + if (mCaster) { - caster_field = caster; - deleteNotify(caster); - processAfter(caster); + mCaster_field = mCaster; + deleteNotify(mCaster); + processAfter(mCaster); } } else { if (stream->readFlag()) // has scope_id (is always a shape) - caster_scope_id = stream->readInt(NetObject::SCOPE_ID_BITS); + mCaster_scope_id = stream->readInt(NetObject::SCOPE_ID_BITS); } } - target = NULL; - target_field = NULL; - target_scope_id = 0; - target_is_shape = false; + mTarget = NULL; + mTarget_field = NULL; + mTarget_scope_id = 0; + mTarget_is_shape = false; if (stream->readFlag()) // has target { if (stream->readFlag()) // has ghost_idx { S32 ghost_idx = stream->readRangedU32(0, NetConnection::MaxGhostCount); - target = dynamic_cast(conn->resolveGhost(ghost_idx)); - if (target) + mTarget = dynamic_cast(conn->resolveGhost(ghost_idx)); + if (mTarget) { - target_field = target; - deleteNotify(target); + mTarget_field = mTarget; + deleteNotify(mTarget); } } else { if (stream->readFlag()) // has scope_id { - target_scope_id = stream->readInt(NetObject::SCOPE_ID_BITS); - target_is_shape = stream->readFlag(); // is shape? + mTarget_scope_id = stream->readInt(NetObject::SCOPE_ID_BITS); + mTarget_is_shape = stream->readFlag(); // is shape? } } } @@ -1089,9 +1089,9 @@ U32 afxMagicSpell::packUpdate(NetConnection* conn, U32 mask, BitStream* stream) if (stream->writeFlag(mask & InitialUpdateMask)) { // pack extra object's ghost index or scope id if not yet ghosted - if (stream->writeFlag(dynamic_cast(extra) != 0)) + if (stream->writeFlag(dynamic_cast(mExtra) != 0)) { - NetObject* net_extra = (NetObject*)extra; + NetObject* net_extra = (NetObject*)mExtra; S32 ghost_idx = conn->getGhostIndex(net_extra); if (stream->writeFlag(ghost_idx != -1)) stream->writeRangedU32(U32(ghost_idx), 0, NetConnection::MaxGhostCount); @@ -1108,12 +1108,12 @@ U32 afxMagicSpell::packUpdate(NetConnection* conn, U32 mask, BitStream* stream) stream->write(exec_conds_mask); // flag if this client owns the spellcaster - bool client_owns_caster = is_caster_client(caster, dynamic_cast(conn)); + bool client_owns_caster = is_caster_client(mCaster, dynamic_cast(conn)); stream->writeFlag(client_owns_caster); // pack per-phrase time-factor values for (S32 i = 0; i < NUM_PHRASES; i++) - stream->write(tfactors[i]); + stream->write(mTfactors[i]); // flag if this conn is zoned-in yet bool zoned_in = client_owns_caster; @@ -1129,10 +1129,10 @@ U32 afxMagicSpell::packUpdate(NetConnection* conn, U32 mask, BitStream* stream) // StateEvent or SyncEvent if (stream->writeFlag((mask & StateEventMask) || (mask & SyncEventMask))) { - stream->write(marks_mask); - stream->write(spell_state); + stream->write(mMarks_mask); + stream->write(mSpell_state); stream->write(state_elapsed()); - stream->write(spell_elapsed); + stream->write(mSpell_elapsed); } // SyncEvent @@ -1142,44 +1142,44 @@ U32 afxMagicSpell::packUpdate(NetConnection* conn, U32 mask, BitStream* stream) } // LaunchEvent - if (stream->writeFlag((mask & LaunchEventMask) && (marks_mask & MARK_LAUNCH) && missile)) + if (stream->writeFlag((mask & LaunchEventMask) && (mMarks_mask & MARK_LAUNCH) && mMissile)) { F32 vel; Point3F vel_vec; - missile->getStartingVelocityValues(vel, vel_vec); + mMissile->getStartingVelocityValues(vel, vel_vec); // pack launch vector and velocity stream->write(vel); mathWrite(*stream, vel_vec); } // ImpactEvent - if (stream->writeFlag(((mask & ImpactEventMask) || (mask & SyncEventMask)) && (marks_mask & MARK_IMPACT))) + if (stream->writeFlag(((mask & ImpactEventMask) || (mask & SyncEventMask)) && (mMarks_mask & MARK_IMPACT))) { // pack impact objects's ghost index or scope id if not yet ghosted - if (stream->writeFlag(impacted_obj != NULL)) + if (stream->writeFlag(mImpacted_obj != NULL)) { - S32 ghost_idx = conn->getGhostIndex(impacted_obj); + S32 ghost_idx = conn->getGhostIndex(mImpacted_obj); if (stream->writeFlag(ghost_idx != -1)) stream->writeRangedU32(U32(ghost_idx), 0, NetConnection::MaxGhostCount); else { - if (stream->writeFlag(impacted_obj->getScopeId() > 0)) + if (stream->writeFlag(mImpacted_obj->getScopeId() > 0)) { - stream->writeInt(impacted_obj->getScopeId(), NetObject::SCOPE_ID_BITS); - stream->writeFlag(dynamic_cast(impacted_obj) != NULL); + stream->writeInt(mImpacted_obj->getScopeId(), NetObject::SCOPE_ID_BITS); + stream->writeFlag(dynamic_cast(mImpacted_obj) != NULL); } } } // pack impact position and normal - mathWrite(*stream, impact_pos); - mathWrite(*stream, impact_norm); + mathWrite(*stream, mImpact_pos); + mathWrite(*stream, mImpact_norm); stream->write(exec_conds_mask); ShapeBase* temp_shape; - stream->writeFlag(caster != 0 && caster->getDamageState() == ShapeBase::Enabled); - temp_shape = dynamic_cast(target); + stream->writeFlag(mCaster != 0 && mCaster->getDamageState() == ShapeBase::Enabled); + temp_shape = dynamic_cast(mTarget); stream->writeFlag(temp_shape != 0 && temp_shape->getDamageState() == ShapeBase::Enabled); - temp_shape = dynamic_cast(impacted_obj); + temp_shape = dynamic_cast(mImpacted_obj); stream->writeFlag(temp_shape != 0 && temp_shape->getDamageState() == ShapeBase::Enabled); } @@ -1201,14 +1201,14 @@ bool afxMagicSpell::remap_builtin_constraint(SceneObject* obj, const char* cons_ return true; if (cons_name_ste == TARGET_CONS) { - if (obj && target && obj != target && !target_cons_id.undefined()) + if (obj && mTarget && obj != mTarget && !mTarget_cons_id.undefined()) { - target = obj; - constraint_mgr->setReferenceObject(target_cons_id, target); + mTarget = obj; + constraint_mgr->setReferenceObject(mTarget_cons_id, mTarget); if (isServerObject()) { - if (target->isScopeable()) - constraint_mgr->addScopeableObject(target); + if (mTarget->isScopeable()) + constraint_mgr->addScopeableObject(mTarget); } } return true; @@ -1252,7 +1252,7 @@ void afxMagicSpell::unpackUpdate(NetConnection * conn, BitStream * stream) if (stream->readFlag()) // is ghost_idx { S32 ghost_idx = stream->readRangedU32(0, NetConnection::MaxGhostCount); - extra = dynamic_cast(conn->resolveGhost(ghost_idx)); + mExtra = dynamic_cast(conn->resolveGhost(ghost_idx)); } else { @@ -1271,11 +1271,11 @@ void afxMagicSpell::unpackUpdate(NetConnection * conn, BitStream * stream) // enable castbar updates bool client_owns_caster = stream->readFlag(); if (client_owns_caster) - notify_castbar = Con::isFunction("onCastingStart"); + mNotify_castbar = Con::isFunction("onCastingStart"); // unpack per-phrase time-factor values for (S32 i = 0; i < NUM_PHRASES; i++) - stream->read(&tfactors[i]); + stream->read(&mTfactors[i]); // if client is marked as fully zoned in if ((zoned_in = stream->readFlag()) == true) @@ -1294,7 +1294,7 @@ void afxMagicSpell::unpackUpdate(NetConnection * conn, BitStream * stream) stream->read(&new_spell_state); stream->read(&new_state_elapsed); stream->read(&new_spell_elapsed); - marks_mask = new_marks_mask; + mMarks_mask = new_marks_mask; } // SyncEvent @@ -1310,42 +1310,42 @@ void afxMagicSpell::unpackUpdate(NetConnection * conn, BitStream * stream) F32 vel; Point3F vel_vec; stream->read(&vel); mathRead(*stream, &vel_vec); - if (missile) + if (mMissile) { - missile->setStartingVelocity(vel); - missile->setStartingVelocityVector(vel_vec); + mMissile->setStartingVelocity(vel); + mMissile->setStartingVelocityVector(vel_vec); } } // ImpactEvent if (stream->readFlag()) { - if (impacted_obj) - clearNotify(impacted_obj); - impacted_obj = NULL; - impacted_scope_id = 0; - impacted_is_shape = false; + if (mImpacted_obj) + clearNotify(mImpacted_obj); + mImpacted_obj = NULL; + mImpacted_scope_id = 0; + mImpacted_is_shape = false; if (stream->readFlag()) // is impacted_obj { if (stream->readFlag()) // is ghost_idx { S32 ghost_idx = stream->readRangedU32(0, NetConnection::MaxGhostCount); - impacted_obj = dynamic_cast(conn->resolveGhost(ghost_idx)); - if (impacted_obj) - deleteNotify(impacted_obj); + mImpacted_obj = dynamic_cast(conn->resolveGhost(ghost_idx)); + if (mImpacted_obj) + deleteNotify(mImpacted_obj); } else { if (stream->readFlag()) // has scope_id { - impacted_scope_id = stream->readInt(NetObject::SCOPE_ID_BITS); - impacted_is_shape = stream->readFlag(); // is shape? + mImpacted_scope_id = stream->readInt(NetObject::SCOPE_ID_BITS); + mImpacted_is_shape = stream->readFlag(); // is shape? } } } - mathRead(*stream, &impact_pos); - mathRead(*stream, &impact_norm); + mathRead(*stream, &mImpact_pos); + mathRead(*stream, &mImpact_norm); stream->read(&exec_conds_mask); bool caster_alive = stream->readFlag(); @@ -1353,18 +1353,18 @@ void afxMagicSpell::unpackUpdate(NetConnection * conn, BitStream * stream) bool impacted_alive = stream->readFlag(); afxConstraint* cons; - if ((cons = constraint_mgr->getConstraint(caster_cons_id)) != 0) + if ((cons = constraint_mgr->getConstraint(mCaster_cons_id)) != 0) cons->setLivingState(caster_alive); - if ((cons = constraint_mgr->getConstraint(target_cons_id)) != 0) + if ((cons = constraint_mgr->getConstraint(mTarget_cons_id)) != 0) cons->setLivingState(target_alive); - if ((cons = constraint_mgr->getConstraint(impacted_cons_id)) != 0) + if ((cons = constraint_mgr->getConstraint(mImpacted_cons_id)) != 0) cons->setLivingState(impacted_alive); } //~~~~~~~~~~~~~~~~~~~~// if (!zoned_in) - spell_state = LATE_STATE; + mSpell_state = LATE_STATE; // need to adjust state info to get all synced up with spell on server if (do_sync_event && !initial_update) @@ -1383,23 +1383,23 @@ bool afxMagicSpell::state_expired() { afxPhrase* phrase = NULL; - switch (spell_state) + switch (mSpell_state) { case CASTING_STATE: - phrase = phrases[CASTING_PHRASE]; + phrase = mPhrases[CASTING_PHRASE]; break; case DELIVERY_STATE: - phrase = phrases[DELIVERY_PHRASE]; + phrase = mPhrases[DELIVERY_PHRASE]; break; case LINGER_STATE: - phrase = phrases[LINGER_PHRASE]; + phrase = mPhrases[LINGER_PHRASE]; break; } if (phrase) { - if (phrase->expired(spell_elapsed)) - return (!phrase->recycle(spell_elapsed)); + if (phrase->expired(mSpell_elapsed)) + return (!phrase->recycle(mSpell_elapsed)); return false; } @@ -1410,83 +1410,83 @@ F32 afxMagicSpell::state_elapsed() { afxPhrase* phrase = NULL; - switch (spell_state) + switch (mSpell_state) { case CASTING_STATE: - phrase = phrases[CASTING_PHRASE]; + phrase = mPhrases[CASTING_PHRASE]; break; case DELIVERY_STATE: - phrase = phrases[DELIVERY_PHRASE]; + phrase = mPhrases[DELIVERY_PHRASE]; break; case LINGER_STATE: - phrase = phrases[LINGER_PHRASE]; + phrase = mPhrases[LINGER_PHRASE]; break; } - return (phrase) ? phrase->elapsed(spell_elapsed) : 0.0f; + return (phrase) ? phrase->elapsed(mSpell_elapsed) : 0.0f; } void afxMagicSpell::init_constraints() { - if (constraints_initialized) + if (mConstraints_initialized) { //Con::printf("CONSTRAINTS ALREADY INITIALIZED"); return; } Vector defs; - datablock->gatherConstraintDefs(defs); + mDatablock->gatherConstraintDefs(defs); constraint_mgr->initConstraintDefs(defs, isServerObject()); if (isServerObject()) { - caster_cons_id = constraint_mgr->setReferenceObject(CASTER_CONS, caster); - target_cons_id = constraint_mgr->setReferenceObject(TARGET_CONS, target); + mCaster_cons_id = constraint_mgr->setReferenceObject(CASTER_CONS, mCaster); + mTarget_cons_id = constraint_mgr->setReferenceObject(TARGET_CONS, mTarget); #if defined(AFX_CAP_SCOPE_TRACKING) - if (caster && caster->isScopeable()) - constraint_mgr->addScopeableObject(caster); + if (mCaster && mCaster->isScopeable()) + constraint_mgr->addScopeableObject(mCaster); - if (target && target->isScopeable()) - constraint_mgr->addScopeableObject(target); + if (mTarget && mTarget->isScopeable()) + constraint_mgr->addScopeableObject(mTarget); #endif // find local camera - camera_cons_obj = get_camera(); - if (camera_cons_obj) - camera_cons_id = constraint_mgr->setReferenceObject(CAMERA_CONS, camera_cons_obj); + mCamera_cons_obj = get_camera(); + if (mCamera_cons_obj) + mCamera_cons_id = constraint_mgr->setReferenceObject(CAMERA_CONS, mCamera_cons_obj); } else // if (isClientObject()) { - if (caster) - caster_cons_id = constraint_mgr->setReferenceObject(CASTER_CONS, caster); - else if (caster_scope_id > 0) - caster_cons_id = constraint_mgr->setReferenceObjectByScopeId(CASTER_CONS, caster_scope_id, true); + if (mCaster) + mCaster_cons_id = constraint_mgr->setReferenceObject(CASTER_CONS, mCaster); + else if (mCaster_scope_id > 0) + mCaster_cons_id = constraint_mgr->setReferenceObjectByScopeId(CASTER_CONS, mCaster_scope_id, true); - if (target) - target_cons_id = constraint_mgr->setReferenceObject(TARGET_CONS, target); - else if (target_scope_id > 0) - target_cons_id = constraint_mgr->setReferenceObjectByScopeId(TARGET_CONS, target_scope_id, target_is_shape); + if (mTarget) + mTarget_cons_id = constraint_mgr->setReferenceObject(TARGET_CONS, mTarget); + else if (mTarget_scope_id > 0) + mTarget_cons_id = constraint_mgr->setReferenceObjectByScopeId(TARGET_CONS, mTarget_scope_id, mTarget_is_shape); // find local camera - camera_cons_obj = get_camera(); - if (camera_cons_obj) - camera_cons_id = constraint_mgr->setReferenceObject(CAMERA_CONS, camera_cons_obj); + mCamera_cons_obj = get_camera(); + if (mCamera_cons_obj) + mCamera_cons_id = constraint_mgr->setReferenceObject(CAMERA_CONS, mCamera_cons_obj); // find local listener Point3F listener_pos; listener_pos = SFX->getListener().getTransform().getPosition(); - listener_cons_id = constraint_mgr->setReferencePoint(LISTENER_CONS, listener_pos); + mListener_cons_id = constraint_mgr->setReferencePoint(LISTENER_CONS, listener_pos); } constraint_mgr->adjustProcessOrdering(this); - constraints_initialized = true; + mConstraints_initialized = true; } void afxMagicSpell::init_scoping() { - if (scoping_initialized) + if (mScoping_initialized) { //Con::printf("SCOPING ALREADY INITIALIZED"); return; @@ -1504,65 +1504,65 @@ void afxMagicSpell::init_scoping() mNetFlags.set(Ghostable); setScopeAlways(); } - scoping_initialized = true; + mScoping_initialized = true; } } void afxMagicSpell::setup_casting_fx() { if (isServerObject()) - phrases[CASTING_PHRASE] = new afxPhrase(isServerObject(), true); + mPhrases[CASTING_PHRASE] = new afxPhrase(isServerObject(), true); else - phrases[CASTING_PHRASE] = new CastingPhrase_C(caster, notify_castbar); + mPhrases[CASTING_PHRASE] = new CastingPhrase_C(mCaster, mNotify_castbar); - if (phrases[CASTING_PHRASE]) - phrases[CASTING_PHRASE]->init(datablock->casting_fx_list, datablock->casting_dur, this, - tfactors[CASTING_PHRASE], datablock->n_casting_loops, 0, - datablock->extra_casting_time); + if (mPhrases[CASTING_PHRASE]) + mPhrases[CASTING_PHRASE]->init(mDatablock->mCasting_fx_list, mDatablock->mCasting_dur, this, + mTfactors[CASTING_PHRASE], mDatablock->mNum_casting_loops, 0, + mDatablock->mExtra_casting_time); } void afxMagicSpell::setup_launch_fx() { - phrases[LAUNCH_PHRASE] = new afxPhrase(isServerObject(), false); - if (phrases[LAUNCH_PHRASE]) - phrases[LAUNCH_PHRASE]->init(datablock->launch_fx_list, -1, this, - tfactors[LAUNCH_PHRASE], 1); + mPhrases[LAUNCH_PHRASE] = new afxPhrase(isServerObject(), false); + if (mPhrases[LAUNCH_PHRASE]) + mPhrases[LAUNCH_PHRASE]->init(mDatablock->mLaunch_fx_list, -1, this, + mTfactors[LAUNCH_PHRASE], 1); } void afxMagicSpell::setup_delivery_fx() { - phrases[DELIVERY_PHRASE] = new afxPhrase(isServerObject(), true); - if (phrases[DELIVERY_PHRASE]) + mPhrases[DELIVERY_PHRASE] = new afxPhrase(isServerObject(), true); + if (mPhrases[DELIVERY_PHRASE]) { - phrases[DELIVERY_PHRASE]->init(datablock->delivery_fx_list, datablock->delivery_dur, this, - tfactors[DELIVERY_PHRASE], datablock->n_delivery_loops, 0, - datablock->extra_delivery_time); + mPhrases[DELIVERY_PHRASE]->init(mDatablock->mDelivery_fx_list, mDatablock->mDelivery_dur, this, + mTfactors[DELIVERY_PHRASE], mDatablock->mNum_delivery_loops, 0, + mDatablock->mExtra_delivery_time); } } void afxMagicSpell::setup_impact_fx() { - phrases[IMPACT_PHRASE] = new afxPhrase(isServerObject(), false); - if (phrases[IMPACT_PHRASE]) + mPhrases[IMPACT_PHRASE] = new afxPhrase(isServerObject(), false); + if (mPhrases[IMPACT_PHRASE]) { - phrases[IMPACT_PHRASE]->init(datablock->impact_fx_list, -1, this, - tfactors[IMPACT_PHRASE], 1); + mPhrases[IMPACT_PHRASE]->init(mDatablock->mImpact_fx_list, -1, this, + mTfactors[IMPACT_PHRASE], 1); } } void afxMagicSpell::setup_linger_fx() { - phrases[LINGER_PHRASE] = new afxPhrase(isServerObject(), true); - if (phrases[LINGER_PHRASE]) - phrases[LINGER_PHRASE]->init(datablock->linger_fx_list, datablock->linger_dur, this, - tfactors[LINGER_PHRASE], datablock->n_linger_loops, 0, - datablock->extra_linger_time); + mPhrases[LINGER_PHRASE] = new afxPhrase(isServerObject(), true); + if (mPhrases[LINGER_PHRASE]) + mPhrases[LINGER_PHRASE]->init(mDatablock->mLinger_fx_list, mDatablock->mLinger_dur, this, + mTfactors[LINGER_PHRASE], mDatablock->mNum_linger_loops, 0, + mDatablock->mExtra_linger_time); } bool afxMagicSpell::cleanup_over() { for (S32 i = 0; i < NUM_PHRASES; i++) - if (phrases[i] && !phrases[i]->isEmpty()) + if (mPhrases[i] && !mPhrases[i]->isEmpty()) return false; return true; @@ -1576,67 +1576,67 @@ bool afxMagicSpell::cleanup_over() void afxMagicSpell::init_missile_s(afxMagicMissileData* mm_db) { - if (missile) - clearNotify(missile); + if (mMissile) + clearNotify(mMissile); // create the missile - missile = new afxMagicMissile(true, false); - missile->setSubstitutionData(this, ranking); - missile->setDataBlock(mm_db); - missile->setChoreographer(this); - if (!missile->registerObject()) + mMissile = new afxMagicMissile(true, false); + mMissile->setSubstitutionData(this, ranking); + mMissile->setDataBlock(mm_db); + mMissile->setChoreographer(this); + if (!mMissile->registerObject()) { Con::errorf("afxMagicSpell: failed to register missile instance."); - delete missile; - missile = NULL; + delete mMissile; + mMissile = NULL; } - if (missile) + if (mMissile) { - deleteNotify(missile); - registerForCleanup(missile); + deleteNotify(mMissile); + registerForCleanup(mMissile); } } void afxMagicSpell::launch_missile_s() { - if (missile) + if (mMissile) { - missile->launch(); - constraint_mgr->setReferenceObject(MISSILE_CONS, missile); + mMissile->launch(); + constraint_mgr->setReferenceObject(MISSILE_CONS, mMissile); } } void afxMagicSpell::init_missile_c(afxMagicMissileData* mm_db) { - if (missile) - clearNotify(missile); + if (mMissile) + clearNotify(mMissile); // create the missile - missile = new afxMagicMissile(false, true); - missile->setSubstitutionData(this, ranking); - missile->setDataBlock(mm_db); - missile->setChoreographer(this); - if (!missile->registerObject()) + mMissile = new afxMagicMissile(false, true); + mMissile->setSubstitutionData(this, ranking); + mMissile->setDataBlock(mm_db); + mMissile->setChoreographer(this); + if (!mMissile->registerObject()) { Con::errorf("afxMagicSpell: failed to register missile instance."); - delete missile; - missile = NULL; + delete mMissile; + mMissile = NULL; } - if (missile) + if (mMissile) { - deleteNotify(missile); - registerForCleanup(missile); + deleteNotify(mMissile); + registerForCleanup(mMissile); } } void afxMagicSpell::launch_missile_c() { - if (missile) + if (mMissile) { - missile->launch(); - constraint_mgr->setReferenceObject(MISSILE_CONS, missile); + mMissile->launch(); + constraint_mgr->setReferenceObject(MISSILE_CONS, mMissile); } } @@ -1652,19 +1652,19 @@ void afxMagicSpell::impactNotify(const Point3F& p, const Point3F& n, SceneObject return; ///impact_time_ms = spell_elapsed_ms; - if (impacted_obj) - clearNotify(impacted_obj); - impacted_obj = obj; - impact_pos = p; - impact_norm = n; + if (mImpacted_obj) + clearNotify(mImpacted_obj); + mImpacted_obj = obj; + mImpact_pos = p; + mImpact_norm = n; - if (impacted_obj != NULL) + if (mImpacted_obj != NULL) { - deleteNotify(impacted_obj); + deleteNotify(mImpacted_obj); exec_conds_mask |= IMPACTED_SOMETHING; - if (impacted_obj == target) + if (mImpacted_obj == mTarget) exec_conds_mask |= IMPACTED_TARGET; - if (impacted_obj->getTypeMask() & datablock->primary_target_types) + if (mImpacted_obj->getTypeMask() & mDatablock->mPrimary_target_types) exec_conds_mask |= IMPACTED_PRIMARY; } @@ -1673,9 +1673,9 @@ void afxMagicSpell::impactNotify(const Point3F& p, const Point3F& n, SceneObject postSpellEvent(IMPACT_EVENT); - if (missile) - clearNotify(missile); - missile = NULL; + if (mMissile) + clearNotify(mMissile); + mMissile = NULL; } void afxMagicSpell::executeScriptEvent(const char* method, afxConstraint* cons, @@ -1692,9 +1692,9 @@ void afxMagicSpell::executeScriptEvent(const char* method, afxConstraint* cons, aa.axis.x, aa.axis.y, aa.axis.z, aa.angle); // CALL SCRIPT afxChoreographerData::method(%spell, %caster, %constraint, %transform, %data) - Con::executef(exeblock, method, + Con::executef(mExeblock, method, getIdString(), - (caster) ? caster->getIdString() : "", + (mCaster) ? mCaster->getIdString() : "", (cons_obj) ? cons_obj->getIdString() : "", arg_buf, data); @@ -1709,7 +1709,7 @@ void afxMagicSpell::inflictDamage(const char * label, const char* flavor, SimObj // CALL SCRIPT afxMagicSpellData::onDamage() // onDamage(%spell, %label, %type, %damaged_obj, %amount, %count, %pos, %ad_amount, // %radius, %impulse) - datablock->onDamage_callback(this, label, flavor, target_id, amount, n, pos, ad_amount, radius, impulse); + mDatablock->onDamage_callback(this, label, flavor, target_id, amount, n, pos, ad_amount, radius, impulse); } @@ -1718,68 +1718,68 @@ void afxMagicSpell::inflictDamage(const char * label, const char* flavor, SimObj void afxMagicSpell::process_server() { - if (spell_state != INACTIVE_STATE) - spell_elapsed += TickSec; + if (mSpell_state != INACTIVE_STATE) + mSpell_elapsed += TickSec; - U8 pending_state = spell_state; + U8 pending_state = mSpell_state; // check for state changes - switch (spell_state) + switch (mSpell_state) { case INACTIVE_STATE: - if (marks_mask & MARK_ACTIVATE) + if (mMarks_mask & MARK_ACTIVATE) pending_state = CASTING_STATE; break; case CASTING_STATE: - if (datablock->casting_dur > 0.0f && datablock->do_move_interrupts && is_caster_moving()) + if (mDatablock->mCasting_dur > 0.0f && mDatablock->mDo_move_interrupts && is_caster_moving()) { - displayScreenMessage(caster, "SPELL INTERRUPTED."); + displayScreenMessage(mCaster, "SPELL INTERRUPTED."); postSpellEvent(INTERRUPT_SPELL_EVENT); } - if (marks_mask & MARK_INTERRUPT_CASTING) + if (mMarks_mask & MARK_INTERRUPT_CASTING) pending_state = CLEANUP_STATE; - else if (marks_mask & MARK_END_CASTING) + else if (mMarks_mask & MARK_END_CASTING) pending_state = DELIVERY_STATE; - else if (marks_mask & MARK_LAUNCH) + else if (mMarks_mask & MARK_LAUNCH) pending_state = DELIVERY_STATE; else if (state_expired()) pending_state = DELIVERY_STATE; break; case DELIVERY_STATE: - if (marks_mask & MARK_INTERRUPT_DELIVERY) + if (mMarks_mask & MARK_INTERRUPT_DELIVERY) pending_state = CLEANUP_STATE; - else if (marks_mask & MARK_END_DELIVERY) + else if (mMarks_mask & MARK_END_DELIVERY) pending_state = LINGER_STATE; - else if (marks_mask & MARK_IMPACT) + else if (mMarks_mask & MARK_IMPACT) pending_state = LINGER_STATE; else if (state_expired()) pending_state = LINGER_STATE; break; case LINGER_STATE: - if (marks_mask & MARK_INTERRUPT_LINGER) + if (mMarks_mask & MARK_INTERRUPT_LINGER) pending_state = CLEANUP_STATE; - else if (marks_mask & MARK_END_LINGER) + else if (mMarks_mask & MARK_END_LINGER) pending_state = CLEANUP_STATE; - else if (marks_mask & MARK_SHUTDOWN) + else if (mMarks_mask & MARK_SHUTDOWN) pending_state = CLEANUP_STATE; else if (state_expired()) pending_state = CLEANUP_STATE; break; case CLEANUP_STATE: - if ((marks_mask & MARK_INTERRUPT_CLEANUP) || cleanup_over()) + if ((mMarks_mask & MARK_INTERRUPT_CLEANUP) || cleanup_over()) pending_state = DONE_STATE; break; } - if (spell_state != pending_state) + if (mSpell_state != pending_state) change_state_s(pending_state); - if (spell_state == INACTIVE_STATE) + if (mSpell_state == INACTIVE_STATE) return; //--------------------------// @@ -1788,23 +1788,23 @@ void afxMagicSpell::process_server() constraint_mgr->sample(TickSec, Platform::getVirtualMilliseconds()); for (S32 i = 0; i < NUM_PHRASES; i++) - if (phrases[i]) - phrases[i]->update(TickSec, spell_elapsed); + if (mPhrases[i]) + mPhrases[i]->update(TickSec, mSpell_elapsed); - if (missile_is_armed) + if (mMissile_is_armed) { launch_missile_s(); - missile_is_armed = false; + mMissile_is_armed = false; } } void afxMagicSpell::change_state_s(U8 pending_state) { - if (spell_state == pending_state) + if (mSpell_state == pending_state) return; // LEAVING THIS STATE - switch (spell_state) + switch (mSpell_state) { case INACTIVE_STATE: break; @@ -1823,7 +1823,7 @@ void afxMagicSpell::change_state_s(U8 pending_state) break; } - spell_state = pending_state; + mSpell_state = pending_state; // ENTERING THIS STATE switch (pending_state) @@ -1851,29 +1851,29 @@ void afxMagicSpell::enter_done_state_s() { postSpellEvent(DEACTIVATE_EVENT); - if (marks_mask & MARK_INTERRUPTS) + if (mMarks_mask & MARK_INTERRUPTS) { Sim::postEvent(this, new ObjectDeleteEvent, Sim::getCurrentTime() + 500); } else { - F32 done_time = spell_elapsed; + F32 done_time = mSpell_elapsed; for (S32 i = 0; i < NUM_PHRASES; i++) { - if (phrases[i]) + if (mPhrases[i]) { F32 phrase_done; - if (phrases[i]->willStop() && phrases[i]->isInfinite()) - phrase_done = spell_elapsed + phrases[i]->calcAfterLife(); + if (mPhrases[i]->willStop() && mPhrases[i]->isInfinite()) + phrase_done = mSpell_elapsed + mPhrases[i]->calcAfterLife(); else - phrase_done = phrases[i]->calcDoneTime(); + phrase_done = mPhrases[i]->calcDoneTime(); if (phrase_done > done_time) done_time = phrase_done; } } - F32 time_left = done_time - spell_elapsed; + F32 time_left = done_time - mSpell_elapsed; if (time_left < 0) time_left = 0; @@ -1881,7 +1881,7 @@ void afxMagicSpell::enter_done_state_s() } // CALL SCRIPT afxMagicSpellData::onDeactivate(%spell) - datablock->onDeactivate_callback(this); + mDatablock->onDeactivate_callback(this); } void afxMagicSpell::enter_casting_state_s() @@ -1891,90 +1891,90 @@ void afxMagicSpell::enter_casting_state_s() // stamp constraint-mgr starting time and reset spell timer constraint_mgr->setStartTime(Platform::getVirtualMilliseconds()); - spell_elapsed = 0; + mSpell_elapsed = 0; setup_dynamic_constraints(); // start casting effects setup_casting_fx(); - if (phrases[CASTING_PHRASE]) - phrases[CASTING_PHRASE]->start(spell_elapsed, spell_elapsed); + if (mPhrases[CASTING_PHRASE]) + mPhrases[CASTING_PHRASE]->start(mSpell_elapsed, mSpell_elapsed); // initialize missile - if (missile_db) + if (mMissile_db) { - missile_db = missile_db->cloneAndPerformSubstitutions(this, ranking); - init_missile_s(missile_db); + mMissile_db = mMissile_db->cloneAndPerformSubstitutions(this, ranking); + init_missile_s(mMissile_db); } } void afxMagicSpell::leave_casting_state_s() { - if (phrases[CASTING_PHRASE]) + if (mPhrases[CASTING_PHRASE]) { - if (marks_mask & MARK_INTERRUPT_CASTING) + if (mMarks_mask & MARK_INTERRUPT_CASTING) { //Con::printf("INTERRUPT CASTING (S)"); - phrases[CASTING_PHRASE]->interrupt(spell_elapsed); + mPhrases[CASTING_PHRASE]->interrupt(mSpell_elapsed); } else { //Con::printf("LEAVING CASTING (S)"); - phrases[CASTING_PHRASE]->stop(spell_elapsed); + mPhrases[CASTING_PHRASE]->stop(mSpell_elapsed); } } - if (marks_mask & MARK_INTERRUPT_CASTING) + if (mMarks_mask & MARK_INTERRUPT_CASTING) { // CALL SCRIPT afxMagicSpellData::onInterrupt(%spell, %caster) - datablock->onInterrupt_callback(this, caster); + mDatablock->onInterrupt_callback(this, mCaster); } } void afxMagicSpell::enter_delivery_state_s() { // CALL SCRIPT afxMagicSpellData::onLaunch(%spell, %caster, %target, %missile) - datablock->onLaunch_callback(this, caster, target, missile); + mDatablock->onLaunch_callback(this, mCaster, mTarget, mMissile); - if (datablock->launch_on_server_signal) + if (mDatablock->mLaunch_on_server_signal) postSpellEvent(LAUNCH_EVENT); - missile_is_armed = true; + mMissile_is_armed = true; // start launch effects setup_launch_fx(); - if (phrases[LAUNCH_PHRASE]) - phrases[LAUNCH_PHRASE]->start(spell_elapsed, spell_elapsed); //START + if (mPhrases[LAUNCH_PHRASE]) + mPhrases[LAUNCH_PHRASE]->start(mSpell_elapsed, mSpell_elapsed); //START // start delivery effects setup_delivery_fx(); - if (phrases[DELIVERY_PHRASE]) - phrases[DELIVERY_PHRASE]->start(spell_elapsed, spell_elapsed); //START + if (mPhrases[DELIVERY_PHRASE]) + mPhrases[DELIVERY_PHRASE]->start(mSpell_elapsed, mSpell_elapsed); //START } void afxMagicSpell::leave_delivery_state_s() { - if (phrases[DELIVERY_PHRASE]) + if (mPhrases[DELIVERY_PHRASE]) { - if (marks_mask & MARK_INTERRUPT_DELIVERY) + if (mMarks_mask & MARK_INTERRUPT_DELIVERY) { //Con::printf("INTERRUPT DELIVERY (S)"); - phrases[DELIVERY_PHRASE]->interrupt(spell_elapsed); + mPhrases[DELIVERY_PHRASE]->interrupt(mSpell_elapsed); } else { //Con::printf("LEAVING DELIVERY (S)"); - phrases[DELIVERY_PHRASE]->stop(spell_elapsed); + mPhrases[DELIVERY_PHRASE]->stop(mSpell_elapsed); } } - if (!missile && !(marks_mask & MARK_IMPACT)) + if (!mMissile && !(mMarks_mask & MARK_IMPACT)) { - if (target) + if (mTarget) { - Point3F p = afxMagicSpell::getShapeImpactPos(target); + Point3F p = afxMagicSpell::getShapeImpactPos(mTarget); Point3F n = Point3F(0,0,1); - impactNotify(p, n, target); + impactNotify(p, n, mTarget); } else { @@ -1987,57 +1987,57 @@ void afxMagicSpell::leave_delivery_state_s() void afxMagicSpell::enter_linger_state_s() { - if (impacted_obj) + if (mImpacted_obj) { - impacted_cons_id = constraint_mgr->setReferenceObject(IMPACTED_OBJECT_CONS, impacted_obj); + mImpacted_cons_id = constraint_mgr->setReferenceObject(IMPACTED_OBJECT_CONS, mImpacted_obj); #if defined(AFX_CAP_SCOPE_TRACKING) - if (impacted_obj->isScopeable()) - constraint_mgr->addScopeableObject(impacted_obj); + if (mImpacted_obj->isScopeable()) + constraint_mgr->addScopeableObject(mImpacted_obj); #endif } else - constraint_mgr->setReferencePoint(IMPACTED_OBJECT_CONS, impact_pos, impact_norm); - constraint_mgr->setReferencePoint(IMPACT_POINT_CONS, impact_pos, impact_norm); + constraint_mgr->setReferencePoint(IMPACTED_OBJECT_CONS, mImpact_pos, mImpact_norm); + constraint_mgr->setReferencePoint(IMPACT_POINT_CONS, mImpact_pos, mImpact_norm); constraint_mgr->setReferenceObject(MISSILE_CONS, 0); // start impact effects setup_impact_fx(); - if (phrases[IMPACT_PHRASE]) - phrases[IMPACT_PHRASE]->start(spell_elapsed, spell_elapsed); //START + if (mPhrases[IMPACT_PHRASE]) + mPhrases[IMPACT_PHRASE]->start(mSpell_elapsed, mSpell_elapsed); //START // start linger effects setup_linger_fx(); - if (phrases[LINGER_PHRASE]) - phrases[LINGER_PHRASE]->start(spell_elapsed, spell_elapsed); //START + if (mPhrases[LINGER_PHRASE]) + mPhrases[LINGER_PHRASE]->start(mSpell_elapsed, mSpell_elapsed); //START #if 0 // code temporarily replaced with old callback technique in order to avoid engine bug. // CALL SCRIPT afxMagicSpellData::onImpact(%spell, %caster, %impactedObj, %impactedPos, %impactedNorm) - datablock->onImpact_callback(this, caster, impacted_obj, impact_pos, impact_norm); + mDatablock->onImpact_callback(this, mCaster, mImpacted_obj, mImpact_pos, mImpact_norm); #else char pos_buf[128]; - dSprintf(pos_buf, sizeof(pos_buf), "%g %g %g", impact_pos.x, impact_pos.y, impact_pos.z); + dSprintf(pos_buf, sizeof(pos_buf), "%g %g %g", mImpact_pos.x, mImpact_pos.y, mImpact_pos.z); char norm_buf[128]; - dSprintf(norm_buf, sizeof(norm_buf), "%g %g %g", impact_norm.x, impact_norm.y, impact_norm.z); - Con::executef(exeblock, "onImpact", getIdString(), - (caster) ? caster->getIdString(): "", - (impacted_obj) ? impacted_obj->getIdString(): "", + dSprintf(norm_buf, sizeof(norm_buf), "%g %g %g", mImpact_norm.x, mImpact_norm.y, mImpact_norm.z); + Con::executef(mExeblock, "onImpact", getIdString(), + (mCaster) ? mCaster->getIdString(): "", + (mImpacted_obj) ? mImpacted_obj->getIdString(): "", pos_buf, norm_buf); #endif } void afxMagicSpell::leave_linger_state_s() { - if (phrases[LINGER_PHRASE]) + if (mPhrases[LINGER_PHRASE]) { - if (marks_mask & MARK_INTERRUPT_LINGER) + if (mMarks_mask & MARK_INTERRUPT_LINGER) { //Con::printf("INTERRUPT LINGER (S)"); - phrases[LINGER_PHRASE]->interrupt(spell_elapsed); + mPhrases[LINGER_PHRASE]->interrupt(mSpell_elapsed); } else { //Con::printf("LEAVING LINGER (S)"); - phrases[LINGER_PHRASE]->stop(spell_elapsed); + mPhrases[LINGER_PHRASE]->stop(mSpell_elapsed); } } } @@ -2049,25 +2049,25 @@ void afxMagicSpell::leave_linger_state_s() void afxMagicSpell::process_client(F32 dt) { - spell_elapsed += dt; //SPELL_ELAPSED + mSpell_elapsed += dt; //SPELL_ELAPSED - U8 pending_state = spell_state; + U8 pending_state = mSpell_state; // check for state changes - switch (spell_state) + switch (mSpell_state) { case INACTIVE_STATE: - if (marks_mask & MARK_ACTIVATE) + if (mMarks_mask & MARK_ACTIVATE) pending_state = CASTING_STATE; break; case CASTING_STATE: - if (marks_mask & MARK_INTERRUPT_CASTING) + if (mMarks_mask & MARK_INTERRUPT_CASTING) pending_state = CLEANUP_STATE; - else if (marks_mask & MARK_END_CASTING) + else if (mMarks_mask & MARK_END_CASTING) pending_state = DELIVERY_STATE; - else if (datablock->launch_on_server_signal) + else if (mDatablock->mLaunch_on_server_signal) { - if (marks_mask & MARK_LAUNCH) + if (mMarks_mask & MARK_LAUNCH) pending_state = DELIVERY_STATE; } else @@ -2077,45 +2077,45 @@ void afxMagicSpell::process_client(F32 dt) } break; case DELIVERY_STATE: - if (marks_mask & MARK_INTERRUPT_DELIVERY) + if (mMarks_mask & MARK_INTERRUPT_DELIVERY) pending_state = CLEANUP_STATE; - else if (marks_mask & MARK_END_DELIVERY) + else if (mMarks_mask & MARK_END_DELIVERY) pending_state = LINGER_STATE; - else if (marks_mask & MARK_IMPACT) + else if (mMarks_mask & MARK_IMPACT) pending_state = LINGER_STATE; else state_expired(); break; case LINGER_STATE: - if (marks_mask & MARK_INTERRUPT_LINGER) + if (mMarks_mask & MARK_INTERRUPT_LINGER) pending_state = CLEANUP_STATE; - else if (marks_mask & MARK_END_LINGER) + else if (mMarks_mask & MARK_END_LINGER) pending_state = CLEANUP_STATE; - else if (marks_mask & MARK_SHUTDOWN) + else if (mMarks_mask & MARK_SHUTDOWN) pending_state = CLEANUP_STATE; else if (state_expired()) pending_state = CLEANUP_STATE; break; case CLEANUP_STATE: - if ((marks_mask & MARK_INTERRUPT_CLEANUP) || cleanup_over()) + if ((mMarks_mask & MARK_INTERRUPT_CLEANUP) || cleanup_over()) pending_state = DONE_STATE; break; } - if (spell_state != pending_state) + if (mSpell_state != pending_state) change_state_c(pending_state); - if (spell_state == INACTIVE_STATE) + if (mSpell_state == INACTIVE_STATE) return; //--------------------------// // update the listener constraint position - if (!listener_cons_id.undefined()) + if (!mListener_cons_id.undefined()) { Point3F listener_pos; listener_pos = SFX->getListener().getTransform().getPosition(); - constraint_mgr->setReferencePoint(listener_cons_id, listener_pos); + constraint_mgr->setReferencePoint(mListener_cons_id, listener_pos); } // find local camera position @@ -2123,10 +2123,10 @@ void afxMagicSpell::process_client(F32 dt) SceneObject* current_cam = get_camera(&cam_pos); // detect camera changes - if (!camera_cons_id.undefined() && current_cam != camera_cons_obj) + if (!mCamera_cons_id.undefined() && current_cam != mCamera_cons_obj) { - constraint_mgr->setReferenceObject(camera_cons_id, current_cam); - camera_cons_obj = current_cam; + constraint_mgr->setReferenceObject(mCamera_cons_id, current_cam); + mCamera_cons_obj = current_cam; } // sample the constraints @@ -2134,23 +2134,23 @@ void afxMagicSpell::process_client(F32 dt) // update active effects lists for (S32 i = 0; i < NUM_PHRASES; i++) - if (phrases[i]) - phrases[i]->update(dt, spell_elapsed); + if (mPhrases[i]) + mPhrases[i]->update(dt, mSpell_elapsed); - if (missile_is_armed) + if (mMissile_is_armed) { launch_missile_c(); - missile_is_armed = false; + mMissile_is_armed = false; } } void afxMagicSpell::change_state_c(U8 pending_state) { - if (spell_state == pending_state) + if (mSpell_state == pending_state) return; // LEAVING THIS STATE - switch (spell_state) + switch (mSpell_state) { case INACTIVE_STATE: break; @@ -2169,7 +2169,7 @@ void afxMagicSpell::change_state_c(U8 pending_state) break; } - spell_state = pending_state; + mSpell_state = pending_state; // ENTERING THIS STATE switch (pending_state) @@ -2177,13 +2177,13 @@ void afxMagicSpell::change_state_c(U8 pending_state) case INACTIVE_STATE: break; case CASTING_STATE: - enter_casting_state_c(spell_elapsed); + enter_casting_state_c(mSpell_elapsed); break; case DELIVERY_STATE: - enter_delivery_state_c(spell_elapsed); + enter_delivery_state_c(mSpell_elapsed); break; case LINGER_STATE: - enter_linger_state_c(spell_elapsed); + enter_linger_state_c(mSpell_elapsed); break; case CLEANUP_STATE: break; @@ -2195,113 +2195,113 @@ void afxMagicSpell::change_state_c(U8 pending_state) void afxMagicSpell::enter_casting_state_c(F32 starttime) { // stamp constraint-mgr starting time - constraint_mgr->setStartTime(Platform::getVirtualMilliseconds() - (U32)(spell_elapsed*1000)); + constraint_mgr->setStartTime(Platform::getVirtualMilliseconds() - (U32)(mSpell_elapsed *1000)); //spell_elapsed = 0; //SPELL_ELAPSED setup_dynamic_constraints(); // start casting effects and castbar setup_casting_fx(); - if (phrases[CASTING_PHRASE]) - phrases[CASTING_PHRASE]->start(starttime, spell_elapsed); //START + if (mPhrases[CASTING_PHRASE]) + mPhrases[CASTING_PHRASE]->start(starttime, mSpell_elapsed); //START // initialize missile - if (missile_db) + if (mMissile_db) { - missile_db = missile_db->cloneAndPerformSubstitutions(this, ranking); - init_missile_c(missile_db); + mMissile_db = mMissile_db->cloneAndPerformSubstitutions(this, ranking); + init_missile_c(mMissile_db); } } void afxMagicSpell::leave_casting_state_c() { - if (phrases[CASTING_PHRASE]) + if (mPhrases[CASTING_PHRASE]) { - if (marks_mask & MARK_INTERRUPT_CASTING) + if (mMarks_mask & MARK_INTERRUPT_CASTING) { //Con::printf("INTERRUPT CASTING (C)"); - phrases[CASTING_PHRASE]->interrupt(spell_elapsed); + mPhrases[CASTING_PHRASE]->interrupt(mSpell_elapsed); } else { //Con::printf("LEAVING CASTING (C)"); - phrases[CASTING_PHRASE]->stop(spell_elapsed); + mPhrases[CASTING_PHRASE]->stop(mSpell_elapsed); } } } void afxMagicSpell::enter_delivery_state_c(F32 starttime) { - missile_is_armed = true; + mMissile_is_armed = true; setup_launch_fx(); - if (phrases[LAUNCH_PHRASE]) - phrases[LAUNCH_PHRASE]->start(starttime, spell_elapsed); //START + if (mPhrases[LAUNCH_PHRASE]) + mPhrases[LAUNCH_PHRASE]->start(starttime, mSpell_elapsed); //START setup_delivery_fx(); - if (phrases[DELIVERY_PHRASE]) - phrases[DELIVERY_PHRASE]->start(starttime, spell_elapsed); //START + if (mPhrases[DELIVERY_PHRASE]) + mPhrases[DELIVERY_PHRASE]->start(starttime, mSpell_elapsed); //START } void afxMagicSpell::leave_delivery_state_c() { - if (missile) + if (mMissile) { - clearNotify(missile); - missile->deleteObject(); - missile = NULL; + clearNotify(mMissile); + mMissile->deleteObject(); + mMissile = NULL; } - if (phrases[DELIVERY_PHRASE]) + if (mPhrases[DELIVERY_PHRASE]) { - if (marks_mask & MARK_INTERRUPT_DELIVERY) + if (mMarks_mask & MARK_INTERRUPT_DELIVERY) { //Con::printf("INTERRUPT DELIVERY (C)"); - phrases[DELIVERY_PHRASE]->interrupt(spell_elapsed); + mPhrases[DELIVERY_PHRASE]->interrupt(mSpell_elapsed); } else { //Con::printf("LEAVING DELIVERY (C)"); - phrases[DELIVERY_PHRASE]->stop(spell_elapsed); + mPhrases[DELIVERY_PHRASE]->stop(mSpell_elapsed); } } } void afxMagicSpell::enter_linger_state_c(F32 starttime) { - if (impacted_obj) - impacted_cons_id = constraint_mgr->setReferenceObject(IMPACTED_OBJECT_CONS, impacted_obj); - else if (impacted_scope_id > 0) - impacted_cons_id = constraint_mgr->setReferenceObjectByScopeId(IMPACTED_OBJECT_CONS, impacted_scope_id, impacted_is_shape); + if (mImpacted_obj) + mImpacted_cons_id = constraint_mgr->setReferenceObject(IMPACTED_OBJECT_CONS, mImpacted_obj); + else if (mImpacted_scope_id > 0) + mImpacted_cons_id = constraint_mgr->setReferenceObjectByScopeId(IMPACTED_OBJECT_CONS, mImpacted_scope_id, mImpacted_is_shape); else - constraint_mgr->setReferencePoint(IMPACTED_OBJECT_CONS, impact_pos, impact_norm); - constraint_mgr->setReferencePoint(IMPACT_POINT_CONS, impact_pos, impact_norm); + constraint_mgr->setReferencePoint(IMPACTED_OBJECT_CONS, mImpact_pos, mImpact_norm); + constraint_mgr->setReferencePoint(IMPACT_POINT_CONS, mImpact_pos, mImpact_norm); constraint_mgr->setReferenceObject(MISSILE_CONS, 0); setup_impact_fx(); - if (phrases[IMPACT_PHRASE]) - phrases[IMPACT_PHRASE]->start(starttime, spell_elapsed); //START + if (mPhrases[IMPACT_PHRASE]) + mPhrases[IMPACT_PHRASE]->start(starttime, mSpell_elapsed); //START setup_linger_fx(); - if (phrases[LINGER_PHRASE]) + if (mPhrases[LINGER_PHRASE]) { - phrases[LINGER_PHRASE]->start(starttime, spell_elapsed); //START + mPhrases[LINGER_PHRASE]->start(starttime, mSpell_elapsed); //START } } void afxMagicSpell::leave_linger_state_c() { - if (phrases[LINGER_PHRASE]) + if (mPhrases[LINGER_PHRASE]) { - if (marks_mask & MARK_INTERRUPT_LINGER) + if (mMarks_mask & MARK_INTERRUPT_LINGER) { //Con::printf("INTERRUPT LINGER (C)"); - phrases[LINGER_PHRASE]->interrupt(spell_elapsed); + mPhrases[LINGER_PHRASE]->interrupt(mSpell_elapsed); } else { //Con::printf("LEAVING LINGER (C)"); - phrases[LINGER_PHRASE]->stop(spell_elapsed); + mPhrases[LINGER_PHRASE]->stop(mSpell_elapsed); } } } @@ -2312,15 +2312,15 @@ void afxMagicSpell::sync_client(U16 marks, U8 state, F32 elapsed, F32 spell_elap // marks, name_from_state(spell_state), name_from_state(state), elapsed, // spell_elapsed); - if (spell_state != LATE_STATE) + if (mSpell_state != LATE_STATE) return; - marks_mask = marks; + mMarks_mask = marks; // don't want to be started on late zoning clients - if (!datablock->exec_on_new_clients) + if (!mDatablock->exec_on_new_clients) { - spell_state = DONE_STATE; + mSpell_state = DONE_STATE; } // it looks like we're ghosting pretty late and @@ -2328,31 +2328,31 @@ void afxMagicSpell::sync_client(U16 marks, U8 state, F32 elapsed, F32 spell_elap else if ((marks & (MARK_INTERRUPTS | MARK_DEACTIVATE | MARK_SHUTDOWN)) || (((marks & MARK_IMPACT) || (marks & MARK_END_DELIVERY)) && (marks & MARK_END_LINGER))) { - spell_state = DONE_STATE; + mSpell_state = DONE_STATE; } // it looks like we should be in the linger state. else if ((marks & MARK_IMPACT) || (((marks & MARK_LAUNCH) || (marks & MARK_END_CASTING)) && (marks & MARK_END_DELIVERY))) { - spell_state = LINGER_STATE; - this->spell_elapsed = spell_elapsed; + mSpell_state = LINGER_STATE; + mSpell_elapsed = spell_elapsed; enter_linger_state_c(spell_elapsed-elapsed); } // it looks like we should be in the delivery state. else if ((marks & MARK_LAUNCH) || (marks & MARK_END_CASTING)) { - spell_state = DELIVERY_STATE; - this->spell_elapsed = spell_elapsed; + mSpell_state = DELIVERY_STATE; + mSpell_elapsed = spell_elapsed; enter_delivery_state_c(spell_elapsed-elapsed); } // it looks like we should be in the casting state. else if (marks & MARK_ACTIVATE) { - spell_state = CASTING_STATE; //SPELL_STATE - this->spell_elapsed = spell_elapsed; + mSpell_state = CASTING_STATE; //SPELL_STATE + mSpell_elapsed = spell_elapsed; enter_casting_state_c(spell_elapsed-elapsed); } } @@ -2367,39 +2367,39 @@ void afxMagicSpell::postSpellEvent(U8 event) switch (event) { case ACTIVATE_EVENT: - marks_mask |= MARK_ACTIVATE; + mMarks_mask |= MARK_ACTIVATE; break; case LAUNCH_EVENT: - marks_mask |= MARK_LAUNCH; + mMarks_mask |= MARK_LAUNCH; setMaskBits(LaunchEventMask); break; case IMPACT_EVENT: - marks_mask |= MARK_IMPACT; + mMarks_mask |= MARK_IMPACT; setMaskBits(ImpactEventMask); break; case SHUTDOWN_EVENT: - marks_mask |= MARK_SHUTDOWN; + mMarks_mask |= MARK_SHUTDOWN; break; case DEACTIVATE_EVENT: - marks_mask |= MARK_DEACTIVATE; + mMarks_mask |= MARK_DEACTIVATE; break; case INTERRUPT_PHASE_EVENT: - if (spell_state == CASTING_STATE) - marks_mask |= MARK_END_CASTING; - else if (spell_state == DELIVERY_STATE) - marks_mask |= MARK_END_DELIVERY; - else if (spell_state == LINGER_STATE) - marks_mask |= MARK_END_LINGER; + if (mSpell_state == CASTING_STATE) + mMarks_mask |= MARK_END_CASTING; + else if (mSpell_state == DELIVERY_STATE) + mMarks_mask |= MARK_END_DELIVERY; + else if (mSpell_state == LINGER_STATE) + mMarks_mask |= MARK_END_LINGER; break; case INTERRUPT_SPELL_EVENT: - if (spell_state == CASTING_STATE) - marks_mask |= MARK_INTERRUPT_CASTING; - else if (spell_state == DELIVERY_STATE) - marks_mask |= MARK_INTERRUPT_DELIVERY; - else if (spell_state == LINGER_STATE) - marks_mask |= MARK_INTERRUPT_LINGER; - else if (spell_state == CLEANUP_STATE) - marks_mask |= MARK_INTERRUPT_CLEANUP; + if (mSpell_state == CASTING_STATE) + mMarks_mask |= MARK_INTERRUPT_CASTING; + else if (mSpell_state == DELIVERY_STATE) + mMarks_mask |= MARK_INTERRUPT_DELIVERY; + else if (mSpell_state == LINGER_STATE) + mMarks_mask |= MARK_INTERRUPT_LINGER; + else if (mSpell_state == CLEANUP_STATE) + mMarks_mask |= MARK_INTERRUPT_CLEANUP; break; } } @@ -2407,7 +2407,7 @@ void afxMagicSpell::postSpellEvent(U8 event) void afxMagicSpell::resolveTimeFactors() { for (S32 i = 0; i < NUM_PHRASES; i++) - tfactors[i] *= overall_time_factor; + mTfactors[i] *= mOverall_time_factor; } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// @@ -2416,10 +2416,10 @@ void afxMagicSpell::finish_startup() { #if !defined(BROKEN_POINT_IN_WATER) // test if caster is in water - if (caster) + if (mCaster) { - Point3F pos = caster->getPosition(); - if (caster->pointInWater(pos)) + Point3F pos = mCaster->getPosition(); + if (mCaster->pointInWater(pos)) exec_conds_mask |= CASTER_IN_WATER; } #endif @@ -2480,7 +2480,7 @@ afxMagicSpell::cast_spell(afxMagicSpellData* datablock, ShapeBase* caster, Scene // create a new spell instance afxMagicSpell* spell = new afxMagicSpell(caster, target); spell->setDataBlock(datablock); - spell->exeblock = exeblock; + spell->mExeblock = exeblock; spell->setExtra(extra); // copy dynamic fields from the param holder to the spell @@ -2527,28 +2527,28 @@ Point3F afxMagicSpell::getShapeImpactPos(SceneObject* obj) void afxMagicSpell::restoreObject(SceneObject* obj) { - if (obj->getScopeId() == caster_scope_id && dynamic_cast(obj) != NULL) + if (obj->getScopeId() == mCaster_scope_id && dynamic_cast(obj) != NULL) { - caster_scope_id = 0; - caster = (ShapeBase*)obj; - caster_field = caster; - deleteNotify(caster); - processAfter(caster); + mCaster_scope_id = 0; + mCaster = (ShapeBase*)obj; + mCaster_field = mCaster; + deleteNotify(mCaster); + processAfter(mCaster); } - if (obj->getScopeId() == target_scope_id) + if (obj->getScopeId() == mTarget_scope_id) { - target_scope_id = 0; - target = obj; - target_field = target; - deleteNotify(target); + mTarget_scope_id = 0; + mTarget = obj; + mTarget_field = mTarget; + deleteNotify(mTarget); } - if (obj->getScopeId() == impacted_scope_id) + if (obj->getScopeId() == mImpacted_scope_id) { - impacted_scope_id = 0; - impacted_obj = obj; - deleteNotify(impacted_obj); + mImpacted_scope_id = 0; + mImpacted_obj = obj; + deleteNotify(mImpacted_obj); } } @@ -2561,23 +2561,23 @@ bool afxMagicSpell::activationCallInit(bool postponed) return false; } - if (!caster_field) + if (!mCaster_field) { Con::errorf("afxMagicSpell::activate() -- no spellcaster specified."); return false; } - caster = dynamic_cast(caster_field); - if (!caster) + mCaster = dynamic_cast(mCaster_field); + if (!mCaster) { Con::errorf("afxMagicSpell::activate() -- spellcaster is not a ShapeBase derived object."); return false; } - if (target_field) + if (mTarget_field) { - target = dynamic_cast(target_field); - if (!target) + mTarget = dynamic_cast(mTarget_field); + if (!mTarget) Con::warnf("afxMagicSpell::activate() -- target is not a SceneObject derived object."); } @@ -2591,11 +2591,11 @@ void afxMagicSpell::activate() // to happen prior to object registration. Sim::postEvent(this, new SpellFinishStartupEvent, Sim::getCurrentTime()); - caster_field = caster; - target_field = target; + mCaster_field = mCaster; + mTarget_field = mTarget; // CALL SCRIPT afxMagicSpellData::onActivate(%spell, %caster, %target) - datablock->onActivate_callback(this, caster, target); + mDatablock->onActivate_callback(this, mCaster, mTarget); } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// diff --git a/Engine/source/afx/afxMagicSpell.h b/Engine/source/afx/afxMagicSpell.h index 1f760e48b..f7545bdb8 100644 --- a/Engine/source/afx/afxMagicSpell.h +++ b/Engine/source/afx/afxMagicSpell.h @@ -68,36 +68,36 @@ class afxMagicSpellData : public afxChoreographerData, public afxMagicSpellDefs void validateType(SimObject *object, void *typePtr); }; - bool do_id_convert; + bool mDo_id_convert; public: - F32 casting_dur; - F32 delivery_dur; - F32 linger_dur; + F32 mCasting_dur; + F32 mDelivery_dur; + F32 mLinger_dur; // - S32 n_casting_loops; - S32 n_delivery_loops; - S32 n_linger_loops; + S32 mNum_casting_loops; + S32 mNum_delivery_loops; + S32 mNum_linger_loops; // - F32 extra_casting_time; - F32 extra_delivery_time; - F32 extra_linger_time; + F32 mExtra_casting_time; + F32 mExtra_delivery_time; + F32 mExtra_linger_time; // - bool do_move_interrupts; - F32 move_interrupt_speed; + bool mDo_move_interrupts; + F32 mMove_interrupt_speed; // - afxMagicMissileData* missile_db; - bool launch_on_server_signal; - U32 primary_target_types; + afxMagicMissileData* mMissile_db; + bool mLaunch_on_server_signal; + U32 mPrimary_target_types; // - afxEffectWrapperData* dummy_fx_entry; + afxEffectWrapperData* mDummy_fx_entry; // various effects lists - afxEffectList casting_fx_list; - afxEffectList launch_fx_list; - afxEffectList delivery_fx_list; - afxEffectList impact_fx_list; - afxEffectList linger_fx_list; + afxEffectList mCasting_fx_list; + afxEffectList mLaunch_fx_list; + afxEffectList mDelivery_fx_list; + afxEffectList mImpact_fx_list; + afxEffectList mLinger_fx_list; void pack_fx(BitStream* stream, const afxEffectList& fx, bool packed); void unpack_fx(BitStream* stream, afxEffectList& fx); @@ -222,39 +222,39 @@ private: static StringTableEntry IMPACTED_OBJECT_CONS; private: - afxMagicSpellData* datablock; - SimObject* exeblock; - afxMagicMissileData* missile_db; + afxMagicSpellData* mDatablock; + SimObject* mExeblock; + afxMagicMissileData* mMissile_db; - ShapeBase* caster; - SceneObject* target; - SimObject* caster_field; - SimObject* target_field; + ShapeBase* mCaster; + SceneObject* mTarget; + SimObject* mCaster_field; + SimObject* mTarget_field; - U16 caster_scope_id; - U16 target_scope_id; - bool target_is_shape; + U16 mCaster_scope_id; + U16 mTarget_scope_id; + bool mTarget_is_shape; - bool constraints_initialized; - bool scoping_initialized; + bool mConstraints_initialized; + bool mScoping_initialized; - U8 spell_state; - F32 spell_elapsed; + U8 mSpell_state; + F32 mSpell_elapsed; - afxConstraintID listener_cons_id; - afxConstraintID caster_cons_id; - afxConstraintID target_cons_id; - afxConstraintID impacted_cons_id; - afxConstraintID camera_cons_id; - SceneObject* camera_cons_obj; + afxConstraintID mListener_cons_id; + afxConstraintID mCaster_cons_id; + afxConstraintID mTarget_cons_id; + afxConstraintID mImpacted_cons_id; + afxConstraintID mCamera_cons_id; + SceneObject* mCamera_cons_obj; - afxPhrase* phrases[NUM_PHRASES]; - F32 tfactors[NUM_PHRASES]; + afxPhrase* mPhrases[NUM_PHRASES]; + F32 mTfactors[NUM_PHRASES]; - bool notify_castbar; - F32 overall_time_factor; + bool mNotify_castbar; + F32 mOverall_time_factor; - U16 marks_mask; + U16 mMarks_mask; private: void init(); @@ -278,13 +278,13 @@ protected: virtual void unpack_constraint_info(NetConnection* conn, BitStream* stream); private: - afxMagicMissile* missile; - bool missile_is_armed; - SceneObject* impacted_obj; - Point3F impact_pos; - Point3F impact_norm; - U16 impacted_scope_id; - bool impacted_is_shape; + afxMagicMissile* mMissile; + bool mMissile_is_armed; + SceneObject* mImpacted_obj; + Point3F mImpact_pos; + Point3F mImpact_norm; + U16 mImpacted_scope_id; + bool mImpacted_is_shape; void init_missile_s(afxMagicMissileData* mm); void launch_missile_s(); @@ -353,15 +353,15 @@ public: void postSpellEvent(U8 event); void resolveTimeFactors(); - void setTimeFactor(F32 f) { overall_time_factor = (f > 0) ? f : 1.0f; } - F32 getTimeFactor() { return overall_time_factor; } - void setTimeFactor(U8 phase, F32 f) { tfactors[phase] = (f > 0) ? f : 1.0f; } - F32 getTimeFactor(U8 phase) { return tfactors[phase]; } + void setTimeFactor(F32 f) { mOverall_time_factor = (f > 0) ? f : 1.0f; } + F32 getTimeFactor() { return mOverall_time_factor; } + void setTimeFactor(U8 phase, F32 f) { mTfactors[phase] = (f > 0) ? f : 1.0f; } + F32 getTimeFactor(U8 phase) { return mTfactors[phase]; } - ShapeBase* getCaster() const { return caster; } - SceneObject* getTarget() const { return target; } - afxMagicMissile* getMissile() const { return missile; } - SceneObject* getImpactedObject() const { return impacted_obj; } + ShapeBase* getCaster() const { return mCaster; } + SceneObject* getTarget() const { return mTarget; } + afxMagicMissile* getMissile() const { return mMissile; } + SceneObject* getImpactedObject() const { return mImpacted_obj; } virtual void restoreObject(SceneObject*); @@ -377,7 +377,7 @@ public: inline bool afxMagicSpell::is_caster_moving() { - return (caster) ? (caster->getVelocity().len() > datablock->move_interrupt_speed) : false; + return (mCaster) ? (mCaster->getVelocity().len() > mDatablock->mMove_interrupt_speed) : false; } inline bool afxMagicSpell::is_caster_client(ShapeBase* caster, GameConnection* conn) diff --git a/Engine/source/afx/afxPhrase.cpp b/Engine/source/afx/afxPhrase.cpp index 3e0a2bee0..3f4e44167 100644 --- a/Engine/source/afx/afxPhrase.cpp +++ b/Engine/source/afx/afxPhrase.cpp @@ -34,51 +34,51 @@ void afxPhrase::init_fx(S32 group_index) { - fx->ev_init(init_chor, *init_fx_list, on_server, will_stop, init_time_factor, init_dur, group_index); + mFX->ev_init(mInit_chor, *mInit_fx_list, mOn_server, mWill_stop, mInit_time_factor, mInit_dur, group_index); } //~~~~~~~~~~~~~~~~~~~~// afxPhrase::afxPhrase(bool on_server, bool will_stop) { - this->on_server = on_server; - this->will_stop = will_stop; + mOn_server = on_server; + mWill_stop = will_stop; - init_fx_list = NULL; - init_dur = 0.0f; - init_chor = NULL; - init_time_factor = 1.0f; + mInit_fx_list = NULL; + mInit_dur = 0.0f; + mInit_chor = NULL; + mInit_time_factor = 1.0f; - fx = new afxEffectVector; - fx2 = NULL; - starttime = 0; - dur = 0; + mFX = new afxEffectVector; + mFX2 = NULL; + mStartTime = 0; + mDur = 0; - n_loops = 1; - loop_cnt = 1; + mNum_loops = 1; + mLoop_cnt = 1; - extra_time = 0.0f; - extra_stoptime = 0.0f; + mExtra_time = 0.0f; + mExtra_stoptime = 0.0f; } afxPhrase::~afxPhrase() { - delete fx; - delete fx2; + delete mFX; + delete mFX2; }; void afxPhrase::init(afxEffectList& fx_list, F32 dur, afxChoreographer* chor, F32 time_factor, S32 n_loops, S32 group_index, F32 extra_time) { - init_fx_list = &fx_list; - init_dur = dur; - init_chor = chor; - init_time_factor = time_factor; + mInit_fx_list = &fx_list; + mInit_dur = dur; + mInit_chor = chor; + mInit_time_factor = time_factor; - this->n_loops = n_loops; - this->extra_time = extra_time; - this->dur = (init_dur < 0) ? init_dur : init_dur*init_time_factor; + mNum_loops = n_loops; + mExtra_time = extra_time; + mDur = (mInit_dur < 0) ? mInit_dur : mInit_dur*mInit_time_factor; init_fx(group_index); } @@ -86,30 +86,30 @@ afxPhrase::init(afxEffectList& fx_list, F32 dur, afxChoreographer* chor, F32 tim void afxPhrase::start(F32 startstamp, F32 timestamp) { - starttime = startstamp; + mStartTime = startstamp; F32 loopstart = timestamp - startstamp; - if (dur > 0 && loopstart > dur) + if (mDur > 0 && loopstart > mDur) { - loop_cnt += (S32) (loopstart/dur); - loopstart = mFmod(loopstart, dur); + mLoop_cnt += (S32) (loopstart/ mDur); + loopstart = mFmod(loopstart, mDur); } - if (!fx->empty()) - fx->start(loopstart); + if (!mFX->empty()) + mFX->start(loopstart); } void afxPhrase::update(F32 dt, F32 timestamp) { - if (fx->isActive()) - fx->update(dt); + if (mFX->isActive()) + mFX->update(dt); - if (fx2 && fx2->isActive()) - fx2->update(dt); + if (mFX2 && mFX2->isActive()) + mFX2->update(dt); - if (extra_stoptime > 0 && timestamp > extra_stoptime) + if (mExtra_stoptime > 0 && timestamp > mExtra_stoptime) { stop(timestamp); } @@ -118,54 +118,54 @@ afxPhrase::update(F32 dt, F32 timestamp) void afxPhrase::stop(F32 timestamp) { - if (extra_time > 0 && !(extra_stoptime > 0)) + if (mExtra_time > 0 && !(mExtra_stoptime > 0)) { - extra_stoptime = timestamp + extra_time; + mExtra_stoptime = timestamp + mExtra_time; return; } - if (fx->isActive()) - fx->stop(); + if (mFX->isActive()) + mFX->stop(); - if (fx2 && fx2->isActive()) - fx2->stop(); + if (mFX2 && mFX2->isActive()) + mFX2->stop(); } bool afxPhrase::expired(F32 timestamp) { - if (dur < 0) + if (mDur < 0) return false; - return ((timestamp - starttime) > loop_cnt*dur); + return ((timestamp - mStartTime) > mLoop_cnt*mDur); } F32 afxPhrase::elapsed(F32 timestamp) { - return (timestamp - starttime); + return (timestamp - mStartTime); } bool afxPhrase::recycle(F32 timestamp) { - if (n_loops < 0 || loop_cnt < n_loops) + if (mNum_loops < 0 || mLoop_cnt < mNum_loops) { - if (fx2) - delete fx2; + if (mFX2) + delete mFX2; - fx2 = fx; + mFX2 = mFX; - fx = new afxEffectVector; + mFX = new afxEffectVector; init_fx(); - if (fx2 && !fx2->empty()) - fx2->stop(); + if (mFX2 && !mFX2->empty()) + mFX2->stop(); - if (!fx->empty()) - fx->start(0.0F); + if (!mFX->empty()) + mFX->start(0.0F); - loop_cnt++; + mLoop_cnt++; return true; } @@ -175,21 +175,21 @@ afxPhrase::recycle(F32 timestamp) void afxPhrase::interrupt(F32 timestamp) { - if (fx->isActive()) - fx->interrupt(); + if (mFX->isActive()) + mFX->interrupt(); - if (fx2 && fx2->isActive()) - fx2->interrupt(); + if (mFX2 && mFX2->isActive()) + mFX2->interrupt(); } F32 afxPhrase::calcDoneTime() { - return starttime + fx->getTotalDur(); + return mStartTime + mFX->getTotalDur(); } F32 afxPhrase::calcAfterLife() { - return fx->getAfterLife(); + return mFX->getAfterLife(); } diff --git a/Engine/source/afx/afxPhrase.h b/Engine/source/afx/afxPhrase.h index 2525c2656..12803dc5f 100644 --- a/Engine/source/afx/afxPhrase.h +++ b/Engine/source/afx/afxPhrase.h @@ -38,23 +38,23 @@ class afxEffectVector; class afxPhrase { protected: - afxEffectList* init_fx_list; - F32 init_dur; - afxChoreographer* init_chor; - F32 init_time_factor; - F32 extra_time; + afxEffectList* mInit_fx_list; + F32 mInit_dur; + afxChoreographer* mInit_chor; + F32 mInit_time_factor; + F32 mExtra_time; - afxEffectVector* fx; - afxEffectVector* fx2; + afxEffectVector* mFX; + afxEffectVector* mFX2; - bool on_server; - bool will_stop; + bool mOn_server; + bool mWill_stop; - F32 starttime; - F32 dur; - S32 n_loops; - S32 loop_cnt; - F32 extra_stoptime; + F32 mStartTime; + F32 mDur; + S32 mNum_loops; + S32 mLoop_cnt; + F32 mExtra_stoptime; void init_fx(S32 group_index=0); @@ -73,13 +73,13 @@ public: virtual bool recycle(F32 timestamp); virtual F32 elapsed(F32 timestamp); - bool isEmpty() { return fx->empty(); } - bool isInfinite() { return (init_dur < 0); } + bool isEmpty() { return mFX->empty(); } + bool isInfinite() { return (mInit_dur < 0); } F32 calcDoneTime(); F32 calcAfterLife(); - bool willStop() { return will_stop; } - bool onServer() { return on_server; } - S32 count() { return fx->count(); } + bool willStop() { return mWill_stop; } + bool onServer() { return mOn_server; } + S32 count() { return mFX->count(); } }; //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// diff --git a/Engine/source/afx/afxSelectron.cpp b/Engine/source/afx/afxSelectron.cpp index 148bcceca..81b60c836 100644 --- a/Engine/source/afx/afxSelectron.cpp +++ b/Engine/source/afx/afxSelectron.cpp @@ -230,9 +230,9 @@ void afxSelectronData::packData(BitStream* stream) stream->write(obj_type_style); stream->write(obj_type_mask); - pack_fx(stream, main_fx_list, packed); - pack_fx(stream, select_fx_list, packed); - pack_fx(stream, deselect_fx_list, packed); + pack_fx(stream, main_fx_list, mPacked); + pack_fx(stream, select_fx_list, mPacked); + pack_fx(stream, deselect_fx_list, mPacked); } void afxSelectronData::unpackData(BitStream* stream) diff --git a/Engine/source/afx/afxSpellBook.cpp b/Engine/source/afx/afxSpellBook.cpp index 42d28d550..cce22129b 100644 --- a/Engine/source/afx/afxSpellBook.cpp +++ b/Engine/source/afx/afxSpellBook.cpp @@ -116,7 +116,7 @@ void afxSpellBookData::packData(BitStream* stream) stream->write(pages_per_book); for (S32 i = 0; i < pages_per_book*spells_per_page; i++) - writeDatablockID(stream, rpg_spells[i], packed); + writeDatablockID(stream, rpg_spells[i], mPacked); } void afxSpellBookData::unpackData(BitStream* stream) diff --git a/Engine/source/afx/ce/afxLightBase_T3D.cpp b/Engine/source/afx/ce/afxLightBase_T3D.cpp index 209bc7426..56b76ccca 100644 --- a/Engine/source/afx/ce/afxLightBase_T3D.cpp +++ b/Engine/source/afx/ce/afxLightBase_T3D.cpp @@ -176,8 +176,8 @@ void afxT3DLightBaseData::packData(BitStream* stream) stream->write( mAnimState.animationPhase ); stream->write( mFlareScale ); - writeDatablockID(stream, mAnimationData, packed); - writeDatablockID(stream, mFlareData, packed); + writeDatablockID(stream, mAnimationData, mPacked); + writeDatablockID(stream, mFlareData, mPacked); } void afxT3DLightBaseData::unpackData(BitStream* stream) diff --git a/Engine/source/afx/ce/afxModel.cpp b/Engine/source/afx/ce/afxModel.cpp index 688cd08ad..6962aea51 100644 --- a/Engine/source/afx/ce/afxModel.cpp +++ b/Engine/source/afx/ce/afxModel.cpp @@ -397,7 +397,7 @@ bool afxModel::onAdd() // setup our bounding box if (mDataBlock->shape) - mObjBox = mDataBlock->shape->bounds; + mObjBox = mDataBlock->shape->mBounds; else mObjBox = Box3F(Point3F(-1, -1, -1), Point3F(1, 1, 1)); diff --git a/Engine/source/afx/ce/afxPhraseEffect.cpp b/Engine/source/afx/ce/afxPhraseEffect.cpp index 3710e2fe6..5df7dfc26 100644 --- a/Engine/source/afx/ce/afxPhraseEffect.cpp +++ b/Engine/source/afx/ce/afxPhraseEffect.cpp @@ -235,7 +235,7 @@ void afxPhraseEffectData::packData(BitStream* stream) stream->writeString(on_trig_cmd); - pack_fx(stream, fx_list, packed); + pack_fx(stream, fx_list, mPacked); } void afxPhraseEffectData::unpackData(BitStream* stream) diff --git a/Engine/source/afx/ce/afxStaticShape.cpp b/Engine/source/afx/ce/afxStaticShape.cpp index 5eb4fb815..4bef19629 100644 --- a/Engine/source/afx/ce/afxStaticShape.cpp +++ b/Engine/source/afx/ce/afxStaticShape.cpp @@ -122,11 +122,11 @@ ConsoleDocClass( afxStaticShape, afxStaticShape::afxStaticShape() { - afx_data = 0; - is_visible = true; - chor_id = 0; - hookup_with_chor = false; - ghost_cons_name = ST_NULLSTRING; + mAFX_data = 0; + mIs_visible = true; + mChor_id = 0; + mHookup_with_chor = false; + mGhost_cons_name = ST_NULLSTRING; } afxStaticShape::~afxStaticShape() @@ -135,8 +135,8 @@ afxStaticShape::~afxStaticShape() void afxStaticShape::init(U32 chor_id, StringTableEntry cons_name) { - this->chor_id = chor_id; - ghost_cons_name = cons_name; + mChor_id = chor_id; + mGhost_cons_name = cons_name; } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~// @@ -147,7 +147,7 @@ bool afxStaticShape::onNewDataBlock(GameBaseData* dptr, bool reload) if (!mDataBlock || !Parent::onNewDataBlock(dptr, reload)) return false; - afx_data = dynamic_cast(mDataBlock); + mAFX_data = dynamic_cast(mDataBlock); if (!mShapeInstance) return true; @@ -156,10 +156,10 @@ bool afxStaticShape::onNewDataBlock(GameBaseData* dptr, bool reload) // if datablock is afxStaticShapeData we get the sequence setting // directly from the datablock on the client-side only - if (afx_data) + if (mAFX_data) { if (isClientObject()) - seq_name = afx_data->sequence; + seq_name = mAFX_data->sequence; } // otherwise datablock is stock StaticShapeData and we look for // a sequence name on a dynamic field on the server. @@ -188,13 +188,13 @@ void afxStaticShape::advanceTime(F32 dt) { Parent::advanceTime(dt); - if (hookup_with_chor) + if (mHookup_with_chor) { - afxChoreographer* chor = arcaneFX::findClientChoreographer(chor_id); + afxChoreographer* chor = arcaneFX::findClientChoreographer(mChor_id); if (chor) { - chor->setGhostConstraintObject(this, ghost_cons_name); - hookup_with_chor = false; + chor->setGhostConstraintObject(this, mGhost_cons_name); + mHookup_with_chor = false; } } } @@ -206,8 +206,8 @@ U32 afxStaticShape::packUpdate(NetConnection* conn, U32 mask, BitStream* stream) // InitialUpdate if (stream->writeFlag(mask & InitialUpdateMask)) { - stream->write(chor_id); - stream->writeString(ghost_cons_name); + stream->write(mChor_id); + stream->writeString(mGhost_cons_name); } return retMask; @@ -222,11 +222,11 @@ void afxStaticShape::unpackUpdate(NetConnection * conn, BitStream * stream) // InitialUpdate if (stream->readFlag()) { - stream->read(&chor_id); - ghost_cons_name = stream->readSTString(); + stream->read(&mChor_id); + mGhost_cons_name = stream->readSTString(); - if (chor_id != 0 && ghost_cons_name != ST_NULLSTRING) - hookup_with_chor = true; + if (mChor_id != 0 && mGhost_cons_name != ST_NULLSTRING) + mHookup_with_chor = true; } } @@ -234,7 +234,7 @@ void afxStaticShape::unpackUpdate(NetConnection * conn, BitStream * stream) void afxStaticShape::prepRenderImage(SceneRenderState* state) { - if (is_visible) + if (mIs_visible) Parent::prepRenderImage(state); } diff --git a/Engine/source/afx/ce/afxStaticShape.h b/Engine/source/afx/ce/afxStaticShape.h index ed84e0774..ad3c895e3 100644 --- a/Engine/source/afx/ce/afxStaticShape.h +++ b/Engine/source/afx/ce/afxStaticShape.h @@ -66,11 +66,11 @@ class afxStaticShape : public StaticShape private: StaticShapeData* mDataBlock; - afxStaticShapeData* afx_data; - bool is_visible; - U32 chor_id; - bool hookup_with_chor; - StringTableEntry ghost_cons_name; + afxStaticShapeData* mAFX_data; + bool mIs_visible; + U32 mChor_id; + bool mHookup_with_chor; + StringTableEntry mGhost_cons_name; protected: virtual void prepRenderImage(SceneRenderState*); @@ -87,7 +87,7 @@ public: virtual void unpackUpdate(NetConnection*, BitStream*); const char* getShapeFileName() const { return mDataBlock->shapeName; } - void setVisibility(bool flag) { is_visible = flag; } + void setVisibility(bool flag) { mIs_visible = flag; } DECLARE_CONOBJECT(afxStaticShape); DECLARE_CATEGORY("AFX"); diff --git a/Engine/source/afx/ea/afxEA_AnimClip.cpp b/Engine/source/afx/ea/afxEA_AnimClip.cpp index 4e635a1db..601d54515 100644 --- a/Engine/source/afx/ea/afxEA_AnimClip.cpp +++ b/Engine/source/afx/ea/afxEA_AnimClip.cpp @@ -89,10 +89,10 @@ bool afxEA_AnimClip::ea_start() do_runtime_substitutions(); afxConstraint* pos_constraint = getPosConstraint(); - if (full_lifetime == INFINITE_LIFETIME && pos_constraint != 0) + if (mFull_lifetime == INFINITE_LIFETIME && pos_constraint != 0) anim_lifetime = pos_constraint->getAnimClipDuration(clip_data->clip_name); else - anim_lifetime = full_lifetime; + anim_lifetime = mFull_lifetime; anim_tag = 0; lock_tag = 0; @@ -127,8 +127,8 @@ bool afxEA_AnimClip::ea_update(F32 dt) if (go_for_it) { - F32 rate = clip_data->rate/prop_time_factor; - F32 pos = mFmod(life_elapsed, anim_lifetime)/anim_lifetime; + F32 rate = clip_data->rate/mProp_time_factor; + F32 pos = mFmod(mLife_elapsed, anim_lifetime)/anim_lifetime; pos = mFmod(pos + clip_data->pos_offset, 1.0); if (clip_data->rate < 0) pos = 1.0f - pos; @@ -164,7 +164,7 @@ void afxEA_AnimClip::do_runtime_substitutions() // clone the datablock and perform substitutions afxAnimClipData* orig_db = clip_data; clip_data = new afxAnimClipData(*orig_db, true); - orig_db->performSubstitutions(clip_data, choreographer, group_index); + orig_db->performSubstitutions(clip_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_AreaDamage.cpp b/Engine/source/afx/ea/afxEA_AreaDamage.cpp index 3c5d26aae..a9a6036fb 100644 --- a/Engine/source/afx/ea/afxEA_AreaDamage.cpp +++ b/Engine/source/afx/ea/afxEA_AreaDamage.cpp @@ -133,7 +133,7 @@ void afxEA_AreaDamage::do_runtime_substitutions() // clone the datablock and perform substitutions afxAreaDamageData* orig_db = damage_data; damage_data = new afxAreaDamageData(*orig_db, true); - orig_db->performSubstitutions(damage_data, choreographer, group_index); + orig_db->performSubstitutions(damage_data, mChoreographer, mGroup_index); } } @@ -204,8 +204,8 @@ void afxEA_AreaDamage::notify_damage_source(ShapeBase* damaged, F32 damage, cons char *posArg = Con::getArgBuffer(64); dSprintf(posArg, 64, "%f %f %f", pos.x, pos.y, pos.z); - Con::executef(choreographer->getDataBlock(), "onInflictedAreaDamage", - choreographer->getIdString(), + Con::executef(mChoreographer->getDataBlock(), "onInflictedAreaDamage", + mChoreographer->getIdString(), damaged->getIdString(), Con::getFloatArg(damage), flavor, @@ -221,7 +221,7 @@ void afxEA_AreaDamage::apply_damage(ShapeBase* shape, F32 damage, const char* fl dSprintf(posArg, 64, "%f %f %f", pos.x, pos.y, pos.z); Con::executef(shape, "damage", - choreographer->getIdString(), + mChoreographer->getIdString(), posArg, Con::getFloatArg(damage), flavor); diff --git a/Engine/source/afx/ea/afxEA_AudioBank.cpp b/Engine/source/afx/ea/afxEA_AudioBank.cpp index 3cf7bd912..6a52ca345 100644 --- a/Engine/source/afx/ea/afxEA_AudioBank.cpp +++ b/Engine/source/afx/ea/afxEA_AudioBank.cpp @@ -125,8 +125,8 @@ bool afxEA_AudioBank::ea_update(F32 dt) if (sound_handle) { - sound_handle->setTransform(updated_xfm); - sound_handle->setVolume(updated_scale.x*fade_value); + sound_handle->setTransform(mUpdated_xfm); + sound_handle->setVolume(mUpdated_scale.x*mFade_value); } return true; @@ -143,14 +143,14 @@ void afxEA_AudioBank::ea_finish(bool was_stopped) void afxEA_AudioBank::do_runtime_substitutions() { - sound_bank = sound_bank->cloneAndPerformSubstitutions(choreographer, group_index); + sound_bank = sound_bank->cloneAndPerformSubstitutions(mChoreographer, mGroup_index); } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// class afxEA_SoundBankDesc : public afxEffectAdapterDesc, public afxEffectDefs { - static afxEA_SoundBankDesc desc; + static afxEA_SoundBankDesc mDesc; public: virtual bool testEffectType(const SimDataBlock*) const; @@ -162,7 +162,7 @@ public: virtual afxEffectWrapper* create() const { return new afxEA_AudioBank; } }; -afxEA_SoundBankDesc afxEA_SoundBankDesc::desc; +afxEA_SoundBankDesc afxEA_SoundBankDesc::mDesc; bool afxEA_SoundBankDesc::testEffectType(const SimDataBlock* db) const { diff --git a/Engine/source/afx/ea/afxEA_Billboard.cpp b/Engine/source/afx/ea/afxEA_Billboard.cpp index 254dab1d6..012b364f9 100644 --- a/Engine/source/afx/ea/afxEA_Billboard.cpp +++ b/Engine/source/afx/ea/afxEA_Billboard.cpp @@ -108,18 +108,18 @@ bool afxEA_Billboard::ea_update(F32 dt) deleteNotify(bb); ///bb->setSequenceRateFactor(datablock->rate_factor/prop_time_factor); - bb->setSortPriority(datablock->sort_priority); + bb->setSortPriority(mDatablock->sort_priority); } if (bb) { - bb->live_color = updated_color; - if (do_fades) + bb->live_color = mUpdated_color; + if (mDo_fades) { - bb->setFadeAmount(fade_value); + bb->setFadeAmount(mFade_value); } - bb->setTransform(updated_xfm); - bb->setScale(updated_scale); + bb->setTransform(mUpdated_xfm); + bb->setScale(mUpdated_scale); } return true; @@ -162,7 +162,7 @@ void afxEA_Billboard::do_runtime_substitutions() // clone the datablock and perform substitutions afxBillboardData* orig_db = bb_data; bb_data = new afxBillboardData(*orig_db, true); - orig_db->performSubstitutions(bb_data, choreographer, group_index); + orig_db->performSubstitutions(bb_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_CameraPuppet.cpp b/Engine/source/afx/ea/afxEA_CameraPuppet.cpp index b307bcb2f..51a3a3dd9 100644 --- a/Engine/source/afx/ea/afxEA_CameraPuppet.cpp +++ b/Engine/source/afx/ea/afxEA_CameraPuppet.cpp @@ -83,8 +83,8 @@ bool afxEA_CameraPuppet::ea_start() do_runtime_substitutions(); - afxConstraintID obj_id = cons_mgr->getConstraintId(puppet_data->cam_def); - cam_cons = cons_mgr->getConstraint(obj_id); + afxConstraintID obj_id = mCons_mgr->getConstraintId(puppet_data->cam_def); + cam_cons = mCons_mgr->getConstraint(obj_id); SceneObject* obj = (cam_cons) ? cam_cons->getSceneObject() : 0; if (obj && obj->isClientObject()) @@ -105,9 +105,9 @@ bool afxEA_CameraPuppet::ea_update(F32 dt) { SceneObject* obj = (cam_cons) ? cam_cons->getSceneObject() : 0; - if (obj && in_scope) + if (obj && mIn_scope) { - obj->setTransform(updated_xfm); + obj->setTransform(mUpdated_xfm); } return true; @@ -153,7 +153,7 @@ void afxEA_CameraPuppet::do_runtime_substitutions() // clone the datablock and perform substitutions afxCameraPuppetData* orig_db = puppet_data; puppet_data = new afxCameraPuppetData(*orig_db, true); - orig_db->performSubstitutions(puppet_data, choreographer, group_index); + orig_db->performSubstitutions(puppet_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_CameraShake.cpp b/Engine/source/afx/ea/afxEA_CameraShake.cpp index 9c26e32b6..2e5a461fa 100644 --- a/Engine/source/afx/ea/afxEA_CameraShake.cpp +++ b/Engine/source/afx/ea/afxEA_CameraShake.cpp @@ -91,7 +91,7 @@ bool afxEA_CameraShake::ea_start() if (aim_constraint && pos_constraint) { - if (full_lifetime <= 0 || full_lifetime == INFINITE_LIFETIME) + if (mFull_lifetime <= 0 || mFull_lifetime == INFINITE_LIFETIME) { Con::errorf("afxEA_CameraShake::ea_start() -- effect requires a finite lifetime."); return false; @@ -106,7 +106,7 @@ bool afxEA_CameraShake::ea_start() if (dist < shake_data->camShakeRadius) { camera_shake = new CameraShake; - camera_shake->setDuration(full_lifetime); + camera_shake->setDuration(mFull_lifetime); camera_shake->setFrequency(shake_data->camShakeFreq); F32 falloff = dist/shake_data->camShakeRadius; @@ -161,7 +161,7 @@ void afxEA_CameraShake::do_runtime_substitutions() // clone the datablock and perform substitutions afxCameraShakeData* orig_db = shake_data; shake_data = new afxCameraShakeData(*orig_db, true); - orig_db->performSubstitutions(shake_data, choreographer, group_index); + orig_db->performSubstitutions(shake_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_CollisionEvent.cpp b/Engine/source/afx/ea/afxEA_CollisionEvent.cpp index b06492acc..73b6fa707 100644 --- a/Engine/source/afx/ea/afxEA_CollisionEvent.cpp +++ b/Engine/source/afx/ea/afxEA_CollisionEvent.cpp @@ -107,16 +107,16 @@ bool afxEA_CollisionEvent::ea_update(F32 dt) afxConstraint* pos_constraint = getPosConstraint(); set_shape((pos_constraint) ? dynamic_cast(pos_constraint->getSceneObject()) : 0); - if (choreographer && trigger_mask != 0) + if (mChoreographer && trigger_mask != 0) { if (triggered) { - choreographer->setTriggerMask(trigger_mask | choreographer->getTriggerMask()); + mChoreographer->setTriggerMask(trigger_mask | mChoreographer->getTriggerMask()); triggered = false; } else { - choreographer->setTriggerMask(~trigger_mask & choreographer->getTriggerMask()); + mChoreographer->setTriggerMask(~trigger_mask & mChoreographer->getTriggerMask()); } } @@ -136,7 +136,7 @@ void afxEA_CollisionEvent::do_runtime_substitutions() // clone the datablock and perform substitutions afxCollisionEventData* orig_db = script_data; script_data = new afxCollisionEventData(*orig_db, true); - orig_db->performSubstitutions(script_data, choreographer, group_index); + orig_db->performSubstitutions(script_data, mChoreographer, mGroup_index); } } @@ -162,7 +162,7 @@ void afxEA_CollisionEvent::set_shape(ShapeBase* new_shape) void afxEA_CollisionEvent::collisionNotify(SceneObject* obj0, SceneObject* obj1, const VectorF& vel) { - if (obj0 != shape || !choreographer || !choreographer->getDataBlock()) + if (obj0 != shape || !mChoreographer || !mChoreographer->getDataBlock()) return; if (script_data->method_name != ST_NULLSTRING) @@ -171,8 +171,8 @@ void afxEA_CollisionEvent::collisionNotify(SceneObject* obj0, SceneObject* obj1, dSprintf(arg_buf, 256, "%g %g %g", vel.x, vel.y, vel.z); // CALL SCRIPT afxChoreographerData::method(%spell, %obj0, %obj1, %velocity) - Con::executef(choreographer->getDataBlock(), script_data->method_name, - choreographer->getIdString(), + Con::executef(mChoreographer->getDataBlock(), script_data->method_name, + mChoreographer->getIdString(), (obj0) ? obj0->getIdString() : "", (obj1) ? obj1->getIdString() : "", arg_buf, diff --git a/Engine/source/afx/ea/afxEA_ConsoleMessage.cpp b/Engine/source/afx/ea/afxEA_ConsoleMessage.cpp index cb08cfa72..0f80a194a 100644 --- a/Engine/source/afx/ea/afxEA_ConsoleMessage.cpp +++ b/Engine/source/afx/ea/afxEA_ConsoleMessage.cpp @@ -98,7 +98,7 @@ void afxEA_ConsoleMessage::do_runtime_substitutions() // clone the datablock and perform substitutions afxConsoleMessageData* orig_db = message_data; message_data = new afxConsoleMessageData(*orig_db, true); - orig_db->performSubstitutions(message_data, choreographer, group_index); + orig_db->performSubstitutions(message_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_Damage.cpp b/Engine/source/afx/ea/afxEA_Damage.cpp index e0691eae3..a338bfa38 100644 --- a/Engine/source/afx/ea/afxEA_Damage.cpp +++ b/Engine/source/afx/ea/afxEA_Damage.cpp @@ -101,7 +101,7 @@ bool afxEA_Damage::ea_start() if (damage_data->repeats > 1) { - dot_delta_ms = full_lifetime/(damage_data->repeats - 1); + dot_delta_ms = mFull_lifetime /(damage_data->repeats - 1); next_dot_time = dot_delta_ms; } @@ -122,15 +122,15 @@ bool afxEA_Damage::ea_update(F32 dt) if (aim_cons && aim_cons->getSceneObject()) impacted_obj_id = aim_cons->getSceneObject()->getId(); - if (choreographer) - choreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount, + if (mChoreographer) + mChoreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount, repeat_cnt, damage_data->ad_amount, damage_data->radius, impact_pos, damage_data->impulse); repeat_cnt++; } else if (repeat_cnt < damage_data->repeats) { - if (next_dot_time <= life_elapsed) + if (next_dot_time <= mLife_elapsed) { // CONSTRAINT REMAPPING << afxConstraint* aim_cons = getAimConstraint(); @@ -138,8 +138,8 @@ bool afxEA_Damage::ea_update(F32 dt) impacted_obj_id = aim_cons->getSceneObject()->getId(); // CONSTRAINT REMAPPING >> - if (choreographer) - choreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount, + if (mChoreographer) + mChoreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount, repeat_cnt, 0, 0, impact_pos, 0); next_dot_time += dot_delta_ms; repeat_cnt++; @@ -153,10 +153,10 @@ void afxEA_Damage::ea_finish(bool was_stopped) { if (started && (repeat_cnt < damage_data->repeats)) { - if (next_dot_time <= life_elapsed) + if (next_dot_time <= mLife_elapsed) { - if (choreographer) - choreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount, + if (mChoreographer) + mChoreographer->inflictDamage(damage_data->label, damage_data->flavor, impacted_obj_id, damage_data->amount, repeat_cnt, 0, 0, impact_pos, 0); } } @@ -172,7 +172,7 @@ void afxEA_Damage::do_runtime_substitutions() // clone the datablock and perform substitutions afxDamageData* orig_db = damage_data; damage_data = new afxDamageData(*orig_db, true); - orig_db->performSubstitutions(damage_data, choreographer, group_index); + orig_db->performSubstitutions(damage_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_Debris.cpp b/Engine/source/afx/ea/afxEA_Debris.cpp index e4a46fc6b..678c02726 100644 --- a/Engine/source/afx/ea/afxEA_Debris.cpp +++ b/Engine/source/afx/ea/afxEA_Debris.cpp @@ -78,7 +78,7 @@ afxEA_Debris::~afxEA_Debris() bool afxEA_Debris::isDone() { - return (datablock->use_as_cons_obj) ? debris_done : exploded; + return (mDatablock->use_as_cons_obj) ? debris_done : exploded; } void afxEA_Debris::ea_set_datablock(SimDataBlock* db) @@ -106,21 +106,21 @@ bool afxEA_Debris::ea_update(F32 dt) { if (exploded && debris) { - if (in_scope) + if (mIn_scope) { - updated_xfm = debris->getRenderTransform(); - updated_xfm.getColumn(3, &updated_pos); + mUpdated_xfm = debris->getRenderTransform(); + mUpdated_xfm.getColumn(3, &mUpdated_pos); } } if (!exploded && debris) { - if (in_scope) + if (mIn_scope) { Point3F dir_vec(0,1,0); - updated_xfm.mulV(dir_vec); + mUpdated_xfm.mulV(dir_vec); - debris->init(updated_pos, dir_vec); + debris->init(mUpdated_pos, dir_vec); if (!debris->registerObject()) { delete debris; @@ -165,7 +165,7 @@ void afxEA_Debris::do_runtime_substitutions() // clone the datablock and perform substitutions DebrisData* orig_db = debris_data; debris_data = new DebrisData(*orig_db, true); - orig_db->performSubstitutions(debris_data, choreographer, group_index); + orig_db->performSubstitutions(debris_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_Explosion.cpp b/Engine/source/afx/ea/afxEA_Explosion.cpp index f8e424f84..d8fcd3377 100644 --- a/Engine/source/afx/ea/afxEA_Explosion.cpp +++ b/Engine/source/afx/ea/afxEA_Explosion.cpp @@ -81,7 +81,7 @@ bool afxEA_Explosion::ea_start() do_runtime_substitutions(); explosion = new Explosion(); - explosion->setSubstitutionData(choreographer, group_index); + explosion->setSubstitutionData(mChoreographer, mGroup_index); explosion->setDataBlock(explosion_data); return true; @@ -91,10 +91,10 @@ bool afxEA_Explosion::ea_update(F32 dt) { if (!exploded && explosion) { - if (in_scope) + if (mIn_scope) { - Point3F norm(0,0,1); updated_xfm.mulV(norm); - explosion->setInitialState(updated_pos, norm); + Point3F norm(0,0,1); mUpdated_xfm.mulV(norm); + explosion->setInitialState(mUpdated_pos, norm); if (!explosion->registerObject()) { delete explosion; @@ -117,7 +117,7 @@ void afxEA_Explosion::ea_finish(bool was_stopped) void afxEA_Explosion::do_runtime_substitutions() { - explosion_data = explosion_data->cloneAndPerformSubstitutions(choreographer, group_index); + explosion_data = explosion_data->cloneAndPerformSubstitutions(mChoreographer, mGroup_index); } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// diff --git a/Engine/source/afx/ea/afxEA_FootSwitch.cpp b/Engine/source/afx/ea/afxEA_FootSwitch.cpp index 822dfb1e4..e2cfb016b 100644 --- a/Engine/source/afx/ea/afxEA_FootSwitch.cpp +++ b/Engine/source/afx/ea/afxEA_FootSwitch.cpp @@ -40,8 +40,8 @@ class afxEA_FootSwitch : public afxEffectWrapper { typedef afxEffectWrapper Parent; - afxFootSwitchData* footfall_data; - Player* player; + afxFootSwitchData* mFootfall_data; + Player* mPlayer; void do_runtime_substitutions(); @@ -62,38 +62,38 @@ public: afxEA_FootSwitch::afxEA_FootSwitch() { - footfall_data = 0; - player = 0; + mFootfall_data = 0; + mPlayer = 0; } inline void afxEA_FootSwitch::set_overrides(Player* player) { - if (footfall_data->override_all) + if (mFootfall_data->override_all) player->overrideFootfallFX(); else - player->overrideFootfallFX(footfall_data->override_decals, - footfall_data->override_sounds, - footfall_data->override_dust); + player->overrideFootfallFX(mFootfall_data->override_decals, + mFootfall_data->override_sounds, + mFootfall_data->override_dust); } inline void afxEA_FootSwitch::clear_overrides(Player* player) { - if (footfall_data->override_all) + if (mFootfall_data->override_all) player->restoreFootfallFX(); else - player->restoreFootfallFX(footfall_data->override_decals, - footfall_data->override_sounds, - footfall_data->override_dust); + player->restoreFootfallFX(mFootfall_data->override_decals, + mFootfall_data->override_sounds, + mFootfall_data->override_dust); } void afxEA_FootSwitch::ea_set_datablock(SimDataBlock* db) { - footfall_data = dynamic_cast(db); + mFootfall_data = dynamic_cast(db); } bool afxEA_FootSwitch::ea_start() { - if (!footfall_data) + if (!mFootfall_data) { Con::errorf("afxEA_FootSwitch::ea_start() -- missing or incompatible datablock."); return false; @@ -102,25 +102,25 @@ bool afxEA_FootSwitch::ea_start() do_runtime_substitutions(); afxConstraint* pos_cons = getPosConstraint(); - player = (pos_cons) ? dynamic_cast(pos_cons->getSceneObject()) : 0; - if (player) - set_overrides(player); + mPlayer = (pos_cons) ? dynamic_cast(pos_cons->getSceneObject()) : 0; + if (mPlayer) + set_overrides(mPlayer); return true; } bool afxEA_FootSwitch::ea_update(F32 dt) { - if (!player) + if (!mPlayer) return true; afxConstraint* pos_cons = getPosConstraint(); Player* temp_player = (pos_cons) ? dynamic_cast(pos_cons->getSceneObject()) : 0; - if (temp_player && temp_player != player) + if (temp_player && temp_player != mPlayer) { - player = temp_player; - if (player) - set_overrides(player); + mPlayer = temp_player; + if (mPlayer) + set_overrides(mPlayer); } return true; @@ -128,24 +128,24 @@ bool afxEA_FootSwitch::ea_update(F32 dt) void afxEA_FootSwitch::ea_finish(bool was_stopped) { - if (!player) + if (!mPlayer) return; afxConstraint* pos_cons = getPosConstraint(); Player* temp_player = (pos_cons) ? dynamic_cast(pos_cons->getSceneObject()) : 0; - if (temp_player == player) - clear_overrides(player); + if (temp_player == mPlayer) + clear_overrides(mPlayer); } void afxEA_FootSwitch::do_runtime_substitutions() { // only clone the datablock if there are substitutions - if (footfall_data->getSubstitutionCount() > 0) + if (mFootfall_data->getSubstitutionCount() > 0) { // clone the datablock and perform substitutions - afxFootSwitchData* orig_db = footfall_data; - footfall_data = new afxFootSwitchData(*orig_db, true); - orig_db->performSubstitutions(footfall_data, choreographer, group_index); + afxFootSwitchData* orig_db = mFootfall_data; + mFootfall_data = new afxFootSwitchData(*orig_db, true); + orig_db->performSubstitutions(mFootfall_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_GuiController.cpp b/Engine/source/afx/ea/afxEA_GuiController.cpp index 9387278e7..e4fe1251e 100644 --- a/Engine/source/afx/ea/afxEA_GuiController.cpp +++ b/Engine/source/afx/ea/afxEA_GuiController.cpp @@ -146,7 +146,7 @@ bool afxEA_GuiController::ea_update(F32 dt) if (ts_ctrl && !controller_data->preserve_pos) { Point3F screen_pos; - if (ts_ctrl->project(updated_pos, &screen_pos)) + if (ts_ctrl->project(mUpdated_pos, &screen_pos)) { const Point2I ext = gui_control->getExtent(); Point2I newpos(screen_pos.x - ext.x/2, screen_pos.y - ext.y/2); @@ -155,12 +155,12 @@ bool afxEA_GuiController::ea_update(F32 dt) } if (progress_base) - progress_base->setProgress((ew_timing.lifetime > 0.0) ? life_elapsed/ew_timing.lifetime : 0.0f); + progress_base->setProgress((mEW_timing.lifetime > 0.0) ? mLife_elapsed / mEW_timing.lifetime : 0.0f); else if (progress_ctrl) - progress_ctrl->setScriptValue((ew_timing.lifetime > 0.0) ? avar("%g", life_elapsed/ew_timing.lifetime) : 0); + progress_ctrl->setScriptValue((mEW_timing.lifetime > 0.0) ? avar("%g", mLife_elapsed / mEW_timing.lifetime) : 0); - if (do_fades) - gui_control->setFadeAmount(fade_value); + if (mDo_fades) + gui_control->setFadeAmount(mFade_value); return true; } @@ -182,7 +182,7 @@ void afxEA_GuiController::do_runtime_substitutions() // clone the datablock and perform substitutions afxGuiControllerData* orig_db = controller_data; controller_data = new afxGuiControllerData(*orig_db, true); - orig_db->performSubstitutions(controller_data, choreographer, group_index); + orig_db->performSubstitutions(controller_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_GuiText.cpp b/Engine/source/afx/ea/afxEA_GuiText.cpp index 7dfc77422..41b8e4346 100644 --- a/Engine/source/afx/ea/afxEA_GuiText.cpp +++ b/Engine/source/afx/ea/afxEA_GuiText.cpp @@ -105,9 +105,9 @@ bool afxEA_GuiText::ea_update(F32 dt) case USER_TEXT: { LinearColorF temp_clr = text_clr; - if (do_fades) - temp_clr.alpha = fade_value; - afxGuiTextHud::addTextItem(updated_pos, text_data->text_str, temp_clr); + if (mDo_fades) + temp_clr.alpha = mFade_value; + afxGuiTextHud::addTextItem(mUpdated_pos, text_data->text_str, temp_clr); } break; case SHAPE_NAME: @@ -127,9 +127,9 @@ bool afxEA_GuiText::ea_update(F32 dt) if (name && name[0] != '\0') { LinearColorF temp_clr = text_clr; - if (do_fades) - temp_clr.alpha = fade_value; - afxGuiTextHud::addTextItem(updated_pos, name, temp_clr, cons_obj); + if (mDo_fades) + temp_clr.alpha = mFade_value; + afxGuiTextHud::addTextItem(mUpdated_pos, name, temp_clr, cons_obj); } } break; @@ -146,7 +146,7 @@ void afxEA_GuiText::do_runtime_substitutions() // clone the datablock and perform substitutions afxGuiTextData* orig_db = text_data; text_data = new afxGuiTextData(*orig_db, true); - orig_db->performSubstitutions(text_data, choreographer, group_index); + orig_db->performSubstitutions(text_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_MachineGun.cpp b/Engine/source/afx/ea/afxEA_MachineGun.cpp index 0db257b87..32b09c267 100644 --- a/Engine/source/afx/ea/afxEA_MachineGun.cpp +++ b/Engine/source/afx/ea/afxEA_MachineGun.cpp @@ -110,15 +110,15 @@ bool afxEA_MachineGun::ea_update(F32 dt) { if (!shooting) { - start_time = elapsed; + start_time = mElapsed; shooting = true; } else { F32 next_shot = start_time + (shot_count+1)*shot_gap; - while (next_shot < elapsed) + while (next_shot < mElapsed) { - if (in_scope) + if (mIn_scope) launch_projectile(); next_shot += shot_gap; shot_count++; @@ -141,7 +141,7 @@ void afxEA_MachineGun::launch_projectile() if (bullet_data->getSubstitutionCount() > 0) { next_bullet = new ProjectileData(*bullet_data, true); - bullet_data->performSubstitutions(next_bullet, choreographer, group_index); + bullet_data->performSubstitutions(next_bullet, mChoreographer, mGroup_index); } projectile->onNewDataBlock(next_bullet, false); @@ -151,10 +151,10 @@ void afxEA_MachineGun::launch_projectile() afxConstraint* pos_cons = getPosConstraint(); ShapeBase* src_obj = (pos_cons) ? (dynamic_cast(pos_cons->getSceneObject())) : 0; - Point3F dir_vec = updated_aim - updated_pos; + Point3F dir_vec = mUpdated_aim - mUpdated_pos; dir_vec.normalizeSafe(); dir_vec *= muzzle_vel; - projectile->init(updated_pos, dir_vec, src_obj); + projectile->init(mUpdated_pos, dir_vec, src_obj); if (!projectile->registerObject()) { delete projectile; @@ -162,7 +162,7 @@ void afxEA_MachineGun::launch_projectile() Con::errorf("afxEA_MachineGun::launch_projectile() -- projectile failed to register."); } if (projectile) - projectile->setDataField(StringTable->insert("afxOwner"), 0, choreographer->getIdString()); + projectile->setDataField(StringTable->insert("afxOwner"), 0, mChoreographer->getIdString()); } void afxEA_MachineGun::do_runtime_substitutions() @@ -173,7 +173,7 @@ void afxEA_MachineGun::do_runtime_substitutions() // clone the datablock and perform substitutions afxMachineGunData* orig_db = gun_data; gun_data = new afxMachineGunData(*orig_db, true); - orig_db->performSubstitutions(gun_data, choreographer, group_index); + orig_db->performSubstitutions(gun_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_Model.cpp b/Engine/source/afx/ea/afxEA_Model.cpp index 23179ebe4..004acd887 100644 --- a/Engine/source/afx/ea/afxEA_Model.cpp +++ b/Engine/source/afx/ea/afxEA_Model.cpp @@ -119,18 +119,18 @@ bool afxEA_Model::ea_update(F32 dt) } deleteNotify(model); - model->setSequenceRateFactor(datablock->rate_factor/prop_time_factor); - model->setSortPriority(datablock->sort_priority); + model->setSequenceRateFactor(mDatablock->rate_factor/ mProp_time_factor); + model->setSortPriority(mDatablock->sort_priority); } if (model) { - if (do_fades) + if (mDo_fades) { - model->setFadeAmount(fade_value); + model->setFadeAmount(mFade_value); } - model->setTransform(updated_xfm); - model->setScale(updated_scale); + model->setTransform(mUpdated_xfm); + model->setScale(mUpdated_scale); } return true; @@ -141,10 +141,10 @@ void afxEA_Model::ea_finish(bool was_stopped) if (!model) return; - if (in_scope && ew_timing.residue_lifetime > 0) + if (mIn_scope && mEW_timing.residue_lifetime > 0) { clearNotify(model); - afxResidueMgr::add(ew_timing.residue_lifetime, ew_timing.residue_fadetime, model); + afxResidueMgr::add(mEW_timing.residue_lifetime, mEW_timing.residue_fadetime, model); model = 0; } else @@ -203,7 +203,7 @@ void afxEA_Model::do_runtime_substitutions() // clone the datablock and perform substitutions afxModelData* orig_db = model_data; model_data = new afxModelData(*orig_db, true); - orig_db->performSubstitutions(model_data, choreographer, group_index); + orig_db->performSubstitutions(model_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_Mooring.cpp b/Engine/source/afx/ea/afxEA_Mooring.cpp index a4e8743ee..76982679b 100644 --- a/Engine/source/afx/ea/afxEA_Mooring.cpp +++ b/Engine/source/afx/ea/afxEA_Mooring.cpp @@ -37,8 +37,8 @@ class afxEA_Mooring : public afxEffectWrapper { typedef afxEffectWrapper Parent; - afxMooringData* mooring_data; - afxMooring* obj; + afxMooringData* mMooring_data; + afxMooring* mObj; void do_runtime_substitutions(); @@ -57,27 +57,27 @@ public: afxEA_Mooring::afxEA_Mooring() { - mooring_data = 0; - obj = 0; + mMooring_data = 0; + mObj = 0; } afxEA_Mooring::~afxEA_Mooring() { - if (obj) - obj->deleteObject(); - if (mooring_data && mooring_data->isTempClone()) - delete mooring_data; - mooring_data = 0; + if (mObj) + mObj->deleteObject(); + if (mMooring_data && mMooring_data->isTempClone()) + delete mMooring_data; + mMooring_data = 0; } void afxEA_Mooring::ea_set_datablock(SimDataBlock* db) { - mooring_data = dynamic_cast(db); + mMooring_data = dynamic_cast(db); } bool afxEA_Mooring::ea_start() { - if (!mooring_data) + if (!mMooring_data) { Con::errorf("afxEA_Mooring::ea_start() -- missing or incompatible datablock."); return false; @@ -90,33 +90,33 @@ bool afxEA_Mooring::ea_start() bool afxEA_Mooring::ea_update(F32 dt) { - if (!obj) + if (!mObj) { - if (datablock->use_ghost_as_cons_obj && datablock->effect_name != ST_NULLSTRING) + if (mDatablock->use_ghost_as_cons_obj && mDatablock->effect_name != ST_NULLSTRING) { - obj = new afxMooring(mooring_data->networking, - choreographer->getChoreographerId(), - datablock->effect_name); + mObj = new afxMooring(mMooring_data->networking, + mChoreographer->getChoreographerId(), + mDatablock->effect_name); } else { - obj = new afxMooring(mooring_data->networking, 0, ST_NULLSTRING); + mObj = new afxMooring(mMooring_data->networking, 0, ST_NULLSTRING); } - obj->onNewDataBlock(mooring_data, false); - if (!obj->registerObject()) + mObj->onNewDataBlock(mMooring_data, false); + if (!mObj->registerObject()) { - delete obj; - obj = 0; + delete mObj; + mObj = 0; Con::errorf("afxEA_Mooring::ea_update() -- effect failed to register."); return false; } - deleteNotify(obj); + deleteNotify(mObj); } - if (obj) + if (mObj) { - obj->setTransform(updated_xfm); + mObj->setTransform(mUpdated_xfm); } return true; @@ -128,7 +128,7 @@ void afxEA_Mooring::ea_finish(bool was_stopped) void afxEA_Mooring::onDeleteNotify(SimObject* obj) { - if (this->obj == obj) + if (mObj == obj) obj = 0; Parent::onDeleteNotify(obj); @@ -137,12 +137,12 @@ void afxEA_Mooring::onDeleteNotify(SimObject* obj) void afxEA_Mooring::do_runtime_substitutions() { // only clone the datablock if there are substitutions - if (mooring_data->getSubstitutionCount() > 0) + if (mMooring_data->getSubstitutionCount() > 0) { // clone the datablock and perform substitutions - afxMooringData* orig_db = mooring_data; - mooring_data = new afxMooringData(*orig_db, true); - orig_db->performSubstitutions(mooring_data, choreographer, group_index); + afxMooringData* orig_db = mMooring_data; + mMooring_data = new afxMooringData(*orig_db, true); + orig_db->performSubstitutions(mMooring_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_ParticleEmitter.cpp b/Engine/source/afx/ea/afxEA_ParticleEmitter.cpp index 7f289b893..18835e1bc 100644 --- a/Engine/source/afx/ea/afxEA_ParticleEmitter.cpp +++ b/Engine/source/afx/ea/afxEA_ParticleEmitter.cpp @@ -84,28 +84,28 @@ bool afxEA_ParticleEmitter::ea_start() { afxParticleEmitterVector* pe = new afxParticleEmitterVector(); pe->onNewDataBlock(afx_emitter_db, false); - pe->setAFXOwner(choreographer); + pe->setAFXOwner(mChoreographer); emitter = pe; } else if (dynamic_cast(emitter_data)) { afxParticleEmitterCone* pe = new afxParticleEmitterCone(); pe->onNewDataBlock(afx_emitter_db, false); - pe->setAFXOwner(choreographer); + pe->setAFXOwner(mChoreographer); emitter = pe; } else if (dynamic_cast(emitter_data)) { afxParticleEmitterPath* pe = new afxParticleEmitterPath(); pe->onNewDataBlock(afx_emitter_db, false); - pe->setAFXOwner(choreographer); + pe->setAFXOwner(mChoreographer); emitter = pe; } else if (dynamic_cast(emitter_data)) { afxParticleEmitterDisc* pe = new afxParticleEmitterDisc(); pe->onNewDataBlock(afx_emitter_db, false); - pe->setAFXOwner(choreographer); + pe->setAFXOwner(mChoreographer); emitter = pe; } } @@ -120,7 +120,7 @@ bool afxEA_ParticleEmitter::ea_start() // here we find or create any required particle-pools if (emitter_data->pool_datablock) { - afxParticlePool* pool = choreographer->findParticlePool(emitter_data->pool_datablock, emitter_data->pool_index); + afxParticlePool* pool = mChoreographer->findParticlePool(emitter_data->pool_datablock, emitter_data->pool_index); if (!pool) { afxParticlePoolData* pool_data = emitter_data->pool_datablock; @@ -129,7 +129,7 @@ bool afxEA_ParticleEmitter::ea_start() // clone the datablock and perform substitutions afxParticlePoolData* orig_db = pool_data; pool_data = new afxParticlePoolData(*orig_db, true); - orig_db->performSubstitutions(pool_data, choreographer, group_index); + orig_db->performSubstitutions(pool_data, mChoreographer, mGroup_index); } pool = new afxParticlePool(); @@ -143,8 +143,8 @@ bool afxEA_ParticleEmitter::ea_start() } if (pool) { - pool->setChoreographer(choreographer); - choreographer->registerParticlePool(pool); + pool->setChoreographer(mChoreographer); + mChoreographer->registerParticlePool(pool); } } if (pool) @@ -160,12 +160,12 @@ bool afxEA_ParticleEmitter::ea_start() return false; } - if (datablock->forced_bbox.isValidBox()) + if (mDatablock->forced_bbox.isValidBox()) { do_bbox_update = true; } - emitter->setSortPriority(datablock->sort_priority); + emitter->setSortPriority(mDatablock->sort_priority); deleteNotify(emitter); return true; @@ -173,26 +173,26 @@ bool afxEA_ParticleEmitter::ea_start() bool afxEA_ParticleEmitter::ea_update(F32 dt) { - if (emitter && in_scope) + if (emitter && mIn_scope) { if (do_bbox_update) { Box3F bbox = emitter->getObjBox(); - bbox.minExtents = updated_pos + datablock->forced_bbox.minExtents; - bbox.maxExtents = updated_pos + datablock->forced_bbox.maxExtents; + bbox.minExtents = mUpdated_pos + mDatablock->forced_bbox.minExtents; + bbox.maxExtents = mUpdated_pos + mDatablock->forced_bbox.maxExtents; emitter->setForcedObjBox(bbox); emitter->setTransform(emitter->getTransform()); - if (!datablock->update_forced_bbox) + if (!mDatablock->update_forced_bbox) do_bbox_update = false; } - if (do_fades) - emitter->setFadeAmount(fade_value); + if (mDo_fades) + emitter->setFadeAmount(mFade_value); - emitter->emitParticlesExt(updated_xfm, updated_pos, Point3F(0.0,0.0,0.0), (U32)(dt*1000)); + emitter->emitParticlesExt(mUpdated_xfm, mUpdated_pos, Point3F(0.0,0.0,0.0), (U32)(dt*1000)); } return true; @@ -209,7 +209,7 @@ void afxEA_ParticleEmitter::ea_finish(bool was_stopped) // note - fully faded particles are not always // invisible, so they are still kept alive and // deleted via deleteWhenEmpty(). - if (ew_timing.fade_out_time > 0.0f) + if (mEW_timing.fade_out_time > 0.0f) emitter->setFadeAmount(0.0f); if (dynamic_cast(emitter)) ((afxParticleEmitter*)emitter)->setAFXOwner(0); @@ -240,32 +240,32 @@ void afxEA_ParticleEmitter::do_runtime_substitutions() { afxParticleEmitterVectorData* orig_db = (afxParticleEmitterVectorData*)emitter_data; emitter_data = new afxParticleEmitterVectorData(*orig_db, true); - orig_db->performSubstitutions(emitter_data, choreographer, group_index); + orig_db->performSubstitutions(emitter_data, mChoreographer, mGroup_index); } else if (dynamic_cast(emitter_data)) { afxParticleEmitterConeData* orig_db = (afxParticleEmitterConeData*)emitter_data; emitter_data = new afxParticleEmitterConeData(*orig_db, true); - orig_db->performSubstitutions(emitter_data, choreographer, group_index); + orig_db->performSubstitutions(emitter_data, mChoreographer, mGroup_index); } else if (dynamic_cast(emitter_data)) { afxParticleEmitterPathData* orig_db = (afxParticleEmitterPathData*)emitter_data; emitter_data = new afxParticleEmitterPathData(*orig_db, true); - orig_db->performSubstitutions(emitter_data, choreographer, group_index); + orig_db->performSubstitutions(emitter_data, mChoreographer, mGroup_index); } else if (dynamic_cast(emitter_data)) { afxParticleEmitterDiscData* orig_db = (afxParticleEmitterDiscData*)emitter_data; emitter_data = new afxParticleEmitterDiscData(*orig_db, true); - orig_db->performSubstitutions(emitter_data, choreographer, group_index); + orig_db->performSubstitutions(emitter_data, mChoreographer, mGroup_index); } } else { ParticleEmitterData* orig_db = emitter_data; emitter_data = new ParticleEmitterData(*orig_db, true); - orig_db->performSubstitutions(emitter_data, choreographer, group_index); + orig_db->performSubstitutions(emitter_data, mChoreographer, mGroup_index); } if (clone_particles) @@ -277,7 +277,7 @@ void afxEA_ParticleEmitter::do_runtime_substitutions() // clone the datablock and perform substitutions ParticleData* orig_db = emitter_data->particleDataBlocks[i]; emitter_data->particleDataBlocks[i] = new ParticleData(*orig_db, true); - orig_db->performSubstitutions(emitter_data->particleDataBlocks[i], choreographer, group_index); + orig_db->performSubstitutions(emitter_data->particleDataBlocks[i], mChoreographer, mGroup_index); } } } diff --git a/Engine/source/afx/ea/afxEA_PhraseEffect.cpp b/Engine/source/afx/ea/afxEA_PhraseEffect.cpp index e253ab1ee..1e14d2c6a 100644 --- a/Engine/source/afx/ea/afxEA_PhraseEffect.cpp +++ b/Engine/source/afx/ea/afxEA_PhraseEffect.cpp @@ -137,7 +137,7 @@ void afxEA_PhraseEffect::grab_player_triggers(U32& trigger_mask) bool afxEA_PhraseEffect::ea_update(F32 dt) { - if (fade_value >= 1.0f) + if (mFade_value >= 1.0f) { // // Choreographer Triggers: @@ -145,7 +145,7 @@ bool afxEA_PhraseEffect::ea_update(F32 dt) // They must be set explicitly by calls to afxChoreographer // console-methods, setTriggerBit(), or clearTriggerBit(). // - U32 trigger_mask = (phrase_fx_data->no_choreographer_trigs) ? 0 : choreographer->getTriggerMask(); + U32 trigger_mask = (phrase_fx_data->no_choreographer_trigs) ? 0 : mChoreographer->getTriggerMask(); // // Constraint Triggers: @@ -191,7 +191,7 @@ bool afxEA_PhraseEffect::ea_update(F32 dt) { for (S32 i = 0; i < active_phrases->size(); i++) { - (*active_phrases)[i]->stop(life_elapsed); + (*active_phrases)[i]->stop(mLife_elapsed); } } } @@ -240,7 +240,7 @@ void afxEA_PhraseEffect::ea_finish(bool was_stopped) { for (S32 i = 0; i < active_phrases->size(); i++) { - (*active_phrases)[i]->stop(life_elapsed); + (*active_phrases)[i]->stop(mLife_elapsed); } } @@ -252,7 +252,7 @@ void afxEA_PhraseEffect::do_runtime_substitutions() // clone the datablock and perform substitutions afxPhraseEffectData* orig_db = phrase_fx_data; phrase_fx_data = new afxPhraseEffectData(*orig_db, true); - orig_db->performSubstitutions(phrase_fx_data, choreographer, group_index); + orig_db->performSubstitutions(phrase_fx_data, mChoreographer, mGroup_index); } } @@ -260,8 +260,8 @@ void afxEA_PhraseEffect::trigger_new_phrase() { //afxPhrase* phrase = new afxPhrase(choreographer->isServerObject(), /*willStop=*/false); bool will_stop = phrase_fx_data->phrase_type == afxPhraseEffectData::PHRASE_CONTINUOUS; - afxPhrase* phrase = new afxPhrase(choreographer->isServerObject(), will_stop); - phrase->init(phrase_fx_data->fx_list, datablock->ewd_timing.lifetime, choreographer, time_factor, phrase_fx_data->n_loops, group_index); + afxPhrase* phrase = new afxPhrase(mChoreographer->isServerObject(), will_stop); + phrase->init(phrase_fx_data->fx_list, mDatablock->ewd_timing.lifetime, mChoreographer, mTime_factor, phrase_fx_data->n_loops, mGroup_index); phrase->start(0, 0); if (phrase->isEmpty()) { @@ -272,10 +272,10 @@ void afxEA_PhraseEffect::trigger_new_phrase() if (phrase_fx_data->on_trig_cmd != ST_NULLSTRING) { char obj_str[32]; - dStrcpy(obj_str, Con::getIntArg(choreographer->getId()), 32); + dStrcpy(obj_str, Con::getIntArg(mChoreographer->getId()), 32); char index_str[32]; - dStrcpy(index_str, Con::getIntArg(group_index), 32); + dStrcpy(index_str, Con::getIntArg(mGroup_index), 32); char buffer[1024]; char* b = buffer; @@ -331,9 +331,9 @@ void afxEA_PhraseEffect::update_active_phrases(F32 dt) for (S32 i = 0; i < active_phrases->size(); i++) { afxPhrase* phrase = (*active_phrases)[i]; - if (phrase->expired(life_elapsed)) - phrase->recycle(life_elapsed); - phrase->update(dt, life_elapsed); + if (phrase->expired(mLife_elapsed)) + phrase->recycle(mLife_elapsed); + phrase->update(dt, mLife_elapsed); } } diff --git a/Engine/source/afx/ea/afxEA_PhysicalZone.cpp b/Engine/source/afx/ea/afxEA_PhysicalZone.cpp index 02012c358..7dbc8062f 100644 --- a/Engine/source/afx/ea/afxEA_PhysicalZone.cpp +++ b/Engine/source/afx/ea/afxEA_PhysicalZone.cpp @@ -127,9 +127,9 @@ bool afxEA_PhysicalZone::ea_update(F32 dt) set_cons_object((pos_constraint) ? pos_constraint->getSceneObject() : 0); } - if (do_fades) - physical_zone->setFadeAmount(fade_value); - physical_zone->setTransform(updated_xfm); + if (mDo_fades) + physical_zone->setFadeAmount(mFade_value); + physical_zone->setTransform(mUpdated_xfm); } return true; @@ -172,7 +172,7 @@ void afxEA_PhysicalZone::do_runtime_substitutions() // clone the datablock and perform substitutions afxPhysicalZoneData* orig_db = zone_data; zone_data = new afxPhysicalZoneData(*orig_db, true); - orig_db->performSubstitutions(zone_data, choreographer, group_index); + orig_db->performSubstitutions(zone_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_PlayerMovement.cpp b/Engine/source/afx/ea/afxEA_PlayerMovement.cpp index 03aac77b2..a563201cc 100644 --- a/Engine/source/afx/ea/afxEA_PlayerMovement.cpp +++ b/Engine/source/afx/ea/afxEA_PlayerMovement.cpp @@ -136,7 +136,7 @@ void afxEA_PlayerMovement::do_runtime_substitutions() // clone the datablock and perform substitutions afxPlayerMovementData* orig_db = movement_data; movement_data = new afxPlayerMovementData(*orig_db, true); - orig_db->performSubstitutions(movement_data, choreographer, group_index); + orig_db->performSubstitutions(movement_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_PlayerPuppet.cpp b/Engine/source/afx/ea/afxEA_PlayerPuppet.cpp index 08c446956..822a69b06 100644 --- a/Engine/source/afx/ea/afxEA_PlayerPuppet.cpp +++ b/Engine/source/afx/ea/afxEA_PlayerPuppet.cpp @@ -80,8 +80,8 @@ bool afxEA_PlayerPuppet::ea_start() do_runtime_substitutions(); - afxConstraintID obj_id = cons_mgr->getConstraintId(mover_data->obj_def); - obj_cons = cons_mgr->getConstraint(obj_id); + afxConstraintID obj_id = mCons_mgr->getConstraintId(mover_data->obj_def); + obj_cons = mCons_mgr->getConstraint(obj_id); Player* player = dynamic_cast((obj_cons) ? obj_cons->getSceneObject() : 0); if (player) @@ -94,9 +94,9 @@ bool afxEA_PlayerPuppet::ea_update(F32 dt) { SceneObject* obj = (obj_cons) ? obj_cons->getSceneObject() : 0; - if (obj && in_scope) + if (obj && mIn_scope) { - obj->setTransform(updated_xfm); + obj->setTransform(mUpdated_xfm); } return true; @@ -138,7 +138,7 @@ void afxEA_PlayerPuppet::do_runtime_substitutions() // clone the datablock and perform substitutions afxPlayerPuppetData* orig_db = mover_data; mover_data = new afxPlayerPuppetData(*orig_db, true); - orig_db->performSubstitutions(mover_data, choreographer, group_index); + orig_db->performSubstitutions(mover_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_PointLight_T3D.cpp b/Engine/source/afx/ea/afxEA_PointLight_T3D.cpp index 3035da8d3..ebbfecc47 100644 --- a/Engine/source/afx/ea/afxEA_PointLight_T3D.cpp +++ b/Engine/source/afx/ea/afxEA_PointLight_T3D.cpp @@ -66,10 +66,10 @@ public: class PointLightProxy : public PointLight { - F32 fade_amt; + F32 mFade_amt; public: - PointLightProxy() { fade_amt = 1.0f; } + PointLightProxy() { mFade_amt = 1.0f; } void force_ghost() { @@ -79,7 +79,7 @@ public: void setFadeAmount(F32 fade_amt) { - this->fade_amt = fade_amt; + mFade_amt = fade_amt; mLight->setBrightness(mBrightness*fade_amt); } @@ -125,10 +125,10 @@ public: void submitLights(LightManager* lm, bool staticLighting) { - if (mAnimState.active && mAnimationData && fade_amt < 1.0f) + if (mAnimState.active && mAnimationData && mFade_amt < 1.0f) { F32 mBrightness_save = mBrightness; - mBrightness *= fade_amt; + mBrightness *= mFade_amt; PointLight::submitLights(lm, staticLighting); mBrightness = mBrightness_save; return; @@ -203,12 +203,12 @@ bool afxEA_T3DPointLight::ea_update(F32 dt) light->setConstraintObject(cons_obj); #endif - light->setLiveColor(updated_color); + light->setLiveColor(mUpdated_color); - if (do_fades) - light->setFadeAmount(fade_value*updated_scale.x); + if (mDo_fades) + light->setFadeAmount(mFade_value*mUpdated_scale.x); - light->updateTransform(updated_xfm); + light->updateTransform(mUpdated_xfm); // scale should not be updated this way. It messes up the culling. //light->setScale(updated_scale); @@ -254,7 +254,7 @@ void afxEA_T3DPointLight::do_runtime_substitutions() // clone the datablock and perform substitutions afxT3DPointLightData* orig_db = light_data; light_data = new afxT3DPointLightData(*orig_db, true); - orig_db->performSubstitutions(light_data, choreographer, group_index); + orig_db->performSubstitutions(light_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_Projectile.cpp b/Engine/source/afx/ea/afxEA_Projectile.cpp index 104d5abb2..0f26d79b3 100644 --- a/Engine/source/afx/ea/afxEA_Projectile.cpp +++ b/Engine/source/afx/ea/afxEA_Projectile.cpp @@ -92,7 +92,7 @@ afxEA_Projectile::~afxEA_Projectile() bool afxEA_Projectile::isDone() { - return (datablock->use_as_cons_obj || datablock->use_ghost_as_cons_obj) ? projectile_done : impacted; + return (mDatablock->use_as_cons_obj || mDatablock->use_ghost_as_cons_obj) ? projectile_done : impacted; } void afxEA_Projectile::ea_set_datablock(SimDataBlock* db) @@ -117,8 +117,8 @@ bool afxEA_Projectile::ea_start() } else { - if (datablock->use_ghost_as_cons_obj && datablock->effect_name != ST_NULLSTRING) - projectile = new afxProjectile(afx_projectile_data->networking, choreographer->getChoreographerId(), datablock->effect_name); + if (mDatablock->use_ghost_as_cons_obj && mDatablock->effect_name != ST_NULLSTRING) + projectile = new afxProjectile(afx_projectile_data->networking, mChoreographer->getChoreographerId(), mDatablock->effect_name); else projectile = new afxProjectile(afx_projectile_data->networking, 0, ST_NULLSTRING); projectile->ignoreSourceTimeout = afx_projectile_data->ignore_src_timeout; @@ -127,8 +127,8 @@ bool afxEA_Projectile::ea_start() projectile->dynamicCollisionMask = afx_projectile_data->dynamicCollisionMask; projectile->staticCollisionMask = afx_projectile_data->staticCollisionMask; } - afxConstraintID launch_pos_id = cons_mgr->getConstraintId(afx_projectile_data->launch_pos_def); - launch_cons = cons_mgr->getConstraint(launch_pos_id); + afxConstraintID launch_pos_id = mCons_mgr->getConstraintId(afx_projectile_data->launch_pos_def); + launch_cons = mCons_mgr->getConstraint(launch_pos_id); launch_dir_bias = afx_projectile_data->launch_dir_bias; } @@ -141,7 +141,7 @@ bool afxEA_Projectile::ea_update(F32 dt) { if (!launched && projectile) { - if (in_scope) + if (mIn_scope) { afxConstraint* pos_cons = getPosConstraint(); ShapeBase* src_obj = (pos_cons) ? (dynamic_cast(pos_cons->getSceneObject())) : 0; @@ -155,19 +155,19 @@ bool afxEA_Projectile::ea_update(F32 dt) { case afxProjectileData::OrientConstraint: dir_vec.set(0,0,1); - updated_xfm.mulV(dir_vec); + mUpdated_xfm.mulV(dir_vec); break; case afxProjectileData::LaunchDirField: dir_vec.set(0,0,1); break; case afxProjectileData::TowardPos2Constraint: default: - dir_vec = updated_aim - updated_pos; + dir_vec = mUpdated_aim - mUpdated_pos; break; } } else - dir_vec = updated_aim - updated_pos; + dir_vec = mUpdated_aim - mUpdated_pos; dir_vec.normalizeSafe(); if (!launch_dir_bias.isZero()) @@ -184,7 +184,7 @@ bool afxEA_Projectile::ea_update(F32 dt) projectile->init(launch_pos, dir_vec, (launch_obj) ? launch_obj : src_obj); } else - projectile->init(updated_pos, dir_vec, src_obj); + projectile->init(mUpdated_pos, dir_vec, src_obj); if (!projectile->registerObject()) { @@ -197,7 +197,7 @@ bool afxEA_Projectile::ea_update(F32 dt) deleteNotify(projectile); if (projectile) - projectile->setDataField(StringTable->insert("afxOwner"), 0, choreographer->getIdString()); + projectile->setDataField(StringTable->insert("afxOwner"), 0, mChoreographer->getIdString()); } launched = true; @@ -205,10 +205,10 @@ bool afxEA_Projectile::ea_update(F32 dt) if (launched && projectile) { - if (in_scope) + if (mIn_scope) { - updated_xfm = projectile->getRenderTransform(); - updated_xfm.getColumn(3, &updated_pos); + mUpdated_xfm = projectile->getRenderTransform(); + mUpdated_xfm.getColumn(3, &mUpdated_pos); } } @@ -247,7 +247,7 @@ void afxEA_Projectile::do_runtime_substitutions() afxProjectileData* orig_db = (afxProjectileData*)projectile_data; afx_projectile_data = new afxProjectileData(*orig_db, true); projectile_data = afx_projectile_data; - orig_db->performSubstitutions(projectile_data, choreographer, group_index); + orig_db->performSubstitutions(projectile_data, mChoreographer, mGroup_index); } else { @@ -255,7 +255,7 @@ void afxEA_Projectile::do_runtime_substitutions() ProjectileData* orig_db = projectile_data; afx_projectile_data = 0; projectile_data = new ProjectileData(*orig_db, true); - orig_db->performSubstitutions(projectile_data, choreographer, group_index); + orig_db->performSubstitutions(projectile_data, mChoreographer, mGroup_index); } } } diff --git a/Engine/source/afx/ea/afxEA_ScriptEvent.cpp b/Engine/source/afx/ea/afxEA_ScriptEvent.cpp index ca5de9966..a80c1b8d2 100644 --- a/Engine/source/afx/ea/afxEA_ScriptEvent.cpp +++ b/Engine/source/afx/ea/afxEA_ScriptEvent.cpp @@ -91,10 +91,10 @@ bool afxEA_ScriptEvent::ea_start() bool afxEA_ScriptEvent::ea_update(F32 dt) { - if (!ran_script && choreographer != NULL) + if (!ran_script && mChoreographer != NULL) { afxConstraint* pos_constraint = getPosConstraint(); - choreographer->executeScriptEvent(script_data->method_name, pos_constraint, updated_xfm, + mChoreographer->executeScriptEvent(script_data->method_name, pos_constraint, mUpdated_xfm, script_data->script_data); ran_script = true; } @@ -115,7 +115,7 @@ void afxEA_ScriptEvent::do_runtime_substitutions() // clone the datablock and perform substitutions afxScriptEventData* orig_db = script_data; script_data = new afxScriptEventData(*orig_db, true); - orig_db->performSubstitutions(script_data, choreographer, group_index); + orig_db->performSubstitutions(script_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_Sound.cpp b/Engine/source/afx/ea/afxEA_Sound.cpp index 3b7f69a88..335800d84 100644 --- a/Engine/source/afx/ea/afxEA_Sound.cpp +++ b/Engine/source/afx/ea/afxEA_Sound.cpp @@ -108,15 +108,15 @@ bool afxEA_Sound::ea_update(F32 dt) { if (!sound_handle) { - sound_handle = SFX->createSource(sound_prof, &updated_xfm, 0); + sound_handle = SFX->createSource(sound_prof, &mUpdated_xfm, 0); if (sound_handle) sound_handle->play(); } if (sound_handle) { - sound_handle->setTransform(updated_xfm); - sound_handle->setVolume((in_scope) ? updated_scale.x*fade_value : 0.0f); + sound_handle->setTransform(mUpdated_xfm); + sound_handle->setVolume((mIn_scope) ? mUpdated_scale.x*mFade_value : 0.0f); deleteNotify(sound_handle); } @@ -134,7 +134,7 @@ void afxEA_Sound::ea_finish(bool was_stopped) void afxEA_Sound::do_runtime_substitutions() { - sound_prof = sound_prof->cloneAndPerformSubstitutions(choreographer, group_index); + sound_prof = sound_prof->cloneAndPerformSubstitutions(mChoreographer, mGroup_index); sound_desc = sound_prof->getDescription(); } @@ -150,7 +150,7 @@ void afxEA_Sound::onDeleteNotify(SimObject* obj) class afxEA_SoundDesc : public afxEffectAdapterDesc, public afxEffectDefs { - static afxEA_SoundDesc desc; + static afxEA_SoundDesc mDesc; public: virtual bool testEffectType(const SimDataBlock*) const; @@ -162,7 +162,7 @@ public: virtual afxEffectWrapper* create() const { return new afxEA_Sound; } }; -afxEA_SoundDesc afxEA_SoundDesc::desc; +afxEA_SoundDesc afxEA_SoundDesc::mDesc; bool afxEA_SoundDesc::testEffectType(const SimDataBlock* db) const { diff --git a/Engine/source/afx/ea/afxEA_SpotLight_T3D.cpp b/Engine/source/afx/ea/afxEA_SpotLight_T3D.cpp index eebab60c8..fac4d4ff0 100644 --- a/Engine/source/afx/ea/afxEA_SpotLight_T3D.cpp +++ b/Engine/source/afx/ea/afxEA_SpotLight_T3D.cpp @@ -66,10 +66,10 @@ public: class SpotLightProxy : public SpotLight { - F32 fade_amt; + F32 mFade_amt; public: - SpotLightProxy() { fade_amt = 1.0f; } + SpotLightProxy() { mFade_amt = 1.0f; } void force_ghost() { @@ -79,7 +79,7 @@ public: void setFadeAmount(F32 fade_amt) { - this->fade_amt = fade_amt; + mFade_amt = fade_amt; mLight->setBrightness(mBrightness*fade_amt); } @@ -130,10 +130,10 @@ public: void submitLights(LightManager* lm, bool staticLighting) { - if (mAnimState.active && mAnimationData && fade_amt < 1.0f) + if (mAnimState.active && mAnimationData && mFade_amt < 1.0f) { F32 mBrightness_save = mBrightness; - mBrightness *= fade_amt; + mBrightness *= mFade_amt; SpotLight::submitLights(lm, staticLighting); mBrightness = mBrightness_save; return; @@ -207,12 +207,12 @@ bool afxEA_T3DSpotLight::ea_update(F32 dt) light->setConstraintObject(cons_obj); #endif - light->setLiveColor(updated_color); + light->setLiveColor(mUpdated_color); - if (do_fades) - light->setFadeAmount(fade_value); + if (mDo_fades) + light->setFadeAmount(mFade_value); - light->updateTransform(updated_xfm); + light->updateTransform(mUpdated_xfm); // scale should not be updated this way. It messes up the culling. //light->setScale(updated_scale); @@ -258,7 +258,7 @@ void afxEA_T3DSpotLight::do_runtime_substitutions() // clone the datablock and perform substitutions afxT3DSpotLightData* orig_db = light_data; light_data = new afxT3DSpotLightData(*orig_db, true); - orig_db->performSubstitutions(light_data, choreographer, group_index); + orig_db->performSubstitutions(light_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_StaticShape.cpp b/Engine/source/afx/ea/afxEA_StaticShape.cpp index 7f0b35351..20e276335 100644 --- a/Engine/source/afx/ea/afxEA_StaticShape.cpp +++ b/Engine/source/afx/ea/afxEA_StaticShape.cpp @@ -97,7 +97,7 @@ bool afxEA_StaticShape::ea_start() do_runtime_substitutions(); // fades are handled using startFade() calls. - do_fades = false; + mDo_fades = false; return true; } @@ -108,8 +108,8 @@ bool afxEA_StaticShape::ea_update(F32 dt) { // create and register effect static_shape = new afxStaticShape(); - if (datablock->use_ghost_as_cons_obj && datablock->effect_name != ST_NULLSTRING) - static_shape->init(choreographer->getChoreographerId(), datablock->effect_name); + if (mDatablock->use_ghost_as_cons_obj && mDatablock->effect_name != ST_NULLSTRING) + static_shape->init(mChoreographer->getChoreographerId(), mDatablock->effect_name); static_shape->onNewDataBlock(shape_data, false); if (!static_shape->registerObject()) @@ -122,26 +122,26 @@ bool afxEA_StaticShape::ea_update(F32 dt) deleteNotify(static_shape); registerForCleanup(static_shape); - if (ew_timing.fade_in_time > 0.0f) - static_shape->startFade(ew_timing.fade_in_time, 0, false); + if (mEW_timing.fade_in_time > 0.0f) + static_shape->startFade(mEW_timing.fade_in_time, 0, false); } if (static_shape) { - if (!fade_out_started && elapsed > fade_out_start) + if (!fade_out_started && mElapsed > mFade_out_start) { if (!do_spawn) { - if (ew_timing.fade_out_time > 0.0f) - static_shape->startFade(ew_timing.fade_out_time, 0, true); + if (mEW_timing.fade_out_time > 0.0f) + static_shape->startFade(mEW_timing.fade_out_time, 0, true); } fade_out_started = true; } - if (in_scope) + if (mIn_scope) { - static_shape->setTransform(updated_xfm); - static_shape->setScale(updated_scale); + static_shape->setTransform(mUpdated_xfm); + static_shape->setScale(mUpdated_scale); } } @@ -155,7 +155,7 @@ void afxEA_StaticShape::ea_finish(bool was_stopped) if (do_spawn) { - Con::executef(shape_data, "onSpawn", static_shape->getIdString(), datablock->effect_name); + Con::executef(shape_data, "onSpawn", static_shape->getIdString(), mDatablock->effect_name); clearNotify(static_shape); } else @@ -204,13 +204,13 @@ void afxEA_StaticShape::do_runtime_substitutions() { afxStaticShapeData* orig_db = (afxStaticShapeData*)shape_data; shape_data = new afxStaticShapeData(*orig_db, true); - orig_db->performSubstitutions(shape_data, choreographer, group_index); + orig_db->performSubstitutions(shape_data, mChoreographer, mGroup_index); } else { StaticShapeData* orig_db = shape_data; shape_data = new StaticShapeData(*orig_db, true); - orig_db->performSubstitutions(shape_data, choreographer, group_index); + orig_db->performSubstitutions(shape_data, mChoreographer, mGroup_index); } } } diff --git a/Engine/source/afx/ea/afxEA_Zodiac.cpp b/Engine/source/afx/ea/afxEA_Zodiac.cpp index d5fb5dd9c..9e76f50ad 100644 --- a/Engine/source/afx/ea/afxEA_Zodiac.cpp +++ b/Engine/source/afx/ea/afxEA_Zodiac.cpp @@ -108,16 +108,16 @@ F32 afxEA_Zodiac::calc_facing_angle() inline F32 afxEA_Zodiac::calc_terrain_alt_bias() { - if (terrain_altitude >= zode_data->altitude_max) + if (mTerrain_altitude >= zode_data->altitude_max) return 0.0f; - return 1.0f - (terrain_altitude - zode_data->altitude_falloff)/altitude_falloff_range; + return 1.0f - (mTerrain_altitude - zode_data->altitude_falloff)/altitude_falloff_range; } inline F32 afxEA_Zodiac::calc_interior_alt_bias() { - if (interior_altitude >= zode_data->altitude_max) + if (mInterior_altitude >= zode_data->altitude_max) return 0.0f; - return 1.0f - (interior_altitude - zode_data->altitude_falloff)/altitude_falloff_range; + return 1.0f - (mInterior_altitude - zode_data->altitude_falloff)/altitude_falloff_range; } afxEA_Zodiac::afxEA_Zodiac() @@ -170,13 +170,13 @@ bool afxEA_Zodiac::ea_start() bool afxEA_Zodiac::ea_update(F32 dt) { - if (!in_scope) + if (!mIn_scope) return true; //~~~~~~~~~~~~~~~~~~~~// // Zodiac Color - zode_color = updated_color; + zode_color = mUpdated_color; if (live_color_factor > 0.0) { @@ -190,15 +190,15 @@ bool afxEA_Zodiac::ea_update(F32 dt) //Con::printf("LIVE-COLOR-FACTOR is ZERO"); } - if (do_fades) + if (mDo_fades) { - if (fade_value < 0.01f) + if (mFade_value < 0.01f) return true; // too transparent if (zode_data->blend_flags == afxZodiacDefs::BLEND_SUBTRACTIVE) - zode_color *= fade_value*live_fade_factor; + zode_color *= mFade_value * mLive_fade_factor; else - zode_color.alpha *= fade_value*live_fade_factor; + zode_color.alpha *= mFade_value * mLive_fade_factor; } if (zode_color.alpha < 0.01f) @@ -208,22 +208,22 @@ bool afxEA_Zodiac::ea_update(F32 dt) // Zodiac // scale and grow zode - zode_radius = zode_data->radius_xy*updated_scale.x + life_elapsed*zode_data->growth_rate; + zode_radius = zode_data->radius_xy*mUpdated_scale.x + mLife_elapsed *zode_data->growth_rate; // zode is growing - if (life_elapsed < zode_data->grow_in_time) + if (mLife_elapsed < zode_data->grow_in_time) { - F32 t = life_elapsed/zode_data->grow_in_time; + F32 t = mLife_elapsed /zode_data->grow_in_time; zode_radius = afxEase::eq(t, 0.001f, zode_radius, 0.2f, 0.8f); } // zode is shrinking - else if (full_lifetime - life_elapsed < zode_data->shrink_out_time) + else if (mFull_lifetime - mLife_elapsed < zode_data->shrink_out_time) { - F32 t = (full_lifetime - life_elapsed)/zode_data->shrink_out_time; + F32 t = (mFull_lifetime - mLife_elapsed)/zode_data->shrink_out_time; zode_radius = afxEase::eq(t, 0.001f, zode_radius, 0.0f, 0.9f); } - zode_radius *= live_scale_factor; + zode_radius *= mLive_scale_factor; if (zode_radius < 0.001f) return true; // too small @@ -238,7 +238,7 @@ bool afxEA_Zodiac::ea_update(F32 dt) //~~~~~~~~~~~~~~~~~~~~// // Zodiac Position - zode_pos = updated_pos; + zode_pos = mUpdated_pos; //~~~~~~~~~~~~~~~~~~~~// // Zodiac Rotation @@ -249,7 +249,7 @@ bool afxEA_Zodiac::ea_update(F32 dt) if (orient_constraint) { VectorF shape_vec; - updated_xfm.getColumn(1, &shape_vec); + mUpdated_xfm.getColumn(1, &shape_vec); shape_vec.z = 0.0f; shape_vec.normalize(); F32 pitch, yaw; @@ -258,14 +258,14 @@ bool afxEA_Zodiac::ea_update(F32 dt) } } - zode_angle = zode_data->calcRotationAngle(life_elapsed, datablock->rate_factor/prop_time_factor); + zode_angle = zode_data->calcRotationAngle(mLife_elapsed, mDatablock->rate_factor/ mProp_time_factor); zode_angle = mFmod(zode_angle + zode_angle_offset, 360.0f); //~~~~~~~~~~~~~~~~~~~~// // post zodiac if ((zode_data->zflags & afxZodiacDefs::SHOW_ON_TERRAIN) != 0) { - if (do_altitude_bias && terrain_altitude > zode_data->altitude_falloff) + if (do_altitude_bias && mTerrain_altitude > zode_data->altitude_falloff) { F32 alt_bias = calc_terrain_alt_bias(); if (alt_bias > 0.0f) @@ -287,7 +287,7 @@ bool afxEA_Zodiac::ea_update(F32 dt) if ((zode_data->zflags & afxZodiacDefs::SHOW_ON_INTERIORS) != 0) { - if (do_altitude_bias && interior_altitude > zode_data->altitude_falloff) + if (do_altitude_bias && mInterior_altitude > zode_data->altitude_falloff) { F32 alt_bias = calc_interior_alt_bias(); if (alt_bias > 0.0f) @@ -310,17 +310,17 @@ bool afxEA_Zodiac::ea_update(F32 dt) void afxEA_Zodiac::ea_finish(bool was_stopped) { - if (in_scope && ew_timing.residue_lifetime > 0) + if (mIn_scope && mEW_timing.residue_lifetime > 0) { - if (do_fades) + if (mDo_fades) { - if (fade_value < 0.01f) + if (mFade_value < 0.01f) return; - zode_color.alpha *= fade_value; + zode_color.alpha *= mFade_value; } if ((zode_data->zflags & afxZodiacDefs::SHOW_ON_TERRAIN) != 0) { - if (do_altitude_bias && terrain_altitude > zode_data->altitude_falloff) + if (do_altitude_bias && mTerrain_altitude > zode_data->altitude_falloff) { F32 alt_bias = calc_terrain_alt_bias(); if (alt_bias > 0.0f) @@ -332,20 +332,20 @@ void afxEA_Zodiac::ea_finish(bool was_stopped) if (zode_data->altitude_fades) zode_color.alpha *= alt_bias; became_residue = true; - afxResidueMgr::add_terrain_zodiac(ew_timing.residue_lifetime, ew_timing.residue_fadetime, zode_data, zode_pos, alt_rad, + afxResidueMgr::add_terrain_zodiac(mEW_timing.residue_lifetime, mEW_timing.residue_fadetime, zode_data, zode_pos, alt_rad, alt_clr, zode_angle); } } else { became_residue = true; - afxResidueMgr::add_terrain_zodiac(ew_timing.residue_lifetime, ew_timing.residue_fadetime, zode_data, zode_pos, zode_radius, + afxResidueMgr::add_terrain_zodiac(mEW_timing.residue_lifetime, mEW_timing.residue_fadetime, zode_data, zode_pos, zode_radius, zode_color, zode_angle); } } if ((zode_data->zflags & afxZodiacDefs::SHOW_ON_INTERIORS) != 0) { - if (do_altitude_bias && interior_altitude > zode_data->altitude_falloff) + if (do_altitude_bias && mInterior_altitude > zode_data->altitude_falloff) { F32 alt_bias = calc_interior_alt_bias(); if (alt_bias > 0.0f) @@ -361,7 +361,7 @@ void afxEA_Zodiac::ea_finish(bool was_stopped) if (became_residue) temp_zode = new afxZodiacData(*zode_data, true); became_residue = true; - afxResidueMgr::add_interior_zodiac(ew_timing.residue_lifetime, ew_timing.residue_fadetime, temp_zode, zode_pos, alt_rad, + afxResidueMgr::add_interior_zodiac(mEW_timing.residue_lifetime, mEW_timing.residue_fadetime, temp_zode, zode_pos, alt_rad, zode_vrange, alt_clr, zode_angle); } @@ -372,7 +372,7 @@ void afxEA_Zodiac::ea_finish(bool was_stopped) if (became_residue) temp_zode = new afxZodiacData(*zode_data, true); became_residue = true; - afxResidueMgr::add_interior_zodiac(ew_timing.residue_lifetime, ew_timing.residue_fadetime, temp_zode, zode_pos, zode_radius, + afxResidueMgr::add_interior_zodiac(mEW_timing.residue_lifetime, mEW_timing.residue_fadetime, temp_zode, zode_pos, zode_radius, zode_vrange, zode_color, zode_angle); } } @@ -387,7 +387,7 @@ void afxEA_Zodiac::do_runtime_substitutions() // clone the datablock and perform substitutions afxZodiacData* orig_db = zode_data; zode_data = new afxZodiacData(*orig_db, true); - orig_db->performSubstitutions(zode_data, choreographer, group_index); + orig_db->performSubstitutions(zode_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/ea/afxEA_ZodiacPlane.cpp b/Engine/source/afx/ea/afxEA_ZodiacPlane.cpp index ca4271860..43246f8f1 100644 --- a/Engine/source/afx/ea/afxEA_ZodiacPlane.cpp +++ b/Engine/source/afx/ea/afxEA_ZodiacPlane.cpp @@ -174,42 +174,42 @@ bool afxEA_ZodiacPlane::ea_update(F32 dt) if (pzode) { //LinearColorF zode_color = zode_data->color; - LinearColorF zode_color = updated_color; + LinearColorF zode_color = mUpdated_color; if (live_color_factor > 0.0) zode_color.interpolate(zode_color, live_color, live_color_factor); - if (do_fades) + if (mDo_fades) { if (zode_data->blend_flags == afxZodiacDefs::BLEND_SUBTRACTIVE) - zode_color *= fade_value*live_fade_factor; + zode_color *= mFade_value *mLive_fade_factor; else - zode_color.alpha *= fade_value*live_fade_factor; + zode_color.alpha *= mFade_value * mLive_fade_factor; } // scale and grow zode //F32 zode_radius = zode_data->radius_xy*updated_scale.x + life_elapsed*zode_data->growth_rate; - F32 zode_radius = zode_data->radius_xy + life_elapsed*zode_data->growth_rate; + F32 zode_radius = zode_data->radius_xy + mLife_elapsed *zode_data->growth_rate; // zode is growing - if (life_elapsed < zode_data->grow_in_time) + if (mLife_elapsed < zode_data->grow_in_time) { - F32 t = life_elapsed/zode_data->grow_in_time; + F32 t = mLife_elapsed /zode_data->grow_in_time; zode_radius = afxEase::eq(t, 0.001f, zode_radius, 0.2f, 0.8f); } // zode is shrinking - else if (full_lifetime - life_elapsed < zode_data->shrink_out_time) + else if (mFull_lifetime - mLife_elapsed < zode_data->shrink_out_time) { - F32 t = (full_lifetime - life_elapsed)/zode_data->shrink_out_time; + F32 t = (mFull_lifetime - mLife_elapsed)/zode_data->shrink_out_time; zode_radius = afxEase::eq(t, 0.001f, zode_radius, 0.0f, 0.9f); } - zode_radius *= live_scale_factor; + zode_radius *= mLive_scale_factor; if (zode_data->respect_ori_cons && !zode_data->use_full_xfm) { VectorF shape_vec; - updated_xfm.getColumn(1, &shape_vec); + mUpdated_xfm.getColumn(1, &shape_vec); shape_vec.normalize(); F32 ang; @@ -246,7 +246,7 @@ bool afxEA_ZodiacPlane::ea_update(F32 dt) zode_angle_offset = mRadToDeg(ang); } - F32 zode_angle = zode_data->calcRotationAngle(life_elapsed, datablock->rate_factor/prop_time_factor); + F32 zode_angle = zode_data->calcRotationAngle(mLife_elapsed, mDatablock->rate_factor/ mProp_time_factor); zode_angle = mFmod(zode_angle + zode_angle_offset, 360.0f); aa_rot.angle = mDegToRad(zode_angle); @@ -258,13 +258,13 @@ bool afxEA_ZodiacPlane::ea_update(F32 dt) pzode->setRadius(zode_radius); if (zode_data->use_full_xfm) { - updated_xfm.mul(spin_xfm); - pzode->setTransform(updated_xfm); + mUpdated_xfm.mul(spin_xfm); + pzode->setTransform(mUpdated_xfm); } else pzode->setTransform(spin_xfm); - pzode->setPosition(updated_pos); - pzode->setScale(updated_scale); + pzode->setPosition(mUpdated_pos); + pzode->setScale(mUpdated_scale); } return true; @@ -307,7 +307,7 @@ void afxEA_ZodiacPlane::do_runtime_substitutions() // clone the datablock and perform substitutions afxZodiacPlaneData* orig_db = zode_data; zode_data = new afxZodiacPlaneData(*orig_db, true); - orig_db->performSubstitutions(zode_data, choreographer, group_index); + orig_db->performSubstitutions(zode_data, mChoreographer, mGroup_index); } } diff --git a/Engine/source/afx/forces/afxEA_Force.cpp b/Engine/source/afx/forces/afxEA_Force.cpp index 7ec2332f1..4f2ac1273 100644 --- a/Engine/source/afx/forces/afxEA_Force.cpp +++ b/Engine/source/afx/forces/afxEA_Force.cpp @@ -95,7 +95,7 @@ bool afxEA_Force::ea_start() do_runtime_substitutions(); - force_set_mgr = choreographer->getForceSetMgr(); + force_set_mgr = mChoreographer->getForceSetMgr(); return true; } @@ -109,7 +109,7 @@ bool afxEA_Force::ea_update(F32 dt) { delete force; force = 0; - Con::errorf(ConsoleLogEntry::General, "Force effect failed to instantiate. (%s)", datablock->getName()); + Con::errorf(ConsoleLogEntry::General, "Force effect failed to instantiate. (%s)", mDatablock->getName()); return false; } force->onNewDataBlock(force_data, false); @@ -123,8 +123,8 @@ bool afxEA_Force::ea_update(F32 dt) if (force) // && in_scope) { - if (do_fades) - force->setFadeAmount(fade_value); + if (mDo_fades) + force->setFadeAmount(mFade_value); force->update(dt); } @@ -145,7 +145,7 @@ void afxEA_Force::ea_finish(bool was_stopped) void afxEA_Force::do_runtime_substitutions() { - force_data = force_data->cloneAndPerformSubstitutions(choreographer, group_index); + force_data = force_data->cloneAndPerformSubstitutions(mChoreographer, mGroup_index); } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// diff --git a/Engine/source/afx/forces/afxForceSet.cpp b/Engine/source/afx/forces/afxForceSet.cpp index 49658022f..0d650e3b4 100644 --- a/Engine/source/afx/forces/afxForceSet.cpp +++ b/Engine/source/afx/forces/afxForceSet.cpp @@ -32,21 +32,21 @@ afxForceSet::afxForceSet(const char* name) { - this->name = (name) ? StringTable->insert(name) : ST_NULLSTRING; - update_dt = 10.0f; // seems like an ok maximum, force-xmods will probably lower it. - elapsed_dt = 0.0f; - elapsed_ms = 0; - num_updates = 0; - last_num_updates = 0; + mName = (name) ? StringTable->insert(name) : ST_NULLSTRING; + mUpdate_dt = 10.0f; // seems like an ok maximum, force-xmods will probably lower it. + mElapsed_dt = 0.0f; + mElapsed_ms = 0; + mNum_updates = 0; + mLast_num_updates = 0; } void afxForceSet::remove(afxForce* force) { - for (S32 i = 0; i < force_v.size(); i++) + for (S32 i = 0; i < mForce_v.size(); i++) { - if (force_v[i] == force) + if (mForce_v[i] == force) { - force_v.erase(i); + mForce_v.erase(i); return; } } @@ -56,23 +56,23 @@ S32 afxForceSet::updateDT(F32 dt) { U32 now = Platform::getVirtualMilliseconds(); - if (elapsed_ms == now) - return last_num_updates; + if (mElapsed_ms == now) + return mLast_num_updates; - elapsed_ms = now; - elapsed_dt += dt; + mElapsed_ms = now; + mElapsed_dt += dt; - if (elapsed_dt < update_dt) + if (mElapsed_dt < mUpdate_dt) { - last_num_updates = 0; + mLast_num_updates = 0; return 0; } - num_updates = mFloor(elapsed_dt/update_dt); - elapsed_dt -= update_dt*num_updates; - last_num_updates = num_updates; + mNum_updates = mFloor(mElapsed_dt/mUpdate_dt); + mElapsed_dt -= mUpdate_dt*mNum_updates; + mLast_num_updates = mNum_updates; - return num_updates; + return mNum_updates; } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// diff --git a/Engine/source/afx/forces/afxForceSet.h b/Engine/source/afx/forces/afxForceSet.h index 8c42a2dd3..7c0cabc54 100644 --- a/Engine/source/afx/forces/afxForceSet.h +++ b/Engine/source/afx/forces/afxForceSet.h @@ -32,28 +32,28 @@ class afxForce; class afxForceSet { - Vector force_v; - StringTableEntry name; + Vector mForce_v; + StringTableEntry mName; // tick-based updating - F32 update_dt; // constant update interval, in seconds - F32 elapsed_dt; // runtime elapsed delta, in seconds - U32 elapsed_ms; - S32 num_updates; - S32 last_num_updates; + F32 mUpdate_dt; // constant update interval, in seconds + F32 mElapsed_dt; // runtime elapsed delta, in seconds + U32 mElapsed_ms; + S32 mNum_updates; + S32 mLast_num_updates; public: /*C*/ afxForceSet(const char* name=0); - void add(afxForce* force) { force_v.push_back(force); } + void add(afxForce* force) { mForce_v.push_back(force); } void remove(afxForce* force); - S32 count() { return force_v.size(); } - afxForce* getForce(S32 idx) { return force_v[idx]; } - const char* getName() const { return name; } + S32 count() { return mForce_v.size(); } + afxForce* getForce(S32 idx) { return mForce_v[idx]; } + const char* getName() const { return mName; } - void setUpdateDT(F32 update_dt) { this->update_dt = update_dt; } - F32 getUpdateDT() { return update_dt; } + void setUpdateDT(F32 update_dt) { mUpdate_dt = update_dt; } + F32 getUpdateDT() { return mUpdate_dt; } S32 updateDT(F32 dt); }; diff --git a/Engine/source/afx/util/afxPath3D.cpp b/Engine/source/afx/util/afxPath3D.cpp index f37b141d9..5997bdc12 100644 --- a/Engine/source/afx/util/afxPath3D.cpp +++ b/Engine/source/afx/util/afxPath3D.cpp @@ -29,7 +29,7 @@ #include "afx/util/afxPath3D.h" -afxPath3D::afxPath3D() : start_time(0), num_points(0), loop_type(LOOP_CONSTANT) +afxPath3D::afxPath3D() : mStart_time(0), mNum_points(0), mLoop_type(LOOP_CONSTANT) { } @@ -39,88 +39,88 @@ afxPath3D::~afxPath3D() void afxPath3D::sortAll() { - curve.sort(); - curve_parameters.sort(); + mCurve.sort(); + mCurve_parameters.sort(); } void afxPath3D::setStartTime( F32 time ) { - start_time = time; + mStart_time = time; } void afxPath3D::setLoopType( U32 loop_type ) { - this->loop_type = loop_type; + mLoop_type = loop_type; } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// F32 afxPath3D::getEndTime() { - return end_time; + return mEnd_time; } int afxPath3D::getNumPoints() { - return num_points; + return mNum_points; } Point3F afxPath3D::getPointPosition( int index ) { - if (index < 0 || index >= num_points) + if (index < 0 || index >= mNum_points) return Point3F(0.0f, 0.0f, 0.0f); - return curve.getPoint(index); + return mCurve.getPoint(index); } F32 afxPath3D::getPointTime( int index ) { - if (index < 0 || index >= num_points) + if (index < 0 || index >= mNum_points) return 0.0f; - return curve_parameters.getKeyTime(index); + return mCurve_parameters.getKeyTime(index); } F32 afxPath3D::getPointParameter( int index ) { - if (index < 0 || index >= num_points) + if (index < 0 || index >= mNum_points) return 0.0f; - return curve_parameters.getKeyValue(index); + return mCurve_parameters.getKeyValue(index); } Point2F afxPath3D::getParameterSegment( F32 time ) { - return curve_parameters.getSegment(time); + return mCurve_parameters.getSegment(time); } void afxPath3D::setPointPosition( int index, Point3F &p ) { - if (index < 0 || index >= num_points) + if (index < 0 || index >= mNum_points) return; - curve.setPoint(index, p); + mCurve.setPoint(index, p); } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// F32 afxPath3D::calcCurveTime( F32 time ) { - if( time <= start_time ) + if( time <= mStart_time ) return 0.0f; - if( time <= end_time ) - return time-start_time; + if( time <= mEnd_time ) + return time-mStart_time; - switch( loop_type ) + switch( mLoop_type ) { case LOOP_CYCLE : { - return mFmod( time-start_time, end_time-start_time ); + return mFmod( time-mStart_time, mEnd_time-mStart_time ); } case LOOP_OSCILLATE : { - F32 t1 = time-start_time; - F32 t2 = end_time-start_time; + F32 t1 = time- mStart_time; + F32 t2 = mEnd_time - mStart_time; if( (int)(t1/t2) % 2 ) // odd segment return t2 - mFmod( t1, t2 ); @@ -129,26 +129,26 @@ F32 afxPath3D::calcCurveTime( F32 time ) } case LOOP_CONSTANT : default: - return end_time; + return mEnd_time; } } Point3F afxPath3D::evaluateAtTime( F32 time ) { F32 ctime = calcCurveTime( time ); - F32 param = curve_parameters.evaluate( ctime ); - return curve.evaluate(param); + F32 param = mCurve_parameters.evaluate( ctime ); + return mCurve.evaluate(param); } Point3F afxPath3D::evaluateAtTime(F32 t0, F32 t1) { F32 ctime = calcCurveTime(t0); - F32 param = curve_parameters.evaluate( ctime ); - Point3F p0 = curve.evaluate(param); + F32 param = mCurve_parameters.evaluate( ctime ); + Point3F p0 = mCurve.evaluate(param); ctime = calcCurveTime(t1); - param = curve_parameters.evaluate( ctime ); - Point3F p1 = curve.evaluate(param); + param = mCurve_parameters.evaluate( ctime ); + Point3F p1 = mCurve.evaluate(param); return p1-p0; } @@ -156,21 +156,21 @@ Point3F afxPath3D::evaluateAtTime(F32 t0, F32 t1) Point3F afxPath3D::evaluateTangentAtTime( F32 time ) { F32 ctime = calcCurveTime( time ); - F32 param = curve_parameters.evaluate( ctime ); - return curve.evaluateTangent(param); + F32 param = mCurve_parameters.evaluate( ctime ); + return mCurve.evaluateTangent(param); } Point3F afxPath3D::evaluateTangentAtPoint( int index ) { - F32 param = curve_parameters.getKeyValue(index); - return curve.evaluateTangent(param); + F32 param = mCurve_parameters.getKeyValue(index); + return mCurve.evaluateTangent(param); } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// void afxPath3D::buildPath( int num_points, Point3F curve_points[], F32 start_time, F32 end_time ) { - this->num_points = num_points; + mNum_points = num_points; // Add points to path F32 param_inc = 1.0f / (F32)(num_points - 1); @@ -179,10 +179,10 @@ void afxPath3D::buildPath( int num_points, Point3F curve_points[], F32 start_tim { if( i == num_points-1 ) param = 1.0f; - curve.addPoint( param, curve_points[i] ); + mCurve.addPoint( param, curve_points[i] ); } - curve.computeTangents(); + mCurve.computeTangents(); initPathParametersNEW( curve_points, start_time, end_time ); @@ -191,7 +191,7 @@ void afxPath3D::buildPath( int num_points, Point3F curve_points[], F32 start_tim void afxPath3D::buildPath( int num_points, Point3F curve_points[], F32 speed ) { - this->num_points = num_points; + mNum_points = num_points; // Add points to path F32 param_inc = 1.0f / (F32)(num_points - 1); @@ -200,7 +200,7 @@ void afxPath3D::buildPath( int num_points, Point3F curve_points[], F32 speed ) { if( i == num_points-1 ) param = 1.0f; - curve.addPoint( param, curve_points[i] ); + mCurve.addPoint( param, curve_points[i] ); } initPathParameters( curve_points, speed ); @@ -211,7 +211,7 @@ void afxPath3D::buildPath( int num_points, Point3F curve_points[], F32 speed ) void afxPath3D::buildPath( int num_points, Point3F curve_points[], F32 point_times[], F32 time_offset, F32 time_factor ) { - this->num_points = num_points; + mNum_points = num_points; // Add points to path F32 param_inc = 1.0f / (F32)(num_points - 1); @@ -220,20 +220,20 @@ void afxPath3D::buildPath( int num_points, Point3F curve_points[], { if( i == num_points-1 ) param = 1.0f; - curve.addPoint( param, curve_points[i] ); + mCurve.addPoint( param, curve_points[i] ); - curve_parameters.addKey( (point_times[i]+time_offset)*time_factor, param ); + mCurve_parameters.addKey( (point_times[i]+time_offset)*time_factor, param ); } // Set end time - end_time = (point_times[num_points-1]+time_offset)*time_factor; + mEnd_time = (point_times[num_points-1]+time_offset)*time_factor; sortAll(); } void afxPath3D::buildPath( int num_points, Point3F curve_points[], Point2F curve_params[] ) { - this->num_points = num_points; + mNum_points = num_points; // Add points to path F32 param_inc = 1.0f / (F32)(num_points - 1); @@ -242,22 +242,22 @@ void afxPath3D::buildPath( int num_points, Point3F curve_points[], Point2F curve { if( i == num_points-1 ) param = 1.0f; - curve.addPoint( param, curve_points[i] ); + mCurve.addPoint( param, curve_points[i] ); } // for (int i = 0; i < num_points; i++) - curve_parameters.addKey( curve_params[i] ); + mCurve_parameters.addKey( curve_params[i] ); // Set end time - end_time = curve_params[num_points - 1].x; + mEnd_time = curve_params[num_points - 1].x; sortAll(); } void afxPath3D::reBuildPath() { - curve.computeTangents(); + mCurve.computeTangents(); sortAll(); } @@ -265,7 +265,7 @@ void afxPath3D::initPathParameters( Point3F curve_points[], F32 speed ) { // Compute the time for each point dependent on the speed of the character and the // distance it must travel (approximately!) - int num_segments = num_points - 1; + int num_segments = mNum_points - 1; F32 *point_distances = new F32[num_segments]; for( int i = 0; i < num_segments; i++ ) { @@ -283,14 +283,14 @@ void afxPath3D::initPathParameters( Point3F curve_points[], F32 speed ) last_time = times[i]; } - curve_parameters.addKey( 0, 0.0f );//start_time, 0.0f ); - F32 param_inc = 1.0f / (F32)(num_points - 1); + mCurve_parameters.addKey( 0, 0.0f );//start_time, 0.0f ); + F32 param_inc = 1.0f / (F32)(mNum_points - 1); F32 param = 0.0f + param_inc; for( int i = 0; i < num_segments; i++, param += param_inc ) - curve_parameters.addKey( times[i], param ); + mCurve_parameters.addKey( times[i], param ); // Set end time - end_time = times[num_segments-1]; + mEnd_time = times[num_segments-1]; if (point_distances) delete [] point_distances; @@ -300,7 +300,7 @@ void afxPath3D::initPathParameters( Point3F curve_points[], F32 speed ) void afxPath3D::initPathParametersNEW( Point3F curve_points[], F32 start_time, F32 end_time ) { - int num_segments = num_points - 1; + int num_segments = mNum_points - 1; F32 *point_distances = new F32[num_segments]; F32 total_distance = 0.0f; for( int i = 0; i < num_segments; i++ ) @@ -315,19 +315,19 @@ void afxPath3D::initPathParametersNEW( Point3F curve_points[], F32 start_time, F F32 duration = end_time - start_time; F32 time = 0.0f; //start_time; - curve_parameters.addKey( time, 0.0f ); - F32 param_inc = 1.0f / (F32)(num_points - 1); + mCurve_parameters.addKey( time, 0.0f ); + F32 param_inc = 1.0f / (F32)(mNum_points - 1); F32 param = 0.0f + param_inc; for( int i=0; i < num_segments; i++, param += param_inc ) { time += (point_distances[i]/total_distance) * duration; - curve_parameters.addKey( time, param ); + mCurve_parameters.addKey( time, param ); } // Set end time ???? //end_time = time; - this->start_time = start_time; - this->end_time = end_time; + mStart_time = start_time; + mEnd_time = end_time; if (point_distances) delete [] point_distances; @@ -336,7 +336,7 @@ void afxPath3D::initPathParametersNEW( Point3F curve_points[], F32 start_time, F void afxPath3D::print() { // curve.print(); - curve_parameters.print(); + mCurve_parameters.print(); } //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~// diff --git a/Engine/source/afx/util/afxPath3D.h b/Engine/source/afx/util/afxPath3D.h index 77d2e2ad2..9c01767b6 100644 --- a/Engine/source/afx/util/afxPath3D.h +++ b/Engine/source/afx/util/afxPath3D.h @@ -37,13 +37,13 @@ class afxPath3D : public EngineObject { private: // Path-related data - afxCurve3D curve; - afxAnimCurve curve_parameters; - int num_points; + afxCurve3D mCurve; + afxAnimCurve mCurve_parameters; + int mNum_points; // Time data - F32 start_time; - F32 end_time; + F32 mStart_time; + F32 mEnd_time; public: /*C*/ afxPath3D( ); @@ -83,7 +83,7 @@ public: LOOP_OSCILLATE }; - U32 loop_type; + U32 mLoop_type; void setLoopType(U32); private: diff --git a/Engine/source/afx/xm/afxXM_AltitudeConform.cpp b/Engine/source/afx/xm/afxXM_AltitudeConform.cpp index 02ce4634b..d2be81cc8 100644 --- a/Engine/source/afx/xm/afxXM_AltitudeConform.cpp +++ b/Engine/source/afx/xm/afxXM_AltitudeConform.cpp @@ -60,13 +60,13 @@ class afxXM_AltitudeConform : public afxXM_WeightedBase { typedef afxXM_WeightedBase Parent; - afxXM_AltitudeConformData* db; - SceneContainer* container; - bool do_freeze; - bool is_frozen; - F32 terrain_alt; - F32 interior_alt; - Point3F conformed_pos; + afxXM_AltitudeConformData* mConformData; + SceneContainer* mContainer; + bool mDo_freeze; + bool mIs_frozen; + F32 mTerrain_alt; + F32 mInterior_alt; + Point3F mConformed_pos; public: /*C*/ afxXM_AltitudeConform(afxXM_AltitudeConformData*, afxEffectWrapper*, bool on_server); @@ -157,24 +157,24 @@ afxXM_Base* afxXM_AltitudeConformData::create(afxEffectWrapper* fx, bool on_serv afxXM_AltitudeConform::afxXM_AltitudeConform(afxXM_AltitudeConformData* db, afxEffectWrapper* fxw, bool on_server) : afxXM_WeightedBase(db, fxw) { - this->db = db; - container = (on_server) ? &gServerContainer : &gClientContainer; - do_freeze = db->do_freeze; - is_frozen = false; - terrain_alt = -1.0f; - interior_alt = -1.0f; - conformed_pos.zero(); + mConformData = db; + mContainer = (on_server) ? &gServerContainer : &gClientContainer; + mDo_freeze = db->do_freeze; + mIs_frozen = false; + mTerrain_alt = -1.0f; + mInterior_alt = -1.0f; + mConformed_pos.zero(); } void afxXM_AltitudeConform::updateParams(F32 dt, F32 elapsed, afxXM_Params& params) { - if (is_frozen) + if (mIs_frozen) { - if (terrain_alt >= 0.0f) - fx_wrapper->setTerrainAltitude(terrain_alt); - if (interior_alt >= 0.0f) - fx_wrapper->setInteriorAltitude(interior_alt); - params.pos = conformed_pos; + if (mTerrain_alt >= 0.0f) + fx_wrapper->setTerrainAltitude(mTerrain_alt); + if (mInterior_alt >= 0.0f) + fx_wrapper->setInteriorAltitude(mInterior_alt); + params.pos = mConformed_pos; return; } @@ -185,53 +185,51 @@ void afxXM_AltitudeConform::updateParams(F32 dt, F32 elapsed, afxXM_Params& para // find primary ground Point3F above_pos(params.pos); above_pos.z += 0.1f; Point3F below_pos(params.pos); below_pos.z -= 10000; - hit1 = container->castRay(above_pos, below_pos, db->interior_types | db->terrain_types, &rInfo1); + hit1 = mContainer->castRay(above_pos, below_pos, mConformData->interior_types | mConformData->terrain_types, &rInfo1); // find secondary ground if (hit1 && rInfo1.object) { - hit1_is_interior = ((rInfo1.object->getTypeMask() & db->interior_types) != 0); - U32 mask = (hit1_is_interior) ? db->terrain_types : db->interior_types; - Point3F above_pos(params.pos); above_pos.z += 0.1f; - Point3F below_pos(params.pos); below_pos.z -= 10000; - hit2 = container->castRay(above_pos, below_pos, mask, &rInfo2); + hit1_is_interior = ((rInfo1.object->getTypeMask() & mConformData->interior_types) != 0); + U32 mask = (hit1_is_interior) ? mConformData->terrain_types : mConformData->interior_types; + hit2 = mContainer->castRay(above_pos, below_pos, mask, &rInfo2); } if (hit1) { F32 wt_factor = calc_weight_factor(elapsed); F32 incoming_z = params.pos.z; - F32 ground1_z = rInfo1.point.z + db->height; + F32 ground1_z = rInfo1.point.z + mConformData->height; F32 pos_z = ground1_z + (1.0f - wt_factor)*(incoming_z - ground1_z); if (hit1_is_interior) { - interior_alt = incoming_z - pos_z; - fx_wrapper->setInteriorAltitude(interior_alt); - if (db->do_interiors) + mInterior_alt = incoming_z - pos_z; + fx_wrapper->setInteriorAltitude(mInterior_alt); + if (mConformData->do_interiors) params.pos.z = pos_z; } else { - terrain_alt = incoming_z - pos_z; - fx_wrapper->setTerrainAltitude(terrain_alt); - if (db->do_terrain) + mTerrain_alt = incoming_z - pos_z; + fx_wrapper->setTerrainAltitude(mTerrain_alt); + if (mConformData->do_terrain) params.pos.z = pos_z; } if (hit2) { - F32 ground2_z = rInfo2.point.z + db->height; + F32 ground2_z = rInfo2.point.z + mConformData->height; F32 z2 = ground2_z + (1.0f - wt_factor)*(incoming_z - ground2_z); if (hit1_is_interior) { - terrain_alt = incoming_z - z2; - fx_wrapper->setTerrainAltitude(terrain_alt); + mTerrain_alt = incoming_z - z2; + fx_wrapper->setTerrainAltitude(mTerrain_alt); } else { - interior_alt = incoming_z - z2; - fx_wrapper->setInteriorAltitude(interior_alt); + mInterior_alt = incoming_z - z2; + fx_wrapper->setInteriorAltitude(mInterior_alt); } } @@ -241,19 +239,19 @@ void afxXM_AltitudeConform::updateParams(F32 dt, F32 elapsed, afxXM_Params& para RayInfo rInfo0; Point3F lookup_from_pos(params.pos); lookup_from_pos.z -= 0.1f; Point3F lookup_to_pos(params.pos); lookup_to_pos.z += 10000; - if (container->castRay(lookup_from_pos, lookup_to_pos, TerrainObjectType, &rInfo0)) + if (mContainer->castRay(lookup_from_pos, lookup_to_pos, TerrainObjectType, &rInfo0)) { - F32 ground2_z = rInfo0.point.z + db->height; + F32 ground2_z = rInfo0.point.z + mConformData->height; F32 z2 = ground2_z + (1.0f - wt_factor)*(incoming_z - ground2_z); - terrain_alt = z2 - incoming_z; - fx_wrapper->setTerrainAltitude(terrain_alt); + mTerrain_alt = z2 - incoming_z; + fx_wrapper->setTerrainAltitude(mTerrain_alt); } } - if (do_freeze) + if (mDo_freeze) { - conformed_pos = params.pos; - is_frozen = true; + mConformed_pos = params.pos; + mIs_frozen = true; } } } diff --git a/Engine/source/afx/xm/afxXM_MountedImageNode.cpp b/Engine/source/afx/xm/afxXM_MountedImageNode.cpp index 8f54f2d9d..b4b244011 100644 --- a/Engine/source/afx/xm/afxXM_MountedImageNode.cpp +++ b/Engine/source/afx/xm/afxXM_MountedImageNode.cpp @@ -63,11 +63,11 @@ class afxXM_MountedImageNode : public afxXM_Base { typedef afxXM_Base Parent; - StringTableEntry node_name; - U32 image_slot; - S32 node_ID; - ShapeBase* shape; - afxConstraint* cons; + StringTableEntry mNode_name; + U32 mImage_slot; + S32 mNode_ID; + ShapeBase* mShape; + afxConstraint* mCons; afxConstraint* find_constraint(); @@ -163,11 +163,11 @@ afxXM_Base* afxXM_MountedImageNodeData::create(afxEffectWrapper* fx, bool on_ser afxXM_MountedImageNode::afxXM_MountedImageNode(afxXM_MountedImageNodeData* db, afxEffectWrapper* fxw) : afxXM_Base(db, fxw) { - image_slot = db->image_slot; - node_name = db->node_name; - cons = 0; - node_ID = -1; - shape = 0; + mImage_slot = db->image_slot; + mNode_name = db->node_name; + mCons = 0; + mNode_ID = -1; + mShape = 0; } // find the first constraint with a shape by checking pos @@ -189,41 +189,41 @@ void afxXM_MountedImageNode::start(F32 timestamp) { // constraint won't change over the modifier's // lifetime so we find it here in start(). - cons = find_constraint(); - if (!cons) + mCons = find_constraint(); + if (!mCons) Con::errorf(ConsoleLogEntry::General, "afxXM_MountedImageNode: failed to find a ShapeBase derived constraint source."); } void afxXM_MountedImageNode::updateParams(F32 dt, F32 elapsed, afxXM_Params& params) { - if (!cons) + if (!mCons) return; // validate shape // The shape must be validated in case it gets deleted // of goes out scope. - SceneObject* scene_object = cons->getSceneObject(); - if (scene_object != (SceneObject*)shape) + SceneObject* scene_object = mCons->getSceneObject(); + if (scene_object != (SceneObject*)mShape) { - shape = dynamic_cast(scene_object); - if (shape && node_name != ST_NULLSTRING) + mShape = dynamic_cast(scene_object); + if (mShape && mNode_name != ST_NULLSTRING) { - node_ID = shape->getNodeIndex(image_slot, node_name); - if (node_ID < 0) + mNode_ID = mShape->getNodeIndex(mImage_slot, mNode_name); + if (mNode_ID < 0) { Con::errorf(ConsoleLogEntry::General, "afxXM_MountedImageNode: failed to find nodeName, \"%s\".", - node_name); + mNode_name); } } else - node_ID = -1; + mNode_ID = -1; } - if (shape) + if (mShape) { - shape->getImageTransform(image_slot, node_ID, ¶ms.ori); + mShape->getImageTransform(mImage_slot, mNode_ID, ¶ms.ori); params.pos = params.ori.getPosition(); } } diff --git a/Engine/source/afx/xm/afxXM_WaveColor.cpp b/Engine/source/afx/xm/afxXM_WaveColor.cpp index 851ccfc4d..af823d58f 100644 --- a/Engine/source/afx/xm/afxXM_WaveColor.cpp +++ b/Engine/source/afx/xm/afxXM_WaveColor.cpp @@ -35,10 +35,10 @@ class afxXM_WaveInterp_Color : public afxXM_WaveInterp { protected: - LinearColorF a_set, b_set; - LinearColorF a_var, b_var; - LinearColorF a, b; - bool sync_var; + LinearColorF mA_set, mB_set; + LinearColorF mA_var, mB_var; + LinearColorF mA, mB; + bool mSync_var; public: afxXM_WaveInterp_Color(); @@ -51,36 +51,36 @@ public: afxXM_WaveInterp_Color::afxXM_WaveInterp_Color() { - a_set.set(0.0f, 0.0f, 0.0f, 0.0f); - b_set.set(1.0f, 1.0f, 1.0f, 1.0f); - a_var.set(0.0f, 0.0f, 0.0f, 0.0f); - b_var.set(0.0f, 0.0f, 0.0f, 0.0f); - sync_var = false; - a.set(0.0f, 0.0f, 0.0f, 0.0f); - b.set(1.0f, 1.0f, 1.0f, 1.0f); + mA_set.set(0.0f, 0.0f, 0.0f, 0.0f); + mB_set.set(1.0f, 1.0f, 1.0f, 1.0f); + mA_var.set(0.0f, 0.0f, 0.0f, 0.0f); + mB_var.set(0.0f, 0.0f, 0.0f, 0.0f); + mSync_var = false; + mA.set(0.0f, 0.0f, 0.0f, 0.0f); + mB.set(1.0f, 1.0f, 1.0f, 1.0f); } void afxXM_WaveInterp_Color::set(LinearColorF& a, LinearColorF& b, LinearColorF& a_var, LinearColorF& b_var, bool sync_var) { - a_set = a; - b_set = b; - this->a_var = a_var; - this->b_var = b_var; - this->sync_var = sync_var; - this->a = a; - this->b = b; + mA_set = a; + mB_set = b; + mA_var = a_var; + mB_var = b_var; + mSync_var = sync_var; + mA = a; + mB = b; } inline void afxXM_WaveInterp_Color::pulse() { LinearColorF temp_color; F32 rand_t = gRandGen.randF()*2.0f; - temp_color.interpolate(-a_var, a_var, rand_t); - a = a_set + temp_color; - if (!sync_var) + temp_color.interpolate(-mA_var, mA_var, rand_t); + mA = mA_set + temp_color; + if (!mSync_var) rand_t = gRandGen.randF()*2.0f; - temp_color.interpolate(-b_var, b_var, rand_t); - b = b_set + temp_color; + temp_color.interpolate(-mB_var, mB_var, rand_t); + mB = mB_set + temp_color; } //~~~~~~~~~~~~~~~~~~~~// @@ -91,7 +91,7 @@ public: virtual void interpolate(F32 t, afxXM_Params& params) { LinearColorF temp_color; - temp_color.interpolate(a, b, t); + temp_color.interpolate(mA, mB, t); params.color += temp_color; } }; @@ -104,7 +104,7 @@ public: virtual void interpolate(F32 t, afxXM_Params& params) { LinearColorF temp_color; - temp_color.interpolate(a, b, t); + temp_color.interpolate(mA, mB, t); params.color *= temp_color; } }; @@ -116,7 +116,7 @@ class afxXM_WaveInterp_Color_Rep : public afxXM_WaveInterp_Color public: virtual void interpolate(F32 t, afxXM_Params& params) { - params.color.interpolate(a, b, t); + params.color.interpolate(mA, mB, t); } }; diff --git a/Engine/source/afx/xm/afxXM_WaveScalar.cpp b/Engine/source/afx/xm/afxXM_WaveScalar.cpp index d05b1d579..7b7947abb 100644 --- a/Engine/source/afx/xm/afxXM_WaveScalar.cpp +++ b/Engine/source/afx/xm/afxXM_WaveScalar.cpp @@ -35,10 +35,10 @@ class afxXM_WaveInterp_Scalar : public afxXM_WaveInterp { protected: - F32 a_set, b_set; - F32 a_var, b_var; - F32 a, b; - bool sync_var; + F32 mA_set, mB_set; + F32 mA_var, mB_var; + F32 mA, mB; + bool mSync_var; public: afxXM_WaveInterp_Scalar(); @@ -51,33 +51,33 @@ public: afxXM_WaveInterp_Scalar::afxXM_WaveInterp_Scalar() { - a_set = 0.0f; - b_set = 1.0f; - a_var = 0.0f; - b_var = 0.0; - sync_var = false; - a = 0.0f; - b = 1.0f; + mA_set = 0.0f; + mB_set = 1.0f; + mA_var = 0.0f; + mB_var = 0.0; + mSync_var = false; + mA = 0.0f; + mB = 1.0f; } void afxXM_WaveInterp_Scalar::set(F32 a, F32 b, F32 a_var, F32 b_var, bool sync_var) { - a_set = a; - b_set = b; - this->a_var = a_var; - this->b_var = b_var; - this->sync_var = sync_var; - this->a = a; - this->b = b; + mA_set = a; + mB_set = b; + mA_var = a_var; + mB_var = b_var; + mSync_var = sync_var; + mA = a; + mA = b; } inline void afxXM_WaveInterp_Scalar::pulse() { F32 rand_t = gRandGen.randF()*2.0f; - a = a_set + rand_t*a_var - a_var; - if (!sync_var) + mA = mA_set + rand_t*mA_var - mA_var; + if (!mSync_var) rand_t = gRandGen.randF()*2.0f; - b = b_set + rand_t*b_var - b_var; + mB = mB_set + rand_t*mB_var - mB_var; } //~~~~~~~~~~~~~~~~~~~~// @@ -90,7 +90,7 @@ public: afxXM_WaveInterp_Scalar_Add(U32 o) : afxXM_WaveInterp_Scalar() { offset = o; } virtual void interpolate(F32 t, afxXM_Params& params) { - *((F32*)(((char*)(¶ms)) + offset)) += lerp(t, a, b); + *((F32*)(((char*)(¶ms)) + offset)) += lerp(t, mA, mB); } }; @@ -104,7 +104,7 @@ public: afxXM_WaveInterp_Scalar_Mul(U32 o) : afxXM_WaveInterp_Scalar() { offset = o; } virtual void interpolate(F32 t, afxXM_Params& params) { - *((F32*)(((char*)(¶ms)) + offset)) *= lerp(t, a, b); + *((F32*)(((char*)(¶ms)) + offset)) *= lerp(t, mA, mB); } }; @@ -118,7 +118,7 @@ public: afxXM_WaveInterp_Scalar_Rep(U32 o) : afxXM_WaveInterp_Scalar() { offset = o; } virtual void interpolate(F32 t, afxXM_Params& params) { - *((F32*)(((char*)(¶ms)) + offset)) = lerp(t, a, b); + *((F32*)(((char*)(¶ms)) + offset)) = lerp(t, mA, mB); } }; @@ -132,7 +132,7 @@ public: afxXM_WaveInterp_Scalar_PointAdd(U32 o) : afxXM_WaveInterp_Scalar() { offset = o; } virtual void interpolate(F32 t, afxXM_Params& params) { - F32 scalar_at_t = lerp(t, a, b); + F32 scalar_at_t = lerp(t, mA, mB); Point3F point_at_t(scalar_at_t, scalar_at_t, scalar_at_t); *((Point3F*)(((char*)(¶ms)) + offset)) += point_at_t; } @@ -148,7 +148,7 @@ public: afxXM_WaveInterp_Scalar_PointMul(U32 o) : afxXM_WaveInterp_Scalar() { offset = o; } virtual void interpolate(F32 t, afxXM_Params& params) { - *((Point3F*)(((char*)(¶ms)) + offset)) *= lerp(t, a, b); + *((Point3F*)(((char*)(¶ms)) + offset)) *= lerp(t, mA, mB); } }; @@ -162,7 +162,7 @@ public: afxXM_WaveInterp_Scalar_PointRep(U32 o) : afxXM_WaveInterp_Scalar() { offset = o; } virtual void interpolate(F32 t, afxXM_Params& params) { - F32 scalar_at_t = lerp(t, a, b); + F32 scalar_at_t = lerp(t,mA, mB); Point3F point_at_t(scalar_at_t, scalar_at_t, scalar_at_t); *((Point3F*)(((char*)(¶ms)) + offset)) = point_at_t; } @@ -179,7 +179,7 @@ public: afxXM_WaveInterp_Scalar_Axis_PointAdd(U32 o, Point3F ax) : afxXM_WaveInterp_Scalar() { offset = o; axis = ax; } virtual void interpolate(F32 t, afxXM_Params& params) { - Point3F point_at_t = axis*lerp(t, a, b); + Point3F point_at_t = axis*lerp(t, mA, mB); *((Point3F*)(((char*)(¶ms)) + offset)) += point_at_t; } }; @@ -195,7 +195,7 @@ public: { Point3F local_axis(axis); params.ori.mulV(local_axis); - Point3F point_at_t = local_axis*lerp(t, a, b); + Point3F point_at_t = local_axis*lerp(t, mA, mB); *((Point3F*)(((char*)(¶ms)) + offset)) += point_at_t; } }; @@ -211,7 +211,7 @@ public: afxXM_WaveInterp_Scalar_Axis_PointMul(U32 o, Point3F ax) : afxXM_WaveInterp_Scalar() { offset = o; axis = ax; } virtual void interpolate(F32 t, afxXM_Params& params) { - Point3F point_at_t = axis*lerp(t, a, b); + Point3F point_at_t = axis*lerp(t, mA, mB); *((Point3F*)(((char*)(¶ms)) + offset)) *= point_at_t; } }; @@ -227,7 +227,7 @@ public: { Point3F local_axis(axis); params.ori.mulV(local_axis); - Point3F point_at_t = local_axis*lerp(t, a, b); + Point3F point_at_t = local_axis*lerp(t, mA, mB); *((Point3F*)(((char*)(¶ms)) + offset)) *= point_at_t; } }; @@ -243,7 +243,7 @@ public: afxXM_WaveInterp_Scalar_Axis_PointRep(U32 o, Point3F ax) : afxXM_WaveInterp_Scalar() { offset = o; axis = ax; } virtual void interpolate(F32 t, afxXM_Params& params) { - Point3F point_at_t = axis*lerp(t, a, b); + Point3F point_at_t = axis*lerp(t, mA, mB); *((Point3F*)(((char*)(¶ms)) + offset)) = point_at_t; } }; @@ -259,7 +259,7 @@ public: { Point3F local_axis(axis); params.ori.mulV(local_axis); - Point3F point_at_t = local_axis*lerp(t, a, b); + Point3F point_at_t = local_axis*lerp(t, mA, mB); *((Point3F*)(((char*)(¶ms)) + offset)) = point_at_t; } }; @@ -272,7 +272,7 @@ public: afxXM_WaveInterp_Scalar_ColorAdd() : afxXM_WaveInterp_Scalar() { } virtual void interpolate(F32 t, afxXM_Params& params) { - F32 scalar_at_t = lerp(t, a, b); + F32 scalar_at_t = lerp(t, mA, mB); LinearColorF color_at_t(scalar_at_t, scalar_at_t, scalar_at_t, scalar_at_t); params.color += color_at_t; } @@ -286,7 +286,7 @@ public: afxXM_WaveInterp_Scalar_ColorMul() : afxXM_WaveInterp_Scalar() { } virtual void interpolate(F32 t, afxXM_Params& params) { - params.color *= lerp(t, a, b); + params.color *= lerp(t, mA, mB); } }; @@ -298,7 +298,7 @@ public: afxXM_WaveInterp_Scalar_ColorRep() : afxXM_WaveInterp_Scalar() { } virtual void interpolate(F32 t, afxXM_Params& params) { - F32 scalar_at_t = lerp(t, a, b); + F32 scalar_at_t = lerp(t, mA, mB); params.color.set(scalar_at_t, scalar_at_t, scalar_at_t, scalar_at_t); } }; @@ -313,7 +313,7 @@ public: afxXM_WaveInterp_Scalar_OriMul(Point3F& ax) : afxXM_WaveInterp_Scalar() { axis = ax; } virtual void interpolate(F32 t, afxXM_Params& params) { - F32 theta = mDegToRad(lerp(t, a, b)); + F32 theta = mDegToRad(lerp(t, mA, mB)); AngAxisF rot_aa(axis, theta); MatrixF rot_xfm; rot_aa.setMatrix(&rot_xfm); params.ori.mul(rot_xfm); @@ -330,7 +330,7 @@ public: afxXM_WaveInterp_Scalar_OriRep(Point3F& ax) : afxXM_WaveInterp_Scalar() { axis = ax; } virtual void interpolate(F32 t, afxXM_Params& params) { - F32 theta = mDegToRad(lerp(t, a, b)); + F32 theta = mDegToRad(lerp(t, mA, mB)); AngAxisF rot_aa(axis, theta); rot_aa.setMatrix(¶ms.ori); } diff --git a/Engine/source/app/net/serverQuery.cpp b/Engine/source/app/net/serverQuery.cpp index 05d31e531..6b555629a 100644 --- a/Engine/source/app/net/serverQuery.cpp +++ b/Engine/source/app/net/serverQuery.cpp @@ -1301,7 +1301,7 @@ static void processPingsAndQueries( U32 session, bool schedule ) if ( !gPingList.size() && !waitingForMaster ) { // Start the query phase: - for ( U32 i = 0; i < gQueryList.size() && i < gMaxConcurrentQueries; ) + for ( i = 0; i < gQueryList.size() && i < gMaxConcurrentQueries; ) { Ping &p = gQueryList[i]; if ( p.time + gPingTimeout < time ) diff --git a/Engine/source/assets/assetManager.cpp b/Engine/source/assets/assetManager.cpp index da610a895..c2591a84f 100644 --- a/Engine/source/assets/assetManager.cpp +++ b/Engine/source/assets/assetManager.cpp @@ -1353,10 +1353,10 @@ bool AssetManager::refreshAsset( const char* pAssetId ) } // Refresh depended-on assets. - for ( Vector::iterator isDependedOnItr = dependedOn.begin(); isDependedOnItr != dependedOn.end(); ++isDependedOnItr ) + for ( Vector::iterator refreshItr = dependedOn.begin(); refreshItr != dependedOn.end(); ++refreshItr) { // Refresh dependency asset. - refreshAsset( *isDependedOnItr ); + refreshAsset( *refreshItr); } } } diff --git a/Engine/source/collision/clippedPolyList.cpp b/Engine/source/collision/clippedPolyList.cpp index 3eee28a09..bd37243c5 100644 --- a/Engine/source/collision/clippedPolyList.cpp +++ b/Engine/source/collision/clippedPolyList.cpp @@ -270,10 +270,10 @@ void ClippedPolyList::end() iv.mask = 0; // Test against the remaining planes - for (U32 i = p + 1; i < mPlaneList.size(); i++) - if (mPlaneList[i].distToPlane(iv.point) > 0) + for (U32 rP = p + 1; rP < mPlaneList.size(); rP++) + if (mPlaneList[rP].distToPlane(iv.point) > 0) { - iv.mask = 1 << i; + iv.mask = 1 << rP; break; } } diff --git a/Engine/source/collision/convex.cpp b/Engine/source/collision/convex.cpp index 0fda42812..01583c9f0 100644 --- a/Engine/source/collision/convex.cpp +++ b/Engine/source/collision/convex.cpp @@ -520,7 +520,7 @@ void Convex::updateStateList(const MatrixF& mat, const Point3F& scale, const Poi // Destroy states which are no longer intersecting for (CollisionStateList* itr = mList.mNext; itr != &mList; itr = itr->mNext) { - Convex* cv = (itr->mState->a == this)? itr->mState->b: itr->mState->a; + Convex* cv = (itr->mState->mA == this)? itr->mState->mB: itr->mState->mA; cv->mTag = sTag; if (!box1.isOverlapped(cv->getBoundingBox())) { CollisionState* cs = itr->mState; @@ -568,9 +568,9 @@ CollisionState* Convex::findClosestState(const MatrixF& mat, const Point3F& scal state->swap(); // Prepare scaled version of transform - MatrixF bxform = state->b->getTransform(); + MatrixF bxform = state->mB->getTransform(); temp = bxform; - Point3F bscale = state->b->getScale(); + Point3F bscale = state->mB->getScale(); bxform.scale(bscale); MatrixF bxforminv(true); bxforminv.scale(Point3F(1.0f/bscale.x, 1.0f/bscale.y, 1.0f/bscale.z)); @@ -613,7 +613,7 @@ bool Convex::getCollisionInfo(const MatrixF& mat, const Point3F& scale, Collisio if (state->mLista != itr) state->swap(); - if (state->dist <= tol) + if (state->mDist <= tol) { fa.reset(); fb.reset(); @@ -628,18 +628,18 @@ bool Convex::getCollisionInfo(const MatrixF& mat, const Point3F& scale, Collisio MatrixF imat = omat; imat.inverse(); - imat.mulV(-state->v,&v); + imat.mulV(-state->mDistvec,&v); getFeatures(omat,v,&fa); - imat = state->b->getTransform(); - imat.scale(state->b->getScale()); + imat = state->mB->getTransform(); + imat.scale(state->mB->getScale()); MatrixF bxform = imat; imat.inverse(); - imat.mulV(state->v,&v); + imat.mulV(state->mDistvec,&v); - state->b->getFeatures(bxform,v,&fb); + state->mB->getFeatures(bxform,v,&fb); fa.collide(fb,cList,tol); } diff --git a/Engine/source/collision/convex.h b/Engine/source/collision/convex.h index 5de048abc..fa6106f83 100644 --- a/Engine/source/collision/convex.h +++ b/Engine/source/collision/convex.h @@ -100,11 +100,11 @@ struct CollisionState { CollisionStateList* mLista; CollisionStateList* mListb; - Convex* a; - Convex* b; + Convex* mA; + Convex* mB; - F32 dist; // Current estimated distance - VectorF v; // Vector between closest points + F32 mDist; // Current estimated distance + VectorF mDistvec; // Vector between closest points // CollisionState(); diff --git a/Engine/source/collision/depthSortList.cpp b/Engine/source/collision/depthSortList.cpp index 87a50fab5..2ead81479 100644 --- a/Engine/source/collision/depthSortList.cpp +++ b/Engine/source/collision/depthSortList.cpp @@ -123,7 +123,7 @@ void DepthSortList::setExtents(Poly & poly, PolyExtents & polyExtents) polyExtents.zMin = polyExtents.zMax = p.z; for (S32 i=poly.vertexStart+1; i 0) { iv.mask = 1 << i; break; diff --git a/Engine/source/collision/extrudedPolyList.cpp b/Engine/source/collision/extrudedPolyList.cpp index 0e3b744a8..24de5af29 100644 --- a/Engine/source/collision/extrudedPolyList.cpp +++ b/Engine/source/collision/extrudedPolyList.cpp @@ -72,11 +72,11 @@ void ExtrudedPolyList::extrude(const Polyhedron& pt, const VectorF& vector) mPolyPlaneList.clear(); // Determine which faces will be extruded. - mExtrudedList.setSize(pt.planeList.size()); + mExtrudedList.setSize(pt.mPlaneList.size()); - for (U32 f = 0; f < pt.planeList.size(); f++) + for (U32 f = 0; f < pt.mPlaneList.size(); f++) { - const PlaneF& face = pt.planeList[f]; + const PlaneF& face = pt.mPlaneList[f]; ExtrudedFace& eface = mExtrudedList[f]; F32 dot = mDot(face,vector); eface.active = dot > EqualEpsilon; @@ -96,9 +96,9 @@ void ExtrudedPolyList::extrude(const Polyhedron& pt, const VectorF& vector) } // Produce extruded planes for bounding and internal edges - for (U32 e = 0; e < pt.edgeList.size(); e++) + for (U32 e = 0; e < pt.mEdgeList.size(); e++) { - Polyhedron::Edge const& edge = pt.edgeList[e]; + Polyhedron::Edge const& edge = pt.mEdgeList[e]; ExtrudedFace& ef1 = mExtrudedList[edge.face[0]]; ExtrudedFace& ef2 = mExtrudedList[edge.face[1]]; if (ef1.active || ef2.active) @@ -106,8 +106,8 @@ void ExtrudedPolyList::extrude(const Polyhedron& pt, const VectorF& vector) // Assumes that the edge points are clockwise // for face[0]. - const Point3F& p1 = pt.pointList[edge.vertex[1]]; - const Point3F &p2 = pt.pointList[edge.vertex[0]]; + const Point3F& p1 = pt.mPointList[edge.vertex[1]]; + const Point3F &p2 = pt.mPointList[edge.vertex[0]]; Point3F p3 = p2 + vector; mPlaneList.increment(2); diff --git a/Engine/source/collision/gjk.cpp b/Engine/source/collision/gjk.cpp index 5dff5ec92..e9debee81 100644 --- a/Engine/source/collision/gjk.cpp +++ b/Engine/source/collision/gjk.cpp @@ -46,7 +46,7 @@ S32 num_irregularities = 0; GjkCollisionState::GjkCollisionState() { - a = b = 0; + mA = mB = 0; } GjkCollisionState::~GjkCollisionState() @@ -58,9 +58,9 @@ GjkCollisionState::~GjkCollisionState() void GjkCollisionState::swap() { - Convex* t = a; a = b; b = t; + Convex* t = mA; mA = mB; mB = t; CollisionStateList* l = mLista; mLista = mListb; mListb = l; - v.neg(); + mDistvec.neg(); } @@ -70,44 +70,44 @@ void GjkCollisionState::compute_det() { // Dot new point with current set for (S32 i = 0, bit = 1; i < 4; ++i, bit <<=1) - if (bits & bit) - dp[i][last] = dp[last][i] = mDot(y[i], y[last]); - dp[last][last] = mDot(y[last], y[last]); + if (mBits & bit) + mDP[i][mLast] = mDP[mLast][i] = mDot(mY[i], mY[mLast]); + mDP[mLast][mLast] = mDot(mY[mLast], mY[mLast]); // Calulate the determinent - det[last_bit][last] = 1; + mDet[mLast_bit][mLast] = 1; for (S32 j = 0, sj = 1; j < 4; ++j, sj <<= 1) { - if (bits & sj) { - S32 s2 = sj | last_bit; - det[s2][j] = dp[last][last] - dp[last][j]; - det[s2][last] = dp[j][j] - dp[j][last]; + if (mBits & sj) { + S32 s2 = sj | mLast_bit; + mDet[s2][j] = mDP[mLast][mLast] - mDP[mLast][j]; + mDet[s2][mLast] = mDP[j][j] - mDP[j][mLast]; for (S32 k = 0, sk = 1; k < j; ++k, sk <<= 1) { - if (bits & sk) { + if (mBits & sk) { S32 s3 = sk | s2; - det[s3][k] = det[s2][j] * (dp[j][j] - dp[j][k]) + - det[s2][last] * (dp[last][j] - dp[last][k]); - det[s3][j] = det[sk | last_bit][k] * (dp[k][k] - dp[k][j]) + - det[sk | last_bit][last] * (dp[last][k] - dp[last][j]); - det[s3][last] = det[sk | sj][k] * (dp[k][k] - dp[k][last]) + - det[sk | sj][j] * (dp[j][k] - dp[j][last]); + mDet[s3][k] = mDet[s2][j] * (mDP[j][j] - mDP[j][k]) + + mDet[s2][mLast] * (mDP[mLast][j] - mDP[mLast][k]); + mDet[s3][j] = mDet[sk | mLast_bit][k] * (mDP[k][k] - mDP[k][j]) + + mDet[sk | mLast_bit][mLast] * (mDP[mLast][k] - mDP[mLast][j]); + mDet[s3][mLast] = mDet[sk | sj][k] * (mDP[k][k] - mDP[k][mLast]) + + mDet[sk | sj][j] * (mDP[j][k] - mDP[j][mLast]); } } } } - if (all_bits == 15) { - det[15][0] = det[14][1] * (dp[1][1] - dp[1][0]) + - det[14][2] * (dp[2][1] - dp[2][0]) + - det[14][3] * (dp[3][1] - dp[3][0]); - det[15][1] = det[13][0] * (dp[0][0] - dp[0][1]) + - det[13][2] * (dp[2][0] - dp[2][1]) + - det[13][3] * (dp[3][0] - dp[3][1]); - det[15][2] = det[11][0] * (dp[0][0] - dp[0][2]) + - det[11][1] * (dp[1][0] - dp[1][2]) + - det[11][3] * (dp[3][0] - dp[3][2]); - det[15][3] = det[7][0] * (dp[0][0] - dp[0][3]) + - det[7][1] * (dp[1][0] - dp[1][3]) + - det[7][2] * (dp[2][0] - dp[2][3]); + if (mAll_bits == 15) { + mDet[15][0] = mDet[14][1] * (mDP[1][1] - mDP[1][0]) + + mDet[14][2] * (mDP[2][1] - mDP[2][0]) + + mDet[14][3] * (mDP[3][1] - mDP[3][0]); + mDet[15][1] = mDet[13][0] * (mDP[0][0] - mDP[0][1]) + + mDet[13][2] * (mDP[2][0] - mDP[2][1]) + + mDet[13][3] * (mDP[3][0] - mDP[3][1]); + mDet[15][2] = mDet[11][0] * (mDP[0][0] - mDP[0][2]) + + mDet[11][1] * (mDP[1][0] - mDP[1][2]) + + mDet[11][3] * (mDP[3][0] - mDP[3][2]); + mDet[15][3] = mDet[7][0] * (mDP[0][0] - mDP[0][3]) + + mDet[7][1] * (mDP[1][0] - mDP[1][3]) + + mDet[7][2] * (mDP[2][0] - mDP[2][3]); } } @@ -120,8 +120,8 @@ inline void GjkCollisionState::compute_vector(S32 bits, VectorF& v) v.set(0, 0, 0); for (S32 i = 0, bit = 1; i < 4; ++i, bit <<= 1) { if (bits & bit) { - sum += det[bits][i]; - v += y[i] * det[bits][i]; + sum += mDet[bits][i]; + v += mY[i] * mDet[bits][i]; } } v *= 1 / sum; @@ -133,13 +133,13 @@ inline void GjkCollisionState::compute_vector(S32 bits, VectorF& v) inline bool GjkCollisionState::valid(S32 s) { for (S32 i = 0, bit = 1; i < 4; ++i, bit <<= 1) { - if (all_bits & bit) { + if (mAll_bits & bit) { if (s & bit) { - if (det[s][i] <= 0) + if (mDet[s][i] <= 0) return false; } else - if (det[s | bit][i] > 0) + if (mDet[s | bit][i] > 0) return false; } } @@ -152,19 +152,19 @@ inline bool GjkCollisionState::valid(S32 s) inline bool GjkCollisionState::closest(VectorF& v) { compute_det(); - for (S32 s = bits; s; --s) { - if ((s & bits) == s) { - if (valid(s | last_bit)) { - bits = s | last_bit; - if (bits != 15) - compute_vector(bits, v); + for (S32 s = mBits; s; --s) { + if ((s & mBits) == s) { + if (valid(s | mLast_bit)) { + mBits = s | mLast_bit; + if (mBits != 15) + compute_vector(mBits, v); return true; } } } - if (valid(last_bit)) { - bits = last_bit; - v = y[last]; + if (valid(mLast_bit)) { + mBits = mLast_bit; + v = mY[mLast]; return true; } return false; @@ -176,7 +176,7 @@ inline bool GjkCollisionState::closest(VectorF& v) inline bool GjkCollisionState::degenerate(const VectorF& w) { for (S32 i = 0, bit = 1; i < 4; ++i, bit <<= 1) - if ((all_bits & bit) && y[i] == w) + if ((mAll_bits & bit) && mY[i] == w) return true; return false; } @@ -186,11 +186,11 @@ inline bool GjkCollisionState::degenerate(const VectorF& w) inline void GjkCollisionState::nextBit() { - last = 0; - last_bit = 1; - while (bits & last_bit) { - ++last; - last_bit <<= 1; + mLast = 0; + mLast_bit = 1; + while (mBits & mLast_bit) { + ++mLast; + mLast_bit <<= 1; } } @@ -203,11 +203,11 @@ inline void GjkCollisionState::nextBit() void GjkCollisionState::set(Convex* aa, Convex* bb, const MatrixF& a2w, const MatrixF& b2w) { - a = aa; - b = bb; + mA = aa; + mB = bb; - bits = 0; - all_bits = 0; + mBits = 0; + mAll_bits = 0; reset(a2w,b2w); // link @@ -223,10 +223,10 @@ void GjkCollisionState::set(Convex* aa, Convex* bb, void GjkCollisionState::reset(const MatrixF& a2w, const MatrixF& b2w) { VectorF zero(0,0,0),sa,sb; - a2w.mulP(a->support(zero),&sa); - b2w.mulP(b->support(zero),&sb); - v = sa - sb; - dist = v.len(); + a2w.mulP(mA->support(zero),&sa); + b2w.mulP(mB->support(zero),&sb); + mDistvec = sa - sb; + mDist = mDistvec.len(); } @@ -237,18 +237,18 @@ void GjkCollisionState::getCollisionInfo(const MatrixF& mat, Collision* info) AssertFatal(false, "GjkCollisionState::getCollisionInfo() - There remain scaling problems here."); // This assumes that the shapes do not intersect Point3F pa,pb; - if (bits) { + if (mBits) { getClosestPoints(pa,pb); mat.mulP(pa,&info->point); - b->getTransform().mulP(pb,&pa); + mB->getTransform().mulP(pb,&pa); info->normal = info->point - pa; } else { - mat.mulP(p[last],&info->point); - info->normal = v; + mat.mulP(mP[mLast],&info->point); + info->normal = mDistvec; } info->normal.normalize(); - info->object = b->getObject(); + info->object = mB->getObject(); } void GjkCollisionState::getClosestPoints(Point3F& p1, Point3F& p2) @@ -257,10 +257,10 @@ void GjkCollisionState::getClosestPoints(Point3F& p1, Point3F& p2) p1.set(0, 0, 0); p2.set(0, 0, 0); for (S32 i = 0, bit = 1; i < 4; ++i, bit <<= 1) { - if (bits & bit) { - sum += det[bits][i]; - p1 += p[i] * det[bits][i]; - p2 += q[i] * det[bits][i]; + if (mBits & bit) { + sum += mDet[mBits][i]; + p1 += mP[i] * mDet[mBits][i]; + p2 += mQ[i] * mDet[mBits][i]; } } F32 s = 1 / sum; @@ -282,40 +282,40 @@ bool GjkCollisionState::intersect(const MatrixF& a2w, const MatrixF& b2w) w2b.inverse(); reset(a2w,b2w); - bits = 0; - all_bits = 0; + mBits = 0; + mAll_bits = 0; do { nextBit(); VectorF va,sa; - w2a.mulV(-v,&va); - p[last] = a->support(va); - a2w.mulP(p[last],&sa); + w2a.mulV(-mDistvec,&va); + mP[mLast] = mA->support(va); + a2w.mulP(mP[mLast],&sa); VectorF vb,sb; - w2b.mulV(v,&vb); - q[last] = b->support(vb); - b2w.mulP(q[last],&sb); + w2b.mulV(mDistvec,&vb); + mQ[mLast] = mB->support(vb); + b2w.mulP(mQ[mLast],&sb); VectorF w = sa - sb; - if (mDot(v,w) > 0) + if (mDot(mDistvec,w) > 0) return false; if (degenerate(w)) { ++num_irregularities; return false; } - y[last] = w; - all_bits = bits | last_bit; + mY[mLast] = w; + mAll_bits = mBits | mLast_bit; ++num_iterations; - if (!closest(v) || num_iterations > sIteration) { + if (!closest(mDistvec) || num_iterations > sIteration) { ++num_irregularities; return false; } } - while (bits < 15 && v.lenSquared() > sEpsilon2); + while (mBits < 15 && mDistvec.lenSquared() > sEpsilon2); return true; } @@ -337,51 +337,51 @@ F32 GjkCollisionState::distance(const MatrixF& a2w, const MatrixF& b2w, } reset(a2w,b2w); - bits = 0; - all_bits = 0; + mBits = 0; + mAll_bits = 0; F32 mu = 0; do { nextBit(); VectorF va,sa; - w2a.mulV(-v,&va); - p[last] = a->support(va); - a2w.mulP(p[last],&sa); + w2a.mulV(-mDistvec,&va); + mP[mLast] = mA->support(va); + a2w.mulP(mP[mLast],&sa); VectorF vb,sb; - w2b.mulV(v,&vb); - q[last] = b->support(vb); - b2w.mulP(q[last],&sb); + w2b.mulV(mDistvec,&vb); + mQ[mLast] = mB->support(vb); + b2w.mulP(mQ[mLast],&sb); VectorF w = sa - sb; - F32 nm = mDot(v, w) / dist; + F32 nm = mDot(mDistvec, w) / mDist; if (nm > mu) mu = nm; if (mu > dontCareDist) return mu; - if (mFabs(dist - mu) <= dist * rel_error) - return dist; + if (mFabs(mDist - mu) <= mDist * rel_error) + return mDist; ++num_iterations; if (degenerate(w) || num_iterations > sIteration) { ++num_irregularities; - return dist; + return mDist; } - y[last] = w; - all_bits = bits | last_bit; + mY[mLast] = w; + mAll_bits = mBits | mLast_bit; - if (!closest(v)) { + if (!closest(mDistvec)) { ++num_irregularities; - return dist; + return mDist; } - dist = v.len(); + mDist = mDistvec.len(); } - while (bits < 15 && dist > sTolerance) ; + while (mBits < 15 && mDist > sTolerance) ; - if (bits == 15 && mu <= 0) - dist = 0; - return dist; + if (mBits == 15 && mu <= 0) + mDist = 0; + return mDist; } diff --git a/Engine/source/collision/gjk.h b/Engine/source/collision/gjk.h index b35f4570d..906007bb3 100644 --- a/Engine/source/collision/gjk.h +++ b/Engine/source/collision/gjk.h @@ -43,17 +43,17 @@ struct GjkCollisionState: public CollisionState { /// @name Temporary values /// @{ - Point3F p[4]; ///< support points of object A in local coordinates - Point3F q[4]; ///< support points of object B in local coordinates - VectorF y[4]; ///< support points of A - B in world coordinates + Point3F mP[4]; ///< support points of object A in local coordinates + Point3F mQ[4]; ///< support points of object B in local coordinates + VectorF mY[4]; ///< support points of A - B in world coordinates - S32 bits; ///< identifies current simplex - S32 all_bits; ///< all_bits = bits | last_bit - F32 det[16][4]; ///< cached sub-determinants - F32 dp[4][4]; ///< cached dot products + S32 mBits; ///< identifies current simplex + S32 mAll_bits; ///< all_bits = bits | last_bit + F32 mDet[16][4]; ///< cached sub-determinants + F32 mDP[4][4]; ///< cached dot products - S32 last; ///< identifies last found support point - S32 last_bit; ///< last_bit = 1<= 0; -- n ) { - polyhedron.edgeList.push_back( + polyhedron.mEdgeList.push_back( Polyhedron::Edge( polyIndex, 0, // face1 filled later indexList[ lastIndex ], indexList[ n ] @@ -514,16 +514,16 @@ Polyhedron OptimizedPolyList::toPolyhedron() const // Finally, consolidate the edge list by merging all edges that // are shared by polygons. - for( U32 i = 0; i < polyhedron.edgeList.size(); ++ i ) + for( U32 i = 0; i < polyhedron.mEdgeList.size(); ++ i ) { - Polyhedron::Edge& edge = polyhedron.edgeList[ i ]; + Polyhedron::Edge& edge = polyhedron.mEdgeList[ i ]; // Find the corresponding duplicate edge, if any, and merge // it into our current edge. - for( U32 n = i + 1; n < polyhedron.edgeList.size(); ++ n ) + for( U32 n = i + 1; n < polyhedron.mEdgeList.size(); ++ n ) { - const Polyhedron::Edge& thisEdge = polyhedron.edgeList[ n ]; + const Polyhedron::Edge& thisEdge = polyhedron.mEdgeList[ n ]; if( ( thisEdge.vertex[ 0 ] == edge.vertex[ 1 ] && thisEdge.vertex[ 1 ] == edge.vertex[ 0 ] ) || @@ -531,7 +531,7 @@ Polyhedron OptimizedPolyList::toPolyhedron() const thisEdge.vertex[ 1 ] == edge.vertex[ 1 ] ) ) { edge.face[ 1 ] = thisEdge.face[ 0 ]; - polyhedron.edgeList.erase( n ); + polyhedron.mEdgeList.erase( n ); break; } } diff --git a/Engine/source/collision/polytope.cpp b/Engine/source/collision/polytope.cpp index f07116583..127c0a1f3 100644 --- a/Engine/source/collision/polytope.cpp +++ b/Engine/source/collision/polytope.cpp @@ -193,19 +193,19 @@ void Polytope::intersect(SimObject* object,const BSPNode* root) // Split the edge into each volume mEdgeList.increment(2); - Edge& e0 = mEdgeList.last(); - e0.next = frontVolume.edgeList; + Edge& ev0 = mEdgeList.last(); + ev0.next = frontVolume.edgeList; frontVolume.edgeList = mEdgeList.size() - 1; - Edge& e1 = *(&e0 - 1); - e1.next = backVolume.edgeList; + Edge& ev1 = *(&ev0 - 1); + ev1.next = backVolume.edgeList; backVolume.edgeList = frontVolume.edgeList - 1; - e0.vertex[0] = edge.vertex[s]; - e1.vertex[0] = edge.vertex[s ^ 1]; - e0.vertex[1] = e1.vertex[1] = mVertexList.size() - 1; - e0.face[0] = e1.face[0] = edge.face[0]; - e0.face[1] = e1.face[1] = edge.face[1]; + ev0.vertex[0] = edge.vertex[s]; + ev1.vertex[0] = edge.vertex[s ^ 1]; + ev0.vertex[1] = ev1.vertex[1] = mVertexList.size() - 1; + ev0.face[0] = ev1.face[0] = edge.face[0]; + ev0.face[1] = ev1.face[1] = edge.face[1]; // Add new edges on the plane, one to each volume for (S32 f = 0; f < 2; f++) { @@ -214,19 +214,19 @@ void Polytope::intersect(SimObject* object,const BSPNode* root) face.vertex = mVertexList.size() - 1; else { mEdgeList.increment(2); - Edge& e0 = mEdgeList.last(); - e0.next = frontVolume.edgeList; + Edge& ep0 = mEdgeList.last(); + ep0.next = frontVolume.edgeList; frontVolume.edgeList = mEdgeList.size() - 1; - Edge& e1 = *(&e0 - 1); - e1.next = backVolume.edgeList; + Edge& ep1 = *(&ep0 - 1); + ep1.next = backVolume.edgeList; backVolume.edgeList = frontVolume.edgeList - 1; - e1.vertex[0] = e0.vertex[0] = face.vertex; - e1.vertex[1] = e0.vertex[1] = mVertexList.size() - 1; - e1.face[0] = e0.face[0] = edge.face[f]; - e1.face[1] = mFaceList.size() - 1; - e0.face[1] = e1.face[1] - 1; + ep1.vertex[0] = ep0.vertex[0] = face.vertex; + ep1.vertex[1] = ep0.vertex[1] = mVertexList.size() - 1; + ep1.face[0] = ep0.face[0] = edge.face[f]; + ep1.face[1] = mFaceList.size() - 1; + ep0.face[1] = ep1.face[1] - 1; } } } diff --git a/Engine/source/console/ast.h b/Engine/source/console/ast.h index 65b20a926..f81971413 100644 --- a/Engine/source/console/ast.h +++ b/Engine/source/console/ast.h @@ -52,7 +52,7 @@ enum TypeReq /// each representing a different language construct. struct StmtNode { - StmtNode *next; ///< Next entry in parse tree. + StmtNode *mNext; ///< Next entry in parse tree. StmtNode(); virtual ~StmtNode() {} @@ -62,7 +62,7 @@ struct StmtNode /// void append(StmtNode *next); - StmtNode *getNext() const { return next; } + StmtNode *getNext() const { return mNext; } /// @} diff --git a/Engine/source/console/astNodes.cpp b/Engine/source/console/astNodes.cpp index 6ea557703..876a4383a 100644 --- a/Engine/source/console/astNodes.cpp +++ b/Engine/source/console/astNodes.cpp @@ -140,7 +140,7 @@ void StmtNode::addBreakLine(CodeStream &code) StmtNode::StmtNode() { - next = NULL; + mNext = NULL; dbgFileName = CodeBlock::smCurrentParser->getCurrentFile(); } @@ -151,9 +151,9 @@ void StmtNode::setPackage(StringTableEntry) void StmtNode::append(StmtNode *next) { StmtNode *walk = this; - while (walk->next) - walk = walk->next; - walk->next = next; + while (walk->mNext) + walk = walk->mNext; + walk->mNext = next; } diff --git a/Engine/source/console/codeBlock.cpp b/Engine/source/console/codeBlock.cpp index 6b60e7789..f414d7473 100644 --- a/Engine/source/console/codeBlock.cpp +++ b/Engine/source/console/codeBlock.cpp @@ -392,14 +392,14 @@ bool CodeBlock::read(StringTableEntry fileName, Stream &st) if (size) { globalFloats = new F64[size]; - for (U32 i = 0; i < size; i++) + for (i = 0; i < size; i++) st.read(&globalFloats[i]); } st.read(&size); if (size) { functionFloats = new F64[size]; - for (U32 i = 0; i < size; i++) + for (i = 0; i < size; i++) st.read(&functionFloats[i]); } U32 codeLength; diff --git a/Engine/source/console/console.cpp b/Engine/source/console/console.cpp index dc7dde340..219f00c59 100644 --- a/Engine/source/console/console.cpp +++ b/Engine/source/console/console.cpp @@ -49,7 +49,7 @@ ExprEvalState gEvalState; StmtNode *gStatementList; StmtNode *gAnonFunctionList; U32 gAnonFunctionID = 0; -ConsoleConstructor *ConsoleConstructor::first = NULL; +ConsoleConstructor *ConsoleConstructor::mFirst = NULL; bool gWarnUndefinedScriptVariables; static char scratchBuffer[4096]; @@ -85,47 +85,47 @@ static const char * prependPercent ( const char * name ) //-------------------------------------- void ConsoleConstructor::init( const char *cName, const char *fName, const char *usg, S32 minArgs, S32 maxArgs, bool isToolOnly, ConsoleFunctionHeader* header ) { - mina = minArgs; - maxa = maxArgs; - funcName = fName; - usage = usg; - className = cName; - sc = 0; fc = 0; vc = 0; bc = 0; ic = 0; - callback = group = false; - next = first; - ns = false; - first = this; - toolOnly = isToolOnly; - this->header = header; + mMina = minArgs; + mMaxa = maxArgs; + mFuncName = fName; + mUsage = usg; + mClassName = cName; + mSC = 0; mFC = 0; mVC = 0; mBC = 0; mIC = 0; + mCallback = mGroup = false; + mNext = mFirst; + mNS = false; + mFirst = this; + mToolOnly = isToolOnly; + mHeader = header; } void ConsoleConstructor::setup() { - for(ConsoleConstructor *walk = first; walk; walk = walk->next) + for(ConsoleConstructor *walk = mFirst; walk; walk = walk->mNext) { #ifdef TORQUE_DEBUG walk->validate(); #endif - if( walk->sc ) - Con::addCommand( walk->className, walk->funcName, walk->sc, walk->usage, walk->mina, walk->maxa, walk->toolOnly, walk->header ); - else if( walk->ic ) - Con::addCommand( walk->className, walk->funcName, walk->ic, walk->usage, walk->mina, walk->maxa, walk->toolOnly, walk->header ); - else if( walk->fc ) - Con::addCommand( walk->className, walk->funcName, walk->fc, walk->usage, walk->mina, walk->maxa, walk->toolOnly, walk->header ); - else if( walk->vc ) - Con::addCommand( walk->className, walk->funcName, walk->vc, walk->usage, walk->mina, walk->maxa, walk->toolOnly, walk->header ); - else if( walk->bc ) - Con::addCommand( walk->className, walk->funcName, walk->bc, walk->usage, walk->mina, walk->maxa, walk->toolOnly, walk->header ); - else if( walk->group ) - Con::markCommandGroup( walk->className, walk->funcName, walk->usage ); - else if( walk->callback ) - Con::noteScriptCallback( walk->className, walk->funcName, walk->usage, walk->header ); - else if( walk->ns ) + if( walk->mSC ) + Con::addCommand( walk->mClassName, walk->mFuncName, walk->mSC, walk->mUsage, walk->mMina, walk->mMaxa, walk->mToolOnly, walk->mHeader); + else if( walk->mIC ) + Con::addCommand( walk->mClassName, walk->mFuncName, walk->mIC, walk->mUsage, walk->mMina, walk->mMaxa, walk->mToolOnly, walk->mHeader); + else if( walk->mFC ) + Con::addCommand( walk->mClassName, walk->mFuncName, walk->mFC, walk->mUsage, walk->mMina, walk->mMaxa, walk->mToolOnly, walk->mHeader); + else if( walk->mVC ) + Con::addCommand( walk->mClassName, walk->mFuncName, walk->mVC, walk->mUsage, walk->mMina, walk->mMaxa, walk->mToolOnly, walk->mHeader); + else if( walk->mBC ) + Con::addCommand( walk->mClassName, walk->mFuncName, walk->mBC, walk->mUsage, walk->mMina, walk->mMaxa, walk->mToolOnly, walk->mHeader); + else if( walk->mGroup ) + Con::markCommandGroup( walk->mClassName, walk->mFuncName, walk->mUsage); + else if( walk->mClassName) + Con::noteScriptCallback( walk->mClassName, walk->mFuncName, walk->mUsage, walk->mHeader); + else if( walk->mNS ) { - Namespace* ns = Namespace::find( StringTable->insert( walk->className ) ); + Namespace* ns = Namespace::find( StringTable->insert( walk->mClassName) ); if( ns ) - ns->mUsage = walk->usage; + ns->mUsage = walk->mUsage; } else { @@ -137,38 +137,38 @@ void ConsoleConstructor::setup() ConsoleConstructor::ConsoleConstructor(const char *className, const char *funcName, StringCallback sfunc, const char *usage, S32 minArgs, S32 maxArgs, bool isToolOnly, ConsoleFunctionHeader* header ) { init( className, funcName, usage, minArgs, maxArgs, isToolOnly, header ); - sc = sfunc; + mSC = sfunc; } ConsoleConstructor::ConsoleConstructor(const char *className, const char *funcName, IntCallback ifunc, const char *usage, S32 minArgs, S32 maxArgs, bool isToolOnly, ConsoleFunctionHeader* header ) { init( className, funcName, usage, minArgs, maxArgs, isToolOnly, header ); - ic = ifunc; + mIC = ifunc; } ConsoleConstructor::ConsoleConstructor(const char *className, const char *funcName, FloatCallback ffunc, const char *usage, S32 minArgs, S32 maxArgs, bool isToolOnly, ConsoleFunctionHeader* header ) { init( className, funcName, usage, minArgs, maxArgs, isToolOnly, header ); - fc = ffunc; + mFC = ffunc; } ConsoleConstructor::ConsoleConstructor(const char *className, const char *funcName, VoidCallback vfunc, const char *usage, S32 minArgs, S32 maxArgs, bool isToolOnly, ConsoleFunctionHeader* header ) { init( className, funcName, usage, minArgs, maxArgs, isToolOnly, header ); - vc = vfunc; + mVC = vfunc; } ConsoleConstructor::ConsoleConstructor(const char *className, const char *funcName, BoolCallback bfunc, const char *usage, S32 minArgs, S32 maxArgs, bool isToolOnly, ConsoleFunctionHeader* header ) { init( className, funcName, usage, minArgs, maxArgs, isToolOnly, header ); - bc = bfunc; + mBC = bfunc; } ConsoleConstructor::ConsoleConstructor(const char* className, const char* groupName, const char* aUsage) { - init(className, groupName, usage, -1, -2); + init(className, groupName, mUsage, -1, -2); - group = true; + mGroup = true; // Somewhere, the entry list is getting flipped, partially. // so we have to do tricks to deal with making sure usage @@ -179,36 +179,36 @@ ConsoleConstructor::ConsoleConstructor(const char* className, const char* groupN if(aUsage) lastUsage = (char *)aUsage; - usage = lastUsage; + mUsage = lastUsage; } ConsoleConstructor::ConsoleConstructor(const char *className, const char *callbackName, const char *usage, ConsoleFunctionHeader* header ) { init( className, callbackName, usage, -2, -3, false, header ); - callback = true; - ns = true; + mCallback = true; + mNS = true; } void ConsoleConstructor::validate() { #ifdef TORQUE_DEBUG // Don't do the following check if we're not a method/func. - if(this->group) + if(mGroup) return; // In debug, walk the list and make sure this isn't a duplicate. - for(ConsoleConstructor *walk = first; walk; walk = walk->next) + for(ConsoleConstructor *walk = mFirst; walk; walk = walk->mNext) { // Skip mismatching func/method names. - if(dStricmp(walk->funcName, this->funcName)) + if(dStricmp(walk->mFuncName, mFuncName)) continue; // Don't compare functions with methods or vice versa. - if(bool(this->className) != bool(walk->className)) + if(bool(mClassName) != bool(walk->mClassName)) continue; // Skip mismatching classnames, if they're present. - if(this->className && walk->className && dStricmp(walk->className, this->className)) + if(mClassName && walk->mClassName && dStricmp(walk->mClassName, mClassName)) continue; // If we encounter ourselves, stop searching; this prevents duplicate @@ -218,13 +218,13 @@ void ConsoleConstructor::validate() break; // Match! - if(this->className) + if(mClassName) { - AssertISV(false, avar("ConsoleConstructor::setup - ConsoleMethod '%s::%s' collides with another of the same name.", this->className, this->funcName)); + AssertISV(false, avar("ConsoleConstructor::setup - ConsoleMethod '%s::%s' collides with another of the same name.", mClassName, mFuncName)); } else { - AssertISV(false, avar("ConsoleConstructor::setup - ConsoleFunction '%s' collides with another of the same name.", this->funcName)); + AssertISV(false, avar("ConsoleConstructor::setup - ConsoleFunction '%s' collides with another of the same name.", mFuncName)); } } #endif @@ -842,9 +842,9 @@ void setIntVariable(const char *varName, S32 value) if (getVariableObjectField(varName, &obj, &objField)) { - char scratchBuffer[32]; - dSprintf(scratchBuffer, sizeof(scratchBuffer), "%d", value); - obj->setDataField(StringTable->insert(objField), 0, scratchBuffer); + char varBuffer[32]; + dSprintf(varBuffer, sizeof(varBuffer), "%d", value); + obj->setDataField(StringTable->insert(objField), 0, varBuffer); } else { @@ -861,9 +861,9 @@ void setFloatVariable(const char *varName, F32 value) if (getVariableObjectField(varName, &obj, &objField)) { - char scratchBuffer[32]; - dSprintf(scratchBuffer, sizeof(scratchBuffer), "%g", value); - obj->setDataField(StringTable->insert(objField), 0, scratchBuffer); + char varBuffer[32]; + dSprintf(varBuffer, sizeof(varBuffer), "%g", value); + obj->setDataField(StringTable->insert(objField), 0, varBuffer); } else { diff --git a/Engine/source/console/console.h b/Engine/source/console/console.h index a734cefbf..67138d06c 100644 --- a/Engine/source/console/console.h +++ b/Engine/source/console/console.h @@ -972,38 +972,38 @@ public: /// @ref console_autodoc /// @{ - StringCallback sc; ///< A function/method that returns a string. - IntCallback ic; ///< A function/method that returns an int. - FloatCallback fc; ///< A function/method that returns a float. - VoidCallback vc; ///< A function/method that returns nothing. - BoolCallback bc; ///< A function/method that returns a bool. - bool group; ///< Indicates that this is a group marker. - bool ns; ///< Indicates that this is a namespace marker. + StringCallback mSC; ///< A function/method that returns a string. + IntCallback mIC; ///< A function/method that returns an int. + FloatCallback mFC; ///< A function/method that returns a float. + VoidCallback mVC; ///< A function/method that returns nothing. + BoolCallback mBC; ///< A function/method that returns a bool. + bool mGroup; ///< Indicates that this is a group marker. + bool mNS; ///< Indicates that this is a namespace marker. /// @deprecated Unused. - bool callback; ///< Is this a callback into script? + bool mCallback; ///< Is this a callback into script? /// @} /// Minimum number of arguments expected by the function. - S32 mina; + S32 mMina; /// Maximum number of arguments accepted by the funtion. Zero for varargs. - S32 maxa; + S32 mMaxa; /// Name of the function/method. - const char* funcName; + const char* mFuncName; /// Name of the class namespace to which to add the method. - const char* className; + const char* mClassName; /// Usage string for documentation. - const char* usage; + const char* mUsage; /// Whether this is a TORQUE_TOOLS only function. - bool toolOnly; + bool mToolOnly; /// The extended function header. - ConsoleFunctionHeader* header; + ConsoleFunctionHeader* mHeader; /// @name ConsoleConstructor Innards /// @@ -1066,8 +1066,8 @@ public: /// @{ /// - ConsoleConstructor *next; - static ConsoleConstructor *first; + ConsoleConstructor *mNext; + static ConsoleConstructor *mFirst; void init(const char* cName, const char* fName, const char *usg, S32 minArgs, S32 maxArgs, bool toolOnly = false, ConsoleFunctionHeader* header = NULL); diff --git a/Engine/source/console/consoleFunctions.cpp b/Engine/source/console/consoleFunctions.cpp index d32b30d31..fc14af173 100644 --- a/Engine/source/console/consoleFunctions.cpp +++ b/Engine/source/console/consoleFunctions.cpp @@ -672,13 +672,13 @@ DefineConsoleFunction( strreplace, const char*, ( const char* source, const char U32 dstp = 0; for(;;) { - const char *scan = dStrstr(source + scanp, from); - if(!scan) + const char *subScan = dStrstr(source + scanp, from); + if(!subScan) { dStrcpy(ret + dstp, source + scanp, retLen - dstp); return ret; } - U32 len = scan - (source + scanp); + U32 len = subScan - (source + scanp); dStrncpy(ret + dstp, source + scanp, getMin(len, retLen - dstp)); dstp += len; dStrcpy(ret + dstp, to, retLen - dstp); diff --git a/Engine/source/console/engineDoc.cpp b/Engine/source/console/engineDoc.cpp index 5625418b7..cbbc7249d 100644 --- a/Engine/source/console/engineDoc.cpp +++ b/Engine/source/console/engineDoc.cpp @@ -248,13 +248,13 @@ static void dumpFunction( Stream &stream, const char* brief = dStrstr( doc, "@brief" ); if( !brief ) { - String brief = entry->getBriefDescription( &doc ); + String briefStr = entry->getBriefDescription( &doc ); - brief.trim(); - if( !brief.isEmpty() ) + briefStr.trim(); + if( !briefStr.isEmpty() ) { stream.writeText( "@brief " ); - stream.writeText( brief ); + stream.writeText(briefStr); stream.writeText( "\r\n\r\n" ); } } diff --git a/Engine/source/console/fieldBrushObject.cpp b/Engine/source/console/fieldBrushObject.cpp index 0caf00e48..486b5c40a 100644 --- a/Engine/source/console/fieldBrushObject.cpp +++ b/Engine/source/console/fieldBrushObject.cpp @@ -449,10 +449,10 @@ void FieldBrushObject::copyFields( SimObject* pSimObject, const char* fieldList // Yes, so is this field name selected? // Iterate fields... - for ( U32 fieldIndex = 0; fieldIndex < fields.size(); ++fieldIndex ) + for ( U32 findFieldIDx = 0; findFieldIDx < fields.size(); ++findFieldIDx) { // Field selected? - if ( staticField.pFieldname == fields[fieldIndex] ) + if ( staticField.pFieldname == fields[findFieldIDx] ) { // Yes, so flag as such. fieldSpecified = true; diff --git a/Engine/source/console/simDatablock.cpp b/Engine/source/console/simDatablock.cpp index e2984c16a..84d11f932 100644 --- a/Engine/source/console/simDatablock.cpp +++ b/Engine/source/console/simDatablock.cpp @@ -62,20 +62,20 @@ SimDataBlock::SimDataBlock() SimDataBlock::SubstitutionStatement::SubstitutionStatement(StringTableEntry slot, S32 idx, const char* value) { - this->slot = slot; - this->idx = idx; - this->value = dStrdup(value); + this->mSlot = slot; + this->mIdx = idx; + this->mValue = dStrdup(value); } SimDataBlock::SubstitutionStatement::~SubstitutionStatement() { - dFree(value); + dFree(mValue); } void SimDataBlock::SubstitutionStatement::replaceValue(const char* value) { - dFree(this->value); - this->value = dStrdup(value); + dFree(this->mValue); + this->mValue = dStrdup(value); } // this is the copy-constructor for creating temp-clones. @@ -109,7 +109,7 @@ void SimDataBlock::addSubstitution(StringTableEntry slot, S32 idx, const char* s for (S32 i = 0; i < substitutions.size(); i++) { - if (substitutions[i] && substitutions[i]->slot == slot && substitutions[i]->idx == idx) + if (substitutions[i] && substitutions[i]->mSlot == slot && substitutions[i]->mIdx == idx) { if (empty_subs) { @@ -137,8 +137,8 @@ const char* SimDataBlock::getSubstitution(StringTableEntry slot, S32 idx) { for (S32 i = 0; i < substitutions.size(); i++) { - if (substitutions[i] && substitutions[i]->slot == slot && substitutions[i]->idx == idx) - return substitutions[i]->value; + if (substitutions[i] && substitutions[i]->mSlot == slot && substitutions[i]->mIdx == idx) + return substitutions[i]->mValue; } return 0; @@ -147,7 +147,7 @@ const char* SimDataBlock::getSubstitution(StringTableEntry slot, S32 idx) bool SimDataBlock::fieldHasSubstitution(StringTableEntry slot) { for (S32 i = 0; i < substitutions.size(); i++) - if (substitutions[i] && substitutions[i]->slot == slot) + if (substitutions[i] && substitutions[i]->mSlot == slot) return true; return false; } @@ -156,7 +156,7 @@ void SimDataBlock::printSubstitutions() { for (S32 i = 0; i < substitutions.size(); i++) if (substitutions[i]) - Con::errorf("SubstitutionStatement[%s] = \"%s\" -- %d", substitutions[i]->slot, substitutions[i]->value, i); + Con::errorf("SubstitutionStatement[%s] = \"%s\" -- %d", substitutions[i]->mSlot, substitutions[i]->mValue, i); } void SimDataBlock::copySubstitutionsFrom(SimDataBlock* other) @@ -170,7 +170,7 @@ void SimDataBlock::copySubstitutionsFrom(SimDataBlock* other) if (other->substitutions[i]) { SubstitutionStatement* subs = other->substitutions[i]; - substitutions.push_back(new SubstitutionStatement(subs->slot, subs->idx, subs->value)); + substitutions.push_back(new SubstitutionStatement(subs->mSlot, subs->mIdx, subs->mValue)); } } } @@ -212,7 +212,7 @@ void SimDataBlock::performSubstitutions(SimDataBlock* dblock, const SimObject* o char* b = buffer; // perform special token expansion (%% and ##) - const char* v = substitutions[i]->value; + const char* v = substitutions[i]->mValue; while (*v != '\0') { // identify "%%" tokens and replace with id @@ -258,7 +258,7 @@ void SimDataBlock::performSubstitutions(SimDataBlock* dblock, const SimObject* o if (Compiler::gSyntaxError) { Con::errorf("Field Substitution Failed: field=\"%s\" substitution=\"%s\" -- syntax error", - substitutions[i]->slot, substitutions[i]->value); + substitutions[i]->mSlot, substitutions[i]->mValue); Compiler::gSyntaxError = false; return; } @@ -267,7 +267,7 @@ void SimDataBlock::performSubstitutions(SimDataBlock* dblock, const SimObject* o if (result == 0 || result[0] == '\0') { Con::errorf("Field Substitution Failed: field=\"%s\" substitution=\"%s\" -- empty result", - substitutions[i]->slot, substitutions[i]->value); + substitutions[i]->mSlot, substitutions[i]->mValue); return; } @@ -282,29 +282,29 @@ void SimDataBlock::performSubstitutions(SimDataBlock* dblock, const SimObject* o result = ""; } - const AbstractClassRep::Field* field = dblock->getClassRep()->findField(substitutions[i]->slot); + const AbstractClassRep::Field* field = dblock->getClassRep()->findField(substitutions[i]->mSlot); if (!field) { // this should be very unlikely... - Con::errorf("Field Substitution Failed: unknown field, \"%s\".", substitutions[i]->slot); + Con::errorf("Field Substitution Failed: unknown field, \"%s\".", substitutions[i]->mSlot); continue; } if (field->keepClearSubsOnly && result[0] != '\0') { Con::errorf("Field Substitution Failed: field \"%s\" of datablock %s only allows \"$$ ~~\" (keep) and \"$$ ~0\" (clear) field substitutions. [%s]", - substitutions[i]->slot, this->getClassName(), this->getName()); + substitutions[i]->mSlot, this->getClassName(), this->getName()); continue; } // substitute the field value with its replacement - Con::setData(field->type, (void*)(((const char*)(dblock)) + field->offset), substitutions[i]->idx, 1, &result, field->table, field->flag); + Con::setData(field->type, (void*)(((const char*)(dblock)) + field->offset), substitutions[i]->mIdx, 1, &result, field->table, field->flag); //dStrncpy(buffer, result, 255); //Con::errorf("SUBSTITUTION %s.%s[%d] = %s idx=%s", Con::getIntArg(getId()), substitutions[i]->slot, substitutions[i]->idx, buffer, index_str); // notify subclasses of a field modification - dblock->onStaticModified(substitutions[i]->slot); + dblock->onStaticModified(substitutions[i]->mSlot); } } @@ -366,9 +366,9 @@ void SimDataBlock::packData(BitStream* stream) if (substitutions[i]) { stream->writeFlag(true); - stream->writeString(substitutions[i]->slot); - stream->write(substitutions[i]->idx); - stream->writeString(substitutions[i]->value); + stream->writeString(substitutions[i]->mSlot); + stream->write(substitutions[i]->mIdx); + stream->writeString(substitutions[i]->mValue); } } stream->writeFlag(false); diff --git a/Engine/source/console/simDatablock.h b/Engine/source/console/simDatablock.h index d6a7dcd52..21856bb46 100644 --- a/Engine/source/console/simDatablock.h +++ b/Engine/source/console/simDatablock.h @@ -179,9 +179,9 @@ public: protected: struct SubstitutionStatement { - StringTableEntry slot; - S32 idx; - char* value; + StringTableEntry mSlot; + S32 mIdx; + char* mValue; SubstitutionStatement(StringTableEntry slot, S32 idx, const char* value); ~SubstitutionStatement(); void replaceValue(const char* value); diff --git a/Engine/source/console/simDictionary.cpp b/Engine/source/console/simDictionary.cpp index b733d9fcc..4f5aac411 100644 --- a/Engine/source/console/simDictionary.cpp +++ b/Engine/source/console/simDictionary.cpp @@ -45,13 +45,13 @@ SimNameDictionary::~SimNameDictionary() void SimNameDictionary::insert(SimObject* obj) { - if (!obj || !obj->objectName) + if (!obj || !obj->getName()) return; - SimObject* checkForDup = find(obj->objectName); + SimObject* checkForDup = find(obj->getName()); if (checkForDup) - Con::warnf("Warning! You have a duplicate datablock name of %s. This can cause problems. You should rename one of them.", obj->objectName); + Con::warnf("Warning! You have a duplicate datablock name of %s. This can cause problems. You should rename one of them.", obj->getName()); Mutex::lockMutex(mutex); #ifndef USE_NEW_SIMDICTIONARY @@ -64,7 +64,7 @@ void SimNameDictionary::insert(SimObject* obj) dMemset(hashTable, 0, sizeof(*hashTable) * DefaultTableSize); } - S32 idx = HashPointer(obj->objectName) % hashTableSize; + S32 idx = HashPointer(obj->getName()) % hashTableSize; obj->nextNameObject = hashTable[idx]; hashTable[idx] = obj; hashEntryCount++; @@ -86,7 +86,7 @@ void SimNameDictionary::insert(SimObject* obj) { SimObject* next = object->nextNameObject; - idx = HashPointer(object->objectName) % newHashTableSize; + idx = HashPointer(object->getName()) % newHashTableSize; object->nextNameObject = newHashTable[idx]; newHashTable[idx] = object; @@ -118,7 +118,7 @@ SimObject* SimNameDictionary::find(StringTableEntry name) SimObject *walk = hashTable[idx]; while (walk) { - if (walk->objectName == name) + if (walk->getName() == name) { Mutex::unlockMutex(mutex); return walk; @@ -139,12 +139,12 @@ SimObject* SimNameDictionary::find(StringTableEntry name) void SimNameDictionary::remove(SimObject* obj) { - if (!obj || !obj->objectName) + if (!obj || !obj->getName()) return; Mutex::lockMutex(mutex); #ifndef USE_NEW_SIMDICTIONARY - SimObject **walk = &hashTable[HashPointer(obj->objectName) % hashTableSize]; + SimObject **walk = &hashTable[HashPointer(obj->getName()) % hashTableSize]; while (*walk) { if (*walk == obj) @@ -190,12 +190,12 @@ SimManagerNameDictionary::~SimManagerNameDictionary() void SimManagerNameDictionary::insert(SimObject* obj) { - if (!obj || !obj->objectName) + if (!obj || !obj->getName()) return; Mutex::lockMutex(mutex); #ifndef USE_NEW_SIMDICTIONARY - S32 idx = HashPointer(obj->objectName) % hashTableSize; + S32 idx = HashPointer(obj->getName()) % hashTableSize; obj->nextManagerNameObject = hashTable[idx]; hashTable[idx] = obj; hashEntryCount++; @@ -217,7 +217,7 @@ void SimManagerNameDictionary::insert(SimObject* obj) { SimObject* next = object->nextManagerNameObject; - idx = HashPointer(object->objectName) % newHashTableSize; + idx = HashPointer(object->getName()) % newHashTableSize; object->nextManagerNameObject = newHashTable[idx]; newHashTable[idx] = object; @@ -247,7 +247,7 @@ SimObject* SimManagerNameDictionary::find(StringTableEntry name) SimObject *walk = hashTable[idx]; while (walk) { - if (walk->objectName == name) + if (walk->getName() == name) { Mutex::unlockMutex(mutex); return walk; @@ -267,13 +267,13 @@ SimObject* SimManagerNameDictionary::find(StringTableEntry name) void SimManagerNameDictionary::remove(SimObject* obj) { - if (!obj || !obj->objectName) + if (!obj || !obj->getName()) return; #ifndef USE_NEW_SIMDICTIONARY Mutex::lockMutex(mutex); - SimObject **walk = &hashTable[HashPointer(obj->objectName) % hashTableSize]; + SimObject **walk = &hashTable[HashPointer(obj->getName()) % hashTableSize]; while (*walk) { if (*walk == obj) diff --git a/Engine/source/console/simFieldDictionary.cpp b/Engine/source/console/simFieldDictionary.cpp index 397b51d23..332224160 100644 --- a/Engine/source/console/simFieldDictionary.cpp +++ b/Engine/source/console/simFieldDictionary.cpp @@ -245,17 +245,17 @@ void SimFieldDictionary::writeFields(SimObject *obj, Stream &stream, U32 tabStop const AbstractClassRep::FieldList &list = obj->getFieldList(); Vector flist(__FILE__, __LINE__); - for (U32 i = 0; i < HashTableSize; i++) + for (U32 curEntry = 0; curEntry < HashTableSize; curEntry++) { - for (Entry *walk = mHashTable[i]; walk; walk = walk->next) + for (Entry *walk = mHashTable[curEntry]; walk; walk = walk->next) { // make sure we haven't written this out yet: - U32 i; - for (i = 0; i < list.size(); i++) - if (list[i].pFieldname == walk->slotName) + U32 curField; + for (curField = 0; curField < list.size(); curField++) + if (list[curField].pFieldname == walk->slotName) break; - if (i != list.size()) + if (curField != list.size()) continue; @@ -293,17 +293,17 @@ void SimFieldDictionary::printFields(SimObject *obj) char expandedBuffer[4096]; Vector flist(__FILE__, __LINE__); - for (U32 i = 0; i < HashTableSize; i++) + for (U32 curEntry = 0; curEntry < HashTableSize; curEntry++) { - for (Entry *walk = mHashTable[i]; walk; walk = walk->next) + for (Entry *walk = mHashTable[curEntry]; walk; walk = walk->next) { // make sure we haven't written this out yet: - U32 i; - for (i = 0; i < list.size(); i++) - if (list[i].pFieldname == walk->slotName) + U32 curField; + for (curField = 0; curField < list.size(); curField++) + if (list[curField].pFieldname == walk->slotName) break; - if (i != list.size()) + if (curField != list.size()) continue; flist.push_back(walk); diff --git a/Engine/source/console/simManager.cpp b/Engine/source/console/simManager.cpp index 4f12fa85f..fc8a77edd 100644 --- a/Engine/source/console/simManager.cpp +++ b/Engine/source/console/simManager.cpp @@ -612,6 +612,6 @@ void SimDataBlockGroup::sort() if(mLastModifiedKey != SimDataBlock::getNextModifiedKey()) { mLastModifiedKey = SimDataBlock::getNextModifiedKey(); - dQsort(objectList.address(),objectList.size(),sizeof(SimObject *),compareModifiedKey); + dQsort(mObjectList.address(), mObjectList.size(),sizeof(SimObject *),compareModifiedKey); } } diff --git a/Engine/source/console/simObject.cpp b/Engine/source/console/simObject.cpp index b47448414..ef23f0448 100644 --- a/Engine/source/console/simObject.cpp +++ b/Engine/source/console/simObject.cpp @@ -71,7 +71,7 @@ namespace Sim SimObject::SimObject() { - objectName = NULL; + mObjectName = NULL; mOriginalName = NULL; mInternalName = NULL; nextNameObject = nullptr; @@ -128,10 +128,10 @@ SimObject::~SimObject() AssertFatal(nextNameObject == nullptr,avar( "SimObject::~SimObject: Not removed from dictionary: name %s, id %i", - objectName, mId)); + mObjectName, mId)); AssertFatal(nextManagerNameObject == nullptr,avar( "SimObject::~SimObject: Not removed from manager dictionary: name %s, id %i", - objectName,mId)); + mObjectName,mId)); AssertFatal(mFlags.test(Added) == 0, "SimObject::object " "missing call to SimObject::onRemove"); } @@ -149,7 +149,7 @@ void SimObject::initPersistFields() { addGroup( "Ungrouped" ); - addProtectedField( "name", TypeName, Offset(objectName, SimObject), &setProtectedName, &defaultProtectedGetFn, + addProtectedField( "name", TypeName, Offset(mObjectName, SimObject), &setProtectedName, &defaultProtectedGetFn, "Optional global name of this object." ); endGroup( "Ungrouped" ); @@ -211,8 +211,8 @@ String SimObject::describeSelf() const if( mId != 0 ) desc = avar( "%s|id: %i", desc.c_str(), mId ); - if( objectName ) - desc = avar( "%s|name: %s", desc.c_str(), objectName ); + if(mObjectName) + desc = avar( "%s|name: %s", desc.c_str(), mObjectName); if( mInternalName ) desc = avar( "%s|internal: %s", desc.c_str(), mInternalName ); if( mNameSpace ) @@ -529,17 +529,17 @@ void SimObject::onTamlCustomRead(TamlCustomNodes const& customNodes) for (TamlCustomFieldVector::const_iterator fieldItr = fields.begin(); fieldItr != fields.end(); ++fieldItr) { // Fetch field. - const TamlCustomField* pField = *fieldItr; + const TamlCustomField* cField = *fieldItr; // Fetch field name. - StringTableEntry fieldName = pField->getFieldName(); + StringTableEntry fieldName = cField->getFieldName(); const AbstractClassRep::Field* field = findField(fieldName); // Check common fields. if (field) { - setDataField(fieldName, buf, pField->getFieldValue()); + setDataField(fieldName, buf, cField->getFieldValue()); } else { @@ -754,9 +754,9 @@ void SimObject::setId(SimObjectId newId) void SimObject::assignName(const char *name) { - if( objectName && !isNameChangeAllowed() ) + if(mObjectName && !isNameChangeAllowed() ) { - Con::errorf( "SimObject::assignName - not allowed to change name of object '%s'", objectName ); + Con::errorf( "SimObject::assignName - not allowed to change name of object '%s'", mObjectName); return; } @@ -781,7 +781,7 @@ void SimObject::assignName(const char *name) Sim::gNameDictionary->remove( this ); } - objectName = newName; + mObjectName = newName; if( mGroup ) mGroup->mNameDictionary.insert( this ); @@ -1373,7 +1373,7 @@ SimObject::SimObject(const SimObject& other, bool temp_clone) { is_temp_clone = temp_clone; - objectName = other.objectName; + mObjectName = other.mObjectName; mOriginalName = other.mOriginalName; nextNameObject = other.nextNameObject; nextManagerNameObject = other.nextManagerNameObject; diff --git a/Engine/source/console/simObject.h b/Engine/source/console/simObject.h index 2119ea6a9..585944df7 100644 --- a/Engine/source/console/simObject.h +++ b/Engine/source/console/simObject.h @@ -293,7 +293,7 @@ class SimObject: public ConsoleObject, public TamlCallbacks }; // dictionary information stored on the object - StringTableEntry objectName; + StringTableEntry mObjectName; StringTableEntry mOriginalName; SimObject* nextNameObject; SimObject* nextManagerNameObject; @@ -358,7 +358,7 @@ class SimObject: public ConsoleObject, public TamlCallbacks { static_cast(object)->setSuperClassNamespace(data); return false; }; static bool writeObjectName(void* obj, StringTableEntry pFieldName) - { SimObject* simObject = static_cast(obj); return simObject->objectName != NULL && simObject->objectName != StringTable->EmptyString(); } + { SimObject* simObject = static_cast(obj); return simObject->mObjectName != NULL && simObject->mObjectName != StringTable->EmptyString(); } static bool writeCanSaveDynamicFields(void* obj, StringTableEntry pFieldName) { return static_cast(obj)->mCanSaveFieldDictionary == false; } static bool writeInternalName(void* obj, StringTableEntry pFieldName) @@ -761,7 +761,7 @@ class SimObject: public ConsoleObject, public TamlCallbacks const char* getIdString() const { return mIdString; } /// Return the name of this object. - StringTableEntry getName() const { return objectName; } + StringTableEntry getName() const { return mObjectName; } /// Return the SimGroup that this object is contained in. Never NULL except for /// RootGroup and unregistered objects. diff --git a/Engine/source/console/simSet.cpp b/Engine/source/console/simSet.cpp index c44b09c36..718e5f158 100644 --- a/Engine/source/console/simSet.cpp +++ b/Engine/source/console/simSet.cpp @@ -118,7 +118,7 @@ IMPLEMENT_CALLBACK( SimSet, onObjectRemoved, void, ( SimObject* object ), ( obje SimSet::SimSet() { - VECTOR_SET_ASSOCIATION( objectList ); + VECTOR_SET_ASSOCIATION(mObjectList); mMutex = Mutex::createMutex(); } @@ -139,7 +139,7 @@ void SimSet::addObject( SimObject* obj ) lock(); - const bool added = objectList.pushBack( obj ); + const bool added = mObjectList.pushBack( obj ); if( added ) deleteNotify( obj ); @@ -159,7 +159,7 @@ void SimSet::removeObject( SimObject* obj ) { lock(); - const bool removed = objectList.remove( obj ); + const bool removed = mObjectList.remove( obj ); if( removed ) clearNotify( obj ); @@ -182,7 +182,7 @@ void SimSet::pushObject( SimObject* obj ) lock(); - bool added = objectList.pushBackForce( obj ); + bool added = mObjectList.pushBackForce( obj ); if( added ) deleteNotify( obj ); @@ -200,15 +200,15 @@ void SimSet::pushObject( SimObject* obj ) void SimSet::popObject() { - if( objectList.empty() ) + if(mObjectList.empty() ) { AssertWarn(false, "Stack underflow in SimSet::popObject"); return; } lock(); - SimObject* object = objectList.last(); - objectList.pop_back(); + SimObject* object = mObjectList.last(); + mObjectList.pop_back(); clearNotify( object ); unlock(); @@ -223,7 +223,7 @@ void SimSet::popObject() void SimSet::scriptSort( const String &scriptCallbackFn ) { lock(); - objectList.scriptSort( scriptCallbackFn ); + mObjectList.scriptSort( scriptCallbackFn ); unlock(); } @@ -303,8 +303,8 @@ bool SimSet::reOrder( SimObject *obj, SimObject *target ) if ( itrS != (end()-1) ) { // remove object from its current location and push to back of list - objectList.erase(itrS); - objectList.push_back(obj); + mObjectList.erase(itrS); + mObjectList.push_back(obj); } } else @@ -314,12 +314,12 @@ bool SimSet::reOrder( SimObject *obj, SimObject *target ) // target must be in list return false; - objectList.erase(itrS); + mObjectList.erase(itrS); // once itrS has been erased, itrD won't be pointing at the // same place anymore - re-find... itrD = find(begin(),end(),target); - objectList.insert(itrD, obj); + mObjectList.insert(itrD, obj); } return true; @@ -340,15 +340,15 @@ void SimSet::onRemove() MutexHandle handle; handle.lock( mMutex ); - if( !objectList.empty() ) + if( !mObjectList.empty() ) { - objectList.sortId(); + mObjectList.sortId(); // This backwards iterator loop doesn't work if the // list is empty, check the size first. - for( SimObjectList::iterator ptr = objectList.end() - 1; - ptr >= objectList.begin(); ptr -- ) + for( SimObjectList::iterator ptr = mObjectList.end() - 1; + ptr >= mObjectList.begin(); ptr -- ) clearNotify( *ptr ); } @@ -417,8 +417,8 @@ void SimSet::deleteAllObjects() lock(); while( !empty() ) { - SimObject* object = objectList.last(); - objectList.pop_back(); + SimObject* object = mObjectList.last(); + mObjectList.pop_back(); object->deleteObject(); } @@ -536,7 +536,7 @@ SimObject* SimSet::findObjectByLineNumber(const char* fileName, S32 declarationL SimObject* SimSet::getRandom() { if (size() > 0) - return objectList[mRandI(0, size() - 1)]; + return mObjectList[mRandI(0, size() - 1)]; return NULL; } @@ -640,7 +640,7 @@ void SimGroup::_addObject( SimObject* obj, bool forcePushBack ) if( obj->getGroup() ) obj->getGroup()->removeObject( obj ); - if( forcePushBack ? objectList.pushBack( obj ) : objectList.pushBackForce( obj ) ) + if( forcePushBack ? mObjectList.pushBack( obj ) : mObjectList.pushBackForce( obj ) ) { mNameDictionary.insert( obj ); obj->mGroup = this; @@ -685,7 +685,7 @@ void SimGroup::_removeObjectNoLock( SimObject* obj ) obj->onGroupRemove(); mNameDictionary.remove( obj ); - objectList.remove( obj ); + mObjectList.remove( obj ); obj->mGroup = 0; getSetModificationSignal().trigger( SetObjectRemoved, this, obj ); @@ -709,14 +709,14 @@ void SimGroup::popObject() MutexHandle handle; handle.lock( mMutex ); - if( objectList.empty() ) + if(mObjectList.empty() ) { AssertWarn( false, "SimGroup::popObject - Stack underflow" ); return; } - SimObject* object = objectList.last(); - objectList.pop_back(); + SimObject* object = mObjectList.last(); + mObjectList.pop_back(); object->onGroupRemove(); object->mGroup = NULL; @@ -736,9 +736,9 @@ void SimGroup::popObject() void SimGroup::onRemove() { lock(); - if( !objectList.empty() ) + if( !mObjectList.empty() ) { - objectList.sortId(); + mObjectList.sortId(); clear(); } SimObject::onRemove(); @@ -752,10 +752,10 @@ void SimGroup::clear() lock(); while( size() > 0 ) { - SimObject* object = objectList.last(); + SimObject* object = mObjectList.last(); object->onGroupRemove(); - objectList.pop_back(); + mObjectList.pop_back(); mNameDictionary.remove( object ); object->mGroup = 0; diff --git a/Engine/source/console/simSet.h b/Engine/source/console/simSet.h index 4bb6e9300..013b1f807 100644 --- a/Engine/source/console/simSet.h +++ b/Engine/source/console/simSet.h @@ -114,7 +114,7 @@ class SimSet : public SimObject, public TamlChildren protected: - SimObjectList objectList; + SimObjectList mObjectList; void *mMutex; /// Signal that is triggered when objects are added or removed from the set. @@ -144,14 +144,14 @@ class SimSet : public SimObject, public TamlChildren /// typedef SimObjectList::iterator iterator; typedef SimObjectList::value_type value; - SimObject* front() { return objectList.front(); } - SimObject* first() { return objectList.first(); } - SimObject* last() { return objectList.last(); } - bool empty() const { return objectList.empty(); } - S32 size() const { return objectList.size(); } - iterator begin() { return objectList.begin(); } - iterator end() { return objectList.end(); } - value operator[] (S32 index) { return objectList[U32(index)]; } + SimObject* front() { return mObjectList.front(); } + SimObject* first() { return mObjectList.first(); } + SimObject* last() { return mObjectList.last(); } + bool empty() const { return mObjectList.empty(); } + S32 size() const { return mObjectList.size(); } + iterator begin() { return mObjectList.begin(); } + iterator end() { return mObjectList.end(); } + value operator[] (S32 index) { return mObjectList[U32(index)]; } inline iterator find( iterator first, iterator last, SimObject *obj) { return T3D::find(first, last, obj); } @@ -163,7 +163,7 @@ class SimSet : public SimObject, public TamlChildren virtual bool reOrder( SimObject *obj, SimObject *target=0 ); /// Return the object at the given index. - SimObject* at(S32 index) const { return objectList.at(index); } + SimObject* at(S32 index) const { return mObjectList.at(index); } /// Remove all objects from this set. virtual void clear(); @@ -263,7 +263,7 @@ class SimSet : public SimObject, public TamlChildren #ifdef TORQUE_DEBUG_GUARD inline void _setVectorAssoc( const char *file, const U32 line ) { - objectList.setFileAssociation( file, line ); + mObjectList.setFileAssociation( file, line ); } #endif @@ -324,9 +324,9 @@ void SimSet::findObjectByType( Vector &foundObjects ) // Loop through our child objects. - SimObjectList::iterator itr = objectList.begin(); + SimObjectList::iterator itr = mObjectList.begin(); - for ( ; itr != objectList.end(); itr++ ) + for ( ; itr != mObjectList.end(); itr++ ) { curObj = dynamic_cast( *itr ); curSet = dynamic_cast( *itr ); @@ -358,9 +358,9 @@ void SimSet::findObjectByCallback( bool ( *fn )( T* ), Vector &foundObjects // Loop through our child objects. - SimObjectList::iterator itr = objectList.begin(); + SimObjectList::iterator itr = mObjectList.begin(); - for ( ; itr != objectList.end(); itr++ ) + for ( ; itr != mObjectList.end(); itr++ ) { curObj = dynamic_cast( *itr ); curSet = dynamic_cast( *itr ); diff --git a/Engine/source/core/stream/bitStream.cpp b/Engine/source/core/stream/bitStream.cpp index 3ee527a04..1a5ab3202 100644 --- a/Engine/source/core/stream/bitStream.cpp +++ b/Engine/source/core/stream/bitStream.cpp @@ -78,7 +78,7 @@ ResizeBitStream::ResizeBitStream(U32 minSpace, U32 initialSize) : BitStream(NULL ResizeBitStream::~ResizeBitStream() { - dFree(dataPtr); + dFree(mDataPtr); } void ResizeBitStream::validate() @@ -86,7 +86,7 @@ void ResizeBitStream::validate() if(getPosition() + mMinSpace > bufSize) { bufSize = getPosition() + mMinSpace * 2; - dataPtr = (U8 *) dRealloc(dataPtr, bufSize); + mDataPtr = (U8 *) dRealloc(mDataPtr, bufSize); maxReadBitNum = bufSize << 3; maxWriteBitNum = bufSize << 3; @@ -148,7 +148,7 @@ HuffmanProcessor HuffmanProcessor::g_huffProcessor; void BitStream::setBuffer(void *bufPtr, S32 size, S32 maxSize) { - dataPtr = (U8 *) bufPtr; + mDataPtr = (U8 *) bufPtr; bitNum = 0; bufSize = size; maxReadBitNum = size << 3; @@ -178,7 +178,7 @@ U32 BitStream::getStreamSize() U8 *BitStream::getBytePtr() { - return dataPtr + getPosition(); + return mDataPtr + getPosition(); } @@ -194,7 +194,7 @@ U32 BitStream::getWriteByteSize() void BitStream::clear() { - dMemset(dataPtr, 0, bufSize); + dMemset(mDataPtr, 0, bufSize); } void BitStream::writeClassId(U32 classId, U32 classType, U32 classGroup) @@ -242,9 +242,9 @@ void BitStream::writeBits(S32 bitCount, const void *bitPtr) for(S32 srcBitNum = 0;srcBitNum < bitCount;srcBitNum++) { if((*(ptr + (srcBitNum >> 3)) & (1 << (srcBitNum & 0x7))) != 0) - *(dataPtr + (bitNum >> 3)) |= (1 << (bitNum & 0x7)); + *(mDataPtr + (bitNum >> 3)) |= (1 << (bitNum & 0x7)); else - *(dataPtr + (bitNum >> 3)) &= ~(1 << (bitNum & 0x7)); + *(mDataPtr + (bitNum >> 3)) &= ~(1 << (bitNum & 0x7)); bitNum++; } } @@ -252,14 +252,14 @@ void BitStream::writeBits(S32 bitCount, const void *bitPtr) void BitStream::setBit(S32 bitCount, bool set) { if(set) - *(dataPtr + (bitCount >> 3)) |= (1 << (bitCount & 0x7)); + *(mDataPtr + (bitCount >> 3)) |= (1 << (bitCount & 0x7)); else - *(dataPtr + (bitCount >> 3)) &= ~(1 << (bitCount & 0x7)); + *(mDataPtr + (bitCount >> 3)) &= ~(1 << (bitCount & 0x7)); } bool BitStream::testBit(S32 bitCount) { - return (*(dataPtr + (bitCount >> 3)) & (1 << (bitCount & 0x7))) != 0; + return (*(mDataPtr + (bitCount >> 3)) & (1 << (bitCount & 0x7))) != 0; } bool BitStream::writeFlag(bool val) @@ -271,9 +271,9 @@ bool BitStream::writeFlag(bool val) return false; } if(val) - *(dataPtr + (bitNum >> 3)) |= (1 << (bitNum & 0x7)); + *(mDataPtr + (bitNum >> 3)) |= (1 << (bitNum & 0x7)); else - *(dataPtr + (bitNum >> 3)) &= ~(1 << (bitNum & 0x7)); + *(mDataPtr + (bitNum >> 3)) &= ~(1 << (bitNum & 0x7)); bitNum++; return (val); } @@ -289,7 +289,7 @@ void BitStream::readBits(S32 bitCount, void *bitPtr) AssertWarn(false, "Out of range read"); return; } - U8 *stPtr = dataPtr + (bitNum >> 3); + U8 *stPtr = mDataPtr + (bitNum >> 3); S32 byteCount = (bitCount + 7) >> 3; U8 *ptr = (U8 *) bitPtr; @@ -298,7 +298,7 @@ void BitStream::readBits(S32 bitCount, void *bitPtr) S32 upShift = 8 - downShift; U8 curB = *stPtr; - const U8 *stEnd = dataPtr + bufSize; + const U8 *stEnd = mDataPtr + bufSize; while(byteCount--) { stPtr++; @@ -628,7 +628,7 @@ void InfiniteBitStream::validate(U32 upcomingBytes) if(getPosition() + upcomingBytes + mMinSpace > bufSize) { bufSize = getPosition() + upcomingBytes + mMinSpace; - dataPtr = (U8 *) dRealloc(dataPtr, bufSize); + mDataPtr = (U8 *) dRealloc(mDataPtr, bufSize); maxReadBitNum = bufSize << 3; maxWriteBitNum = bufSize << 3; @@ -643,11 +643,11 @@ void InfiniteBitStream::compact() // Copy things... bufSize = getPosition() + mMinSpace * 2; - dMemcpy(tmp, dataPtr, oldSize); + dMemcpy(tmp, mDataPtr, oldSize); // And clean up. - dFree(dataPtr); - dataPtr = tmp; + dFree(mDataPtr); + mDataPtr = tmp; maxReadBitNum = bufSize << 3; maxWriteBitNum = bufSize << 3; @@ -655,7 +655,7 @@ void InfiniteBitStream::compact() void InfiniteBitStream::writeToStream(Stream &s) { - s.write(getPosition(), dataPtr); + s.write(getPosition(), mDataPtr); } //------------------------------------------------------------------------------ @@ -781,7 +781,7 @@ void HuffmanProcessor::generateCodes(BitStream& rBS, S32 index, S32 depth) // leaf node, copy the code in, and back out... HuffLeaf& rLeaf = m_huffLeaves[-(index + 1)]; - dMemcpy(&rLeaf.code, rBS.dataPtr, sizeof(rLeaf.code)); + dMemcpy(&rLeaf.code, rBS.mDataPtr, sizeof(rLeaf.code)); rLeaf.numBits = depth; } else { HuffNode& rNode = m_huffNodes[index]; diff --git a/Engine/source/core/stream/bitStream.h b/Engine/source/core/stream/bitStream.h index 93287b938..b0bb2f22a 100644 --- a/Engine/source/core/stream/bitStream.h +++ b/Engine/source/core/stream/bitStream.h @@ -53,7 +53,7 @@ class QuatF; class BitStream : public Stream { protected: - U8 *dataPtr; + U8 *mDataPtr; S32 bitNum; S32 bufSize; bool error; @@ -68,7 +68,7 @@ public: static void sendPacketStream(const NetAddress *addr); void setBuffer(void *bufPtr, S32 bufSize, S32 maxSize = 0); - U8* getBuffer() { return dataPtr; } + U8* getBuffer() { return mDataPtr; } U8* getBytePtr(); U32 getReadByteSize(); @@ -337,7 +337,7 @@ inline bool BitStream::readFlag() return false; } S32 mask = 1 << (bitNum & 0x7); - bool ret = (*(dataPtr + (bitNum >> 3)) & mask) != 0; + bool ret = (*(mDataPtr + (bitNum >> 3)) & mask) != 0; bitNum++; return ret; } diff --git a/Engine/source/core/stringTable.cpp b/Engine/source/core/stringTable.cpp index d29519198..f88a0af2f 100644 --- a/Engine/source/core/stringTable.cpp +++ b/Engine/source/core/stringTable.cpp @@ -233,7 +233,7 @@ void _StringTable::resize(const U32 _newSize) walk = head; while(walk) { U32 key; - Node *temp = walk; + temp = walk; walk = walk->next; key = hashString(temp->val); diff --git a/Engine/source/core/tSparseArray.h b/Engine/source/core/tSparseArray.h index 5a15b1f81..4f3800447 100644 --- a/Engine/source/core/tSparseArray.h +++ b/Engine/source/core/tSparseArray.h @@ -113,14 +113,14 @@ inline void SparseArray::insert(T* pObject, U32 key) template inline T* SparseArray::remove(U32 key) { - U32 remove = key % mModulus; - Node* probe = &mSentryTables[remove]; + U32 sentryID = key % mModulus; + Node* probe = &mSentryTables[sentryID]; while (probe->next != NULL) { if (probe->next->key == key) { - Node* remove = probe->next; - T* pReturn = remove->pObject; - probe->next = remove->next; - delete remove; + Node* nextProbe = probe->next; + T* pReturn = nextProbe->pObject; + probe->next = nextProbe->next; + delete nextProbe; return pReturn; } probe = probe->next; diff --git a/Engine/source/core/util/tSignal.cpp b/Engine/source/core/util/tSignal.cpp index 30980a715..d323bec0c 100644 --- a/Engine/source/core/util/tSignal.cpp +++ b/Engine/source/core/util/tSignal.cpp @@ -28,9 +28,9 @@ void SignalBase::DelegateLink::insert(DelegateLink* node, F32 order) { // Note: can only legitimately be called on list head DelegateLink * walk = next; - while (order >= walk->order && walk->next != this) + while (order >= walk->mOrder && walk->next != this) walk = walk->next; - if (order >= walk->order) + if (order >= walk->mOrder) { // insert after walk node->prev = walk; @@ -46,7 +46,7 @@ void SignalBase::DelegateLink::insert(DelegateLink* node, F32 order) walk->prev->next = node; walk->prev = node; } - node->order = order; + node->mOrder = order; } void SignalBase::DelegateLink::unlink() diff --git a/Engine/source/core/util/tSignal.h b/Engine/source/core/util/tSignal.h index 4960ba8dd..f5531e217 100644 --- a/Engine/source/core/util/tSignal.h +++ b/Engine/source/core/util/tSignal.h @@ -53,7 +53,7 @@ public: SignalBase() { mList.next = mList.prev = &mList; - mList.order = 0.5f; + mList.mOrder = 0.5f; } ~SignalBase(); @@ -72,7 +72,7 @@ protected: struct DelegateLink { DelegateLink *next,*prev; - F32 order; + F32 mOrder; void insert(DelegateLink* node, F32 order); void unlink(); @@ -191,7 +191,7 @@ public: for ( DelegateLink *ptr = base.mList.next; ptr != &base.mList; ptr = ptr->next ) { DelegateLinkImpl *del = static_cast( ptr ); - notify( del->mDelegate, del->order ); + notify( del->mDelegate, del->mOrder ); } } diff --git a/Engine/source/core/volume.cpp b/Engine/source/core/volume.cpp index 4c3c85b4e..3630f7ffb 100644 --- a/Engine/source/core/volume.cpp +++ b/Engine/source/core/volume.cpp @@ -808,7 +808,6 @@ bool MountSystem::isDirectory(const Path& path, FileSystemRef fsRef) if (fnRef.isNull()) return false; - FileNode::Attributes attr; if (fnRef->getAttributes(&attr)) return attr.flags & FileNode::Directory; return false; diff --git a/Engine/source/environment/VolumetricFog.cpp b/Engine/source/environment/VolumetricFog.cpp index 9235611d1..e0b1c6227 100644 --- a/Engine/source/environment/VolumetricFog.cpp +++ b/Engine/source/environment/VolumetricFog.cpp @@ -347,8 +347,8 @@ bool VolumetricFog::LoadShape() return false; } - mObjBox = mShape->bounds; - mRadius = mShape->radius; + mObjBox = mShape->mBounds; + mRadius = mShape->mRadius; resetWorldBox(); if (!isClientObject()) @@ -421,13 +421,13 @@ bool VolumetricFog::LoadShape() det_size[i].indices = new Vector(); - for (U32 k = 0; k < mesh->indices.size(); k++) - det_size[i].indices->push_back(mesh->indices[k]); + for (U32 k = 0; k < mesh->mIndices.size(); k++) + det_size[i].indices->push_back(mesh->mIndices[k]); - U32 primitivesSize = mesh->primitives.size(); + U32 primitivesSize = mesh->mPrimitives.size(); for (U32 k = 0; k < primitivesSize; k++) { - const TSDrawPrimitive & draw = mesh->primitives[k]; + const TSDrawPrimitive & draw = mesh->mPrimitives[k]; GFXPrimitiveType drawType = GFXdrawTypes[draw.matIndex >> 30]; switch (drawType) { @@ -436,7 +436,7 @@ bool VolumetricFog::LoadShape() pInfo.numPrimitives = draw.numElements / 3; pInfo.startIndex = draw.start; // Use the first index to determine which 16-bit address space we are operating in - pInfo.startVertex = mesh->indices[draw.start] & 0xFFFF0000; + pInfo.startVertex = mesh->mIndices[draw.start] & 0xFFFF0000; pInfo.minIndex = pInfo.startVertex; pInfo.numVertices = getMin((U32)0x10000, mesh->mNumVerts - pInfo.startVertex); break; @@ -445,7 +445,7 @@ bool VolumetricFog::LoadShape() pInfo.numPrimitives = draw.numElements - 2; pInfo.startIndex = draw.start; // Use the first index to determine which 16-bit address space we are operating in - pInfo.startVertex = mesh->indices[draw.start] & 0xFFFF0000; + pInfo.startVertex = mesh->mIndices[draw.start] & 0xFFFF0000; pInfo.minIndex = pInfo.startVertex; pInfo.numVertices = getMin((U32)0x10000, mesh->mNumVerts - pInfo.startVertex); break; @@ -560,8 +560,8 @@ U32 VolumetricFog::packUpdate(NetConnection *con, U32 mask, BitStream *stream) mShape = ResourceManager::get().load(mShapeName); if (bool(mShape) == false) return retMask; - mObjBox = mShape->bounds; - mRadius = mShape->radius; + mObjBox = mShape->mBounds; + mRadius = mShape->mRadius; resetWorldBox(); mObjSize = mWorldBox.getGreatestDiagonalLength(); mObjScale = getScale(); @@ -620,25 +620,20 @@ void VolumetricFog::unpackUpdate(NetConnection *con, BitStream *stream) stream->read(&mLightRayMod); if (isTicking()) { - char buf[20]; - dSprintf(buf, sizeof(buf), "%3.7f", mGlowStrength); - Con::setVariable("$VolFogGlowPostFx::glowStrength", buf); + char glowStrBuf[20]; + dSprintf(glowStrBuf, sizeof(glowStrBuf), "%3.7f", mGlowStrength); + Con::setVariable("$VolFogGlowPostFx::glowStrength", glowStrBuf); if (mUseGlow && !glowFX->isEnabled()) glowFX->enable(); if (!mUseGlow && glowFX->isEnabled()) glowFX->disable(); - if (mModifLightRays) - { - char buf[20]; - dSprintf(buf, sizeof(buf), "%3.7f", mOldLightRayStrength * mLightRayMod); - Con::setVariable("$LightRayPostFX::brightScalar", buf); - } - if (!mModifLightRays) - { - char buf[20]; - dSprintf(buf, sizeof(buf), "%3.7f", mOldLightRayStrength); - Con::setVariable("$LightRayPostFX::brightScalar", buf); - } + + F32 rayStrength = mOldLightRayStrength; + if (mModifLightRays) + rayStrength *= mLightRayMod; + char rayStrBuf[20]; + dSprintf(rayStrBuf, sizeof(rayStrBuf), "%3.7f", rayStrength); + Con::setVariable("$LightRayPostFX::brightScalar", rayStrBuf); } } if (stream->readFlag())//Volumetric Fog diff --git a/Engine/source/environment/decalRoad.cpp b/Engine/source/environment/decalRoad.cpp index edf4c725b..00359f7bb 100644 --- a/Engine/source/environment/decalRoad.cpp +++ b/Engine/source/environment/decalRoad.cpp @@ -1265,7 +1265,7 @@ void DecalRoad::_generateEdges() // for ( U32 i = 0; i < mEdges.size(); i++ ) { - RoadEdge *edge = &mEdges[i]; + edge = &mEdges[i]; edge->p0 = edge->p1 - edge->rvec * edge->width * 0.5f; edge->p2 = edge->p1 + edge->rvec * edge->width * 0.5f; _getTerrainHeight( edge->p0 ); @@ -1467,20 +1467,20 @@ void DecalRoad::_captureVerts() for ( U32 i = 0; i < clipperList.size(); i++ ) { ClippedPolyList *clipper = &clipperList[i]; - RoadEdge &edge = mEdges[i]; - RoadEdge &nextEdge = mEdges[i+1]; + edge = &mEdges[i]; + nextEdge = &mEdges[i+1]; - VectorF segFvec = nextEdge.p1 - edge.p1; + VectorF segFvec = nextEdge->p1 - edge->p1; F32 segLen = segFvec.len(); segFvec.normalize(); F32 texLen = segLen / mTextureLength; texEnd = texStart + texLen; - BiQuadToSqr quadToSquare( Point2F( edge.p0.x, edge.p0.y ), - Point2F( edge.p2.x, edge.p2.y ), - Point2F( nextEdge.p2.x, nextEdge.p2.y ), - Point2F( nextEdge.p0.x, nextEdge.p0.y ) ); + BiQuadToSqr quadToSquare( Point2F( edge->p0.x, edge->p0.y ), + Point2F( edge->p2.x, edge->p2.y ), + Point2F( nextEdge->p2.x, nextEdge->p2.y ), + Point2F( nextEdge->p0.x, nextEdge->p0.y ) ); // if ( i % mSegmentsPerBatch == 0 ) @@ -1572,12 +1572,12 @@ void DecalRoad::_captureVerts() Box3F box; for ( U32 i = 0; i < mBatches.size(); i++ ) { - const RoadBatch &batch = mBatches[i]; + batch = &mBatches[i]; if ( i == 0 ) - box = batch.bounds; + box = batch->bounds; else - box.intersect( batch.bounds ); + box.intersect( batch->bounds ); } mWorldBox = box; diff --git a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp index e1a612b00..d36fb5cd9 100644 --- a/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiMeshRoadEditorCtrl.cpp @@ -1132,11 +1132,11 @@ void GuiMeshRoadEditorCtrl::setSelectedNode( S32 node ) mSelNode = node; if ( mSelNode != -1 ) { - const MeshRoadNode &node = mSelRoad->mNodes[mSelNode]; + const MeshRoadNode &curNode = mSelRoad->mNodes[mSelNode]; MatrixF objMat = mSelRoad->getNodeTransform(mSelNode); - Point3F objScale( node.width, 1.0f, node.depth ); - Point3F worldPos = node.point; + Point3F objScale(curNode.width, 1.0f, curNode.depth ); + Point3F worldPos = curNode.point; mGizmo->set( objMat, worldPos, objScale ); } diff --git a/Engine/source/environment/editors/guiRiverEditorCtrl.cpp b/Engine/source/environment/editors/guiRiverEditorCtrl.cpp index 01ab745a8..103d6e380 100644 --- a/Engine/source/environment/editors/guiRiverEditorCtrl.cpp +++ b/Engine/source/environment/editors/guiRiverEditorCtrl.cpp @@ -1277,11 +1277,11 @@ void GuiRiverEditorCtrl::setSelectedNode( S32 node ) mSelNode = node; if ( mSelNode != -1 ) { - const RiverNode &node = mSelRiver->mNodes[mSelNode]; + const RiverNode &curNode = mSelRiver->mNodes[mSelNode]; MatrixF objMat = mSelRiver->getNodeTransform(mSelNode); - Point3F objScale( node.width, 1.0f, node.depth ); - Point3F worldPos = node.point; + Point3F objScale(curNode.width, 1.0f, curNode.depth ); + Point3F worldPos = curNode.point; mGizmo->set( objMat, worldPos, objScale ); } diff --git a/Engine/source/environment/meshRoad.cpp b/Engine/source/environment/meshRoad.cpp index 0d523f9a7..1ed6768fb 100644 --- a/Engine/source/environment/meshRoad.cpp +++ b/Engine/source/environment/meshRoad.cpp @@ -1681,54 +1681,40 @@ void MeshRoad::_generateSlices() } } } - - // - // Calculate uvec, fvec, and rvec for all slices - // - + MatrixF mat(true); - - for ( U32 i = 0; i < mSlices.size(); i++ ) - { - calcSliceTransform( i, mat ); - mat.getColumn( 0, &mSlices[i].rvec ); - mat.getColumn( 1, &mSlices[i].fvec ); - mat.getColumn( 2, &mSlices[i].uvec ); - } - - // - // Calculate p0/p2/pb0/pb2 for all slices - // - for ( U32 i = 0; i < mSlices.size(); i++ ) - { - MeshRoadSlice *slice = &mSlices[i]; - slice->p0 = slice->p1 - slice->rvec * slice->width * 0.5f; - slice->p2 = slice->p1 + slice->rvec * slice->width * 0.5f; - slice->pb0 = slice->p0 - slice->uvec * slice->depth; - slice->pb2 = slice->p2 - slice->uvec * slice->depth; - } - - // Generate the object/world bounds Box3F box; for ( U32 i = 0; i < mSlices.size(); i++ ) { - const MeshRoadSlice &slice = mSlices[i]; + // Calculate uvec, fvec, and rvec for all slices + calcSliceTransform( i, mat ); + MeshRoadSlice *slicePtr = &mSlices[i]; + mat.getColumn( 0, &slicePtr->rvec ); + mat.getColumn( 1, &slicePtr->fvec ); + mat.getColumn( 2, &slicePtr->uvec ); + // Calculate p0/p2/pb0/pb2 for all slices + slicePtr->p0 = slicePtr->p1 - slicePtr->rvec * slicePtr->width * 0.5f; + slicePtr->p2 = slicePtr->p1 + slicePtr->rvec * slicePtr->width * 0.5f; + slicePtr->pb0 = slicePtr->p0 - slicePtr->uvec * slicePtr->depth; + slicePtr->pb2 = slicePtr->p2 - slicePtr->uvec * slicePtr->depth; + + // Generate or extend the object/world bounds if ( i == 0 ) { - box.minExtents = slice.p0; - box.maxExtents = slice.p2; - box.extend( slice.pb0 ); - box.extend( slice.pb2 ); + box.minExtents = slicePtr->p0; + box.maxExtents = slicePtr->p2; + box.extend(slicePtr->pb0 ); + box.extend(slicePtr->pb2 ); } else { - box.extend( slice.p0 ); - box.extend( slice.p2 ); - box.extend( slice.pb0 ); - box.extend( slice.pb2 ); + box.extend(slicePtr->p0 ); + box.extend(slicePtr->p2 ); + box.extend(slicePtr->pb0 ); + box.extend(slicePtr->pb2 ); } - } + } mWorldBox = box; resetObjectBox(); diff --git a/Engine/source/environment/scatterSky.cpp b/Engine/source/environment/scatterSky.cpp index 1b3a60843..2f8d17d00 100644 --- a/Engine/source/environment/scatterSky.cpp +++ b/Engine/source/environment/scatterSky.cpp @@ -690,13 +690,13 @@ void ScatterSky::prepRenderImage( SceneRenderState *state ) mMatrixSet->setSceneProjection(GFX->getProjectionMatrix()); mMatrixSet->setWorld(GFX->getWorldMatrix()); - ObjectRenderInst *ri = renderPass->allocInst(); - ri->renderDelegate.bind( this, &ScatterSky::_renderMoon ); - ri->type = RenderPassManager::RIT_Sky; + ObjectRenderInst *moonRI = renderPass->allocInst(); + moonRI->renderDelegate.bind( this, &ScatterSky::_renderMoon ); + moonRI->type = RenderPassManager::RIT_Sky; // Render after sky objects and before CloudLayer! - ri->defaultKey = 5; - ri->defaultKey2 = 0; - renderPass->addInst(ri); + moonRI->defaultKey = 5; + moonRI->defaultKey2 = 0; + renderPass->addInst(moonRI); } } @@ -1346,7 +1346,7 @@ void ScatterSky::_getColor( const Point3F &pos, LinearColorF *outColor ) for ( U32 i = 0; i < 2; i++ ) { F32 fHeight = v3SamplePoint.len(); - F32 fDepth = mExp( scaleOverScaleDepth * (mSphereInnerRadius - smViewerHeight) ); + fDepth = mExp( scaleOverScaleDepth * (mSphereInnerRadius - smViewerHeight) ); F32 fLightAngle = mDot( mLightDir, v3SamplePoint ) / fHeight; F32 fCameraAngle = mDot( v3Ray, v3SamplePoint ) / fHeight; diff --git a/Engine/source/forest/editor/forestBrushElement.cpp b/Engine/source/forest/editor/forestBrushElement.cpp index f61834c9e..bfdedd2b8 100644 --- a/Engine/source/forest/editor/forestBrushElement.cpp +++ b/Engine/source/forest/editor/forestBrushElement.cpp @@ -172,8 +172,8 @@ SimGroup* ForestBrush::getGroup() bool ForestBrush::containsItemData( const ForestItemData *inData ) { - SimObjectList::iterator iter = objectList.begin(); - for ( ; iter != objectList.end(); iter++ ) + SimObjectList::iterator iter = mObjectList.begin(); + for ( ; iter != mObjectList.end(); iter++ ) { ForestBrushElement *pElement = dynamic_cast(*iter); diff --git a/Engine/source/forest/forestCollision.cpp b/Engine/source/forest/forestCollision.cpp index 213f15775..468c901dc 100644 --- a/Engine/source/forest/forestCollision.cpp +++ b/Engine/source/forest/forestCollision.cpp @@ -151,7 +151,7 @@ void ForestConvex::getFeatures( const MatrixF &mat, const VectorF &n, ConvexFeat for (i = 0; i < numVerts; i++) { cf->mVertexList.increment(); - U32 index = emitString[currPos++]; + index = emitString[currPos++]; mat.mulP(pAccel->vertexList[index], &cf->mVertexList.last()); } diff --git a/Engine/source/forest/forestWindEmitter.cpp b/Engine/source/forest/forestWindEmitter.cpp index 46b879214..f02adbee6 100644 --- a/Engine/source/forest/forestWindEmitter.cpp +++ b/Engine/source/forest/forestWindEmitter.cpp @@ -150,10 +150,10 @@ void ForestWind::processTick() mCurrentInterp = 0; mCurrentTarget.set( 0, 0 ); - Point2F windDir( mDirection.x, mDirection.y ); - windDir.normalizeSafe(); + Point2F windNorm( mDirection.x, mDirection.y ); + windNorm.normalizeSafe(); - mCurrentTarget = finalVec + windDir; + mCurrentTarget = finalVec + windNorm; } else { diff --git a/Engine/source/forest/ts/tsForestItemData.h b/Engine/source/forest/ts/tsForestItemData.h index 46252361b..089da98d5 100644 --- a/Engine/source/forest/ts/tsForestItemData.h +++ b/Engine/source/forest/ts/tsForestItemData.h @@ -88,7 +88,7 @@ public: const Vector& getLOSDetails() const { return mLOSDetails; } // ForestItemData - const Box3F& getObjBox() const { return mShape ? mShape->bounds : Box3F::Zero; } + const Box3F& getObjBox() const { return mShape ? mShape->mBounds : Box3F::Zero; } bool render( TSRenderState *rdata, const ForestItem& item ) const; ForestCellBatch* allocateBatch() const; bool canBillboard( const SceneRenderState *state, const ForestItem &item, F32 distToCamera ) const; diff --git a/Engine/source/gfx/gfxDrawUtil.cpp b/Engine/source/gfx/gfxDrawUtil.cpp index ac25b3f15..9796e30fa 100644 --- a/Engine/source/gfx/gfxDrawUtil.cpp +++ b/Engine/source/gfx/gfxDrawUtil.cpp @@ -1041,9 +1041,9 @@ void GFXDrawUtil::_drawSolidPolyhedron( const GFXStateBlockDesc &desc, const Any continue; } - U32 numPoints = poly.extractFace( i, &indices[ idx ], numIndices - idx ); - numIndicesForPoly[ numPolys ] = numPoints; - idx += numPoints; + U32 polyIDx = poly.extractFace( i, &indices[ idx ], numIndices - idx ); + numIndicesForPoly[ numPolys ] = polyIDx; + idx += polyIDx; numPolys ++; } @@ -1083,11 +1083,11 @@ void GFXDrawUtil::drawObjectBox( const GFXStateBlockDesc &desc, const Point3F &s PrimBuild::color( color ); PrimBuild::begin( GFXLineList, 48 ); - static const Point3F cubePoints[8] = + Point3F cubePts[8]; + for (U32 i = 0; i < 8; i++) { - Point3F(-0.5, -0.5, -0.5), Point3F(-0.5, -0.5, 0.5), Point3F(-0.5, 0.5, -0.5), Point3F(-0.5, 0.5, 0.5), - Point3F( 0.5, -0.5, -0.5), Point3F( 0.5, -0.5, 0.5), Point3F( 0.5, 0.5, -0.5), Point3F( 0.5, 0.5, 0.5) - }; + cubePts[i] = cubePoints[i]/2; + } // 8 corner points of the box for ( U32 i = 0; i < 8; i++ ) diff --git a/Engine/source/gui/3d/guiTSControl.cpp b/Engine/source/gui/3d/guiTSControl.cpp index d19d58aee..3e2c192c9 100644 --- a/Engine/source/gui/3d/guiTSControl.cpp +++ b/Engine/source/gui/3d/guiTSControl.cpp @@ -432,8 +432,6 @@ void GuiTSCtrl::_internalRender(RectI guiViewport, RectI renderViewport, Frustum if (mRenderStyle == RenderStyleStereoSideBySide && debugDraw->willDraw()) { // For SBS we need to render over each viewport - Frustum frustum; - GFX->setViewport(mLastCameraQuery.stereoViewports[0]); MathUtils::makeFovPortFrustum(&frustum, mLastCameraQuery.ortho, mLastCameraQuery.nearPlane, mLastCameraQuery.farPlane, mLastCameraQuery.fovPort[0]); GFX->setFrustum(frustum); @@ -543,7 +541,6 @@ void GuiTSCtrl::onRender(Point2I offset, const RectI &updateRect) GFX->setStereoTargets(mLastCameraQuery.stereoTargets); MatrixF myTransforms[2]; - Frustum frustum; if (smUseLatestDisplayTransform) { diff --git a/Engine/source/gui/containers/guiWindowCtrl.cpp b/Engine/source/gui/containers/guiWindowCtrl.cpp index 5ef2a71af..5077ae348 100644 --- a/Engine/source/gui/containers/guiWindowCtrl.cpp +++ b/Engine/source/gui/containers/guiWindowCtrl.cpp @@ -357,7 +357,7 @@ void GuiWindowCtrl::moveToCollapseGroup(GuiWindowCtrl* hitWindow, bool orientati } else { - S32 groupVec = hitWindow->mCollapseGroup; + groupVec = hitWindow->mCollapseGroup; if(orientation == 0) parent->mCollapseGroupVec[groupVec].push_front(this); diff --git a/Engine/source/gui/controls/guiDecoyCtrl.cpp b/Engine/source/gui/controls/guiDecoyCtrl.cpp index 56e2d9467..f7fd881e8 100644 --- a/Engine/source/gui/controls/guiDecoyCtrl.cpp +++ b/Engine/source/gui/controls/guiDecoyCtrl.cpp @@ -142,7 +142,6 @@ void GuiDecoyCtrl::onMouseMove(const GuiEvent &event) if(mIsDecoy == true) { mVisible = false; - GuiControl *parent = getParent(); GuiControl *tempControl = parent->findHitControl(localPoint); //the decoy control has the responsibility of keeping track of the decoyed controls status diff --git a/Engine/source/gui/controls/guiDirectoryFileListCtrl.cpp b/Engine/source/gui/controls/guiDirectoryFileListCtrl.cpp index 420ddc575..724c0c4e2 100644 --- a/Engine/source/gui/controls/guiDirectoryFileListCtrl.cpp +++ b/Engine/source/gui/controls/guiDirectoryFileListCtrl.cpp @@ -189,7 +189,7 @@ DefineEngineMethod( GuiDirectoryFileListCtrl, getSelectedFiles, const char*, (), // Fetch the remaining entries for( S32 i = 1; i < ItemVector.size(); i++ ) { - StringTableEntry itemText = object->getItemText( ItemVector[i] ); + itemText = object->getItemText( ItemVector[i] ); if( !itemText ) continue; diff --git a/Engine/source/gui/controls/guiPopUpCtrl.cpp b/Engine/source/gui/controls/guiPopUpCtrl.cpp index 0697c6a36..c1454f206 100644 --- a/Engine/source/gui/controls/guiPopUpCtrl.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrl.cpp @@ -190,9 +190,9 @@ void GuiPopupTextListCtrl::onRenderCell(Point2I offset, Point2I cell, bool selec if(drawbox) { Point2I coloredboxsize(15,10); - RectI r(offset.x + mProfile->mTextOffset.x, offset.y+2, coloredboxsize.x, coloredboxsize.y); - GFX->getDrawUtil()->drawRectFill( r, boxColor); - GFX->getDrawUtil()->drawRect( r, ColorI(0,0,0)); + RectI boxBounds(offset.x + mProfile->mTextOffset.x, offset.y+2, coloredboxsize.x, coloredboxsize.y); + GFX->getDrawUtil()->drawRectFill(boxBounds, boxColor); + GFX->getDrawUtil()->drawRect(boxBounds, ColorI(0,0,0)); textXOffset += coloredboxsize.x + mProfile->mTextOffset.x; } @@ -855,23 +855,23 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect ) GFXDrawUtil* drawUtil = GFX->getDrawUtil(); - RectI r( offset, getExtent() ); + RectI baseRect( offset, getExtent() ); if ( mInAction ) { - S32 l = r.point.x, r2 = r.point.x + r.extent.x - 1; - S32 t = r.point.y, b = r.point.y + r.extent.y - 1; + S32 left = baseRect.point.x, right = baseRect.point.x + baseRect.extent.x - 1; + S32 top = baseRect.point.y, bottom = baseRect.point.y + baseRect.extent.y - 1; // Do we render a bitmap border or lines? if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) { // Render the fixed, filled in border - renderFixedBitmapBordersFilled(r, 3, mProfile ); + renderFixedBitmapBordersFilled(baseRect, 3, mProfile ); } else { //renderSlightlyLoweredBox(r, mProfile); - drawUtil->drawRectFill( r, mProfile->mFillColor ); + drawUtil->drawRectFill(baseRect, mProfile->mFillColor ); } // Draw a bitmap over the background? @@ -891,10 +891,10 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect ) // Do we render a bitmap border or lines? if ( !( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) ) { - drawUtil->drawLine( l, t, l, b, colorWhite ); - drawUtil->drawLine( l, t, r2, t, colorWhite ); - drawUtil->drawLine( l + 1, b, r2, b, mProfile->mBorderColor ); - drawUtil->drawLine( r2, t + 1, r2, b - 1, mProfile->mBorderColor ); + drawUtil->drawLine(left, top, left, bottom, colorWhite ); + drawUtil->drawLine(left, top, right, top, colorWhite ); + drawUtil->drawLine(left + 1, bottom, right, bottom, mProfile->mBorderColor ); + drawUtil->drawLine(right, top + 1, right, bottom - 1, mProfile->mBorderColor ); } } @@ -903,19 +903,19 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect ) // TODO: Add onMouseEnter() and onMouseLeave() and a definition of mMouseOver (see guiButtonBaseCtrl) for this to work. if ( mMouseOver ) { - S32 l = r.point.x, r2 = r.point.x + r.extent.x - 1; - S32 t = r.point.y, b = r.point.y + r.extent.y - 1; + S32 left = baseRect.point.x, right = baseRect.point.x + baseRect.extent.x - 1; + S32 top = baseRect.point.y, bottom = baseRect.point.y + baseRect.extent.y - 1; // Do we render a bitmap border or lines? if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) { // Render the fixed, filled in border - renderFixedBitmapBordersFilled( r, 2, mProfile ); + renderFixedBitmapBordersFilled(baseRect, 2, mProfile ); } else { - drawUtil->drawRectFill( r, mProfile->mFillColorHL ); + drawUtil->drawRectFill(baseRect, mProfile->mFillColorHL ); } // Draw a bitmap over the background? @@ -929,10 +929,10 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect ) // Do we render a bitmap border or lines? if ( !( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) ) { - drawUtil->drawLine( l, t, l, b, colorWhite ); - drawUtil->drawLine( l, t, r2, t, colorWhite ); - drawUtil->drawLine( l + 1, b, r2, b, mProfile->mBorderColor ); - drawUtil->drawLine( r2, t + 1, r2, b - 1, mProfile->mBorderColor ); + drawUtil->drawLine(left, top, left, bottom, colorWhite); + drawUtil->drawLine(left, top, right, top, colorWhite); + drawUtil->drawLine(left + 1, bottom, right, bottom, mProfile->mBorderColor); + drawUtil->drawLine(right, top + 1, right, bottom - 1, mProfile->mBorderColor); } } else @@ -941,11 +941,11 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect ) if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) { // Render the fixed, filled in border - renderFixedBitmapBordersFilled( r, 1, mProfile ); + renderFixedBitmapBordersFilled(baseRect, 1, mProfile ); } else { - drawUtil->drawRectFill( r, mProfile->mFillColorNA ); + drawUtil->drawRectFill(baseRect, mProfile->mFillColorNA ); } // Draw a bitmap over the background? @@ -959,7 +959,7 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect ) // Do we render a bitmap border or lines? if ( !( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) ) { - drawUtil->drawRect( r, mProfile->mBorderColorNA ); + drawUtil->drawRect( baseRect, mProfile->mBorderColorNA ); } } // renderSlightlyRaisedBox(r, mProfile); // Used to be the only 'else' condition to mInAction above. @@ -1029,9 +1029,9 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect ) if ( drawbox ) { Point2I coloredboxsize( 15, 10 ); - RectI r( offset.x + mProfile->mTextOffset.x, offset.y + ( (getHeight() - coloredboxsize.y ) / 2 ), coloredboxsize.x, coloredboxsize.y ); - drawUtil->drawRectFill( r, boxColor); - drawUtil->drawRect( r, ColorI(0,0,0)); + RectI boxBounds( offset.x + mProfile->mTextOffset.x, offset.y + ( (getHeight() - coloredboxsize.y ) / 2 ), coloredboxsize.x, coloredboxsize.y ); + drawUtil->drawRectFill(boxBounds, boxColor); + drawUtil->drawRect(boxBounds, ColorI(0,0,0)); localStart.x += coloredboxsize.x + mProfile->mTextOffset.x; } @@ -1055,18 +1055,18 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect ) // Draw the second column to the right getColumn( mText, buff, 1, "\t" ); - S32 txt_w = mProfile->mFont->getStrWidth( buff ); + S32 colTxt_w = mProfile->mFont->getStrWidth( buff ); if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) { // We're making use of a bitmap border, so take into account the // right cap of the border. RectI* bitmapBounds = mProfile->mBitmapArrayRects.address(); - Point2I textpos = localToGlobalCoord( Point2I( getWidth() - txt_w - bitmapBounds[2].extent.x, localStart.y ) ); + Point2I textpos = localToGlobalCoord( Point2I( getWidth() - colTxt_w - bitmapBounds[2].extent.x, localStart.y ) ); drawUtil->drawText( mProfile->mFont, textpos, buff, mProfile->mFontColors ); } else { - Point2I textpos = localToGlobalCoord( Point2I( getWidth() - txt_w - 12, localStart.y ) ); + Point2I textpos = localToGlobalCoord( Point2I( getWidth() - colTxt_w - 12, localStart.y ) ); drawUtil->drawText( mProfile->mFont, textpos, buff, mProfile->mFontColors ); } @@ -1079,10 +1079,10 @@ void GuiPopUpMenuCtrl::onRender( Point2I offset, const RectI &updateRect ) if ( !(mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size()) ) { // Draw a triangle (down arrow) - S32 left = r.point.x + r.extent.x - 12; + S32 left = baseRect.point.x + baseRect.extent.x - 12; S32 right = left + 8; S32 middle = left + 4; - S32 top = r.extent.y / 2 + r.point.y - 4; + S32 top = baseRect.extent.y / 2 + baseRect.point.y - 4; S32 bottom = top + 8; PrimBuild::color( mProfile->mFontColor ); diff --git a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp index 2c8f5342a..dbd5356b5 100644 --- a/Engine/source/gui/controls/guiPopUpCtrlEx.cpp +++ b/Engine/source/gui/controls/guiPopUpCtrlEx.cpp @@ -1211,9 +1211,9 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect) if ( drawbox ) { Point2I coloredboxsize( 15, 10 ); - RectI r( offset.x + mProfile->mTextOffset.x, offset.y + ( (getHeight() - coloredboxsize.y ) / 2 ), coloredboxsize.x, coloredboxsize.y ); - drawUtil->drawRectFill( r, boxColor); - drawUtil->drawRect( r, ColorI(0,0,0)); + RectI boxBounds( offset.x + mProfile->mTextOffset.x, offset.y + ( (getHeight() - coloredboxsize.y ) / 2 ), coloredboxsize.x, coloredboxsize.y ); + drawUtil->drawRectFill(boxBounds, boxColor); + drawUtil->drawRect(boxBounds, ColorI(0,0,0)); localStart.x += coloredboxsize.x + mProfile->mTextOffset.x; } @@ -1237,18 +1237,18 @@ void GuiPopUpMenuCtrlEx::onRender(Point2I offset, const RectI &updateRect) // Draw the second column to the right getColumn( mText, buff, 1, "\t" ); - S32 txt_w = mProfile->mFont->getStrWidth( buff ); + S32 colTxt_w = mProfile->mFont->getStrWidth( buff ); if ( mProfile->getChildrenProfile() && mProfile->mBitmapArrayRects.size() ) { // We're making use of a bitmap border, so take into account the // right cap of the border. RectI* bitmapBounds = mProfile->mBitmapArrayRects.address(); - Point2I textpos = localToGlobalCoord( Point2I( getWidth() - txt_w - bitmapBounds[2].extent.x, localStart.y ) ); + Point2I textpos = localToGlobalCoord( Point2I( getWidth() - colTxt_w - bitmapBounds[2].extent.x, localStart.y ) ); drawUtil->drawText( mProfile->mFont, textpos, buff, mProfile->mFontColors ); } else { - Point2I textpos = localToGlobalCoord( Point2I( getWidth() - txt_w - 12, localStart.y ) ); + Point2I textpos = localToGlobalCoord( Point2I( getWidth() - colTxt_w - 12, localStart.y ) ); drawUtil->drawText( mProfile->mFont, textpos, buff, mProfile->mFontColors ); } diff --git a/Engine/source/gui/controls/guiTreeViewCtrl.cpp b/Engine/source/gui/controls/guiTreeViewCtrl.cpp index a4c5aff70..3e815b1a5 100644 --- a/Engine/source/gui/controls/guiTreeViewCtrl.cpp +++ b/Engine/source/gui/controls/guiTreeViewCtrl.cpp @@ -3004,10 +3004,10 @@ void GuiTreeViewCtrl::onMouseUp(const GuiEvent &event) { if( !mActive || !mAwake || !mVisible ) return; - + + BitSet32 hitFlags = 0; if( isMethod("onMouseUp") ) { - BitSet32 hitFlags = 0; Item* item; S32 hitItemId = -1; @@ -3025,26 +3025,26 @@ void GuiTreeViewCtrl::onMouseUp(const GuiEvent &event) return; } - BitSet32 hitFlags = 0; - Item *item; - bool hitCheck = _hitTest( event.mousePoint, item, hitFlags ); + hitFlags = 0; + Item *hitItem; + bool hitCheck = _hitTest( event.mousePoint, hitItem, hitFlags ); mRenamingItem = NULL; if( hitCheck ) { if ( event.mouseClickCount == 1 && !mMouseDragged && mPossibleRenameItem != NULL ) { - if ( item == mPossibleRenameItem ) - showItemRenameCtrl( item ); + if (hitItem == mPossibleRenameItem ) + showItemRenameCtrl(hitItem); } else // If mouseUp occurs on the same item as mouse down { - bool wasSelected = isSelected( item ); + bool wasSelected = isSelected(hitItem); bool multiSelect = getSelectedItemsCount() > 1; - if( wasSelected && multiSelect && item == mTempItem ) + if( wasSelected && multiSelect && hitItem == mTempItem ) { clearSelection(); - addSelection( item->mId ); + addSelection( hitItem->mId ); } } } @@ -3061,7 +3061,7 @@ void GuiTreeViewCtrl::onMouseUp(const GuiEvent &event) { Parent::onMouseMove( event ); - BitSet32 hitFlags = 0; + hitFlags = 0; if( !_hitTest( event.mousePoint, newItem2, hitFlags ) ) { if( !mShowRoot ) @@ -3794,16 +3794,12 @@ void GuiTreeViewCtrl::onMouseDown(const GuiEvent & event) if (item->isInspectorData()) { Entity* e = dynamic_cast(item->getObject()); - //if (item->mScriptInfo.mText != StringTable->insert("Components")) - { - Entity* e = dynamic_cast(item->getObject()); - if (e) - { - if (item->isExpanded()) - e->onInspect(); - else - e->onEndInspect(); - } + if (e) + { + if (item->isExpanded()) + e->onInspect(); + else + e->onEndInspect(); } } diff --git a/Engine/source/gui/core/guiCanvas.cpp b/Engine/source/gui/core/guiCanvas.cpp index efb0674ea..fd0b65ae0 100644 --- a/Engine/source/gui/core/guiCanvas.cpp +++ b/Engine/source/gui/core/guiCanvas.cpp @@ -1530,9 +1530,9 @@ void GuiCanvas::popDialogControl(GuiControl *gui) if (size() > 0) { - GuiControl *ctrl = static_cast(last()); - if( ctrl->getFirstResponder() ) - ctrl->getFirstResponder()->setFirstResponder(); + GuiControl *lastCtrl = static_cast(last()); + if(lastCtrl->getFirstResponder() ) + lastCtrl->getFirstResponder()->setFirstResponder(); } else { @@ -1547,8 +1547,8 @@ void GuiCanvas::popDialogControl(GuiControl *gui) if (size() > 0) { - GuiControl *ctrl = static_cast(last()); - ctrl->buildAcceleratorMap(); + GuiControl *lastCtrl = static_cast(last()); + lastCtrl->buildAcceleratorMap(); } refreshMouseControl(); } diff --git a/Engine/source/gui/editor/guiEditCtrl.cpp b/Engine/source/gui/editor/guiEditCtrl.cpp index 6eb290142..7e8ce57d0 100644 --- a/Engine/source/gui/editor/guiEditCtrl.cpp +++ b/Engine/source/gui/editor/guiEditCtrl.cpp @@ -542,10 +542,10 @@ void GuiEditCtrl::onMouseDragged( const GuiEvent &event ) // Snap the mouse cursor to grid if active. Do this on the mouse cursor so that we handle // incremental drags correctly. - Point2I mousePoint = event.mousePoint; - snapToGrid( mousePoint ); + Point2I dragPoint = event.mousePoint; + snapToGrid(dragPoint); - Point2I delta = mousePoint - mLastDragPos; + Point2I delta = dragPoint - mLastDragPos; // If CTRL is down, apply smart snapping. @@ -584,7 +584,7 @@ void GuiEditCtrl::onMouseDragged( const GuiEvent &event ) // Remember drag point. - mLastDragPos = mousePoint; + mLastDragPos = dragPoint; } else if (mMouseDownMode == MovingSelection && mSelectedControls.size()) { @@ -770,7 +770,7 @@ void GuiEditCtrl::onRender(Point2I offset, const RectI &updateRect) ( mMouseDownMode == MovingSelection || mMouseDownMode == SizingSelection ) && ( mGridSnap.x || mGridSnap.y ) ) { - Point2I cext = getContentControl()->getExtent(); + cext = getContentControl()->getExtent(); Point2I coff = getContentControl()->localToGlobalCoord(Point2I(0,0)); // create point-dots @@ -847,8 +847,8 @@ void GuiEditCtrl::onRender(Point2I offset, const RectI &updateRect) if( mSnapTargets[ axis ] ) { - RectI bounds = mSnapTargets[ axis ]->getGlobalBounds(); - drawer->drawRect( bounds, ColorI( 128, 128, 128, 128 ) ); + RectI snapBounds = mSnapTargets[ axis ]->getGlobalBounds(); + drawer->drawRect(snapBounds, ColorI( 128, 128, 128, 128 ) ); } } } diff --git a/Engine/source/gui/editor/guiFilterCtrl.cpp b/Engine/source/gui/editor/guiFilterCtrl.cpp index 67a0232ae..3ac67238a 100644 --- a/Engine/source/gui/editor/guiFilterCtrl.cpp +++ b/Engine/source/gui/editor/guiFilterCtrl.cpp @@ -177,9 +177,9 @@ void GuiFilterCtrl::onRender(Point2I offset, const RectI &updateRect) Point2I pos = offset; Point2I ext = getExtent(); - RectI r(pos, ext); - GFX->getDrawUtil()->drawRectFill(r, ColorI(255,255,255)); - GFX->getDrawUtil()->drawRect(r, ColorI(0,0,0)); + RectI bgRect(pos, ext); + GFX->getDrawUtil()->drawRectFill(bgRect, ColorI(255,255,255)); + GFX->getDrawUtil()->drawRect(bgRect, ColorI(0,0,0)); // shrink by 2 pixels pos.x += 2; @@ -218,13 +218,13 @@ void GuiFilterCtrl::onRender(Point2I offset, const RectI &updateRect) // draw the knots for (U32 k=0; k < mFilter.size(); k++) { - RectI r; - r.point.x = (S32)(((F32)ext.x/(F32)(mFilter.size()-1)*(F32)k)); - r.point.y = (S32)(ext.y - ((F32)ext.y * mFilter[k])); - r.point += pos + Point2I(-2,-2); - r.extent = Point2I(5,5); + RectI knotRect; + knotRect.point.x = (S32)(((F32)ext.x/(F32)(mFilter.size()-1)*(F32)k)); + knotRect.point.y = (S32)(ext.y - ((F32)ext.y * mFilter[k])); + knotRect.point += pos + Point2I(-2,-2); + knotRect.extent = Point2I(5,5); - GFX->getDrawUtil()->drawRectFill(r, ColorI(255,0,0)); + GFX->getDrawUtil()->drawRectFill(knotRect, ColorI(255,0,0)); } renderChildControls(offset, updateRect); diff --git a/Engine/source/gui/editor/guiGraphCtrl.cpp b/Engine/source/gui/editor/guiGraphCtrl.cpp index 8b1c14108..41e4d0d14 100644 --- a/Engine/source/gui/editor/guiGraphCtrl.cpp +++ b/Engine/source/gui/editor/guiGraphCtrl.cpp @@ -168,7 +168,7 @@ void GuiGraphCtrl::onRender(Point2I offset, const RectI &updateRect) F32 Scale = F32( getExtent().y ) / F32( mGraphMax[ k ] * 1.05 ); const S32 numSamples = mGraphData[ k ].size(); - + F32 graphOffset; switch( mGraphType[ k ] ) { case Bar: @@ -180,21 +180,21 @@ void GuiGraphCtrl::onRender(Point2I offset, const RectI &updateRect) PrimBuild::begin( GFXTriangleStrip, 4 ); PrimBuild::color( mGraphColor[ k ] ); - F32 offset = F32( getExtent().x ) / F32( MaxDataPoints ) * F32( sample + 1 ); + graphOffset = F32( getExtent().x ) / F32( MaxDataPoints ) * F32( sample + 1 ); PrimBuild::vertex2f( globalPos.x + prevOffset, midPointY - ( getDatum( k, sample ) * Scale ) ); - PrimBuild::vertex2f( globalPos.x + offset, + PrimBuild::vertex2f( globalPos.x + graphOffset, midPointY - ( getDatum( k, sample ) * Scale ) ); - PrimBuild::vertex2f( globalPos.x + offset, + PrimBuild::vertex2f( globalPos.x + graphOffset, midPointY ); PrimBuild::vertex2f( globalPos.x + prevOffset, midPointY ); - prevOffset = offset; + prevOffset = graphOffset; PrimBuild::end(); } @@ -209,12 +209,12 @@ void GuiGraphCtrl::onRender(Point2I offset, const RectI &updateRect) for( S32 sample = 0; sample < numSamples; ++ sample ) { - F32 offset = F32( getExtent().x ) / F32( MaxDataPoints - 1 ) * F32( sample ); + graphOffset = F32( getExtent().x ) / F32( MaxDataPoints - 1 ) * F32( sample ); - PrimBuild::vertex2f( globalPos.x + offset, + PrimBuild::vertex2f( globalPos.x + graphOffset, midPointY ); - PrimBuild::vertex2f( globalPos.x + offset, + PrimBuild::vertex2f( globalPos.x + graphOffset, midPointY - ( getDatum( k, sample ) * Scale ) ); } @@ -234,9 +234,9 @@ void GuiGraphCtrl::onRender(Point2I offset, const RectI &updateRect) for( S32 sample = 0; sample < numSamples; ++ sample ) { - F32 offset = F32( getExtent().x ) / F32( MaxDataPoints - 1 ) * F32( sample ); + graphOffset = F32( getExtent().x ) / F32( MaxDataPoints - 1 ) * F32( sample ); - PrimBuild::vertex2f( globalPos.x + offset, + PrimBuild::vertex2f( globalPos.x + graphOffset, midPointY - ( getDatum( k, sample ) * Scale ) ); } diff --git a/Engine/source/gui/editor/guiInspector.cpp b/Engine/source/gui/editor/guiInspector.cpp index 4551d03e8..06e06d996 100644 --- a/Engine/source/gui/editor/guiInspector.cpp +++ b/Engine/source/gui/editor/guiInspector.cpp @@ -658,23 +658,23 @@ void GuiInspector::refresh() if( !group && !isGroupFiltered( itr->pGroupname ) ) { - GuiInspectorGroup *group = new GuiInspectorGroup( itr->pGroupname, this ); + GuiInspectorGroup *newGroup = new GuiInspectorGroup( itr->pGroupname, this ); - group->registerObject(); - if( !group->getNumFields() ) + newGroup->registerObject(); + if( !newGroup->getNumFields() ) { #ifdef DEBUG_SPEW Platform::outputDebugString( "[GuiInspector] Removing empty group '%s'", - group->getCaption().c_str() ); + newGroup->getCaption().c_str() ); #endif // The group ended up having no fields. Remove it. - group->deleteObject(); + newGroup->deleteObject(); } else { - mGroups.push_back( group ); - addObject( group ); + mGroups.push_back(newGroup); + addObject(newGroup); } } } diff --git a/Engine/source/gui/editor/guiInspectorTypes.cpp b/Engine/source/gui/editor/guiInspectorTypes.cpp index f31d4facd..a90da6587 100644 --- a/Engine/source/gui/editor/guiInspectorTypes.cpp +++ b/Engine/source/gui/editor/guiInspectorTypes.cpp @@ -1035,7 +1035,6 @@ GuiControl* GuiInspectorTypeEaseF::constructEditControl() mBrowseButton = new GuiButtonCtrl(); { RectI browseRect( Point2I( ( getLeft() + getWidth()) - 26, getTop() + 2), Point2I(20, getHeight() - 4) ); - char szBuffer[512]; dSprintf( szBuffer, sizeof( szBuffer ), "GetEaseF(%d.getText(), \"%d.apply\", %d.getRoot());", retCtrl->getId(), getId(), getId() ); mBrowseButton->setField( "Command", szBuffer ); mBrowseButton->setField( "text", "E" ); diff --git a/Engine/source/gui/editor/guiMenuBar.cpp b/Engine/source/gui/editor/guiMenuBar.cpp index dc168436b..89958fa5b 100644 --- a/Engine/source/gui/editor/guiMenuBar.cpp +++ b/Engine/source/gui/editor/guiMenuBar.cpp @@ -1369,19 +1369,19 @@ void GuiMenuBar::buildWindowAcceleratorMap(WindowInputGenerator &inputGenerator) { for (U32 item = 0; item < mMenuList[i].popupMenu->mMenuItems.size(); item++) { - if (!mMenuList[i].popupMenu->mMenuItems[item].accelerator) + if (!mMenuList[i].popupMenu->mMenuItems[item].mAccelerator) { - mMenuList[i].popupMenu->mMenuItems[item].accelerator = 0; + mMenuList[i].popupMenu->mMenuItems[item].mAccelerator = 0; continue; } EventDescriptor accelEvent; - ActionMap::createEventDescriptor(mMenuList[i].popupMenu->mMenuItems[item].accelerator, &accelEvent); + ActionMap::createEventDescriptor(mMenuList[i].popupMenu->mMenuItems[item].mAccelerator, &accelEvent); //now we have a modifier, and a key, add them to the canvas - inputGenerator.addAcceleratorKey(this, mMenuList[i].popupMenu->mMenuItems[item].cmd, accelEvent.eventCode, accelEvent.flags); + inputGenerator.addAcceleratorKey(this, mMenuList[i].popupMenu->mMenuItems[item].mCMD, accelEvent.eventCode, accelEvent.flags); - mMenuList[i].popupMenu->mMenuItems[item].acceleratorIndex = mCurAcceleratorIndex; + mMenuList[i].popupMenu->mMenuItems[item].mAcceleratorIndex = mCurAcceleratorIndex; mCurAcceleratorIndex++; } } @@ -1403,7 +1403,7 @@ void GuiMenuBar::acceleratorKeyPress(U32 index) for(U32 item = 0; item < mMenuList[i].popupMenu->mMenuItems.size(); item++) { - if(mMenuList[i].popupMenu->mMenuItems[item].acceleratorIndex == index) + if(mMenuList[i].popupMenu->mMenuItems[item].mAcceleratorIndex == index) { // first, call the script callback for menu selection: onMenuSelect_callback(mMenuList[i].popupMenu->getId(), mMenuList[i].text); @@ -1454,7 +1454,7 @@ void GuiMenuBar::insert(SimObject* pObject, S32 pos) newMenu.drawBitmapOnly = false; newMenu.drawBorder = true; newMenu.bitmapIndex = -1; - newMenu.text = menu->barTitle; + newMenu.text = menu->mBarTitle; newMenu.visible = true; newMenu.popupMenu = menu; diff --git a/Engine/source/gui/editor/guiPopupMenuCtrl.cpp b/Engine/source/gui/editor/guiPopupMenuCtrl.cpp index d03a8bec1..1d72b794c 100644 --- a/Engine/source/gui/editor/guiPopupMenuCtrl.cpp +++ b/Engine/source/gui/editor/guiPopupMenuCtrl.cpp @@ -100,7 +100,7 @@ GuiPopupMenuTextListCtrl::GuiPopupMenuTextListCtrl() void GuiPopupMenuTextListCtrl::onRenderCell(Point2I offset, Point2I cell, bool selected, bool mouseOver) { //check if we're a real entry, or if it's a divider - if (mPopup->mMenuItems[cell.y].isSpacer) + if (mPopup->mMenuItems[cell.y].mIsSpacer) { S32 yp = offset.y + mCellSize.y / 2; GFX->getDrawUtil()->drawLine(offset.x + 5, yp, offset.x + mCellSize.x - 5, yp, ColorI(128, 128, 128)); @@ -214,8 +214,8 @@ void GuiPopupMenuTextListCtrl::onMouseUp(const GuiEvent &event) if (item) { - if (item->enabled) - dAtob(Con::executef(mPopup, "onSelectItem", Con::getIntArg(getSelectedCell().y), item->text.isNotEmpty() ? item->text : "")); + if (item->mEnabled) + dAtob(Con::executef(mPopup, "onSelectItem", Con::getIntArg(getSelectedCell().y), item->mText.isNotEmpty() ? item->mText : "")); } } @@ -247,9 +247,9 @@ void GuiPopupMenuTextListCtrl::onCellHighlighted(Point2I cell) { MenuItem *list = &mPopup->mMenuItems[selectionIndex]; - if (list->isSubmenu && list->subMenu != nullptr) + if (list->mIsSubmenu && list->mSubMenu != nullptr) { - list->subMenu->showPopup(getRoot(), getPosition().x + mCellSize.x, getPosition().y + (selectionIndex * mCellSize.y)); + list->mSubMenu->showPopup(getRoot(), getPosition().x + mCellSize.x, getPosition().y + (selectionIndex * mCellSize.y)); } } } \ No newline at end of file diff --git a/Engine/source/gui/editor/guiShapeEdPreview.cpp b/Engine/source/gui/editor/guiShapeEdPreview.cpp index f04ef371a..bb83d85d7 100644 --- a/Engine/source/gui/editor/guiShapeEdPreview.cpp +++ b/Engine/source/gui/editor/guiShapeEdPreview.cpp @@ -366,8 +366,8 @@ bool GuiShapeEdPreview::setObjectModel(const char* modelName) mOrbitPos = shape->center; // Set camera move and zoom speed according to model size - mMoveSpeed = shape->radius / sMoveScaler; - mZoomSpeed = shape->radius / sZoomScaler; + mMoveSpeed = shape->mRadius / sMoveScaler; + mZoomSpeed = shape->mRadius / sZoomScaler; // Reset node selection mHoverNode = -1; @@ -853,7 +853,7 @@ void GuiShapeEdPreview::exportToCollada( const String& path ) if ( mModel ) { MatrixF orientation( true ); - orientation.setPosition( mModel->getShape()->bounds.getCenter() ); + orientation.setPosition( mModel->getShape()->mBounds.getCenter() ); orientation.inverse(); OptimizedPolyList polyList; @@ -1138,8 +1138,8 @@ bool GuiShapeEdPreview::getCameraTransform(MatrixF* cameraMatrix) cameraMatrix->identity(); if ( mModel ) { - Point3F camPos = mModel->getShape()->bounds.getCenter(); - F32 offset = mModel->getShape()->bounds.len(); + Point3F camPos = mModel->getShape()->mBounds.getCenter(); + F32 offset = mModel->getShape()->mBounds.len(); switch (mDisplayType) { @@ -1244,9 +1244,9 @@ void GuiShapeEdPreview::updateDetailLevel(const SceneRenderState* state) continue; // Count the number of draw calls and materials - mNumDrawCalls += mesh->primitives.size(); - for ( S32 iPrim = 0; iPrim < mesh->primitives.size(); iPrim++ ) - usedMaterials.push_back_unique( mesh->primitives[iPrim].matIndex & TSDrawPrimitive::MaterialMask ); + mNumDrawCalls += mesh->mPrimitives.size(); + for ( S32 iPrim = 0; iPrim < mesh->mPrimitives.size(); iPrim++ ) + usedMaterials.push_back_unique( mesh->mPrimitives[iPrim].matIndex & TSDrawPrimitive::MaterialMask ); // For skinned meshes, count the number of bones and weights if ( mesh->getMeshType() == TSMesh::SkinMeshType ) @@ -1442,7 +1442,7 @@ void GuiShapeEdPreview::renderWorld(const RectI &updateRect) // Render the shape bounding box if ( mRenderBounds ) { - Point3F boxSize = mModel->getShape()->bounds.maxExtents - mModel->getShape()->bounds.minExtents; + Point3F boxSize = mModel->getShape()->mBounds.maxExtents - mModel->getShape()->mBounds.minExtents; GFXStateBlockDesc desc; desc.fillMode = GFXFillWireframe; @@ -1544,7 +1544,7 @@ void GuiShapeEdPreview::renderSunDirection() const { // Render four arrows aiming in the direction of the sun's light ColorI color = LinearColorF( mFakeSun->getColor()).toColorI(); - F32 length = mModel->getShape()->bounds.len() * 0.8f; + F32 length = mModel->getShape()->mBounds.len() * 0.8f; // Get the sun's vectors Point3F fwd = mFakeSun->getTransform().getForwardVector(); diff --git a/Engine/source/gui/editor/popupMenu.cpp b/Engine/source/gui/editor/popupMenu.cpp index 0e5db18da..63b5241e3 100644 --- a/Engine/source/gui/editor/popupMenu.cpp +++ b/Engine/source/gui/editor/popupMenu.cpp @@ -46,14 +46,20 @@ public: //----------------------------------------------------------------------------- PopupMenu::PopupMenu() { - bitmapIndex = -1; + mMenuItems = NULL; + mMenuBarCtrl = nullptr; - barTitle = StringTable->EmptyString(); + mBarTitle = StringTable->EmptyString(); + mBounds = RectI(0, 0, 64, 64); + mVisible = true; - mMenuBarCtrl = nullptr; - mTextList = nullptr; + mBitmapIndex = -1; + mDrawBitmapOnly = false; + mDrawBorder = false; - isSubmenu = false; + mTextList = nullptr; + + mIsSubmenu = false; } PopupMenu::~PopupMenu() @@ -76,7 +82,7 @@ void PopupMenu::initPersistFields() { Parent::initPersistFields(); - addField("barTitle", TypeCaseString, Offset(barTitle, PopupMenu), ""); + addField("barTitle", TypeCaseString, Offset(mBarTitle, PopupMenu), ""); } //----------------------------------------------------------------------------- @@ -134,28 +140,28 @@ S32 PopupMenu::insertItem(S32 pos, const char *title, const char* accelerator, c String titleString = title; MenuItem newItem; - newItem.id = pos; - newItem.text = titleString; - newItem.cmd = cmd; + newItem.mID = pos; + newItem.mText = titleString; + newItem.mCMD = cmd; if (titleString.isEmpty() || titleString == String("-")) - newItem.isSpacer = true; + newItem.mIsSpacer = true; else - newItem.isSpacer = false; + newItem.mIsSpacer = false; if (accelerator[0]) - newItem.accelerator = dStrdup(accelerator); + newItem.mAccelerator = dStrdup(accelerator); else - newItem.accelerator = NULL; + newItem.mAccelerator = NULL; - newItem.visible = true; - newItem.isChecked = false; - newItem.acceleratorIndex = 0; - newItem.enabled = !newItem.isSpacer; + newItem.mVisible = true; + newItem.mIsChecked = false; + newItem.mAcceleratorIndex = 0; + newItem.mEnabled = !newItem.mIsSpacer; - newItem.isSubmenu = false; - newItem.subMenu = nullptr; - newItem.subMenuParentMenu = nullptr; + newItem.mIsSubmenu = false; + newItem.mSubMenu = nullptr; + newItem.mSubMenuParentMenu = nullptr; mMenuItems.push_back(newItem); @@ -166,11 +172,11 @@ S32 PopupMenu::insertSubMenu(S32 pos, const char *title, PopupMenu *submenu) { S32 itemPos = insertItem(pos, title, "", ""); - mMenuItems[itemPos].isSubmenu = true; - mMenuItems[itemPos].subMenu = submenu; - mMenuItems[itemPos].subMenuParentMenu = this; + mMenuItems[itemPos].mIsSubmenu = true; + mMenuItems[itemPos].mSubMenu = submenu; + mMenuItems[itemPos].mSubMenuParentMenu = this; - submenu->isSubmenu = true; + submenu->mIsSubmenu = true; return itemPos; } @@ -181,15 +187,15 @@ bool PopupMenu::setItem(S32 pos, const char *title, const char* accelerator, con for (U32 i = 0; i < mMenuItems.size(); i++) { - if (mMenuItems[i].text == titleString) + if (mMenuItems[i].mText == titleString) { - mMenuItems[i].id = pos; - mMenuItems[i].cmd = cmd; + mMenuItems[i].mID = pos; + mMenuItems[i].mCMD = cmd; if (accelerator && accelerator[0]) - mMenuItems[i].accelerator = dStrdup(accelerator); + mMenuItems[i].mAccelerator = dStrdup(accelerator); else - mMenuItems[i].accelerator = NULL; + mMenuItems[i].mAccelerator = NULL; return true; } } @@ -211,7 +217,7 @@ void PopupMenu::enableItem(S32 pos, bool enable) if (mMenuItems.size() < pos || pos < 0) return; - mMenuItems[pos].enabled = enable; + mMenuItems[pos].mEnabled = enable; } void PopupMenu::checkItem(S32 pos, bool checked) @@ -219,24 +225,24 @@ void PopupMenu::checkItem(S32 pos, bool checked) if (mMenuItems.size() < pos || pos < 0) return; - if (checked && mMenuItems[pos].checkGroup != -1) + if (checked && mMenuItems[pos].mCheckGroup != -1) { // first, uncheck everything in the group: for (U32 i = 0; i < mMenuItems.size(); i++) - if (mMenuItems[i].checkGroup == mMenuItems[pos].checkGroup && mMenuItems[i].isChecked) - mMenuItems[i].isChecked = false; + if (mMenuItems[i].mCheckGroup == mMenuItems[pos].mCheckGroup && mMenuItems[i].mIsChecked) + mMenuItems[i].mIsChecked = false; } - mMenuItems[pos].isChecked; + mMenuItems[pos].mIsChecked = checked; } void PopupMenu::checkRadioItem(S32 firstPos, S32 lastPos, S32 checkPos) { for (U32 i = 0; i < mMenuItems.size(); i++) { - if (mMenuItems[i].id >= firstPos && mMenuItems[i].id <= lastPos) + if (mMenuItems[i].mID >= firstPos && mMenuItems[i].mID <= lastPos) { - mMenuItems[i].isChecked = false; + mMenuItems[i].mIsChecked = false; } } } @@ -246,7 +252,7 @@ bool PopupMenu::isItemChecked(S32 pos) if (mMenuItems.size() < pos || pos < 0) return false; - return mMenuItems[pos].isChecked; + return mMenuItems[pos].mIsChecked; } U32 PopupMenu::getItemCount() @@ -305,7 +311,7 @@ void PopupMenu::showPopup(GuiCanvas *owner, S32 x /* = -1 */, S32 y /* = -1 */) if (!backgroundCtrl || !mTextList) return; - if (!isSubmenu) + if (!mIsSubmenu) { //if we're a 'parent' menu, then tell the background to clear out all existing other popups @@ -354,11 +360,11 @@ void PopupMenu::showPopup(GuiCanvas *owner, S32 x /* = -1 */, S32 y /* = -1 */) for (U32 i = 0; i < mMenuItems.size(); i++) { - if (!mMenuItems[i].visible) + if (!mMenuItems[i].mVisible) continue; - S32 iTextWidth = font->getStrWidth(mMenuItems[i].text.c_str()); - S32 iAcceleratorWidth = mMenuItems[i].accelerator ? font->getStrWidth(mMenuItems[i].accelerator) : 0; + S32 iTextWidth = font->getStrWidth(mMenuItems[i].mText.c_str()); + S32 iAcceleratorWidth = mMenuItems[i].mAccelerator ? font->getStrWidth(mMenuItems[i].mAccelerator) : 0; if (iTextWidth > textWidth) textWidth = iTextWidth; @@ -378,7 +384,7 @@ void PopupMenu::showPopup(GuiCanvas *owner, S32 x /* = -1 */, S32 y /* = -1 */) for (U32 i = 0; i < mMenuItems.size(); i++) { - if (!mMenuItems[i].visible) + if (!mMenuItems[i].mVisible) continue; char buf[512]; @@ -386,17 +392,17 @@ void PopupMenu::showPopup(GuiCanvas *owner, S32 x /* = -1 */, S32 y /* = -1 */) // If this menu item is a submenu, then set the isSubmenu to 2 to indicate // an arrow should be drawn. Otherwise set the isSubmenu normally. char isSubmenu = 1; - if (mMenuItems[i].isSubmenu) + if (mMenuItems[i].mIsSubmenu) isSubmenu = 2; char bitmapIndex = 1; - if (mMenuItems[i].bitmapIndex >= 0 && (mMenuItems[i].bitmapIndex * 3 <= profile->mBitmapArrayRects.size())) - bitmapIndex = mMenuItems[i].bitmapIndex + 2; + if (mMenuItems[i].mBitmapIndex >= 0 && (mMenuItems[i].mBitmapIndex * 3 <= profile->mBitmapArrayRects.size())) + bitmapIndex = mMenuItems[i].mBitmapIndex + 2; - dSprintf(buf, sizeof(buf), "%c%c\t%s\t%s", bitmapIndex, isSubmenu, mMenuItems[i].text.c_str(), mMenuItems[i].accelerator ? mMenuItems[i].accelerator : ""); + dSprintf(buf, sizeof(buf), "%c%c\t%s\t%s", bitmapIndex, isSubmenu, mMenuItems[i].mText.c_str(), mMenuItems[i].mAccelerator ? mMenuItems[i].mAccelerator : ""); mTextList->addEntry(entryCount, buf); - if (!mMenuItems[i].enabled) + if (!mMenuItems[i].mEnabled) mTextList->setEntryActive(entryCount, false); entryCount++; @@ -437,8 +443,8 @@ void PopupMenu::hidePopupSubmenus() { for (U32 i = 0; i < mMenuItems.size(); i++) { - if (mMenuItems[i].subMenu != nullptr) - mMenuItems[i].subMenu->hidePopup(); + if (mMenuItems[i].mSubMenu != nullptr) + mMenuItems[i].mSubMenu->hidePopup(); } } diff --git a/Engine/source/gui/editor/popupMenu.h b/Engine/source/gui/editor/popupMenu.h index 9a6dd0821..66a67b1ff 100644 --- a/Engine/source/gui/editor/popupMenu.h +++ b/Engine/source/gui/editor/popupMenu.h @@ -34,27 +34,27 @@ class GuiPopupMenuBackgroundCtrl; struct MenuItem // an individual item in a pull-down menu { - String text; // the text of the menu item - U32 id; // a script-assigned identifier - char *accelerator; // the keyboard accelerator shortcut for the menu item - U32 acceleratorIndex; // index of this accelerator - bool enabled; // true if the menu item is selectable - bool visible; // true if the menu item is visible - S32 bitmapIndex; // index of the bitmap in the bitmap array - S32 checkGroup; // the group index of the item visa vi check marks - + String mText; // the text of the menu item + U32 mID; // a script-assigned identifier + char *mAccelerator; // the keyboard accelerator shortcut for the menu item + U32 mAcceleratorIndex; // index of this accelerator + bool mEnabled; // true if the menu item is selectable + bool mVisible; // true if the menu item is visible + S32 mBitmapIndex; // index of the bitmap in the bitmap array + S32 mCheckGroup; // the group index of the item visa vi check marks - // only one item in the group can be checked. - bool isSubmenu; // This menu item has a submenu that will be displayed + bool mIsSubmenu; // This menu item has a submenu that will be displayed - bool isChecked; + bool mIsChecked; - bool isSpacer; + bool mIsSpacer; - bool isMenubarEntry; + bool mIsMenubarEntry; - PopupMenu* subMenuParentMenu; // For a submenu, this is the parent menu - PopupMenu* subMenu; - String cmd; + PopupMenu* mSubMenuParentMenu; // For a submenu, this is the parent menu + PopupMenu* mSubMenu; + String mCMD; }; // PopupMenu represents a menu. @@ -72,16 +72,16 @@ protected: GuiMenuBar* mMenuBarCtrl; - StringTableEntry barTitle; + StringTableEntry mBarTitle; - RectI bounds; - bool visible; + RectI mBounds; + bool mVisible; - S32 bitmapIndex; // Index of the bitmap in the bitmap array (-1 = no bitmap) - bool drawBitmapOnly; // Draw only the bitmap and not the text - bool drawBorder; // Should a border be drawn around this menu (usually if we only have a bitmap, we don't want a border) + S32 mBitmapIndex; // Index of the bitmap in the bitmap array (-1 = no bitmap) + bool mDrawBitmapOnly; // Draw only the bitmap and not the text + bool mDrawBorder; // Should a border be drawn around this menu (usually if we only have a bitmap, we don't want a border) - bool isSubmenu; + bool mIsSubmenu; //This is the gui control that renders our popup GuiPopupMenuTextListCtrl *mTextList; @@ -175,8 +175,8 @@ public: virtual bool onMessageReceived(StringTableEntry queue, const char* event, const char* data ); virtual bool onMessageObjectReceived(StringTableEntry queue, Message *msg ); - bool isVisible() { return visible; } - void setVisible(bool isVis) { visible = isVis; } + bool isVisible() { return mVisible; } + void setVisible(bool isVis) { mVisible = isVis; } GuiMenuBar* getMenuBarCtrl(); }; diff --git a/Engine/source/gui/worldEditor/gizmo.cpp b/Engine/source/gui/worldEditor/gizmo.cpp index 029cae110..a74202f81 100644 --- a/Engine/source/gui/worldEditor/gizmo.cpp +++ b/Engine/source/gui/worldEditor/gizmo.cpp @@ -612,12 +612,12 @@ bool Gizmo::collideAxisGizmo( const Gui3DMouseEvent & event ) Point3F(mOrigin + (p1 + p2) * scale) }; - Point3F end = camPos + event.vec * smProjectDistance; - F32 t = plane.intersect(camPos, end); + Point3F endProj = camPos + event.vec * smProjectDistance; + F32 t = plane.intersect(camPos, endProj); if ( t >= 0 && t <= 1 ) { Point3F pos; - pos.interpolate(camPos, end, t); + pos.interpolate(camPos, endProj, t); // check if inside our 'poly' of this axisIdx vector... bool inside = true; diff --git a/Engine/source/gui/worldEditor/worldEditor.cpp b/Engine/source/gui/worldEditor/worldEditor.cpp index b66ead790..651ef4ded 100644 --- a/Engine/source/gui/worldEditor/worldEditor.cpp +++ b/Engine/source/gui/worldEditor/worldEditor.cpp @@ -1454,16 +1454,16 @@ void WorldEditor::renderSplinePath(SimPath::Path *path) } - CameraSpline::Knot::Path path; + CameraSpline::Knot::Path tPath; switch (pathmarker->mSmoothingType) { - case Marker::SmoothingTypeLinear: path = CameraSpline::Knot::LINEAR; break; + case Marker::SmoothingTypeLinear: tPath = CameraSpline::Knot::LINEAR; break; case Marker::SmoothingTypeSpline: - default: path = CameraSpline::Knot::SPLINE; break; + default: tPath = CameraSpline::Knot::SPLINE; break; } - spline.push_back(new CameraSpline::Knot(pos, rot, 1.0f, type, path)); + spline.push_back(new CameraSpline::Knot(pos, rot, 1.0f, type, tPath)); } F32 t = 0.0f; @@ -1559,8 +1559,8 @@ void WorldEditor::renderSplinePath(SimPath::Path *path) // Reset for next pass... vIdx = 0; - void *lockPtr = vb.lock(); - if(!lockPtr) return; + void *nextlockPtr = vb.lock(); + if(!nextlockPtr) return; } } @@ -3036,25 +3036,25 @@ bool WorldEditor::alignByAxis( S32 axis ) if(mSelected->size() < 2) return true; - SceneObject* object = dynamic_cast< SceneObject* >( ( *mSelected )[ 0 ] ); - if( !object ) + SceneObject* primaryObj = dynamic_cast< SceneObject* >( ( *mSelected )[ 0 ] ); + if( !primaryObj) return false; submitUndo( mSelected, "Align By Axis" ); // All objects will be repositioned to line up with the // first selected object - Point3F pos = object->getPosition(); + Point3F pos = primaryObj->getPosition(); for(S32 i=0; isize(); ++i) { - SceneObject* object = dynamic_cast< SceneObject* >( ( *mSelected )[ i ] ); - if( !object ) + SceneObject* additionalObj = dynamic_cast< SceneObject* >( ( *mSelected )[ i ] ); + if( !additionalObj) continue; - Point3F objPos = object->getPosition(); + Point3F objPos = additionalObj->getPosition(); objPos[axis] = pos[axis]; - object->setPosition(objPos); + additionalObj->setPosition(objPos); } return true; @@ -4073,8 +4073,8 @@ DefineEngineMethod( WorldEditor, createPolyhedralObject, SceneObject*, ( const c // Create the object. - SceneObject* object = dynamic_cast< SceneObject* >( classRep->create() ); - if( !Object ) + SceneObject* polyObj = dynamic_cast< SceneObject* >( classRep->create() ); + if( !polyObj) { Con::errorf( "WorldEditor::createPolyhedralObject - Could not create SceneObject with class '%s'", className ); return NULL; @@ -4092,7 +4092,7 @@ DefineEngineMethod( WorldEditor, createPolyhedralObject, SceneObject*, ( const c for( U32 i = 0; i < numPoints; ++ i ) { static StringTableEntry sPoint = StringTable->insert( "point" ); - object->setDataField( sPoint, NULL, EngineMarshallData( points[ i ] ) ); + polyObj->setDataField( sPoint, NULL, EngineMarshallData( points[ i ] ) ); } // Add the plane data. @@ -4108,7 +4108,7 @@ DefineEngineMethod( WorldEditor, createPolyhedralObject, SceneObject*, ( const c char buffer[ 1024 ]; dSprintf( buffer, sizeof( buffer ), "%g %g %g %g", plane.x, plane.y, plane.z, plane.d ); - object->setDataField( sPlane, NULL, buffer ); + polyObj->setDataField( sPlane, NULL, buffer ); } // Add the edge data. @@ -4127,24 +4127,24 @@ DefineEngineMethod( WorldEditor, createPolyhedralObject, SceneObject*, ( const c edge.vertex[ 0 ], edge.vertex[ 1 ] ); - object->setDataField( sEdge, NULL, buffer ); + polyObj->setDataField( sEdge, NULL, buffer ); } // Set the transform. - object->setTransform( savedTransform ); - object->setScale( savedScale ); + polyObj->setTransform( savedTransform ); + polyObj->setScale( savedScale ); // Register and return the object. - if( !object->registerObject() ) + if( !polyObj->registerObject() ) { Con::errorf( "WorldEditor::createPolyhedralObject - Failed to register object!" ); - delete object; + delete polyObj; return NULL; } - return object; + return polyObj; } //----------------------------------------------------------------------------- diff --git a/Engine/source/lighting/advanced/glsl/advancedLightingFeaturesGLSL.cpp b/Engine/source/lighting/advanced/glsl/advancedLightingFeaturesGLSL.cpp index f1223f7b0..9ac194cff 100644 --- a/Engine/source/lighting/advanced/glsl/advancedLightingFeaturesGLSL.cpp +++ b/Engine/source/lighting/advanced/glsl/advancedLightingFeaturesGLSL.cpp @@ -350,7 +350,7 @@ void DeferredBumpFeatGLSL::processPix( Vector &componentList, if (fd.features.hasFeature(MFT_DetailNormalMap)) { - Var *bumpMap = (Var*)LangElement::find("detailBumpMap"); + bumpMap = (Var*)LangElement::find("detailBumpMap"); if (!bumpMap) { bumpMap = new Var; bumpMap->setType("sampler2D"); diff --git a/Engine/source/lighting/advanced/hlsl/advancedLightingFeaturesHLSL.cpp b/Engine/source/lighting/advanced/hlsl/advancedLightingFeaturesHLSL.cpp index 7255ea564..7e3564350 100644 --- a/Engine/source/lighting/advanced/hlsl/advancedLightingFeaturesHLSL.cpp +++ b/Engine/source/lighting/advanced/hlsl/advancedLightingFeaturesHLSL.cpp @@ -367,7 +367,7 @@ void DeferredBumpFeatHLSL::processPix( Vector &componentList, if ( fd.features.hasFeature( MFT_DetailNormalMap ) ) { - Var *bumpMap = (Var*)LangElement::find( "detailBumpMap" ); + bumpMap = (Var*)LangElement::find( "detailBumpMap" ); if ( !bumpMap ) { bumpMap = new Var; @@ -378,7 +378,7 @@ void DeferredBumpFeatHLSL::processPix( Vector &componentList, bumpMap->constNum = Var::getTexUnitNum(); } - Var* bumpMapTex = (Var*)LangElement::find("detailBumpMap"); + bumpMapTex = (Var*)LangElement::find("detailBumpMap"); if (!bumpMapTex) { bumpMap->setType("SamplerState"); diff --git a/Engine/source/lighting/common/blobShadow.cpp b/Engine/source/lighting/common/blobShadow.cpp index a564ff654..f0d87be28 100644 --- a/Engine/source/lighting/common/blobShadow.cpp +++ b/Engine/source/lighting/common/blobShadow.cpp @@ -95,7 +95,7 @@ bool BlobShadow::shouldRender(F32 camDist) if (mShapeBase && mShapeBase->getFadeVal() < TSMesh::VISIBILITY_EPSILON) return false; - F32 shadowLen = 10.0f * mShapeInstance->getShape()->radius; + F32 shadowLen = 10.0f * mShapeInstance->getShape()->mRadius; Point3F pos = mShapeInstance->getShape()->center; // this is a bit of a hack...move generic shadows towards feet/base of shape @@ -182,7 +182,7 @@ void BlobShadow::setRadius(F32 radius) void BlobShadow::setRadius(TSShapeInstance * shapeInstance, const Point3F & scale) { - const Box3F & bounds = shapeInstance->getShape()->bounds; + const Box3F & bounds = shapeInstance->getShape()->mBounds; F32 dx = 0.5f * (bounds.maxExtents.x-bounds.minExtents.x) * scale.x; F32 dy = 0.5f * (bounds.maxExtents.y-bounds.minExtents.y) * scale.y; F32 dz = 0.5f * (bounds.maxExtents.z-bounds.minExtents.z) * scale.z; diff --git a/Engine/source/lighting/shadowMap/pssmLightShadowMap.cpp b/Engine/source/lighting/shadowMap/pssmLightShadowMap.cpp index d276fe3a5..c9ac7e2e3 100644 --- a/Engine/source/lighting/shadowMap/pssmLightShadowMap.cpp +++ b/Engine/source/lighting/shadowMap/pssmLightShadowMap.cpp @@ -254,7 +254,7 @@ void PSSMLightShadowMap::_render( RenderPassManager* renderPass, for (U32 i = 0; i < mNumSplits; i++) { - GFXTransformSaver saver; + GFXTransformSaver splitSaver; // Calculate a sub-frustum Frustum subFrustum(fullFrustum); diff --git a/Engine/source/materials/processedShaderMaterial.cpp b/Engine/source/materials/processedShaderMaterial.cpp index 4fb2acc94..e433a354c 100644 --- a/Engine/source/materials/processedShaderMaterial.cpp +++ b/Engine/source/materials/processedShaderMaterial.cpp @@ -531,9 +531,9 @@ bool ProcessedShaderMaterial::_createPasses( MaterialFeatureData &stageFeatures, ShaderRenderPassData passData; U32 texIndex = 0; - for( U32 i=0; i < FEATUREMGR->getFeatureCount(); i++ ) + for( U32 featureIDx=0; featureIDx < FEATUREMGR->getFeatureCount(); featureIDx++ ) { - const FeatureInfo &info = FEATUREMGR->getAt( i ); + const FeatureInfo &info = FEATUREMGR->getAt(featureIDx); if ( !stageFeatures.features.hasFeature( *info.type ) ) continue; @@ -562,7 +562,7 @@ bool ProcessedShaderMaterial::_createPasses( MaterialFeatureData &stageFeatures, #if defined(TORQUE_DEBUG) && defined( TORQUE_OPENGL) if(oldTexNumber != texIndex) { - for(int i = oldTexNumber; i < texIndex; i++) + for(int texNum = oldTexNumber; texNum < texIndex; texNum++) { AssertFatal(passData.mSamplerNames[ oldTexNumber ].isNotEmpty(), avar( "ERROR: ShaderGen feature %s don't set used sampler name", info.feature->getName().c_str()) ); } @@ -579,9 +579,9 @@ bool ProcessedShaderMaterial::_createPasses( MaterialFeatureData &stageFeatures, } #if defined(TORQUE_DEBUG) && defined( TORQUE_OPENGL) - for(int i = 0; i < texIndex; i++) + for(int samplerIDx = 0; samplerIDx < texIndex; samplerIDx++) { - AssertFatal(passData.mSamplerNames[ i ].isNotEmpty(),""); + AssertFatal(passData.mSamplerNames[samplerIDx].isNotEmpty(),""); } #endif diff --git a/Engine/source/materials/shaderData.cpp b/Engine/source/materials/shaderData.cpp index 3a80c0ac5..d8f4befaf 100644 --- a/Engine/source/materials/shaderData.cpp +++ b/Engine/source/materials/shaderData.cpp @@ -363,17 +363,17 @@ bool ShaderData::_checkDefinition(GFXShader *shader) { if( !shader->findShaderConstHandle( String::ToString("$rtParams%d", pos)) ) { - String error = String::ToString("ShaderData(%s) sampler[%d] used but rtParams%d not used in shader compilation. Possible error", shader->getPixelShaderFile().c_str(), pos, pos); - Con::errorf( error ); + String errStr = String::ToString("ShaderData(%s) sampler[%d] used but rtParams%d not used in shader compilation. Possible error", shader->getPixelShaderFile().c_str(), pos, pos); + Con::errorf(errStr); error = true; } } if(!find) { - String error = String::ToString("ShaderData(%s) sampler %s not defined", shader->getPixelShaderFile().c_str(), samplers[i].c_str()); - Con::errorf(error ); - GFXAssertFatal(0, error ); + String errStr = String::ToString("ShaderData(%s) sampler %s not defined", shader->getPixelShaderFile().c_str(), samplers[i].c_str()); + Con::errorf(errStr); + GFXAssertFatal(0, errStr); error = true; } } diff --git a/Engine/source/math/mEase.cpp b/Engine/source/math/mEase.cpp index 0eca22fef..e1ff97d5f 100644 --- a/Engine/source/math/mEase.cpp +++ b/Engine/source/math/mEase.cpp @@ -6,158 +6,158 @@ EaseF::EaseF() { - dir = 0; - type = 0; - param[0] = param[1] = -1.0f; + mDir = 0; + mType = 0; + mParam[0] = mParam[1] = -1.0f; } EaseF::EaseF(const EaseF &ease) { - this->dir = ease.dir; - this->type = ease.type; - this->param[0] = ease.param[0]; - this->param[1] = ease.param[1]; + this->mDir = ease.mDir; + this->mType = ease.mType; + this->mParam[0] = ease.mParam[0]; + this->mParam[1] = ease.mParam[1]; } EaseF::EaseF(const S32 dir, const S32 type) { - this->dir = dir; - this->type = type; - this->param[0] = this->param[1] = -1.0f; + this->mDir = dir; + this->mType = type; + this->mParam[0] = this->mParam[1] = -1.0f; } EaseF::EaseF(const S32 dir, const S32 type, F32 param[2]) { - this->dir = dir; - this->type = type; - this->param[0] = param[0]; - this->param[1] = param[1]; + this->mDir = dir; + this->mType = type; + this->mParam[0] = param[0]; + this->mParam[1] = param[1]; } void EaseF::set(const S32 dir, const S32 type) { - this->dir = dir; - this->type = type; - this->param[0] = this->param[1] = -1.0f; + this->mDir = dir; + this->mType = type; + this->mParam[0] = this->mParam[1] = -1.0f; } void EaseF::set(const S32 dir, const S32 type, F32 param[2]) { - this->dir = dir; - this->type = type; - this->param[0] = param[0]; - this->param[1] = param[1]; + this->mDir = dir; + this->mType = type; + this->mParam[0] = param[0]; + this->mParam[1] = param[1]; } void EaseF::set(const S32 dir, const S32 type, F32 param0, F32 param1) { - this->dir = dir; - this->type = type; - this->param[0] = param0; - this->param[1] = param1; + this->mDir = dir; + this->mType = type; + this->mParam[0] = param0; + this->mParam[1] = param1; } void EaseF::set(const char *s) { - dSscanf(s,"%d %d %f %f",&dir,&type,¶m[0],¶m[1]); + dSscanf(s,"%d %d %f %f",&mDir,&mType,&mParam[0],&mParam[1]); } F32 EaseF::getValue(F32 t, F32 b, F32 c, F32 d) const { F32 value = 0; - if (type == Ease::Linear) + if (mType == Ease::Linear) { value = mLinearTween(t,b, c, d); } - else if (type == Ease::Quadratic) + else if (mType == Ease::Quadratic) { - if (dir == Ease::In) + if (mDir == Ease::In) value = mEaseInQuad(t,b, c, d); - else if (dir == Ease::Out) + else if (mDir == Ease::Out) value = mEaseOutQuad(t,b, c, d); - else if (dir == Ease::InOut) + else if (mDir == Ease::InOut) value = mEaseInOutQuad(t,b, c, d); } - else if (type == Ease::Cubic) + else if (mType == Ease::Cubic) { - if (dir == Ease::In) + if (mDir == Ease::In) value = mEaseInCubic(t,b, c, d); - else if (dir == Ease::Out) + else if (mDir == Ease::Out) value = mEaseOutCubic(t,b, c, d); - else if (dir == Ease::InOut) + else if (mDir == Ease::InOut) value = mEaseInOutCubic(t,b, c, d); } - else if (type == Ease::Quartic) + else if (mType == Ease::Quartic) { - if (dir == Ease::In) + if (mDir == Ease::In) value = mEaseInQuart(t,b, c, d); - else if (dir == Ease::Out) + else if (mDir == Ease::Out) value = mEaseOutQuart(t,b, c, d); - else if (dir == Ease::InOut) + else if (mDir == Ease::InOut) value = mEaseInOutQuart(t,b, c, d); } - else if (type == Ease::Quintic) + else if (mType == Ease::Quintic) { - if (dir == Ease::In) + if (mDir == Ease::In) value = mEaseInQuint(t,b, c, d); - else if (dir == Ease::Out) + else if (mDir == Ease::Out) value = mEaseOutQuint(t,b, c, d); - else if (dir == Ease::InOut) + else if (mDir == Ease::InOut) value = mEaseInOutQuint(t,b, c, d); } - else if (type == Ease::Sinusoidal) + else if (mType == Ease::Sinusoidal) { - if (dir == Ease::In) + if (mDir == Ease::In) value = mEaseInSine(t,b, c, d); - else if (dir == Ease::Out) + else if (mDir == Ease::Out) value = mEaseOutSine(t,b, c, d); - else if (dir == Ease::InOut) + else if (mDir == Ease::InOut) value = mEaseInOutSine(t,b, c, d); } - else if (type == Ease::Exponential) + else if (mType == Ease::Exponential) { - if (dir == Ease::In) + if (mDir == Ease::In) value = mEaseInExpo(t,b, c, d); - else if (dir == Ease::Out) + else if (mDir == Ease::Out) value = mEaseOutExpo(t,b, c, d); - else if (dir == Ease::InOut) + else if (mDir == Ease::InOut) value = mEaseInOutExpo(t,b, c, d); } - else if (type == Ease::Circular) + else if (mType == Ease::Circular) { - if (dir == Ease::In) + if (mDir == Ease::In) value = mEaseInCirc(t,b, c, d); - else if (dir == Ease::Out) + else if (mDir == Ease::Out) value = mEaseOutCirc(t,b, c, d); - else if (dir == Ease::InOut) + else if (mDir == Ease::InOut) value = mEaseInOutCirc(t,b, c, d); } - else if (type == Ease::Elastic) + else if (mType == Ease::Elastic) { - if (dir == Ease::In) - value = mEaseInElastic(t,b, c, d, param[0], param[1]); - else if (dir == Ease::Out) - value = mEaseOutElastic(t,b, c, d, param[0], param[1]); - else if (dir == Ease::InOut) - value = mEaseInOutElastic(t,b, c, d, param[0], param[1]); + if (mDir == Ease::In) + value = mEaseInElastic(t,b, c, d, mParam[0], mParam[1]); + else if (mDir == Ease::Out) + value = mEaseOutElastic(t,b, c, d, mParam[0], mParam[1]); + else if (mDir == Ease::InOut) + value = mEaseInOutElastic(t,b, c, d, mParam[0], mParam[1]); } - else if (type == Ease::Back) + else if (mType == Ease::Back) { - if (dir == Ease::In) - value = mEaseInBack(t,b, c, d, param[0]); - else if (dir == Ease::Out) - value = mEaseOutBack(t,b, c, d, param[0]); - else if (dir == Ease::InOut) - value = mEaseInOutBack(t,b, c, d, param[0]); + if (mDir == Ease::In) + value = mEaseInBack(t,b, c, d, mParam[0]); + else if (mDir == Ease::Out) + value = mEaseOutBack(t,b, c, d, mParam[0]); + else if (mDir == Ease::InOut) + value = mEaseInOutBack(t,b, c, d, mParam[0]); } - else if (type == Ease::Bounce) + else if (mType == Ease::Bounce) { - if (dir == Ease::In) + if (mDir == Ease::In) value = mEaseInBounce(t,b, c, d); - else if (dir == Ease::Out) + else if (mDir == Ease::Out) value = mEaseOutBounce(t,b, c, d); - else if (dir == Ease::InOut) + else if (mDir == Ease::InOut) value = mEaseInOutBounce(t,b, c, d); } else diff --git a/Engine/source/math/mEase.h b/Engine/source/math/mEase.h index 8689f7fbb..33dcb1467 100644 --- a/Engine/source/math/mEase.h +++ b/Engine/source/math/mEase.h @@ -76,9 +76,9 @@ class EaseF : public Ease { //-------------------------------------- Public data public: - S32 dir; // inout, in, out - S32 type; // linear, etc... - F32 param[2]; // optional params + S32 mDir; // inout, in, out + S32 mType; // linear, etc... + F32 mParam[2]; // optional params //-------------------------------------- Public interface public: diff --git a/Engine/source/math/mPolyhedron.cpp b/Engine/source/math/mPolyhedron.cpp index c9b1e60a3..7a1b75c97 100644 --- a/Engine/source/math/mPolyhedron.cpp +++ b/Engine/source/math/mPolyhedron.cpp @@ -137,8 +137,8 @@ void PolyhedronVectorData::buildFromPlanes( const PlaneSetF& planes ) S32 v1index = -1; bool v1Existed = false; - for( U32 nvert = 0; nvert < pointList.size(); ++ nvert ) - if( pointList[ nvert ].equal( v1, 0.001f ) ) + for( U32 nvert = 0; nvert < mPointList.size(); ++ nvert ) + if(mPointList[ nvert ].equal( v1, 0.001f ) ) { v1index = nvert; v1Existed = true; @@ -149,8 +149,8 @@ void PolyhedronVectorData::buildFromPlanes( const PlaneSetF& planes ) S32 v2index = -1; bool v2Existed = false; - for( U32 nvert = 0; nvert < pointList.size(); ++ nvert ) - if( pointList[ nvert ].equal( v2, 0.001f ) ) + for( U32 nvert = 0; nvert < mPointList.size(); ++ nvert ) + if(mPointList[ nvert ].equal( v2, 0.001f ) ) { v2index = nvert; v2Existed = true; @@ -161,30 +161,30 @@ void PolyhedronVectorData::buildFromPlanes( const PlaneSetF& planes ) if( !v1Existed ) { - v1index = pointList.size(); - pointList.push_back( v1 ); + v1index = mPointList.size(); + mPointList.push_back( v1 ); } // Add vertex 2, if necessary. if( !v2Existed ) { - v2index = pointList.size(); - pointList.push_back( v2 ); + v2index = mPointList.size(); + mPointList.push_back( v2 ); } // If both v1 and v2 already existed in the point // set, this must be an edge that we are sharing so try // to find it. - const U32 thisPlaneIndex = planeList.size(); + const U32 thisPlaneIndex = mPlaneList.size(); bool foundExistingEdge = false; if( v1Existed && v2Existed ) { - for( U32 nedge = 0; nedge < edgeList.size(); ++ nedge ) + for( U32 nedge = 0; nedge < mEdgeList.size(); ++ nedge ) { - Edge& edge = edgeList[ nedge ]; + Edge& edge = mEdgeList[ nedge ]; if( ( edge.vertex[ 0 ] == v1index && edge.vertex[ 1 ] == v2index ) || ( edge.vertex[ 0 ] == v2index && edge.vertex[ 1 ] == v1index ) ) @@ -222,13 +222,13 @@ void PolyhedronVectorData::buildFromPlanes( const PlaneSetF& planes ) if( !invert ) { - edgeList.push_back( + mEdgeList.push_back( Edge( thisPlaneIndex, 0, v1index, v2index ) ); } else { - edgeList.push_back( + mEdgeList.push_back( Edge( thisPlaneIndex, 0, v2index, v1index ) ); } @@ -242,6 +242,6 @@ void PolyhedronVectorData::buildFromPlanes( const PlaneSetF& planes ) // If this plane produced edges, add it. if( haveEdges ) - planeList.push_back( currentPlane ); + mPlaneList.push_back( currentPlane ); } } diff --git a/Engine/source/math/mPolyhedron.h b/Engine/source/math/mPolyhedron.h index dbb874817..8888d531d 100644 --- a/Engine/source/math/mPolyhedron.h +++ b/Engine/source/math/mPolyhedron.h @@ -124,42 +124,42 @@ struct PolyhedronVectorData : public PolyhedronData typedef Vector< Edge > EdgeListType; /// List of planes. Note that by default, the normals facing *inwards*. - PlaneListType planeList; + PlaneListType mPlaneList; /// List of vertices. - PointListType pointList; + PointListType mPointList; /// List of edges. - EdgeListType edgeList; + EdgeListType mEdgeList; PolyhedronVectorData() { - VECTOR_SET_ASSOCIATION( pointList ); - VECTOR_SET_ASSOCIATION( planeList ); - VECTOR_SET_ASSOCIATION( edgeList ); + VECTOR_SET_ASSOCIATION(mPointList); + VECTOR_SET_ASSOCIATION(mPlaneList); + VECTOR_SET_ASSOCIATION(mEdgeList); } /// @name Accessors /// @{ /// Return the number of planes that make up this polyhedron. - U32 getNumPlanes() const { return planeList.size(); } + U32 getNumPlanes() const { return mPlaneList.size(); } /// Return the planes that make up the polyhedron. /// @note The normals of these planes are facing *inwards*. - PlaneF* getPlanes() const { return planeList.address(); } + PlaneF* getPlanes() const { return mPlaneList.address(); } /// Return the number of points that this polyhedron has. - U32 getNumPoints() const { return pointList.size(); } + U32 getNumPoints() const { return mPointList.size(); } /// - Point3F* getPoints() const { return pointList.address(); } + Point3F* getPoints() const { return mPointList.address(); } /// Return the number of edges that this polyhedron has. - U32 getNumEdges() const { return edgeList.size(); } + U32 getNumEdges() const { return mEdgeList.size(); } /// - Edge* getEdges() const { return edgeList.address(); } + Edge* getEdges() const { return mEdgeList.address(); } /// @} @@ -168,9 +168,9 @@ struct PolyhedronVectorData : public PolyhedronData void buildBox( const MatrixF& mat, const Box3F& box, bool invertNormals = false ) { - pointList.setSize( 8 ); - planeList.setSize( 6 ); - edgeList.setSize( 12 ); + mPointList.setSize( 8 ); + mPlaneList.setSize( 6 ); + mEdgeList.setSize( 12 ); buildBoxData( *this, mat, box, invertNormals ); } @@ -190,13 +190,13 @@ struct PolyhedronUnmanagedVectorData : public PolyhedronData protected: /// List of planes. Note that by default, the normals facing *inwards*. - PlaneListType planeList; + PlaneListType mPlaneList; /// List of vertices. - PointListType pointList; + PointListType mPointList; /// List of edges. - EdgeListType edgeList; + EdgeListType mEdgeList; public: @@ -204,26 +204,26 @@ struct PolyhedronUnmanagedVectorData : public PolyhedronData /// @{ /// Return the number of planes that make up this polyhedron. - U32 getNumPlanes() const { return planeList.size(); } + U32 getNumPlanes() const { return mPlaneList.size(); } /// Return the planes that make up the polyhedron. /// @note The normals of these planes are facing *inwards*. - const PlaneF* getPlanes() const { return planeList.address(); } - PlaneF* getPlanes() { return planeList.address(); } + const PlaneF* getPlanes() const { return mPlaneList.address(); } + PlaneF* getPlanes() { return mPlaneList.address(); } /// Return the number of points that this polyhedron has. - U32 getNumPoints() const { return pointList.size(); } + U32 getNumPoints() const { return mPointList.size(); } /// - const Point3F* getPoints() const { return pointList.address(); } - Point3F* getPoints() { return pointList.address(); } + const Point3F* getPoints() const { return mPointList.address(); } + Point3F* getPoints() { return mPointList.address(); } /// Return the number of edges that this polyhedron has. - U32 getNumEdges() const { return edgeList.size(); } + U32 getNumEdges() const { return mEdgeList.size(); } /// - const Edge* getEdges() const { return edgeList.address(); } - Edge* getEdges() { return edgeList.address(); } + const Edge* getEdges() const { return mEdgeList.address(); } + Edge* getEdges() { return mEdgeList.address(); } /// @} }; @@ -239,13 +239,13 @@ struct PolyhedronFixedVectorData : public PolyhedronData protected: /// List of planes. Note that by default, the normals facing *inwards*. - PlaneListType planeList; + PlaneListType mPlaneList; /// List of vertices. - PointListType pointList; + PointListType mPointList; /// List of edges. - EdgeListType edgeList; + EdgeListType mEdgeList; public: @@ -254,23 +254,23 @@ struct PolyhedronFixedVectorData : public PolyhedronData /// @{ /// Return the number of planes that make up this polyhedron. - U32 getNumPlanes() const { return planeList.size(); } + U32 getNumPlanes() const { return mPlaneList.size(); } /// Return the planes that make up the polyhedron. /// @note The normals of these planes are facing *inwards*. - PlaneF* getPlanes() const { return planeList.address(); } + PlaneF* getPlanes() const { return mPlaneList.address(); } /// Return the number of points that this polyhedron has. - U32 getNumPoints() const { return pointList.size(); } + U32 getNumPoints() const { return mPointList.size(); } /// - Point3F* getPoints() const { return pointList.address(); } + Point3F* getPoints() const { return mPointList.address(); } /// Return the number of edges that this polyhedron has. U32 getNumEdges() const { return edgeList.size(); } /// - Edge* getEdges() const { return edgeList.address(); } + Edge* getEdges() const { return mEdgeList.address(); } /// @} @@ -302,9 +302,9 @@ struct PolyhedronImpl : public Base /// Construct a polyhedron described by the given planes and edges. PolyhedronImpl( PlaneListType planes, PointListType points, EdgeListType edges ) { - this->planeList = planes; - this->pointList = points; - this->edgeList = edges; + this->mPlaneList = planes; + this->mPointList = points; + this->mEdgeList = edges; } /// Return the AABB around the polyhedron. diff --git a/Engine/source/math/mPolyhedron.impl.h b/Engine/source/math/mPolyhedron.impl.h index 796f11350..bb7f199c1 100644 --- a/Engine/source/math/mPolyhedron.impl.h +++ b/Engine/source/math/mPolyhedron.impl.h @@ -462,7 +462,7 @@ void PolyhedronData::buildBoxData( Polyhedron& poly, const MatrixF& mat, const B // Corner points. - typename Polyhedron::PointListType& pointList = poly.pointList; + typename Polyhedron::PointListType& pointList = poly.mPointList; pointList[ 0 ] = min; // near left bottom pointList[ 1 ] = min + yvec; // far left bottom @@ -475,7 +475,7 @@ void PolyhedronData::buildBoxData( Polyhedron& poly, const MatrixF& mat, const B // Side planes. - typename Polyhedron::PlaneListType& planeList = poly.planeList; + typename Polyhedron::PlaneListType& planeList = poly.mPlaneList; const F32 pos = invertNormals ? -1.f : 1.f; const F32 neg = - pos; @@ -490,7 +490,7 @@ void PolyhedronData::buildBoxData( Polyhedron& poly, const MatrixF& mat, const B // The edges are constructed so that the vertices // are oriented clockwise for face[0]. - typename Polyhedron::EdgeType* edge = &poly.edgeList[ 0 ]; + typename Polyhedron::EdgeType* edge = &poly.mEdgeList[ 0 ]; for( U32 i = 0; i < 4; ++ i ) { diff --git a/Engine/source/math/mathIO.h b/Engine/source/math/mathIO.h index 6acbc1b52..23fdfe438 100644 --- a/Engine/source/math/mathIO.h +++ b/Engine/source/math/mathIO.h @@ -142,10 +142,10 @@ inline bool mathRead(Stream& stream, QuatF* q) inline bool mathRead(Stream& stream, EaseF* e) { - bool success = stream.read( &e->dir ); - success &= stream.read( &e->type ); - success &= stream.read( &e->param[ 0 ] ); - success &= stream.read( &e->param[ 1 ] ); + bool success = stream.read( &e->mDir ); + success &= stream.read( &e->mType ); + success &= stream.read( &e->mParam[ 0 ] ); + success &= stream.read( &e->mParam[ 1 ] ); return success; } @@ -270,10 +270,10 @@ inline bool mathWrite(Stream& stream, const QuatF& q) inline bool mathWrite(Stream& stream, const EaseF& e) { - bool success = stream.write(e.dir); - success &= stream.write(e.type); - success &= stream.write(e.param[0]); - success &= stream.write(e.param[1]); + bool success = stream.write(e.mDir); + success &= stream.write(e.mType); + success &= stream.write(e.mParam[0]); + success &= stream.write(e.mParam[1]); return success; } diff --git a/Engine/source/math/mathTypes.cpp b/Engine/source/math/mathTypes.cpp index 1d1011d0f..7f3e44225 100644 --- a/Engine/source/math/mathTypes.cpp +++ b/Engine/source/math/mathTypes.cpp @@ -557,7 +557,7 @@ ConsoleGetType( TypeEaseF ) static const U32 bufSize = 256; char* returnBuffer = Con::getReturnBuffer(bufSize); dSprintf(returnBuffer, bufSize, "%d %d %g %g", - pEase->dir, pEase->type, pEase->param[0], pEase->param[1]); + pEase->mDir, pEase->mType, pEase->mParam[0], pEase->mParam[1]); return returnBuffer; } @@ -567,11 +567,11 @@ ConsoleSetType( TypeEaseF ) EaseF* pDst = (EaseF*)dptr; // defaults... - pDst->param[0] = -1.0f; - pDst->param[1] = -1.0f; + pDst->mParam[0] = -1.0f; + pDst->mParam[1] = -1.0f; if (argc == 1) { U32 args = dSscanf(argv[0], "%d %d %f %f", // the two params are optional and assumed -1 if not present... - &pDst->dir, &pDst->type, &pDst->param[0],&pDst->param[1]); + &pDst->mDir, &pDst->mType, &pDst->mParam[0],&pDst->mParam[1]); if( args < 2 ) Con::warnf( "Warning, EaseF probably not read properly" ); } else { diff --git a/Engine/source/math/mathUtils.cpp b/Engine/source/math/mathUtils.cpp index 745338e10..8b9cd9fab 100644 --- a/Engine/source/math/mathUtils.cpp +++ b/Engine/source/math/mathUtils.cpp @@ -1086,9 +1086,9 @@ bool mRayQuadCollide( const Quad &quad, - (beta * (alpha_11 - 1.0f)) - 1.0f; F32 C = alpha; F32 D = (B * B) - (4.0f * A * C); - F32 Q = -0.5f * (B + (B < 0.0f ? -1.0f : 1.0f) ) * mSqrt(D); - u = Q / A; - if ((u < 0.0f) || (u > 1.0f)) u = C / Q; + F32 F = -0.5f * (B + (B < 0.0f ? -1.0f : 1.0f) ) * mSqrt(D); + u = F / A; + if ((u < 0.0f) || (u > 1.0f)) u = C / F; v = beta / ((u * (beta_11 - 1.0f)) + 1.0f); } diff --git a/Engine/source/navigation/guiNavEditorCtrl.cpp b/Engine/source/navigation/guiNavEditorCtrl.cpp index bc605c054..64ae03b6c 100644 --- a/Engine/source/navigation/guiNavEditorCtrl.cpp +++ b/Engine/source/navigation/guiNavEditorCtrl.cpp @@ -535,10 +535,10 @@ void GuiNavEditorCtrl::renderScene(const RectI & updateRect) GFXStateBlockDesc desc; desc.setBlend(false); desc.setZReadWrite(true ,true); - MatrixF mat(true); - mat.setPosition(mLinkStart); + MatrixF linkMat(true); + linkMat.setPosition(mLinkStart); Point3F scale(0.8f, 0.8f, 0.8f); - GFX->getDrawUtil()->drawTransform(desc, mat, &scale); + GFX->getDrawUtil()->drawTransform(desc, linkMat, &scale); } } diff --git a/Engine/source/navigation/navMesh.cpp b/Engine/source/navigation/navMesh.cpp index c9bbb1fa4..04283fd1f 100644 --- a/Engine/source/navigation/navMesh.cpp +++ b/Engine/source/navigation/navMesh.cpp @@ -1232,10 +1232,10 @@ bool NavMesh::createCoverPoints() float segs[MAX_SEGS*6]; int nsegs = 0; query->getPolyWallSegments(ref, &f, segs, NULL, &nsegs, MAX_SEGS); - for(int j = 0; j < nsegs; ++j) + for(int segIDx = 0; segIDx < nsegs; ++segIDx) { - const float* sa = &segs[j*6]; - const float* sb = &segs[j*6+3]; + const float* sa = &segs[segIDx *6]; + const float* sb = &segs[segIDx *6+3]; Point3F a = RCtoDTS(sa), b = RCtoDTS(sb); F32 len = (b - a).len(); if(len < mWalkableRadius * 2) @@ -1244,7 +1244,7 @@ bool NavMesh::createCoverPoints() edge.normalize(); // Number of points to try placing - for now, one at each end. U32 pointCount = (len > mWalkableRadius * 4) ? 2 : 1; - for(U32 i = 0; i < pointCount; i++) + for(U32 pointIDx = 0; pointIDx < pointCount; pointIDx++) { MatrixF mat; Point3F pos; @@ -1254,10 +1254,10 @@ bool NavMesh::createCoverPoints() // Otherwise, stand off from edge ends. else { - if(i % 2) - pos = a + edge * (i/2+1) * mWalkableRadius; + if(pointIDx % 2) + pos = a + edge * (pointIDx /2+1) * mWalkableRadius; else - pos = b - edge * (i/2+1) * mWalkableRadius; + pos = b - edge * (pointIDx /2+1) * mWalkableRadius; } CoverPointData data; if(testEdgeCover(pos, edge, data)) @@ -1332,7 +1332,7 @@ bool NavMesh::testEdgeCover(const Point3F &pos, const VectorF &dir, CoverPointDa void NavMesh::renderToDrawer() { - dd.clear(); + mDbgDraw.clear(); // Recast debug draw NetObject *no = getServerObject(); if(no) @@ -1341,12 +1341,12 @@ void NavMesh::renderToDrawer() if(n->nm) { - dd.beginGroup(0); - duDebugDrawNavMesh (&dd, *n->nm, 0); - dd.beginGroup(1); - duDebugDrawNavMeshPortals(&dd, *n->nm); - dd.beginGroup(2); - duDebugDrawNavMeshBVTree (&dd, *n->nm); + mDbgDraw.beginGroup(0); + duDebugDrawNavMesh (&mDbgDraw, *n->nm, 0); + mDbgDraw.beginGroup(1); + duDebugDrawNavMeshPortals(&mDbgDraw, *n->nm); + mDbgDraw.beginGroup(2); + duDebugDrawNavMeshBVTree (&mDbgDraw, *n->nm); } } } @@ -1398,16 +1398,16 @@ void NavMesh::render(ObjectRenderInst *ri, SceneRenderState *state, BaseMatInsta int alpha = 80; if(!n->isSelected() || !Con::getBoolVariable("$Nav::EditorOpen")) alpha = 20; - dd.overrideColor(duRGBA(255, 0, 0, alpha)); + mDbgDraw.overrideColor(duRGBA(255, 0, 0, alpha)); } else { - dd.cancelOverride(); + mDbgDraw.cancelOverride(); } - if((!gEditingMission && n->mAlwaysRender) || (gEditingMission && Con::getBoolVariable("$Nav::Editor::renderMesh", 1))) dd.renderGroup(0); - if(Con::getBoolVariable("$Nav::Editor::renderPortals")) dd.renderGroup(1); - if(Con::getBoolVariable("$Nav::Editor::renderBVTree")) dd.renderGroup(2); + if((!gEditingMission && n->mAlwaysRender) || (gEditingMission && Con::getBoolVariable("$Nav::Editor::renderMesh", 1))) mDbgDraw.renderGroup(0); + if(Con::getBoolVariable("$Nav::Editor::renderPortals")) mDbgDraw.renderGroup(1); + if(Con::getBoolVariable("$Nav::Editor::renderBVTree")) mDbgDraw.renderGroup(2); } } diff --git a/Engine/source/navigation/navMesh.h b/Engine/source/navigation/navMesh.h index ff279c3be..75efcdacb 100644 --- a/Engine/source/navigation/navMesh.h +++ b/Engine/source/navigation/navMesh.h @@ -407,7 +407,7 @@ private: /// @name Rendering /// @{ - duDebugDrawTorque dd; + duDebugDrawTorque mDbgDraw; void renderToDrawer(); diff --git a/Engine/source/persistence/taml/fsTinyXml.cpp b/Engine/source/persistence/taml/fsTinyXml.cpp index 9fdf3f812..ffc069613 100644 --- a/Engine/source/persistence/taml/fsTinyXml.cpp +++ b/Engine/source/persistence/taml/fsTinyXml.cpp @@ -199,16 +199,16 @@ void fsTiXmlAttribute::Print( FileStream& stream, int depth, TIXML_STRING* str ) { TIXML_STRING n, v; - TiXmlString value = TiXmlString(Value()); + TiXmlString val = TiXmlString(Value()); EncodeString( NameTStr(), &n ); - EncodeString( value, &v ); + EncodeString( val, &v ); for ( int i=0; i< depth; i++ ) { stream.writeText( " " ); } - if (value.find ('\"') == TIXML_STRING::npos) { + if (val.find ('\"') == TIXML_STRING::npos) { const char* pValue = v.c_str(); char buffer[4096]; const S32 length = dSprintf(buffer, sizeof(buffer), "%s=\"%s\"", n.c_str(), pValue); diff --git a/Engine/source/persistence/taml/fsTinyXml.h b/Engine/source/persistence/taml/fsTinyXml.h index 864abec09..5040abf1a 100644 --- a/Engine/source/persistence/taml/fsTinyXml.h +++ b/Engine/source/persistence/taml/fsTinyXml.h @@ -129,7 +129,7 @@ public: attrib->SetValue( _value ); } } - void SetAttribute( const char * name, int value ) + void SetAttribute( const char * name, int _value) { TiXmlAttribute* attrib = attributeSet.Find( name ); if(!attrib) @@ -139,7 +139,7 @@ public: attrib->SetName( name ); } if ( attrib ) { - attrib->SetIntValue( value ); + attrib->SetIntValue(_value); } } TiXmlNode* Identify( const char* p, TiXmlEncoding encoding ); diff --git a/Engine/source/persistence/taml/json/tamlJSONReader.cpp b/Engine/source/persistence/taml/json/tamlJSONReader.cpp index 7cbc114a9..cc545ca24 100644 --- a/Engine/source/persistence/taml/json/tamlJSONReader.cpp +++ b/Engine/source/persistence/taml/json/tamlJSONReader.cpp @@ -192,7 +192,7 @@ SimObject* TamlJSONReader::parseType( const rapidjson::Value::ConstMemberIterato for( rapidjson::Value::ConstMemberIterator objectMemberItr = typeValue.MemberBegin(); objectMemberItr != typeValue.MemberEnd(); ++objectMemberItr ) { // Fetch name and value. - const rapidjson::Value& objectName = objectMemberItr->name; + const rapidjson::Value& objName = objectMemberItr->name; const rapidjson::Value& objectValue = objectMemberItr->value; // Skip if not an object. @@ -200,7 +200,7 @@ SimObject* TamlJSONReader::parseType( const rapidjson::Value::ConstMemberIterato continue; // Find the period character in the name. - const char* pPeriod = dStrchr( objectName.GetString(), '.' ); + const char* pPeriod = dStrchr( objName.GetString(), '.' ); // Did we find the period? if ( pPeriod == NULL ) diff --git a/Engine/source/persistence/taml/taml.cpp b/Engine/source/persistence/taml/taml.cpp index 9b9c3bfa7..82369a7c0 100644 --- a/Engine/source/persistence/taml/taml.cpp +++ b/Engine/source/persistence/taml/taml.cpp @@ -1241,8 +1241,8 @@ ImplementEnumType(_TamlFormatMode, // ************************************************************* // Generate the engine type elements. - TiXmlComment* pComment = new TiXmlComment("Type Elements"); - pSchemaElement->LinkEndChild(pComment); + TiXmlComment* tComment = new TiXmlComment("Type Elements"); + pSchemaElement->LinkEndChild(tComment); for (AbstractClassRep* pType = pRootType; pType != NULL; pType = pType->getNextClass()) { // Add type. @@ -1260,8 +1260,8 @@ ImplementEnumType(_TamlFormatMode, { // Add complex type comment. dSprintf(buffer, sizeof(buffer), " %s Type ", pType->getClassName()); - TiXmlComment* pComment = new TiXmlComment(buffer); - pSchemaElement->LinkEndChild(pComment); + TiXmlComment* ctComment = new TiXmlComment(buffer); + pSchemaElement->LinkEndChild(ctComment); // Add complex type. TiXmlElement* pComplexTypeElement = new TiXmlElement("xs:complexType"); diff --git a/Engine/source/platform/platformNet.cpp b/Engine/source/platform/platformNet.cpp index 47b655ed2..2a22499c4 100644 --- a/Engine/source/platform/platformNet.cpp +++ b/Engine/source/platform/platformNet.cpp @@ -1842,8 +1842,6 @@ void Net::addressToString(const NetAddress *address, char addressString[256]) { char buffer[256]; buffer[0] = '\0'; - sockaddr_in ipAddr; - NetAddressToIPSocket(address, &ipAddr); inet_ntop(AF_INET, &(ipAddr.sin_addr), buffer, sizeof(buffer)); if (ipAddr.sin_port == 0) dSprintf(addressString, 256, "IP:%s", buffer); diff --git a/Engine/source/platformWin32/winConsole.cpp b/Engine/source/platformWin32/winConsole.cpp index cc92c2c15..93ce3c68e 100644 --- a/Engine/source/platformWin32/winConsole.cpp +++ b/Engine/source/platformWin32/winConsole.cpp @@ -176,12 +176,12 @@ void WinConsole::process() S32 outpos = 0; ReadConsoleInput(stdIn, rec, 20, &numEvents); - DWORD i; - for(i = 0; i < numEvents; i++) + DWORD evt; + for(evt = 0; evt < numEvents; evt++) { - if(rec[i].EventType == KEY_EVENT) + if(rec[evt].EventType == KEY_EVENT) { - KEY_EVENT_RECORD *ke = &(rec[i].Event.KeyEvent); + KEY_EVENT_RECORD *ke = &(rec[evt].Event.KeyEvent); if(ke->bKeyDown) { switch (ke->uChar.AsciiChar) diff --git a/Engine/source/scene/mixin/scenePolyhedralObject.impl.h b/Engine/source/scene/mixin/scenePolyhedralObject.impl.h index b01eb9691..4ce8998f0 100644 --- a/Engine/source/scene/mixin/scenePolyhedralObject.impl.h +++ b/Engine/source/scene/mixin/scenePolyhedralObject.impl.h @@ -215,27 +215,27 @@ void ScenePolyhedralObject< Base, P >::unpackUpdate( NetConnection* connection, // Read planes. const U32 numPlanes = stream->readInt( 8 ); - mPolyhedron.planeList.setSize( numPlanes ); + mPolyhedron.mPlaneList.setSize( numPlanes ); for( U32 i = 0; i < numPlanes; ++ i ) - mathRead( *stream, &mPolyhedron.planeList[ i ] ); + mathRead( *stream, &mPolyhedron.mPlaneList[ i ] ); // Read points. const U32 numPoints = stream->readInt( 8 ); - mPolyhedron.pointList.setSize( numPoints ); + mPolyhedron.mPointList.setSize( numPoints ); for( U32 i = 0; i < numPoints; ++ i ) - mathRead( *stream, &mPolyhedron.pointList[ i ] ); + mathRead( *stream, &mPolyhedron.mPointList[ i ] ); // Read edges. const U32 numEdges = stream->readInt( 8 ); - mPolyhedron.edgeList.setSize( numEdges ); + mPolyhedron.mEdgeList.setSize( numEdges ); for( U32 i = 0; i < numEdges; ++ i ) { - typename PolyhedronType::EdgeType& edge = mPolyhedron.edgeList[ i ]; + typename PolyhedronType::EdgeType& edge = mPolyhedron.mEdgeList[ i ]; edge.face[ 0 ] = stream->readInt( 8 ); edge.face[ 1 ] = stream->readInt( 8 ); @@ -344,7 +344,7 @@ bool ScenePolyhedralObject< Base, P >::_setPlane( void* object, const char* inde &plane.d ); - obj->mPolyhedron.planeList.push_back( plane ); + obj->mPolyhedron.mPlaneList.push_back( plane ); obj->setMaskBits( PolyMask ); obj->mIsBox = false; @@ -366,7 +366,7 @@ bool ScenePolyhedralObject< Base, P >::_setPoint( void* object, const char* inde &point[ 2 ] ); - obj->mPolyhedron.pointList.push_back( point ); + obj->mPolyhedron.mPointList.push_back( point ); obj->setMaskBits( PolyMask ); obj->mIsBox = false; @@ -389,7 +389,7 @@ bool ScenePolyhedralObject< Base, P >::_setEdge( void* object, const char* index &edge.vertex[ 1 ] ); - obj->mPolyhedron.edgeList.push_back( edge ); + obj->mPolyhedron.mEdgeList.push_back( edge ); obj->setMaskBits( PolyMask ); obj->mIsBox = false; diff --git a/Engine/source/scene/reflector.cpp b/Engine/source/scene/reflector.cpp index 5d9bdc3a8..ecaabc43a 100644 --- a/Engine/source/scene/reflector.cpp +++ b/Engine/source/scene/reflector.cpp @@ -315,20 +315,20 @@ void CubeReflector::updateReflection( const ReflectParams ¶ms ) const GFXFormat reflectFormat = REFLECTMGR->getReflectFormat(); if ( texResize || - cubemap.isNull() || - cubemap->getFormat() != reflectFormat ) + mCubemap.isNull() || + mCubemap->getFormat() != reflectFormat ) { - cubemap = GFX->createCubemap(); - cubemap->initDynamic( texDim, reflectFormat ); + mCubemap = GFX->createCubemap(); + mCubemap->initDynamic( texDim, reflectFormat ); } - GFXTexHandle depthBuff = LightShadowMap::_getDepthTarget( texDim, texDim ); + mDepthBuff = LightShadowMap::_getDepthTarget( texDim, texDim ); - if ( renderTarget.isNull() ) - renderTarget = GFX->allocRenderToTextureTarget(); + if ( mRenderTarget.isNull() ) + mRenderTarget = GFX->allocRenderToTextureTarget(); GFX->pushActiveRenderTarget(); - renderTarget->attachTexture( GFXTextureTarget::DepthStencil, depthBuff ); + mRenderTarget->attachTexture( GFXTextureTarget::DepthStencil, mDepthBuff ); F32 oldVisibleDist = gClientSceneGraph->getVisibleDistance(); @@ -407,8 +407,8 @@ void CubeReflector::updateFace( const ReflectParams ¶ms, U32 faceidx ) GFX->setWorldMatrix(matView); GFX->clearTextureStateImmediate(0); - renderTarget->attachTexture( GFXTextureTarget::Color0, cubemap, faceidx ); - GFX->setActiveRenderTarget( renderTarget ); + mRenderTarget->attachTexture( GFXTextureTarget::Color0, mCubemap, faceidx ); + GFX->setActiveRenderTarget(mRenderTarget); GFX->clear( GFXClearStencil | GFXClearTarget | GFXClearZBuffer, gCanvasClearColor, 1.0f, 0 ); SceneRenderState reflectRenderState @@ -427,7 +427,7 @@ void CubeReflector::updateFace( const ReflectParams ¶ms, U32 faceidx ) LIGHTMGR->unregisterAllLights(); // Clean up. - renderTarget->resolve(); + mRenderTarget->resolve(); } F32 CubeReflector::calcFaceScore( const ReflectParams ¶ms, U32 faceidx ) @@ -746,18 +746,18 @@ void PlaneReflector::setGFXMatrices( const MatrixF &camTrans ) MatrixF relCamTrans = invObjTrans * camTrans; MatrixF camReflectTrans = getCameraReflection( relCamTrans ); - MatrixF camTrans = mObject->getRenderTransform() * camReflectTrans; - camTrans.inverse(); + MatrixF objTrans = mObject->getRenderTransform() * camReflectTrans; + objTrans.inverse(); - GFX->setWorldMatrix( camTrans ); + GFX->setWorldMatrix(objTrans); // use relative reflect transform for modelview since clip plane is in object space - camTrans = camReflectTrans; - camTrans.inverse(); + objTrans = camReflectTrans; + objTrans.inverse(); // set new projection matrix gClientSceneGraph->setNonClipProjection( (MatrixF&) GFX->getProjectionMatrix() ); - MatrixF clipProj = getFrustumClipProj( camTrans ); + MatrixF clipProj = getFrustumClipProj(objTrans); GFX->setProjectionMatrix( clipProj ); } else diff --git a/Engine/source/scene/reflector.h b/Engine/source/scene/reflector.h index c0646d30d..fd0f3e08c 100644 --- a/Engine/source/scene/reflector.h +++ b/Engine/source/scene/reflector.h @@ -153,16 +153,16 @@ public: virtual void unregisterReflector(); virtual void updateReflection( const ReflectParams ¶ms ); - GFXCubemap* getCubemap() const { return cubemap; } + GFXCubemap* getCubemap() const { return mCubemap; } void updateFace( const ReflectParams ¶ms, U32 faceidx ); F32 calcFaceScore( const ReflectParams ¶ms, U32 faceidx ); protected: - GFXTexHandle depthBuff; - GFXTextureTargetRef renderTarget; - GFXCubemapHandle cubemap; + GFXTexHandle mDepthBuff; + GFXTextureTargetRef mRenderTarget; + GFXCubemapHandle mCubemap; U32 mLastTexSize; class CubeFaceReflector : public ReflectorBase diff --git a/Engine/source/scene/sceneContainer.cpp b/Engine/source/scene/sceneContainer.cpp index a561f45e3..128ef3edd 100644 --- a/Engine/source/scene/sceneContainer.cpp +++ b/Engine/source/scene/sceneContainer.cpp @@ -60,26 +60,26 @@ static Box3F sBoundingBox; SceneContainer::Link::Link() { - next = prev = this; + mNext = mPrev = this; } //----------------------------------------------------------------------------- void SceneContainer::Link::unlink() { - next->prev = prev; - prev->next = next; - next = prev = this; + mNext->mPrev = mPrev; + mPrev->mNext = mNext; + mNext = mPrev = this; } //----------------------------------------------------------------------------- void SceneContainer::Link::linkAfter(SceneContainer::Link* ptr) { - next = ptr->next; - next->prev = this; - prev = ptr; - prev->next = this; + mNext = ptr->mNext; + mNext->mPrev = this; + mPrev = ptr; + mPrev->mNext = this; } //============================================================================= @@ -93,8 +93,8 @@ SceneContainer::SceneContainer() mSearchInProgress = false; mCurrSeqKey = 0; - mEnd.next = mEnd.prev = &mStart; - mStart.next = mStart.prev = &mEnd; + mEnd.mNext = mEnd.mPrev = &mStart; + mStart.mNext = mStart.mPrev = &mEnd; mBinArray = new SceneObjectRef[csmNumBins * csmNumBins]; for (U32 i = 0; i < csmNumBins; i++) @@ -586,10 +586,10 @@ void SceneContainer::polyhedronFindObjects(const Polyhedron& polyhedron, U32 mas Box3F box; box.minExtents.set(1e9, 1e9, 1e9); box.maxExtents.set(-1e9, -1e9, -1e9); - for (i = 0; i < polyhedron.pointList.size(); i++) + for (i = 0; i < polyhedron.mPointList.size(); i++) { - box.minExtents.setMin(polyhedron.pointList[i]); - box.maxExtents.setMax(polyhedron.pointList[i]); + box.minExtents.setMin(polyhedron.mPointList[i]); + box.maxExtents.setMax(polyhedron.mPointList[i]); } if ( mask == WaterObjectType || @@ -760,7 +760,7 @@ void SceneContainer::findObjectList( const Frustum &frustum, U32 mask, Vector *outFound ) { - for ( Link* itr = mStart.next; itr != &mEnd; itr = itr->next ) + for ( Link* itr = mStart.mNext; itr != &mEnd; itr = itr->mNext) { SceneObject* ptr = static_cast( itr ); if ( ( ptr->getTypeMask() & mask ) != 0 ) @@ -772,7 +772,7 @@ void SceneContainer::findObjectList( U32 mask, Vector *outFound ) void SceneContainer::findObjects( U32 mask, FindCallback callback, void *key ) { - for (Link* itr = mStart.next; itr != &mEnd; itr = itr->next) { + for (Link* itr = mStart.mNext; itr != &mEnd; itr = itr->mNext) { SceneObject* ptr = static_cast(itr); if ((ptr->getTypeMask() & mask) != 0 && !ptr->mCollisionCount) (*callback)(ptr,key); @@ -859,10 +859,10 @@ bool SceneContainer::_castRay( U32 type, const Point3F& start, const Point3F& en F32 currentT = 2.0; mCurrSeqKey++; - SceneObjectRef* chain = mOverflowBin.nextInBin; - while (chain) + SceneObjectRef* overflowChain = mOverflowBin.nextInBin; + while (overflowChain) { - SceneObject* ptr = chain->object; + SceneObject* ptr = overflowChain->object; if (ptr->getContainerSeqKey() != mCurrSeqKey) { ptr->setContainerSeqKey(mCurrSeqKey); @@ -897,7 +897,7 @@ bool SceneContainer::_castRay( U32 type, const Point3F& start, const Point3F& en } } } - chain = chain->nextInBin; + overflowChain = overflowChain->nextInBin; } // These are just for rasterizing the line against the grid. We want the x coord @@ -1138,7 +1138,7 @@ bool SceneContainer::collideBox(const Point3F &start, const Point3F &end, U32 ma AssertFatal( info->userData == NULL, "SceneContainer::collideBox - RayInfo->userData cannot be used here!" ); F32 currentT = 2; - for (Link* itr = mStart.next; itr != &mEnd; itr = itr->next) + for (Link* itr = mStart.mNext; itr != &mEnd; itr = itr->mNext) { SceneObject* ptr = static_cast(itr); if (ptr->getTypeMask() & mask && !ptr->mCollisionCount) diff --git a/Engine/source/scene/sceneContainer.h b/Engine/source/scene/sceneContainer.h index a98548964..2437eb396 100644 --- a/Engine/source/scene/sceneContainer.h +++ b/Engine/source/scene/sceneContainer.h @@ -151,8 +151,8 @@ class SceneContainer struct Link { - Link* next; - Link* prev; + Link* mNext; + Link* mPrev; Link(); void unlink(); void linkAfter(Link* ptr); diff --git a/Engine/source/scene/simPath.cpp b/Engine/source/scene/simPath.cpp index e3769df3c..2145af3cc 100644 --- a/Engine/source/scene/simPath.cpp +++ b/Engine/source/scene/simPath.cpp @@ -194,7 +194,7 @@ void Path::onRemove() /// Sort the markers objects into sequence order void Path::sortMarkers() { - dQsort(objectList.address(), objectList.size(), sizeof(SimObject*), cmpPathObject); + dQsort(mObjectList.address(), mObjectList.size(), sizeof(SimObject*), cmpPathObject); } void Path::updatePath() diff --git a/Engine/source/sfx/sfxDevice.cpp b/Engine/source/sfx/sfxDevice.cpp index 1d2f7cf30..a069b0564 100644 --- a/Engine/source/sfx/sfxDevice.cpp +++ b/Engine/source/sfx/sfxDevice.cpp @@ -168,9 +168,9 @@ void SFXDevice::_removeBuffer( SFXBuffer* buffer ) BufferIterator iter = T3D::find( mBuffers.begin(), mBuffers.end(), buffer ); if( iter != mBuffers.end() ) { - SFXBuffer* buffer = *iter; + SFXBuffer* curBuf = *iter; - mStatNumBufferBytes -= buffer->getMemoryUsed(); + mStatNumBufferBytes -= curBuf->getMemoryUsed(); mStatNumBuffers --; mBuffers.erase( iter ); diff --git a/Engine/source/sfx/sfxMemoryStream.cpp b/Engine/source/sfx/sfxMemoryStream.cpp index d7e04785f..6dcdbc60c 100644 --- a/Engine/source/sfx/sfxMemoryStream.cpp +++ b/Engine/source/sfx/sfxMemoryStream.cpp @@ -80,13 +80,13 @@ U32 SFXMemoryStream::read( U8* buffer, U32 length ) if( numBytesLeftInCurrentPacket ) { - const U32 numBytesToCopy = getMin( numBytesLeftInCurrentPacket, numBytesLeftToCopy ); - dMemcpy( &buffer[ bufferOffset ], &mCurrentPacket->data[ mCurrentPacketOffset ], numBytesToCopy ); + const U32 remainingNumBytesToCopy = getMin( numBytesLeftInCurrentPacket, numBytesLeftToCopy ); + dMemcpy( &buffer[ bufferOffset ], &mCurrentPacket->data[ mCurrentPacketOffset ], remainingNumBytesToCopy); - bufferOffset += numBytesToCopy; - mCurrentPacketOffset += numBytesToCopy; - numBytesLeftInCurrentPacket -= numBytesToCopy; - numBytesLeftToCopy -= numBytesToCopy; + bufferOffset += remainingNumBytesToCopy; + mCurrentPacketOffset += remainingNumBytesToCopy; + numBytesLeftInCurrentPacket -= remainingNumBytesToCopy; + numBytesLeftToCopy -= remainingNumBytesToCopy; } // Discard the packet if there's no data left. diff --git a/Engine/source/sfx/sfxSoundscape.cpp b/Engine/source/sfx/sfxSoundscape.cpp index afd41f842..855ebd2be 100644 --- a/Engine/source/sfx/sfxSoundscape.cpp +++ b/Engine/source/sfx/sfxSoundscape.cpp @@ -174,18 +174,18 @@ void SFXSoundscapeManager::update() // Activate SFXStates on the ambience. For state slots that // have changed, deactivate states that we have already activated. - for( U32 i = 0; i < SFXAmbience::MaxStates; ++ i ) + for( U32 ambState = 0; ambState < SFXAmbience::MaxStates; ++ambState) { - SFXState* state = ambience->getState( i ); - if( soundscape->mStates[ i ] != state ) + SFXState* state = ambience->getState(ambState); + if( soundscape->mStates[ambState] != state ) { - if( soundscape->mStates[ i ] ) - soundscape->mStates[ i ]->deactivate(); + if( soundscape->mStates[ambState] ) + soundscape->mStates[ambState]->deactivate(); if( state ) state->activate(); - soundscape->mStates[ i ] = state; + soundscape->mStates[ambState] = state; } } diff --git a/Engine/source/sfx/sfxSystem.cpp b/Engine/source/sfx/sfxSystem.cpp index b02d4fc67..5cf340cf2 100644 --- a/Engine/source/sfx/sfxSystem.cpp +++ b/Engine/source/sfx/sfxSystem.cpp @@ -674,9 +674,9 @@ void SFXSystem::_onRemoveSource( SFXSource* source ) { // Check if it was a play once source. - Vector< SFXSource* >::iterator iter = T3D::find( mPlayOnceSources.begin(), mPlayOnceSources.end(), source ); - if ( iter != mPlayOnceSources.end() ) - mPlayOnceSources.erase_fast( iter ); + Vector< SFXSource* >::iterator sourceIter = T3D::find( mPlayOnceSources.begin(), mPlayOnceSources.end(), source ); + if (sourceIter != mPlayOnceSources.end() ) + mPlayOnceSources.erase_fast(sourceIter); // Update the stats. @@ -684,9 +684,9 @@ void SFXSystem::_onRemoveSource( SFXSource* source ) if( dynamic_cast< SFXSound* >( source ) ) { - SFXSoundVector::iterator iter = T3D::find( mSounds.begin(), mSounds.end(), static_cast< SFXSound* >( source ) ); - if( iter != mSounds.end() ) - mSounds.erase_fast( iter ); + SFXSoundVector::iterator vectorIter = T3D::find( mSounds.begin(), mSounds.end(), static_cast< SFXSound* >( source ) ); + if(vectorIter != mSounds.end() ) + mSounds.erase_fast(vectorIter); mStatNumSounds = mSounds.size(); } diff --git a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp index 5a6f5abd2..ab9bdb25b 100644 --- a/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp +++ b/Engine/source/shaderGen/GLSL/shaderFeatureGLSL.cpp @@ -1105,7 +1105,7 @@ void DiffuseFeatureGLSL::processPix( Vector &componentList, targ = ShaderFeature::RenderTarget1; col = (Var*)LangElement::find("col1"); - MultiLine * meta = new MultiLine; + meta = new MultiLine; if (!col) { // create color var @@ -1154,7 +1154,7 @@ void DiffuseVertColorFeatureGLSL::processVert( Vector< ShaderComponent* >& comp ShaderConnector* connectComp = dynamic_cast< ShaderConnector* >( componentList[ C_CONNECTOR ] ); AssertFatal( connectComp, "DiffuseVertColorFeatureGLSL::processVert - C_CONNECTOR is not a ShaderConnector" ); - Var* outColor = connectComp->getElement( RT_COLOR ); + outColor = connectComp->getElement( RT_COLOR ); outColor->setName( "vertColor" ); outColor->setStructName( "OUT" ); outColor->setType( "vec4" ); @@ -1455,7 +1455,7 @@ void VertLitGLSL::processVert( Vector &componentList, { // Grab the connector color ShaderConnector *connectComp = dynamic_cast( componentList[C_CONNECTOR] ); - Var *outColor = connectComp->getElement( RT_COLOR ); + outColor = connectComp->getElement( RT_COLOR ); outColor->setName( "vertColor" ); outColor->setStructName( "OUT" ); outColor->setType( "vec4" ); diff --git a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp index c665d0044..547e77d31 100644 --- a/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp +++ b/Engine/source/shaderGen/HLSL/shaderFeatureHLSL.cpp @@ -1109,7 +1109,6 @@ void DiffuseFeatureHLSL::processPix( Vector &componentList, targ = ShaderFeature::RenderTarget1; col = (Var*)LangElement::find("col1"); - MultiLine * meta = new MultiLine; if (!col) { // create color var @@ -1117,7 +1116,7 @@ void DiffuseFeatureHLSL::processPix( Vector &componentList, col->setType("fragout"); col->setName(getOutputTargetVarName(targ)); col->setStructName("OUT"); - meta->addStatement(new GenOp(" @ = float4(1.0);\r\n", col)); + meta->addStatement(new GenOp(" @ = float4(1.0,1.0,1.0,1.0);\r\n", col)); } } @@ -1158,7 +1157,7 @@ void DiffuseVertColorFeatureHLSL::processVert( Vector< ShaderComponent* >& comp ShaderConnector* connectComp = dynamic_cast< ShaderConnector* >( componentList[ C_CONNECTOR ] ); AssertFatal( connectComp, "DiffuseVertColorFeatureGLSL::processVert - C_CONNECTOR is not a ShaderConnector" ); - Var* outColor = connectComp->getElement( RT_COLOR ); + outColor = connectComp->getElement( RT_COLOR ); outColor->setName( "vertColor" ); outColor->setStructName( "OUT" ); outColor->setType( "float4" ); @@ -1487,7 +1486,7 @@ void VertLitHLSL::processVert( Vector &componentList, // Grab the connector color ShaderConnector *connectComp = dynamic_cast( componentList[C_CONNECTOR] ); - Var *outColor = connectComp->getElement( RT_COLOR ); + outColor = connectComp->getElement( RT_COLOR ); outColor->setName( "vertColor" ); outColor->setStructName( "OUT" ); outColor->setType( "float4" ); diff --git a/Engine/source/sim/netGhost.cpp b/Engine/source/sim/netGhost.cpp index 1b51b0dde..d903d7473 100644 --- a/Engine/source/sim/netGhost.cpp +++ b/Engine/source/sim/netGhost.cpp @@ -428,7 +428,7 @@ void NetConnection::ghostWritePacket(BitStream *bstream, PacketNotify *notify) // for(i = mGhostZeroUpdateIndex - 1; i >= 0 && !bstream->isFull(); i--) { - GhostInfo *walk = mGhostArray[i]; + walk = mGhostArray[i]; if(walk->flags & (GhostInfo::KillingGhost | GhostInfo::Ghosting)) continue; diff --git a/Engine/source/sim/netObject.cpp b/Engine/source/sim/netObject.cpp index a77869883..25c5e3657 100644 --- a/Engine/source/sim/netObject.cpp +++ b/Engine/source/sim/netObject.cpp @@ -56,9 +56,9 @@ NetObject::NetObject() mNextDirtyList = NULL; mDirtyMaskBits = 0; #ifdef TORQUE_AFX_ENABLED - scope_id = 0; - scope_refs = 0; - scope_registered = false; + mScope_id = 0; + mScope_refs = 0; + mScope_registered = false; #endif } @@ -478,23 +478,23 @@ DefineEngineMethod( NetObject, isServerObject, bool, (),, #ifdef TORQUE_AFX_ENABLED U16 NetObject::addScopeRef() { - if (scope_refs == 0) + if (mScope_refs == 0) { - scope_id = arcaneFX::generateScopeId(); + mScope_id = arcaneFX::generateScopeId(); onScopeIdChange(); } - scope_refs++; - return scope_id; + mScope_refs++; + return mScope_id; } void NetObject::removeScopeRef() { - if (scope_refs == 0) + if (mScope_refs == 0) return; - scope_refs--; - if (scope_refs == 0) + mScope_refs--; + if (mScope_refs == 0) { - scope_id = 0; + mScope_id = 0; onScopeIdChange(); } } diff --git a/Engine/source/sim/netObject.h b/Engine/source/sim/netObject.h index bbc913c26..60e8786d7 100644 --- a/Engine/source/sim/netObject.h +++ b/Engine/source/sim/netObject.h @@ -411,17 +411,17 @@ public: /// @} protected: - U16 scope_id; - U16 scope_refs; - bool scope_registered; + U16 mScope_id; + U16 mScope_refs; + bool mScope_registered; virtual void onScopeIdChange() { } public: enum { SCOPE_ID_BITS = 14 }; - U16 getScopeId() const { return scope_id; } + U16 getScopeId() const { return mScope_id; } U16 addScopeRef(); void removeScopeRef(); - void setScopeRegistered(bool flag) { scope_registered = flag; } - bool getScopeRegistered() const { return scope_registered; } + void setScopeRegistered(bool flag) { mScope_registered = flag; } + bool getScopeRegistered() const { return mScope_registered; } protected: /// Add a networked field diff --git a/Engine/source/terrain/glsl/terrFeatureGLSL.cpp b/Engine/source/terrain/glsl/terrFeatureGLSL.cpp index 4492ca01b..2acd40871 100644 --- a/Engine/source/terrain/glsl/terrFeatureGLSL.cpp +++ b/Engine/source/terrain/glsl/terrFeatureGLSL.cpp @@ -569,9 +569,6 @@ void TerrainDetailMapFeatGLSL::processPix( Vector &component // amount so that it fades out with the layer blending. if ( fd.features.hasFeature( MFT_TerrainParallaxMap, detailIndex ) ) { - // Get the rest of our inputs. - Var *normalMap = _getNormalMapTex(); - // Call the library function to do the rest. if (fd.features.hasFeature(MFT_IsBC3nm, detailIndex)) { diff --git a/Engine/source/terrain/terrFile.cpp b/Engine/source/terrain/terrFile.cpp index 3a639d0b0..1ae32dc73 100644 --- a/Engine/source/terrain/terrFile.cpp +++ b/Engine/source/terrain/terrFile.cpp @@ -110,11 +110,11 @@ void TerrainFile::_buildGridMap() mGridMap.compact(); // Assign memory from the pool to each grid level. - TerrainSquare *sq = mGridMapPool.address(); + TerrainSquare *grid = mGridMapPool.address(); for ( S32 i = mGridLevels; i >= 0; i-- ) { - mGridMap[i] = sq; - sq += 1 << ( 2 * ( mGridLevels - i ) ); + mGridMap[i] = grid; + grid += 1 << ( 2 * ( mGridLevels - i ) ); } for( S32 i = mGridLevels; i >= 0; i-- ) diff --git a/Engine/source/ts/collada/colladaAppMesh.cpp b/Engine/source/ts/collada/colladaAppMesh.cpp index c1420d1cd..a6bb56f04 100644 --- a/Engine/source/ts/collada/colladaAppMesh.cpp +++ b/Engine/source/ts/collada/colladaAppMesh.cpp @@ -152,7 +152,7 @@ private: // Add the input to the right place in the list (somewhere between start and end) for (S32 i = start; i <= end; i++) { - const domInputLocalOffset* localOffset = daeSafeCast(sortedInputs[i]); + localOffset = daeSafeCast(sortedInputs[i]); domUint set = localOffset ? localOffset->getSet() : 0xFFFFFFFF; if (newSet < set) { for (S32 j = i + 1; j <= end; j++) @@ -181,10 +181,10 @@ private: const char* semantic = SourceTypeToSemantic( type ); for (S32 iInput = 0; iInput < vertices->getInput_array().getCount(); iInput++) { - domInputLocal* input = vertices->getInput_array().get(iInput); - if (dStrEqual(input->getSemantic(), semantic)) + domInputLocal* vInput = vertices->getInput_array().get(iInput); + if (dStrEqual(vInput->getSemantic(), semantic)) { - source = daeSafeCast(findInputSource(input)); + source = daeSafeCast(findInputSource(vInput)); break; } } @@ -977,7 +977,7 @@ void ColladaAppMesh::lookupSkinData() bool tooManyWeightsWarning = false; for (S32 iVert = 0; iVert < vertsPerFrame; iVert++) { const domUint* vcount = (domUint*)weights_vcount.getRaw(0); - const domInt* vindices = (domInt*)weights_v.getRaw(0); + vindices = (domInt*)weights_v.getRaw(0); vindices += vindicesOffset[vertTuples[iVert].vertex]; S32 nonZeroWeightCount = 0; diff --git a/Engine/source/ts/collada/colladaImport.cpp b/Engine/source/ts/collada/colladaImport.cpp index 1cc2909b0..ded830d5c 100644 --- a/Engine/source/ts/collada/colladaImport.cpp +++ b/Engine/source/ts/collada/colladaImport.cpp @@ -120,9 +120,9 @@ static void processNode(GuiTreeViewCtrl* tree, domNode* node, S32 parentID, Scen for (S32 i = 0; i < node->getInstance_node_array().getCount(); i++) { domInstance_node* instnode = node->getInstance_node_array()[i]; - domNode* node = daeSafeCast(instnode->getUrl().getElement()); - if (node) - processNode(tree, node, nodeID, stats); + domNode* dNode = daeSafeCast(instnode->getUrl().getElement()); + if (dNode) + processNode(tree, dNode, nodeID, stats); } } diff --git a/Engine/source/ts/collada/colladaUtils.cpp b/Engine/source/ts/collada/colladaUtils.cpp index 8ad5bff9b..974d2a8ed 100644 --- a/Engine/source/ts/collada/colladaUtils.cpp +++ b/Engine/source/ts/collada/colladaUtils.cpp @@ -266,10 +266,10 @@ void AnimData::parseTargetString(const char* target, S32 fullCount, const char* targetValueCount = 1; } } - else if (const char* p = dStrrchr(target, '.')) { + else if (const char* p2 = dStrrchr(target, '.')) { // Check for named elements for (S32 iElem = 0; elements[iElem][0] != 0; iElem++) { - if (!dStrcmp(p, elements[iElem])) { + if (!dStrcmp(p2, elements[iElem])) { targetValueOffset = iElem; targetValueCount = 1; break; @@ -2948,7 +2948,7 @@ void ColladaUtils::ExportData::processData() detailLevels.clear(); detailLevels.setSize(numDetailLevels); - for (U32 m = 0; m < meshData.size(); ++m) + for (U32 meshNum = 0; meshNum < meshData.size(); ++meshNum) { for (U32 i = 0; i < numDetailLevels; ++i) { @@ -2967,7 +2967,7 @@ void ColladaUtils::ExportData::processData() { //walk backwards as needed to find our first valid detail level for this mesh. if we find none, just move on S32 testDetailLevelSize = getDetailLevelSize(mdl); - detailLevelIdx = meshData[m].hasDetailLevel(testDetailLevelSize); + detailLevelIdx = meshData[meshNum].hasDetailLevel(testDetailLevelSize); if (detailLevelIdx != -1) break; @@ -2983,7 +2983,7 @@ void ColladaUtils::ExportData::processData() { //walk backwards as needed to find our first valid detail level for this mesh. if we find none, just move on S32 testDetailLevelSize = getDetailLevelSize(mdl); - detailLevelIdx = meshData[m].hasDetailLevel(testDetailLevelSize); + detailLevelIdx = meshData[meshNum].hasDetailLevel(testDetailLevelSize); if (detailLevelIdx != -1) break; @@ -2994,13 +2994,13 @@ void ColladaUtils::ExportData::processData() //If we found the detail level index, go ahead and build out the data for it if (detailLevelIdx != -1) { - curDetail->mesh.setTransform(&meshData[m].meshTransform, meshData[m].scale); - curDetail->mesh.setObject(meshData[m].originatingObject); + curDetail->mesh.setTransform(&meshData[meshNum].meshTransform, meshData[meshNum].scale); + curDetail->mesh.setObject(meshData[meshNum].originatingObject); - if (meshData[m].shapeInst != nullptr) + if (meshData[meshNum].shapeInst != nullptr) { - if (!meshData[m].shapeInst->buildPolyList(&curDetail->mesh, detailLevelIdx)) + if (!meshData[meshNum].shapeInst->buildPolyList(&curDetail->mesh, detailLevelIdx)) { Con::errorf("TSStatic::buildExportPolyList - failed to build polylist for LOD %i", i); continue; @@ -3009,10 +3009,10 @@ void ColladaUtils::ExportData::processData() else { //special handling classes - ConvexShape* convexShp = dynamic_cast(meshData[m].originatingObject); + ConvexShape* convexShp = dynamic_cast(meshData[meshNum].originatingObject); if (convexShp != nullptr) { - if (!convexShp->buildPolyList(PLC_Export, &curDetail->mesh, meshData[m].originatingObject->getWorldBox(), meshData[m].originatingObject->getWorldSphere())) + if (!convexShp->buildPolyList(PLC_Export, &curDetail->mesh, meshData[meshNum].originatingObject->getWorldBox(), meshData[meshNum].originatingObject->getWorldSphere())) { Con::errorf("TSStatic::buildExportPolyList - failed to build ConvexShape polylist for LOD %i", i); continue; @@ -3021,19 +3021,19 @@ void ColladaUtils::ExportData::processData() } //lastly, get material - for (U32 m = 0; m < curDetail->mesh.mMaterialList.size(); m++) + for (U32 matNum = 0; matNum < curDetail->mesh.mMaterialList.size(); matNum++) { - S32 matIdx = hasMaterialInstance(curDetail->mesh.mMaterialList[m]); + S32 matIdx = hasMaterialInstance(curDetail->mesh.mMaterialList[matNum]); if (matIdx == -1) { //cool, haven't already got this material, so lets store it out - materials.push_back(curDetail->mesh.mMaterialList[m]); - curDetail->materialRefList.insert(m, materials.size() - 1); + materials.push_back(curDetail->mesh.mMaterialList[matNum]); + curDetail->materialRefList.insert(matNum, materials.size() - 1); } else { - curDetail->materialRefList.insert(m, matIdx); + curDetail->materialRefList.insert(matNum, matIdx); } } } diff --git a/Engine/source/ts/loader/appMesh.cpp b/Engine/source/ts/loader/appMesh.cpp index c06a5909e..bd5c291e0 100644 --- a/Engine/source/ts/loader/appMesh.cpp +++ b/Engine/source/ts/loader/appMesh.cpp @@ -147,13 +147,13 @@ TSMesh* AppMesh::constructTSMesh() } // Copy mesh elements - tsmesh->verts = points; - tsmesh->norms = normals; - tsmesh->tverts = uvs; - tsmesh->primitives = primitives; - tsmesh->indices = indices; - tsmesh->colors = colors; - tsmesh->tverts2 = uv2s; + tsmesh->mVerts = points; + tsmesh->mNorms = normals; + tsmesh->mTverts = uvs; + tsmesh->mPrimitives = primitives; + tsmesh->mIndices = indices; + tsmesh->mColors = colors; + tsmesh->mTverts2 = uv2s; // Finish initializing the shape tsmesh->setFlags(flags); @@ -162,8 +162,8 @@ TSMesh* AppMesh::constructTSMesh() tsmesh->numFrames = numFrames; tsmesh->numMatFrames = numMatFrames; tsmesh->vertsPerFrame = vertsPerFrame; - tsmesh->createTangents(tsmesh->verts, tsmesh->norms); - tsmesh->encodedNorms.set(NULL,0); + tsmesh->createTangents(tsmesh->mVerts, tsmesh->mNorms); + tsmesh->mEncodedNorms.set(NULL,0); return tsmesh; } diff --git a/Engine/source/ts/loader/tsShapeLoader.cpp b/Engine/source/ts/loader/tsShapeLoader.cpp index 61c183d27..11779eb6b 100644 --- a/Engine/source/ts/loader/tsShapeLoader.cpp +++ b/Engine/source/ts/loader/tsShapeLoader.cpp @@ -1172,7 +1172,7 @@ void TSShapeLoader::install() { TSMesh *mesh = shape->meshes[obj.startMeshIndex + iMesh]; - if (mesh && !mesh->primitives.size()) + if (mesh && !mesh->mPrimitives.size()) { S32 oldMeshCount = obj.numMeshes; destructInPlace(mesh); @@ -1220,13 +1220,13 @@ void TSShapeLoader::install() } } - computeBounds(shape->bounds); - if (!shape->bounds.isValidBox()) - shape->bounds = Box3F(1.0f); + computeBounds(shape->mBounds); + if (!shape->mBounds.isValidBox()) + shape->mBounds = Box3F(1.0f); - shape->bounds.getCenter(&shape->center); - shape->radius = (shape->bounds.maxExtents - shape->center).len(); - shape->tubeRadius = shape->radius; + shape->mBounds.getCenter(&shape->center); + shape->mRadius = (shape->mBounds.maxExtents - shape->center).len(); + shape->tubeRadius = shape->mRadius; shape->init(); shape->finalizeEditable(); diff --git a/Engine/source/ts/loader/tsShapeLoader.h b/Engine/source/ts/loader/tsShapeLoader.h index 32b462e46..e58496ce7 100644 --- a/Engine/source/ts/loader/tsShapeLoader.h +++ b/Engine/source/ts/loader/tsShapeLoader.h @@ -118,8 +118,6 @@ protected: Vector nodeScaleRotCache; Vector nodeScaleCache; - Point3F shapeOffset; ///< Offset used to translate the shape origin - //-------------------------------------------------------------------------- // Collect the nodes, objects and sequences for the scene diff --git a/Engine/source/ts/tsAnimate.cpp b/Engine/source/ts/tsAnimate.cpp index 135f8a4b9..ef88d1eb8 100644 --- a/Engine/source/ts/tsAnimate.cpp +++ b/Engine/source/ts/tsAnimate.cpp @@ -212,11 +212,11 @@ void TSShapeInstance::animateNodes(S32 ss) for (i=0; i=start && nodeIndex=start && nodeIdxsetNodeTransform(this, nodeIndex, smNodeLocalTransforms[nodeIndex]); - smNodeLocalTransformDirty.set(nodeIndex); + mNodeCallbacks[i].callback->setNodeTransform(this, nodeIdx, smNodeLocalTransforms[nodeIdx]); + smNodeLocalTransformDirty.set(nodeIdx); } } diff --git a/Engine/source/ts/tsCollision.cpp b/Engine/source/ts/tsCollision.cpp index 6fe935bbe..53fcb60d6 100644 --- a/Engine/source/ts/tsCollision.cpp +++ b/Engine/source/ts/tsCollision.cpp @@ -414,7 +414,7 @@ void TSShapeInstance::computeBounds(S32 dl, Box3F & bounds) // use shape bounds for imposter details if (ss < 0) { - bounds = mShape->bounds; + bounds = mShape->mBounds; return; } @@ -1370,9 +1370,9 @@ void TSMesh::prepOpcodeCollision() // Figure out how many triangles we have... U32 triCount = 0; const U32 base = 0; - for ( U32 i = 0; i < primitives.size(); i++ ) + for ( U32 i = 0; i < mPrimitives.size(); i++ ) { - TSDrawPrimitive & draw = primitives[i]; + TSDrawPrimitive & draw = mPrimitives[i]; const U32 start = draw.start; AssertFatal( draw.matIndex & TSDrawPrimitive::Indexed,"TSMesh::buildPolyList (1)" ); @@ -1383,16 +1383,16 @@ void TSMesh::prepOpcodeCollision() else { // Have to walk the tristrip to get a count... may have degenerates - U32 idx0 = base + indices[start + 0]; + U32 idx0 = base + mIndices[start + 0]; U32 idx1; - U32 idx2 = base + indices[start + 1]; + U32 idx2 = base + mIndices[start + 1]; U32 * nextIdx = &idx1; for ( S32 j = 2; j < draw.numElements; j++ ) { *nextIdx = idx2; // nextIdx = (j%2)==0 ? &idx0 : &idx1; nextIdx = (U32*) ( (dsize_t)nextIdx ^ (dsize_t)&idx0 ^ (dsize_t)&idx1); - idx2 = base + indices[start + j]; + idx2 = base + mIndices[start + j]; if ( idx0 == idx1 || idx0 == idx2 || idx1 == idx2 ) continue; @@ -1402,7 +1402,7 @@ void TSMesh::prepOpcodeCollision() } // Just do the first trilist for now. - mi->SetNbVertices( mVertexData.isReady() ? mNumVerts : verts.size() ); + mi->SetNbVertices( mVertexData.isReady() ? mNumVerts : mVerts.size() ); mi->SetNbTriangles( triCount ); // Stuff everything into appropriate arrays. @@ -1413,9 +1413,9 @@ void TSMesh::prepOpcodeCollision() mOpPoints = pts; // add the polys... - for ( U32 i = 0; i < primitives.size(); i++ ) + for ( U32 i = 0; i < mPrimitives.size(); i++ ) { - TSDrawPrimitive & draw = primitives[i]; + TSDrawPrimitive & draw = mPrimitives[i]; const U32 start = draw.start; AssertFatal( draw.matIndex & TSDrawPrimitive::Indexed,"TSMesh::buildPolyList (1)" ); @@ -1427,9 +1427,9 @@ void TSMesh::prepOpcodeCollision() { for ( S32 j = 0; j < draw.numElements; ) { - curIts->mVRef[2] = base + indices[start + j + 0]; - curIts->mVRef[1] = base + indices[start + j + 1]; - curIts->mVRef[0] = base + indices[start + j + 2]; + curIts->mVRef[2] = base + mIndices[start + j + 0]; + curIts->mVRef[1] = base + mIndices[start + j + 1]; + curIts->mVRef[0] = base + mIndices[start + j + 2]; curIts->mMatIdx = matIndex; curIts++; @@ -1440,16 +1440,16 @@ void TSMesh::prepOpcodeCollision() { AssertFatal( (draw.matIndex & TSDrawPrimitive::TypeMask) == TSDrawPrimitive::Strip,"TSMesh::buildPolyList (2)" ); - U32 idx0 = base + indices[start + 0]; + U32 idx0 = base + mIndices[start + 0]; U32 idx1; - U32 idx2 = base + indices[start + 1]; + U32 idx2 = base + mIndices[start + 1]; U32 * nextIdx = &idx1; for ( S32 j = 2; j < draw.numElements; j++ ) { *nextIdx = idx2; // nextIdx = (j%2)==0 ? &idx0 : &idx1; nextIdx = (U32*) ( (dsize_t)nextIdx ^ (dsize_t)&idx0 ^ (dsize_t)&idx1); - idx2 = base + indices[start + j]; + idx2 = base + mIndices[start + j]; if ( idx0 == idx1 || idx0 == idx2 || idx1 == idx2 ) continue; @@ -1473,7 +1473,7 @@ void TSMesh::prepOpcodeCollision() } else { - pts[i].Set( verts[i].x, verts[i].y, verts[i].z ); + pts[i].Set( mVerts[i].x, mVerts[i].y, mVerts[i].z ); } } @@ -1505,14 +1505,14 @@ static Point3F texGenAxis[18] = }; -bool TSMesh::castRayOpcode( const Point3F &s, const Point3F &e, RayInfo *info, TSMaterialList *materials ) +bool TSMesh::castRayOpcode( const Point3F &start, const Point3F &end, RayInfo *info, TSMaterialList *materials ) { Opcode::RayCollider ray; Opcode::CollisionFaces cfs; - IceMaths::Point dir( e.x - s.x, e.y - s.y, e.z - s.z ); + IceMaths::Point dir(end.x - start.x, end.y - start.y, end.z - start.z ); const F32 rayLen = dir.Magnitude(); - IceMaths::Ray vec( Point(s.x, s.y, s.z), dir.Normalize() ); + IceMaths::Ray vec( Point(start.x, start.y, start.z), dir.Normalize() ); ray.SetDestination( &cfs); ray.SetFirstContact( false ); diff --git a/Engine/source/ts/tsDump.cpp b/Engine/source/ts/tsDump.cpp index 57461c04e..987b2b757 100644 --- a/Engine/source/ts/tsDump.cpp +++ b/Engine/source/ts/tsDump.cpp @@ -197,10 +197,10 @@ void TSShapeInstance::dump(Stream & stream) dumpLine("\r\n Sequences:\r\n"); for (i = 0; i < mShape->sequences.size(); i++) { - const char *name = "(none)"; + const char *seqName = "(none)"; if (mShape->sequences[i].nameIndex != -1) - name = mShape->getName(mShape->sequences[i].nameIndex); - dumpLine(avar(" %3d: %s%s%s\r\n", i, name, + seqName = mShape->getName(mShape->sequences[i].nameIndex); + dumpLine(avar(" %3d: %s%s%s\r\n", i, seqName, mShape->sequences[i].isCyclic() ? " (cyclic)" : "", mShape->sequences[i].isBlend() ? " (blend)" : "")); } @@ -212,9 +212,9 @@ void TSShapeInstance::dump(Stream & stream) for (i=0; i<(S32)ml->size(); i++) { U32 flags = ml->getFlags(i); - const String& name = ml->getMaterialName(i); + const String& matName = ml->getMaterialName(i); dumpLine(avar( - " material #%i: '%s'%s.", i, name.c_str(), + " material #%i: '%s'%s.", i, matName.c_str(), flags & (TSMaterialList::S_Wrap|TSMaterialList::T_Wrap) ? "" : " not tiled") ); if (flags & TSMaterialList::Translucent) diff --git a/Engine/source/ts/tsLastDetail.cpp b/Engine/source/ts/tsLastDetail.cpp index 9619903b0..9bc53fd4f 100644 --- a/Engine/source/ts/tsLastDetail.cpp +++ b/Engine/source/ts/tsLastDetail.cpp @@ -82,7 +82,7 @@ TSLastDetail::TSLastDetail( TSShape *shape, mDl = dl; mDim = getMax( dim, (S32)32 ); - mRadius = mShape->radius; + mRadius = mShape->mRadius; mCenter = mShape->center; mCachePath = cachePath; @@ -420,24 +420,24 @@ void TSLastDetail::_update() imposterCap->end(); - Point2I texSize( destBmp.getWidth(mip), destBmp.getHeight(mip) ); + Point2I atlasSize( destBmp.getWidth(mip), destBmp.getHeight(mip) ); // Ok... pack in bitmaps till we run out. - for ( S32 y=0; y+currDim <= texSize.y; ) + for ( S32 y=0; y+currDim <= atlasSize.y; ) { - for ( S32 x=0; x+currDim <= texSize.x; ) + for ( S32 x=0; x+currDim <= atlasSize.x; ) { // Copy the next bitmap to the dest texture. - GBitmap* bmp = bitmaps.first(); + GBitmap* cell = bitmaps.first(); bitmaps.pop_front(); - destBmp.copyRect( bmp, RectI( 0, 0, currDim, currDim ), Point2I( x, y ), 0, mip ); - delete bmp; + destBmp.copyRect(cell, RectI( 0, 0, currDim, currDim ), Point2I( x, y ), 0, mip ); + delete cell; // Copy the next normal to the dest texture. - GBitmap* normalmap = normalmaps.first(); + GBitmap* cellNormalmap = normalmaps.first(); normalmaps.pop_front(); - destNormal.copyRect( normalmap, RectI( 0, 0, currDim, currDim ), Point2I( x, y ), 0, mip ); - delete normalmap; + destNormal.copyRect(cellNormalmap, RectI( 0, 0, currDim, currDim ), Point2I( x, y ), 0, mip ); + delete cellNormalmap; // Did we finish? if ( bitmaps.empty() ) diff --git a/Engine/source/ts/tsMesh.cpp b/Engine/source/ts/tsMesh.cpp index b52a50b96..5e767bd66 100644 --- a/Engine/source/ts/tsMesh.cpp +++ b/Engine/source/ts/tsMesh.cpp @@ -122,7 +122,7 @@ void TSMesh::innerRender( TSVertexBufferHandle &vb, GFXPrimitiveBufferHandle &pb GFX->setVertexBuffer( vb ); GFX->setPrimitiveBuffer( pb ); - for( U32 p = 0; p < primitives.size(); p++ ) + for( U32 p = 0; p < mPrimitives.size(); p++ ) GFX->drawPrimitive( p ); } @@ -223,9 +223,9 @@ void TSMesh::innerRender( TSMaterialList *materials, const TSRenderState &rdata, // NOTICE: SFXBB is removed and refraction is disabled! //coreRI->backBuffTex = GFX->getSfxBackBuffer(); - for ( S32 i = 0; i < primitives.size(); i++ ) + for ( S32 i = 0; i < mPrimitives.size(); i++ ) { - const TSDrawPrimitive &draw = primitives[i]; + const TSDrawPrimitive &draw = mPrimitives[i]; // We need to have a material. if ( draw.matIndex & TSDrawPrimitive::NoMaterial ) @@ -253,7 +253,7 @@ void TSMesh::innerRender( TSMaterialList *materials, const TSRenderState &rdata, #ifndef TORQUE_OS_MAC // Get the instancing material if this mesh qualifies. - if ( meshType != SkinMeshType && pb->mPrimitiveArray[i].numVertices < smMaxInstancingVerts ) + if (mMeshType != SkinMeshType && pb->mPrimitiveArray[i].numVertices < smMaxInstancingVerts ) if (matInst && !matInst->getFeatures().hasFeature(MFT_HardwareSkinning)) matInst = InstancingMaterialHook::getInstancingMat( matInst ); @@ -293,13 +293,13 @@ const Point3F * TSMesh::getNormals( S32 firstVert ) if ( getFlags( UseEncodedNormals ) ) { gNormalStore.setSize( vertsPerFrame ); - for ( S32 i = 0; i < encodedNorms.size(); i++ ) - gNormalStore[i] = decodeNormal( encodedNorms[ i + firstVert ] ); + for ( S32 i = 0; i < mEncodedNorms.size(); i++ ) + gNormalStore[i] = decodeNormal(mEncodedNorms[ i + firstVert ] ); return gNormalStore.address(); } - return &norms[firstVert]; + return &mNorms[firstVert]; } //----------------------------------------------------- @@ -352,28 +352,28 @@ bool TSMesh::buildPolyList( S32 frame, AbstractPolyList *polyList, U32 &surfaceK { // Don't use vertex() method as we want to retain the original indices OptimizedPolyList::VertIndex vert; - vert.vertIdx = opList->insertPoint( verts[ i + firstVert ] ); - vert.normalIdx = opList->insertNormal( norms[ i + firstVert ] ); - vert.uv0Idx = opList->insertUV0( tverts[ i + firstVert ] ); + vert.vertIdx = opList->insertPoint( mVerts[ i + firstVert ] ); + vert.normalIdx = opList->insertNormal( mNorms[ i + firstVert ] ); + vert.uv0Idx = opList->insertUV0( mTverts[ i + firstVert ] ); if ( hasTVert2 ) - vert.uv1Idx = opList->insertUV1( tverts2[ i + firstVert ] ); + vert.uv1Idx = opList->insertUV1(mTverts[ i + firstVert ] ); opList->mVertexList.push_back( vert ); } } else { - base = polyList->addPointAndNormal( verts[firstVert], norms[firstVert] ); + base = polyList->addPointAndNormal( mVerts[firstVert], mNorms[firstVert] ); for ( i = 1; i < vertsPerFrame; i++ ) - polyList->addPointAndNormal( verts[ i + firstVert ], norms[ i + firstVert ] ); + polyList->addPointAndNormal(mVerts[ i + firstVert ], mNorms[ i + firstVert ] ); } } } // add the polys... - for ( i = 0; i < primitives.size(); i++ ) + for ( i = 0; i < mPrimitives.size(); i++ ) { - TSDrawPrimitive & draw = primitives[i]; + TSDrawPrimitive & draw = mPrimitives[i]; U32 start = draw.start; AssertFatal( draw.matIndex & TSDrawPrimitive::Indexed,"TSMesh::buildPolyList (1)" ); @@ -386,9 +386,9 @@ bool TSMesh::buildPolyList( S32 frame, AbstractPolyList *polyList, U32 &surfaceK { for ( S32 j = 0; j < draw.numElements; ) { - U32 idx0 = base + indices[start + j + 0]; - U32 idx1 = base + indices[start + j + 1]; - U32 idx2 = base + indices[start + j + 2]; + U32 idx0 = base + mIndices[start + j + 0]; + U32 idx1 = base + mIndices[start + j + 1]; + U32 idx2 = base + mIndices[start + j + 2]; polyList->begin(material,surfaceKey++); polyList->vertex( idx0 ); polyList->vertex( idx1 ); @@ -402,16 +402,16 @@ bool TSMesh::buildPolyList( S32 frame, AbstractPolyList *polyList, U32 &surfaceK { AssertFatal( (draw.matIndex & TSDrawPrimitive::TypeMask) == TSDrawPrimitive::Strip,"TSMesh::buildPolyList (2)" ); - U32 idx0 = base + indices[start + 0]; + U32 idx0 = base + mIndices[start + 0]; U32 idx1; - U32 idx2 = base + indices[start + 1]; + U32 idx2 = base + mIndices[start + 1]; U32 * nextIdx = &idx1; for ( S32 j = 2; j < draw.numElements; j++ ) { *nextIdx = idx2; // nextIdx = (j%2)==0 ? &idx0 : &idx1; nextIdx = (U32*) ( (dsize_t)nextIdx ^ (dsize_t)&idx0 ^ (dsize_t)&idx1); - idx2 = base + indices[start + j]; + idx2 = base + mIndices[start + j]; if ( idx0 == idx1 || idx0 == idx2 || idx1 == idx2 ) continue; @@ -440,9 +440,9 @@ bool TSMesh::getFeatures( S32 frame, const MatrixF& mat, const VectorF&, ConvexF } // add the polys... - for ( i = 0; i < primitives.size(); i++ ) + for ( i = 0; i < mPrimitives.size(); i++ ) { - TSDrawPrimitive & draw = primitives[i]; + TSDrawPrimitive & draw = mPrimitives[i]; U32 start = draw.start; AssertFatal( draw.matIndex & TSDrawPrimitive::Indexed,"TSMesh::buildPolyList (1)" ); @@ -452,24 +452,24 @@ bool TSMesh::getFeatures( S32 frame, const MatrixF& mat, const VectorF&, ConvexF { for ( S32 j = 0; j < draw.numElements; j += 3 ) { - PlaneF plane( cf->mVertexList[base + indices[start + j + 0]], - cf->mVertexList[base + indices[start + j + 1]], - cf->mVertexList[base + indices[start + j + 2]]); + PlaneF plane( cf->mVertexList[base + mIndices[start + j + 0]], + cf->mVertexList[base + mIndices[start + j + 1]], + cf->mVertexList[base + mIndices[start + j + 2]]); cf->mFaceList.increment(); ConvexFeature::Face& lastFace = cf->mFaceList.last(); lastFace.normal = plane; - lastFace.vertex[0] = base + indices[start + j + 0]; - lastFace.vertex[1] = base + indices[start + j + 1]; - lastFace.vertex[2] = base + indices[start + j + 2]; + lastFace.vertex[0] = base + mIndices[start + j + 0]; + lastFace.vertex[1] = base + mIndices[start + j + 1]; + lastFace.vertex[2] = base + mIndices[start + j + 2]; for ( U32 l = 0; l < 3; l++ ) { U32 newEdge0, newEdge1; - U32 zero = base + indices[start + j + l]; - U32 one = base + indices[start + j + ((l+1)%3)]; + U32 zero = base + mIndices[start + j + l]; + U32 one = base + mIndices[start + j + ((l+1)%3)]; newEdge0 = getMin( zero, one ); newEdge1 = getMax( zero, one ); bool found = false; @@ -496,15 +496,15 @@ bool TSMesh::getFeatures( S32 frame, const MatrixF& mat, const VectorF&, ConvexF { AssertFatal( (draw.matIndex & TSDrawPrimitive::TypeMask) == TSDrawPrimitive::Strip,"TSMesh::buildPolyList (2)" ); - U32 idx0 = base + indices[start + 0]; + U32 idx0 = base + mIndices[start + 0]; U32 idx1; - U32 idx2 = base + indices[start + 1]; + U32 idx2 = base + mIndices[start + 1]; U32 * nextIdx = &idx1; for ( S32 j = 2; j < draw.numElements; j++ ) { *nextIdx = idx2; nextIdx = (U32*) ( (dsize_t)nextIdx ^ (dsize_t)&idx0 ^ (dsize_t)&idx1); - idx2 = base + indices[start + j]; + idx2 = base + mIndices[start + j]; if ( idx0 == idx1 || idx0 == idx2 || idx1 == idx2 ) continue; @@ -627,7 +627,7 @@ void TSMesh::support( S32 frame, const Point3F &v, F32 *currMaxDP, Point3F *curr bool TSMesh::castRay( S32 frame, const Point3F & start, const Point3F & end, RayInfo * rayInfo, TSMaterialList* materials ) { - if ( planeNormals.empty() ) + if ( mPlaneNormals.empty() ) buildConvexHull(); // if haven't done it yet... // Keep track of startTime and endTime. They start out at just under 0 and just over 1, respectively. @@ -657,15 +657,15 @@ bool TSMesh::castRay( S32 frame, const Point3F & start, const Point3F & end, Ray S32 * pplane = &curPlane; bool * pfound = &found; - S32 startPlane = frame * planesPerFrame; - for ( S32 i = startPlane; i < startPlane + planesPerFrame; i++ ) + S32 startPlane = frame * mPlanesPerFrame; + for ( S32 i = startPlane; i < startPlane + mPlanesPerFrame; i++ ) { // if start & end outside, no collision // if start & end inside, continue // if start outside, end inside, or visa versa, find intersection of line with plane // then update intersection of line with hull (using startTime and endTime) - F32 dot1 = mDot( planeNormals[i], start ) - planeConstants[i]; - F32 dot2 = mDot( planeNormals[i], end) - planeConstants[i]; + F32 dot1 = mDot(mPlaneNormals[i], start ) - mPlaneConstants[i]; + F32 dot2 = mDot(mPlaneNormals[i], end) - mPlaneConstants[i]; if ( dot1 * dot2 > 0.0f ) { // same side of the plane...which side -- dot==0 considered inside @@ -747,10 +747,10 @@ bool TSMesh::castRay( S32 frame, const Point3F & start, const Point3F & end, Ray // setup rayInfo if ( found && rayInfo ) { - curMaterial = planeMaterials[ curPlane - startPlane ]; + curMaterial = mPlaneMaterials[ curPlane - startPlane ]; rayInfo->t = (F32)startNum/(F32)startDen; // finally divide... - rayInfo->normal = planeNormals[curPlane]; + rayInfo->normal = mPlaneNormals[curPlane]; if (materials && materials->size() > 0) rayInfo->material = materials->getMaterialInst( curMaterial ); @@ -785,9 +785,9 @@ bool TSMesh::castRayRendered( S32 frame, const Point3F & start, const Point3F & BaseMatInstance* bestMaterial = NULL; Point3F dir = end - start; - for ( S32 i = 0; i < primitives.size(); i++ ) + for ( S32 i = 0; i < mPrimitives.size(); i++ ) { - TSDrawPrimitive & draw = primitives[i]; + TSDrawPrimitive & draw = mPrimitives[i]; U32 drawStart = draw.start; AssertFatal( draw.matIndex & TSDrawPrimitive::Indexed,"TSMesh::castRayRendered (1)" ); @@ -802,9 +802,9 @@ bool TSMesh::castRayRendered( S32 frame, const Point3F & start, const Point3F & { for ( S32 j = 0; j < draw.numElements-2; j += 3 ) { - idx0 = indices[drawStart + j + 0]; - idx1 = indices[drawStart + j + 1]; - idx2 = indices[drawStart + j + 2]; + idx0 = mIndices[drawStart + j + 0]; + idx1 = mIndices[drawStart + j + 1]; + idx2 = mIndices[drawStart + j + 2]; F32 cur_t = 0; Point2F b; @@ -828,15 +828,15 @@ bool TSMesh::castRayRendered( S32 frame, const Point3F & start, const Point3F & { AssertFatal( (draw.matIndex & TSDrawPrimitive::TypeMask) == TSDrawPrimitive::Strip,"TSMesh::castRayRendered (2)" ); - idx0 = indices[drawStart + 0]; - idx2 = indices[drawStart + 1]; + idx0 = mIndices[drawStart + 0]; + idx2 = mIndices[drawStart + 1]; U32 * nextIdx = &idx1; for ( S32 j = 2; j < draw.numElements; j++ ) { *nextIdx = idx2; // nextIdx = (j%2)==0 ? &idx0 : &idx1; nextIdx = (U32*) ( (dsize_t)nextIdx ^ (dsize_t)&idx0 ^ (dsize_t)&idx1); - idx2 = indices[drawStart + j]; + idx2 = mIndices[drawStart + j]; if ( idx0 == idx1 || idx0 == idx2 || idx1 == idx2 ) continue; @@ -927,35 +927,35 @@ bool TSMesh::addToHull( U32 idx0, U32 idx1, U32 idx2 ) normal.normalize(); F32 k = mDot( normal, mVertexData.getBase(idx0).vert() ); - for ( S32 i = 0; i < planeNormals.size(); i++ ) + for ( S32 i = 0; i < mPlaneNormals.size(); i++ ) { - if ( mDot( planeNormals[i], normal ) > 0.99f && mFabs( k-planeConstants[i] ) < 0.01f ) + if ( mDot(mPlaneNormals[i], normal ) > 0.99f && mFabs( k- mPlaneConstants[i] ) < 0.01f ) return false; // this is a repeat... } // new plane, add it to the list... - planeNormals.push_back( normal ); - planeConstants.push_back( k ); + mPlaneNormals.push_back( normal ); + mPlaneConstants.push_back( k ); return true; } bool TSMesh::buildConvexHull() { // already done, return without error - if ( planeNormals.size() ) + if (mPlaneNormals.size() ) return true; bool error = false; // should probably only have 1 frame, but just in case... - planesPerFrame = 0; + mPlanesPerFrame = 0; S32 frame, i, j; for ( frame = 0; frame < numFrames; frame++ ) { S32 firstVert = vertsPerFrame * frame; - S32 firstPlane = planeNormals.size(); - for ( i = 0; i < primitives.size(); i++ ) + S32 firstPlane = mPlaneNormals.size(); + for ( i = 0; i < mPrimitives.size(); i++ ) { - TSDrawPrimitive & draw = primitives[i]; + TSDrawPrimitive & draw = mPrimitives[i]; U32 start = draw.start; AssertFatal( draw.matIndex & TSDrawPrimitive::Indexed,"TSMesh::buildConvexHull (1)" ); @@ -964,71 +964,71 @@ bool TSMesh::buildConvexHull() if ( (draw.matIndex & TSDrawPrimitive::TypeMask) == TSDrawPrimitive::Triangles ) { for ( j = 0; j < draw.numElements; j += 3 ) - if ( addToHull( indices[start + j + 0] + firstVert, - indices[start + j + 1] + firstVert, - indices[start + j + 2] + firstVert ) && frame == 0 ) - planeMaterials.push_back( draw.matIndex & TSDrawPrimitive::MaterialMask ); + if ( addToHull( mIndices[start + j + 0] + firstVert, + mIndices[start + j + 1] + firstVert, + mIndices[start + j + 2] + firstVert ) && frame == 0 ) + mPlaneMaterials.push_back( draw.matIndex & TSDrawPrimitive::MaterialMask ); } else { AssertFatal( (draw.matIndex&TSDrawPrimitive::Strip) == TSDrawPrimitive::Strip,"TSMesh::buildConvexHull (2)" ); - U32 idx0 = indices[start + 0] + firstVert; + U32 idx0 = mIndices[start + 0] + firstVert; U32 idx1; - U32 idx2 = indices[start + 1] + firstVert; + U32 idx2 = mIndices[start + 1] + firstVert; U32 * nextIdx = &idx1; for ( j = 2; j < draw.numElements; j++ ) { *nextIdx = idx2; // nextIdx = (j%2)==0 ? &idx0 : &idx1; nextIdx = (U32*) ( (dsize_t)nextIdx ^ (dsize_t)&idx0 ^ (dsize_t)&idx1 ); - idx2 = indices[start + j] + firstVert; + idx2 = mIndices[start + j] + firstVert; if ( addToHull( idx0, idx1, idx2 ) && frame == 0 ) - planeMaterials.push_back( draw.matIndex & TSDrawPrimitive::MaterialMask ); + mPlaneMaterials.push_back( draw.matIndex & TSDrawPrimitive::MaterialMask ); } } } // make sure all the verts on this frame are inside all the planes for ( i = 0; i < vertsPerFrame; i++ ) - for ( j = firstPlane; j < planeNormals.size(); j++ ) - if ( mDot( mVertexData.getBase(firstVert + i).vert(), planeNormals[j] ) - planeConstants[j] < 0.01 ) // .01 == a little slack + for ( j = firstPlane; j < mPlaneNormals.size(); j++ ) + if ( mDot( mVertexData.getBase(firstVert + i).vert(), mPlaneNormals[j] ) - mPlaneConstants[j] < 0.01 ) // .01 == a little slack error = true; if ( frame == 0 ) - planesPerFrame = planeNormals.size(); + mPlanesPerFrame = mPlaneNormals.size(); - if ( (frame + 1) * planesPerFrame != planeNormals.size() ) + if ( (frame + 1) * mPlanesPerFrame != mPlaneNormals.size() ) { // eek, not all frames have same number of planes... - while ( (frame + 1) * planesPerFrame > planeNormals.size() ) + while ( (frame + 1) * mPlanesPerFrame > mPlaneNormals.size() ) { // we're short, duplicate last plane till we match - U32 sz = planeNormals.size(); - planeNormals.increment(); - planeNormals.last() = planeNormals[sz-1]; - planeConstants.increment(); - planeConstants.last() = planeConstants[sz-1]; + U32 sz = mPlaneNormals.size(); + mPlaneNormals.increment(); + mPlaneNormals.last() = mPlaneNormals[sz-1]; + mPlaneConstants.increment(); + mPlaneConstants.last() = mPlaneConstants[sz-1]; } - while ( (frame + 1) * planesPerFrame < planeNormals.size() ) + while ( (frame + 1) * mPlanesPerFrame < mPlaneNormals.size() ) { // harsh -- last frame has more than other frames // duplicate last plane in each frame for ( S32 k = frame - 1; k >= 0; k-- ) { - planeNormals.insert( k * planesPerFrame + planesPerFrame ); - planeNormals[k * planesPerFrame + planesPerFrame] = planeNormals[k * planesPerFrame + planesPerFrame - 1]; - planeConstants.insert( k * planesPerFrame + planesPerFrame ); - planeConstants[k * planesPerFrame + planesPerFrame] = planeConstants[k * planesPerFrame + planesPerFrame - 1]; + mPlaneNormals.insert( k * mPlanesPerFrame + mPlanesPerFrame ); + mPlaneNormals[k * mPlanesPerFrame + mPlanesPerFrame] = mPlaneNormals[k * mPlanesPerFrame + mPlanesPerFrame - 1]; + mPlaneConstants.insert( k * mPlanesPerFrame + mPlanesPerFrame ); + mPlaneConstants[k * mPlanesPerFrame + mPlanesPerFrame] = mPlaneConstants[k * mPlanesPerFrame + mPlanesPerFrame - 1]; if ( k == 0 ) { - planeMaterials.increment(); - planeMaterials.last() = planeMaterials[planeMaterials.size() - 2]; + mPlaneMaterials.increment(); + mPlaneMaterials.last() = mPlaneMaterials[mPlaneMaterials.size() - 2]; } } - planesPerFrame++; + mPlanesPerFrame++; } } - AssertFatal( (frame + 1) * planesPerFrame == planeNormals.size(),"TSMesh::buildConvexHull (3)" ); + AssertFatal( (frame + 1) * mPlanesPerFrame == mPlaneNormals.size(),"TSMesh::buildConvexHull (3)" ); } return !error; } @@ -1051,7 +1051,7 @@ void TSMesh::computeBounds( const MatrixF &transform, Box3F &bounds, S32 frame, AssertFatal(!mVertexData.isReady() || (mVertexData.isReady() && mNumVerts == mVertexData.size() && mNumVerts == vertsPerFrame), "vertex number mismatch"); - if(verts.size() == 0 && mVertexData.isReady() && mVertexData.size() > 0) + if(mVerts.size() == 0 && mVertexData.isReady() && mVertexData.size() > 0) { baseVert = &mVertexData.getBase(0).vert(); stride = mVertexData.vertSize(); @@ -1066,11 +1066,11 @@ void TSMesh::computeBounds( const MatrixF &transform, Box3F &bounds, S32 frame, } else { - baseVert = verts.address(); + baseVert = mVerts.address(); stride = sizeof(Point3F); if ( frame < 0 ) - numVerts = verts.size(); + numVerts = mVerts.size(); else { baseVert += frame * vertsPerFrame; @@ -1131,27 +1131,27 @@ void TSMesh::computeBounds( const Point3F *v, S32 numVerts, S32 stride, const Ma S32 TSMesh::getNumPolys() const { S32 count = 0; - for ( S32 i = 0; i < primitives.size(); i++ ) + for ( S32 i = 0; i < mPrimitives.size(); i++ ) { - switch (primitives[i].matIndex & TSDrawPrimitive::TypeMask) + switch (mPrimitives[i].matIndex & TSDrawPrimitive::TypeMask) { case TSDrawPrimitive::Triangles: - count += primitives[i].numElements / 3; + count += mPrimitives[i].numElements / 3; break; case TSDrawPrimitive::Fan: - count += primitives[i].numElements - 2; + count += mPrimitives[i].numElements - 2; break; case TSDrawPrimitive::Strip: // Don't count degenerate triangles - for ( S32 j = primitives[i].start; - j < primitives[i].start+primitives[i].numElements-2; + for ( S32 j = mPrimitives[i].start; + j < mPrimitives[i].start+ mPrimitives[i].numElements-2; j++ ) { - if ((indices[j] != indices[j+1]) && - (indices[j] != indices[j+2]) && - (indices[j+1] != indices[j+2])) + if ((mIndices[j] != mIndices[j+1]) && + (mIndices[j] != mIndices[j+2]) && + (mIndices[j+1] != mIndices[j+2])) count++; } break; @@ -1162,12 +1162,12 @@ S32 TSMesh::getNumPolys() const //----------------------------------------------------- -TSMesh::TSMesh() : meshType( StandardMeshType ) +TSMesh::TSMesh() : mMeshType( StandardMeshType ) { - VECTOR_SET_ASSOCIATION( planeNormals ); - VECTOR_SET_ASSOCIATION( planeConstants ); - VECTOR_SET_ASSOCIATION( planeMaterials ); - parentMesh = -1; + VECTOR_SET_ASSOCIATION(mPlaneNormals ); + VECTOR_SET_ASSOCIATION(mPlaneConstants ); + VECTOR_SET_ASSOCIATION(mPlaneMaterials ); + mParentMesh = -1; mOptTree = NULL; mOpMeshInterface = NULL; @@ -1181,7 +1181,7 @@ TSMesh::TSMesh() : meshType( StandardMeshType ) mVertSize = 0; mVertOffset = 0; - parentMeshObject = NULL; + mParentMeshObject = NULL; } //----------------------------------------------------- @@ -1326,8 +1326,8 @@ void TSSkinMesh::createSkinBatchData() } else { - batchData.initialNorms = norms; - batchData.initialVerts = verts; + batchData.initialNorms = mNorms; + batchData.initialVerts = mVerts; } // Build the batch operations @@ -1546,10 +1546,10 @@ void TSSkinMesh::computeBounds( const MatrixF &transform, Box3F &bounds, S32 fra { TORQUE_UNUSED(frame); - if (verts.size() != 0) + if (mVerts.size() != 0) { // Use unskinned verts - TSMesh::computeBounds( verts.address(), verts.size(), sizeof(Point3F), transform, bounds, center, radius ); + TSMesh::computeBounds(mVerts.address(), mVerts.size(), sizeof(Point3F), transform, bounds, center, radius ); } else if (frame <= 0 && batchData.initialVerts.size() > 0) { @@ -2368,10 +2368,10 @@ void TSMesh::dumpPrimitives(U32 startVertex, U32 startIndex, GFXPrimitive *piArr // go through and create PrimitiveInfo array GFXPrimitive pInfo; - U32 primitivesSize = primitives.size(); + U32 primitivesSize = mPrimitives.size(); for (U32 i = 0; i < primitivesSize; i++) { - const TSDrawPrimitive & draw = primitives[i]; + const TSDrawPrimitive & draw = mPrimitives[i]; GFXPrimitiveType drawType = getDrawType(draw.matIndex >> 30); @@ -2382,7 +2382,7 @@ void TSMesh::dumpPrimitives(U32 startVertex, U32 startIndex, GFXPrimitive *piArr pInfo.numPrimitives = draw.numElements / 3; pInfo.startIndex = startIndex + draw.start; // Use the first index to determine which 16-bit address space we are operating in - pInfo.startVertex = (indices[draw.start] & 0xFFFF0000); // TODO: figure out a good solution for this + pInfo.startVertex = (mIndices[draw.start] & 0xFFFF0000); // TODO: figure out a good solution for this pInfo.minIndex = 0; // minIndex are zero based index relative to startVertex. See @GFXDevice pInfo.numVertices = getMin((U32)0x10000, mNumVerts - pInfo.startVertex); pInfo.startVertex += startVertex; @@ -2393,7 +2393,7 @@ void TSMesh::dumpPrimitives(U32 startVertex, U32 startIndex, GFXPrimitive *piArr pInfo.numPrimitives = draw.numElements - 2; pInfo.startIndex = startIndex + draw.start; // Use the first index to determine which 16-bit address space we are operating in - pInfo.startVertex = (indices[draw.start] & 0xFFFF0000); // TODO: figure out a good solution for this + pInfo.startVertex = (mIndices[draw.start] & 0xFFFF0000); // TODO: figure out a good solution for this pInfo.minIndex = 0; // minIndex are zero based index relative to startVertex. See @GFXDevice pInfo.numVertices = getMin((U32)0x10000, mNumVerts - pInfo.startVertex); pInfo.startVertex += startVertex; @@ -2406,7 +2406,7 @@ void TSMesh::dumpPrimitives(U32 startVertex, U32 startIndex, GFXPrimitive *piArr *piArray++ = pInfo; } - dCopyArray(ibIndices, indices.address(), indices.size()); + dCopyArray(ibIndices, mIndices.address(), mIndices.size()); } void TSMesh::assemble( bool skip ) @@ -2415,7 +2415,7 @@ void TSMesh::assemble( bool skip ) numFrames = tsalloc.get32(); numMatFrames = tsalloc.get32(); - parentMesh = tsalloc.get32(); + mParentMesh = tsalloc.get32(); tsalloc.get32( (S32*)&mBounds, 6 ); tsalloc.get32( (S32*)&mCenter, 3 ); mRadius = (F32)tsalloc.get32(); @@ -2435,51 +2435,51 @@ void TSMesh::assemble( bool skip ) } S32 numVerts = tsalloc.get32(); - S32 *ptr32 = getSharedData32( parentMesh, 3 * numVerts, (S32**)smVertsList.address(), skip ); - verts.set( (Point3F*)ptr32, numVerts ); + S32 *ptr32 = getSharedData32(mParentMesh, 3 * numVerts, (S32**)smVertsList.address(), skip ); + mVerts.set( (Point3F*)ptr32, numVerts ); S32 numTVerts = tsalloc.get32(); - ptr32 = getSharedData32( parentMesh, 2 * numTVerts, (S32**)smTVertsList.address(), skip ); - tverts.set( (Point2F*)ptr32, numTVerts ); + ptr32 = getSharedData32(mParentMesh, 2 * numTVerts, (S32**)smTVertsList.address(), skip ); + mTverts.set( (Point2F*)ptr32, numTVerts ); if ( TSShape::smReadVersion > 25 ) { numTVerts = tsalloc.get32(); - ptr32 = getSharedData32( parentMesh, 2 * numTVerts, (S32**)smTVerts2List.address(), skip ); - tverts2.set( (Point2F*)ptr32, numTVerts ); + ptr32 = getSharedData32(mParentMesh, 2 * numTVerts, (S32**)smTVerts2List.address(), skip ); + mTverts2.set( (Point2F*)ptr32, numTVerts ); S32 numVColors = tsalloc.get32(); - ptr32 = getSharedData32( parentMesh, numVColors, (S32**)smColorsList.address(), skip ); - colors.set( (ColorI*)ptr32, numVColors ); + ptr32 = getSharedData32(mParentMesh, numVColors, (S32**)smColorsList.address(), skip ); + mColors.set( (ColorI*)ptr32, numVColors ); } S8 *ptr8; if ( TSShape::smReadVersion > 21 && TSMesh::smUseEncodedNormals) { // we have encoded normals and we want to use them... - if ( parentMesh < 0 ) + if (mParentMesh < 0 ) tsalloc.getPointer32( numVerts * 3 ); // adva nce past norms, don't use - norms.set( NULL, 0 ); + mNorms.set( NULL, 0 ); - ptr8 = getSharedData8( parentMesh, numVerts, (S8**)smEncodedNormsList.address(), skip ); - encodedNorms.set( ptr8, numVerts ); + ptr8 = getSharedData8(mParentMesh, numVerts, (S8**)smEncodedNormsList.address(), skip ); + mEncodedNorms.set( ptr8, numVerts ); } else if ( TSShape::smReadVersion > 21 ) { // we have encoded normals but we don't want to use them... - ptr32 = getSharedData32( parentMesh, 3 * numVerts, (S32**)smNormsList.address(), skip ); - norms.set( (Point3F*)ptr32, numVerts ); + ptr32 = getSharedData32(mParentMesh, 3 * numVerts, (S32**)smNormsList.address(), skip ); + mNorms.set( (Point3F*)ptr32, numVerts ); - if ( parentMesh < 0 ) + if (mParentMesh < 0 ) tsalloc.getPointer8( numVerts ); // advance past encoded normls, don't use - encodedNorms.set( NULL, 0 ); + mEncodedNorms.set( NULL, 0 ); } else { // no encoded normals... - ptr32 = getSharedData32( parentMesh, 3 * numVerts, (S32**)smNormsList.address(), skip ); - norms.set( (Point3F*)ptr32, numVerts ); - encodedNorms.set( NULL, 0 ); + ptr32 = getSharedData32(mParentMesh, 3 * numVerts, (S32**)smNormsList.address(), skip ); + mNorms.set( (Point3F*)ptr32, numVerts ); + mEncodedNorms.set( NULL, 0 ); } // copy the primitives and indices...how we do this depends on what @@ -2553,8 +2553,8 @@ void TSMesh::assemble( bool skip ) AssertFatal(chkPrim==szPrimOut && chkInd==szIndOut,"TSMesh::primitive conversion"); // store output - primitives.set(primOut, szPrimOut); - indices.set(indOut, szIndOut); + mPrimitives.set(primOut, szPrimOut); + mIndices.set(indOut, szIndOut); // delete temporary arrays if necessary if (deleteInputArrays) @@ -2569,7 +2569,7 @@ void TSMesh::assemble( bool skip ) vertsPerFrame = tsalloc.get32(); U32 flags = (U32)tsalloc.get32(); - if ( encodedNorms.size() ) + if ( mEncodedNorms.size() ) flags |= UseEncodedNormals; setFlags( flags ); @@ -2577,9 +2577,9 @@ void TSMesh::assemble( bool skip ) // Set color & tvert2 flags if we have an old version if (TSShape::smReadVersion < 27) { - if (colors.size() > 0) setFlags(HasColor); - if (tverts2.size() > 0) setFlags(HasTVert2); - mNumVerts = verts.size(); + if (mColors.size() > 0) setFlags(HasColor); + if (mTverts2.size() > 0) setFlags(HasTVert2); + mNumVerts = mVerts.size(); } tsalloc.checkGuard(); @@ -2587,7 +2587,7 @@ void TSMesh::assemble( bool skip ) if ( tsalloc.allocShape32( 0 ) && TSShape::smReadVersion < 19 ) computeBounds(); // only do this if we copied the data... - createTangents(verts, norms); + createTangents(mVerts, mNorms); } void TSMesh::disassemble() @@ -2596,7 +2596,7 @@ void TSMesh::disassemble() tsalloc.set32( numFrames ); tsalloc.set32( numMatFrames ); - tsalloc.set32( parentMesh ); + tsalloc.set32(mParentMesh); tsalloc.copyToBuffer32( (S32*)&mBounds, 6 ); tsalloc.copyToBuffer32( (S32*)&mCenter, 3 ); tsalloc.set32( (S32)mRadius ); @@ -2636,39 +2636,39 @@ void TSMesh::disassemble() else { // verts... - tsalloc.set32(verts.size()); - if (parentMesh < 0) - tsalloc.copyToBuffer32((S32*)verts.address(), 3 * verts.size()); // if no parent mesh, then save off our verts + tsalloc.set32(mVerts.size()); + if (mParentMesh < 0) + tsalloc.copyToBuffer32((S32*)mVerts.address(), 3 * mVerts.size()); // if no parent mesh, then save off our verts // tverts... - tsalloc.set32(tverts.size()); - if (parentMesh < 0) - tsalloc.copyToBuffer32((S32*)tverts.address(), 2 * tverts.size()); // if no parent mesh, then save off our tverts + tsalloc.set32(mTverts.size()); + if (mParentMesh < 0) + tsalloc.copyToBuffer32((S32*)mTverts.address(), 2 * mTverts.size()); // if no parent mesh, then save off our tverts if (TSShape::smVersion > 25) { // tverts2... - tsalloc.set32(tverts2.size()); - if (parentMesh < 0) - tsalloc.copyToBuffer32((S32*)tverts2.address(), 2 * tverts2.size()); // if no parent mesh, then save off our tverts + tsalloc.set32(mTverts2.size()); + if (mParentMesh < 0) + tsalloc.copyToBuffer32((S32*)mTverts2.address(), 2 * mTverts2.size()); // if no parent mesh, then save off our tverts // colors - tsalloc.set32(colors.size()); - if (parentMesh < 0) - tsalloc.copyToBuffer32((S32*)colors.address(), colors.size()); // if no parent mesh, then save off our tverts + tsalloc.set32(mColors.size()); + if (mParentMesh < 0) + tsalloc.copyToBuffer32((S32*)mColors.address(), mColors.size()); // if no parent mesh, then save off our tverts } // norms... - if (parentMesh < 0) // if no parent mesh, then save off our norms - tsalloc.copyToBuffer32((S32*)norms.address(), 3 * norms.size()); // norms.size()==verts.size() or error... + if (mParentMesh < 0) // if no parent mesh, then save off our norms + tsalloc.copyToBuffer32((S32*)mNorms.address(), 3 * mNorms.size()); // norms.size()==verts.size() or error... // encoded norms... - if (parentMesh < 0) + if (mParentMesh < 0) { // if no parent mesh, compute encoded normals and copy over - for (S32 i = 0; i < norms.size(); i++) + for (S32 i = 0; i < mNorms.size(); i++) { - U8 normIdx = encodedNorms.size() ? encodedNorms[i] : encodeNormal(norms[i]); + U8 normIdx = mEncodedNorms.size() ? mEncodedNorms[i] : encodeNormal(mNorms[i]); tsalloc.copyToBuffer8((S8*)&normIdx, 1); } } @@ -2676,17 +2676,17 @@ void TSMesh::disassemble() // optimize triangle draw order during disassemble { - FrameTemp tmpIdxs(indices.size()); - for ( S32 i = 0; i < primitives.size(); i++ ) + FrameTemp tmpIdxs(mIndices.size()); + for ( S32 i = 0; i < mPrimitives.size(); i++ ) { - const TSDrawPrimitive& prim = primitives[i]; + const TSDrawPrimitive& prim = mPrimitives[i]; // only optimize triangle lists (strips and fans are assumed to be already optimized) if ( (prim.matIndex & TSDrawPrimitive::TypeMask) == TSDrawPrimitive::Triangles ) { - TriListOpt::OptimizeTriangleOrdering(verts.size(), prim.numElements, - indices.address() + prim.start, tmpIdxs.address()); - dCopyArray(indices.address() + prim.start, tmpIdxs.address(), + TriListOpt::OptimizeTriangleOrdering(mVerts.size(), prim.numElements, + mIndices.address() + prim.start, tmpIdxs.address()); + dCopyArray(mIndices.address() + prim.start, tmpIdxs.address(), prim.numElements); } } @@ -2695,32 +2695,32 @@ void TSMesh::disassemble() if (TSShape::smVersion > 25) { // primitives... - tsalloc.set32( primitives.size() ); - tsalloc.copyToBuffer32((S32*)primitives.address(),3*primitives.size()); + tsalloc.set32(mPrimitives.size() ); + tsalloc.copyToBuffer32((S32*)mPrimitives.address(),3* mPrimitives.size()); // indices... - tsalloc.set32(indices.size()); - tsalloc.copyToBuffer32((S32*)indices.address(),indices.size()); + tsalloc.set32(mIndices.size()); + tsalloc.copyToBuffer32((S32*)mIndices.address(),mIndices.size()); } else { // primitives - tsalloc.set32( primitives.size() ); - for (S32 i=0; i s16_indices(indices.size()); - for (S32 i=0; i s16_indices(mIndices.size()); + for (S32 i=0; i 21 && TSMesh::smUseEncodedNormals) { // we have encoded normals and we want to use them... - if (parentMesh < 0) + if (mParentMesh < 0) tsalloc.getPointer32(numVerts * 3); // advance past norms, don't use batchData.initialNorms.set(NULL, 0); - ptr8 = getSharedData8(parentMesh, numVerts, (S8**)smEncodedNormsList.address(), skip); - encodedNorms.set(ptr8, numVerts); + ptr8 = getSharedData8(mParentMesh, numVerts, (S8**)smEncodedNormsList.address(), skip); + mEncodedNorms.set(ptr8, numVerts); // Note: we don't set the encoded normals flag because we handle them in updateSkin and // hide the fact that we are using them from base class (TSMesh) } else if (TSShape::smReadVersion > 21) { // we have encoded normals but we don't want to use them... - ptr32 = getSharedData32(parentMesh, 3 * numVerts, (S32**)smNormsList.address(), skip); + ptr32 = getSharedData32(mParentMesh, 3 * numVerts, (S32**)smNormsList.address(), skip); batchData.initialNorms.set((Point3F*)ptr32, numVerts); - if (parentMesh < 0) + if (mParentMesh < 0) tsalloc.getPointer8(numVerts); // advance past encoded normls, don't use - encodedNorms.set(NULL, 0); + mEncodedNorms.set(NULL, 0); } else { // no encoded normals... - ptr32 = getSharedData32(parentMesh, 3 * numVerts, (S32**)smNormsList.address(), skip); + ptr32 = getSharedData32(mParentMesh, 3 * numVerts, (S32**)smNormsList.address(), skip); batchData.initialNorms.set((Point3F*)ptr32, numVerts); - encodedNorms.set(NULL, 0); + mEncodedNorms.set(NULL, 0); } // Sometimes we'll have a mesh with 0 verts but initialVerts is set, // so set these accordingly - if (verts.size() == 0) + if (mVerts.size() == 0) { - verts = batchData.initialVerts; + mVerts = batchData.initialVerts; } - if (norms.size() == 0) + if (mNorms.size() == 0) { - norms = batchData.initialNorms; + mNorms = batchData.initialNorms; } } else { // Set from the mesh data - batchData.initialVerts = verts; - batchData.initialNorms = norms; + batchData.initialVerts = mVerts; + batchData.initialNorms = mNorms; } sz = tsalloc.get32(); - ptr32 = getSharedData32( parentMesh, 16 * sz, (S32**)smInitTransformList.address(), skip ); + ptr32 = getSharedData32(mParentMesh, 16 * sz, (S32**)smInitTransformList.address(), skip ); batchData.initialTransforms.set( ptr32, sz ); sz = tsalloc.get32(); - ptr32 = getSharedData32( parentMesh, sz, (S32**)smVertexIndexList.address(), skip ); + ptr32 = getSharedData32(mParentMesh, sz, (S32**)smVertexIndexList.address(), skip ); vertexIndex.set( ptr32, sz ); - ptr32 = getSharedData32( parentMesh, sz, (S32**)smBoneIndexList.address(), skip ); + ptr32 = getSharedData32(mParentMesh, sz, (S32**)smBoneIndexList.address(), skip ); boneIndex.set( ptr32, sz ); - ptr32 = getSharedData32( parentMesh, sz, (S32**)smWeightList.address(), skip ); + ptr32 = getSharedData32(mParentMesh, sz, (S32**)smWeightList.address(), skip ); weight.set( (F32*)ptr32, sz ); sz = tsalloc.get32(); - ptr32 = getSharedData32( parentMesh, sz, (S32**)smNodeIndexList.address(), skip ); + ptr32 = getSharedData32(mParentMesh, sz, (S32**)smNodeIndexList.address(), skip ); batchData.nodeIndex.set( ptr32, sz ); tsalloc.checkGuard(); @@ -2883,24 +2883,24 @@ void TSSkinMesh::disassemble() { tsalloc.set32(batchData.initialVerts.size()); // if we have no parent mesh, then save off our verts & norms - if (parentMesh < 0) + if (mParentMesh < 0) { - tsalloc.copyToBuffer32((S32*)verts.address(), 3 * verts.size()); + tsalloc.copyToBuffer32((S32*)mVerts.address(), 3 * mVerts.size()); // no longer do this here...let tsmesh handle this - tsalloc.copyToBuffer32((S32*)norms.address(), 3 * norms.size()); + tsalloc.copyToBuffer32((S32*)mNorms.address(), 3 * mNorms.size()); // if no parent mesh, compute encoded normals and copy over - for (S32 i = 0; i < norms.size(); i++) + for (S32 i = 0; i < mNorms.size(); i++) { - U8 normIdx = encodedNorms.size() ? encodedNorms[i] : encodeNormal(norms[i]); + U8 normIdx = mEncodedNorms.size() ? mEncodedNorms[i] : encodeNormal(mNorms[i]); tsalloc.copyToBuffer8((S8*)&normIdx, 1); } } } tsalloc.set32( batchData.initialTransforms.size() ); - if ( parentMesh < 0 ) + if (mParentMesh < 0 ) tsalloc.copyToBuffer32( (S32*)batchData.initialTransforms.address(), batchData.initialTransforms.size() * 16 ); if (!mVertexData.isReady()) @@ -2920,7 +2920,7 @@ void TSSkinMesh::disassemble() if (TSShape::smVersion < 27) { - if (parentMesh < 0) + if (mParentMesh < 0) { tsalloc.copyToBuffer32((S32*)vertexIndex.address(), vertexIndex.size()); @@ -2931,7 +2931,7 @@ void TSSkinMesh::disassemble() } tsalloc.set32( batchData.nodeIndex.size() ); - if ( parentMesh < 0 ) + if (mParentMesh < 0 ) tsalloc.copyToBuffer32( (S32*)batchData.nodeIndex.address(), batchData.nodeIndex.size() ); tsalloc.setGuard(); @@ -2939,7 +2939,7 @@ void TSSkinMesh::disassemble() TSSkinMesh::TSSkinMesh() { - meshType = SkinMeshType; + mMeshType = SkinMeshType; batchData.initialized = false; maxBones = -1; } @@ -2958,9 +2958,9 @@ inline void TSMesh::findTangent( U32 index1, const Point3F &v2 = _verts[index2]; const Point3F &v3 = _verts[index3]; - const Point2F &w1 = tverts[index1]; - const Point2F &w2 = tverts[index2]; - const Point2F &w3 = tverts[index3]; + const Point2F &w1 = mTverts[index1]; + const Point2F &w2 = mTverts[index2]; + const Point2F &w3 = mTverts[index3]; F32 x1 = v2.x - v1.x; F32 x2 = v3.x - v1.x; @@ -3025,17 +3025,17 @@ void TSMesh::createTangents(const Vector &_verts, const Vector Point3F *tan1 = tan0.address() + numVerts; dMemset( tan0.address(), 0, sizeof(Point3F) * 2 * numVerts ); - U32 numPrimatives = primitives.size(); + U32 numPrimatives = mPrimitives.size(); for (S32 i = 0; i < numPrimatives; i++ ) { - const TSDrawPrimitive & draw = primitives[i]; + const TSDrawPrimitive & draw = mPrimitives[i]; GFXPrimitiveType drawType = getDrawType( draw.matIndex >> 30 ); U32 p1Index = 0; U32 p2Index = 0; - U32 *baseIdx = &indices[draw.start]; + U32 *baseIdx = &mIndices[draw.start]; const U32 numElements = (U32)draw.numElements; @@ -3066,7 +3066,7 @@ void TSMesh::createTangents(const Vector &_verts, const Vector } } - tangents.setSize( numVerts ); + mTangents.setSize( numVerts ); // fill out final info from accumulated basis data for( U32 i = 0; i < numVerts; i++ ) @@ -3077,12 +3077,12 @@ void TSMesh::createTangents(const Vector &_verts, const Vector Point3F tempPt = t - n * mDot( n, t ); tempPt.normalize(); - tangents[i] = tempPt; + mTangents[i] = tempPt; Point3F cp; mCross( n, t, &cp ); - tangents[i].w = (mDot( cp, b ) < 0.0f) ? -1.0f : 1.0f; + mTangents[i].w = (mDot( cp, b ) < 0.0f) ? -1.0f : 1.0f; } } @@ -3090,7 +3090,7 @@ void TSMesh::convertToVertexData() { if (!mVertexData.isReady()) { - _convertToVertexData(mVertexData, verts, norms); + _convertToVertexData(mVertexData, mVerts, mNorms); } } @@ -3111,39 +3111,39 @@ void TSSkinMesh::convertToVertexData() void TSMesh::copySourceVertexDataFrom(const TSMesh* srcMesh) { - verts = srcMesh->verts; - tverts = srcMesh->tverts; - norms = srcMesh->norms; - colors = srcMesh->colors; - tverts2 = srcMesh->tverts2; + mVerts = srcMesh->mVerts; + mTverts = srcMesh->mTverts; + mNorms = srcMesh->mNorms; + mColors = srcMesh->mColors; + mTverts2 = srcMesh->mTverts2; - if (verts.size() == 0) + if (mVerts.size() == 0) { bool hasTVert2 = srcMesh->getHasTVert2(); bool hasColor = srcMesh->getHasColor(); - verts.setSize(srcMesh->mNumVerts); - tverts.setSize(srcMesh->mNumVerts); - norms.setSize(srcMesh->mNumVerts); + mVerts.setSize(srcMesh->mNumVerts); + mTverts.setSize(srcMesh->mNumVerts); + mNorms.setSize(srcMesh->mNumVerts); if (hasColor) - colors.setSize(mNumVerts); + mColors.setSize(mNumVerts); if (hasTVert2) - tverts2.setSize(mNumVerts); + mTverts2.setSize(mNumVerts); // Fill arrays for (U32 i = 0; i < mNumVerts; i++) { const __TSMeshVertexBase &cv = srcMesh->mVertexData.getBase(i); const __TSMeshVertex_3xUVColor &cvc = srcMesh->mVertexData.getColor(i); - verts[i] = cv.vert(); - tverts[i] = cv.tvert(); - norms[i] = cv.normal(); + mVerts[i] = cv.vert(); + mTverts[i] = cv.tvert(); + mNorms[i] = cv.normal(); if (hasColor) - cvc.color().getColor(&colors[i]); + cvc.color().getColor(&mColors[i]); if (hasTVert2) - tverts2[i] = cvc.tvert2(); + mTverts2[i] = cvc.tvert2(); } } } @@ -3173,21 +3173,21 @@ void TSSkinMesh::copySourceVertexDataFrom(const TSMesh* srcMesh) U32 TSMesh::getNumVerts() { - return mVertexData.isReady() ? mNumVerts : verts.size(); + return mVertexData.isReady() ? mNumVerts : mVerts.size(); } void TSMesh::_convertToVertexData(TSMeshVertexArray &outArray, const Vector &_verts, const Vector &_norms) { // Update tangents list - createTangents(verts, norms); + createTangents(mVerts, mNorms); AssertFatal(_verts.size() == mNumVerts, "vert count mismatch"); - AssertFatal(!getHasColor() || colors.size() == _verts.size(), "Vector of color elements should be the same size as other vectors"); - AssertFatal(!getHasTVert2() || tverts2.size() == _verts.size(), "Vector of tvert2 elements should be the same size as other vectors"); + AssertFatal(!getHasColor() || mColors.size() == _verts.size(), "Vector of color elements should be the same size as other vectors"); + AssertFatal(!getHasTVert2() || mTverts2.size() == _verts.size(), "Vector of tvert2 elements should be the same size as other vectors"); AssertFatal(!outArray.isReady(), "Mesh already converted to aligned data! Re-check code!"); AssertFatal(_verts.size() == _norms.size() && - _verts.size() == tangents.size(), + _verts.size() == mTangents.size(), "Vectors: verts, norms, tangents must all be the same size"); AssertFatal(mVertSize == outArray.vertSize(), "Size inconsistency"); @@ -3206,18 +3206,18 @@ void TSMesh::_convertToVertexData(TSMeshVertexArray &outArray, const Vector 0 || meshType & HasColor; } - U32 getHasTVert2() const { return tverts2.size() > 0 || meshType & HasTVert2; } - void setFlags(U32 flag) { meshType |= flag; } - void clearFlags(U32 flag) { meshType &= ~flag; } - U32 getFlags( U32 flag = 0xFFFFFFFF ) const { return meshType & flag; } + U32 getMeshType() const { return mMeshType & TypeMask; } + U32 getHasColor() const { return mColors.size() > 0 || mMeshType & HasColor; } + U32 getHasTVert2() const { return mTverts2.size() > 0 || mMeshType & HasTVert2; } + void setFlags(U32 flag) { mMeshType |= flag; } + void clearFlags(U32 flag) { mMeshType &= ~flag; } + U32 getFlags( U32 flag = 0xFFFFFFFF ) const { return mMeshType & flag; } const Point3F* getNormals( S32 firstVert ); @@ -319,34 +319,34 @@ protected: /// @name Vertex data /// @{ - FreeableVector verts; - FreeableVector norms; - FreeableVector tverts; - FreeableVector tangents; + FreeableVector mVerts; + FreeableVector mNorms; + FreeableVector mTverts; + FreeableVector mTangents; // Optional second texture uvs. - FreeableVector tverts2; + FreeableVector mTverts2; // Optional vertex colors data. - FreeableVector colors; + FreeableVector mColors; /// @} - Vector primitives; - Vector encodedNorms; - Vector indices; + Vector mPrimitives; + Vector mEncodedNorms; + Vector mIndices; /// billboard data - Point3F billboardAxis; + Point3F mBillboardAxis; /// @name Convex Hull Data /// Convex hulls are convex (no angles >= 180º) meshes used for collision /// @{ - Vector planeNormals; - Vector planeConstants; - Vector planeMaterials; - S32 planesPerFrame; - U32 mergeBufferStart; + Vector mPlaneNormals; + Vector mPlaneConstants; + Vector mPlaneMaterials; + S32 mPlanesPerFrame; + U32 mMergeBufferStart; /// @} /// @name Render Methods diff --git a/Engine/source/ts/tsMeshFit.cpp b/Engine/source/ts/tsMeshFit.cpp index 7ea2049c9..0beb2d9a2 100644 --- a/Engine/source/ts/tsMeshFit.cpp +++ b/Engine/source/ts/tsMeshFit.cpp @@ -246,24 +246,24 @@ void MeshFit::addSourceMesh( const TSShape::Object& obj, const TSMesh* mesh ) { // Add indices S32 indicesBase = mIndices.size(); - for ( S32 i = 0; i < mesh->primitives.size(); i++ ) + for ( S32 i = 0; i < mesh->mPrimitives.size(); i++ ) { - const TSDrawPrimitive& draw = mesh->primitives[i]; + const TSDrawPrimitive& draw = mesh->mPrimitives[i]; if ( (draw.matIndex & TSDrawPrimitive::TypeMask) == TSDrawPrimitive::Triangles ) { - mIndices.merge( &mesh->indices[draw.start], draw.numElements ); + mIndices.merge( &mesh->mIndices[draw.start], draw.numElements ); } else { - U32 idx0 = mesh->indices[draw.start + 0]; + U32 idx0 = mesh->mIndices[draw.start + 0]; U32 idx1; - U32 idx2 = mesh->indices[draw.start + 1]; + U32 idx2 = mesh->mIndices[draw.start + 1]; U32 *nextIdx = &idx1; for ( S32 j = 2; j < draw.numElements; j++ ) { *nextIdx = idx2; nextIdx = (U32*) ( (dsize_t)nextIdx ^ (dsize_t)&idx0 ^ (dsize_t)&idx1); - idx2 = mesh->indices[draw.start + j]; + idx2 = mesh->mIndices[draw.start + j]; if ( idx0 == idx1 || idx0 == idx2 || idx1 == idx2 ) continue; @@ -282,7 +282,7 @@ void MeshFit::addSourceMesh( const TSShape::Object& obj, const TSMesh* mesh ) S32 count, stride; U8* pVert; - if ( mesh->mVertexData.isReady() && mesh->verts.size() == 0 ) + if ( mesh->mVertexData.isReady() && mesh->mVerts.size() == 0 ) { count = mesh->mVertexData.size(); stride = mesh->mVertexData.vertSize(); @@ -290,9 +290,9 @@ void MeshFit::addSourceMesh( const TSShape::Object& obj, const TSMesh* mesh ) } else { - count = mesh->verts.size(); + count = mesh->mVerts.size(); stride = sizeof(Point3F); - pVert = (U8*)mesh->verts.address(); + pVert = (U8*)mesh->mVerts.address(); } MatrixF objMat; @@ -329,61 +329,61 @@ TSMesh* MeshFit::createTriMesh( F32* verts, S32 numVerts, U32* indices, S32 numT mesh->setFlags(0); mesh->mNumVerts = numVerts; - mesh->indices.reserve( numTris * 3 ); + mesh->mIndices.reserve( numTris * 3 ); for ( S32 i = 0; i < numTris; i++ ) { - mesh->indices.push_back( indices[i*3 + 0] ); - mesh->indices.push_back( indices[i*3 + 2] ); - mesh->indices.push_back( indices[i*3 + 1] ); + mesh->mIndices.push_back( indices[i*3 + 0] ); + mesh->mIndices.push_back( indices[i*3 + 2] ); + mesh->mIndices.push_back( indices[i*3 + 1] ); } - mesh->verts.set( verts, numVerts ); + mesh->mVerts.set( verts, numVerts ); // Compute mesh normals - mesh->norms.setSize( mesh->verts.size() ); - for (S32 iNorm = 0; iNorm < mesh->norms.size(); iNorm++) - mesh->norms[iNorm] = Point3F::Zero; + mesh->mNorms.setSize( mesh->mVerts.size() ); + for (S32 iNorm = 0; iNorm < mesh->mNorms.size(); iNorm++) + mesh->mNorms[iNorm] = Point3F::Zero; // Sum triangle normals for each vertex - for (S32 iInd = 0; iInd < mesh->indices.size(); iInd += 3) + for (S32 iInd = 0; iInd < mesh->mIndices.size(); iInd += 3) { // Compute the normal for this triangle - S32 idx0 = mesh->indices[iInd + 0]; - S32 idx1 = mesh->indices[iInd + 1]; - S32 idx2 = mesh->indices[iInd + 2]; + S32 idx0 = mesh->mIndices[iInd + 0]; + S32 idx1 = mesh->mIndices[iInd + 1]; + S32 idx2 = mesh->mIndices[iInd + 2]; - const Point3F& v0 = mesh->verts[idx0]; - const Point3F& v1 = mesh->verts[idx1]; - const Point3F& v2 = mesh->verts[idx2]; + const Point3F& v0 = mesh->mVerts[idx0]; + const Point3F& v1 = mesh->mVerts[idx1]; + const Point3F& v2 = mesh->mVerts[idx2]; Point3F n; mCross(v2 - v0, v1 - v0, &n); n.normalize(); // remove this to use 'weighted' normals (large triangles will have more effect) - mesh->norms[idx0] += n; - mesh->norms[idx1] += n; - mesh->norms[idx2] += n; + mesh->mNorms[idx0] += n; + mesh->mNorms[idx1] += n; + mesh->mNorms[idx2] += n; } // Normalize the vertex normals (this takes care of averaging the triangle normals) - for (S32 iNorm = 0; iNorm < mesh->norms.size(); iNorm++) - mesh->norms[iNorm].normalize(); + for (S32 iNorm = 0; iNorm < mesh->mNorms.size(); iNorm++) + mesh->mNorms[iNorm].normalize(); // Set some dummy UVs - mesh->tverts.setSize( numVerts ); - for ( S32 j = 0; j < mesh->tverts.size(); j++ ) - mesh->tverts[j].set( 0, 0 ); + mesh->mTverts.setSize( numVerts ); + for ( S32 j = 0; j < mesh->mTverts.size(); j++ ) + mesh->mTverts[j].set( 0, 0 ); // Add a single triangle-list primitive - mesh->primitives.increment(); - mesh->primitives.last().start = 0; - mesh->primitives.last().numElements = mesh->indices.size(); - mesh->primitives.last().matIndex = TSDrawPrimitive::Triangles | + mesh->mPrimitives.increment(); + mesh->mPrimitives.last().start = 0; + mesh->mPrimitives.last().numElements = mesh->mIndices.size(); + mesh->mPrimitives.last().matIndex = TSDrawPrimitive::Triangles | TSDrawPrimitive::Indexed | TSDrawPrimitive::NoMaterial; - mesh->createTangents( mesh->verts, mesh->norms ); - mesh->encodedNorms.set( NULL,0 ); + mesh->createTangents( mesh->mVerts, mesh->mNorms); + mesh->mEncodedNorms.set( NULL,0 ); return mesh; } @@ -404,13 +404,13 @@ void MeshFit::addBox( const Point3F& sides, const MatrixF& mat ) if ( !mesh ) return; - if (mesh->verts.size() > 0) + if (mesh->mVerts.size() > 0) { - for (S32 i = 0; i < mesh->verts.size(); i++) + for (S32 i = 0; i < mesh->mVerts.size(); i++) { - Point3F v = mesh->verts[i]; + Point3F v = mesh->mVerts[i]; v.convolve(sides); - mesh->verts[i] = v; + mesh->mVerts[i] = v; } mesh->mVertexData.setReady(false); @@ -799,7 +799,7 @@ DefineTSShapeConstructorMethod( addPrimitive, bool, ( const char* meshName, cons MatrixF mat( txfm.getMatrix() ); // Transform the mesh vertices - if ( mesh->mVertexData.isReady() && mesh->verts.size() == 0 ) + if ( mesh->mVertexData.isReady() && mesh->mVerts.size() == 0 ) { for (S32 i = 0; i < mesh->mVertexData.size(); i++) { @@ -811,10 +811,10 @@ DefineTSShapeConstructorMethod( addPrimitive, bool, ( const char* meshName, cons } else { - for (S32 i = 0; i < mesh->verts.size(); i++) + for (S32 i = 0; i < mesh->mVerts.size(); i++) { - Point3F v(mesh->verts[i]); - mat.mulP( v, &mesh->verts[i] ); + Point3F v(mesh->mVerts[i]); + mat.mulP( v, &mesh->mVerts[i] ); } } diff --git a/Engine/source/ts/tsShape.cpp b/Engine/source/ts/tsShape.cpp index 8b0146567..681388d6d 100644 --- a/Engine/source/ts/tsShape.cpp +++ b/Engine/source/ts/tsShape.cpp @@ -566,8 +566,8 @@ void TSShape::initObjects() if (accel != NULL) { delete[] accel->vertexList; delete[] accel->normalList; - for (S32 j = 0; j < accel->numVerts; j++) - delete[] accel->emitStrings[j]; + for (S32 vertID = 0; vertID < accel->numVerts; vertID++) + delete[] accel->emitStrings[vertID]; delete[] accel->emitStrings; delete accel; } @@ -585,18 +585,18 @@ void TSShape::initObjects() if (!mesh) continue; - if (mesh->parentMesh >= meshes.size()) + if (mesh->mParentMesh >= meshes.size()) { - Con::warnf("Mesh %i has a bad parentMeshObject (%i)", iter - meshes.begin(), mesh->parentMesh); + Con::warnf("Mesh %i has a bad parentMeshObject (%i)", iter - meshes.begin(), mesh->mParentMesh); } - if (mesh->parentMesh >= 0 && mesh->parentMesh < meshes.size()) + if (mesh->mParentMesh >= 0 && mesh->mParentMesh < meshes.size()) { - mesh->parentMeshObject = meshes[mesh->parentMesh]; + mesh->mParentMeshObject = meshes[mesh->mParentMesh]; } else { - mesh->parentMeshObject = NULL; + mesh->mParentMeshObject = NULL; } mesh->mVertexFormat = &mVertexFormat; @@ -622,8 +622,8 @@ void TSShape::initVertexBuffers() mesh->getMeshType() != TSMesh::SkinMeshType)) continue; - destIndices += mesh->indices.size(); - destPrims += mesh->primitives.size(); + destIndices += mesh->mIndices.size(); + destPrims += mesh->mPrimitives.size(); } // For HW skinning we can just use the static buffer @@ -660,15 +660,15 @@ void TSShape::initVertexBuffers() AssertFatal(mesh->mVertOffset / mVertexSize == vertStart, "offset mismatch"); vertStart += mesh->mNumVerts; - primStart += mesh->primitives.size(); - indStart += mesh->indices.size(); + primStart += mesh->mPrimitives.size(); + indStart += mesh->mIndices.size(); mesh->mVB = mShapeVertexBuffer; mesh->mPB = mShapeVertexIndices; // Advance - piInput += mesh->primitives.size(); - ibIndices += mesh->indices.size(); + piInput += mesh->mPrimitives.size(); + ibIndices += mesh->mIndices.size(); if (TSSkinMesh::smDebugSkinVerts && mesh->getMeshType() == TSMesh::SkinMeshType) { @@ -683,9 +683,9 @@ void TSShape::initVertexBuffers() U32 vertsInBuffer = mShapeVertexData.size / mVertexSize; U32 indsInBuffer = ibIndices - indicesStart; - for (U32 i = 0; i < primStart; i++) + for (U32 primID = 0; primID < primStart; primID++) { - GFXPrimitive &prim = mShapeVertexIndices->mPrimitiveArray[i]; + GFXPrimitive &prim = mShapeVertexIndices->mPrimitiveArray[primID]; if (prim.type != GFXTriangleList && prim.type != GFXTriangleStrip) { @@ -845,7 +845,7 @@ void TSShape::initVertexFeatures() mesh->mVertOffset = destVertex; destVertex += mesh->mVertSize * mesh->getNumVerts(); - destIndices += mesh->indices.size(); + destIndices += mesh->mIndices.size(); count += 1; } @@ -906,12 +906,12 @@ void TSShape::initVertexFeatures() mesh->mVertexData.setReady(true); #ifdef TORQUE_DEBUG - AssertFatal(mesh->mNumVerts == mesh->verts.size(), "vert mismatch"); + AssertFatal(mesh->mNumVerts == mesh->mVerts.size(), "vert mismatch"); for (U32 i = 0; i < mesh->mNumVerts; i++) { - Point3F v1 = mesh->verts[i]; + Point3F v1 = mesh->mVerts[i]; Point3F v2 = mesh->mVertexData.getBase(i).vert(); - AssertFatal(mesh->verts[i] == mesh->mVertexData.getBase(i).vert(), "vert data mismatch"); + AssertFatal(mesh->mVerts[i] == mesh->mVertexData.getBase(i).vert(), "vert data mismatch"); } if (mesh->getMeshType() == TSMesh::SkinMeshType) @@ -987,11 +987,11 @@ void TSShape::initMaterialList() if (!mesh) continue; - for (k=0; kprimitives.size(); k++) + for (k=0; kmPrimitives.size(); k++) { - if (mesh->primitives[k].matIndex & TSDrawPrimitive::NoMaterial) + if (mesh->mPrimitives[k].matIndex & TSDrawPrimitive::NoMaterial) continue; - S32 flags = materialList->getFlags(mesh->primitives[k].matIndex & TSDrawPrimitive::MaterialMask); + S32 flags = materialList->getFlags(mesh->mPrimitives[k].matIndex & TSDrawPrimitive::MaterialMask); if (flags & TSMaterialList::AuxiliaryMap) continue; if (flags & TSMaterialList::Translucent) @@ -1001,7 +1001,7 @@ void TSShape::initMaterialList() break; } } - if (k!=mesh->primitives.size()) + if (k!=mesh->mPrimitives.size()) break; } if (j!=obj.numMeshes) @@ -1195,10 +1195,10 @@ void TSShape::assembleShape() tsalloc.checkGuard(); // get bounds... - tsalloc.get32((S32*)&radius,1); + tsalloc.get32((S32*)&mRadius,1); tsalloc.get32((S32*)&tubeRadius,1); tsalloc.get32((S32*)¢er,3); - tsalloc.get32((S32*)&bounds,6); + tsalloc.get32((S32*)&mBounds,6); tsalloc.checkGuard(); @@ -1303,10 +1303,10 @@ void TSShape::assembleShape() S32 oldSz = groundTranslations.size(); groundTranslations.setSize(oldSz+seq.numGroundFrames); groundRotations.setSize(oldSz+seq.numGroundFrames); - for (S32 j=0;j 10000 ) || - ( details[i].maxError == 0 ) || ( details[i].maxError > 10000 ) ) + if ( ( details[erID].averageError == 0 ) || ( details[erID].averageError > 10000 ) || + ( details[erID].maxError == 0 ) || ( details[erID].maxError > 10000 ) ) { - details[i].averageError = details[i].maxError = -1.0f; + details[erID].averageError = details[erID].maxError = -1.0f; } } @@ -1521,15 +1521,15 @@ void TSShape::assembleShape() // fill in location of verts, tverts, and normals for detail levels if (mesh && meshType!=TSMesh::DecalMeshType) { - TSMesh::smVertsList[i] = mesh->verts.address(); - TSMesh::smTVertsList[i] = mesh->tverts.address(); + TSMesh::smVertsList[i] = mesh->mVerts.address(); + TSMesh::smTVertsList[i] = mesh->mTverts.address(); if (smReadVersion >= 26) { - TSMesh::smTVerts2List[i] = mesh->tverts2.address(); - TSMesh::smColorsList[i] = mesh->colors.address(); + TSMesh::smTVerts2List[i] = mesh->mTverts2.address(); + TSMesh::smColorsList[i] = mesh->mColors.address(); } - TSMesh::smNormsList[i] = mesh->norms.address(); - TSMesh::smEncodedNormsList[i] = mesh->encodedNorms.address(); + TSMesh::smNormsList[i] = mesh->mNorms.address(); + TSMesh::smEncodedNormsList[i] = mesh->mEncodedNorms.address(); TSMesh::smDataCopied[i] = !skip; // as long as we didn't skip this mesh, the data should be in shape now if (meshType==TSMesh::SkinMeshType) { @@ -1617,9 +1617,9 @@ void TSShape::assembleShape() if (skin) { TSMesh::smVertsList[i] = skin->batchData.initialVerts.address(); - TSMesh::smTVertsList[i] = skin->tverts.address(); + TSMesh::smTVertsList[i] = skin->mTverts.address(); TSMesh::smNormsList[i] = skin->batchData.initialNorms.address(); - TSMesh::smEncodedNormsList[i] = skin->encodedNorms.address(); + TSMesh::smEncodedNormsList[i] = skin->mEncodedNorms.address(); TSMesh::smDataCopied[i] = !skip; // as long as we didn't skip this mesh, the data should be in shape now TSSkinMesh::smInitTransformList[i] = skin->batchData.initialTransforms.address(); TSSkinMesh::smVertexIndexList[i] = skin->vertexIndex.address(); @@ -1670,10 +1670,10 @@ void TSShape::disassembleShape() tsalloc.setGuard(); // get bounds... - tsalloc.copyToBuffer32((S32*)&radius,1); + tsalloc.copyToBuffer32((S32*)&mRadius,1); tsalloc.copyToBuffer32((S32*)&tubeRadius,1); tsalloc.copyToBuffer32((S32*)¢er,3); - tsalloc.copyToBuffer32((S32*)&bounds,6); + tsalloc.copyToBuffer32((S32*)&mBounds,6); tsalloc.setGuard(); @@ -1740,8 +1740,8 @@ void TSShape::disassembleShape() { // Legacy details => no explicit autobillboard parameters U32 legacyDetailSize32 = 7; // only store the first 7 4-byte values of each detail - for ( S32 i = 0; i < details.size(); i++ ) - tsalloc.copyToBuffer32( (S32*)&details[i], legacyDetailSize32 ); + for ( S32 bbID = 0; bbID < details.size(); bbID++ ) + tsalloc.copyToBuffer32( (S32*)&details[bbID], legacyDetailSize32 ); } tsalloc.setGuard(); @@ -1805,15 +1805,15 @@ bool TSShape::canWriteOldFormat() const continue; // Cannot use old format if using the new functionality (COLORs, 2nd UV set) - if (meshes[i]->tverts2.size() || meshes[i]->colors.size()) + if (meshes[i]->mTverts2.size() || meshes[i]->mColors.size()) return false; // Cannot use old format if any primitive has too many triangles // (ie. cannot fit in a S16) - for (S32 j = 0; j < meshes[i]->primitives.size(); j++) + for (S32 j = 0; j < meshes[i]->mPrimitives.size(); j++) { - if ((meshes[i]->primitives[j].start + - meshes[i]->primitives[j].numElements) >= (1 << 15)) + if ((meshes[i]->mPrimitives[j].start + + meshes[i]->mPrimitives[j].numElements) >= (1 << 15)) { return false; } @@ -2060,11 +2060,11 @@ void TSShape::createEmptyShape() names[1] = StringTable->insert("Mesh2"); names[2] = StringTable->insert("Mesh"); - radius = 0.866025f; + mRadius = 0.866025f; tubeRadius = 0.707107f; center.set(0.0f, 0.5f, 0.0f); - bounds.minExtents.set(-0.5f, 0.0f, -0.5f); - bounds.maxExtents.set(0.5f, 1.0f, 0.5f); + mBounds.minExtents.set(-0.5f, 0.0f, -0.5f); + mBounds.maxExtents.set(0.5f, 1.0f, 0.5f); mExporterVersion = 124; mSmallestVisibleSize = 2; diff --git a/Engine/source/ts/tsShape.h b/Engine/source/ts/tsShape.h index e72dd8617..164e378a9 100644 --- a/Engine/source/ts/tsShape.h +++ b/Engine/source/ts/tsShape.h @@ -354,10 +354,10 @@ class TSShape /// @name Bounding /// @{ - F32 radius; + F32 mRadius; F32 tubeRadius; Point3F center; - Box3F bounds; + Box3F mBounds; /// @} diff --git a/Engine/source/ts/tsShapeConstruct.cpp b/Engine/source/ts/tsShapeConstruct.cpp index fc5465401..c77802895 100644 --- a/Engine/source/ts/tsShapeConstruct.cpp +++ b/Engine/source/ts/tsShapeConstruct.cpp @@ -1354,7 +1354,7 @@ DefineTSShapeConstructorMethod( getMeshMaterial, const char*, ( const char* name GET_MESH( getMeshMaterial, mesh, name, "" ); // Return the name of the first material attached to this mesh - S32 matIndex = mesh->primitives[0].matIndex & TSDrawPrimitive::MaterialMask; + S32 matIndex = mesh->mPrimitives[0].matIndex & TSDrawPrimitive::MaterialMask; if ((matIndex >= 0) && (matIndex < mShape->materialList->size())) return mShape->materialList->getMaterialName( matIndex ); else @@ -1391,10 +1391,10 @@ DefineTSShapeConstructorMethod( setMeshMaterial, bool, ( const char* meshName, c } // Set this material for all primitives in the mesh - for ( S32 i = 0; i < mesh->primitives.size(); i++ ) + for ( S32 i = 0; i < mesh->mPrimitives.size(); i++ ) { - U32 matType = mesh->primitives[i].matIndex & ( TSDrawPrimitive::TypeMask | TSDrawPrimitive::Indexed ); - mesh->primitives[i].matIndex = ( matType | matIndex ); + U32 matType = mesh->mPrimitives[i].matIndex & ( TSDrawPrimitive::TypeMask | TSDrawPrimitive::Indexed ); + mesh->mPrimitives[i].matIndex = ( matType | matIndex ); } ADD_TO_CHANGE_SET(); @@ -1459,7 +1459,7 @@ DefineTSShapeConstructorMethod( getBounds, Box3F, (),, "Get the bounding box for the shape.\n" "@return Bounding box \"minX minY minZ maxX maxY maxZ\"" ) { - return mShape->bounds; + return mShape->mBounds; }} DefineTSShapeConstructorMethod( setBounds, bool, ( Box3F bbox ),, @@ -1471,10 +1471,10 @@ DefineTSShapeConstructorMethod( setBounds, bool, ( Box3F bbox ),, // Set shape bounds TSShape* shape = mShape; - shape->bounds = bbox; - shape->bounds.getCenter( &shape->center ); - shape->radius = ( shape->bounds.maxExtents - shape->center ).len(); - shape->tubeRadius = shape->radius; + shape->mBounds = bbox; + shape->mBounds.getCenter( &shape->center ); + shape->mRadius = ( shape->mBounds.maxExtents - shape->center ).len(); + shape->tubeRadius = shape->mRadius; ADD_TO_CHANGE_SET(); return true; @@ -2214,12 +2214,12 @@ void TSShapeConstructor::ChangeSet::write(TSShape* shape, Stream& stream, const for (U32 j = 1; j < cmd.argc; j++) { // Use relative paths when possible - String str( cmd.argv[j] ); - if ( str.startsWith( savePath ) ) - str = str.substr( savePath.length() + 1 ); + String relStr( cmd.argv[j] ); + if (relStr.startsWith( savePath ) ) + relStr = relStr.substr( savePath.length() + 1 ); stream.writeText( ", \"" ); - stream.write( str.length(), str.c_str() ); + stream.write(relStr.length(), relStr.c_str() ); stream.writeText( "\"" ); } } diff --git a/Engine/source/ts/tsShapeEdit.cpp b/Engine/source/ts/tsShapeEdit.cpp index 94379de4d..f1b35a928 100644 --- a/Engine/source/ts/tsShapeEdit.cpp +++ b/Engine/source/ts/tsShapeEdit.cpp @@ -756,13 +756,13 @@ void TSShape::removeMeshFromObject(S32 objIndex, S32 meshIndex) if (meshes[k] == NULL) continue; - if (meshes[k]->parentMesh == idxToRemove) + if (meshes[k]->mParentMesh == idxToRemove) { - meshes[k]->parentMesh = -1; + meshes[k]->mParentMesh = -1; } - else if (meshes[k]->parentMesh > idxToRemove) + else if (meshes[k]->mParentMesh > idxToRemove) { - meshes[k]->parentMesh--; + meshes[k]->mParentMesh--; } } @@ -800,13 +800,13 @@ void TSShape::removeMeshFromObject(S32 objIndex, S32 meshIndex) if (meshes[k] == NULL) continue; - if (meshes[k]->parentMesh == idxToRemove) + if (meshes[k]->mParentMesh == idxToRemove) { - meshes[k]->parentMesh = -1; + meshes[k]->mParentMesh = -1; } - else if (meshes[k]->parentMesh > idxToRemove) + else if (meshes[k]->mParentMesh > idxToRemove) { - meshes[k]->parentMesh--; + meshes[k]->mParentMesh--; } } @@ -937,8 +937,8 @@ TSMesh* TSShape::copyMesh( const TSMesh* srcMesh ) const return mesh; // return an empty mesh // Copy mesh elements - mesh->indices = srcMesh->indices; - mesh->primitives = srcMesh->primitives; + mesh->mIndices = srcMesh->mIndices; + mesh->mPrimitives = srcMesh->mPrimitives; mesh->numFrames = srcMesh->numFrames; mesh->numMatFrames = srcMesh->numMatFrames; mesh->vertsPerFrame = srcMesh->vertsPerFrame; @@ -948,8 +948,8 @@ TSMesh* TSShape::copyMesh( const TSMesh* srcMesh ) const // Copy vertex data in an *unpacked* form mesh->copySourceVertexDataFrom(srcMesh); - mesh->createTangents(mesh->verts, mesh->norms); - mesh->encodedNorms.set(NULL, 0); + mesh->createTangents(mesh->mVerts, mesh->mNorms); + mesh->mEncodedNorms.set(NULL, 0); mesh->computeBounds(); @@ -1108,12 +1108,12 @@ bool TSShape::addMesh(TSShape* srcShape, const String& srcMeshName, const String // Copy materials used by the source mesh (only if from a different shape) if (srcShape != this) { - for (S32 i = 0; i < mesh->primitives.size(); i++) + for (S32 i = 0; i < mesh->mPrimitives.size(); i++) { - if (!(mesh->primitives[i].matIndex & TSDrawPrimitive::NoMaterial)) + if (!(mesh->mPrimitives[i].matIndex & TSDrawPrimitive::NoMaterial)) { - S32 drawType = (mesh->primitives[i].matIndex & (~TSDrawPrimitive::MaterialMask)); - S32 srcMatIndex = mesh->primitives[i].matIndex & TSDrawPrimitive::MaterialMask; + S32 drawType = (mesh->mPrimitives[i].matIndex & (~TSDrawPrimitive::MaterialMask)); + S32 srcMatIndex = mesh->mPrimitives[i].matIndex & TSDrawPrimitive::MaterialMask; const String& matName = srcShape->materialList->getMaterialName(srcMatIndex); // Add the material if it does not already exist @@ -1124,7 +1124,7 @@ bool TSShape::addMesh(TSShape* srcShape, const String& srcMeshName, const String materialList->push_back(matName, srcShape->materialList->getFlags(srcMatIndex)); } - mesh->primitives[i].matIndex = drawType | destMatIndex; + mesh->mPrimitives[i].matIndex = drawType | destMatIndex; } } } diff --git a/Engine/source/ts/tsShapeInstance.cpp b/Engine/source/ts/tsShapeInstance.cpp index 53167f1cf..7be0cd151 100644 --- a/Engine/source/ts/tsShapeInstance.cpp +++ b/Engine/source/ts/tsShapeInstance.cpp @@ -665,7 +665,7 @@ S32 TSShapeInstance::setDetailFromDistance( const SceneRenderState *state, F32 s // We're inlining SceneRenderState::projectRadius here to // skip the unnessasary divide by zero protection. - F32 pixelRadius = ( mShape->radius / scaledDistance ) * state->getWorldToScreenScale().y * pixelScale; + F32 pixelRadius = ( mShape->mRadius / scaledDistance ) * state->getWorldToScreenScale().y * pixelScale; F32 pixelSize = pixelRadius * smDetailAdjust; if ( pixelSize < smSmallestVisiblePixelSize ) { diff --git a/Engine/source/ts/tsShapeInstance.h b/Engine/source/ts/tsShapeInstance.h index 627eb63ce..d1131d0a3 100644 --- a/Engine/source/ts/tsShapeInstance.h +++ b/Engine/source/ts/tsShapeInstance.h @@ -727,7 +727,7 @@ class TSThread TSShapeInstance * mShapeInstance; ///< Instance of the shape that this thread animates S32 sequence; ///< Sequence this thread will perform - F32 pos; + F32 mSeqPos; F32 timeScale; ///< How fast to play through the sequence diff --git a/Engine/source/ts/tsShapeOldRead.cpp b/Engine/source/ts/tsShapeOldRead.cpp index d20175a2e..9b06aff75 100644 --- a/Engine/source/ts/tsShapeOldRead.cpp +++ b/Engine/source/ts/tsShapeOldRead.cpp @@ -647,27 +647,27 @@ bool TSShape::importSequences(Stream * s, const String& sequencePath) nodeUniformScales.increment(newScaleMembership.count() * seq.numKeyframes); // remap node transforms from temporary arrays - for (S32 j = 0; j < nodeMap.size(); j++) + for (S32 nodeID = 0; nodeID < nodeMap.size(); nodeID++) { - if (nodeMap[j] < 0) + if (nodeMap[nodeID] < 0) continue; - if (newTransMembership.test(nodeMap[j])) + if (newTransMembership.test(nodeMap[nodeID])) { - S32 src = seq.numKeyframes * seq.translationMatters.count(j); - S32 dest = seq.baseTranslation + seq.numKeyframes * newTransMembership.count(nodeMap[j]); + S32 src = seq.numKeyframes * seq.translationMatters.count(nodeID); + S32 dest = seq.baseTranslation + seq.numKeyframes * newTransMembership.count(nodeMap[nodeID]); dCopyArray(&nodeTranslations[dest], &seqTranslations[src], seq.numKeyframes); } - if (newRotMembership.test(nodeMap[j])) + if (newRotMembership.test(nodeMap[nodeID])) { - S32 src = seq.numKeyframes * seq.rotationMatters.count(j); - S32 dest = seq.baseRotation + seq.numKeyframes * newRotMembership.count(nodeMap[j]); + S32 src = seq.numKeyframes * seq.rotationMatters.count(nodeID); + S32 dest = seq.baseRotation + seq.numKeyframes * newRotMembership.count(nodeMap[nodeID]); dCopyArray(&nodeRotations[dest], &seqRotations[src], seq.numKeyframes); } - if (newScaleMembership.test(nodeMap[j])) + if (newScaleMembership.test(nodeMap[nodeID])) { - S32 src = seq.numKeyframes * seq.scaleMatters.count(j); - S32 dest = seq.baseScale + seq.numKeyframes * newScaleMembership.count(nodeMap[j]); + S32 src = seq.numKeyframes * seq.scaleMatters.count(nodeID); + S32 dest = seq.baseScale + seq.numKeyframes * newScaleMembership.count(nodeMap[nodeID]); if (seq.flags & TSShape::ArbitraryScale) { dCopyArray(&nodeArbitraryScaleRots[dest], &seqArbitraryScaleRots[src], seq.numKeyframes); @@ -713,10 +713,10 @@ bool TSShape::importSequences(Stream * s, const String& sequencePath) S32 oldSz = triggers.size(); s->read(&sz); triggers.setSize(oldSz+sz); - for (S32 i=0; iread(&triggers[i+oldSz].state); - s->read(&triggers[i+oldSz].pos); + s->read(&triggers[triggerID +oldSz].state); + s->read(&triggers[triggerID +oldSz].pos); } if (smInitOnRead) diff --git a/Engine/source/ts/tsSortedMesh.cpp b/Engine/source/ts/tsSortedMesh.cpp index e2c5b489c..8a88ff319 100644 --- a/Engine/source/ts/tsSortedMesh.cpp +++ b/Engine/source/ts/tsSortedMesh.cpp @@ -86,10 +86,10 @@ S32 TSSortedMesh::getNumPolys() Cluster & cluster = clusters[cIdx]; for (S32 i=cluster.startPrimitive; ipriority; - pos = toPos; + mSeqPos = toPos; makePath = getSequence()->makePath(); path.start = path.end = 0; path.loop = 0; // 1.0f doesn't exist on cyclic sequences - if (pos>0.9999f && getSequence()->isCyclic()) - pos = 0.9999f; + if (mSeqPos>0.9999f && getSequence()->isCyclic()) + mSeqPos = 0.9999f; // select keyframes - selectKeyframes(pos,getSequence(),&keyNum1,&keyNum2,&keyPos); + selectKeyframes(mSeqPos,getSequence(),&keyNum1,&keyNum2,&keyPos); } void TSThread::transitionToSequence(S32 seq, F32 toPos, F32 duration, bool continuePlay) @@ -207,7 +207,7 @@ void TSThread::transitionToSequence(S32 seq, F32 toPos, F32 duration, bool conti // set time characteristics of transition transitionData.oldSequence = sequence; - transitionData.oldPos = pos; + transitionData.oldPos = mSeqPos; transitionData.duration = duration; transitionData.pos = 0.0f; transitionData.direction = timeScale>0.0f ? 1.0f : -1.0f; @@ -219,17 +219,17 @@ void TSThread::transitionToSequence(S32 seq, F32 toPos, F32 duration, bool conti // set target sequence data sequence = seq; priority = getSequence()->priority; - pos = toPos; + mSeqPos = toPos; makePath = getSequence()->makePath(); path.start = path.end = 0; path.loop = 0; // 1.0f doesn't exist on cyclic sequences - if (pos>0.9999f && getSequence()->isCyclic()) - pos = 0.9999f; + if (mSeqPos>0.9999f && getSequence()->isCyclic()) + mSeqPos = 0.9999f; // select keyframes - selectKeyframes(pos,getSequence(),&keyNum1,&keyNum2,&keyPos); + selectKeyframes(mSeqPos,getSequence(),&keyNum1,&keyNum2,&keyPos); } bool TSThread::isInTransition() @@ -322,12 +322,12 @@ void TSThread::activateTriggers(F32 a, F32 b) F32 TSThread::getPos() { - return transitionData.inTransition ? transitionData.pos : pos; + return transitionData.inTransition ? transitionData.pos : mSeqPos; } F32 TSThread::getTime() { - return transitionData.inTransition ? transitionData.pos * transitionData.duration : pos * getSequence()->duration; + return transitionData.inTransition ? transitionData.pos * transitionData.duration : mSeqPos * getSequence()->duration; } F32 TSThread::getDuration() @@ -378,48 +378,48 @@ void TSThread::advancePos(F32 delta) if (makePath) { - path.start = pos; - pos += delta; + path.start = mSeqPos; + mSeqPos += delta; if (!getSequence()->isCyclic()) { - pos = mClampF(pos , 0.0f, 1.0f); + mSeqPos = mClampF(mSeqPos, 0.0f, 1.0f); path.loop = 0; } else { - path.loop = (S32)pos; - if (pos < 0.0f) + path.loop = (S32)mSeqPos; + if (mSeqPos < 0.0f) path.loop--; - pos -= path.loop; + mSeqPos -= path.loop; // following necessary because of floating point roundoff errors - if (pos < 0.0f) pos += 1.0f; - if (pos >= 1.0f) pos -= 1.0f; + if (mSeqPos < 0.0f) mSeqPos += 1.0f; + if (mSeqPos >= 1.0f) mSeqPos -= 1.0f; } - path.end = pos; + path.end = mSeqPos; animateTriggers(); // do this automatically...no need for user to call it - AssertFatal(pos>=0.0f && pos<=1.0f,"TSThread::advancePos (1)"); - AssertFatal(!getSequence()->isCyclic() || pos<1.0f,"TSThread::advancePos (2)"); + AssertFatal(mSeqPos >=0.0f && mSeqPos <=1.0f,"TSThread::advancePos (1)"); + AssertFatal(!getSequence()->isCyclic() || mSeqPos<1.0f,"TSThread::advancePos (2)"); } else { - pos += delta; + mSeqPos += delta; if (!getSequence()->isCyclic()) - pos = mClampF(pos, 0.0f, 1.0f); + mSeqPos = mClampF(mSeqPos, 0.0f, 1.0f); else { - pos -= S32(pos); + mSeqPos -= S32(mSeqPos); // following necessary because of floating point roundoff errors - if (pos < 0.0f) pos += 1.0f; - if (pos >= 1.0f) pos -= 1.0f; + if (mSeqPos < 0.0f) mSeqPos += 1.0f; + if (mSeqPos >= 1.0f) mSeqPos -= 1.0f; } - AssertFatal(pos>=0.0f && pos<=1.0f,"TSThread::advancePos (3)"); - AssertFatal(!getSequence()->isCyclic() || pos<1.0f,"TSThread::advancePos (4)"); + AssertFatal(mSeqPos >=0.0f && mSeqPos <=1.0f,"TSThread::advancePos (3)"); + AssertFatal(!getSequence()->isCyclic() || mSeqPos<1.0f,"TSThread::advancePos (4)"); } // select keyframes - selectKeyframes(pos,getSequence(),&keyNum1,&keyNum2,&keyPos); + selectKeyframes(mSeqPos,getSequence(),&keyNum1,&keyNum2,&keyPos); } void TSThread::advanceTime(F32 delta) @@ -459,7 +459,7 @@ void TSThread::setKeyframeNumber(S32 kf) keyNum1 = keyNum2 = kf; keyPos = 0; - pos = 0; + mSeqPos = 0; } TSThread::TSThread(TSShapeInstance * _shapeInst) diff --git a/Engine/source/util/scopeTracker.h b/Engine/source/util/scopeTracker.h index c58711ca0..ecbf0fac9 100644 --- a/Engine/source/util/scopeTracker.h +++ b/Engine/source/util/scopeTracker.h @@ -515,11 +515,11 @@ void ScopeTracker< NUM_DIMENSIONS, Object >::updateObject( Object object ) while( !mPotentialScopeInObjects.empty() ) { - Object object = mPotentialScopeInObjects.last(); + Object obj = mPotentialScopeInObjects.last(); mPotentialScopeInObjects.decrement(); - if( Deref( object ).isInScope() ) - _onScopeIn( object ); + if( Deref(obj).isInScope() ) + _onScopeIn(obj); } } else