OLD | NEW |
1 /* | 1 /* |
2 * $Id$ | 2 * $Id$ |
3 * | 3 * |
4 * ***** BEGIN GPL LICENSE BLOCK ***** | 4 * ***** BEGIN GPL LICENSE BLOCK ***** |
5 * | 5 * |
6 * This program is free software; you can redistribute it and/or | 6 * This program is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU General Public License | 7 * modify it under the terms of the GNU General Public License |
8 * as published by the Free Software Foundation; either version 2 | 8 * as published by the Free Software Foundation; either version 2 |
9 * of the License, or (at your option) any later version. | 9 * of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
405 ········ | 405 ········ |
406 KX_KetsjiEngine::SetTicRate(ticrate); | 406 KX_KetsjiEngine::SetTicRate(ticrate); |
407 Py_RETURN_NONE; | 407 Py_RETURN_NONE; |
408 } | 408 } |
409 | 409 |
410 static PyObject* gPyGetLogicTicRate(PyObject*) | 410 static PyObject* gPyGetLogicTicRate(PyObject*) |
411 { | 411 { |
412 return PyFloat_FromDouble(KX_KetsjiEngine::GetTicRate()); | 412 return PyFloat_FromDouble(KX_KetsjiEngine::GetTicRate()); |
413 } | 413 } |
414 | 414 |
| 415 static PyObject* gPySetExitKey(PyObject*, PyObject* args) |
| 416 { |
| 417 short exitkey; |
| 418 if (!PyArg_ParseTuple(args, "h:setExitKey", &exitkey)) |
| 419 return NULL; |
| 420 KX_KetsjiEngine::SetExitKey(exitkey); |
| 421 Py_RETURN_NONE; |
| 422 } |
| 423 |
| 424 static PyObject* gPyGetExitKey(PyObject*) |
| 425 { |
| 426 return PyLong_FromSsize_t(KX_KetsjiEngine::GetExitKey()); |
| 427 } |
| 428 |
415 static PyObject* gPySetMaxLogicFrame(PyObject*, PyObject* args) | 429 static PyObject* gPySetMaxLogicFrame(PyObject*, PyObject* args) |
416 { | 430 { |
417 int frame; | 431 int frame; |
418 if (!PyArg_ParseTuple(args, "i:setMaxLogicFrame", &frame)) | 432 if (!PyArg_ParseTuple(args, "i:setMaxLogicFrame", &frame)) |
419 return NULL; | 433 return NULL; |
420 ········ | 434 ········ |
421 KX_KetsjiEngine::SetMaxLogicFrame(frame); | 435 KX_KetsjiEngine::SetMaxLogicFrame(frame); |
422 Py_RETURN_NONE; | 436 Py_RETURN_NONE; |
423 } | 437 } |
424 | 438 |
(...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
798 {"setGravity",(PyCFunction) gPySetGravity, METH_O, (const char *)"set Gr
avitation"}, | 812 {"setGravity",(PyCFunction) gPySetGravity, METH_O, (const char *)"set Gr
avitation"}, |
799 {"getSpectrum",(PyCFunction) gPyGetSpectrum, METH_NOARGS, (const char *)
"get audio spectrum"}, | 813 {"getSpectrum",(PyCFunction) gPyGetSpectrum, METH_NOARGS, (const char *)
"get audio spectrum"}, |
800 {"getMaxLogicFrame", (PyCFunction) gPyGetMaxLogicFrame, METH_NOARGS, (co
nst char *)"Gets the max number of logic frame per render frame"}, | 814 {"getMaxLogicFrame", (PyCFunction) gPyGetMaxLogicFrame, METH_NOARGS, (co
nst char *)"Gets the max number of logic frame per render frame"}, |
801 {"setMaxLogicFrame", (PyCFunction) gPySetMaxLogicFrame, METH_VARARGS, (c
onst char *)"Sets the max number of logic frame per render frame"}, | 815 {"setMaxLogicFrame", (PyCFunction) gPySetMaxLogicFrame, METH_VARARGS, (c
onst char *)"Sets the max number of logic frame per render frame"}, |
802 {"getMaxPhysicsFrame", (PyCFunction) gPyGetMaxPhysicsFrame, METH_NOARGS,
(const char *)"Gets the max number of physics frame per render frame"}, | 816 {"getMaxPhysicsFrame", (PyCFunction) gPyGetMaxPhysicsFrame, METH_NOARGS,
(const char *)"Gets the max number of physics frame per render frame"}, |
803 {"setMaxPhysicsFrame", (PyCFunction) gPySetMaxPhysicsFrame, METH_VARARGS
, (const char *)"Sets the max number of physics farme per render frame"}, | 817 {"setMaxPhysicsFrame", (PyCFunction) gPySetMaxPhysicsFrame, METH_VARARGS
, (const char *)"Sets the max number of physics farme per render frame"}, |
804 {"getLogicTicRate", (PyCFunction) gPyGetLogicTicRate, METH_NOARGS, (cons
t char *)"Gets the logic tic rate"}, | 818 {"getLogicTicRate", (PyCFunction) gPyGetLogicTicRate, METH_NOARGS, (cons
t char *)"Gets the logic tic rate"}, |
805 {"setLogicTicRate", (PyCFunction) gPySetLogicTicRate, METH_VARARGS, (con
st char *)"Sets the logic tic rate"}, | 819 {"setLogicTicRate", (PyCFunction) gPySetLogicTicRate, METH_VARARGS, (con
st char *)"Sets the logic tic rate"}, |
806 {"getPhysicsTicRate", (PyCFunction) gPyGetPhysicsTicRate, METH_NOARGS, (
const char *)"Gets the physics tic rate"}, | 820 {"getPhysicsTicRate", (PyCFunction) gPyGetPhysicsTicRate, METH_NOARGS, (
const char *)"Gets the physics tic rate"}, |
807 {"setPhysicsTicRate", (PyCFunction) gPySetPhysicsTicRate, METH_VARARGS,
(const char *)"Sets the physics tic rate"}, | 821 {"setPhysicsTicRate", (PyCFunction) gPySetPhysicsTicRate, METH_VARARGS,
(const char *)"Sets the physics tic rate"}, |
| 822 {"getExitKey", (PyCFunction) gPyGetExitKey, METH_NOARGS, (const char *)"
Gets the key used to exit the game engine"}, |
| 823 {"setExitKey", (PyCFunction) gPySetExitKey, METH_VARARGS, (const char *)
"Sets the key used to exit the game engine"}, |
808 {"getAverageFrameRate", (PyCFunction) gPyGetAverageFrameRate, METH_NOARG
S, (const char *)"Gets the estimated average frame rate"}, | 824 {"getAverageFrameRate", (PyCFunction) gPyGetAverageFrameRate, METH_NOARG
S, (const char *)"Gets the estimated average frame rate"}, |
809 {"getBlendFileList", (PyCFunction)gPyGetBlendFileList, METH_VARARGS, (co
nst char *)"Gets a list of blend files in the same directory as the current blen
d file"}, | 825 {"getBlendFileList", (PyCFunction)gPyGetBlendFileList, METH_VARARGS, (co
nst char *)"Gets a list of blend files in the same directory as the current blen
d file"}, |
810 {"PrintGLInfo", (PyCFunction)pyPrintExt, METH_NOARGS, (const char *)"Pri
nts GL Extension Info"}, | 826 {"PrintGLInfo", (PyCFunction)pyPrintExt, METH_NOARGS, (const char *)"Pri
nts GL Extension Info"}, |
811 {"PrintMemInfo", (PyCFunction)pyPrintStats, METH_NOARGS, (const char *)"
Print engine stastics"}, | 827 {"PrintMemInfo", (PyCFunction)pyPrintStats, METH_NOARGS, (const char *)"
Print engine stastics"}, |
812 ········ | 828 ········ |
813 /* library functions */ | 829 /* library functions */ |
814 {"LibLoad", (PyCFunction)gLibLoad, METH_VARARGS|METH_KEYWORDS, (const ch
ar *)""}, | 830 {"LibLoad", (PyCFunction)gLibLoad, METH_VARARGS|METH_KEYWORDS, (const ch
ar *)""}, |
815 {"LibNew", (PyCFunction)gLibNew, METH_VARARGS, (const char *)""}, | 831 {"LibNew", (PyCFunction)gLibNew, METH_VARARGS, (const char *)""}, |
816 {"LibFree", (PyCFunction)gLibFree, METH_VARARGS, (const char *)""}, | 832 {"LibFree", (PyCFunction)gLibFree, METH_VARARGS, (const char *)""}, |
817 {"LibList", (PyCFunction)gLibList, METH_VARARGS, (const char *)""}, | 833 {"LibList", (PyCFunction)gLibList, METH_VARARGS, (const char *)""}, |
(...skipping 1515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2333 | 2349 |
2334 // we need this so while blender is open (not blenderplayer) | 2350 // we need this so while blender is open (not blenderplayer) |
2335 // loading new blendfiles will reset this on starting the | 2351 // loading new blendfiles will reset this on starting the |
2336 // engine but loading blend files within the BGE wont overwrite gp_GamePythonPat
hOrig | 2352 // engine but loading blend files within the BGE wont overwrite gp_GamePythonPat
hOrig |
2337 void resetGamePythonPath() | 2353 void resetGamePythonPath() |
2338 { | 2354 { |
2339 gp_GamePythonPathOrig[0] = '\0'; | 2355 gp_GamePythonPathOrig[0] = '\0'; |
2340 } | 2356 } |
2341 | 2357 |
2342 #endif // WITH_PYTHON | 2358 #endif // WITH_PYTHON |
OLD | NEW |