diff -urNx '*.d' t3d1.2_stock/Engine/lib/convexDecomp/NvRemoveTjunctions.cpp t3d1.2_patched/Engine/lib/convexDecomp/NvRemoveTjunctions.cpp
--- t3d1.2_stock/Engine/lib/convexDecomp/NvRemoveTjunctions.cpp	2009-12-09 05:33:30.000000000 -0600
+++ t3d1.2_patched/Engine/lib/convexDecomp/NvRemoveTjunctions.cpp	2011-12-29 16:05:33.446763638 -0600
@@ -67,6 +67,9 @@
 #include "NvHashMap.h"
 #include "NvRemoveTjunctions.h"
 #include "NvFloatMath.h"
+#ifdef LINUX
+   #include <climits>
+#endif
 
 #pragma warning(disable:4189)
 
diff -urNx '*.d' t3d1.2_stock/Engine/source/console/dynamicTypes.h t3d1.2_patched/Engine/source/console/dynamicTypes.h
--- t3d1.2_stock/Engine/source/console/dynamicTypes.h	2011-04-08 12:28:44.000000000 -0500
+++ t3d1.2_patched/Engine/source/console/dynamicTypes.h	2011-12-29 19:46:10.598819326 -0600
@@ -235,7 +235,7 @@
    extern S32 type; \
    extern const char* castConsoleTypeToString( _ConsoleConstType< nativeType >::ConstType &arg ); \
    extern bool castConsoleTypeFromString( nativeType &arg, const char *str ); \
-   template<> extern S32 TYPEID< nativeType >();
+   template<> /*extern*/ S32 TYPEID< nativeType >();
    
 #define DefineUnmappedConsoleType( type, nativeType ) \
    DefineConsoleType( type, nativeType ) \
diff -urNx '*.d' t3d1.2_stock/Engine/source/console/engineTypes.h t3d1.2_patched/Engine/source/console/engineTypes.h
--- t3d1.2_stock/Engine/source/console/engineTypes.h	2011-04-08 12:28:44.000000000 -0500
+++ t3d1.2_patched/Engine/source/console/engineTypes.h	2011-12-29 19:46:20.818765157 -0600
@@ -399,7 +399,7 @@
 
 
 #define _DECLARE_TYPE( type )                                                                \
