diff options
-rw-r--r-- | source/gameengine/GamePlayer/ghost/GPG_Application.cpp | 1 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.cpp | 18 | ||||
-rw-r--r-- | source/gameengine/Ketsji/KX_KetsjiEngine.h | 7 |
3 files changed, 26 insertions, 0 deletions
diff --git a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp index 58710120afa..31ce1869544 100644 --- a/source/gameengine/GamePlayer/ghost/GPG_Application.cpp +++ b/source/gameengine/GamePlayer/ghost/GPG_Application.cpp @@ -503,6 +503,7 @@ bool GPG_Application::processEvent(GHOST_IEvent* event) GHOST_Rect bnds; window->getClientBounds(bnds); m_canvas->Resize(bnds.getWidth(), bnds.getHeight()); + m_ketsjiengine->Resize(); } } break; diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp index fab19008b25..3abc129521e 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.cpp +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.cpp @@ -2012,6 +2012,24 @@ void KX_KetsjiEngine::GetOverrideFrameColor(float& r, float& g, float& b) const b = m_overrideFrameColorB; } + +void KX_KetsjiEngine::Resize() +{ + KX_SceneList::iterator sceneit; + + /* extended mode needs to recalculate camera frustrums when */ + KX_Scene* firstscene = *m_scenes.begin(); + const RAS_FrameSettings &framesettings = firstscene->GetFramingType(); + + if (framesettings.FrameType() == RAS_FrameSettings::e_frame_extend) { + for (sceneit = m_scenes.begin();sceneit != m_scenes.end(); sceneit++) { + KX_Camera* cam = ((KX_Scene *)*sceneit)->GetActiveCamera(); + cam->InvalidateProjectionMatrix(); + } + } +} + + void KX_KetsjiEngine::SetGlobalSettings(GlobalSettings* gs) { m_globalsettings.matmode = gs->matmode; diff --git a/source/gameengine/Ketsji/KX_KetsjiEngine.h b/source/gameengine/Ketsji/KX_KetsjiEngine.h index fdfe0551d18..0d7e41d7568 100644 --- a/source/gameengine/Ketsji/KX_KetsjiEngine.h +++ b/source/gameengine/Ketsji/KX_KetsjiEngine.h @@ -420,6 +420,13 @@ public: GlobalSettings* GetGlobalSettings(void); void SetGlobalSettings(GlobalSettings* gs); + /** + * Invalidate all the camera matrices and handle other + * needed changes when resized. + * It's only called from Blenderplayer. + */ + void Resize(); + protected: /** * Processes all scheduled scene activity. |