From a9aa8d4a703c22f63bac463b4c62b9d9a11a17b2 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Thu, 11 Jan 2018 01:38:08 -0800 Subject: [PATCH] Initial `Console` implementation --- Editor/main.cpp | 11 ++++++++++- hecl | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Editor/main.cpp b/Editor/main.cpp index 33baa0312..714815c7a 100644 --- a/Editor/main.cpp +++ b/Editor/main.cpp @@ -6,6 +6,7 @@ #include "ViewManager.hpp" #include "hecl/hecl.hpp" #include "hecl/CVarCommons.hpp" +#include "hecl/Console.hpp" static logvisor::Module AthenaLog("Athena"); static void AthenaExc(athena::error::Level level, const char* file, @@ -58,6 +59,7 @@ struct Application : boo::IApplicationCallback hecl::Runtime::FileStoreManager m_fileMgr; hecl::CVarManager m_cvarManager; hecl::CVarCommons m_cvarCommons; + hecl::Console m_console; std::unique_ptr m_viewManager; bool m_running = true; @@ -65,9 +67,11 @@ struct Application : boo::IApplicationCallback Application() : m_fileMgr(_S("urde")), m_cvarManager(m_fileMgr), - m_cvarCommons(m_cvarManager) + m_cvarCommons(m_cvarManager), + m_console(&m_cvarManager) { m_viewManager = std::make_unique(m_fileMgr, m_cvarManager); + m_console.registerCommand("quit", "Quits application instantly", "", std::bind(&Application::quit, this, std::placeholders::_1)); } virtual ~Application() = default; @@ -137,6 +141,11 @@ struct Application : boo::IApplicationCallback { return m_cvarCommons.getAnisotropy(); } + + void quit(const std::vector& arg = std::vector()) + { + m_running = false; + } }; } diff --git a/hecl b/hecl index 9ddfcff49..dfc6bca2e 160000 --- a/hecl +++ b/hecl @@ -1 +1 @@ -Subproject commit 9ddfcff4920ff69cc76023a37263beed453aebb9 +Subproject commit dfc6bca2e4a993ef1027d59fb3078195dc806f40