diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-01-23 11:26:39 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-01-23 11:26:39 +0400 |
commit | 69ddc5eb99d36c7d2cf86a7537a3784d3c72777e (patch) | |
tree | 2346cd60891c2015fc59a30576d0c99b072712cc /source/gameengine | |
parent | 4544c234f5baf386eae9ffd98994f9905a285aaa (diff) |
make bullet optional again
Diffstat (limited to 'source/gameengine')
17 files changed, 41 insertions, 41 deletions
diff --git a/source/gameengine/BlenderRoutines/CMakeLists.txt b/source/gameengine/BlenderRoutines/CMakeLists.txt index d833534605b..32efc5bde21 100644 --- a/source/gameengine/BlenderRoutines/CMakeLists.txt +++ b/source/gameengine/BlenderRoutines/CMakeLists.txt @@ -73,7 +73,7 @@ if(WITH_BULLET) list(APPEND INC_SYS ${BULLET_INCLUDE_DIRS} ) - add_definitions(-DUSE_BULLET) + add_definitions(-DWITH_BULLET) endif() diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 9267b2b9fed..409a3bfec8f 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -164,7 +164,7 @@ extern Material defmaterial; /* material.c */ #include "SG_Tree.h" #include "KX_ConvertPhysicsObject.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "CcdPhysicsEnvironment.h" #include "CcdGraphicController.h" #endif @@ -1526,7 +1526,7 @@ static void BL_CreateGraphicObjectNew(KX_GameObject* gameobj, { switch (physics_engine) { -#ifdef USE_BULLET +#ifdef WITH_BULLET case UseBullet: { CcdPhysicsEnvironment* env = (CcdPhysicsEnvironment*)kxscene->GetPhysicsEnvironment(); @@ -1829,7 +1829,7 @@ static void BL_CreatePhysicsObjectNew(KX_GameObject* gameobj, switch (physics_engine) { -#ifdef USE_BULLET +#ifdef WITH_BULLET case UseBullet: KX_ConvertBulletObject(gameobj, meshobj, dm, kxscene, shapeprops, smmaterial, &objprop); break; @@ -1980,7 +1980,7 @@ static KX_GameObject *gameobject_from_blenderobject( bool bHasDvert = mesh->dvert != NULL && ob->defbase.first; bool bHasArmature = (BL_ModifierDeformer::HasArmatureDeformer(ob) && ob->parent && ob->parent->type == OB_ARMATURE && bHasDvert); bool bHasModifier = BL_ModifierDeformer::HasCompatibleDeformer(ob); -#ifdef USE_BULLET +#ifdef WITH_BULLET bool bHasSoftBody = (!ob->parent && (ob->gameflag & OB_SOFT_BODY)); #endif if (bHasModifier) { @@ -2007,7 +2007,7 @@ static KX_GameObject *gameobject_from_blenderobject( BL_MeshDeformer *dcont = new BL_MeshDeformer((BL_DeformableGameObject*)gameobj, ob, meshobj); ((BL_DeformableGameObject*)gameobj)->SetDeformer(dcont); -#ifdef USE_BULLET +#ifdef WITH_BULLET } else if (bHasSoftBody) { KX_SoftBodyDeformer *dcont = new KX_SoftBodyDeformer(meshobj, (BL_DeformableGameObject*)gameobj); ((BL_DeformableGameObject*)gameobj)->SetDeformer(dcont); diff --git a/source/gameengine/Converter/CMakeLists.txt b/source/gameengine/Converter/CMakeLists.txt index 8ac9e523d5d..38c0d71d24d 100644 --- a/source/gameengine/Converter/CMakeLists.txt +++ b/source/gameengine/Converter/CMakeLists.txt @@ -114,7 +114,7 @@ if(WITH_BULLET) list(APPEND INC_SYS ${BULLET_INCLUDE_DIRS} ) - add_definitions(-DUSE_BULLET) + add_definitions(-DWITH_BULLET) endif() if(WITH_AUDASPACE) diff --git a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp index 5524612f707..376f75959ed 100644 --- a/source/gameengine/Converter/KX_BlenderSceneConverter.cpp +++ b/source/gameengine/Converter/KX_BlenderSceneConverter.cpp @@ -55,7 +55,7 @@ #include "KX_ConvertPhysicsObject.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "CcdPhysicsEnvironment.h" #endif @@ -193,7 +193,7 @@ KX_BlenderSceneConverter::~KX_BlenderSceneConverter() itm++; } -#ifdef USE_BULLET +#ifdef WITH_BULLET KX_ClearBulletSharedShapes(); #endif @@ -254,7 +254,7 @@ Scene *KX_BlenderSceneConverter::GetBlenderSceneForName(const STR_String& name) } #include "KX_PythonInit.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "LinearMath/btIDebugDraw.h" @@ -348,7 +348,7 @@ void KX_BlenderSceneConverter::ConvertScene(class KX_Scene* destinationscene, switch (physics_engine) { -#ifdef USE_BULLET +#ifdef WITH_BULLET case UseBullet: { CcdPhysicsEnvironment* ccdPhysEnv = new CcdPhysicsEnvironment(useDbvtCulling); @@ -398,7 +398,7 @@ void KX_BlenderSceneConverter::ConvertScene(class KX_Scene* destinationscene, //that would result from this is fixed in RemoveScene() m_map_mesh_to_gamemesh.clear(); -#ifndef USE_BULLET +#ifndef WITH_BULLET /* quiet compiler warning */ (void)useDbvtCulling; #endif diff --git a/source/gameengine/Converter/KX_SoftBodyDeformer.cpp b/source/gameengine/Converter/KX_SoftBodyDeformer.cpp index 72d0c8733f2..d860b2ee694 100644 --- a/source/gameengine/Converter/KX_SoftBodyDeformer.cpp +++ b/source/gameengine/Converter/KX_SoftBodyDeformer.cpp @@ -42,7 +42,7 @@ #include "CTR_Map.h" #include "CTR_HashedPtr.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "CcdPhysicsEnvironment.h" #include "CcdPhysicsController.h" diff --git a/source/gameengine/Converter/SConscript b/source/gameengine/Converter/SConscript index 28ad742545e..ef546ce1b19 100644 --- a/source/gameengine/Converter/SConscript +++ b/source/gameengine/Converter/SConscript @@ -64,7 +64,7 @@ if env['WITH_BF_CXX_GUARDEDALLOC']: defs.append('WITH_CXX_GUARDEDALLOC') if env['WITH_BF_BULLET']: - defs.append('USE_BULLET') + defs.append('WITH_BULLET') if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): incs += ' ' + env['BF_PTHREADS_INC'] diff --git a/source/gameengine/Ketsji/CMakeLists.txt b/source/gameengine/Ketsji/CMakeLists.txt index e42c2a74a8e..fc322d80cd0 100644 --- a/source/gameengine/Ketsji/CMakeLists.txt +++ b/source/gameengine/Ketsji/CMakeLists.txt @@ -254,7 +254,7 @@ if(WITH_BULLET) list(APPEND INC ${BULLET_INCLUDE_DIRS} ) - add_definitions(-DUSE_BULLET) + add_definitions(-DWITH_BULLET) endif() blender_add_lib(ge_logic_ketsji "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp index 20c41b95dd3..6ef0aed9fe2 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.cpp @@ -4,7 +4,7 @@ //under visual studio the #define in KX_ConvertPhysicsObject.h is quicker for recompilation #include "KX_ConvertPhysicsObject.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "KX_BulletPhysicsController.h" @@ -536,4 +536,4 @@ const char* KX_BulletPhysicsController::getName() return 0; } -#endif // USE_BULLET +#endif // WITH_BULLET diff --git a/source/gameengine/Ketsji/KX_BulletPhysicsController.h b/source/gameengine/Ketsji/KX_BulletPhysicsController.h index 4813b39a34e..aa42bf61a78 100644 --- a/source/gameengine/Ketsji/KX_BulletPhysicsController.h +++ b/source/gameengine/Ketsji/KX_BulletPhysicsController.h @@ -8,7 +8,7 @@ #include "KX_IPhysicsController.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "CcdPhysicsController.h" #endif @@ -25,7 +25,7 @@ private: btCollisionShape* m_bulletChildShape; public: -#ifdef USE_BULLET +#ifdef WITH_BULLET KX_BulletPhysicsController (const CcdConstructionInfo& ci, bool dyna, bool sensor, bool character, bool compound); virtual ~KX_BulletPhysicsController (); #endif diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h b/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h index e71037d08a0..903966b79be 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObject.h @@ -145,7 +145,7 @@ void KX_ConvertDynamoObject(KX_GameObject* gameobj, struct KX_ObjectProperties* objprop); -#ifdef USE_BULLET +#ifdef WITH_BULLET void KX_ConvertBulletObject( class KX_GameObject* gameobj, class RAS_MeshObject* meshobj, diff --git a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp index ff3c46cb8ab..4a5a1704979 100644 --- a/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp +++ b/source/gameengine/Ketsji/KX_ConvertPhysicsObjects.cpp @@ -58,7 +58,7 @@ extern "C"{ #include "BKE_DerivedMesh.h" } -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "BulletSoftBody/btSoftBody.h" #include "CcdPhysicsEnvironment.h" @@ -574,4 +574,4 @@ bool KX_ReInstanceBulletShapeFromMesh(KX_GameObject *gameobj, KX_GameObject *fro spc->ReplaceControllerShape(bm); return true; } -#endif // USE_BULLET +#endif // WITH_BULLET diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index eec45669e04..63854c6aebd 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -1777,7 +1777,7 @@ PyObject *KX_GameObject::PyReinstancePhysicsMesh(PyObject *args) ) { return NULL; } -#ifdef USE_BULLET +#ifdef WITH_BULLET /* gameobj and mesh can be NULL */ if (KX_ReInstanceBulletShapeFromMesh(this, gameobj, mesh)) Py_RETURN_TRUE; diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp index 9bb09d56de6..2e9b988dff1 100644 --- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp +++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp @@ -43,7 +43,7 @@ #include "PyObjectPlus.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET # include "LinearMath/btIDebugDraw.h" #endif @@ -716,7 +716,7 @@ PyObject *initPythonConstraintBinding() PyDict_SetItemString(d, "error", ErrorObject); Py_DECREF(ErrorObject); -#ifdef USE_BULLET +#ifdef WITH_BULLET //Debug Modes constants to be used with setDebugMode() python function KX_MACRO_addTypesToDict(d, DBG_NODEBUG, btIDebugDraw::DBG_NoDebug); KX_MACRO_addTypesToDict(d, DBG_DRAWWIREFRAME, btIDebugDraw::DBG_DrawWireframe); @@ -732,7 +732,7 @@ PyObject *initPythonConstraintBinding() KX_MACRO_addTypesToDict(d, DBG_DRAWCONSTRAINTS, btIDebugDraw::DBG_DrawConstraints); KX_MACRO_addTypesToDict(d, DBG_DRAWCONSTRAINTLIMITS, btIDebugDraw::DBG_DrawConstraintLimits); KX_MACRO_addTypesToDict(d, DBG_FASTWIREFRAME, btIDebugDraw::DBG_FastWireframe); -#endif // USE_BULLET +#endif // WITH_BULLET //Constraint types to be used with createConstraint() python function KX_MACRO_addTypesToDict(d, POINTTOPOINT_CONSTRAINT, PHY_POINT2POINT_CONSTRAINT); diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 55c9ff5307f..bb2f9a8354a 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -88,7 +88,7 @@ #include "BL_DeformableGameObject.h" #include "KX_ObstacleSimulation.h" -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "KX_SoftBodyDeformer.h" #include "KX_ConvertPhysicsObject.h" #include "CcdPhysicsEnvironment.h" @@ -1131,7 +1131,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u blendobj->parent && // original object had armature (not sure this test is needed) blendobj->parent->type == OB_ARMATURE && blendmesh->dvert!=NULL; // mesh has vertex group -#ifdef USE_BULLET +#ifdef WITH_BULLET bool bHasSoftBody = (!parentobj && (blendobj->gameflag & OB_SOFT_BODY)); #endif bool releaseParent = true; @@ -1222,7 +1222,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u ); newobj->SetDeformer(meshdeformer); } -#ifdef USE_BULLET +#ifdef WITH_BULLET else if (bHasSoftBody) { KX_SoftBodyDeformer *softdeformer = new KX_SoftBodyDeformer(mesh, newobj); @@ -1239,7 +1239,7 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u gameobj->AddMeshUser(); } -#ifdef USE_BULLET +#ifdef WITH_BULLET if (use_phys) { /* update the new assigned mesh with the physics mesh */ KX_ReInstanceBulletShapeFromMesh(gameobj, NULL, use_gfx?NULL:mesh); } @@ -1756,7 +1756,7 @@ short KX_Scene::GetAnimationFPS() return m_blenderScene->r.frs_sec; } -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "KX_BulletPhysicsController.h" #endif @@ -1768,7 +1768,7 @@ static void MergeScene_LogicBrick(SCA_ILogicBrick* brick, KX_Scene *to) brick->Replace_NetworkScene(to->GetNetworkScene()); /* near sensors have physics controllers */ -#ifdef USE_BULLET +#ifdef WITH_BULLET KX_TouchSensor *touch_sensor = dynamic_cast<class KX_TouchSensor *>(brick); if (touch_sensor) { touch_sensor->GetPhysicsController()->SetPhysicsEnvironment(to->GetPhysicsEnvironment()); @@ -1789,7 +1789,7 @@ static void MergeScene_LogicBrick(SCA_ILogicBrick* brick, KX_Scene *to) } } -#ifdef USE_BULLET +#ifdef WITH_BULLET #include "CcdGraphicController.h" // XXX ctrl->SetPhysicsEnvironment(to->GetPhysicsEnvironment()); #include "CcdPhysicsEnvironment.h" // XXX ctrl->SetPhysicsEnvironment(to->GetPhysicsEnvironment()); #include "KX_BulletPhysicsController.h" @@ -1858,7 +1858,7 @@ static void MergeScene_GameObject(KX_GameObject* gameobj, KX_Scene *to, KX_Scene for (int i=0; i<children.size(); i++) children[i]->SetSGClientInfo(to); } -#ifdef USE_BULLET +#ifdef WITH_BULLET SGControllerList::iterator contit; SGControllerList& controllers = sg->GetSGControllerList(); for (contit = controllers.begin();contit!=controllers.end();++contit) @@ -1867,7 +1867,7 @@ static void MergeScene_GameObject(KX_GameObject* gameobj, KX_Scene *to, KX_Scene if (phys_ctrl) phys_ctrl->SetPhysicsEnvironment(to->GetPhysicsEnvironment()); } -#endif // USE_BULLET +#endif // WITH_BULLET } /* If the object is a light, update it's scene */ if (gameobj->GetGameObjectType() == SCA_IObject::OBJ_LIGHT) @@ -1886,7 +1886,7 @@ static void MergeScene_GameObject(KX_GameObject* gameobj, KX_Scene *to, KX_Scene bool KX_Scene::MergeScene(KX_Scene *other) { -#ifdef USE_BULLET +#ifdef WITH_BULLET CcdPhysicsEnvironment *env= dynamic_cast<CcdPhysicsEnvironment *>(this->GetPhysicsEnvironment()); CcdPhysicsEnvironment *env_other= dynamic_cast<CcdPhysicsEnvironment *>(other->GetPhysicsEnvironment()); @@ -1896,7 +1896,7 @@ bool KX_Scene::MergeScene(KX_Scene *other) printf("\tsource %d, terget %d\n", (int)(env!=NULL), (int)(env_other!=NULL)); return false; } -#endif // USE_BULLET +#endif // WITH_BULLET if (GetSceneConverter() != other->GetSceneConverter()) { printf("KX_Scene::MergeScene: converters differ, aborting\n"); @@ -1939,7 +1939,7 @@ bool KX_Scene::MergeScene(KX_Scene *other) GetLightList()->MergeList(other->GetLightList()); other->GetLightList()->ReleaseAndRemoveAll(); -#ifdef USE_BULLET +#ifdef WITH_BULLET if (env) /* bullet scene? - dummy scenes don't need touching */ env->MergeEnvironment(env_other); #endif diff --git a/source/gameengine/Ketsji/SConscript b/source/gameengine/Ketsji/SConscript index da1a72b4758..0690bdd6538 100644 --- a/source/gameengine/Ketsji/SConscript +++ b/source/gameengine/Ketsji/SConscript @@ -71,7 +71,7 @@ if env['WITH_BF_CXX_GUARDEDALLOC']: defs.append('WITH_CXX_GUARDEDALLOC') if env['WITH_BF_BULLET']: - defs.append('USE_BULLET') + defs.append('WITH_BULLET') incs += ' #source/gameengine/Physics/Bullet' if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'): diff --git a/source/gameengine/Physics/Bullet/CMakeLists.txt b/source/gameengine/Physics/Bullet/CMakeLists.txt index afb166eee57..c5b601361d9 100644 --- a/source/gameengine/Physics/Bullet/CMakeLists.txt +++ b/source/gameengine/Physics/Bullet/CMakeLists.txt @@ -62,7 +62,7 @@ if(WITH_BULLET) list(APPEND INC ${BULLET_INCLUDE_DIRS} ) - add_definitions(-DUSE_BULLET) + add_definitions(-DWITH_BULLET) endif() blender_add_lib(ge_phys_bullet "${SRC}" "${INC}" "${INC_SYS}") diff --git a/source/gameengine/Physics/Bullet/SConscript b/source/gameengine/Physics/Bullet/SConscript index 83239cf979a..6ef2750e8d6 100644 --- a/source/gameengine/Physics/Bullet/SConscript +++ b/source/gameengine/Physics/Bullet/SConscript @@ -56,6 +56,6 @@ if env['WITH_BF_CXX_GUARDEDALLOC']: defs.append('WITH_CXX_GUARDEDALLOC') if env['WITH_BF_BULLET']: - defs.append('USE_BULLET') + defs.append('WITH_BULLET') env.BlenderLib ( 'ge_phys_bullet', Split(sources), Split(incs), defs, libtype=['core','player'], priority=[350,50], cxx_compileflags=env['BGE_CXXFLAGS']) |