Changeset View
Changeset View
Standalone View
Standalone View
source/gameengine/Ketsji/KX_PythonInit.cpp
| Show First 20 Lines • Show All 591 Lines • ▼ Show 20 Lines | |||||
| } | } | ||||
| PyDoc_STRVAR(gPyGetSceneList_doc, | PyDoc_STRVAR(gPyGetSceneList_doc, | ||||
| "getSceneList()\n" | "getSceneList()\n" | ||||
| "Return a list of converted scenes." | "Return a list of converted scenes." | ||||
| ); | ); | ||||
| static PyObject *gPyGetSceneList(PyObject *self) | static PyObject *gPyGetSceneList(PyObject *self) | ||||
| { | { | ||||
| KX_KetsjiEngine* m_engine = KX_GetActiveEngine(); | return KX_GetActiveEngine()->CurrentScenes()->GetProxy(); | ||||
| PyObject *list; | |||||
| KX_SceneList* scenes = m_engine->CurrentScenes(); | |||||
| int numScenes = scenes->size(); | |||||
| int i; | |||||
| list = PyList_New(numScenes); | |||||
| for (i=0;i<numScenes;i++) | |||||
| { | |||||
| KX_Scene* scene = scenes->at(i); | |||||
| PyList_SET_ITEM(list, i, scene->GetProxy()); | |||||
| } | |||||
| return list; | |||||
| } | } | ||||
| static PyObject *pyPrintStats(PyObject *,PyObject *,PyObject *) | static PyObject *pyPrintStats(PyObject *,PyObject *,PyObject *) | ||||
| { | { | ||||
| gp_KetsjiScene->GetSceneConverter()->PrintStats(); | gp_KetsjiScene->GetSceneConverter()->PrintStats(); | ||||
| Py_RETURN_NONE; | Py_RETURN_NONE; | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 597 Lines • ▼ Show 20 Lines | static PyObject *gPySetGLSLMaterialSetting(PyObject *, | ||||
| /* temporarily store the glsl settings in the scene for the GLSL materials */ | /* temporarily store the glsl settings in the scene for the GLSL materials */ | ||||
| GameData *gm= &(gp_KetsjiScene->GetBlenderScene()->gm); | GameData *gm= &(gp_KetsjiScene->GetBlenderScene()->gm); | ||||
| gm->flag = gs->glslflag; | gm->flag = gs->glslflag; | ||||
| /* display lists and GLSL materials need to be remade */ | /* display lists and GLSL materials need to be remade */ | ||||
| if (sceneflag != gs->glslflag) { | if (sceneflag != gs->glslflag) { | ||||
| GPU_materials_free(); | GPU_materials_free(); | ||||
| if (gp_KetsjiEngine) { | if (gp_KetsjiEngine) { | ||||
| KX_SceneList *scenes = gp_KetsjiEngine->CurrentScenes(); | CListValue *scenes = gp_KetsjiEngine->CurrentScenes(); | ||||
| KX_SceneList::iterator it; | |||||
| for (it=scenes->begin(); it!=scenes->end(); it++) | for (unsigned int sce_idx = 0; sce_idx < scenes->GetCount(); ++sce_idx) | ||||
| if ((*it)->GetBucketManager()) { | { | ||||
| (*it)->GetBucketManager()->ReleaseDisplayLists(); | KX_Scene* scene = (KX_Scene*)scenes->GetValue(sce_idx); | ||||
| (*it)->GetBucketManager()->ReleaseMaterials(); | if (scene->GetBucketManager()) { | ||||
| scene->GetBucketManager()->ReleaseDisplayLists(); | |||||
| scene->GetBucketManager()->ReleaseMaterials(); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| } | } | ||||
| Py_RETURN_NONE; | Py_RETURN_NONE; | ||||
| } | } | ||||
| static PyObject *gPyGetGLSLMaterialSetting(PyObject *, | static PyObject *gPyGetGLSLMaterialSetting(PyObject *, | ||||
| PyObject *args, | PyObject *args, | ||||
| ▲ Show 20 Lines • Show All 1,463 Lines • Show Last 20 Lines | |||||