[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [32392] trunk/blender: enable building the game engine without bullet for scons & cmake

Campbell Barton ideasman42 at gmail.com
Sun Oct 10 09:01:57 CEST 2010


Revision: 32392
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=32392
Author:   campbellbarton
Date:     2010-10-10 09:01:56 +0200 (Sun, 10 Oct 2010)

Log Message:
-----------
enable building the game engine without bullet for scons & cmake

Modified Paths:
--------------
    trunk/blender/CMakeLists.txt
    trunk/blender/source/blender/blenkernel/intern/object.c
    trunk/blender/source/gameengine/CMakeLists.txt
    trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp
    trunk/blender/source/gameengine/Converter/CMakeLists.txt
    trunk/blender/source/gameengine/Converter/SConscript
    trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp
    trunk/blender/source/gameengine/Ketsji/CMakeLists.txt
    trunk/blender/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
    trunk/blender/source/gameengine/Ketsji/KX_BulletPhysicsController.h
    trunk/blender/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h
    trunk/blender/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
    trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp
    trunk/blender/source/gameengine/Ketsji/KX_Light.cpp
    trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp
    trunk/blender/source/gameengine/Ketsji/SConscript
    trunk/blender/source/gameengine/Physics/Bullet/CMakeLists.txt
    trunk/blender/source/gameengine/Physics/Bullet/SConscript
    trunk/blender/source/gameengine/SConscript

Modified: trunk/blender/CMakeLists.txt
===================================================================
--- trunk/blender/CMakeLists.txt	2010-10-09 22:30:01 UTC (rev 32391)
+++ trunk/blender/CMakeLists.txt	2010-10-10 07:01:56 UTC (rev 32392)
@@ -126,9 +126,6 @@
 	OPTION(WITH_LIBS10.5  "Use 10.5 libs (needed for 64bit builds)" OFF)
 ENDIF(APPLE)
 
-IF(NOT WITH_BULLET AND WITH_GAMEENGINE)
-	MESSAGE("WARNING: WITH_GAMEENGINE needs WITH_BULLET")
-ENDIF(NOT WITH_BULLET AND WITH_GAMEENGINE)
 
 IF(NOT WITH_GAMEENGINE AND WITH_PLAYER)
 	MESSAGE("WARNING: WITH_PLAYER needs WITH_GAMEENGINE")

Modified: trunk/blender/source/blender/blenkernel/intern/object.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/object.c	2010-10-09 22:30:01 UTC (rev 32391)
+++ trunk/blender/source/blender/blenkernel/intern/object.c	2010-10-10 07:01:56 UTC (rev 32392)
@@ -1743,7 +1743,7 @@
 static void ob_parcurve(Scene *scene, Object *ob, Object *par, float mat[][4])
 {
 	Curve *cu;
-	float q[4], vec[4], dir[3], quat[4], radius, x1, ctime;
+	float vec[4], dir[3], quat[4], radius, ctime;
 	float timeoffs = 0.0, sf_orig = 0.0;
 	
 	unit_m4(mat);
@@ -1795,6 +1795,7 @@
 
 		if(cu->flag & CU_FOLLOW) {
 #if 0
+			float x1, q[4];
 			vec_to_quat( quat,dir, ob->trackflag, ob->upflag);
 			
 			/* the tilt */

Modified: trunk/blender/source/gameengine/CMakeLists.txt
===================================================================
--- trunk/blender/source/gameengine/CMakeLists.txt	2010-10-09 22:30:01 UTC (rev 32391)
+++ trunk/blender/source/gameengine/CMakeLists.txt	2010-10-10 07:01:56 UTC (rev 32392)
@@ -37,8 +37,11 @@
 ADD_SUBDIRECTORY(Rasterizer)
 ADD_SUBDIRECTORY(Rasterizer/RAS_OpenGLRasterizer)
 ADD_SUBDIRECTORY(SceneGraph)
-ADD_SUBDIRECTORY(Physics/Bullet)
 
+IF(WITH_BULLET)
+	ADD_SUBDIRECTORY(Physics/Bullet)
+ENDIF(WITH_BULLET)
+
 IF(WITH_PYTHON)
 	ADD_SUBDIRECTORY(VideoTexture)
 ENDIF(WITH_PYTHON)

Modified: trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp
===================================================================
--- trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp	2010-10-09 22:30:01 UTC (rev 32391)
+++ trunk/blender/source/gameengine/Converter/BL_BlenderDataConversion.cpp	2010-10-10 07:01:56 UTC (rev 32392)
@@ -1766,9 +1766,11 @@
 			BL_MeshDeformer *dcont = new BL_MeshDeformer((BL_DeformableGameObject*)gameobj,
 														  ob, meshobj);
 			((BL_DeformableGameObject*)gameobj)->SetDeformer(dcont);
+#ifdef USE_BULLET
 		} else if (bHasSoftBody) {
 			KX_SoftBodyDeformer *dcont = new KX_SoftBodyDeformer(meshobj, (BL_DeformableGameObject*)gameobj);
 			((BL_DeformableGameObject*)gameobj)->SetDeformer(dcont);
+#endif
 		}
 		
 		MT_Point3 min = MT_Point3(center) - MT_Vector3(extents);

Modified: trunk/blender/source/gameengine/Converter/CMakeLists.txt
===================================================================
--- trunk/blender/source/gameengine/Converter/CMakeLists.txt	2010-10-09 22:30:01 UTC (rev 32391)
+++ trunk/blender/source/gameengine/Converter/CMakeLists.txt	2010-10-10 07:01:56 UTC (rev 32392)
@@ -69,4 +69,8 @@
 	ADD_DEFINITIONS(-DDISABLE_PYTHON)
 ENDIF(WITH_PYTHON)
 
+IF(WITH_BULLET)
+	ADD_DEFINITIONS(-DUSE_BULLET)
+ENDIF(WITH_BULLET)
+
 BLENDERLIB(bf_converter "${SRC}" "${INC}")

Modified: trunk/blender/source/gameengine/Converter/SConscript
===================================================================
--- trunk/blender/source/gameengine/Converter/SConscript	2010-10-09 22:30:01 UTC (rev 32391)
+++ trunk/blender/source/gameengine/Converter/SConscript	2010-10-10 07:01:56 UTC (rev 32392)
@@ -35,4 +35,7 @@
 if env['WITH_BF_CXX_GUARDEDALLOC']:
     defs.append('WITH_CXX_GUARDEDALLOC')
 
+if env['WITH_BF_BULLET']:
+    defs.append('USE_BULLET')
+
 env.BlenderLib ( 'bf_converter', sources, Split(incs), defs, libtype=['core','player'], priority=[305,40], cxx_compileflags=env['BGE_CXXFLAGS'])

Modified: trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp
===================================================================
--- trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp	2010-10-09 22:30:01 UTC (rev 32391)
+++ trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp	2010-10-10 07:01:56 UTC (rev 32392)
@@ -214,7 +214,7 @@
 	PyErr_Format(PyExc_ValueError, "'%s' not in this python controllers actuator list", _PyUnicode_AsString(value_str));
 	Py_DECREF(value_str);
 	
-	return false;
+	return NULL;
 }
 
 const char* SCA_PythonController::sPyGetCurrentController__doc__ = "getCurrentController()";

Modified: trunk/blender/source/gameengine/Ketsji/CMakeLists.txt
===================================================================
--- trunk/blender/source/gameengine/Ketsji/CMakeLists.txt	2010-10-09 22:30:01 UTC (rev 32391)
+++ trunk/blender/source/gameengine/Ketsji/CMakeLists.txt	2010-10-10 07:01:56 UTC (rev 32392)
@@ -51,13 +51,11 @@
 	../../../source/gameengine/Network
 	../../../source/gameengine/SceneGraph 
 	../../../source/gameengine/Physics/common
-	../../../source/gameengine/Physics/Bullet 
 	../../../source/gameengine/Network/LoopBackNetwork
 	../../../intern/audaspace/intern
 	../../../source/blender/misc 
 	../../../source/blender/blenloader
 	../../../source/blender/gpu
-	../../../extern/bullet2/src
 	../../../extern/glew/include
 )
 
