Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2010-11-29 16:04:03 +0000
committerStijn Buys <ingar@osirion.org>2010-11-29 16:04:03 +0000
commit8774e65cc503318005f34c133cbaee21b18fc144 (patch)
tree907c120079597398abfda5d4791ce58573009e7c /src/client/client.cc
parent2c7d185fdb03d17475deb9af1edaa82ffa51d4b6 (diff)
Parse command line options after engine initialization.
Diffstat (limited to 'src/client/client.cc')
-rw-r--r--src/client/client.cc26
1 files changed, 22 insertions, 4 deletions
diff --git a/src/client/client.cc b/src/client/client.cc
index ec2d002..97cfc91 100644
--- a/src/client/client.cc
+++ b/src/client/client.cc
@@ -113,12 +113,12 @@ void Client::init(int count, char **arguments)
quit(1);
}
- // initialize input
- input::init();
-
// initialize audio
audio::init();
+ // initialize input
+ input::init();
+
// add engine functions
core::Func *func = 0;
@@ -224,7 +224,7 @@ void Client::frame(unsigned long timestamp)
core::Application::frame(timestamp);
if (!connected()) {
- std::string module_label(core::Loader::label());
+ const std::string module_label(core::Loader::label());
// load the intro if nothing is running
if (load("intro")) {
@@ -589,6 +589,24 @@ void Client::func_menu(std::string const &args)
void Client::func_testmodel(std::string const &args)
{
+ // if testmodel is called from the command line, no module has been loaded yet
+ if (!client()->connected()) {
+ const std::string module_label(core::Loader::label());
+
+ // load the intro if nothing is running
+ if (client()->load("intro")) {
+ client()->connect("");
+ if (module_label.size())
+ client()->load(module_label);
+ }
+ }
+
+ if (!client()->connected()) {
+ client()->client_testmodelview->hide();
+ ui::console()->show();
+ return;
+ }
+
std::string modelname(args);
aux::trim(modelname);