| 79 | |
| 80 | #if PY_MAJOR_VERSION == 2 |
| 81 | const char* InitializeForPython() |
| 82 | { |
| 83 | const PyMethodDef dummyMethods[] = { 0 }; |
| 84 | |
| 85 | // put myself into python as a module |
| 86 | PyObject* module = Py_InitModule( CCP_STRINGIZE( CCP_CONCATENATE( TRINITYNAME, CCP_BUILD_FLAVOR ) ), (PyMethodDef*)dummyMethods ); |
| 87 | PyObject* dict = PyModule_GetDict( module ); |
| 88 | |
| 89 | // constants |
| 90 | AddTriConstants( dict ); |
| 91 | |
| 92 | // put UI into python as a separate module |
| 93 | PyObject* uiModule = Py_InitModule( "triui", (PyMethodDef*)dummyMethods ); |
| 94 | PyObject* uiDict = PyModule_GetDict( uiModule ); |
| 95 | |
| 96 | AddScancodesToDict( uiDict ); |
| 97 | AddUIChoosersToDict( uiDict ); |
| 98 | |
| 99 | BLUE_REGISTER_THUNKER( ITriScalarFunction_Thunk::Defs(), ITriScalarFunction_Thunk::IID() ); |
| 100 | BLUE_REGISTER_THUNKER( ITriVectorFunction_Thunk::Defs(), ITriVectorFunction_Thunk::IID() ); |
| 101 | BLUE_REGISTER_THUNKER( ITriQuaternionFunction_Thunk::Defs(), ITriQuaternionFunction_Thunk::IID() ); |
| 102 | BLUE_REGISTER_THUNKER( ITriColorFunction_Thunk::Defs(), ITriColorFunction_Thunk::IID() ); |
| 103 | |
| 104 | BlueRegisterToModule( module, BlueRegistration::GetClassRegs(), BlueRegistration::GetFuncRegs(), BlueRegistration::GetEnumRegs(), BlueRegistration::GetTestRegs(), BlueRegistration::GetThunkerRegs(), BlueRegistration::GetFuncSignatures() ); |
| 105 | |
| 106 | BlueRegisterObjectsToModule( module, BlueRegistration::GetObjectRegs() ); |
| 107 | BlueRegisterExceptionsToModule( module, BlueRegistration::GetExceptionRegs() ); |
| 108 | |
| 109 | PyModule_AddObject( module, "settings", BlueWrapObjectForPython( &Tr2Renderer::GetSettings() ) ); |
| 110 | PyModule_AddObject( module, "fontMan", BlueWrapObjectForPython( g_fontManager ) ); |
| 111 | |
| 112 | return NULL; |
| 113 | } |
| 114 | #else |
| 115 | PyObject* InitializeForPython() |
| 116 | { |
no test coverage detected