Explorar el Código

Merge branch 'linux' of https://github.com/just-bank/Torque3D into just-bank-linux

David Wyand hace 13 años
padre
commit
2d9fa140ed
Se han modificado 36 ficheros con 597 adiciones y 58 borrados
  1. 3 0
      Engine/lib/convexDecomp/NvRemoveTjunctions.cpp
  2. 5 1
      Engine/source/T3D/physics/bullet/btWorld.cpp
  3. 1 1
      Engine/source/console/dynamicTypes.h
  4. 1 1
      Engine/source/console/engineTypes.h
  5. 11 3
      Engine/source/gui/controls/guiTreeViewCtrl.cpp
  6. 3 3
      Engine/source/lighting/advanced/advancedLightingFeatures.cpp
  7. 3 3
      Engine/source/lighting/basic/basicLightManager.cpp
  8. 10 1
      Engine/source/lighting/common/lightMapParams.cpp
  9. 1 1
      Engine/source/lighting/common/lightMapParams.h
  10. 3 3
      Engine/source/lighting/lightManager.cpp
  11. 10 2
      Engine/source/lighting/shadowMap/lightShadowMap.cpp
  12. 1 1
      Engine/source/lighting/shadowMap/lightShadowMap.h
  13. 2 2
      Engine/source/math/mSilhouetteExtractor.h
  14. 5 5
      Engine/source/platform/platform.h
  15. 3 3
      Engine/source/platform/platformCPUCount.cpp
  16. 16 4
      Engine/source/platformX86UNIX/threads/semaphore.cpp
  17. 2 0
      Engine/source/platformX86UNIX/x86UNIXStub.dedicated.cpp
  18. 1 1
      Engine/source/renderInstance/renderPassManager.cpp
  19. 3 0
      Engine/source/ts/tsShapeConstruct.h
  20. 67 0
      Templates/Empty/DeleteCachedDTSs.command
  21. 65 0
      Templates/Empty/buildFiles/config/project.linux_ded.conf
  22. 96 0
      Templates/Empty/buildFiles/config/torque3D_dedicated.conf
  23. 7 1
      Templates/Empty/cleanShaders.command
  24. 67 0
      Templates/Full/DeleteCachedDTSs.command
  25. 65 0
      Templates/Full/buildFiles/config/project.linux_ded.conf
  26. 96 0
      Templates/Full/buildFiles/config/torque3D_dedicated.conf
  27. 3 3
      Templates/Full/cleanShaders.command
  28. 4 1
      Tools/projectGenerator/modules/T3D.inc
  29. 2 0
      Tools/projectGenerator/modules/advancedLighting.inc
  30. 1 1
      Tools/projectGenerator/modules/bullet.inc
  31. 16 5
      Tools/projectGenerator/modules/core.inc
  32. 9 5
      Tools/projectGenerator/templates/makeApp.tpl
  33. 3 2
      Tools/projectGenerator/templates/makeAppShared.tpl
  34. 4 3
      Tools/projectGenerator/templates/makeLib.tpl
  35. 3 2
      Tools/projectGenerator/templates/makeSo.tpl
  36. 5 0
      Tools/projectGenerator/templates/makeSolution.tpl

+ 3 - 0
Engine/lib/convexDecomp/NvRemoveTjunctions.cpp

@@ -67,6 +67,9 @@ NvRemoveTjunctions.cpp : A code snippet to remove tjunctions from a triangle mes
 #include "NvHashMap.h"
 #include "NvHashMap.h"
 #include "NvRemoveTjunctions.h"
 #include "NvRemoveTjunctions.h"
 #include "NvFloatMath.h"
 #include "NvFloatMath.h"
+#ifdef LINUX
+   #include <climits>
+#endif
 
 
 #pragma warning(disable:4189)
 #pragma warning(disable:4189)
 
 

+ 5 - 1
Engine/source/T3D/physics/bullet/btWorld.cpp

@@ -33,7 +33,11 @@
 #include "console/consoleTypes.h"
 #include "console/consoleTypes.h"
 #include "scene/sceneRenderState.h"
 #include "scene/sceneRenderState.h"
 #include "T3D/gameBase/gameProcess.h"
 #include "T3D/gameBase/gameProcess.h"
-
+#ifdef _WIN32
+#include "BulletMultiThreaded/Win32ThreadSupport.h"
+#elif defined (USE_PTHREADS)
+#include "BulletMultiThreaded/PosixThreadSupport.h"
+#endif
 
 
 BtWorld::BtWorld() :
 BtWorld::BtWorld() :
    mProcessList( NULL ),
    mProcessList( NULL ),

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

@@ -252,7 +252,7 @@ const EngineTypeInfo* _MAPTYPE() { return TYPE< T >(); }
    extern S32 type; \
    extern S32 type; \
    extern const char* castConsoleTypeToString( _ConsoleConstType< nativeType >::ConstType &arg ); \
    extern const char* castConsoleTypeToString( _ConsoleConstType< nativeType >::ConstType &arg ); \
    extern bool castConsoleTypeFromString( nativeType &arg, const char *str ); \
    extern bool castConsoleTypeFromString( nativeType &arg, const char *str ); \
-   template<> extern S32 TYPEID< nativeType >();
+   template<> S32 TYPEID< nativeType >();
    
    
 #define DefineUnmappedConsoleType( type, nativeType ) \
 #define DefineUnmappedConsoleType( type, nativeType ) \
    DefineConsoleType( type, nativeType ) \
    DefineConsoleType( type, nativeType ) \

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