@@ -79,4 +77,10 @@
 	ADD_DEFINITIONS(-DWITH_FFMPEG)
 ENDIF(WITH_FFMPEG)
 
+IF(WITH_BULLET)
+	ADD_DEFINITIONS(-DUSE_BULLET)
+	LIST(APPEND INC ../../../extern/bullet2/src)
+	LIST(APPEND INC ../../../source/gameengine/Physics/Bullet )
+ENDIF(WITH_BULLET)
+
 BLENDERLIB(bf_ketsji "${SRC}" "${INC}")

Modified: trunk/blender/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp	2010-10-09 22:30:01 UTC (rev 32391)
+++ trunk/blender/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp	2010-10-10 07:01:56 UTC (rev 32392)
@@ -521,4 +521,4 @@
 //	return false;
 }
 
-#endif //#ifdef USE_BULLET
+#endif // USE_BULLET

Modified: trunk/blender/source/gameengine/Ketsji/KX_BulletPhysicsController.h
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_BulletPhysicsController.h	2010-10-09 22:30:01 UTC (rev 32391)
+++ trunk/blender/source/gameengine/Ketsji/KX_BulletPhysicsController.h	2010-10-10 07:01:56 UTC (rev 32392)
@@ -3,7 +3,9 @@
 
 
 #include "KX_IPhysicsController.h"
