diff options
Diffstat (limited to 'src/client/client.cc')
| -rw-r--r-- | src/client/client.cc | 26 | 
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);  | 
