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-08-19 14:26:43 +0400
committerCampbell Barton <ideasman42@gmail.com>2009-08-19 14:26:43 +0400
commitc3041ae7cda20c78040e7deea17530fe5f41029d (patch)
tree3190e3af2ab7f81833f379771f5fdcd8819bd635 /source/gameengine/Ketsji
parente611c4756fa17c57855123dc2b5c2c2408b0d790 (diff)
- fix for BGE warnings
- when C++ uses guardedalloc SYS_DeleteSystem was called after MEM_printmemlist(), making it look like there was a leak.
Diffstat (limited to 'source/gameengine/Ketsji')
-rw-r--r--source/gameengine/Ketsji/KX_CameraActuator.cpp12
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp12
-rw-r--r--source/gameengine/Ketsji/KX_IpoActuator.cpp28
-rw-r--r--source/gameengine/Ketsji/KX_IpoActuator.h14
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp14
-rw-r--r--source/gameengine/Ketsji/KX_PythonInitTypes.cpp3
-rw-r--r--source/gameengine/Ketsji/KX_PythonSeq.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h2
8 files changed, 36 insertions, 51 deletions
diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp
index faf0ca50407..b5a0a63cf68 100644
--- a/source/gameengine/Ketsji/KX_CameraActuator.cpp
+++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp
@@ -38,9 +38,6 @@
#include "PyObjectPlus.h"
-STR_String KX_CameraActuator::X_AXIS_STRING = "x";
-STR_String KX_CameraActuator::Y_AXIS_STRING = "y";
-
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
@@ -353,15 +350,6 @@ CValue *KX_CameraActuator::findObject(char *obName)
return NULL;
}
-bool KX_CameraActuator::string2axischoice(const char *axisString)
-{
- bool res = true;
-
- res = !(axisString == Y_AXIS_STRING);
-
- return res;
-}
-
/* ------------------------------------------------------------------------- */
/* Python functions */
/* ------------------------------------------------------------------------- */
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index 146b83abd17..a5217273b17 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -464,7 +464,7 @@ void KX_GameObject::AddMeshUser()
double* fl = GetOpenGLMatrixPtr()->getPointer();
SG_QList::iterator<RAS_MeshSlot> mit(m_meshSlots);
- RAS_MeshSlot* ms;
+// RAS_MeshSlot* ms;
for(mit.begin(); !mit.end(); ++mit)
{
(*mit)->m_OpenGLMatrix = fl;
@@ -1817,10 +1817,10 @@ int KX_GameObject::pyattr_set_visible(void *self_v, const KX_PYATTRIBUTE_DEF *at
PyObject* KX_GameObject::pyattr_get_worldPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
- KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
#ifdef USE_MATHUTILS
return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_GLOBAL);
#else
+ KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
return PyObjectFrom(self->NodeGetWorldPosition());
#endif
}
@@ -1839,10 +1839,10 @@ int KX_GameObject::pyattr_set_worldPosition(void *self_v, const KX_PYATTRIBUTE_D
PyObject* KX_GameObject::pyattr_get_localPosition(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
- KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
#ifdef USE_MATHUTILS
return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_POS_LOCAL);
#else
+ KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
return PyObjectFrom(self->NodeGetLocalPosition());
#endif
}
@@ -1861,10 +1861,10 @@ int KX_GameObject::pyattr_set_localPosition(void *self_v, const KX_PYATTRIBUTE_D
PyObject* KX_GameObject::pyattr_get_localInertia(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
- KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
#ifdef USE_MATHUTILS
return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_INERTIA_LOCAL);
#else
+ KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
if (self->GetPhysicsController())
return PyObjectFrom(self->GetPhysicsController()->GetLocalInertia());
return Py_BuildValue("fff", 0.0f, 0.0f, 0.0f);
@@ -1922,20 +1922,20 @@ int KX_GameObject::pyattr_set_localOrientation(void *self_v, const KX_PYATTRIBUT
PyObject* KX_GameObject::pyattr_get_worldScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
- KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
#ifdef USE_MATHUTILS
return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_GLOBAL);
#else
+ KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
return PyObjectFrom(self->NodeGetWorldScaling());
#endif
}
PyObject* KX_GameObject::pyattr_get_localScaling(void *self_v, const KX_PYATTRIBUTE_DEF *attrdef)
{
- KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
#ifdef USE_MATHUTILS
return newVectorObject_cb((PyObject *)self_v, 3, mathutils_kxgameob_vector_cb_index, MATHUTILS_VEC_CB_SCALE_LOCAL);
#else
+ KX_GameObject* self= static_cast<KX_GameObject*>(self_v);
return PyObjectFrom(self->NodeGetLocalScaling());
#endif
}
diff --git a/source/gameengine/Ketsji/KX_IpoActuator.cpp b/source/gameengine/Ketsji/KX_IpoActuator.cpp
index e4eaff4f401..3f241e90836 100644
--- a/source/gameengine/Ketsji/KX_IpoActuator.cpp
+++ b/source/gameengine/Ketsji/KX_IpoActuator.cpp
@@ -49,13 +49,13 @@
/* Type strings */
/* ------------------------------------------------------------------------- */
-STR_String KX_IpoActuator::S_KX_ACT_IPO_PLAY_STRING = "Play";
-STR_String KX_IpoActuator::S_KX_ACT_IPO_PINGPONG_STRING = "PingPong";
-STR_String KX_IpoActuator::S_KX_ACT_IPO_FLIPPER_STRING = "Flipper";
-STR_String KX_IpoActuator::S_KX_ACT_IPO_LOOPSTOP_STRING = "LoopStop";
-STR_String KX_IpoActuator::S_KX_ACT_IPO_LOOPEND_STRING = "LoopEnd";
-STR_String KX_IpoActuator::S_KX_ACT_IPO_KEY2KEY_STRING = "Key2key";
-STR_String KX_IpoActuator::S_KX_ACT_IPO_FROM_PROP_STRING = "FromProp";
+const char *KX_IpoActuator::S_KX_ACT_IPO_PLAY_STRING = "Play";
+const char *KX_IpoActuator::S_KX_ACT_IPO_PINGPONG_STRING = "PingPong";
+const char *KX_IpoActuator::S_KX_ACT_IPO_FLIPPER_STRING = "Flipper";
+const char *KX_IpoActuator::S_KX_ACT_IPO_LOOPSTOP_STRING = "LoopStop";
+const char *KX_IpoActuator::S_KX_ACT_IPO_LOOPEND_STRING = "LoopEnd";
+const char *KX_IpoActuator::S_KX_ACT_IPO_KEY2KEY_STRING = "Key2key";
+const char *KX_IpoActuator::S_KX_ACT_IPO_FROM_PROP_STRING = "FromProp";
/* ------------------------------------------------------------------------- */
/* Native functions */
@@ -385,19 +385,19 @@ bool KX_IpoActuator::Update(double curtime, bool frame)
int KX_IpoActuator::string2mode(char* modename) {
IpoActType res = KX_ACT_IPO_NODEF;
- if (modename == S_KX_ACT_IPO_PLAY_STRING) {
+ if (strcmp(modename, S_KX_ACT_IPO_PLAY_STRING)==0) {
res = KX_ACT_IPO_PLAY;
- } else if (modename == S_KX_ACT_IPO_PINGPONG_STRING) {
+ } else if (strcmp(modename, S_KX_ACT_IPO_PINGPONG_STRING)==0) {
res = KX_ACT_IPO_PINGPONG;
- } else if (modename == S_KX_ACT_IPO_FLIPPER_STRING) {
+ } else if (strcmp(modename, S_KX_ACT_IPO_FLIPPER_STRING)==0) {
res = KX_ACT_IPO_FLIPPER;
- } else if (modename == S_KX_ACT_IPO_LOOPSTOP_STRING) {
+ } else if (strcmp(modename, S_KX_ACT_IPO_LOOPSTOP_STRING)==0) {
res = KX_ACT_IPO_LOOPSTOP;
- } else if (modename == S_KX_ACT_IPO_LOOPEND_STRING) {
+ } else if (strcmp(modename, S_KX_ACT_IPO_LOOPEND_STRING)==0) {
res = KX_ACT_IPO_LOOPEND;
- } else if (modename == S_KX_ACT_IPO_KEY2KEY_STRING) {
+ } else if (strcmp(modename, S_KX_ACT_IPO_KEY2KEY_STRING)==0) {
res = KX_ACT_IPO_KEY2KEY;
- } else if (modename == S_KX_ACT_IPO_FROM_PROP_STRING) {
+ } else if (strcmp(modename, S_KX_ACT_IPO_FROM_PROP_STRING)==0) {
res = KX_ACT_IPO_FROM_PROP;
}
diff --git a/source/gameengine/Ketsji/KX_IpoActuator.h b/source/gameengine/Ketsji/KX_IpoActuator.h
index 01051ca82dc..0581d1644ee 100644
--- a/source/gameengine/Ketsji/KX_IpoActuator.h
+++ b/source/gameengine/Ketsji/KX_IpoActuator.h
@@ -100,13 +100,13 @@ public:
KX_ACT_IPO_MAX
};
- static STR_String S_KX_ACT_IPO_PLAY_STRING;
- static STR_String S_KX_ACT_IPO_PINGPONG_STRING;
- static STR_String S_KX_ACT_IPO_FLIPPER_STRING;
- static STR_String S_KX_ACT_IPO_LOOPSTOP_STRING;
- static STR_String S_KX_ACT_IPO_LOOPEND_STRING;
- static STR_String S_KX_ACT_IPO_KEY2KEY_STRING;
- static STR_String S_KX_ACT_IPO_FROM_PROP_STRING;
+ static const char *S_KX_ACT_IPO_PLAY_STRING;
+ static const char *S_KX_ACT_IPO_PINGPONG_STRING;
+ static const char *S_KX_ACT_IPO_FLIPPER_STRING;
+ static const char *S_KX_ACT_IPO_LOOPSTOP_STRING;
+ static const char *S_KX_ACT_IPO_LOOPEND_STRING;
+ static const char *S_KX_ACT_IPO_KEY2KEY_STRING;
+ static const char *S_KX_ACT_IPO_FROM_PROP_STRING;
int string2mode(char* modename);
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index de3dcd0ebf8..49cf895af17 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -142,7 +142,7 @@ void KX_RasterizerDrawDebugLine(const MT_Vector3& from,const MT_Vector3& to,cons
// List of methods defined in the module
static PyObject* ErrorObject;
-STR_String gPyGetRandomFloat_doc="getRandomFloat returns a random floating point value in the range [0..1)";
+static const char *gPyGetRandomFloat_doc="getRandomFloat returns a random floating point value in the range [0..1]";
static PyObject* gPyGetRandomFloat(PyObject*)
{
@@ -346,7 +346,7 @@ static PyObject* gPyGetBlendFileList(PyObject*, PyObject* args)
return list;
}
-static STR_String gPyGetCurrentScene_doc =
+static const char *gPyGetCurrentScene_doc =
"getCurrentScene()\n"
"Gets a reference to the current scene.\n";
static PyObject* gPyGetCurrentScene(PyObject* self)
@@ -354,7 +354,7 @@ static PyObject* gPyGetCurrentScene(PyObject* self)
return gp_KetsjiScene->GetProxy();
}
-static STR_String gPyGetSceneList_doc =
+static const char *gPyGetSceneList_doc =
"getSceneList()\n"
"Return a list of converted scenes.\n";
static PyObject* gPyGetSceneList(PyObject* self)
@@ -479,15 +479,15 @@ static struct PyMethodDef game_methods[] = {
{"sendMessage", (PyCFunction)gPySendMessage, METH_VARARGS, (const char *)gPySendMessage_doc},
{"getCurrentController",
(PyCFunction) SCA_PythonController::sPyGetCurrentController,
- METH_NOARGS, (const char *)SCA_PythonController::sPyGetCurrentController__doc__},
+ METH_NOARGS, SCA_PythonController::sPyGetCurrentController__doc__},
{"getCurrentScene", (PyCFunction) gPyGetCurrentScene,
- METH_NOARGS, (const char *)gPyGetCurrentScene_doc.Ptr()},
+ METH_NOARGS, gPyGetCurrentScene_doc},
{"getSceneList", (PyCFunction) gPyGetSceneList,
- METH_NOARGS, (const char *)gPyGetSceneList_doc.Ptr()},
+ METH_NOARGS, (const char *)gPyGetSceneList_doc},
{"addActiveActuator",(PyCFunction) SCA_PythonController::sPyAddActiveActuator,
METH_VARARGS, (const char *)SCA_PythonController::sPyAddActiveActuator__doc__},
{"getRandomFloat",(PyCFunction) gPyGetRandomFloat,
- METH_NOARGS, (const char *)gPyGetRandomFloat_doc.Ptr()},
+ METH_NOARGS, (const char *)gPyGetRandomFloat_doc},
{"setGravity",(PyCFunction) gPySetGravity, METH_O, (const char *)"set Gravitation"},
{"getSpectrum",(PyCFunction) gPyGetSpectrum, METH_NOARGS, (const char *)"get audio spectrum"},
{"stopDSP",(PyCFunction) gPyStopDSP, METH_VARARGS, (const char *)"stop using the audio dsp (for performance reasons)"},
diff --git a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp
index 5260c0bb01a..61e563791c3 100644
--- a/source/gameengine/Ketsji/KX_PythonInitTypes.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInitTypes.cpp
@@ -123,9 +123,6 @@ static void PyType_Ready_ADD(PyObject *dict, PyTypeObject *tp, PyAttributeDef *a
memset(attr_getset, 0, sizeof(PyGetSetDef));
}
} else {
-
- PyObject *item;
-
PyType_Ready(tp);
PyDict_SetItemString(dict, tp->tp_name, reinterpret_cast<PyObject *>(tp));
}
diff --git a/source/gameengine/Ketsji/KX_PythonSeq.cpp b/source/gameengine/Ketsji/KX_PythonSeq.cpp
index 4fc5252de60..1098dc03b62 100644
--- a/source/gameengine/Ketsji/KX_PythonSeq.cpp
+++ b/source/gameengine/Ketsji/KX_PythonSeq.cpp
@@ -375,7 +375,7 @@ PyTypeObject KX_PythonSeq_Type = {
NULL, /* getattrfunc tp_getattr; */
NULL, /* setattrfunc tp_setattr; */
/* TODO, richcmp */
- NULL, /* ( cmpfunc ) KX_PythonSeq_compare, /* cmpfunc tp_compare; */
+ NULL, /* ( cmpfunc ) KX_PythonSeq_compare, // cmpfunc tp_compare; */
( reprfunc ) KX_PythonSeq_repr, /* reprfunc tp_repr; */
/* Method suites for standard classes */
diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h
index ae2c0d2d6ce..1e258420836 100644
--- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h
+++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.h
@@ -50,8 +50,8 @@ class KX_SCA_ReplaceMeshActuator : public SCA_IActuator
// mesh reference (mesh to replace)
RAS_MeshObject* m_mesh;
SCA_IScene* m_scene;
- bool m_use_phys;
bool m_use_gfx;
+ bool m_use_phys;
public:
KX_SCA_ReplaceMeshActuator(