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

@@ -106,8 +106,9 @@ struct PyMethodDef M_Mathutils_methods[] = {
{"Point", (PyCFunction) M_Mathutils_Point, METH_VARARGS, M_Mathutils_Point_doc},
{NULL, NULL, 0, NULL}
};
//----------------------------MODULE INIT-------------------------
PyObject *Mathutils_Init(void)
/*----------------------------MODULE INIT-------------------------*/
/* from can be Blender.Mathutils or GameLogic.Mathutils for the BGE */
PyObject *Mathutils_Init(char *from)
{
PyObject *submodule;
@@ -125,8 +126,7 @@ PyObject *Mathutils_Init(void)
if( PyType_Ready( &quaternion_Type ) < 0 )
return NULL;
submodule = Py_InitModule3("Blender.Mathutils",
M_Mathutils_methods, M_Mathutils_doc);
submodule = Py_InitModule3(from, M_Mathutils_methods, M_Mathutils_doc);
return (submodule);
}
//-----------------------------METHODS----------------------------