-   template<> extern const EngineTypeInfo* TYPE< type >();                                   \
+   template<> /*extern*/ const EngineTypeInfo* TYPE< type >();                                   \
    template<> struct _SCOPE< type > {                                                        \
       EngineExportScope& operator()() const {                                                \
          return *reinterpret_cast< EngineExportScope* >(                                     \
diff -urNx '*.d' t3d1.2_stock/Engine/source/gui/controls/guiTreeViewCtrl.cpp t3d1.2_patched/Engine/source/gui/controls/guiTreeViewCtrl.cpp
--- t3d1.2_stock/Engine/source/gui/controls/guiTreeViewCtrl.cpp	2011-05-04 14:03:14.000000000 -0500
+++ t3d1.2_patched/Engine/source/gui/controls/guiTreeViewCtrl.cpp	2011-12-29 16:14:25.910794619 -0600
@@ -16,7 +16,9 @@
 #include "platform/event.h"
 #include "gfx/gfxDrawUtil.h"
 #include "gui/controls/guiTextEditCtrl.h"
-#include "gui/editor/editorFunctions.h"
+#ifdef TORQUE_TOOLS
+   #include "gui/editor/editorFunctions.h"
+#endif
 #include "console/engineAPI.h"
 
 
@@ -4025,7 +4027,10 @@
       // 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
       // 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
       if ( !hasClassIcon && item->mState.test(Item::VirtualParent))
@@ -5263,7 +5268,10 @@
 
    if ( mRenameInternal )
       obj->setInternalName( data );   
-   else if ( validateObjectName( data, obj ) )
+   else
+#ifdef TORQUE_TOOLS
+   if ( validateObjectName( data, obj ) )
+#endif
       obj->assignName( data ); 
 }
 
diff -urNx '*.d' t3d1.2_stock/Engine/source/lighting/advanced/advancedLightingFeatures.cpp t3d1.2_patched/Engine/source/lighting/advanced/advancedLightingFeatures.cpp
--- t3d1.2_stock/Engine/source/lighting/advanced/advancedLightingFeatures.cpp	2011-04-08 12:28:44.000000000 -0500
+++ t3d1.2_patched/Engine/source/lighting/advanced/advancedLightingFeatures.cpp	2011-12-29 17:03:39.480364551 -0600
@@ -14,7 +14,7 @@
 #include "gfx/gfxDevice.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/advancedLightingFeaturesHLSL.h"
 #else
@@ -37,7 +37,7 @@
 
    if(GFX->getAdapterType() == OpenGL)
    {
-#ifdef TORQUE_OS_MAC
+#if defined( TORQUE_OS_MAC ) || defined( TORQUE_OS_LINUX )
       cond = new GBufferConditionerGLSL( prepassTargetFormat );
       FEATUREMGR->registerFeature(MFT_PrePassConditioner, cond);
       FEATUREMGR->registerFeature(MFT_RTLighting, new DeferredRTLightingFeatGLSL());
@@ -49,7 +49,7 @@
    }
    else
    {
-#ifndef TORQUE_OS_MAC
+#if !defined( TORQUE_OS_MAC ) && !defined( TORQUE_OS_LINUX )
       cond = new GBufferConditionerHLSL( prepassTargetFormat, GBufferConditionerHLSL::ViewSpace );
       FEATUREMGR->registerFeature(MFT_PrePassConditioner, cond);
       FEATUREMGR->registerFeature(MFT_RTLighting, new DeferredRTLightingFeatHLSL());
diff -urNx '*.d' t3d1.2_stock/Engine/source/lighting/basic/basicLightManager.cpp t3d1.2_patched/Engine/source/lighting/basic/basicLightManager.cpp
--- t3d1.2_stock/Engine/source/lighting/basic/basicLightManager.cpp	2011-09-17 01:47:50.000000000 -0500
+++ t3d1.2_patched/Engine/source/lighting/basic/basicLightManager.cpp	2011-12-29 17:04:54.475892064 -0600
@@ -32,7 +32,7 @@
 #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/bumpGLSL.h"
 #include "shaderGen/GLSL/pixSpecularGLSL.h"
@@ -150,7 +150,7 @@
 
    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_ToneMap, new TonemapFeatGLSL );
          FEATUREMGR->registerFeature( MFT_NormalMap, new BumpFeatGLSL );
@@ -160,7 +160,7 @@
    }
    else
    {
-      #ifndef TORQUE_OS_MAC
+      #if !defined( TORQUE_OS_MAC ) && !defined( TORQUE_OS_LINUX )
          FEATUREMGR->registerFeature( MFT_LightMap, new LightmapFeatHLSL );
          FEATUREMGR->registerFeature( MFT_ToneMap, new TonemapFeatHLSL );
          FEATUREMGR->registerFeature( MFT_NormalMap, new BumpFeatHLSL );
diff -urNx '*.d' t3d1.2_stock/Engine/source/lighting/common/lightMapParams.cpp t3d1.2_patched/Engine/source/lighting/common/lightMapParams.cpp
--- t3d1.2_stock/Engine/source/lighting/common/lightMapParams.cpp	2011-04-08 12:28:44.000000000 -0500
+++ t3d1.2_patched/Engine/source/lighting/common/lightMapParams.cpp	2011-12-29 16:17:58.178774828 -0600
@@ -5,8 +5,17 @@
 
 #include "lighting/common/lightMapParams.h"
 #include "core/stream/bitStream.h"
+#include "core/module.h"
+ 
+MODULE_BEGIN( LightMapParams )
+MODULE_INIT_AFTER( ShadowMapParams )
+MODULE_INIT
+{
+   LightMapParams::Type = "LightMapParams" ;
+}
+MODULE_END;
 
-const LightInfoExType LightMapParams::Type( "LightMapParams" );
+LightInfoExType LightMapParams::Type( "" );
 
 LightMapParams::LightMapParams( LightInfo *light ) :
    representedInLightmap(false), 
@@ -41,4 +50,4 @@
 
    // Always make sure that the alpha value of the shadowDarkenColor is -1.0
    shadowDarkenColor.alpha = -1.0f;
-}
\ No newline at end of file
+}
diff -urNx '*.d' t3d1.2_stock/Engine/source/lighting/common/lightMapParams.h t3d1.2_patched/Engine/source/lighting/common/lightMapParams.h
--- t3d1.2_stock/Engine/source/lighting/common/lightMapParams.h	2011-04-08 12:28:44.000000000 -0500
+++ t3d1.2_patched/Engine/source/lighting/common/lightMapParams.h	2011-12-29 16:18:44.834762407 -0600
@@ -17,7 +17,7 @@
    virtual ~LightMapParams();
 
    /// The LightInfoEx hook type.
