Revision: 16395 http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=16395 Author: sirdude Date: 2008-09-06 16:13:31 +0200 (Sat, 06 Sep 2008)
Log Message: ----------- converted my gen_utils.h fix to PyObjectPlus.h Also added a fix for PyMarshal_WriteObjectToString Now I just need to figure out linking of the gameengine on my imac. Kent Modified Paths: -------------- trunk/blender/source/blender/python/api2_2x/gen_utils.h trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp trunk/blender/source/gameengine/Converter/Makefile trunk/blender/source/gameengine/Expressions/Makefile trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp trunk/blender/source/gameengine/Expressions/PyObjectPlus.h trunk/blender/source/gameengine/GameLogic/Makefile trunk/blender/source/gameengine/GameLogic/SCA_ILogicBrick.cpp trunk/blender/source/gameengine/GameLogic/SCA_JoystickSensor.cpp trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp trunk/blender/source/gameengine/GamePlayer/ghost/GPG_Application.cpp trunk/blender/source/gameengine/Ketsji/BL_Shader.cpp trunk/blender/source/gameengine/Ketsji/KX_CameraActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp trunk/blender/source/gameengine/Ketsji/KX_MeshProxy.cpp trunk/blender/source/gameengine/Ketsji/KX_ParentActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_PhysicsObjectWrapper.cpp trunk/blender/source/gameengine/Ketsji/KX_PyConstraintBinding.cpp trunk/blender/source/gameengine/Ketsji/KX_PythonInit.cpp trunk/blender/source/gameengine/Ketsji/KX_SCA_AddObjectActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_SCA_ReplaceMeshActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_TrackToActuator.cpp trunk/blender/source/gameengine/Ketsji/KX_VehicleWrapper.cpp Modified: trunk/blender/source/blender/python/api2_2x/gen_utils.h =================================================================== --- trunk/blender/source/blender/python/api2_2x/gen_utils.h 2008-09-06 13:24:42 UTC (rev 16394) +++ trunk/blender/source/blender/python/api2_2x/gen_utils.h 2008-09-06 14:13:31 UTC (rev 16395) @@ -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) Modified: trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp =================================================================== --- trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp 2008-09-06 13:24:42 UTC (rev 16394) +++ trunk/blender/source/gameengine/Converter/BL_ActionActuator.cpp 2008-09-06 14:13:31 UTC (rev 16395) @@ -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> Modified: trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp =================================================================== --- trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp 2008-09-06 13:24:42 UTC (rev 16394) +++ trunk/blender/source/gameengine/Converter/BL_ShapeActionActuator.cpp 2008-09-06 14:13:31 UTC (rev 16395) @@ -49,9 +49,8 @@ #include "BLI_arithb.h" #include "MT_Matrix4x4.h" #include "BKE_utildefines.h" +#include "PyObjectPlus.h" -#include "gen_utils.h" /* python stuff */ - #ifdef HAVE_CONFIG_H #include <config.h> #endif Modified: trunk/blender/source/gameengine/Converter/Makefile =================================================================== --- trunk/blender/source/gameengine/Converter/Makefile 2008-09-06 13:24:42 UTC (rev 16394) +++ trunk/blender/source/gameengine/Converter/Makefile 2008-09-06 14:13:31 UTC (rev 16395) @@ -39,7 +39,6 @@ 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 Modified: trunk/blender/source/gameengine/Expressions/Makefile =================================================================== --- trunk/blender/source/gameengine/Expressions/Makefile 2008-09-06 13:24:42 UTC (rev 16394) +++ trunk/blender/source/gameengine/Expressions/Makefile 2008-09-06 14:13:31 UTC (rev 16395) @@ -36,7 +36,6 @@ 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 Modified: trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp =================================================================== --- trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp 2008-09-06 13:24:42 UTC (rev 16394) +++ trunk/blender/source/gameengine/Expressions/PyObjectPlus.cpp 2008-09-06 14:13:31 UTC (rev 16395) @@ -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 ------------------------------*/ Modified: trunk/blender/source/gameengine/Expressions/PyObjectPlus.h =================================================================== --- trunk/blender/source/gameengine/Expressions/PyObjectPlus.h 2008-09-06 13:24:42 UTC (rev 16394) +++ trunk/blender/source/gameengine/Expressions/PyObjectPlus.h 2008-09-06 14:13:31 UTC (rev 16395) @@ -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;} Modified: trunk/blender/source/gameengine/GameLogic/Makefile =================================================================== --- trunk/blender/source/gameengine/GameLogic/Makefile 2008-09-06 13:24:42 UTC (rev 16394) +++ trunk/blender/source/gameengine/GameLogic/Makefile 2008-09-06 14:13:31 UTC (rev 16395) @@ -44,7 +44,6 @@ 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 Modified: trunk/blender/source/gameengine/GameLogic/SCA_ILogicBrick.cpp =================================================================== --- trunk/blender/source/gameengine/GameLogic/SCA_ILogicBrick.cpp 2008-09-06 13:24:42 UTC (rev 16394) +++ trunk/blender/source/gameengine/GameLogic/SCA_ILogicBrick.cpp 2008-09-06 14:13:31 UTC (rev 16395) @@ -27,7 +27,7 @@ */ #include "SCA_ILogicBrick.h" -#include "gen_utils.h" /* python stuff */ +#include "PyObjectPlus.h" #ifdef HAVE_CONFIG_H #include <config.h> Modified: trunk/blender/source/gameengine/GameLogic/SCA_JoystickSensor.cpp =================================================================== --- trunk/blender/source/gameengine/GameLogic/SCA_JoystickSensor.cpp 2008-09-06 13:24:42 UTC (rev 16394) +++ trunk/blender/source/gameengine/GameLogic/SCA_JoystickSensor.cpp 2008-09-06 14:13:31 UTC (rev 16395) @@ -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> Modified: trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp =================================================================== --- trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp 2008-09-06 13:24:42 UTC (rev 16394) +++ trunk/blender/source/gameengine/GameLogic/SCA_PythonController.cpp 2008-09-06 14:13:31 UTC (rev 16395) @@ -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> Modified: trunk/blender/source/gameengine/GamePlayer/ghost/GPG_Application.cpp =================================================================== --- trunk/blender/source/gameengine/GamePlayer/ghost/GPG_Application.cpp 2008-09-06 13:24:42 UTC (rev 16394) +++ trunk/blender/source/gameengine/GamePlayer/ghost/GPG_Application.cpp 2008-09-06 14:13:31 UTC (rev 16395) @@ -717,7 +717,11 @@ 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); Modified: trunk/blender/source/gameengine/Ketsji/BL_Shader.cpp =================================================================== --- trunk/blender/source/gameengine/Ketsji/BL_Shader.cpp 2008-09-06 13:24:42 UTC (rev 16394) +++ trunk/blender/source/gameengine/Ketsji/BL_Shader.cpp 2008-09-06 14:13:31 UTC (rev 16395) @@ -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 Modified: trunk/blender/source/gameengine/Ketsji/KX_CameraActuator.cpp =================================================================== --- trunk/blender/source/gameengine/Ketsji/KX_CameraActuator.cpp 2008-09-06 13:24:42 UTC (rev 16394) +++ trunk/blender/source/gameengine/Ketsji/KX_CameraActuator.cpp 2008-09-06 14:13:31 UTC (rev 16395) @@ -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"; Modified: trunk/blender/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp =================================================================== --- trunk/blender/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp 2008-09-06 13:24:42 UTC (rev 16394) +++ trunk/blender/source/gameengine/Ketsji/KX_ConstraintWrapper.cpp 2008-09-06 14:13:31 UTC (rev 16395) @@ -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" Modified: trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp =================================================================== --- trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp 2008-09-06 13:24:42 UTC (rev 16394) +++ trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp 2008-09-06 14:13:31 UTC (rev 16395) @@ -65,7 +65,7 @@ #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. Modified: trunk/blender/source/gameengine/Ketsji/KX_MeshProxy.cpp =================================================================== --- trunk/blender/source/gameengine/Ketsji/KX_MeshProxy.cpp 2008-09-06 13:24:42 UTC (rev 16394) @@ Diff output truncated at 10240 characters. @@ _______________________________________________ Bf-blender-cvs mailing list Bf-blender-cvs@blender.org http://lists.blender.org/mailman/listinfo/bf-blender-cvs