1 #include <BLIB/Engine.hpp>
2 #include <BLIB/Logging.hpp>
3 #include <BLIB/Resources.hpp>
4 #include <BLIB/Util/Waiter.hpp>
21 bl::logging::Config::rollLogs(
"logs",
"editor", 3);
22 bl::logging::Config::configureOutput(std::cout, bl::logging::Config::Debug);
23 bl::logging::Config::addFileOutput(
"logs/editor.log", bl::logging::Config::Debug);
25 BL_LOG_INFO <<
"Loading application properties";
27 BL_LOG_ERROR <<
"Failed to load application properties";
31 BL_LOG_INFO <<
"Initializing resource systems";
34 BL_LOG_INFO <<
"Loading game metadata";
35 BL_LOG_INFO <<
"Loading items";
38 BL_LOG_ERROR <<
"Failed to load item database";
42 BL_LOG_INFO <<
"Loading moves";
45 BL_LOG_ERROR <<
"Failed to load move database";
49 BL_LOG_INFO <<
"Loading Peoplemon";
52 BL_LOG_ERROR <<
"Failed to load peoplemon database";
56 BL_LOG_INFO <<
"Game metadata loaded";
59 BL_LOG_INFO <<
"Registered factories for custom GUI elements";
62 BL_LOG_INFO <<
"Creating engine instance";
63 const bl::engine::Settings engineSettings =
64 bl::engine::Settings()
65 .withWindowParameters(
66 bl::engine::Settings::WindowParameters()
70 .withStyle(sf::Style::Close | sf::Style::Titlebar | sf::Style::Resize)
71 .withTitle(
"Peoplemon Editor")
72 .withIcon(
"EditorResources/icon.png")
73 .withLetterBoxOnResize(
false)
74 .withSyncOverlaySizeToWindow(
true))
75 .withAllowVariableTimestep(
false);
76 bl::engine::Engine engine(engineSettings);
77 BL_LOG_INFO <<
"Created engine";
79 BL_LOG_INFO <<
"Initializing game systems";
81 BL_LOG_INFO <<
"Core game systems initialized";
83 BL_LOG_INFO <<
"Running engine main loop";
85 BL_LOG_ERROR <<
"Engine exited with error";
86 bl::util::Waiter::unblockAll();
90 BL_LOG_INFO <<
"Unblocking waiting threads";
91 bl::util::Waiter::unblockAll();
94 BL_LOG_INFO <<
"Freeing resources";
95 bl::resource::GarbageCollector::shutdownAndClear();
97 BL_LOG_INFO <<
"Exiting normally";
void installDevLoaders()
Sets up the BLIB resource managers in dev mode.
Loads and stores metadata surrounding items in the game.
bool load()
Loads the item metadata from the data file.
Stores the metadata of all peoplemon moves.
bool load()
Loads the moves from the data file.
Data structure that holds the underlaying data for all the peoplemon.
bool load()
Loads the database data from the save file.
static void setDataSource(file::ItemDB &source)
Set the data source for the item methods.
static void setDataSource(file::MoveDB &source)
Set the data source for each method.
static void setDataSource(file::PeoplemonDB &data)
Sets the data source for all peoplemon. Must remain in scope.
static int WindowHeight()
static bool load(bool inEditor)
Loads from the config file and sets defaults. Must be called before using any properties.
Owns all primary systems and a reference to the engine.
static Ptr create(core::system::Systems &systems)
Construct a new Main Editor state.
static void registerCustomGuiComponents()
Registers renderer components for custom GUI elements.