-   static const LightInfoExType Type;
+   static LightInfoExType Type;
 
    // LightInfoEx
    virtual void set( const LightInfoEx *ex );
diff -urNx '*.d' t3d1.2_stock/Engine/source/lighting/lightManager.cpp t3d1.2_patched/Engine/source/lighting/lightManager.cpp
--- t3d1.2_stock/Engine/source/lighting/lightManager.cpp	2011-09-17 01:47:50.000000000 -0500
+++ t3d1.2_patched/Engine/source/lighting/lightManager.cpp	2011-12-29 17:06:40.483013680 -0600
@@ -297,7 +297,7 @@
 
       // NOTE: We haven't ported the lighting shaders on OSX
       // 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 ) );
       #else
          static AlignedArray<Point4F> lightPositions( 3, sizeof( Point4F ) );
@@ -325,7 +325,7 @@
          if ( !light )            
             break;
 
-         #ifdef TORQUE_OS_MAC
+         #if defined( TORQUE_OS_MAC ) || defined( TORQUE_OS_LINUX )
 
             lightPositions[i] = light->getPosition();
 
@@ -364,7 +364,7 @@
       shaderConsts->setSafe( lightDiffuseSC, lightColors );
       shaderConsts->setSafe( lightInvRadiusSqSC, lightInvRadiusSq );
 
-      #ifndef TORQUE_OS_MAC
+      #if !defined( TORQUE_OS_MAC ) && !defined( TORQUE_OS_LINUX )
 
          shaderConsts->setSafe( lightSpotDirSC, lightSpotDirs );
          shaderConsts->setSafe( lightSpotAngleSC, lightSpotAngle );
diff -urNx '*.d' t3d1.2_stock/Engine/source/lighting/shadowMap/lightShadowMap.cpp t3d1.2_patched/Engine/source/lighting/shadowMap/lightShadowMap.cpp
--- t3d1.2_stock/Engine/source/lighting/shadowMap/lightShadowMap.cpp	2011-09-17 01:47:50.000000000 -0500
+++ t3d1.2_patched/Engine/source/lighting/shadowMap/lightShadowMap.cpp	2011-12-29 19:59:40.894764690 -0600
@@ -17,7 +17,7 @@
 #include "materials/baseMatInstance.h"
 #include "scene/sceneManager.h"
 #include "scene/sceneRenderState.h"
-#include "scene/zones/SceneZoneSpace.h"
+#include "scene/zones/sceneZoneSpace.h"
 #include "lighting/lightManager.h"
 #include "math/mathUtils.h"
 #include "shaderGen/shaderGenVars.h"
@@ -25,6 +25,7 @@
 #include "core/stream/bitStream.h"
 #include "math/mathIO.h"
 #include "materials/shaderData.h"
+#include "core/module.h"
 
 // Used for creation in ShadowMapParams::getOrCreateShadowMap()
 #include "lighting/shadowMap/singleLightShadowMap.h"
@@ -529,7 +530,15 @@
 }
 
 
-const LightInfoExType ShadowMapParams::Type( "ShadowMapParams" );
+MODULE_BEGIN( ShadowMapParams )
+MODULE_INIT_BEFORE( LightMapParams )
+MODULE_INIT
+{
+   ShadowMapParams::Type = "ShadowMapParams" ;
+}
+MODULE_END;
+
+LightInfoExType ShadowMapParams::Type( "" );
 
 ShadowMapParams::ShadowMapParams( LightInfo *light ) 
    :  mLight( light ),
