From 48bcecff9ae0065f8411afec398cc2f1be8b8179 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Fri, 8 Jul 2016 23:53:20 -0700 Subject: [PATCH] Block space switching when requested space type matches current --- Editor/Space.cpp | 20 ++++++++++++++++---- Editor/main.cpp | 15 ++++++++++----- 2 files changed, 26 insertions(+), 9 deletions(-) diff --git a/Editor/Space.cpp b/Editor/Space.cpp index 55ce751d5..cb6fdb0db 100644 --- a/Editor/Space.cpp +++ b/Editor/Space.cpp @@ -243,10 +243,22 @@ void Space::SpaceMenuNode::SubNode::activated(const boo::SWindowCoord &coord) std::unique_ptr newSpace; switch(m_data.m_cls) { - case Class::InformationCenter: newSpace.reset(new InformationCenter(m_space.m_parent->m_vm, m_space.m_parent)); break; - case Class::EffectEditor: newSpace.reset(new EffectEditor(m_space.m_parent->m_vm, m_space.m_parent)); break; - case Class::ResourceBrowser: newSpace.reset(new ResourceBrowser(m_space.m_parent->m_vm, m_space.m_parent)); break; - case Class::ModelViewer: newSpace.reset(new ModelViewer(m_space.m_parent->m_vm, m_space.m_parent)); break; + case Class::InformationCenter: + if (typeid(InformationCenter) != typeid(m_space)) + newSpace.reset(new InformationCenter(m_space.m_parent->m_vm, m_space.m_parent)); + break; + case Class::EffectEditor: + if (typeid(EffectEditor) != typeid(m_space)) + newSpace.reset(new EffectEditor(m_space.m_parent->m_vm, m_space.m_parent)); + break; + case Class::ResourceBrowser: + if (typeid(ResourceBrowser) != typeid(m_space)) + newSpace.reset(new ResourceBrowser(m_space.m_parent->m_vm, m_space.m_parent)); + break; + case Class::ModelViewer: + if (typeid(ModelViewer) != typeid(m_space)) + newSpace.reset(new ModelViewer(m_space.m_parent->m_vm, m_space.m_parent)); + break; default: break; } if (newSpace) diff --git a/Editor/main.cpp b/Editor/main.cpp index 6c587e654..e536a4f34 100644 --- a/Editor/main.cpp +++ b/Editor/main.cpp @@ -35,6 +35,8 @@ struct Application : boo::IApplicationCallback m_viewManager.reset(new ViewManager(m_fileMgr, m_cvarManager)); } + virtual ~Application() = default; + int appMain(boo::IApplication* app) { initialize(app); @@ -53,12 +55,9 @@ struct Application : boo::IApplicationCallback { m_running = false; } - void appFilesOpen(boo::IApplication*, const std::vector&) - { + void appFilesOpen(boo::IApplication*, const std::vector&); - } - - void initialize(boo::IApplication* app) + void initialize(boo::IApplication* /*app*/) { zeus::detectCPU(); //hecl::VerbosityLevel = 1; @@ -102,6 +101,12 @@ struct Application : boo::IApplicationCallback } }; +/* This is here to prevent a vtable being dumped into every translation unit */ +void Application::appFilesOpen(boo::IApplication *, const std::vector &) +{ + +} + } #if _WIN32