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:
-rw-r--r--source/blender/python/api2_2x/gen_utils.h1
-rw-r--r--source/gameengine/Converter/BL_ActionActuator.cpp2
-rw-r--r--source/gameengine/Converter/BL_ShapeActionActuator.cpp3
-rw-r--r--source/gameengine/Converter/Makefile1
-rw-r--r--source/gameengine/Expressions/Makefile1
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.cpp1
-rw-r--r--source/gameengine/Expressions/PyObjectPlus.h27
-rw-r--r--source/gameengine/GameLogic/Makefile1
-rw-r--r--source/gameengine/GameLogic/SCA_ILogicBrick.cpp2
-rw-r--r--source/gameengine/GameLogic/SCA_JoystickSensor.cpp3
-rw-r--r--source/gameengine/GameLogic/SCA_PythonController.cpp2
-rw-r--r--source/gameengine/GamePlayer/ghost/GPG_Application.cpp4
-rw-r--r--source/gameengine/Ketsji/BL_Shader.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_CameraActuator.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_ConstraintWrapper.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_GameObject.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_MeshProxy.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_ParentActuator.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_PyConstraintBinding.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_PythonInit.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_TrackToActuator.cpp2
-rw-r--r--source/gameengine/Ketsji/KX_VehicleWrapper.cpp2
25 files changed, 50 insertions, 24 deletions
diff --git a/source/blender/python/api2_2x/gen_utils.h b/source/blender/python/api2_2x/gen_utils.h
index 1f2fd55cf1b..f33dc69d703 100644
--- a/source/blender/python/api2_2x/gen_utils.h
+++ b/source/blender/python/api2_2x/gen_utils.h
@@ -45,6 +45,7 @@
Py_RETURN_NONE
Python 2.4 macro.
defined here until we switch to 2.4
+ also in PyObjectPlus.h for gameengine
*/
#ifndef Py_RETURN_NONE
#define Py_RETURN_NONE return Py_BuildValue("O", Py_None)
diff --git a/source/gameengine/Converter/BL_ActionActuator.cpp b/source/gameengine/Converter/BL_ActionActuator.cpp
index 13c25188753..119465c8726 100644
--- a/source/gameengine/Converter/BL_ActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ActionActuator.cpp
@@ -50,7 +50,7 @@
#include "MT_Matrix4x4.h"
#include "BKE_utildefines.h"
#include "FloatValue.h"
-#include "gen_utils.h" /* Python stuff */
+#include "PyObjectPlus.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/source/gameengine/Converter/BL_ShapeActionActuator.cpp b/source/gameengine/Converter/BL_ShapeActionActuator.cpp
index 06a9db866d4..679b0df7ec6 100644
--- a/source/gameengine/Converter/BL_ShapeActionActuator.cpp
+++ b/source/gameengine/Converter/BL_ShapeActionActuator.cpp
@@ -49,8 +49,7 @@
#include "BLI_arithb.h"
#include "MT_Matrix4x4.h"
#include "BKE_utildefines.h"
-
-#include "gen_utils.h" /* python stuff */
+#include "PyObjectPlus.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/source/gameengine/Converter/Makefile b/source/gameengine/Converter/Makefile
index 9bd8ae4fc7b..4dd63e428bd 100644
--- a/source/gameengine/Converter/Makefile
+++ b/source/gameengine/Converter/Makefile
@@ -39,7 +39,6 @@ CPPFLAGS += -I$(OPENGL_HEADERS)
CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_SOUNDSYSTEM)/include
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
-CPPFLAGS += -I../../blender/python/api2_2x
CPPFLAGS += -I$(NAN_FUZZICS)/include -I$(NAN_SUMO) -I$(NAN_MOTO)/include
CPPFLAGS += -I$(NAN_SOLID)/include
CPPFLAGS += -I$(NAN_BULLET2)/include
diff --git a/source/gameengine/Expressions/Makefile b/source/gameengine/Expressions/Makefile
index f333de68be0..6736149bbcd 100644
--- a/source/gameengine/Expressions/Makefile
+++ b/source/gameengine/Expressions/Makefile
@@ -36,7 +36,6 @@ include nan_compile.mk
CCFLAGS += $(LEVEL_1_CPP_WARNINGS)
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
-CPPFLAGS += -I../../blender/python/api2_2x
CPPFLAGS += -I../../blender/makesdna
CPPFLAGS += -I$(NAN_STRING)/include
diff --git a/source/gameengine/Expressions/PyObjectPlus.cpp b/source/gameengine/Expressions/PyObjectPlus.cpp
index 3dfa1b0da3d..1eca527151a 100644
--- a/source/gameengine/Expressions/PyObjectPlus.cpp
+++ b/source/gameengine/Expressions/PyObjectPlus.cpp
@@ -50,7 +50,6 @@
#include "stdlib.h"
#include "PyObjectPlus.h"
#include "STR_String.h"
-#include "gen_utils.h"
/*------------------------------
* PyObjectPlus Type -- Every class, even the abstract one should have a Type
------------------------------*/
diff --git a/source/gameengine/Expressions/PyObjectPlus.h b/source/gameengine/Expressions/PyObjectPlus.h
index 65cd4e890f7..ccc9af2ed79 100644
--- a/source/gameengine/Expressions/PyObjectPlus.h
+++ b/source/gameengine/Expressions/PyObjectPlus.h
@@ -43,6 +43,33 @@
* Python defines
------------------------------*/
+/*
+ Py_RETURN_NONE
+ Python 2.4 macro.
+ defined here until we switch to 2.4
+ also in api2_2x/gen_utils.h
+*/
+#ifndef Py_RETURN_NONE
+#define Py_RETURN_NONE return Py_BuildValue("O", Py_None)
+#endif
+#ifndef Py_RETURN_FALSE
+#define Py_RETURN_FALSE return PyBool_FromLong(0)
+#endif
+#ifndef Py_RETURN_TRUE
+#define Py_RETURN_TRUE return PyBool_FromLong(1)
+#endif
+
+/* for pre Py 2.5 */
+#if PY_VERSION_HEX < 0x02050000
+typedef int Py_ssize_t;
+#define PY_SSIZE_T_MAX INT_MAX
+#define PY_SSIZE_T_MIN INT_MIN
+#else
+/* Py 2.5 and later */
+#define intargfunc ssizeargfunc
+#define intintargfunc ssizessizeargfunc
+#endif
+
// some basic python macros
#define Py_Return { Py_INCREF(Py_None); return Py_None;}
diff --git a/source/gameengine/GameLogic/Makefile b/source/gameengine/GameLogic/Makefile
index 564e9b16b55..355ece6e8bd 100644
--- a/source/gameengine/GameLogic/Makefile
+++ b/source/gameengine/GameLogic/Makefile
@@ -44,7 +44,6 @@ CPPFLAGS += -I$(NAN_STRING)/include
CPPFLAGS += -I$(NAN_MOTO)/include
CPPFLAGS += -I../../blender/makesdna
CPPFLAGS += -I$(NAN_PYTHON)/include/python$(NAN_PYTHON_VERSION)
-CPPFLAGS += -I../../blender/python/api2_2x
CPPFLAGS += $(NAN_SDLCFLAGS)
CPPFLAGS += -I../../kernel/gen_system
diff --git a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp
index 1c446bc87c4..abd049e9d64 100644
--- a/source/gameengine/GameLogic/SCA_ILogicBrick.cpp
+++ b/source/gameengine/GameLogic/SCA_ILogicBrick.cpp
@@ -27,7 +27,7 @@
*/
#include "SCA_ILogicBrick.h"
-#include "gen_utils.h" /* python stuff */
+#include "PyObjectPlus.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
index 2d42d64abe3..403fbfe6f4c 100644
--- a/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
+++ b/source/gameengine/GameLogic/SCA_JoystickSensor.cpp
@@ -30,9 +30,10 @@
#include "SCA_EventManager.h"
#include "SCA_LogicManager.h"
+#include "PyObjectPlus.h"
+
#include <iostream>
-#include "gen_utils.h" /* python stuff */
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/source/gameengine/GameLogic/SCA_PythonController.cpp b/source/gameengine/GameLogic/SCA_PythonController.cpp
index 6ba4456bddd..6e9a0a7c6b6 100644
--- a/source/gameengine/GameLogic/SCA_PythonController.cpp
+++ b/source/gameengine/GameLogic/SCA_PythonController.cpp
@@ -33,11 +33,11 @@
#include "SCA_LogicManager.h"
#include "SCA_ISensor.h"
#include "SCA_IActuator.h"
+#include "PyObjectPlus.h"
#include "compile.h"
#include "eval.h"
#include <algorithm>
-#include "gen_utils.h" /* python stuff */
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
index a690beb9f38..806216e05bb 100644
--- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
+++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp
@@ -717,7 +717,11 @@ void GPG_Application::stopEngine()
if (gameLogic) {
PyObject* pyGlobalDict = PyDict_GetItemString(PyModule_GetDict(gameLogic), "globalDict"); // Same as importing the module
if (pyGlobalDict) {
+#ifdef Py_MARSHAL_VERSION
PyObject* pyGlobalDictMarshal = PyMarshal_WriteObjectToString( pyGlobalDict, 2); // Py_MARSHAL_VERSION == 2 as of Py2.5
+#else
+ PyObject* pyGlobalDictMarshal = PyMarshal_WriteObjectToString( pyGlobalDict );
+#endif
if (pyGlobalDictMarshal) {
m_pyGlobalDictString_Length = PyString_Size(pyGlobalDictMarshal);
PyObject_Print(pyGlobalDictMarshal, stderr, 0);
diff --git a/source/gameengine/Ketsji/BL_Shader.cpp b/source/gameengine/Ketsji/BL_Shader.cpp
index f4a4194edfe..f28d3fa2912 100644
--- a/source/gameengine/Ketsji/BL_Shader.cpp
+++ b/source/gameengine/Ketsji/BL_Shader.cpp
@@ -15,8 +15,6 @@
#include "RAS_MeshObject.h"
#include "RAS_IRasterizer.h"
-#include "gen_utils.h" /* python stuff */
-
#define spit(x) std::cout << x << std::endl;
#define SORT_UNIFORMS 1
diff --git a/source/gameengine/Ketsji/KX_CameraActuator.cpp b/source/gameengine/Ketsji/KX_CameraActuator.cpp
index 8f037a93f6a..4948c0ea174 100644
--- a/source/gameengine/Ketsji/KX_CameraActuator.cpp
+++ b/source/gameengine/Ketsji/KX_CameraActuator.cpp
@@ -35,7 +35,7 @@
#include <math.h>
#include "KX_GameObject.h"
-#include "gen_utils.h" /* Python stuff */
+#include "PyObjectPlus.h"
STR_String KX_CameraActuator::X_AXIS_STRING = "x";
STR_String KX_CameraActuator::Y_AXIS_STRING = "y";
diff --git a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
index 9cb859be30d..c9095ff34f6 100644
--- a/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp
@@ -27,7 +27,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
-#include "gen_utils.h"
+#include "PyObjectPlus.h"
#include "KX_ConstraintWrapper.h"
#include "PHY_IPhysicsEnvironment.h"
diff --git a/source/gameengine/Ketsji/KX_GameObject.cpp b/source/gameengine/Ketsji/KX_GameObject.cpp
index 0ca823e148f..27a955b3105 100644
--- a/source/gameengine/Ketsji/KX_GameObject.cpp
+++ b/source/gameengine/Ketsji/KX_GameObject.cpp
@@ -65,7 +65,7 @@ typedef unsigned long uint_ptr;
#include "SCA_IActuator.h"
#include "SCA_ISensor.h"
-#include "gen_utils.h" /* python stuff */
+#include "PyObjectPlus.h" /* python stuff */
// This file defines relationships between parents and children
// in the game engine.
diff --git a/source/gameengine/Ketsji/KX_MeshProxy.cpp b/source/gameengine/Ketsji/KX_MeshProxy.cpp
index e420a208ffd..5cc102248f2 100644
--- a/source/gameengine/Ketsji/KX_MeshProxy.cpp
+++ b/source/gameengine/Ketsji/KX_MeshProxy.cpp
@@ -43,7 +43,7 @@
#include "KX_PyMath.h"
#include "KX_ConvertPhysicsObject.h"
-#include "gen_utils.h" /* Python stuff */
+#include "PyObjectPlus.h"
PyTypeObject KX_MeshProxy::Type = {
PyObject_HEAD_INIT(&PyType_Type)
diff --git a/source/gameengine/Ketsji/KX_ParentActuator.cpp b/source/gameengine/Ketsji/KX_ParentActuator.cpp
index 58000062dcf..3ca121f63f8 100644
--- a/source/gameengine/Ketsji/KX_ParentActuator.cpp
+++ b/source/gameengine/Ketsji/KX_ParentActuator.cpp
@@ -36,7 +36,7 @@
#include "KX_GameObject.h"
#include "KX_PythonInit.h"
-#include "gen_utils.h" /* Python stuff */
+#include "PyObjectPlus.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
index cd76e00a2e3..da4f05ced7c 100644
--- a/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp
@@ -27,7 +27,7 @@
* ***** END GPL LICENSE BLOCK *****
*/
#include <Python.h>
-#include "gen_utils.h"
+#include "PyObjectPlus.h"
#include "KX_PhysicsObjectWrapper.h"
#include "PHY_IPhysicsEnvironment.h"
diff --git a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
index 83695a9f4c3..ac63e3fade5 100644
--- a/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
+++ b/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp
@@ -34,7 +34,7 @@
#include "PHY_IPhysicsController.h"
#include "PHY_IVehicle.h"
-#include "gen_utils.h" /* Python stuff */
+#include "PyObjectPlus.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp
index c89e4cbd831..fe6294e7626 100644
--- a/source/gameengine/Ketsji/KX_PythonInit.cpp
+++ b/source/gameengine/Ketsji/KX_PythonInit.cpp
@@ -68,7 +68,7 @@
#include "KX_PyMath.h"
-#include "gen_utils.h" /* Python stuff */
+#include "PyObjectPlus.h"
extern "C" {
#include "Mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use.
diff --git a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
index 579ad94206b..c4c190e9fa1 100644
--- a/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp
@@ -39,7 +39,7 @@
#include "KX_GameObject.h"
#include "KX_IPhysicsController.h"
-#include "gen_utils.h" /* Python stuff */
+#include "PyObjectPlus.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
index 383347684cb..e1f11732085 100644
--- a/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
+++ b/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp
@@ -37,7 +37,7 @@
#include "KX_SCA_ReplaceMeshActuator.h"
-#include "gen_utils.h" /* Python stuff */
+#include "PyObjectPlus.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/source/gameengine/Ketsji/KX_TrackToActuator.cpp b/source/gameengine/Ketsji/KX_TrackToActuator.cpp
index 962ca93c018..8b09cd4e953 100644
--- a/source/gameengine/Ketsji/KX_TrackToActuator.cpp
+++ b/source/gameengine/Ketsji/KX_TrackToActuator.cpp
@@ -42,7 +42,7 @@
#include <iostream>
#include "KX_GameObject.h"
-#include "gen_utils.h" /* Python stuff */
+#include "PyObjectPlus.h"
#ifdef HAVE_CONFIG_H
#include <config.h>
diff --git a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
index 9131afda5dd..342e71c5093 100644
--- a/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
+++ b/source/gameengine/Ketsji/KX_VehicleWrapper.cpp
@@ -1,7 +1,7 @@
#include <Python.h>
-#include "gen_utils.h"
+#include "PyObjectPlus.h"
#include "KX_VehicleWrapper.h"
#include "PHY_IPhysicsEnvironment.h"