mirror of https://github.com/AxioDL/metaforce.git
Add space switching
This commit is contained in:
parent
8b1f70c5cd
commit
4f401acdca
|
@ -9,17 +9,6 @@ void ModelViewer::View::resized(const boo::SWindowRect& root, const boo::SWindow
|
|||
m_scissorRect = sub;
|
||||
}
|
||||
|
||||
void ModelViewer::View::draw(boo::IGraphicsCommandQueue* gfxQ)
|
||||
{
|
||||
gfxQ->setScissor(m_scissorRect);
|
||||
m_mv.m_lineRenderer->Reset();
|
||||
m_mv.m_lineRenderer->AddVertex({-0.5f, 0.f, -0.5f}, zeus::CColor::skBlue, 1.f);
|
||||
m_mv.m_lineRenderer->AddVertex({-0.5f, 0.f, 0.5f}, zeus::CColor::skBlue, 1.f);
|
||||
m_mv.m_lineRenderer->AddVertex({0.5f, 10.f, 0.5f}, zeus::CColor::skRed, 3.f);
|
||||
m_mv.m_lineRenderer->AddVertex({0.5f, 0.f, -0.5f}, zeus::CColor::skBlue, 1.f);
|
||||
m_mv.m_lineRenderer->Render();
|
||||
gfxQ->setScissor({});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -36,7 +36,6 @@ class ModelViewer : public ViewerSpace
|
|||
: specter::View(res, mv.m_vm.rootView()), m_mv(mv) {}
|
||||
|
||||
void resized(const boo::SWindowRect& root, const boo::SWindowRect& sub);
|
||||
void draw(boo::IGraphicsCommandQueue *gfxQ);
|
||||
};
|
||||
|
||||
Camera m_camera;
|
||||
|
|
|
@ -38,6 +38,8 @@ public:
|
|||
{
|
||||
return new EffectEditor(m_vm, parent, *this);
|
||||
}
|
||||
|
||||
bool usesToolbar() const { return true; }
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -238,4 +238,23 @@ RootSpace* Space::NewRootSpaceFromConfigStream(ViewManager& vm, ConfigReader& r)
|
|||
return new RootSpace(vm, r);
|
||||
}
|
||||
|
||||
void Space::SpaceMenuNode::SubNode::activated(const boo::SWindowCoord &coord)
|
||||
{
|
||||
std::unique_ptr<Space> 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;
|
||||
default: break;
|
||||
}
|
||||
if (newSpace)
|
||||
{
|
||||
Space* parent = m_space.m_parent;
|
||||
m_space.m_parent->exchangeSpaceSplitJoin(&m_space, std::move(newSpace));
|
||||
parent->m_vm.BuildSpaceViews();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
Space& m_space;
|
||||
const SubNodeData& m_data;
|
||||
const std::string* text() const {return &m_data.m_text;}
|
||||
void activated(const boo::SWindowCoord& coord) {}
|
||||
void activated(const boo::SWindowCoord& coord);
|
||||
|
||||
SubNode(Space& space, const SubNodeData& data) : m_space(space), m_data(data) {}
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue