Added GameLogic.Mathutils so Mathutils and its types can be accessed from blenderplayer.

also changed importText so it dosnt do a malloc
This commit is contained in:
2008-08-05 09:35:46 +00:00
parent 9e968cea47
commit cd1d46c61d
7 changed files with 46 additions and 33 deletions

View File

@@ -62,6 +62,10 @@
#include "KX_PyMath.h"
extern "C" {
#include "Mathutils.h" // Blender.Mathutils module copied here so the blenderlayer can use.
}
#include "PHY_IPhysicsEnvironment.h"
// FIXME: Enable for access to blender python modules. This is disabled because
// python has dependencies on a lot of other modules and is a pain to link.
@@ -733,7 +737,10 @@ PyObject* initGameLogic(KX_Scene* scene) // quick hack to get gravity hook
ErrorObject = PyString_FromString("GameLogic.error");
PyDict_SetItemString(d, "error", ErrorObject);
// Add Blender.Mathutils module, duplicate code :/
PyDict_SetItemString(d, "Mathutils", Mathutils_Init("GameLogic.Mathutils"));
// XXXX Add constants here
/* To use logic bricks, we need some sort of constants. Here, we associate */
/* constants and sumbolic names. Add them to dictionary d. */