Building the game engine with Solid/Sumo is now optional for scons using WITH_BF_SOLID.
authorCampbell Barton <ideasman42@gmail.com>
Wed, 25 Feb 2009 12:07:51 +0000 (12:07 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 25 Feb 2009 12:07:51 +0000 (12:07 +0000)
Now Sumo is has been deprecated for a while we might want to remove it for 2.5.

15 files changed:
SConstruct
extern/SConscript
source/blender/src/SConscript
source/gameengine/BlenderRoutines/SConscript
source/gameengine/Converter/SConscript
source/gameengine/GamePlayer/common/SConscript
source/gameengine/GamePlayer/ghost/SConscript
source/gameengine/Ketsji/KX_ClientObjectInfo.h
source/gameengine/Ketsji/KX_ConvertPhysicsObject.h
source/gameengine/Ketsji/KX_KetsjiEngine.cpp
source/gameengine/Ketsji/KX_NearSensor.cpp
source/gameengine/Ketsji/KX_TouchSensor.cpp
source/gameengine/Ketsji/SConscript
source/gameengine/SConscript
tools/btools.py

index 809166586e6af8a4c891cf40e0714e2de45a2be3..20d8f8fd2ec3203dfb5a515b60ff1f54995d67e5 100644 (file)
@@ -280,6 +280,7 @@ if 'blenderlite' in B.targets:
        env['WITH_BF_PNG'] = False
        env['WITH_BF_ODE'] = False
        env['WITH_BF_BULLET'] = False
+       env['WITH_BF_SOLID'] = False
        env['WITH_BF_BINRELOC'] = False
        env['BF_BUILDINFO'] = False
        env['BF_NO_ELBEEM'] = True
index 4c892e1956dee1eceb5c7ad545cecdba49398fa5..6bc067c0f03a03a04e0b56c0484572b882450792 100644 (file)
@@ -5,8 +5,8 @@ Import('env')
 SConscript(['glew/SConscript'])
 
 if env['WITH_BF_GAMEENGINE']:
-    SConscript(['qhull/SConscript',
-            'solid/SConscript'])
+       if env['WITH_BF_SOLID']:
+               SConscript(['qhull/SConscript', 'solid/SConscript'])
 
 if env['WITH_BF_BULLET']:
     SConscript(['bullet2/src/SConscript'])
index 384ad1b1bf261723475153125d0b55fdd3cd3b2a..2e5dda6c772a86a9ebf34ea0174390a9346812f0 100644 (file)
@@ -70,7 +70,9 @@ if env['WITH_BF_ICONV']:
 
 if env['WITH_BF_GAMEENGINE']:
        defs.append('GAMEBLENDER=1')
-
+       if env['WITH_BF_SOLID']:
+               defs.append('USE_SUMO_SOLID')
+       
 if env['WITH_BF_FFMPEG']:
     defs.append('WITH_FFMPEG')
     incs += ' ' + env['BF_FFMPEG_INC']
index 7a1bf4d9ad613df4b9c631ccd5c125e93d951d92..f2d92384e3ced85b2e5c80bd7e78e70c14567d56 100644 (file)
@@ -2,6 +2,7 @@
 Import ('env')
 
 sources = env.Glob('*.cpp')
+defs = []
 
 incs = '. #source/kernel/gen_system #intern/string #intern/guardedalloc'
 incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer #intern/bmfont'
@@ -12,13 +13,17 @@ incs += ' #source/blender/blenkernel #source/blender #source/blender/include'
 incs += ' #source/blender/makesdna #source/gameengine/Rasterizer #source/gameengine/GameLogic'
 incs += ' #source/gameengine/Expressions #source/gameengine/Network'
 incs += ' #source/gameengine/SceneGraph #source/gameengine/Physics/common'
-incs += ' #source/gameengine/Physics/Bullet #source/gameengine/Physics/Sumo'
-incs += ' #source/gameengine/Physics/Sumo/Fuzzics/include #source/gameengine/Network/LoopBackNetwork'
+incs += ' #source/gameengine/Physics/Bullet'
+incs += ' #source/gameengine/Network/LoopBackNetwork'
 incs += ' #intern/SoundSystem #source/blender/misc #source/blender/blenloader'
 incs += ' #extern/glew/include #source/blender/gpu'
 
+if env['WITH_BF_SOLID']:
+       incs += ' #source/gameengine/Physics/Sumo #source/gameengine/Physics/Sumo/Fuzzics/include'
+       incs += ' ' + env['BF_SOLID_INC']
+       defs.append('USE_SUMO_SOLID')
+
 incs += ' ' + env['BF_PYTHON_INC']
-incs += ' ' + env['BF_SOLID_INC']
 incs += ' ' + env['BF_BULLET_INC']
 incs += ' ' + env['BF_OPENGL_INC']
 
@@ -27,4 +32,4 @@ if env['OURPLATFORM']=='win32-vc':
        cxxflags.append ('/GR')
        cxxflags.append ('/O2')
 
-env.BlenderLib ( 'bf_bloutines', sources, Split(incs), [], libtype=['game', 'game2', 'player'], priority=[0, 0, 55] , cxx_compileflags=cxxflags)
+env.BlenderLib ( 'bf_bloutines', sources, Split(incs), defs, libtype=['game', 'game2', 'player'], priority=[0, 0, 55] , cxx_compileflags=cxxflags)
index 3be352c568b5db0918daef7470a03d483280f604..361dca580054dc57842ba8fed2b415abdfc76b2e 100644 (file)
@@ -2,6 +2,7 @@
 Import ('env')
 
 sources = env.Glob('*.cpp')
+defs = []
 
 incs = '. #source/kernel/gen_system #intern/string #intern/guardedalloc'
 incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer #intern/bmfont'
@@ -14,12 +15,16 @@ incs += ' #source/blender/include #source/blender/makesdna #source/gameengine/Ra
 incs += ' #source/gameengine/Rasterizer/RAS_OpenGLRasterizer #source/gameengine/GameLogic'
 incs += ' #source/gameengine/Expressions #source/gameengine/Network #source/gameengine/SceneGraph'
 incs += ' #source/gameengine/Physics/common #source/gameengine/Physics/Bullet #source/gameengine/Physics/BlOde'
-incs += ' #source/gameengine/Physics/Dummy #source/gameengine/Physics/Sumo'
-incs += ' #source/gameengine/Physics/Sumo/Fuzzics/include #source/gameengine/Network/LoopBackNetwork'
+incs += ' #source/gameengine/Physics/Dummy'
+incs += ' #source/gameengine/Network/LoopBackNetwork'
 incs += ' #source/blender/misc #source/blender/blenloader #source/blender/gpu'
 
+if env['WITH_BF_SOLID']:
+       incs += ' #source/gameengine/Physics/Sumo #source/gameengine/Physics/Sumo/Fuzzics/include'
+       incs += ' ' + env['BF_SOLID_INC']
+       defs.append('USE_SUMO_SOLID')
+
 incs += ' ' + env['BF_PYTHON_INC']
-incs += ' ' + env['BF_SOLID_INC']
 incs += ' ' + env['BF_BULLET_INC']
 
-env.BlenderLib ( 'bf_converter', sources, Split(incs), [], libtype=['game','player'], priority=[5,70] )
+env.BlenderLib ( 'bf_converter', sources, Split(incs), defs, libtype=['game','player'], priority=[5,70] )
index c9bda78d9053c5a91a6d7f4434e5c712dc6d71f0..23ad413350b5507305049895bf814d34bf526317 100644 (file)
@@ -39,15 +39,13 @@ incs = ['.',
         '#source/gameengine/Network',
         '#source/gameengine/SceneGraph',
         '#source/gameengine/Physics/common',
-        '#source/gameengine/Physics/Sumo',
-        '#source/gameengine/Physics/Sumo/Fuzzics/include',
         '#source/gameengine/Network/LoopBackNetwork',
         '#source/gameengine/GamePlayer/ghost',
         '#source/blender/misc',
         '#source/blender/blenloader',
         '#source/blender/gpu',
                '#extern/glew/include']
-                                
+
 #This is all plugin stuff!
 #if sys.platform=='win32':
 #   source_files += ['windows/GPW_Canvas.cpp',
@@ -62,8 +60,12 @@ incs = ['.',
 #                    'unix/GPU_System.cpp']
 #   gp_common_env.Append ( CPPPATH = ['unix'])
 
+if env['WITH_BF_SOLID']:
+       incs.append('#source/gameengine/Physics/Sumo')
+       incs.append('#source/gameengine/Physics/Sumo/Fuzzics/include')
+       incs += Split(env['BF_SOLID_INC'])
+
 incs += Split(env['BF_PYTHON_INC'])
-incs += Split(env['BF_SOLID_INC'])
 incs += Split(env['BF_PNG_INC'])
 incs += Split(env['BF_ZLIB_INC'])
 
index 0785ce4bd0d543609e8a0e478fa14b944a6d6749..dd8761e0a453d8b09975a8c397a4e8b993f536bc 100644 (file)
@@ -34,8 +34,6 @@ incs = ['.',
         '#source/gameengine/Network',
         '#source/gameengine/SceneGraph',
         '#source/gameengine/Physics/common',
-        '#source/gameengine/Physics/Sumo',
-        '#source/gameengine/Physics/Sumo/Fuzzics/include',
         '#source/gameengine/Network/LoopBackNetwork',
         '#source/gameengine/GamePlayer/common',
         '#source/blender/misc',
@@ -43,8 +41,11 @@ incs = ['.',
         '#source/blender/gpu',
         '#extern/glew/include']
 
+if env['WITH_BF_SOLID']:
+       incs.append(['#source/gameengine/Physics/Sumo', '#source/gameengine/Physics/Sumo/Fuzzics/include'])
+       incs += Split(env['BF_SOLID_INC'])
+
 incs += Split(env['BF_PYTHON_INC'])
-incs += Split(env['BF_SOLID_INC'])
 
 cxxflags = []
 if env['OURPLATFORM']=='win32-vc':
index 5e8af0f040c933d16f5725a043f481d85cff921e..7345edb054bbe0b9237e3c3176c6274b7198385a 100644 (file)
 #ifndef __KX_CLIENTOBJECT_INFO_H
 #define __KX_CLIENTOBJECT_INFO_H
 
+/* Note, the way this works with/without sumo is a bit odd */
+#ifdef USE_SUMO_SOLID
 #include <SM_Object.h>
+#endif //USE_SUMO_SOLID
 
 #include <list>
 
@@ -38,7 +41,10 @@ class KX_GameObject;
 /**
  * Client Type and Additional Info. This structure can be use instead of a bare void* pointer, for safeness, and additional info for callbacks
  */
-struct KX_ClientObjectInfo : public SM_ClientObject
+struct KX_ClientObjectInfo
+#ifdef USE_SUMO_SOLID
+  : public SM_ClientObject
+#endif
 {
        enum clienttype {
                STATIC,
@@ -52,14 +58,18 @@ struct KX_ClientObjectInfo : public SM_ClientObject
        std::list<SCA_ISensor*> m_sensors;
 public:
        KX_ClientObjectInfo(KX_GameObject *gameobject, clienttype type = STATIC, void *auxilary_info = NULL) :
+#ifdef USE_SUMO_SOLID
                SM_ClientObject(),
+#endif
                m_type(type),
                m_gameobject(gameobject),
                m_auxilary_info(auxilary_info)
        {}
        
-       KX_ClientObjectInfo(const KX_ClientObjectInfo &copy)
-               : SM_ClientObject(copy),
+       KX_ClientObjectInfo(const KX_ClientObjectInfo &copy) :
+#ifdef USE_SUMO_SOLID          
+                 SM_ClientObject(copy),
+#endif
                  m_type(copy.m_type),
                  m_gameobject(copy.m_gameobject),
                  m_auxilary_info(copy.m_auxilary_info)
index 53486cecf732342e270b65e657b70e1a59ec7d58..edacf38ab4316e52cf75f0d2a46adffb47398e78 100644 (file)
@@ -32,7 +32,7 @@
 /* These are defined by the build system... */
 //but the build system is broken, because it doesn't allow for 2 or more defines at once.
 //Please leave Sumo _AND_ Bullet enabled
-#define USE_SUMO_SOLID
+//#define USE_SUMO_SOLID // scons defines this
 #define USE_BULLET
 
 //#define USE_ODE
index 074b31951217f97c47de2d4cce52ca572652f1df..87f348799df9e0e19a91e00768b19fbae991991c 100644 (file)
 #include "KX_PythonInit.h"
 #include "KX_PyConstraintBinding.h"
 #include "PHY_IPhysicsEnvironment.h"
+
+#ifdef USE_SUMO_SOLID
 #include "SumoPhysicsEnvironment.h"
+#endif
 
 #include "SND_Scene.h"
 #include "SND_IAudioDevice.h"
index fb38f16c1699b00a2448cb28e338ec4745d5bb1b..5b1df8b1fe140fb4e75c70633de412e05c62ec51 100644 (file)
@@ -37,7 +37,6 @@
 #include "PHY_IPhysicsEnvironment.h"
 #include "PHY_IPhysicsController.h"
 
-
 #ifdef HAVE_CONFIG_H
 #include <config.h>
 #endif
@@ -272,7 +271,7 @@ bool        KX_NearSensor::NewHandleCollision(void* obj1,void* obj2,const PHY_CollData
                //}
        }
        
-       return DT_CONTINUE;
+       return false; // was DT_CONTINUE; but this was defined in Sumo as false
 }
 
 
index 117adb4474260b5067ec97fea53d6756edd1ff95..0b4d66dbb3444704c542a4663fa08f5edd989a6d 100644 (file)
@@ -34,7 +34,9 @@
 #include "SCA_LogicManager.h"
 #include "KX_GameObject.h"
 #include "KX_TouchEventManager.h"
-#include "KX_SumoPhysicsController.h"
+
+#include "PHY_IPhysicsController.h"
+
 #include <iostream>
 #include "PHY_IPhysicsEnvironment.h"
 
@@ -214,7 +216,7 @@ bool        KX_TouchSensor::NewHandleCollision(void*object1,void*object2,const PHY_Coll
                }
                
        } 
-       return DT_CONTINUE;
+       return false; // was DT_CONTINUE but this was defined in sumo as false.
 }
 
 
index 40cbc35e7f39bc216b69ded75c796302bf5c928c..5989d9d8b52d50d07b2b2eba707d0c3f61473d56 100644 (file)
@@ -31,11 +31,15 @@ incs += ' #source/blender/makesdna #source/blender/python #source/gameengine/Ras
 incs += ' #source/gameengine/GameLogic #source/gameengine/Expressions #source/gameengine/Network'
 incs += ' #source/gameengine/SceneGraph #source/gameengine/Physics/common #source/gameengine/Physics/Bullet'
 incs += ' #source/gameengine/Physics/BlOde #source/gameengine/Physics/Dummy'
-incs += ' #source/gameengine/Physics/Sumo #source/gameengine/Physics/Sumo/include'
-incs += ' #source/gameengine/Physics/Sumo/Fuzzics/include #source/gameengine/Network/LoopBackNetwork'
 incs += ' #source/blender/misc #source/blender/blenloader #extern/glew/include #source/blender/gpu'
 
-incs += ' ' + env['BF_SOLID_INC']
+if env['WITH_BF_SOLID']:
+       incs += ' #source/gameengine/Physics/Sumo #source/gameengine/Physics/Sumo/include'
+       incs += ' #source/gameengine/Physics/Sumo/Fuzzics/include #source/gameengine/Network/LoopBackNetwork'
+       incs += ' ' + env['BF_SOLID_INC']
+       defs += ' USE_SUMO_SOLID'
+
+
 incs += ' ' + env['BF_PYTHON_INC']
 incs += ' ' + env['BF_BULLET_INC']
 incs += ' ' + env['BF_OPENGL_INC']
index e841f206eee47cb1bf5feb9e0eb3b93853aebed5..51a05e70a07dc0aa60c4d9f5c8f301a8e420e2d2 100644 (file)
@@ -15,10 +15,12 @@ SConscript(['BlenderRoutines/SConscript',
             'Rasterizer/RAS_OpenGLRasterizer/SConscript',
             'SceneGraph/SConscript',
             'Physics/Bullet/SConscript',
-            'Physics/Sumo/SConscript',
             'VideoTexture/SConscript'
             ])
 
+if env['WITH_BF_SOLID']:
+       SConscript(['Physics/Sumo/SConscript'])
+
 if env['WITH_BF_PLAYER']:
     SConscript(['GamePlayer/SConscript'])
 
index 21ab547b11af5c024f79aa6b566ff637555b79a0..79f4717a262a821dc5c6df298bb11752968a7e86 100755 (executable)
@@ -44,7 +44,7 @@ def validate_arguments(args, bc):
                        'BF_GETTEXT', 'BF_GETTEXT_INC', 'BF_GETTEXT_LIB', 'BF_GETTEXT_LIBPATH',
                        'WITH_BF_ICONV', 'BF_ICONV', 'BF_ICONV_INC', 'BF_ICONV_LIB', 'BF_ICONV_LIBPATH',
                        'WITH_BF_ODE', 'BF_ODE', 'BF_ODE_INC', 'BF_ODE_LIB',
-                       'WITH_BF_GAMEENGINE', 'WITH_BF_BULLET', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB',
+                       'WITH_BF_GAMEENGINE', 'WITH_BF_SOLID', 'WITH_BF_BULLET', 'BF_BULLET', 'BF_BULLET_INC', 'BF_BULLET_LIB',
                        'BF_SOLID', 'BF_SOLID_INC', 'BF_WINTAB', 'BF_WINTAB_INC',
                        'WITH_BF_YAFRAY',
                        'WITH_BF_FREETYPE', 'BF_FREETYPE', 'BF_FREETYPE_INC', 'BF_FREETYPE_LIB', 'BF_FREETYPE_LIBPATH',
@@ -276,6 +276,7 @@ def read_opts(cfg, args):
                ('BF_BULLET_INC', 'Bullet include path', ''),
                ('BF_BULLET_LIB', 'Bullet library', ''),
                
+               (BoolVariable('WITH_BF_SOLID', 'Use Sumo/Solid deprecated physics system if true', True)),
                ('BF_SOLID', 'Solid base dir', '#/extern/solid'),
                ('BF_SOLID_INC', 'Solid include path', ''),
                ('BF_WINTAB', 'WinTab base dir', ''),