diff -urNx '*.d' t3d1.2_stock/Engine/source/lighting/shadowMap/lightShadowMap.h t3d1.2_patched/Engine/source/lighting/shadowMap/lightShadowMap.h
--- t3d1.2_stock/Engine/source/lighting/shadowMap/lightShadowMap.h	2011-09-17 01:47:50.000000000 -0500
+++ t3d1.2_patched/Engine/source/lighting/shadowMap/lightShadowMap.h	2011-12-29 16:22:12.910769573 -0600
@@ -270,7 +270,7 @@
    virtual ~ShadowMapParams();
 
    /// The LightInfoEx hook type.
-   static const LightInfoExType Type;
+   static LightInfoExType Type;
 
    // LightInfoEx
    virtual void set( const LightInfoEx *ex );
diff -urNx '*.d' t3d1.2_stock/Engine/source/math/mSilhouetteExtractor.h t3d1.2_patched/Engine/source/math/mSilhouetteExtractor.h
--- t3d1.2_stock/Engine/source/math/mSilhouetteExtractor.h	2011-09-20 13:07:04.000000000 -0500
+++ t3d1.2_patched/Engine/source/math/mSilhouetteExtractor.h	2011-12-29 19:52:37.334773857 -0600
@@ -75,14 +75,14 @@
 
          // 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 );
 
          Point3F camPos = camView.getPosition();
 
          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;
             else
                mPolygonOrientations[i] = BackFacing;
diff -urNx '*.d' t3d1.2_stock/Engine/source/platformX86UNIX/threads/semaphore.cpp t3d1.2_patched/Engine/source/platformX86UNIX/threads/semaphore.cpp
--- t3d1.2_stock/Engine/source/platformX86UNIX/threads/semaphore.cpp	2011-04-08 12:28:44.000000000 -0500
+++ t3d1.2_patched/Engine/source/platformX86UNIX/threads/semaphore.cpp	2011-12-29 17:09:20.314765524 -0600
@@ -38,13 +38,25 @@
   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 (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);
    }
    else
diff -urNx '*.d' t3d1.2_stock/Engine/source/platformX86UNIX/x86UNIXStub.dedicated.cpp t3d1.2_patched/Engine/source/platformX86UNIX/x86UNIXStub.dedicated.cpp
--- t3d1.2_stock/Engine/source/platformX86UNIX/x86UNIXStub.dedicated.cpp	2011-04-08 12:28:44.000000000 -0500
+++ t3d1.2_patched/Engine/source/platformX86UNIX/x86UNIXStub.dedicated.cpp	2011-12-29 17:10:11.027139512 -0600
@@ -64,6 +64,8 @@
 
 // Platform Stubs
 
+bool Platform::excludeOtherInstances(const char*) { return true; }
+
 // clipboard
 const char* Platform::getClipboard() { return ""; }
 bool Platform::setClipboard(const char *text) { return false; }
diff -urNx '*.d' t3d1.2_stock/Engine/source/renderInstance/renderPassManager.cpp t3d1.2_patched/Engine/source/renderInstance/renderPassManager.cpp
--- t3d1.2_stock/Engine/source/renderInstance/renderPassManager.cpp	2011-04-29 21:37:16.000000000 -0500
+++ t3d1.2_patched/Engine/source/renderInstance/renderPassManager.cpp	2011-12-29 17:11:06.058793749 -0600
@@ -25,7 +25,7 @@
 #include "console/engineAPI.h"
 
 
-const RenderInstType RenderInstType::Invalid( String::EmptyString );
+const RenderInstType RenderInstType::Invalid( "" );
 
 const RenderInstType RenderPassManager::RIT_Interior("Interior");
 const RenderInstType RenderPassManager::RIT_Mesh("Mesh");
