Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2014-07-09 19:18:31 +0000
committerStijn Buys <ingar@osirion.org>2014-07-09 19:18:31 +0000
commit1d518a54914531d7a4fab3a6835b75de85bd7bc7 (patch)
treecabfcb6f735e3c928cddf79169fb84d9b422747f /src/render/textures.cc
parent25a7edee2f003f259fc3a97bbfc047d72adaa361 (diff)
Initial support for multi-layered materials, requires shaders files in the new format.
Diffstat (limited to 'src/render/textures.cc')
-rw-r--r--src/render/textures.cc19
1 files changed, 7 insertions, 12 deletions
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]);
}
}