mirror of https://github.com/AxioDL/metaforce.git
Initial `Console` implementation
This commit is contained in:
parent
8f725d902e
commit
a9aa8d4a70
|
@ -6,6 +6,7 @@
|
||||||
#include "ViewManager.hpp"
|
#include "ViewManager.hpp"
|
||||||
#include "hecl/hecl.hpp"
|
#include "hecl/hecl.hpp"
|
||||||
#include "hecl/CVarCommons.hpp"
|
#include "hecl/CVarCommons.hpp"
|
||||||
|
#include "hecl/Console.hpp"
|
||||||
|
|
||||||
static logvisor::Module AthenaLog("Athena");
|
static logvisor::Module AthenaLog("Athena");
|
||||||
static void AthenaExc(athena::error::Level level, const char* file,
|
static void AthenaExc(athena::error::Level level, const char* file,
|
||||||
|
@ -58,6 +59,7 @@ struct Application : boo::IApplicationCallback
|
||||||
hecl::Runtime::FileStoreManager m_fileMgr;
|
hecl::Runtime::FileStoreManager m_fileMgr;
|
||||||
hecl::CVarManager m_cvarManager;
|
hecl::CVarManager m_cvarManager;
|
||||||
hecl::CVarCommons m_cvarCommons;
|
hecl::CVarCommons m_cvarCommons;
|
||||||
|
hecl::Console m_console;
|
||||||
std::unique_ptr<ViewManager> m_viewManager;
|
std::unique_ptr<ViewManager> m_viewManager;
|
||||||
|
|
||||||
bool m_running = true;
|
bool m_running = true;
|
||||||
|
@ -65,9 +67,11 @@ struct Application : boo::IApplicationCallback
|
||||||
Application() :
|
Application() :
|
||||||
m_fileMgr(_S("urde")),
|
m_fileMgr(_S("urde")),
|
||||||
m_cvarManager(m_fileMgr),
|
m_cvarManager(m_fileMgr),
|
||||||
m_cvarCommons(m_cvarManager)
|
m_cvarCommons(m_cvarManager),
|
||||||
|
m_console(&m_cvarManager)
|
||||||
{
|
{
|
||||||
m_viewManager = std::make_unique<ViewManager>(m_fileMgr, m_cvarManager);
|
m_viewManager = std::make_unique<ViewManager>(m_fileMgr, m_cvarManager);
|
||||||
|
m_console.registerCommand("quit", "Quits application instantly", "", std::bind(&Application::quit, this, std::placeholders::_1));
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual ~Application() = default;
|
virtual ~Application() = default;
|
||||||
|
@ -137,6 +141,11 @@ struct Application : boo::IApplicationCallback
|
||||||
{
|
{
|
||||||
return m_cvarCommons.getAnisotropy();
|
return m_cvarCommons.getAnisotropy();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void quit(const std::vector<std::string>& arg = std::vector<std::string>())
|
||||||
|
{
|
||||||
|
m_running = false;
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
2
hecl
2
hecl
|
@ -1 +1 @@
|
||||||
Subproject commit 9ddfcff4920ff69cc76023a37263beed453aebb9
|
Subproject commit dfc6bca2e4a993ef1027d59fb3078195dc806f40
|
Loading…
Reference in New Issue