merge runk 16887:16950
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user