diff options
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/Makefile.am | 12 | ||||
-rw-r--r-- | src/core/core.cc | 26 | ||||
-rw-r--r-- | src/core/core.h | 4 |
3 files changed, 31 insertions, 11 deletions
diff --git a/src/core/Makefile.am b/src/core/Makefile.am index 0f0020f..1f1cc2e 100644 --- a/src/core/Makefile.am +++ b/src/core/Makefile.am @@ -1,12 +1,12 @@ METASOURCES = AUTO INCLUDES = -I$(top_srcdir)/src -libcore_la_SOURCES = core.cc -libcore_la_LDFLAGS = -avoid-version -no-undefined -libcore_la_LIBADD = $(top_builddir)/src/common/libcommon.la \ - $(top_builddir)/src/math/libmath.la \ - $(top_builddir)/src/filesystem/libfilesystem.la +libcore_la_SOURCES = core.cc game.cc +libcore_la_LDFLAGS = -avoid-version +libcore_la_LIBADD = $(top_builddir)/src/math/libmath.la \ + $(top_builddir)/src/common/libcommon.la \ + $(top_builddir)/src/filesystem/libfilesystem.la noinst_LTLIBRARIES = libcore.la -noinst_HEADERS = core.h +noinst_HEADERS = core.h game.h diff --git a/src/core/core.cc b/src/core/core.cc index b576ba5..0a4ed60 100644 --- a/src/core/core.cc +++ b/src/core/core.cc @@ -12,23 +12,39 @@ namespace core { -/// initialize the core -void init() { +void init() +{ + con_debug << "Initializing core..." << std::endl; + common::init(); filesystem::init(); + + if (::core::Game::instance()) + ::core::Game::instance()->init(); + else + con_warn << "No game module found!" << std::endl; - con_debug << "Initializing core..." << std::endl; } -/// shutdown the core -void shutdown() { +void shutdown() +{ con_debug << "Shutting down core..." << std::endl; + if (::core::Game::instance()) + ::core::Game::instance()->shutdown(); + else + con_warn << "No game module found!" << std::endl; + filesystem::shutdown(); common::shutdown(); } +void frame(float sec) +{ + if (::core::Game::instance()) + ::core::Game::instance()->frame(sec); } +} //namespace core diff --git a/src/core/core.h b/src/core/core.h index d5e4542..09c7209 100644 --- a/src/core/core.h +++ b/src/core/core.h @@ -16,7 +16,11 @@ namespace core /// shutdown the core void shutdown(); + /// run one frame + void frame(float sec); }; +#include "core/game.h" + #endif // __INCLUDED_CORE_H__ |