From 1d518a54914531d7a4fab3a6835b75de85bd7bc7 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 9 Jul 2014 19:18:31 +0000 Subject: Initial support for multi-layered materials, requires shaders files in the new format. --- src/render/textures.cc | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) (limited to 'src/render/textures.cc') diff --git a/src/render/textures.cc b/src/render/textures.cc index 5a90640..bd75a45 100644 --- a/src/render/textures.cc +++ b/src/render/textures.cc @@ -24,11 +24,6 @@ GLuint Textures::textures_cubemap_id; math::Vector2f Textures::texture_size[MAXTEXTURES]; std::string textures_cubemapname; -void material_loader_func(model::Material *material) -{ - Textures::material_loader(material); -} - void Textures::init() { con_print << "^BLoading textures..." << std::endl; @@ -57,12 +52,12 @@ void Textures::init() load("bitmaps/pointers/control"); load("bitmaps/pointers/target"); - model::Material::set_loader_func(Textures::material_loader); + model::Material::set_imageloader_func(Textures::image_loader); } void Textures::shutdown() { - model::Material::set_loader_func(0); + model::Material::set_imageloader_func(0); clear(); } @@ -416,12 +411,12 @@ size_t Textures::bind(const size_t texture, const bool filter) return id; } -void Textures::material_loader(model::Material *material) +void Textures::image_loader(model::Layer *layer) { - if (material->has_flag(model::Material::FlagTexture) && (material->texture().size() > 0)) { - size_t id = load(material->texture()); - material->set_texture_id(id); - material->set_size(texture_size[id]); + if (layer->texture().size() > 0 ) { + size_t id = load(layer->texture()); + layer->set_texture_id(id); + layer->set_size(texture_size[id]); } } -- cgit v1.2.3