diff options
| author | Stijn Buys <ingar@osirion.org> | 2009-08-09 16:34:38 +0000 | 
|---|---|---|
| committer | Stijn Buys <ingar@osirion.org> | 2009-08-09 16:34:38 +0000 | 
| commit | 324f5431245f2a550acddea70ea72770430a19d1 (patch) | |
| tree | aa05d127c20f5bb5995a3fdceb915b5280887e4b /src/model/model.cc | |
| parent | b808c0e24cc4a59bd801059147bc9805944bee9a (diff) | |
initial .ase support
Diffstat (limited to 'src/model/model.cc')
| -rw-r--r-- | src/model/model.cc | 16 | 
1 files changed, 13 insertions, 3 deletions
diff --git a/src/model/model.cc b/src/model/model.cc index 3ec75d7..3ed5a93 100644 --- a/src/model/model.cc +++ b/src/model/model.cc @@ -5,6 +5,7 @@  */  #include "sys/sys.h" +#include "model/asefile.h"  #include "model/model.h"  #include "model/map.h"  #include "model/vertexarray.h" @@ -101,10 +102,19 @@ Model *Model::load(std::string const & name)  {  	Model *model = find(name);  	if (!model) { +		// try loading the .map model  		model = Map::load(name); -		if (model) { -			model_registry[model->name()] = model; -		} +	} +		 +	if (!model) { +		// if it can't be found, try the ase model +		model = ASEFile::load(name); +	} +	 +	if (!model) {	 +		con_warn << "Could not load maps/" << name << ".map or models/" << name << ".ase" << std::endl; +	} else { +		model_registry[model->name()] = model;  	}  	return model;  | 
