Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-01-31 18:22:44 +0000
committerStijn Buys <ingar@osirion.org>2008-01-31 18:22:44 +0000
commitf794b9ee52293cefd6ac73fdf0d2a01c5388f057 (patch)
tree2838d7ee11ae49e2e519ad604ba41f7071fb8288 /src/core
parent1ddff2045848da5136e9e8131e335ac7626b8f68 (diff)
modular system works now
Diffstat (limited to 'src/core')
-rw-r--r--src/core/Makefile.am12
-rw-r--r--src/core/core.cc26
-rw-r--r--src/core/core.h4
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__