+#ifdef USE_BULLET
 #include "CcdPhysicsController.h"
+#endif
 
 class KX_BulletPhysicsController : public KX_IPhysicsController ,public CcdPhysicsController
 {
@@ -18,9 +20,10 @@
 	btCollisionShape* m_bulletChildShape;
 
 public:
+#ifdef USE_BULLET
 	KX_BulletPhysicsController (const CcdConstructionInfo& ci, bool dyna, bool sensor, bool compound);
 	virtual ~KX_BulletPhysicsController ();
-
+#endif
 	///////////////////////////////////
 	//	KX_IPhysicsController interface
 	////////////////////////////////////

Modified: trunk/blender/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h	2010-10-09 22:30:01 UTC (rev 32391)
+++ trunk/blender/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h	2010-10-10 07:01:56 UTC (rev 32392)
@@ -29,19 +29,6 @@
 #ifndef KX_CONVERTPHYSICSOBJECTS
 #define KX_CONVERTPHYSICSOBJECTS
 
-/* 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_BULLET
-
-//on visual studio 7/8, always enable BULLET for now 
-//you can have multiple physics engines running anyway, and 
-//the scons build system doesn't really support this at the moment.
-//if you got troubles, just comment out USE_BULLET
-#if 1300 <= _MSC_VER
-#define USE_BULLET
-#endif
-
 class RAS_MeshObject;
 class KX_Scene;
 struct DerivedMesh;

Modified: trunk/blender/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp	2010-10-09 22:30:01 UTC (rev 32391)
+++ trunk/blender/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp	2010-10-10 07:01:56 UTC (rev 32392)
@@ -38,7 +38,6 @@
 #include "RAS_MeshObject.h"
 #include "KX_Scene.h"
 #include "SYS_System.h"
-#include "BulletSoftBody/btSoftBody.h"
 
 #include "PHY_Pro.h" //todo cleanup
 #include "KX_ClientObjectInfo.h"
@@ -56,6 +55,7 @@
 }
 
 #ifdef USE_BULLET
+#include "BulletSoftBody/btSoftBody.h"
 
 #include "CcdPhysicsEnvironment.h"
 #include "CcdPhysicsController.h"
@@ -561,4 +561,4 @@
 	spc->ReplaceControllerShape(bm);
 	return true;
 }
-#endif
+#endif // USE_BULLET

Modified: trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp	2010-10-09 22:30:01 UTC (rev 32391)
+++ trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp	2010-10-10 07:01:56 UTC (rev 32392)
@@ -1574,11 +1574,11 @@
 		) {
 		return NULL;
 	}
-	
+#ifdef USE_BULLET
 	/* gameobj and mesh can be NULL */
 	if(KX_ReInstanceBulletShapeFromMesh(this, gameobj, mesh))
 		Py_RETURN_TRUE;
-
+#endif
 	Py_RETURN_FALSE;
 }
 

Modified: trunk/blender/source/gameengine/Ketsji/KX_Light.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_Light.cpp	2010-10-09 22:30:01 UTC (rev 32391)
+++ trunk/blender/source/gameengine/Ketsji/KX_Light.cpp	2010-10-10 07:01:56 UTC (rev 32392)
@@ -180,7 +180,7 @@
 	if(m_glsl)
 		return GPU_lamp_from_blender(m_blenderscene, GetBlenderObject(), GetBlenderGroupObject());
 	else
-		return false;
+		return NULL;
 }
 
 void KX_LightObject::Update()

Modified: trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp
===================================================================
--- trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp	2010-10-09 22:30:01 UTC (rev 32391)
+++ trunk/blender/source/gameengine/Ketsji/KX_Scene.cpp	2010-10-10 07:01:56 UTC (rev 32392)
@@ -82,7 +82,10 @@
 #include "BL_ModifierDeformer.h"
 #include "BL_ShapeDeformer.h"
 #include "BL_DeformableGameObject.h"
+
+#ifdef USE_BULLET
 #include "KX_SoftBodyDeformer.h"
+#endif
 
 // to get USE_BULLET!

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list