Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2009-09-30 02:49:33 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-09-30 02:49:33 +0400
commit8b6f5c171da4d9b165c5ba0628f0302430dbed2b (patch)
tree143760eb8bfb151e6bea7fc5fdaed0fafe221a49 /source/gameengine/Ketsji
parent71b3088596feb008e503be6430a30555aaffa586 (diff)
- rather then passing the python namespace dictionary to the controller function get the namespace from the converter.
- renamed SetPythonDictionary() to SetPyNamespace() - remove IsLight(), GetGameObjectType() existed before this but wasnt used for lights.
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.h8
-rw-r--r--source/gameengine/Ketsji/KX_ISceneConverter.h3
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.cpp5
-rw-r--r--source/gameengine/Ketsji/KX_KetsjiEngine.h3
-rw-r--r--source/gameengine/Ketsji/KX_Light.h4
-rw-r--r--source/gameengine/Ketsji/KX_Scene.cpp8
6 files changed, 9 insertions, 22 deletions
diff --git a/source/gameengine/Ketsji/KX_GameObject.h b/source/gameengine/Ketsji/KX_GameObject.h
index 48ba573e01b..41e04eef91c 100644
--- a/source/gameengine/Ketsji/KX_GameObject.h
+++ b/source/gameengine/Ketsji/KX_GameObject.h
@@ -749,14 +749,6 @@ public:
) { return m_bIsNegativeScaling; }
/**
- * Is this a light?
- */
- virtual bool
- IsLight(
- void
- ) { return false; }
-
- /**
* @section Logic bubbling methods.
*/
diff --git a/source/gameengine/Ketsji/KX_ISceneConverter.h b/source/gameengine/Ketsji/KX_ISceneConverter.h
index 3c3d1d700c4..e5b7c777fb4 100644
--- a/source/gameengine/Ketsji/KX_ISceneConverter.h
+++ b/source/gameengine/Ketsji/KX_ISceneConverter.h
@@ -53,9 +53,6 @@ public:
*/
virtual void ConvertScene(
class KX_Scene* destinationscene,
-#ifndef DISABLE_PYTHON
- PyObject* dictobj,
-#endif
class RAS_IRenderTools* rendertools,
class RAS_ICanvas* canvas)=0;
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
index 734b74b7456..9f4fa9a7c02 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp
@@ -238,7 +238,7 @@ void KX_KetsjiEngine::SetRasterizer(RAS_IRasterizer* rasterizer)
* At the moment the GameLogic module is imported into 'pythondictionary' after this function is called.
* if this function ever changes to assign a copy, make sure the game logic module is imported into this dictionary before hand.
*/
-void KX_KetsjiEngine::SetPythonDictionary(PyObject* pythondictionary)
+void KX_KetsjiEngine::SetPyNamespace(PyObject* pythondictionary)
{
MT_assert(pythondictionary);
m_pythondictionary = pythondictionary;
@@ -1618,9 +1618,6 @@ KX_Scene* KX_KetsjiEngine::CreateScene(const STR_String& scenename)
scene);
m_sceneconverter->ConvertScene(tmpscene,
-#ifndef DISABLE_PYTHON
- m_pythondictionary,
-#endif
m_rendertools,
m_canvas);
diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h
index 9cfca850bf3..74d683fbad6 100644
--- a/source/gameengine/Ketsji/KX_KetsjiEngine.h
+++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h
@@ -204,7 +204,8 @@ public:
void SetRenderTools(RAS_IRenderTools* rendertools);
void SetRasterizer(RAS_IRasterizer* rasterizer);
#ifndef DISABLE_PYTHON
- void SetPythonDictionary(PyObject* pythondictionary);
+ void SetPyNamespace(PyObject* pythondictionary);
+ PyObject* GetPyNamespace(){return m_pythondictionary;};
#endif
void SetSceneConverter(KX_ISceneConverter* sceneconverter);
void SetGame2IpoMode(bool game2ipo,int startFrame);
diff --git a/source/gameengine/Ketsji/KX_Light.h b/source/gameengine/Ketsji/KX_Light.h
index 74d8abcfeac..0e8484a4fe5 100644
--- a/source/gameengine/Ketsji/KX_Light.h
+++ b/source/gameengine/Ketsji/KX_Light.h
@@ -64,6 +64,8 @@ public:
void BindShadowBuffer(class RAS_IRasterizer *ras, class KX_Camera *cam, class MT_Transform& camtrans);
void UnbindShadowBuffer(class RAS_IRasterizer *ras);
void Update();
+
+ virtual int GetGameObjectType() { return OBJ_LIGHT; }
#ifndef DISABLE_PYTHON
/* attributes */
@@ -73,8 +75,6 @@ public:
static PyObject* pyattr_get_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef);
static int pyattr_set_type(void* self_v, const KX_PYATTRIBUTE_DEF *attrdef, PyObject* value);
#endif
-
- virtual bool IsLight(void) { return true; }
};
#endif //__KX_LIGHT
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp
index 94f62b5b4b6..c93ead74182 100644
--- a/source/gameengine/Ketsji/KX_Scene.cpp
+++ b/source/gameengine/Ketsji/KX_Scene.cpp
@@ -477,7 +477,7 @@ KX_GameObject* KX_Scene::AddNodeReplicaObject(class SG_IObject* node, class CVal
// this is the list of object that are send to the graphics pipeline
m_objectlist->Add(newobj->AddRef());
- if (newobj->IsLight())
+ if (newobj->GetGameObjectType()==SCA_IObject::OBJ_LIGHT)
m_lightlist->Add(newobj->AddRef());
newobj->AddMeshUser();
@@ -753,7 +753,7 @@ void KX_Scene::DupliGroupRecurse(CValue* obj, int level)
// add the object in the layer of the parent
(*git)->SetLayer(groupobj->GetLayer());
// If the object was a light, we need to update it's RAS_LightObject as well
- if ((*git)->IsLight())
+ if ((*git)->GetGameObjectType()==SCA_IObject::OBJ_LIGHT)
{
KX_LightObject* lightobj = static_cast<KX_LightObject*>(*git);
lightobj->GetLightData()->m_layer = groupobj->GetLayer();
@@ -861,7 +861,7 @@ SCA_IObject* KX_Scene::AddReplicaObject(class CValue* originalobject,
// add the object in the layer of the parent
(*git)->SetLayer(parentobj->GetLayer());
// If the object was a light, we need to update it's RAS_LightObject as well
- if ((*git)->IsLight())
+ if ((*git)->GetGameObjectType()==SCA_IObject::OBJ_LIGHT)
{
KX_LightObject* lightobj = static_cast<KX_LightObject*>(*git);
lightobj->GetLightData()->m_layer = parentobj->GetLayer();
@@ -982,7 +982,7 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj)
newobj->RemoveMeshes();
ret = 1;
- if (newobj->IsLight() && m_lightlist->RemoveValue(newobj))
+ if (newobj->GetGameObjectType()==SCA_IObject::OBJ_LIGHT && m_lightlist->RemoveValue(newobj))
ret = newobj->Release();
if (m_objectlist->RemoveValue(newobj))
ret = newobj->Release();