@@ -416,7 +416,7 @@ namespace _Private {
 
 
 
 
 #define _DECLARE_TYPE( type )                                                                \
 #define _DECLARE_TYPE( type )                                                                \
-   template<> extern const EngineTypeInfo* TYPE< type >();                                   \
+   template<> const EngineTypeInfo* TYPE< type >();                                          \
    template<> struct _SCOPE< type > {                                                        \
    template<> struct _SCOPE< type > {                                                        \
       EngineExportScope& operator()() const {                                                \
       EngineExportScope& operator()() const {                                                \
          return *reinterpret_cast< EngineExportScope* >(                                     \
          return *reinterpret_cast< EngineExportScope* >(                                     \

+ 11 - 3
Engine/source/gui/controls/guiTreeViewCtrl.cpp

@@ -33,7 +33,9 @@
 #include "platform/event.h"
 #include "platform/event.h"
 #include "gfx/gfxDrawUtil.h"
 #include "gfx/gfxDrawUtil.h"
 #include "gui/controls/guiTextEditCtrl.h"
 #include "gui/controls/guiTextEditCtrl.h"
-#include "gui/editor/editorFunctions.h"
+#ifdef TORQUE_TOOLS
+   #include "gui/editor/editorFunctions.h"
+#endif
 #include "console/engineAPI.h"
 #include "console/engineAPI.h"
 
 
 
 
@@ -4042,7 +4044,10 @@ void GuiTreeViewCtrl::onRenderCell(Point2I offset, Point2I cell, bool, bool )
       // If this item is a VirtualParent we can use the generic SimGroup123 icons.
       // If this item is a VirtualParent we can use the generic SimGroup123 icons.
       // However if there is already an icon in the EditorIconRegistry for this
       // However if there is already an icon in the EditorIconRegistry for this
       // exact class (not counting parent class icons) we want to use that instead.
       // exact class (not counting parent class icons) we want to use that instead.
-      bool hasClassIcon = gEditorIcons.hasIconNoRecurse( pObject );
+      bool hasClassIcon = false;
+#ifdef TORQUE_TOOLS
+      hasClassIcon = gEditorIcons.hasIconNoRecurse( pObject );
+#endif
 
 
       // draw the icon associated with the item
       // draw the icon associated with the item
       if ( !hasClassIcon && item->mState.test(Item::VirtualParent))
       if ( !hasClassIcon && item->mState.test(Item::VirtualParent))
@@ -5280,7 +5285,10 @@ void GuiTreeViewCtrl::onRenameValidate()
 
 
    if ( mRenameInternal )
    if ( mRenameInternal )
       obj->setInternalName( data );   
       obj->setInternalName( data );   
-   else if ( validateObjectName( data, obj ) )
+   else
+#ifdef TORQUE_TOOLS
+   if ( validateObjectName( data, obj ) )
+#endif
       obj->assignName( data ); 
       obj->assignName( data ); 
 }
 }
 
 

+ 3 - 3
Engine/source/lighting/advanced/advancedLightingFeatures.cpp

@@ -31,7 +31,7 @@
 #include "gfx/gfxDevice.h"
 #include "gfx/gfxDevice.h"
 #include "core/util/safeDelete.h"
 #include "core/util/safeDelete.h"
 
 
-#ifndef TORQUE_OS_MAC
+#if !defined( TORQUE_OS_MAC ) && !defined( TORQUE_OS_LINUX )
 #  include "lighting/advanced/hlsl/gBufferConditionerHLSL.h"
 #  include "lighting/advanced/hlsl/gBufferConditionerHLSL.h"
 #  include "lighting/advanced/hlsl/advancedLightingFeaturesHLSL.h"
 #  include "lighting/advanced/hlsl/advancedLightingFeaturesHLSL.h"
 #else
 #else
@@ -54,7 +54,7 @@ void AdvancedLightingFeatures::registerFeatures( const GFXFormat &prepassTargetF
 
 
    if(GFX->getAdapterType() == OpenGL)
    if(GFX->getAdapterType() == OpenGL)
    {
    {
-#ifdef TORQUE_OS_MAC
+#if defined( TORQUE_OS_MAC ) || defined( TORQUE_OS_LINUX )
       cond = new GBufferConditionerGLSL( prepassTargetFormat );
       cond = new GBufferConditionerGLSL( prepassTargetFormat );
       FEATUREMGR->registerFeature(MFT_PrePassConditioner, cond);
       FEATUREMGR->registerFeature(MFT_PrePassConditioner, cond);
       FEATUREMGR->registerFeature(MFT_RTLighting, new DeferredRTLightingFeatGLSL());
       FEATUREMGR->registerFeature(MFT_RTLighting, new DeferredRTLightingFeatGLSL());
@@ -66,7 +66,7 @@ void AdvancedLightingFeatures::registerFeatures( const GFXFormat &prepassTargetF
    }
    }
    else
    else
    {
    {
-#ifndef TORQUE_OS_MAC
+#if !defined( TORQUE_OS_MAC ) && !defined( TORQUE_OS_LINUX )
       cond = new GBufferConditionerHLSL( prepassTargetFormat, GBufferConditionerHLSL::ViewSpace );
       cond = new GBufferConditionerHLSL( prepassTargetFormat, GBufferConditionerHLSL::ViewSpace );
       FEATUREMGR->registerFeature(MFT_PrePassConditioner, cond);
       FEATUREMGR->registerFeature(MFT_PrePassConditioner, cond);
       FEATUREMGR->registerFeature(MFT_RTLighting, new DeferredRTLightingFeatHLSL());
       FEATUREMGR->registerFeature(MFT_RTLighting, new DeferredRTLightingFeatHLSL());

+ 3 - 3
Engine/source/lighting/basic/basicLightManager.cpp

@@ -49,7 +49,7 @@
 #include "lighting/common/projectedShadow.h"
 #include "lighting/common/projectedShadow.h"
 
 
 
 
-#ifdef TORQUE_OS_MAC
+#if defined( TORQUE_OS_MAC ) || defined( TORQUE_OS_LINUX )
 #include "shaderGen/GLSL/shaderFeatureGLSL.h"
 #include "shaderGen/GLSL/shaderFeatureGLSL.h"
 #include "shaderGen/GLSL/bumpGLSL.h"
 #include "shaderGen/GLSL/bumpGLSL.h"
 #include "shaderGen/GLSL/pixSpecularGLSL.h"
 #include "shaderGen/GLSL/pixSpecularGLSL.h"
@@ -167,7 +167,7 @@ void BasicLightManager::activate( SceneManager *sceneManager )
 
 
    if( GFX->getAdapterType() == OpenGL )
    if( GFX->getAdapterType() == OpenGL )
    {
    {
-      #ifdef TORQUE_OS_MAC
+      #if defined( TORQUE_OS_MAC ) || defined( TORQUE_OS_LINUX )
          FEATUREMGR->registerFeature( MFT_LightMap, new LightmapFeatGLSL );
          FEATUREMGR->registerFeature( MFT_LightMap, new LightmapFeatGLSL );
          FEATUREMGR->registerFeature( MFT_ToneMap, new TonemapFeatGLSL );
          FEATUREMGR->registerFeature( MFT_ToneMap, new TonemapFeatGLSL );
          FEATUREMGR->registerFeature( MFT_NormalMap, new BumpFeatGLSL );
          FEATUREMGR->registerFeature( MFT_NormalMap, new BumpFeatGLSL );
@@ -177,7 +177,7 @@ void BasicLightManager::activate( SceneManager *sceneManager )
    }
    }
    else
    else
    {
    {
-      #ifndef TORQUE_OS_MAC
+      #if !defined( TORQUE_OS_MAC ) && !defined( TORQUE_OS_LINUX )
          FEATUREMGR->registerFeature( MFT_LightMap, new LightmapFeatHLSL );
          FEATUREMGR->registerFeature( MFT_LightMap, new LightmapFeatHLSL );
          FEATUREMGR->registerFeature( MFT_ToneMap, new TonemapFeatHLSL );
          FEATUREMGR->registerFeature( MFT_ToneMap, new TonemapFeatHLSL );
          FEATUREMGR->registerFeature( MFT_NormalMap, new BumpFeatHLSL );
          FEATUREMGR->registerFeature( MFT_NormalMap, new BumpFeatHLSL );

+ 10 - 1
Engine/source/lighting/common/lightMapParams.cpp

@@ -22,8 +22,17 @@
 
 
 #include "lighting/common/lightMapParams.h"
 #include "lighting/common/lightMapParams.h"
 #include "core/stream/bitStream.h"
 #include "core/stream/bitStream.h"
+#include "core/module.h"
 
 
-const LightInfoExType LightMapParams::Type( "LightMapParams" );
+MODULE_BEGIN( LightMapParams )
+MODULE_INIT_AFTER( ShadowMapParams )
+MODULE_INIT
+{
+   LightMapParams::Type = "LightMapParams";
+}
+MODULE_END;
+
+LightInfoExType LightMapParams::Type( "" );
 
 
 LightMapParams::LightMapParams( LightInfo *light ) :
 LightMapParams::LightMapParams( LightInfo *light ) :
    representedInLightmap(false), 
    representedInLightmap(false), 

+ 1 - 1
Engine/source/lighting/common/lightMapParams.h

@@ -34,7 +34,7 @@ public:
    virtual ~LightMapParams();
    virtual ~LightMapParams();
 
 
    /// The LightInfoEx hook type.
    /// The LightInfoEx hook type.
-   static const LightInfoExType Type;
+   static LightInfoExType Type;
 
 
    // LightInfoEx
    // LightInfoEx
    virtual void set( const LightInfoEx *ex );
    virtual void set( const LightInfoEx *ex );

+ 3 - 3
Engine/source/lighting/lightManager.cpp

@@ -314,7 +314,7 @@ void LightManager::_update4LightConsts(   const SceneData &sgData,
 
 
       // NOTE: We haven't ported the lighting shaders on OSX
       // NOTE: We haven't ported the lighting shaders on OSX
       // to the optimized HLSL versions.
       // to the optimized HLSL versions.
-      #ifdef TORQUE_OS_MAC
+      #if defined( TORQUE_OS_MAC ) || defined( TORQUE_OS_LINUX )
          static AlignedArray<Point3F> lightPositions( 4, sizeof( Point4F ) );
          static AlignedArray<Point3F> lightPositions( 4, sizeof( Point4F ) );
       #else
       #else
          static AlignedArray<Point4F> lightPositions( 3, sizeof( Point4F ) );
          static AlignedArray<Point4F> lightPositions( 3, sizeof( Point4F ) );
@@ -342,7 +342,7 @@ void LightManager::_update4LightConsts(   const SceneData &sgData,
          if ( !light )            
          if ( !light )            
             break;
             break;
 
 
-         #ifdef TORQUE_OS_MAC
+         #if defined( TORQUE_OS_MAC ) || defined( TORQUE_OS_LINUX )
 
 
             lightPositions[i] = light->getPosition();
             lightPositions[i] = light->getPosition();
 
 
@@ -381,7 +381,7 @@ void LightManager::_update4LightConsts(   const SceneData &sgData,
       shaderConsts->setSafe( lightDiffuseSC, lightColors );
       shaderConsts->setSafe( lightDiffuseSC, lightColors );
       shaderConsts->setSafe( lightInvRadiusSqSC, lightInvRadiusSq );
       shaderConsts->setSafe( lightInvRadiusSqSC, lightInvRadiusSq );
 
 
-      #ifndef TORQUE_OS_MAC
+      #if !defined( TORQUE_OS_MAC ) && !defined( TORQUE_OS_LINUX )
 
 
          shaderConsts->setSafe( lightSpotDirSC, lightSpotDirs );
          shaderConsts->setSafe( lightSpotDirSC, lightSpotDirs );
          shaderConsts->setSafe( lightSpotAngleSC, lightSpotAngle );
          shaderConsts->setSafe( lightSpotAngleSC, lightSpotAngle );

+ 10 - 2
Engine/source/lighting/shadowMap/lightShadowMap.cpp

@@ -34,7 +34,7 @@
 #include "materials/baseMatInstance.h"
 #include "materials/baseMatInstance.h"
 #include "scene/sceneManager.h"
 #include "scene/sceneManager.h"
 #include "scene/sceneRenderState.h"
 #include "scene/sceneRenderState.h"
-#include "scene/zones/SceneZoneSpace.h"
+#include "scene/zones/sceneZoneSpace.h"
 #include "lighting/lightManager.h"
 #include "lighting/lightManager.h"
 #include "math/mathUtils.h"
 #include "math/mathUtils.h"
 #include "shaderGen/shaderGenVars.h"
 #include "shaderGen/shaderGenVars.h"
@@ -42,6 +42,7 @@
 #include "core/stream/bitStream.h"
 #include "core/stream/bitStream.h"
 #include "math/mathIO.h"
 #include "math/mathIO.h"
 #include "materials/shaderData.h"
 #include "materials/shaderData.h"
+#include "core/module.h"
 
 
 // Used for creation in ShadowMapParams::getOrCreateShadowMap()
 // Used for creation in ShadowMapParams::getOrCreateShadowMap()
 #include "lighting/shadowMap/singleLightShadowMap.h"
 #include "lighting/shadowMap/singleLightShadowMap.h"
@@ -545,8 +546,15 @@ void LightingShaderConstants::_onShaderReload()
       init( mShader );
       init( mShader );
 }
 }
 
 
+MODULE_BEGIN( ShadowMapParams )
+MODULE_INIT_BEFORE( LightMapParams )
+MODULE_INIT
+{
+   ShadowMapParams::Type = "ShadowMapParams" ;
+}
+MODULE_END;
 
 
-const LightInfoExType ShadowMapParams::Type( "ShadowMapParams" );
+LightInfoExType ShadowMapParams::Type( "" );
 
 
 ShadowMapParams::ShadowMapParams( LightInfo *light ) 
 ShadowMapParams::ShadowMapParams( LightInfo *light ) 
    :  mLight( light ),
    :  mLight( light ),

+ 1 - 1
Engine/source/lighting/shadowMap/lightShadowMap.h

@@ -287,7 +287,7 @@ public:
    virtual ~ShadowMapParams();
    virtual ~ShadowMapParams();
 
 
    /// The LightInfoEx hook type.
    /// The LightInfoEx hook type.
-   static const LightInfoExType Type;
+   static LightInfoExType Type;
 
 
    // LightInfoEx
    // LightInfoEx
    virtual void set( const LightInfoEx *ex );
    virtual void set( const LightInfoEx *ex );

+ 2 - 2
Engine/source/math/mSilhouetteExtractor.h

@@ -92,14 +92,14 @@ struct SilhouetteExtractorBasePerspective : public SilhouetteExtractorBase< Poly
 
 
          // Determine orientation of each of the polygons.
          // Determine orientation of each of the polygons.
 
 
-         const U32 numPolygons = mPolyhedron->getNumPlanes();
+         const U32 numPolygons = this->mPolyhedron->getNumPlanes();
          mPolygonOrientations = ( Orientation* ) FrameAllocator::alloc( sizeof( Orientation ) * numPolygons );
          mPolygonOrientations = ( Orientation* ) FrameAllocator::alloc( sizeof( Orientation ) * numPolygons );
 
 
          Point3F camPos = camView.getPosition();
          Point3F camPos = camView.getPosition();
 
 
          for( U32 i = 0; i < numPolygons; ++ i )
          for( U32 i = 0; i < numPolygons; ++ i )
          {
          {
-            if (mPolyhedron->getPlanes()[i].whichSide( camPos ) == PlaneF::Front)
+            if (this->mPolyhedron->getPlanes()[i].whichSide( camPos ) == PlaneF::Front)
                mPolygonOrientations[i] = FrontFacing;
                mPolygonOrientations[i] = FrontFacing;
             else
             else
                mPolygonOrientations[i] = BackFacing;
                mPolygonOrientations[i] = BackFacing;

+ 5 - 5
Engine/source/platform/platform.h

@@ -523,17 +523,17 @@ template<class T,class S> void dCopyArray(T *dst, const S *src, dsize_t size)
       dst[i] = (T)src[i];
       dst[i] = (T)src[i];
 }
 }
 
 
+extern void* dMemcpy(void *dst, const void *src, dsize_t size);
+extern void* dMemmove(void *dst, const void *src, dsize_t size);
+extern void* dMemset(void *dst, int c, dsize_t size);
+extern int   dMemcmp(const void *ptr1, const void *ptr2, dsize_t size);
+
 // Special case of the above function when the arrays are the same type (use memcpy)
 // Special case of the above function when the arrays are the same type (use memcpy)
 template<class T> void dCopyArray(T *dst, const T *src, dsize_t size)
 template<class T> void dCopyArray(T *dst, const T *src, dsize_t size)
 {
 {
    dMemcpy(dst, src, size * sizeof(T));
    dMemcpy(dst, src, size * sizeof(T));
 }
 }
 
 
-extern void* dMemcpy(void *dst, const void *src, dsize_t size);
-extern void* dMemmove(void *dst, const void *src, dsize_t size);
-extern void* dMemset(void *dst, int c, dsize_t size);
-extern int   dMemcmp(const void *ptr1, const void *ptr2, dsize_t size);
-
 /// The dALIGN macro ensures the passed declaration is
 /// The dALIGN macro ensures the passed declaration is
 /// data aligned at 16 byte boundaries.
 /// data aligned at 16 byte boundaries.
 #if defined( TORQUE_COMPILER_VISUALC )
 #if defined( TORQUE_COMPILER_VISUALC )

+ 3 - 3
Engine/source/platform/platformCPUCount.cpp

@@ -522,9 +522,9 @@ next:
                // processors per core
                // processors per core
 
 
                tblSMTID[j]  = GetNzbSubID(apicID, MaxLPPerCore, 0);
                tblSMTID[j]  = GetNzbSubID(apicID, MaxLPPerCore, 0);
-               tblCoreID[j] = GetNzbSubID(apicID, 
-                  MaxCorePerPhysicalProc(),
-                  (unsigned char) find_maskwidth(MaxLPPerCore));
+               unsigned char maxCorePPP = MaxCorePerPhysicalProc();
+               unsigned char maskWidth = find_maskwidth(MaxLPPerCore);
+               tblCoreID[j] = GetNzbSubID(apicID, maxCorePPP, maskWidth);
 
 
                // Extract package ID, assume single cluster.
                // Extract package ID, assume single cluster.
                // Shift value is the mask width for max Logical per package
                // Shift value is the mask width for max Logical per package

+ 16 - 4
Engine/source/platformX86UNIX/threads/semaphore.cpp

@@ -55,13 +55,25 @@ Semaphore::~Semaphore()
   delete mData;
   delete mData;
 }
 }
 
 
-bool Semaphore::acquire(bool block)
+bool Semaphore::acquire(bool block, S32 timeoutMS)
 {
 {
-   AssertFatal(mData, "Semaphore::acquire - Invalid semaphore.");
+   AssertFatal(mData && mData->semaphore, "Semaphore::acquire - Invalid semaphore.");
    if (block)
    if (block)
    {
    {
-      if (SDL_SemWait(mData->semaphore) < 0)
-         AssertFatal(false, "Semaphore::acquie - Wait failed.");
+      // Semaphore acquiring is different from the MacOS/Win realization because SDL_SemWaitTimeout() with "infinite" timeout can be too heavy on some platforms.
+      // (see "man SDL_SemWaitTimeout(3)" for more info)
+      // "man" states to avoid the use of SDL_SemWaitTimeout at all, but at current stage this looks like a valid and working solution, so keeping it this way.
+      // [bank / Feb-2010]
+      if (timeoutMS == -1)
+      {
+         if (SDL_SemWait(mData->semaphore) < 0)
+            AssertFatal(false, "Semaphore::acquie - Wait failed.");
+      }
+      else
+      {
+         if (SDL_SemWaitTimeout(mData->semaphore, timeoutMS) < 0)
+            AssertFatal(false, "Semaphore::acquie - Wait with timeout failed.");
+      }
       return (true);
       return (true);
    }
    }
    else
    else

+ 2 - 0
Engine/source/platformX86UNIX/x86UNIXStub.dedicated.cpp

@@ -81,6 +81,8 @@ void OpenALDLLShutdown() {}
 
 
 // Platform Stubs
 // Platform Stubs
 
 
+bool Platform::excludeOtherInstances(const char*) { return true; }
+
 // clipboard
 // clipboard
 const char* Platform::getClipboard() { return ""; }
 const char* Platform::getClipboard() { return ""; }
 bool Platform::setClipboard(const char *text) { return false; }
 bool Platform::setClipboard(const char *text) { return false; }

+ 1 - 1
Engine/source/renderInstance/renderPassManager.cpp

@@ -42,7 +42,7 @@
 #include "console/engineAPI.h"
 #include "console/engineAPI.h"
 
 
 
 
-const RenderInstType RenderInstType::Invalid( String::EmptyString );
+const RenderInstType RenderInstType::Invalid( "" );
 
 
 const RenderInstType RenderPassManager::RIT_Interior("Interior");
 const RenderInstType RenderPassManager::RIT_Interior("Interior");
 const RenderInstType RenderPassManager::RIT_Mesh("Mesh");
 const RenderInstType RenderPassManager::RIT_Mesh("Mesh");

+ 3 - 0
Engine/source/ts/tsShapeConstruct.h

@@ -38,6 +38,9 @@
 #ifndef _COLLADA_UTILS_H_
 #ifndef _COLLADA_UTILS_H_
 #include "ts/collada/colladaUtils.h"
 #include "ts/collada/colladaUtils.h"
 #endif
 #endif
+#ifndef _ENGINEAPI_H_
+#include "console/engineAPI.h"
+#endif
 
 
 /// This class allows an artist to export their animations for the model
 /// This class allows an artist to export their animations for the model
 /// into the .dsq format.  This class in particular matches up the model
 /// into the .dsq format.  This class in particular matches up the model

+ 67 - 0
Templates/Empty/DeleteCachedDTSs.command

@@ -0,0 +1,67 @@
+<?php
+
+// Set the game project name, this is what your game's exe/dll will be called
+setGameProjectName("Empty");
+
+setPlatform( 'linux' );
+
+// Libs
+includeLib( 'mng' );
+includeLib( 'png' );
+includeLib( 'ungif' );
+includeLib( 'jpeg' );
+includeLib( 'tinyxml' );
+includeLib( 'opcode' );
+includeLib( 'squish' );
+includeLib( 'libvorbis' );
+includeLib( 'libtheora' );
+includeLib( 'libogg' );
+includeLib( 'zlib' );
+includeLib( 'pcre' );
+includeLib( 'collada_dom' );
+includeLib( 'convexDecomp' );
+
+// We need to pick the right physics engine to include.
+global $USE_BULLET_PHYSICS;
+
+/////// Application Config
+beginAppConfig( getGameProjectName(), '{CDECDFF9-E125-523F-87BC-2D89DB971CAB}' );
+
+   // Include only the dedicated crunchy Torque3D goodness
+   echo( "\n   - Loading project code configuration from \"torque3D.conf\"\n");
+   include "torque3D.conf";
+   
+   // Include the project specific source files
+   echo( "\n   - Loading project code configuration from \"projectCode.conf\"\n");
+   include "projectCode.conf";
+
+	addEngineSrcDir( 'main' );
+	
+endAppConfig();
+
+
+
+///////////////// And our solution
+beginSolutionConfig( 'Makefile', '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}' );
+
+   addSolutionProjectRef( getGameProjectName() );
+
+   addSolutionProjectRef( 'collada_dom' );
+
+   addSolutionProjectRef( 'libvorbis' );
+   addSolutionProjectRef( 'libtheora' );
+   addSolutionProjectRef( 'libogg' );
+   addSolutionProjectRef( 'ljpeg' );
+   addSolutionProjectRef( 'lmng' );
+   addSolutionProjectRef( 'lpng' );
+   addSolutionProjectRef( 'lungif' );
+   addSolutionProjectRef( 'opcode' );
+   addSolutionProjectRef( 'pcre' );
+   addSolutionProjectRef( 'squish' );
+   addSolutionProjectRef( 'tinyxml' );
+   addSolutionProjectRef( 'zlib' );
+   addSolutionProjectRef( 'convexDecomp' );
+
+endSolutionConfig();
+
+?>

+ 65 - 0
Templates/Empty/buildFiles/config/project.linux_ded.conf

@@ -0,0 +1,65 @@
+<?php
+
+// Set the game project name, this is what your game's exe/dll will be called
+setGameProjectName("Empty");
+
+setPlatform( 'linux_dedicated' );
+
+// Libs
+includeLib( 'mng' );
+includeLib( 'png' );
+includeLib( 'ungif' );
+includeLib( 'jpeg' );
+includeLib( 'tinyxml' );
+includeLib( 'opcode' );
+includeLib( 'squish' );
+includeLib( 'libvorbis' );
+includeLib( 'libtheora' );
+includeLib( 'libogg' );
+includeLib( 'zlib' );
+includeLib( 'pcre' );
+includeLib( 'collada_dom' );
+includeLib( 'convexDecomp' );
+
+// We need to pick the right physics engine to include.
+global $USE_BULLET_PHYSICS;
+
+/////// Application Config
+beginAppConfig( getGameProjectName(), '{CDECDFF9-E125-523F-87BC-2D89DB971CAB}' );
+
+   // Include only the dedicated crunchy Torque3D goodness
+   echo( "\n   - Loading project code configuration from \"torque3D_dedicated.conf\"\n");
+   include "torque3D_dedicated.conf";
+   
+   // Include the project specific source files
+   echo( "\n   - Loading project code configuration from \"projectCode.conf\"\n");
+   include "projectCode.conf";
+
+   addEngineSrcDir( 'main' );
+	
+endAppConfig();
+
+///////////////// And our solution
+beginSolutionConfig( 'Makefile', '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}' );
+
+   addSolutionProjectRef( getGameProjectName() );
+
+   addSolutionProjectRef( 'collada_dom' );
+
+   addSolutionProjectRef( 'libvorbis' );
+   addSolutionProjectRef( 'libtheora' );
+   addSolutionProjectRef( 'libogg' );
+   addSolutionProjectRef( 'ljpeg' );
+   addSolutionProjectRef( 'lmng' );
+   addSolutionProjectRef( 'lpng' );
+   addSolutionProjectRef( 'lungif' );
+   addSolutionProjectRef( 'opcode' );
+   addSolutionProjectRef( 'pcre' );
+   addSolutionProjectRef( 'squish' );
+   addSolutionProjectRef( 'tinyxml' );
+   addSolutionProjectRef( 'zlib' );
+   addSolutionProjectRef( 'convexDecomp' );
+
+endSolutionConfig();
+
+?>

+ 96 - 0
Templates/Empty/buildFiles/config/torque3D_dedicated.conf

@@ -0,0 +1,96 @@
+<?php
+        
+    /// Prefs
+    addProjectDefine( 'TORQUE_SHADERGEN' );
+    addProjectDefine( 'TORQUE_UNICODE' );
+    addProjectDefine( 'TORQUE_DEDICATED' );
+
+    /// For OPCODE
+    addProjectDefine( 'BAN_OPCODE_AUTOLINK' );
+    addProjectDefine( 'ICE_NO_DLL' );
+    addProjectDefine( 'TORQUE_OPCODE' );
+    
+    // Additional includes
+    addIncludePath( "../../game/shaders" );
+
+    addLibIncludePath( "lmng" );
+    addLibIncludePath( "lpng" );
+    addLibIncludePath( "ljpeg" );
+    addLibIncludePath( "lungif" );
+    addLibIncludePath( "zlib" );
+    addLibIncludePath( "tinyxml" );
+    addLibIncludePath( "opcode" );
+    addLibIncludePath( "squish" );
+    addLibIncludePath( "libvorbis/include" );
+    addLibIncludePath( "libogg/include" );
+    addLibIncludePath( "libtheora/include" );
+    addLibIncludePath( "convexDecomp" );
+
+    // Modules
+    includeModule( 'Torque3D' );
+    includeModule( 'core' );
+    includeModule( 'T3D' );
+    includeModule( 'advancedLighting' );
+    includeModule( 'basicLighting' );
+    includeModule( 'vorbis' );
+    includeModule( 'theora' );
+    
+    includeModule( 'collada' );
+   
+    // Dependencies
+    addProjectDependency( 'lmng' );
+    addProjectDependency( 'lpng' );
+    addProjectDependency( 'lungif' );
+    addProjectDependency( 'ljpeg' );
+    addProjectDependency( 'zlib' );
+    addProjectDependency( 'tinyxml' );
+    
+    addProjectDependency( 'opcode' );
+    addProjectDependency( 'pcre' );
+    addProjectDependency( 'squish' );
+    addProjectDependency( 'collada_dom' );
+    addProjectDependency( 'libvorbis' );
+    addProjectDependency( 'libogg' );
+    addProjectDependency( 'libtheora' );
+    addProjectDependency( 'convexDecomp' );
+    
+    if ( $USE_BULLET_PHYSICS == true )
+    {
+        includeModule( 'bullet' );
+        addProjectDependency( 'libbullet' );
+    }
+
+    if ( Generator::$platform == "mac" )
+    {    
+        addProjectDefine( '__MACOSX__' );
+        addProjectDefine( 'LTM_DESC' );
+    }
+
+
+    if (Generator::$platform == "win32")
+    {
+        setProjectModuleDefinitionFile('../../' . getLibSrcDir() . 'Torque3D/msvc/torque3d.def');
+
+        addProjectDefine( 'UNICODE' );
+        addProjectDefine( 'INITGUID' );
+        addProjectDefine( '_CRT_SECURE_NO_DEPRECATE' );
+
+        addProjectLibInput('COMCTL32.LIB');
+        addProjectLibInput('COMDLG32.LIB');
+        addProjectLibInput('USER32.LIB');
+        addProjectLibInput('ADVAPI32.LIB');
+        addProjectLibInput('GDI32.LIB');
+        addProjectLibInput('WINMM.LIB');
+        addProjectLibInput('WSOCK32.LIB');
+        addProjectLibInput('vfw32.lib');
+        addProjectLibInput('Imm32.lib');
+        addProjectLibInput('d3d9.lib');
+        addProjectLibInput('d3dx9.lib');
+        addProjectLibInput('DxErr.lib');
+        addProjectLibInput('ole32.lib');
+        addProjectLibInput('shell32.lib');
+        addProjectLibInput('oleaut32.lib');
+        addProjectLibInput('version.lib');
+    }
+
+?>

+ 7 - 1
Templates/Empty/cleanShaders.command

@@ -2,5 +2,11 @@
 
 
 cd "`dirname "$0"`"
 cd "`dirname "$0"`"
 
 
-/usr/bin/php ../../Tools/projectGenerator/projectGenerator.php buildFiles/config/project.mac.conf
+OS=`uname`
 
 
+if [ "$OS" = "Darwin" ]; then
+	/usr/bin/php ../../Tools/projectGenerator/projectGenerator.php buildFiles/config/project.mac.conf
+else
+	/usr/bin/php ../../Tools/projectGenerator/projectGenerator.php buildFiles/config/project.linux.conf
+	/usr/bin/php ../../Tools/projectGenerator/projectGenerator.php buildFiles/config/project.linux_ded.conf
+fi

+ 67 - 0
Templates/Full/DeleteCachedDTSs.command

@@ -0,0 +1,67 @@
+<?php
+
+// Set the game project name, this is what your game's exe/dll will be called
+setGameProjectName("Full");
+
+setPlatform( 'linux' );
+
+// Libs
+includeLib( 'mng' );
+includeLib( 'png' );
+includeLib( 'ungif' );
+includeLib( 'jpeg' );
+includeLib( 'tinyxml' );
+includeLib( 'opcode' );
+includeLib( 'squish' );
+includeLib( 'libvorbis' );
+includeLib( 'libtheora' );
+includeLib( 'libogg' );
+includeLib( 'zlib' );
+includeLib( 'pcre' );
+includeLib( 'collada_dom' );
+includeLib( 'convexDecomp' );
+
+// We need to pick the right physics engine to include.
+global $USE_BULLET_PHYSICS;
+
+/////// Application Config
+beginAppConfig( getGameProjectName(), '{CDECDFF9-E125-523F-87BC-2D89DB971CAB}' );
+
+   // Include only the dedicated crunchy Torque3D goodness
+   echo( "\n   - Loading project code configuration from \"torque3D.conf\"\n");
+   include "torque3D.conf";
+   
+   // Include the project specific source files
+   echo( "\n   - Loading project code configuration from \"projectCode.conf\"\n");
+   include "projectCode.conf";
+
+	addEngineSrcDir( 'main' );
+	
+endAppConfig();
+
+
+
+///////////////// And our solution
+beginSolutionConfig( 'Makefile', '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}' );
+
+   addSolutionProjectRef( getGameProjectName() );
+
+   addSolutionProjectRef( 'collada_dom' );
+
+   addSolutionProjectRef( 'libvorbis' );
+   addSolutionProjectRef( 'libtheora' );
+   addSolutionProjectRef( 'libogg' );
+   addSolutionProjectRef( 'ljpeg' );
+   addSolutionProjectRef( 'lmng' );
+   addSolutionProjectRef( 'lpng' );
+   addSolutionProjectRef( 'lungif' );
+   addSolutionProjectRef( 'opcode' );
+   addSolutionProjectRef( 'pcre' );
+   addSolutionProjectRef( 'squish' );
+   addSolutionProjectRef( 'tinyxml' );
+   addSolutionProjectRef( 'zlib' );
+   addSolutionProjectRef( 'convexDecomp' );
+
+endSolutionConfig();
+
+?>

+ 65 - 0
Templates/Full/buildFiles/config/project.linux_ded.conf

@@ -0,0 +1,65 @@
+<?php
+
+// Set the game project name, this is what your game's exe/dll will be called
+setGameProjectName("Full");
+
+setPlatform( 'linux_dedicated' );
+
+// Libs
+includeLib( 'mng' );
+includeLib( 'png' );
+includeLib( 'ungif' );
+includeLib( 'jpeg' );
+includeLib( 'tinyxml' );
+includeLib( 'opcode' );
+includeLib( 'squish' );
+includeLib( 'libvorbis' );
+includeLib( 'libtheora' );
+includeLib( 'libogg' );
+includeLib( 'zlib' );
+includeLib( 'pcre' );
+includeLib( 'collada_dom' );
+includeLib( 'convexDecomp' );
+
+// We need to pick the right physics engine to include.
+global $USE_BULLET_PHYSICS;
+
+/////// Application Config
+beginAppConfig( getGameProjectName(), '{CDECDFF9-E125-523F-87BC-2D89DB971CAB}' );
+
+   // Include only the dedicated crunchy Torque3D goodness
+   echo( "\n   - Loading project code configuration from \"torque3D_dedicated.conf\"\n");
+   include "torque3D_dedicated.conf";
+   
+   // Include the project specific source files
+   echo( "\n   - Loading project code configuration from \"projectCode.conf\"\n");
+   include "projectCode.conf";
+
+   addEngineSrcDir( 'main' );
+	
+endAppConfig();
+
+///////////////// And our solution
+beginSolutionConfig( 'Makefile', '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}' );
+
+   addSolutionProjectRef( getGameProjectName() );
+
+   addSolutionProjectRef( 'collada_dom' );
+
+   addSolutionProjectRef( 'libvorbis' );
+   addSolutionProjectRef( 'libtheora' );
+   addSolutionProjectRef( 'libogg' );
+   addSolutionProjectRef( 'ljpeg' );
+   addSolutionProjectRef( 'lmng' );
+   addSolutionProjectRef( 'lpng' );
+   addSolutionProjectRef( 'lungif' );
+   addSolutionProjectRef( 'opcode' );
+   addSolutionProjectRef( 'pcre' );
+   addSolutionProjectRef( 'squish' );
+   addSolutionProjectRef( 'tinyxml' );
+   addSolutionProjectRef( 'zlib' );
+   addSolutionProjectRef( 'convexDecomp' );
+
+endSolutionConfig();
+
+?>

+ 96 - 0
Templates/Full/buildFiles/config/torque3D_dedicated.conf

@@ -0,0 +1,96 @@
+<?php
+        
+    /// Prefs
+    addProjectDefine( 'TORQUE_SHADERGEN' );
+    addProjectDefine( 'TORQUE_UNICODE' );
+    addProjectDefine( 'TORQUE_DEDICATED' );
+
+    /// For OPCODE
+    addProjectDefine( 'BAN_OPCODE_AUTOLINK' );
+    addProjectDefine( 'ICE_NO_DLL' );
+    addProjectDefine( 'TORQUE_OPCODE' );
+    
+    // Additional includes
+    addIncludePath( "../../game/shaders" );
+
+    addLibIncludePath( "lmng" );
+    addLibIncludePath( "lpng" );
+    addLibIncludePath( "ljpeg" );
+    addLibIncludePath( "lungif" );
+    addLibIncludePath( "zlib" );
+    addLibIncludePath( "tinyxml" );
+    addLibIncludePath( "opcode" );
+    addLibIncludePath( "squish" );
+    addLibIncludePath( "libvorbis/include" );
+    addLibIncludePath( "libogg/include" );
+    addLibIncludePath( "libtheora/include" );
+    addLibIncludePath( "convexDecomp" );
+
+    // Modules
+    includeModule( 'Torque3D' );
+    includeModule( 'core' );
+    includeModule( 'T3D' );
+    includeModule( 'advancedLighting' );
+    includeModule( 'basicLighting' );
+    includeModule( 'vorbis' );
+    includeModule( 'theora' );
+    
+    includeModule( 'collada' );
+   
+    // Dependencies
+    addProjectDependency( 'lmng' );
+    addProjectDependency( 'lpng' );
+    addProjectDependency( 'lungif' );
+    addProjectDependency( 'ljpeg' );
+    addProjectDependency( 'zlib' );
+    addProjectDependency( 'tinyxml' );
+    
+    addProjectDependency( 'opcode' );
+    addProjectDependency( 'pcre' );
+    addProjectDependency( 'squish' );
+    addProjectDependency( 'collada_dom' );
+    addProjectDependency( 'libvorbis' );
+    addProjectDependency( 'libogg' );
+    addProjectDependency( 'libtheora' );
+    addProjectDependency( 'convexDecomp' );
+    
+    if ( $USE_BULLET_PHYSICS == true )
+    {
+        includeModule( 'bullet' );
+        addProjectDependency( 'libbullet' );
+    }
+
+    if ( Generator::$platform == "mac" )
+    {    
+        addProjectDefine( '__MACOSX__' );
+        addProjectDefine( 'LTM_DESC' );
+    }
+
+
+    if (Generator::$platform == "win32")
+    {
+        setProjectModuleDefinitionFile('../../' . getLibSrcDir() . 'Torque3D/msvc/torque3d.def');
+
+        addProjectDefine( 'UNICODE' );
+        addProjectDefine( 'INITGUID' );
+        addProjectDefine( '_CRT_SECURE_NO_DEPRECATE' );
+
+        addProjectLibInput('COMCTL32.LIB');
+        addProjectLibInput('COMDLG32.LIB');
+        addProjectLibInput('USER32.LIB');
+        addProjectLibInput('ADVAPI32.LIB');
+        addProjectLibInput('GDI32.LIB');
+        addProjectLibInput('WINMM.LIB');
+        addProjectLibInput('WSOCK32.LIB');
+        addProjectLibInput('vfw32.lib');
+        addProjectLibInput('Imm32.lib');
+        addProjectLibInput('d3d9.lib');
+        addProjectLibInput('d3dx9.lib');
+        addProjectLibInput('DxErr.lib');
+        addProjectLibInput('ole32.lib');
+        addProjectLibInput('shell32.lib');
+        addProjectLibInput('oleaut32.lib');
+        addProjectLibInput('version.lib');
+    }
+
+?>

+ 3 - 3
Templates/Full/cleanShaders.command

@@ -153,7 +153,7 @@ $c = BuildTarget::add( 'Make',                // Name
 
 
 $c->setSolutionInfo( 'makeSolution.tpl', '', '' );
 $c->setSolutionInfo( 'makeSolution.tpl', '', '' );
 
 
-$c->setFileExtensions( 'c', 'cc', 'h', 'cpp', 'inl', 'asm' );
+$c->setFileExtensions( 'c', 'cc', 'cpp', 'asm' );
 
 
 $c->setPlatforms( "linux" );
 $c->setPlatforms( "linux" );
 
 
@@ -175,7 +175,7 @@ $c = BuildTarget::add( 'Make Dedicated',      // Name
 
 
 $c->setSolutionInfo( 'makeSolution.tpl', '', '' );
 $c->setSolutionInfo( 'makeSolution.tpl', '', '' );
 
 
-$c->setFileExtensions( 'c', 'cc', 'h', 'cpp', 'inl', 'asm' );
+$c->setFileExtensions( 'c', 'cc', 'cpp', 'asm' );
 
 
 $c->setPlatforms( "linux_dedicated" );
 $c->setPlatforms( "linux_dedicated" );
 
 
@@ -197,7 +197,7 @@ $c = BuildTarget::add( 'build',						// Name
                   '',         				   // ActiveX Project Template
                   '',         				   // ActiveX Project Template
                   '.txt' );
                   '.txt' );
          
          
-$c->setFileExtensions( 'c', 'cc', 'h', 'cpp', 'inl', 'asm', 'm', 'mm' );
+$c->setFileExtensions( 'c', 'cc', 'cpp', 'asm', 'm', 'mm' );
 
 
 // NO PLATFORMS - SO ALL OR NONE?
 // NO PLATFORMS - SO ALL OR NONE?
 $c->setPlatforms("");
 $c->setPlatforms("");

+ 4 - 1
Tools/projectGenerator/modules/T3D.inc

@@ -38,7 +38,8 @@ addEngineSrcDir('environment');
 
 
 addEngineSrcDir('forest');
 addEngineSrcDir('forest');
 addEngineSrcDir('forest/ts');
 addEngineSrcDir('forest/ts');
-addEngineSrcDir('forest/editor');
+if(getToolBuild())
+   addEngineSrcDir('forest/editor');
 
 
 addEngineSrcDir('ts');
 addEngineSrcDir('ts');
 addEngineSrcDir('ts/arch');
 addEngineSrcDir('ts/arch');
@@ -84,6 +85,8 @@ switch( Generator::$platform )
       // Fall through
       // Fall through
       
       
    case "mac":
    case "mac":
+   case "linux":
+   case "linux_dedicated":
       addEngineSrcDir( 'terrain/glsl' );
       addEngineSrcDir( 'terrain/glsl' );
       addEngineSrcDir( 'forest/glsl' );
       addEngineSrcDir( 'forest/glsl' );
       break;
       break;

+ 2 - 0
Tools/projectGenerator/modules/advancedLighting.inc

@@ -37,6 +37,8 @@ beginModule( 'advancedLighting' );
          addEngineSrcDir( 'lighting/advanced/hlsl' );
          addEngineSrcDir( 'lighting/advanced/hlsl' );
          break;
          break;
       case "mac":
       case "mac":
+      case "linux":
+      case "linux_dedicated":
          addEngineSrcDir( 'lighting/advanced/glsl' );
          addEngineSrcDir( 'lighting/advanced/glsl' );
          break;
          break;
    }
    }

+ 1 - 1
Tools/projectGenerator/modules/bullet.inc

@@ -35,7 +35,7 @@ beginModule( 'bullet' );
    {
    {
       addProjectDependency( 'libbullet' );
       addProjectDependency( 'libbullet' );
 
 
-      if (Generator::$platform != "mac")
+      if (Generator::$platform != "win32")
          addSolutionProjectRef( 'libbullet' );
          addSolutionProjectRef( 'libbullet' );
    }
    }
    
    

+ 16 - 5
Tools/projectGenerator/modules/core.inc

@@ -110,8 +110,10 @@ switch( Generator::$platform )
      addEngineSrcDir('windowManager/ps3');
      addEngineSrcDir('windowManager/ps3');
      break;
      break;
 
 
-   case "linux":
    case "linux_dedicated":
    case "linux_dedicated":
+     addEngineSrcDir('windowManager/dedicated');
+
+   case "linux":
      addEngineSrcDir('platformX86UNIX');
      addEngineSrcDir('platformX86UNIX');
      addEngineSrcDir('platformX86UNIX/threads');
      addEngineSrcDir('platformX86UNIX/threads');
      addEngineSrcDir('platformPOSIX');
      addEngineSrcDir('platformPOSIX');
@@ -135,12 +137,12 @@ switch( Generator::$platform )
       addEngineSrcDir( 'gfx/D3D' );
       addEngineSrcDir( 'gfx/D3D' );
       addEngineSrcDir( 'gfx/D3D9' );
       addEngineSrcDir( 'gfx/D3D9' );
       addEngineSrcDir( 'gfx/D3D9/pc' );
       addEngineSrcDir( 'gfx/D3D9/pc' );
-      addEngineSrcDir( 'shaderGen/hlsl' );
+      addEngineSrcDir( 'shaderGen/HLSL' );
       break;
       break;
    case "360":
    case "360":
       addEngineSrcDir( 'gfx/D3D9' );
       addEngineSrcDir( 'gfx/D3D9' );
       addEngineSrcDir( 'gfx/D3D9/360' );
       addEngineSrcDir( 'gfx/D3D9/360' );
-      addEngineSrcDir( 'shaderGen/hlsl' );
+      addEngineSrcDir( 'shaderGen/HLSL' );
       addEngineSrcDir( 'shaderGen/360' );
       addEngineSrcDir( 'shaderGen/360' );
       break;
       break;
    case "mac":
    case "mac":
@@ -150,7 +152,16 @@ switch( Generator::$platform )
       addEngineSrcDir( 'gfx/gl' );
       addEngineSrcDir( 'gfx/gl' );
       addEngineSrcDir( 'gfx/gl/ggl' );
       addEngineSrcDir( 'gfx/gl/ggl' );
       addEngineSrcDir( 'gfx/gl/ggl/generated' );
       addEngineSrcDir( 'gfx/gl/ggl/generated' );
-      addEngineSrcDir( 'shaderGen/glsl' );
+      addEngineSrcDir( 'shaderGen/GLSL' );
+      break;
+   case "linux":
+   case "linux_dedicated":
+      //addEngineSrcDir( 'gfx/gl/ggl/x11' ); // This one is not yet implemented!
+      // GFX - GGL
+      addEngineSrcDir( 'gfx/gl' );
+      addEngineSrcDir( 'gfx/gl/ggl' );
+      addEngineSrcDir( 'gfx/gl/ggl/generated' );
+      addEngineSrcDir( 'shaderGen/GLSL' );
       break;
       break;
    case "ps3":
    case "ps3":
       addEngineSrcDir( 'gfx/gl/ggl/ps3' );
       addEngineSrcDir( 'gfx/gl/ggl/ps3' );
@@ -159,7 +170,7 @@ switch( Generator::$platform )
       addEngineSrcDir( 'gfx/gl' );
       addEngineSrcDir( 'gfx/gl' );
       addEngineSrcDir( 'gfx/gl/ggl' );
       addEngineSrcDir( 'gfx/gl/ggl' );
       addEngineSrcDir( 'gfx/gl/ggl/generated' );
       addEngineSrcDir( 'gfx/gl/ggl/generated' );
-      addEngineSrcDir( 'shaderGen/glsl' );
+      addEngineSrcDir( 'shaderGen/GLSL' );
       break;
       break;
 }
 }
 
 

+ 9 - 5
Tools/projectGenerator/templates/makeApp.tpl

@@ -12,13 +12,17 @@ SOURCES := {foreach from=$dirWalk item=file key=key}
 {/foreach}
 {/foreach}
 
 
 LDFLAGS := -g -m32
 LDFLAGS := -g -m32
-LDLIBS := -lstdc++
-CFLAGS := -MMD -I. -Wfatal-errors -m32
+LDLIBS := -lstdc++ -lm -lSDL -lpthread -lrt
+{foreach item=def from=$projLibs}LDLIBS += -l{$def}
+{/foreach}
+
+CFLAGS := -MMD -I. -Wfatal-errors -m32 -msse -mmmx -march=i686 -pipe
 
 
 {foreach item=def from=$projIncludes}CFLAGS += -I{$def}
 {foreach item=def from=$projIncludes}CFLAGS += -I{$def}
 {/foreach}
 {/foreach}
 
 
-CFLAGS += -DUNICODE;
+CFLAGS += -DUNICODE
+CFLAGS += -DLINUX
 
 
 {foreach item=def from=$projDefines}CFLAGS += -D{$def}
 {foreach item=def from=$projDefines}CFLAGS += -D{$def}
 {/foreach}
 {/foreach}
@@ -28,9 +32,9 @@ CFLAGS_DEBUG += -DTORQUE_DEBUG
 CFLAGS_DEBUG += -DTORQUE_DEBUG_GUARD
 CFLAGS_DEBUG += -DTORQUE_DEBUG_GUARD
 CFLAGS_DEBUG += -DTORQUE_NET_STATS
 CFLAGS_DEBUG += -DTORQUE_NET_STATS
 
 
-CFLAGS += -O3
+CFLAGS += -O0
 
 
-#CC := gcc
+CC := gcc
 LD := gcc
 LD := gcc
 
 
 APP_TARGETS += $(APPNAME)
 APP_TARGETS += $(APPNAME)

+ 3 - 2
Tools/projectGenerator/templates/makeAppShared.tpl

@@ -13,12 +13,13 @@ SOURCES := {foreach from=$dirWalk item=file key=key}
 
 
 LDFLAGS := -g -m32
 LDFLAGS := -g -m32
 LDLIBS := -lstdc++
 LDLIBS := -lstdc++
-CFLAGS := -MMD -I. -Wfatal-errors -m32
+CFLAGS := -MMD -I. -Wfatal-errors -m32 -msse -mmmx -march=i686
 
 
 {foreach item=def from=$projIncludes}CFLAGS += -I{$def}
 {foreach item=def from=$projIncludes}CFLAGS += -I{$def}
 {/foreach}
 {/foreach}
 
 
 CFLAGS += -DUNICODE
 CFLAGS += -DUNICODE
+CFLAGS += -DLINUX
 
 
 {foreach item=def from=$projDefines}CFLAGS += -D{$def}
 {foreach item=def from=$projDefines}CFLAGS += -D{$def}
 {/foreach}
 {/foreach}
@@ -30,7 +31,7 @@ CFLAGS_DEBUG += -DTORQUE_DEBUG_GUARD
 
 
 CFLAGS += -O3
 CFLAGS += -O3
 
 
-#CC := gcc
+CC := gcc
 LD := gcc
 LD := gcc
 
 
 APP_TARGETS += $(APPNAME)
 APP_TARGETS += $(APPNAME)

+ 4 - 3
Tools/projectGenerator/templates/makeLib.tpl

@@ -15,13 +15,14 @@ SOURCES := {foreach from=$dirWalk item=file key=key}
 {/foreach}
 {/foreach}
 
 
 LDFLAGS_{$projName} := -g -m32
 LDFLAGS_{$projName} := -g -m32
-LDLIBS_{$projName} := -lstdc++
-CFLAGS_{$projName} := -MMD -I. -m32
+#LDLIBS_{$projName} := -lstdc++
+CFLAGS_{$projName} := -MMD -I. -m32 -msse -mmmx -march=i686
 
 
 {foreach item=def from=$projIncludes}CFLAGS_{$projName} += -I{$def}
 {foreach item=def from=$projIncludes}CFLAGS_{$projName} += -I{$def}
 {/foreach}
 {/foreach}
 
 
 CFLAGS_{$projName} += -DUNICODE
 CFLAGS_{$projName} += -DUNICODE
+CFLAGS_{$projName} += -DLINUX
 
 
 {foreach item=def from=$projDefines}CFLAGS_{$projName} += -D{$def}
 {foreach item=def from=$projDefines}CFLAGS_{$projName} += -D{$def}
 {/foreach}
 {/foreach}
@@ -33,7 +34,7 @@ CFLAGS_DEBUG_{$projName} += -DTORQUE_NET_STATS
 
 
 CFLAGS_{$projName} += -O3
 CFLAGS_{$projName} += -O3
 
 
-#CC := gcc
+CC := gcc
 LD := gcc
 LD := gcc
 
 
 TARGET_{$projName} := {$libDir}/compiled/Make/{$projName}.a
 TARGET_{$projName} := {$libDir}/compiled/Make/{$projName}.a

+ 3 - 2
Tools/projectGenerator/templates/makeSo.tpl

@@ -22,6 +22,7 @@ CFLAGS_{$projName} := -MMD -I. -m32 -mmmx -msse -march=i686
 {/foreach}
 {/foreach}
 
 
 CFLAGS_{$projName} += -DUNICODE
 CFLAGS_{$projName} += -DUNICODE
+CFLAGS_{$projName} += -DLINUX
 
 
 {foreach item=def from=$projDefines}CFLAGS_{$projName} += -D{$def}
 {foreach item=def from=$projDefines}CFLAGS_{$projName} += -D{$def}
 {/foreach}
 {/foreach}
@@ -31,9 +32,9 @@ CFLAGS_DEBUG_{$projName} += -DTORQUE_DEBUG
 CFLAGS_DEBUG_{$projName} += -DTORQUE_DEBUG_GUARD
 CFLAGS_DEBUG_{$projName} += -DTORQUE_DEBUG_GUARD
 CFLAGS_DEBUG_{$projName} += -DTORQUE_NET_STATS
 CFLAGS_DEBUG_{$projName} += -DTORQUE_NET_STATS
 
 
-CFLAGS_{$projName} += -O3
+CFLAGS_{$projName} += -O0
 
 
-#CC := gcc
+CC := gcc
 LD := gcc
 LD := gcc
 
 
 SHARED_LIB_TARGETS += {$projName}.so
 SHARED_LIB_TARGETS += {$projName}.so

+ 5 - 0
Tools/projectGenerator/templates/makeSolution.tpl

@@ -3,6 +3,11 @@
 # copyright on the actual sources.
 # copyright on the actual sources.
 # Copyright 2005 Jon Watte.
 # Copyright 2005 Jon Watte.
 
 
+# This sets the option for how many instances of gcc we'll run at the
+# same time, one per CPU core in this case. This speeds up build time.
+# Adjust to your amount of cores.
+OPTIONS := --jobs=4
+
 DEPS := 
 DEPS := 
 LIB_TARGETS :=
 LIB_TARGETS :=
 LIB_TARGETS_DEBUG := 
 LIB_TARGETS_DEBUG :=