diff options
author | Stijn Buys <ingar@osirion.org> | 2009-08-10 22:32:36 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2009-08-10 22:32:36 +0000 |
commit | bd142a328328cdf0cbfbb59e4e0aa99dd51184b8 (patch) | |
tree | c2ed4e832e60b379723ea3f530c5b192bec0da61 /src/model/map.cc | |
parent | bbd04914749b2e3918796fe331daf649b06163ea (diff) |
initial texture support for ase models
Diffstat (limited to 'src/model/map.cc')
-rw-r--r-- | src/model/map.cc | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/model/map.cc b/src/model/map.cc index 8165e3a..9cb5295 100644 --- a/src/model/map.cc +++ b/src/model/map.cc @@ -434,16 +434,13 @@ void Map::make_brushface(Plane *face) if (vl.size() > 2) { - Material *material = Material::find(face->texture()); + Material *material = Material::find("textures/" + face->texture()); + if (!material) { - material = new Material(face->texture()); + material = new Material("textures/" + face->texture()); Material::add(material); - material->set_color(math::Color(1.0, 0.0f, 1.0f)); - material->set_flags(Material::Bright); - - // don't show material warnings on a dedicated server - if (VertexArray::instance()) - con_warn << "Unkown material '" << face->texture() << "'" << std::endl; + material->set_flags(Material::Texture); + material->set_texture(material->name()); } // find the list if primitives for the current material, allocate a new one if necessary |