diff -urNx '*.d' t3d1.2_stock/Templates/Full/buildFiles/config/project.linux_ded.conf t3d1.2_patched/Templates/Full/buildFiles/config/project.linux_ded.conf
--- t3d1.2_stock/Templates/Full/buildFiles/config/project.linux_ded.conf	1969-12-31 18:00:00.000000000 -0600
+++ t3d1.2_patched/Templates/Full/buildFiles/config/project.linux_ded.conf	2011-02-04 12:10:27.000000000 -0600
@@ -0,0 +1,62 @@
+<?php
+
+// Set the game project name, this is what your game's exe/dll will be called
+setGameProjectName("Full");
+
+// Set this build to be non-tools, so it will not include anything like editors, etc. Anyway we don't need it on dedicated
+setToolBuild(false);
+
+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' ); 
+
+beginAppConfig( getGameProjectName(), '{C0FCDFF9-E125-412E-87BC-2D89DB971CAB}' );
+
+   // Include only the dedicated crunchy Torque3D goodness
+   include "torque3D_dedicated.conf";
+   
+   addEngineSrcDir( 'main' );
+   
+   // Include the project specific source files
+   include "projectCode.conf";
+
+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();
+
+?>
diff -urNx '*.d' t3d1.2_stock/Templates/Full/buildFiles/config/torque3D_dedicated.conf t3d1.2_patched/Templates/Full/buildFiles/config/torque3D_dedicated.conf
--- t3d1.2_stock/Templates/Full/buildFiles/config/torque3D_dedicated.conf	1969-12-31 18:00:00.000000000 -0600
+++ t3d1.2_patched/Templates/Full/buildFiles/config/torque3D_dedicated.conf	2011-02-04 12:10:27.000000000 -0600
@@ -0,0 +1,93 @@
+<?php
+        
+    /// Prefs
+    addProjectDefine( 'TORQUE_SHADERGEN' );
+    addProjectDefine( 'TORQUE_UNICODE' );
+    // addProjectDefine( 'TORQUE_SHARED' );
+    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( "libvorbis/include" );
+    addLibIncludePath( "libogg/include" );
+    addLibIncludePath( "libtheora/include" );
+    addLibIncludePath( "squish" );
+    addLibIncludePath( "convexDecomp" );
+    addLibIncludePath( "fmod/inc" );
+
+    // Modules
+    includeModule( 'Torque3D' );
+    includeModule( 'core' );
+    includeModule( 'T3D' );
+    includeModule( 'vorbis' );
+    includeModule( 'theora' );
+    includeModule( 'fmod' );
+    includeModule( 'advancedLighting' );
+    includeModule( 'basicLighting' );
+    
+    includeModule( 'collada' );
+   
+    // Dependencies
+    addProjectDependency( 'lmng' );
+    addProjectDependency( 'lpng' );
+    addProjectDependency( 'lungif' );
+    addProjectDependency( 'ljpeg' );
+    addProjectDependency( 'zlib' );
+    addProjectDependency( 'tinyxml' );
+    
+    addProjectDependency( 'opcode' );
+    addProjectDependency( 'libvorbis' );
+    addProjectDependency( 'libogg' );
+    addProjectDependency( 'libtheora' );
+    addProjectDependency( 'squish' );
+    addProjectDependency( 'pcre' );
+    addProjectDependency( 'collada_dom' );
+    addProjectDependency( 'convexDecomp' );
+    
+
+    if ( Generator::$platform == "mac" )
+    {    
+        addProjectDefine( '__MACOSX__' );
+        addProjectDefine( 'LTM_DESC' );
+    }
+
+
+    if (Generator::$platform == "win32")
+    {
+        setProjectModuleDefinitionFile('../../' . getLibSrcDir() . 'Torque3D/msvc/torque3d.def');
+
+        addProjectDefine( 'UNICODE' );
+        addProjectDefine( 'INITGUID' );
+
+        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('dxerr9.lib');
+        addProjectLibInput('ole32.lib');
+        addProjectLibInput('shell32.lib');
+        addProjectLibInput('oleaut32.lib');
+        addProjectLibInput('version.lib');
+    }
+
+?>
diff -urNx '*.d' t3d1.2_stock/Templates/Full/generateProjects.command t3d1.2_patched/Templates/Full/generateProjects.command
--- t3d1.2_stock/Templates/Full/generateProjects.command	2009-08-14 17:41:46.000000000 -0500
+++ t3d1.2_patched/Templates/Full/generateProjects.command	2011-12-29 18:10:00.062763534 -0600
@@ -7,6 +7,6 @@
 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.conf
 	/usr/bin/php ../../Tools/projectGenerator/projectGenerator.php buildFiles/config/project.linux_ded.conf
 fi
