diff options
Diffstat (limited to 'source/gameengine/VideoTexture/blendVideoTex.cpp')
-rw-r--r-- | source/gameengine/VideoTexture/blendVideoTex.cpp | 27 |
1 files changed, 10 insertions, 17 deletions
diff --git a/source/gameengine/VideoTexture/blendVideoTex.cpp b/source/gameengine/VideoTexture/blendVideoTex.cpp index ab6dca0958f..6c9294873a6 100644 --- a/source/gameengine/VideoTexture/blendVideoTex.cpp +++ b/source/gameengine/VideoTexture/blendVideoTex.cpp @@ -157,10 +157,14 @@ static void registerAllTypes(void) pyFilterTypes.add(&FilterBGR24Type, "FilterBGR24"); } +PyDoc_STRVAR(VideoTexture_module_documentation, +"Module that allows to play video files on textures in GameBlender." +); + static struct PyModuleDef VideoTexture_module_def = { - {}, /* m_base */ + PyModuleDef_HEAD_INIT, "VideoTexture", /* m_name */ - "Module that allows to play video files on textures in GameBlender.", /* m_doc */ + VideoTexture_module_documentation, /* m_doc */ 0, /* m_size */ moduleMethods, /* m_methods */ 0, /* m_reload */ @@ -169,7 +173,7 @@ static struct PyModuleDef VideoTexture_module_def = { 0, /* m_free */ }; -PyObject *initVideoTexture(void) +PyMODINIT_FUNC initVideoTexturePythonBinding(void) { PyObject *m; @@ -187,20 +191,9 @@ PyObject *initVideoTexture(void) if (PyType_Ready(&TextureType) < 0) return NULL; - /* Use existing module where possible - * be careful not to init any runtime vars after this */ - m = PyImport_ImportModule( "VideoTexture" ); - if (m) { - Py_DECREF(m); - return m; - } - else { - PyErr_Clear(); - - m = PyModule_Create(&VideoTexture_module_def); - PyDict_SetItemString(PySys_GetObject("modules"), VideoTexture_module_def.m_name, m); - } - + m = PyModule_Create(&VideoTexture_module_def); + PyDict_SetItemString(PySys_GetObject("modules"), VideoTexture_module_def.m_name, m); + if (m == NULL) return NULL; |