diff options
author | Martin Poirier <theeth@yahoo.com> | 2008-10-06 21:37:03 +0400 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2008-10-06 21:37:03 +0400 |
commit | d16a8649ff6c2b65492a78eab80bcdbefa9dbe9d (patch) | |
tree | 5d2a2bd518cc7de908ad516a28ee8011d9a7e590 /source/gameengine | |
parent | 1513e96857538a5a686439247c0608bd1dfce64a (diff) | |
parent | de6a9d0194abacb1bd2de5283e72440b4916325c (diff) |
merge runk 16887:16950
Diffstat (limited to 'source/gameengine')
-rw-r--r-- | source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp | 25 | ||||
-rw-r--r-- | source/gameengine/Converter/KX_ConvertActuators.cpp | 12 | ||||
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_ghost.cpp | 4 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_PythonInit.cpp | 21 |
4 files changed, 42 insertions, 20 deletions
diff --git a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp index 0d58810e156..1110c4e0b48 100644 --- a/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp +++ b/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp @@ -135,15 +135,6 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, bool frameRate = (SYS_GetCommandLineInt(syshandle, "show_framerate", 0) != 0); bool game2ipo = (SYS_GetCommandLineInt(syshandle, "game2ipo", 0) != 0); bool displaylists = (SYS_GetCommandLineInt(syshandle, "displaylists", 0) != 0); - bool usemat = false, useglslmat = false; - - if(GLEW_ARB_multitexture && GLEW_VERSION_1_1) - usemat = (SYS_GetCommandLineInt(syshandle, "blender_material", 1) != 0); - - if(GPU_extensions_minimum_support()) - useglslmat = (SYS_GetCommandLineInt(syshandle, "blender_glsl_material", 1) != 0); - else if(G.fileflags & G_FILE_GAME_MAT_GLSL) - usemat = false; // create the canvas, rasterizer and rendertools RAS_ICanvas* canvas = new KX_BlenderCanvas(area); @@ -316,10 +307,18 @@ extern "C" void StartKetsjiShell(struct ScrArea *area, if (always_use_expand_framing) sceneconverter->SetAlwaysUseExpandFraming(true); - if(usemat && (G.fileflags & G_FILE_GAME_MAT)) - sceneconverter->SetMaterials(true); - if(useglslmat && (G.fileflags & G_FILE_GAME_MAT_GLSL)) - sceneconverter->SetGLSLMaterials(true); + bool usemat = false, useglslmat = false; + + if(GLEW_ARB_multitexture && GLEW_VERSION_1_1) + usemat = true; + + if(GPU_extensions_minimum_support()) + useglslmat = true; + else if(G.fileflags & G_FILE_GAME_MAT_GLSL) + usemat = false; + + sceneconverter->SetMaterials(usemat && (G.fileflags & G_FILE_GAME_MAT)); + sceneconverter->SetGLSLMaterials(useglslmat && (G.fileflags & G_FILE_GAME_MAT_GLSL)); KX_Scene* startscene = new KX_Scene(keyboarddevice, mousedevice, diff --git a/source/gameengine/Converter/KX_ConvertActuators.cpp b/source/gameengine/Converter/KX_ConvertActuators.cpp index d5f304c38e7..4f152acc918 100644 --- a/source/gameengine/Converter/KX_ConvertActuators.cpp +++ b/source/gameengine/Converter/KX_ConvertActuators.cpp @@ -291,15 +291,19 @@ void BL_ConvertActuators(char* maggiename, STR_String toPropName = (msgAct->toPropName ? (char*) msgAct->toPropName : ""); - /** - * Get the Message Subject to send. + /* BGE Wants "OB" prefix */ + if (toPropName != "") + toPropName = "OB" + toPropName; + + /** + * Get the Message Subject to send. */ STR_String subject = (msgAct->subject ? (char*) msgAct->subject : ""); - /** - * Get the bodyType + /** + * Get the bodyType */ int bodyType = msgAct->bodyType; diff --git a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp index 9700e6387f2..fbb8d6530ba 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_ghost.cpp @@ -659,7 +659,9 @@ int main(int argc, char** argv) Main *maggie = bfd->main; Scene *scene = bfd->curscene; G.main = maggie; - G.fileflags = bfd->fileflags; + + if (firstTimeRunning) + G.fileflags = bfd->fileflags; //Seg Fault; icon.c gIcons == 0 BKE_icons_init(1); diff --git a/source/gameengine/Ketsji/KX_PythonInit.cpp b/source/gameengine/Ketsji/KX_PythonInit.cpp index fc836234e2b..cdf7ebd0943 100644 --- a/source/gameengine/Ketsji/KX_PythonInit.cpp +++ b/source/gameengine/Ketsji/KX_PythonInit.cpp @@ -1077,9 +1077,17 @@ PyObject *KXpy_import(PyObject *self, PyObject *args) PyObject *fromlist = NULL; PyObject *l, *m, *n; +#if (PY_VERSION_HEX >= 0x02060000) + int dummy_val; /* what does this do?*/ + + if (!PyArg_ParseTuple(args, "s|OOOi:m_import", + &name, &globals, &locals, &fromlist, &dummy_val)) + return NULL; +#else if (!PyArg_ParseTuple(args, "s|OOO:m_import", &name, &globals, &locals, &fromlist)) return NULL; +#endif /* check for builtin modules */ m = PyImport_AddModule("sys"); @@ -1492,6 +1500,7 @@ int saveGamePythonConfig( char **marshal_buffer) } Py_DECREF(gameLogic); } else { + PyErr_Clear(); printf("Error, GameLogic failed to import GameLogic.globalDict will be lost\n"); } return marshal_length; @@ -1505,10 +1514,17 @@ int loadGamePythonConfig(char *marshal_buffer, int marshal_length) if (gameLogic) { PyObject* pyGlobalDict = PyMarshal_ReadObjectFromString(marshal_buffer, marshal_length); - if (pyGlobalDict) { - PyDict_SetItemString(PyModule_GetDict(gameLogic), "globalDict", pyGlobalDict); // Same as importing the module. + PyObject* pyGlobalDict_orig = PyDict_GetItemString(PyModule_GetDict(gameLogic), "globalDict"); // Same as importing the module. + if (pyGlobalDict_orig) { + PyDict_Clear(pyGlobalDict_orig); + PyDict_Update(pyGlobalDict_orig, pyGlobalDict); + } else { + /* this should not happen, but cant find the original globalDict, just assign it then */ + PyDict_SetItemString(PyModule_GetDict(gameLogic), "globalDict", pyGlobalDict); // Same as importing the module. + } Py_DECREF(gameLogic); + Py_DECREF(pyGlobalDict); return 1; } else { Py_DECREF(gameLogic); @@ -1516,6 +1532,7 @@ int loadGamePythonConfig(char *marshal_buffer, int marshal_length) printf("Error could not marshall string\n"); } } else { + PyErr_Clear(); printf("Error, GameLogic failed to import GameLogic.globalDict will be lost\n"); } } |