Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/applicationinterface.cc')
-rw-r--r--src/core/applicationinterface.cc25
1 files changed, 22 insertions, 3 deletions
diff --git a/src/core/applicationinterface.cc b/src/core/applicationinterface.cc
index 209a4f5..9a2cce2 100644
--- a/src/core/applicationinterface.cc
+++ b/src/core/applicationinterface.cc
@@ -14,6 +14,17 @@
namespace core {
+// --------------- function repository ------------------------------
+extern "C" void func_print(std::stringstream &args) {
+ char text[MAXCMDSIZE];
+ if(args.getline(text, MAXCMDSIZE))
+ con_print << args << std::endl;
+}
+
+extern "C" void func_help(std::stringstream &args) {
+ con_print << "This is the help function" << std::endl;
+}
+
// --------------- signal_handler -----------------------------------
extern "C" void signal_handler(int signum)
{
@@ -71,10 +82,14 @@ void ApplicationInterface::init()
con_debug << "Initializing core..." << std::endl;
+ // register our functions
+ func::add("print", func_print);
+ func::add("help", func_help);
+
if (game())
game()->init();
else
- con_warn << "No game module found!" << std::endl;
+ con_warn << "No game module loaded!" << std::endl;
}
@@ -85,7 +100,7 @@ void ApplicationInterface::shutdown()
if (game())
game()->shutdown();
else
- con_warn << "No game module found!" << std::endl;
+ con_warn << "No game module loaded!" << std::endl;
filesystem::shutdown();
}
@@ -97,8 +112,12 @@ void ApplicationInterface::quit(int status)
void ApplicationInterface::frame(float seconds)
{
- if (game())
+ if (game()) {
game()->frame(seconds);
+ }
+
+ // execute commands in the buffer
+ commandbuffer::execute();
}
}