Phase 2: #ifdef for Zodiacs and particles

This commit is contained in:
Marc Chapman 2018-01-23 22:03:18 +00:00
parent 0c65f9ee8e
commit b8f722e2f9
7 changed files with 38 additions and 13 deletions

View file

@ -47,10 +47,12 @@
class RenderPassManager; class RenderPassManager;
class ParticleData; class ParticleData;
#define AFX_CAP_PARTICLE_POOLS #ifdef TORQUE_AFX_ENABLED
#if defined(AFX_CAP_PARTICLE_POOLS) #define AFX_CAP_PARTICLE_POOLS
class afxParticlePoolData; #if defined(AFX_CAP_PARTICLE_POOLS)
class afxParticlePool; class afxParticlePoolData;
class afxParticlePool;
#endif
#endif #endif
//***************************************************************************** //*****************************************************************************

View file

@ -194,12 +194,14 @@ bool GameConnection::client_cache_on = false;
//---------------------------------------------------------------------------- //----------------------------------------------------------------------------
GameConnection::GameConnection() GameConnection::GameConnection()
{ {
#ifdef TORQUE_AFX_ENABLED
mRolloverObj = NULL; mRolloverObj = NULL;
mPreSelectedObj = NULL; mPreSelectedObj = NULL;
mSelectedObj = NULL; mSelectedObj = NULL;
mChangedSelectedObj = false; mChangedSelectedObj = false;
mPreSelectTimestamp = 0; mPreSelectTimestamp = 0;
zoned_in = false; zoned_in = false;
#endif
#ifdef AFX_CAP_DATABLOCK_CACHE #ifdef AFX_CAP_DATABLOCK_CACHE
client_db_stream = new InfiniteBitStream; client_db_stream = new InfiniteBitStream;
@ -1177,6 +1179,7 @@ void GameConnection::readPacket(BitStream *bstream)
{ {
mMoveList->clientReadMovePacket(bstream); mMoveList->clientReadMovePacket(bstream);
#ifdef TORQUE_AFX_ENABLED
// selected object - do we have a change in status? // selected object - do we have a change in status?
if (bstream->readFlag()) if (bstream->readFlag())
{ {
@ -1188,6 +1191,8 @@ void GameConnection::readPacket(BitStream *bstream)
else else
setSelectedObj(NULL); setSelectedObj(NULL);
} }
#endif
bool hadFlash = mDamageFlash > 0 || mWhiteOut > 0; bool hadFlash = mDamageFlash > 0 || mWhiteOut > 0;
mDamageFlash = 0; mDamageFlash = 0;
mWhiteOut = 0; mWhiteOut = 0;
@ -1431,6 +1436,7 @@ void GameConnection::writePacket(BitStream *bstream, PacketNotify *note)
// all the damage flash & white out // all the damage flash & white out
S32 gIndex = -1; S32 gIndex = -1;
#ifdef TORQUE_AFX_ENABLED
if (mChangedSelectedObj) if (mChangedSelectedObj)
{ {
S32 gidx; S32 gidx;
@ -1459,6 +1465,7 @@ void GameConnection::writePacket(BitStream *bstream, PacketNotify *note)
} }
else else
bstream->writeFlag(false); bstream->writeFlag(false);
#endif
if (!mControlObject.isNull()) if (!mControlObject.isNull())
{ {

View file

@ -385,7 +385,8 @@ protected:
DECLARE_CALLBACK( void, setLagIcon, (bool state) ); DECLARE_CALLBACK( void, setLagIcon, (bool state) );
DECLARE_CALLBACK( void, onDataBlocksDone, (U32 sequence) ); DECLARE_CALLBACK( void, onDataBlocksDone, (U32 sequence) );
DECLARE_CALLBACK( void, onFlash, (bool state) ); DECLARE_CALLBACK( void, onFlash, (bool state) );
#ifdef TORQUE_AFX_ENABLED
// GameConnection is modified to keep track of object selections which are used in // 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 // 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 // current rollover object beneath the cursor. The rollover object is treated as a
@ -415,7 +416,7 @@ private:
public: public:
bool isZonedIn() const { return zoned_in; } bool isZonedIn() const { return zoned_in; }
void setZonedIn() { zoned_in = true; } void setZonedIn() { zoned_in = true; }
#endif
#ifdef AFX_CAP_DATABLOCK_CACHE #ifdef AFX_CAP_DATABLOCK_CACHE
private: private:
static StringTableEntry server_cache_filename; static StringTableEntry server_cache_filename;

View file

@ -44,8 +44,9 @@
#include "T3D/physics/physicsPlugin.h" #include "T3D/physics/physicsPlugin.h"
#include "T3D/physics/physicsBody.h" #include "T3D/physics/physicsBody.h"
#include "T3D/physics/physicsCollision.h" #include "T3D/physics/physicsCollision.h"
#ifdef TORQUE_AFX_ENABLED
#include "afx/ce/afxZodiacMgr.h" #include "afx/ce/afxZodiacMgr.h"
#endif
/// Minimum square size allowed. This is a cheap way to limit the amount /// Minimum square size allowed. This is a cheap way to limit the amount
/// of geometry possibly generated by the GroundPlane (vertex buffers have a /// of geometry possibly generated by the GroundPlane (vertex buffers have a
@ -362,8 +363,9 @@ void GroundPlane::prepRenderImage( SceneRenderState* state )
createGeometry( state->getCullingFrustum() ); createGeometry( state->getCullingFrustum() );
if( mVertexBuffer.isNull() ) if( mVertexBuffer.isNull() )
return; return;
#ifdef TORQUE_AFX_ENABLED
afxZodiacMgr::renderGroundPlaneZodiacs(state, this); afxZodiacMgr::renderGroundPlaneZodiacs(state, this);
#endif
// Add a render instance. // Add a render instance.
RenderPassManager* pass = state->getRenderPass(); RenderPassManager* pass = state->getRenderPass();

View file

@ -58,8 +58,9 @@
using namespace Torque; using namespace Torque;
extern bool gEditingMission; extern bool gEditingMission;
#ifdef TORQUE_AFX_ENABLED
#include "afx/ce/afxZodiacMgr.h" #include "afx/ce/afxZodiacMgr.h"
#endif
IMPLEMENT_CO_NETOBJECT_V1(TSStatic); IMPLEMENT_CO_NETOBJECT_V1(TSStatic);
@ -136,7 +137,9 @@ TSStatic::TSStatic()
mHasGradients = false; mHasGradients = false;
mInvertGradientRange = false; mInvertGradientRange = false;
mGradientRangeUser.set(0.0f, 180.0f); mGradientRangeUser.set(0.0f, 180.0f);
#ifdef TORQUE_AFX_ENABLED
afxZodiacData::convertGradientRangeFromDegrees(mGradientRange, mGradientRangeUser); afxZodiacData::convertGradientRangeFromDegrees(mGradientRange, mGradientRangeUser);
#endif
} }
TSStatic::~TSStatic() TSStatic::~TSStatic()
@ -721,9 +724,10 @@ void TSStatic::prepRenderImage( SceneRenderState* state )
} }
} }
mShapeInstance->render( rdata ); mShapeInstance->render( rdata );
#ifdef TORQUE_AFX_ENABLED
if (!mIgnoreZodiacs && mDecalDetailsPtr != 0) if (!mIgnoreZodiacs && mDecalDetailsPtr != 0)
afxZodiacMgr::renderPolysoupZodiacs(state, this); afxZodiacMgr::renderPolysoupZodiacs(state, this);
#endif
if ( mRenderNormalScalar > 0 ) if ( mRenderNormalScalar > 0 )
{ {
ObjectRenderInst *ri = state->getRenderPass()->allocInst<ObjectRenderInst>(); ObjectRenderInst *ri = state->getRenderPass()->allocInst<ObjectRenderInst>();
@ -1399,11 +1403,13 @@ void TSStatic::set_special_typing()
void TSStatic::onStaticModified(const char* slotName, const char*newValue) void TSStatic::onStaticModified(const char* slotName, const char*newValue)
{ {
#ifdef TORQUE_AFX_ENABLED
if (slotName == afxZodiacData::GradientRangeSlot) if (slotName == afxZodiacData::GradientRangeSlot)
{ {
afxZodiacData::convertGradientRangeFromDegrees(mGradientRange, mGradientRangeUser); afxZodiacData::convertGradientRangeFromDegrees(mGradientRange, mGradientRangeUser);
return; return;
} }
#endif
set_special_typing(); set_special_typing();
} }

View file

@ -56,8 +56,9 @@
#include "T3D/physics/physicsBody.h" #include "T3D/physics/physicsBody.h"
#include "T3D/physics/physicsCollision.h" #include "T3D/physics/physicsCollision.h"
#include "environment/nodeListManager.h" #include "environment/nodeListManager.h"
#ifdef TORQUE_AFX_ENABLED
#include "afx/ce/afxZodiacMgr.h" #include "afx/ce/afxZodiacMgr.h"
#endif
#define MIN_METERS_PER_SEGMENT 1.0f #define MIN_METERS_PER_SEGMENT 1.0f
#define MIN_NODE_DEPTH 0.25f #define MIN_NODE_DEPTH 0.25f
@ -829,7 +830,9 @@ void MeshRoad::prepRenderImage( SceneRenderState* state )
// otherwise obey the smShowRoad flag // otherwise obey the smShowRoad flag
if ( smShowRoad || !smEditorOpen ) if ( smShowRoad || !smEditorOpen )
{ {
#ifdef TORQUE_AFX_ENABLED
afxZodiacMgr::renderMeshRoadZodiacs(state, this); afxZodiacMgr::renderMeshRoadZodiacs(state, this);
#endif
MeshRenderInst coreRI; MeshRenderInst coreRI;
coreRI.clear(); coreRI.clear();
coreRI.objectToWorld = &MatrixF::Identity; coreRI.objectToWorld = &MatrixF::Identity;

View file

@ -52,8 +52,9 @@
#ifdef TORQUE_AFX_ENABLED #ifdef TORQUE_AFX_ENABLED
#include "afx/arcaneFX.h" #include "afx/arcaneFX.h"
#endif
#include "afx/ce/afxZodiacMgr.h" #include "afx/ce/afxZodiacMgr.h"
#endif
#include "gfx/gfxTransformSaver.h" #include "gfx/gfxTransformSaver.h"
#include "gfx/bitmap/gBitmap.h" #include "gfx/bitmap/gBitmap.h"
#include "gfx/bitmap/ddsFile.h" #include "gfx/bitmap/ddsFile.h"
@ -430,7 +431,9 @@ void TerrainBlock::_renderBlock( SceneRenderState *state )
if ( isColorDrawPass ) if ( isColorDrawPass )
lm = LIGHTMGR; lm = LIGHTMGR;
#ifdef TORQUE_AFX_ENABLED
bool has_zodiacs = afxZodiacMgr::doesBlockContainZodiacs(state, this); bool has_zodiacs = afxZodiacMgr::doesBlockContainZodiacs(state, this);
#endif
for ( U32 i=0; i < renderCells.size(); i++ ) for ( U32 i=0; i < renderCells.size(); i++ )
{ {
TerrCell *cell = renderCells[i]; TerrCell *cell = renderCells[i];
@ -492,10 +495,11 @@ void TerrainBlock::_renderBlock( SceneRenderState *state )
} }
inst->defaultKey = (U32)cell->getMaterials(); inst->defaultKey = (U32)cell->getMaterials();
#ifdef TORQUE_AFX_ENABLED
if (has_zodiacs) if (has_zodiacs)
afxZodiacMgr::renderTerrainZodiacs(state, this, cell); afxZodiacMgr::renderTerrainZodiacs(state, this, cell);
// Submit it for rendering. // Submit it for rendering.
#endif
renderPass->addInst( inst ); renderPass->addInst( inst );
} }