Tank wheel pair!

This commit is contained in:
2014-05-30 01:04:09 +02:00
parent 701ca06a65
commit 235a03ab4c
5 changed files with 143 additions and 314 deletions
+8 -9
View File
@@ -18,7 +18,7 @@ public:
GameFrame(Frame* parent, std::string name)
: Frame(parent, name)
{
EVENT_SUBSCRIBE_MEMBER(m_EInputCommand, &GameFrame::OnCommand);
EVENT_SUBSCRIBE_MEMBER(m_EKeyUp, &GameFrame::OnKeyUp);
m_World = std::make_shared<GameWorld>(EventBroker, ResourceManager);
auto worldFrame = new WorldFrame(this, "GameWorldFrame", m_World);
@@ -40,22 +40,21 @@ public:
}
private:
EventRelay<Frame, Events::InputCommand> m_EInputCommand;
EventRelay<Frame, Events::KeyUp> m_EKeyUp;
std::shared_ptr<GameWorld> m_World;
Viewport* vp1;
Viewport* vp2;
Viewport* m_FreeCamViewport;
bool OnCommand(const Events::InputCommand &event)
bool OnKeyUp(const Events::KeyUp &event)
{
if (event.Command == "cam_vertical" || event.Command == "cam_horizontal" || event.Command == "cam_normal" || event.Command == "cam_lock")
if (event.KeyCode == GLFW_KEY_1)
{
m_FreeCamViewport->Show();
}
else
{
m_FreeCamViewport->Hide();
if (m_FreeCamViewport->Hidden())
m_FreeCamViewport->Show();
else
m_FreeCamViewport->Hide();
}
return true;