diff -urNx '*.d' t3d1.2_stock/Tools/projectGenerator/btargets/targets.inc t3d1.2_patched/Tools/projectGenerator/btargets/targets.inc
--- t3d1.2_stock/Tools/projectGenerator/btargets/targets.inc	2011-10-28 15:40:08.000000000 -0500
+++ t3d1.2_patched/Tools/projectGenerator/btargets/targets.inc	2011-12-29 17:15:39.587097168 -0600
@@ -131,7 +131,7 @@
 
 $c->setSolutionInfo( 'makeSolution.tpl', '', '' );
 
-$c->setFileExtensions( 'c', 'cc', 'h', 'cpp', 'inl', 'asm' );
+$c->setFileExtensions( 'c', 'cc', 'cpp', 'asm' );
 
 $c->setPlatforms( "linux" );
 
@@ -153,7 +153,7 @@
 
 $c->setSolutionInfo( 'makeSolution.tpl', '', '' );
 
-$c->setFileExtensions( 'c', 'cc', 'h', 'cpp', 'inl', 'asm' );
+$c->setFileExtensions( 'c', 'cc', 'cpp', 'asm' );
 
 $c->setPlatforms( "linux_dedicated" );
 
@@ -175,7 +175,7 @@
                   '',         				   // ActiveX Project Template
                   '.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?
 $c->setPlatforms("");
diff -urNx '*.d' t3d1.2_stock/Tools/projectGenerator/modules/advancedLighting.inc t3d1.2_patched/Tools/projectGenerator/modules/advancedLighting.inc
--- t3d1.2_stock/Tools/projectGenerator/modules/advancedLighting.inc	2010-02-26 16:33:11.000000000 -0600
+++ t3d1.2_patched/Tools/projectGenerator/modules/advancedLighting.inc	2011-12-29 17:17:45.238764823 -0600
@@ -16,10 +16,12 @@
          addEngineSrcDir( 'lighting/advanced/hlsl' );
          break;
       case "mac":
+      case "linux":
+      case "linux_dedicated":
          addEngineSrcDir( 'lighting/advanced/glsl' );
          break;
    }
 
 endModule();
 
-?>
\ No newline at end of file
+?>
diff -urNx '*.d' t3d1.2_stock/Tools/projectGenerator/modules/core.inc t3d1.2_patched/Tools/projectGenerator/modules/core.inc
--- t3d1.2_stock/Tools/projectGenerator/modules/core.inc	2011-04-22 10:12:28.000000000 -0500
+++ t3d1.2_patched/Tools/projectGenerator/modules/core.inc	2011-12-29 17:20:09.107499704 -0600
@@ -89,8 +89,10 @@
      addEngineSrcDir('windowManager/ps3');
      break;
 
-   case "linux":
    case "linux_dedicated":
+     addEngineSrcDir('windowManager/dedicated');
+
+   case "linux":
      addEngineSrcDir('platformX86UNIX');
      addEngineSrcDir('platformX86UNIX/threads');
      addEngineSrcDir('platformPOSIX');
@@ -114,12 +116,12 @@
       addEngineSrcDir( 'gfx/D3D' );
       addEngineSrcDir( 'gfx/D3D9' );
       addEngineSrcDir( 'gfx/D3D9/pc' );
-      addEngineSrcDir( 'shaderGen/hlsl' );
+      addEngineSrcDir( 'shaderGen/HLSL' );
       break;
    case "360":
       addEngineSrcDir( 'gfx/D3D9' );
       addEngineSrcDir( 'gfx/D3D9/360' );
-      addEngineSrcDir( 'shaderGen/hlsl' );
+      addEngineSrcDir( 'shaderGen/HLSL' );
       addEngineSrcDir( 'shaderGen/360' );
       break;
    case "mac":
