From 324f5431245f2a550acddea70ea72770430a19d1 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 9 Aug 2009 16:34:38 +0000 Subject: initial .ase support --- src/model/model.cc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'src/model/model.cc') 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; -- cgit v1.2.3