diff options
Diffstat (limited to 'source/gameengine/Ketsji/KX_Scene.cpp')
-rw-r--r-- | source/gameengine/Ketsji/KX_Scene.cpp | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/source/gameengine/Ketsji/KX_Scene.cpp b/source/gameengine/Ketsji/KX_Scene.cpp index 0605650bb09..1db174d72be 100644 --- a/source/gameengine/Ketsji/KX_Scene.cpp +++ b/source/gameengine/Ketsji/KX_Scene.cpp @@ -323,7 +323,10 @@ list<class KX_Camera*>* KX_Scene::GetCameras() return &m_cameras; } - +list<class KX_FontObject*>* KX_Scene::GetFonts() +{ + return &m_fonts; +} void KX_Scene::SetFramingType(RAS_FrameSettings & frame_settings) { @@ -1014,6 +1017,9 @@ int KX_Scene::NewRemoveObject(class CValue* gameobj) // in case this is a camera m_cameras.remove((KX_Camera*)newobj); + // in case this is a font + m_fonts.remove((KX_FontObject*)newobj); + /* currently does nothing, keep incase we need to Unregister something */ #if 0 if (m_sceneConverter) @@ -1188,6 +1194,27 @@ void KX_Scene::ReplaceMesh(class CValue* obj,void* meshobj, bool use_gfx, bool u #endif } +/* Font Object routines */ +void KX_Scene::AddFont(KX_FontObject* font) +{ + if (!FindFont(font)) + m_fonts.push_back(font); +} + +KX_FontObject* KX_Scene::FindFont(KX_FontObject* font) +{ + list<KX_FontObject*>::iterator it = m_fonts.begin(); + + while ( (it != m_fonts.end()) + && ((*it) != font) ) { + ++it; + } + + return ((it == m_fonts.end()) ? NULL : (*it)); +} + + +/* Camera Object routines */ KX_Camera* KX_Scene::FindCamera(KX_Camera* cam) { list<KX_Camera*>::iterator it = m_cameras.begin(); |