@@ -129,8 +131,17 @@
       addEngineSrcDir( 'gfx/gl' );
       addEngineSrcDir( 'gfx/gl/ggl' );
       addEngineSrcDir( 'gfx/gl/ggl/generated' );
-      addEngineSrcDir( 'shaderGen/glsl' );
+      addEngineSrcDir( 'shaderGen/GLSL' );
       break;
+   case "linux":
+   case "linux_dedicated":
+      // GFX - GGL
+      addEngineSrcDir( 'gfx/gl' );
+      addEngineSrcDir( 'gfx/gl/ggl' );
+      addEngineSrcDir( 'gfx/gl/ggl/generated' );
+      addEngineSrcDir( 'shaderGen/GLSL' );
+      break;
+
    case "ps3":
       addEngineSrcDir( 'gfx/gl/ggl/ps3' );
 
@@ -138,7 +149,7 @@
       addEngineSrcDir( 'gfx/gl' );
       addEngineSrcDir( 'gfx/gl/ggl' );
       addEngineSrcDir( 'gfx/gl/ggl/generated' );
-      addEngineSrcDir( 'shaderGen/glsl' );
+      addEngineSrcDir( 'shaderGen/GLSL' );
       break;
 }
 
diff -urNx '*.d' t3d1.2_stock/Tools/projectGenerator/modules/T3D.inc t3d1.2_patched/Tools/projectGenerator/modules/T3D.inc
--- t3d1.2_stock/Tools/projectGenerator/modules/T3D.inc	2011-06-29 01:36:26.000000000 -0500
+++ t3d1.2_patched/Tools/projectGenerator/modules/T3D.inc	2011-12-29 17:21:54.574774448 -0600
@@ -17,7 +17,8 @@
 
 addEngineSrcDir('forest');
 addEngineSrcDir('forest/ts');
-addEngineSrcDir('forest/editor');
+if(getToolBuild())
+   addEngineSrcDir('forest/editor');
 
 addEngineSrcDir('ts');
 addEngineSrcDir('ts/arch');
@@ -63,6 +64,8 @@
       // Fall through
       
    case "mac":
+   case "linux":
+   case "linux_dedicated":
       addEngineSrcDir( 'terrain/glsl' );
       addEngineSrcDir( 'forest/glsl' );
       break;
diff -urNx '*.d' t3d1.2_stock/Tools/projectGenerator/templates/makeAppShared.tpl t3d1.2_patched/Tools/projectGenerator/templates/makeAppShared.tpl
--- t3d1.2_stock/Tools/projectGenerator/templates/makeAppShared.tpl	2009-08-09 16:13:34.000000000 -0500
+++ t3d1.2_patched/Tools/projectGenerator/templates/makeAppShared.tpl	2011-12-29 17:26:22.286898249 -0600
@@ -13,12 +13,13 @@
 
 LDFLAGS := -g -m32
 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}
 
 CFLAGS += -DUNICODE
+CFLAGS += -DLINUX
 
 {foreach item=def from=$projDefines}CFLAGS += -D{$def}
 {/foreach}
@@ -30,7 +31,7 @@
 
 CFLAGS += -O3
 
-#CC := gcc
+CC := gcc
 LD := gcc
 
 APP_TARGETS += $(APPNAME)
diff -urNx '*.d' t3d1.2_stock/Tools/projectGenerator/templates/makeApp.tpl t3d1.2_patched/Tools/projectGenerator/templates/makeApp.tpl
--- t3d1.2_stock/Tools/projectGenerator/templates/makeApp.tpl	2009-08-09 16:13:34.000000000 -0500
+++ t3d1.2_patched/Tools/projectGenerator/templates/makeApp.tpl	2011-12-29 17:27:34.279108362 -0600
@@ -12,13 +12,14 @@
 {/foreach}
 
 LDFLAGS := -g -m32
-LDLIBS := -lstdc++
-CFLAGS := -MMD -I. -Wfatal-errors -m32
+LDLIBS := -lstdc++ -lSDL -lpthread -lrt
+CFLAGS := -MMD -I. -Wfatal-errors -m32 -msse -mmmx -march=i686 -pipe
 
 {foreach item=def from=$projIncludes}CFLAGS += -I{$def}
 {/foreach}
 
