From af62b5c0a9f81ca8b9f9acea4e0095935a52911e Mon Sep 17 00:00:00 2001 From: Marc Chapman Date: Tue, 23 Jan 2018 22:03:18 +0000 Subject: [PATCH] Phase 2: #ifdef for Zodiacs and particles --- Engine/source/T3D/fx/particleEmitter.h | 10 ++++++---- Engine/source/T3D/gameBase/gameConnection.cpp | 7 +++++++ Engine/source/T3D/gameBase/gameConnection.h | 5 +++-- Engine/source/T3D/groundPlane.cpp | 6 ++++-- Engine/source/T3D/tsStatic.cpp | 10 ++++++++-- Engine/source/environment/meshRoad.cpp | 5 ++++- Engine/source/terrain/terrRender.cpp | 8 ++++++-- 7 files changed, 38 insertions(+), 13 deletions(-) diff --git a/Engine/source/T3D/fx/particleEmitter.h b/Engine/source/T3D/fx/particleEmitter.h index 0750ab864..c3df9dad6 100644 --- a/Engine/source/T3D/fx/particleEmitter.h +++ b/Engine/source/T3D/fx/particleEmitter.h @@ -47,10 +47,12 @@ class RenderPassManager; class ParticleData; -#define AFX_CAP_PARTICLE_POOLS -#if defined(AFX_CAP_PARTICLE_POOLS) -class afxParticlePoolData; -class afxParticlePool; +#ifdef TORQUE_AFX_ENABLED + #define AFX_CAP_PARTICLE_POOLS + #if defined(AFX_CAP_PARTICLE_POOLS) + class afxParticlePoolData; + class afxParticlePool; + #endif #endif //***************************************************************************** diff --git a/Engine/source/T3D/gameBase/gameConnection.cpp b/Engine/source/T3D/gameBase/gameConnection.cpp index b1da7bf8f..03f9e6202 100644 --- a/Engine/source/T3D/gameBase/gameConnection.cpp +++ b/Engine/source/T3D/gameBase/gameConnection.cpp @@ -194,12 +194,14 @@ bool GameConnection::client_cache_on = false; //---------------------------------------------------------------------------- GameConnection::GameConnection() { +#ifdef TORQUE_AFX_ENABLED mRolloverObj = NULL; mPreSelectedObj = NULL; mSelectedObj = NULL; mChangedSelectedObj = false; mPreSelectTimestamp = 0; zoned_in = false; +#endif #ifdef AFX_CAP_DATABLOCK_CACHE client_db_stream = new InfiniteBitStream; @@ -1177,6 +1179,7 @@ void GameConnection::readPacket(BitStream *bstream) { mMoveList->clientReadMovePacket(bstream); +#ifdef TORQUE_AFX_ENABLED // selected object - do we have a change in status? if (bstream->readFlag()) { @@ -1188,6 +1191,8 @@ void GameConnection::readPacket(BitStream *bstream) else setSelectedObj(NULL); } +#endif + bool hadFlash = mDamageFlash > 0 || mWhiteOut > 0; mDamageFlash = 0; mWhiteOut = 0; @@ -1431,6 +1436,7 @@ void GameConnection::writePacket(BitStream *bstream, PacketNotify *note) // all the damage flash & white out S32 gIndex = -1; +#ifdef TORQUE_AFX_ENABLED if (mChangedSelectedObj) { S32 gidx; @@ -1459,6 +1465,7 @@ void GameConnection::writePacket(BitStream *bstream, PacketNotify *note) } else bstream->writeFlag(false); +#endif if (!mControlObject.isNull()) { diff --git a/Engine/source/T3D/gameBase/gameConnection.h b/Engine/source/T3D/gameBase/gameConnection.h index 427c8ce8d..cffd89d2d 100644 --- a/Engine/source/T3D/gameBase/gameConnection.h +++ b/Engine/source/T3D/gameBase/gameConnection.h @@ -385,7 +385,8 @@ protected: DECLARE_CALLBACK( void, setLagIcon, (bool state) ); DECLARE_CALLBACK( void, onDataBlocksDone, (U32 sequence) ); DECLARE_CALLBACK( void, onFlash, (bool state) ); - + +#ifdef TORQUE_AFX_ENABLED // GameConnection is modified to keep track of object selections which are used in // spell targeting. This code stores the current object selection as well as the // current rollover object beneath the cursor. The rollover object is treated as a @@ -415,7 +416,7 @@ private: public: bool isZonedIn() const { return zoned_in; } void setZonedIn() { zoned_in = true; } - +#endif #ifdef AFX_CAP_DATABLOCK_CACHE private: static StringTableEntry server_cache_filename; diff --git a/Engine/source/T3D/groundPlane.cpp b/Engine/source/T3D/groundPlane.cpp index 5e23a28ce..9e0065adb 100644 --- a/Engine/source/T3D/groundPlane.cpp +++ b/Engine/source/T3D/groundPlane.cpp @@ -44,8 +44,9 @@ #include "T3D/physics/physicsPlugin.h" #include "T3D/physics/physicsBody.h" #include "T3D/physics/physicsCollision.h" - +#ifdef TORQUE_AFX_ENABLED #include "afx/ce/afxZodiacMgr.h" +#endif /// Minimum square size allowed. This is a cheap way to limit the amount /// of geometry possibly generated by the GroundPlane (vertex buffers have a @@ -362,8 +363,9 @@ void GroundPlane::prepRenderImage( SceneRenderState* state ) createGeometry( state->getCullingFrustum() ); if( mVertexBuffer.isNull() ) return; - +#ifdef TORQUE_AFX_ENABLED afxZodiacMgr::renderGroundPlaneZodiacs(state, this); +#endif // Add a render instance. RenderPassManager* pass = state->getRenderPass(); diff --git a/Engine/source/T3D/tsStatic.cpp b/Engine/source/T3D/tsStatic.cpp index b2f33f44a..13964e632 100644 --- a/Engine/source/T3D/tsStatic.cpp +++ b/Engine/source/T3D/tsStatic.cpp @@ -58,8 +58,9 @@ using namespace Torque; extern bool gEditingMission; - +#ifdef TORQUE_AFX_ENABLED #include "afx/ce/afxZodiacMgr.h" +#endif IMPLEMENT_CO_NETOBJECT_V1(TSStatic); @@ -136,7 +137,9 @@ TSStatic::TSStatic() mHasGradients = false; mInvertGradientRange = false; mGradientRangeUser.set(0.0f, 180.0f); +#ifdef TORQUE_AFX_ENABLED afxZodiacData::convertGradientRangeFromDegrees(mGradientRange, mGradientRangeUser); +#endif } TSStatic::~TSStatic() @@ -721,9 +724,10 @@ void TSStatic::prepRenderImage( SceneRenderState* state ) } } mShapeInstance->render( rdata ); - +#ifdef TORQUE_AFX_ENABLED if (!mIgnoreZodiacs && mDecalDetailsPtr != 0) afxZodiacMgr::renderPolysoupZodiacs(state, this); +#endif if ( mRenderNormalScalar > 0 ) { ObjectRenderInst *ri = state->getRenderPass()->allocInst(); @@ -1399,11 +1403,13 @@ void TSStatic::set_special_typing() void TSStatic::onStaticModified(const char* slotName, const char*newValue) { +#ifdef TORQUE_AFX_ENABLED if (slotName == afxZodiacData::GradientRangeSlot) { afxZodiacData::convertGradientRangeFromDegrees(mGradientRange, mGradientRangeUser); return; } +#endif set_special_typing(); } diff --git a/Engine/source/environment/meshRoad.cpp b/Engine/source/environment/meshRoad.cpp index fc1619afb..0d523f9a7 100644 --- a/Engine/source/environment/meshRoad.cpp +++ b/Engine/source/environment/meshRoad.cpp @@ -56,8 +56,9 @@ #include "T3D/physics/physicsBody.h" #include "T3D/physics/physicsCollision.h" #include "environment/nodeListManager.h" - +#ifdef TORQUE_AFX_ENABLED #include "afx/ce/afxZodiacMgr.h" +#endif #define MIN_METERS_PER_SEGMENT 1.0f #define MIN_NODE_DEPTH 0.25f @@ -829,7 +830,9 @@ void MeshRoad::prepRenderImage( SceneRenderState* state ) // otherwise obey the smShowRoad flag if ( smShowRoad || !smEditorOpen ) { +#ifdef TORQUE_AFX_ENABLED afxZodiacMgr::renderMeshRoadZodiacs(state, this); +#endif MeshRenderInst coreRI; coreRI.clear(); coreRI.objectToWorld = &MatrixF::Identity; diff --git a/Engine/source/terrain/terrRender.cpp b/Engine/source/terrain/terrRender.cpp index bb0ba8f5d..a6bc3dfae 100644 --- a/Engine/source/terrain/terrRender.cpp +++ b/Engine/source/terrain/terrRender.cpp @@ -52,8 +52,9 @@ #ifdef TORQUE_AFX_ENABLED #include "afx/arcaneFX.h" -#endif #include "afx/ce/afxZodiacMgr.h" +#endif + #include "gfx/gfxTransformSaver.h" #include "gfx/bitmap/gBitmap.h" #include "gfx/bitmap/ddsFile.h" @@ -430,7 +431,9 @@ void TerrainBlock::_renderBlock( SceneRenderState *state ) if ( isColorDrawPass ) lm = LIGHTMGR; +#ifdef TORQUE_AFX_ENABLED bool has_zodiacs = afxZodiacMgr::doesBlockContainZodiacs(state, this); +#endif for ( U32 i=0; i < renderCells.size(); i++ ) { TerrCell *cell = renderCells[i]; @@ -492,10 +495,11 @@ void TerrainBlock::_renderBlock( SceneRenderState *state ) } inst->defaultKey = (U32)cell->getMaterials(); - +#ifdef TORQUE_AFX_ENABLED if (has_zodiacs) afxZodiacMgr::renderTerrainZodiacs(state, this, cell); // Submit it for rendering. +#endif renderPass->addInst( inst ); }