浏览代码

Phase 1: Add a #define test

Marc Chapman 7 年之前
父节点
当前提交
0c65f9ee8e

+ 17 - 0
Engine/source/T3D/gameBase/gameBase.cpp

@@ -41,7 +41,9 @@
 #include "T3D/aiConnection.h"
 #endif
 
+#ifdef TORQUE_AFX_ENABLED
 #include "afx/arcaneFX.h"
+#endif
 //----------------------------------------------------------------------------
 // Ghost update relative priority values
 
@@ -256,8 +258,10 @@ GameBase::GameBase()
 
 GameBase::~GameBase()
 {
+#ifdef TORQUE_AFX_ENABLED
    if (scope_registered)
       arcaneFX::unregisterScopedObject(this);
+#endif
 }
 
 
@@ -270,6 +274,7 @@ bool GameBase::onAdd()
 
    // Datablock must be initialized on the server.
    // Client datablock are initialized by the initial update.
+#ifdef TORQUE_AFX_ENABLED
    if (isClientObject())
    {
       if (scope_id > 0 && !scope_registered)
@@ -280,6 +285,10 @@ bool GameBase::onAdd()
       if ( mDataBlock && !onNewDataBlock( mDataBlock, false ) )
          return false;
    }
+#else
+   if ( isServerObject() && mDataBlock && !onNewDataBlock( mDataBlock, false ) )
+      return false;
+#endif
 
    setProcessTick( true );
 
@@ -288,8 +297,10 @@ bool GameBase::onAdd()
 
 void GameBase::onRemove()
 {
+#ifdef TORQUE_AFX_ENABLED
    if (scope_registered)
       arcaneFX::unregisterScopedObject(this);
+#endif
    // EDITOR FEATURE: Remove us from the reload signal of our datablock.
    if ( mDataBlock )
       mDataBlock->mReloadSignal.remove( this, &GameBase::_onDatablockModified );
@@ -314,9 +325,11 @@ bool GameBase::onNewDataBlock( GameBaseData *dptr, bool reload )
 
    if ( !mDataBlock )
       return false;
+#ifdef TORQUE_AFX_ENABLED
    // Don't set mask when new datablock is a temp-clone.
    if (mDataBlock->isTempClone())
       return true;
+#endif
 
    setMaskBits(DataBlockMask);
    return true;
@@ -570,11 +583,13 @@ U32 GameBase::packUpdate( NetConnection *connection, U32 mask, BitStream *stream
    stream->writeFlag(mIsAiControlled);
 #endif
 
+#ifdef TORQUE_AFX_ENABLED
    if (stream->writeFlag(mask & ScopeIdMask))
    {
       if (stream->writeFlag(scope_refs > 0))
          stream->writeInt(scope_id, SCOPE_ID_BITS);
    }
+#endif
    return retMask;
 }
 
@@ -613,11 +628,13 @@ void GameBase::unpackUpdate(NetConnection *con, BitStream *stream)
    mTicksSinceLastMove = 0;
    mIsAiControlled = stream->readFlag();
 #endif
+#ifdef TORQUE_AFX_ENABLED
    if (stream->readFlag())
    {
       scope_id = (stream->readFlag()) ? (U16) stream->readInt(SCOPE_ID_BITS) : 0;
       scope_refs = 0;
    }
+#endif
 }
 
 void GameBase::onMount( SceneObject *obj, S32 node )

+ 4 - 0
Engine/source/T3D/gameBase/gameConnection.cpp

@@ -61,7 +61,9 @@
 #include "core/stream/fileStream.h"
 #endif 
 
+#ifdef TORQUE_AFX_ENABLED
 #include "afx/arcaneFX.h"
+#endif
 //----------------------------------------------------------------------------
 #define MAX_MOVE_PACKET_SENDS 4
 
@@ -2452,6 +2454,7 @@ DefineEngineMethod( GameConnection, getVisibleGhostDistance, F32, (),,
    return object->getVisibleGhostDistance();
 }
 
+#ifdef TORQUE_AFX_ENABLED 
 // The object selection code here is, in part, based, on functionality described
 // in the following resource:
 // Object Selection in Torque by Dave Myers 
@@ -2580,6 +2583,7 @@ void GameConnection::onDeleteNotify(SimObject* obj)
 
    Parent::onDeleteNotify(obj);
 }
+#endif
 
 #ifdef AFX_CAP_DATABLOCK_CACHE 
 

+ 5 - 1
Engine/source/app/game.cpp

@@ -54,8 +54,10 @@
 #include "gfx/gfxTextureManager.h"
 #include "sfx/sfxSystem.h"
 
-// Including this header provides access to certain system-level AFX methods.
+#ifdef TORQUE_AFX_ENABLED
 #include "afx/arcaneFX.h"
+#endif
+
 #ifdef TORQUE_PLAYER
 // See matching #ifdef in editor/editor.cpp
 bool gEditingMission = false;
@@ -242,9 +244,11 @@ ConsoleFunctionGroupEnd(Platform);
 
 bool clientProcess(U32 timeDelta)
 {
+#ifdef TORQUE_AFX_ENABLED
    // Required heartbeat call on the client side which must come
    // before the advanceTime() calls are made to the scene objects.
    arcaneFX::advanceTime(timeDelta);
+#endif
    bool ret = true;
 
 #ifndef TORQUE_TGB_ONLY

+ 1 - 1
Engine/source/console/consoleObject.h

@@ -515,9 +515,9 @@ public:
       TypeValidator *validator;     ///< Validator, if any.
       SetDataNotify  setDataFn;     ///< Set data notify Fn
       GetDataNotify  getDataFn;     ///< Get data notify Fn
+	  WriteDataNotify writeDataFn;  ///< Function to determine whether data should be written or not.
       bool           doNotSubstitute;
       bool           keepClearSubsOnly;
-      WriteDataNotify writeDataFn;  ///< Function to determine whether data should be written or not.
    };
    typedef Vector<Field> FieldList;
 

+ 7 - 1
Engine/source/sim/netObject.cpp

@@ -33,7 +33,9 @@
 #include "console/consoleTypes.h"
 #include "console/engineAPI.h"
 
+#ifdef TORQUE_AFX_ENABLED
 #include "afx/arcaneFX.h"
+#endif
 
 IMPLEMENT_CONOBJECT(NetObject);
 
@@ -53,9 +55,11 @@ NetObject::NetObject()
    mPrevDirtyList = NULL;
    mNextDirtyList = NULL;
    mDirtyMaskBits = 0;
+#ifdef TORQUE_AFX_ENABLED
    scope_id = 0;
    scope_refs = 0;
    scope_registered = false;
+#endif
 }
 
 NetObject::~NetObject()
@@ -470,6 +474,8 @@ DefineEngineMethod( NetObject, isServerObject, bool, (),,
 //{
 //   return object->isServerObject();
 //}
+
+#ifdef TORQUE_AFX_ENABLED
 U16 NetObject::addScopeRef() 
 { 
    if (scope_refs == 0)
@@ -492,4 +498,4 @@ void NetObject::removeScopeRef()
       onScopeIdChange();
    }
 }
-
+#endif

+ 2 - 0
Engine/source/terrain/terrRender.cpp

@@ -50,7 +50,9 @@
 
 #include "gfx/gfxDrawUtil.h"
 
+#ifdef TORQUE_AFX_ENABLED
 #include "afx/arcaneFX.h"
+#endif
 #include "afx/ce/afxZodiacMgr.h"
 #include "gfx/gfxTransformSaver.h"
 #include "gfx/bitmap/gBitmap.h"