From b3ec839e89828224a178f4aca5dcbb75dd5b4ff1 Mon Sep 17 00:00:00 2001 From: Glyn Leine Date: Tue, 10 Dec 2024 17:47:11 +0100 Subject: [PATCH] small rework of entry point --- src/core/entry/entry_point.hpp | 10 ++++++---- src/core/program/program.hpp | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/core/entry/entry_point.hpp b/src/core/entry/entry_point.hpp index cda4d94..1c9beb4 100644 --- a/src/core/entry/entry_point.hpp +++ b/src/core/entry/entry_point.hpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "..\program\program.hpp" @@ -18,10 +19,10 @@ /**@brief Reports engine modules to the engine, must be implemented by you. - * @param [in] engine The engine object as ptr * + * @param [in] engine The engine object * @ref rythe::core::Engine::reportModule() */ -extern int reportModules(rythe::core::Program& program); +extern rsl::result init_program(rythe::core::Program& program); #if defined(RYTHE_ENTRY) @@ -35,9 +36,10 @@ int main(int argc, char** argv) { rsl::log::setup(); rythe::core::Program program; - if (int result = reportModules(program); result != 0) + + if (auto errorCode = init_program(program).report_errors(); errorCode != rsl::no_error_code) { - return result; + return static_cast(errorCode); } program.initialize(); diff --git a/src/core/program/program.hpp b/src/core/program/program.hpp index b2762a1..318c6b0 100644 --- a/src/core/program/program.hpp +++ b/src/core/program/program.hpp @@ -66,11 +66,11 @@ namespace rythe::core } } - bool isRunning() { return m_running; } + [[rythe_always_inline]] bool isRunning() { return m_running; } - void stop() { m_running = false; } + [[rythe_always_inline]] void stop() { m_running = false; } - Engine& addEngineInstance() + [[rythe_always_inline]] Engine& addEngineInstance() { return *(m_engines.emplace(m_lastIdx, std::make_unique(Engine{m_lastIdx++})).first->second); }