-CFLAGS += -DUNICODE;
+CFLAGS += -DUNICODE
+CFLAGS += -DLINUX
 
 {foreach item=def from=$projDefines}CFLAGS += -D{$def}
 {/foreach}
@@ -28,9 +29,9 @@
 CFLAGS_DEBUG += -DTORQUE_DEBUG_GUARD
 CFLAGS_DEBUG += -DTORQUE_NET_STATS
 
-CFLAGS += -O3
+CFLAGS += -O0
 
-#CC := gcc
+CC := gcc
 LD := gcc
 
 APP_TARGETS += $(APPNAME)
diff -urNx '*.d' t3d1.2_stock/Tools/projectGenerator/templates/makeLib.tpl t3d1.2_patched/Tools/projectGenerator/templates/makeLib.tpl
--- t3d1.2_stock/Tools/projectGenerator/templates/makeLib.tpl	2009-08-09 16:13:34.000000000 -0500
+++ t3d1.2_patched/Tools/projectGenerator/templates/makeLib.tpl	2011-12-29 17:28:24.454766114 -0600
@@ -16,12 +16,13 @@
 
 LDFLAGS_{$projName} := -g -m32
 LDLIBS_{$projName} := -lstdc++
-CFLAGS_{$projName} := -MMD -I. -m32
+CFLAGS_{$projName} := -MMD -I. -m32 -msse -mmmx -march=i686
 
 {foreach item=def from=$projIncludes}CFLAGS_{$projName} += -I{$def}
 {/foreach}
 
 CFLAGS_{$projName} += -DUNICODE
+CFLAGS_{$projName} += -DLINUX
 
 {foreach item=def from=$projDefines}CFLAGS_{$projName} += -D{$def}
 {/foreach}
@@ -33,7 +34,7 @@
 
 CFLAGS_{$projName} += -O3
 
-#CC := gcc
+CC := gcc
 LD := gcc
 
 TARGET_{$projName} := {$libDir}/compiled/Make/{$projName}.a
diff -urNx '*.d' t3d1.2_stock/Tools/projectGenerator/templates/makeSolution.tpl t3d1.2_patched/Tools/projectGenerator/templates/makeSolution.tpl
--- t3d1.2_stock/Tools/projectGenerator/templates/makeSolution.tpl	2009-08-09 16:13:34.000000000 -0500
+++ t3d1.2_patched/Tools/projectGenerator/templates/makeSolution.tpl	2011-12-29 17:30:07.366774274 -0600
@@ -3,6 +3,10 @@
 # copyright on the actual sources.
 # 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.
+OPTIONS := --jobs=2
+
 DEPS := 
 LIB_TARGETS :=
 LIB_TARGETS_DEBUG := 
diff -urNx '*.d' t3d1.2_stock/Tools/projectGenerator/templates/makeSo.tpl t3d1.2_patched/Tools/projectGenerator/templates/makeSo.tpl
--- t3d1.2_stock/Tools/projectGenerator/templates/makeSo.tpl	2009-08-11 01:30:26.000000000 -0500
+++ t3d1.2_patched/Tools/projectGenerator/templates/makeSo.tpl	2011-12-29 17:31:02.555047345 -0600
@@ -16,12 +16,13 @@
 
 LDFLAGS_{$projName} := -g -m32 -shared
 LDLIBS_{$projName} := -lstdc++ -lSDL -lpthread
-CFLAGS_{$projName} := -MMD -I. -m32 -mmmx -msse -march=i686 
+CFLAGS_{$projName} := -MMD -I. -m32 -mmmx -msse -march=i686
 
 {foreach item=def from=$projIncludes}CFLAGS_{$projName} += -I{$def}
 {/foreach}
 
 CFLAGS_{$projName} += -DUNICODE
+CFLAGS_{$projName} += -DLINUX
 
 {foreach item=def from=$projDefines}CFLAGS_{$projName} += -D{$def}
 {/foreach}
@@ -33,7 +34,7 @@
 
 CFLAGS_{$projName} += -O3
 
-#CC := gcc
+CC := gcc
 LD := gcc
 
 SHARED_LIB_TARGETS += {$projName}.so
