Fixes for Camera objects and python:

Normalise clip planes for sphere testing.
Do a frustum-sphere <-> sphere test
Reference count all python objects (!)
This commit is contained in:
2004-05-21 09:18:42 +00:00
parent 22883f9232
commit 1217928e66
8 changed files with 186 additions and 76 deletions

View File

@@ -594,19 +594,40 @@ void setSandbox(TPythonSecurityLevel level)
}
}
/**
* Python is not initialised.
*/
PyObject* initGamePlayerPythonScripting(const STR_String& progname, TPythonSecurityLevel level)
{
STR_String pname = progname;
Py_SetProgramName(pname.Ptr());
Py_NoSiteFlag=1;
Py_FrozenFlag=1;
Py_Initialize();
//importBlenderModules()
setSandbox(level);
PyObject* moduleobj = PyImport_AddModule("__main__");
return PyModule_GetDict(moduleobj);
}
void exitGamePlayerPythonScripting()
{
Py_Finalize();
}
/**
* Python is already initialized.
*/
PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLevel level)
{
STR_String pname = progname;
Py_SetProgramName(pname.Ptr());
Py_NoSiteFlag=1;
Py_FrozenFlag=1;
#ifndef USE_BLENDER_PYTHON
Py_Initialize();
#else
BPY_start_python();
#endif
setSandbox(level);
PyObject* moduleobj = PyImport_AddModule("__main__");
@@ -617,11 +638,6 @@ PyObject* initGamePythonScripting(const STR_String& progname, TPythonSecurityLev
void exitGamePythonScripting()
{
#ifndef USE_BLENDER_PYTHON
Py_Finalize();
#else
BPY_end_python();
#endif
}