From 95e08f6bff272162f2199744842a198742c35de2 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sun, 2 Aug 2009 23:53:53 +0000 Subject: [PATCH 1/3] * remove unused member of KX_Scene - m_objecttree * implicit declaration of getenv in glutil.c --- source/blender/src/glutil.c | 5 +++++ source/gameengine/Ketsji/KX_Scene.cpp | 5 ----- source/gameengine/Ketsji/KX_Scene.h | 4 ---- 3 files changed, 5 insertions(+), 9 deletions(-) diff --git a/source/blender/src/glutil.c b/source/blender/src/glutil.c index bb9b1be08b6..0772478be2d 100644 --- a/source/blender/src/glutil.c +++ b/source/blender/src/glutil.c @@ -33,6 +33,11 @@ #include #include +/* getenv only */ +#ifdef __linux__ +#include +#endif + #include "MEM_guardedalloc.h" #include "DNA_vec_types.h" diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index caab0f38db9..0aeccbcaaad 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -1577,11 +1577,6 @@ void KX_Scene::SetGravity(const MT_Vector3& gravity) GetPhysicsEnvironment()->setGravity(gravity[0],gravity[1],gravity[2]); } -void KX_Scene::SetNodeTree(SG_Tree* root) -{ - m_objecttree = root; -} - void KX_Scene::SetSceneConverter(class KX_BlenderSceneConverter* sceneConverter) { m_sceneConverter = sceneConverter; diff --git a/source/gameengine/Ketsji/KX_Scene.h b/source/gameengine/Ketsji/KX_Scene.h index c4f868f6a02..09fad7040a8 100644 --- a/source/gameengine/Ketsji/KX_Scene.h +++ b/source/gameengine/Ketsji/KX_Scene.h @@ -119,10 +119,6 @@ protected: // the Qlist is for objects that needs to be rescheduled // for updates after udpate is over (slow parent, bone parent) - /** - * The tree of objects in the scene. - */ - SG_Tree* m_objecttree; /** * The set of cameras for this scene From d595f6f2034ff9b74064975f351b7c42a8c651ac Mon Sep 17 00:00:00 2001 From: Nathan Letwory Date: Tue, 4 Aug 2009 01:05:31 +0000 Subject: [PATCH 2/3] * apparently I forgot to update this one for the python zip copying business. Thanks to JMS for spotting. --- SConstruct | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SConstruct b/SConstruct index de669e3a95c..7bec9827364 100644 --- a/SConstruct +++ b/SConstruct @@ -554,8 +554,8 @@ if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw'): if env['WITH_BF_PYTHON']: ver = env["BF_PYTHON_VERSION"].replace(".", "") - dllsources.append('#release/windows/extra/python' + ver + '.zip') - dllsources.append('#release/windows/extra/zlib.pyd') + dllsources.append('${LCGDIR}/release/python' + ver + '.zip') + dllsources.append('${LCGDIR}/release/zlib.pyd') if env['BF_DEBUG']: dllsources.append('${BF_PYTHON_LIBPATH}/${BF_PYTHON_LIB}_d.dll') else: From 856dba000b09409bf6da2865bca2c79dba378683 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Tue, 4 Aug 2009 05:14:10 +0000 Subject: [PATCH 3/3] no need to store the physics env in each KX_GameObject --- .../Converter/BL_BlenderDataConversion.cpp | 1 - .../gameengine/Ketsji/KX_ConstraintActuator.cpp | 5 +++-- source/gameengine/Ketsji/KX_GameObject.cpp | 6 ++---- source/gameengine/Ketsji/KX_GameObject.h | 16 ---------------- .../gameengine/Rasterizer/RAS_BucketManager.cpp | 9 ++------- 5 files changed, 7 insertions(+), 30 deletions(-) diff --git a/source/gameengine/Converter/BL_BlenderDataConversion.cpp b/source/gameengine/Converter/BL_BlenderDataConversion.cpp index 7a902a72795..d27c544ccb4 100644 --- a/source/gameengine/Converter/BL_BlenderDataConversion.cpp +++ b/source/gameengine/Converter/BL_BlenderDataConversion.cpp @@ -1806,7 +1806,6 @@ static KX_GameObject *gameobject_from_blenderobject( } if (gameobj) { - gameobj->SetPhysicsEnvironment(kxscene->GetPhysicsEnvironment()); gameobj->SetLayer(ob->lay); gameobj->SetBlenderObject(ob); /* set the visibility state based on the objects render option in the outliner */ diff --git a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp index 6f66faaeafb..c90f4e23316 100644 --- a/source/gameengine/Ketsji/KX_ConstraintActuator.cpp +++ b/source/gameengine/Ketsji/KX_ConstraintActuator.cpp @@ -36,6 +36,7 @@ #include "MT_Matrix3x3.h" #include "KX_GameObject.h" #include "KX_RayCast.h" +#include "KX_PythonInit.h" // KX_GetActiveScene #include "blendef.h" #ifdef HAVE_CONFIG_H @@ -329,7 +330,7 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame) } { MT_Point3 topoint = position + (m_maximumBound) * direction; - PHY_IPhysicsEnvironment* pe = obj->GetPhysicsEnvironment(); + PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment(); KX_IPhysicsController *spc = obj->GetPhysicsController(); if (!pe) { @@ -442,7 +443,7 @@ bool KX_ConstraintActuator::Update(double curtime, bool frame) } normal.normalize(); { - PHY_IPhysicsEnvironment* pe = obj->GetPhysicsEnvironment(); + PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment(); KX_IPhysicsController *spc = obj->GetPhysicsController(); if (!pe) { diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp index e9263ee62e0..d04174a32aa 100644 --- a/source/gameengine/Ketsji/KX_GameObject.cpp +++ b/source/gameengine/Ketsji/KX_GameObject.cpp @@ -103,7 +103,6 @@ KX_GameObject::KX_GameObject( m_bOccluder(false), m_pPhysicsController1(NULL), m_pGraphicController(NULL), - m_pPhysicsEnvironment(NULL), m_xray(false), m_pHitObject(NULL), m_isDeformable(false), @@ -2604,8 +2603,7 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCastTo, toDir.normalize(); toPoint = fromPoint + (dist) * toDir; } - - PHY_IPhysicsEnvironment* pe = GetPhysicsEnvironment(); + PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment(); KX_IPhysicsController *spc = GetPhysicsController(); KX_GameObject *parent = GetParent(); if (!spc && parent) @@ -2732,7 +2730,7 @@ KX_PYMETHODDEF_DOC(KX_GameObject, rayCast, return none_tuple_3(); } - PHY_IPhysicsEnvironment* pe = GetPhysicsEnvironment(); + PHY_IPhysicsEnvironment* pe = KX_GetActiveScene()->GetPhysicsEnvironment(); KX_IPhysicsController *spc = GetPhysicsController(); KX_GameObject *parent = GetParent(); if (!spc && parent) diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h index 32df5803f31..88ef44c41c6 100644 --- a/source/gameengine/Ketsji/KX_GameObject.h +++ b/source/gameengine/Ketsji/KX_GameObject.h @@ -94,8 +94,6 @@ protected: KX_IPhysicsController* m_pPhysicsController1; PHY_IGraphicController* m_pGraphicController; - // used for ray casting - PHY_IPhysicsEnvironment* m_pPhysicsEnvironment; STR_String m_testPropName; bool m_xray; KX_GameObject* m_pHitObject; @@ -334,20 +332,6 @@ public: bool ang_vel_local ); - - /** - * @return a pointer to the physics environment in use during the game, for rayCasting - */ - PHY_IPhysicsEnvironment* GetPhysicsEnvironment() - { - return m_pPhysicsEnvironment; - } - - void SetPhysicsEnvironment(PHY_IPhysicsEnvironment* physicsEnvironment) - { - m_pPhysicsEnvironment = physicsEnvironment; - } - /** * @return a pointer to the physics controller owned by this class. */ diff --git a/source/gameengine/Rasterizer/RAS_BucketManager.cpp b/source/gameengine/Rasterizer/RAS_BucketManager.cpp index 200b1c6c89f..8b3c4990a7a 100644 --- a/source/gameengine/Rasterizer/RAS_BucketManager.cpp +++ b/source/gameengine/Rasterizer/RAS_BucketManager.cpp @@ -126,10 +126,7 @@ void RAS_BucketManager::OrderBuckets(const MT_Transform& cameratrans, BucketList RAS_MaterialBucket* bucket = *bit; RAS_MeshSlot* ms; // remove the mesh slot form the list, it culls them automatically for next frame - for(ms = bucket->GetNextActiveMeshSlot(); - ms!= NULL; - ms = bucket->GetNextActiveMeshSlot()) - { + while((ms = bucket->GetNextActiveMeshSlot())) { slots[i++].set(ms, bucket, pnorm); } } @@ -179,9 +176,7 @@ void RAS_BucketManager::RenderSolidBuckets( RAS_MaterialBucket* bucket = *bit; RAS_MeshSlot* ms; // remove the mesh slot form the list, it culls them automatically for next frame - for(ms = bucket->GetNextActiveMeshSlot(); - ms!= NULL; - ms = bucket->GetNextActiveMeshSlot()) + while((ms = bucket->GetNextActiveMeshSlot())) { rendertools->SetClientObject(rasty, ms->m_clientObj); while (bucket->ActivateMaterial(cameratrans, rasty, rendertools))