diff options
author | Stijn Buys <ingar@osirion.org> | 2013-11-16 18:25:03 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2013-11-16 18:25:03 +0000 |
commit | 302f11ce816ffe4b51f48c42972bb58475bcca5d (patch) | |
tree | f7d4969f7b3abe27e069589bcebc99a14d70e523 /src/render | |
parent | 359f98adee3e0308dcd92dc59b68f699527d1acb (diff) |
Material API cleanups,
added support for bounds materials.
Diffstat (limited to 'src/render')
-rw-r--r-- | src/render/state.cc | 10 | ||||
-rw-r--r-- | src/render/textures.cc | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/render/state.cc b/src/render/state.cc index df9a001..400a186 100644 --- a/src/render/state.cc +++ b/src/render/state.cc @@ -237,7 +237,7 @@ void State::use_material(const model::Material * material) { } // material has the decal flag set - if (material->flag_is_set(model::Material::FlagDecal)) { + if (material->has_flag(model::Material::FlagDecal)) { gl::enable(GL_POLYGON_OFFSET_FILL); gl::enable(GL_ALPHA_TEST); gl::polygonoffset(-1,-1); @@ -289,7 +289,7 @@ void State::use_material(const model::Material * material) { } // lighted or fullbright - if (state_power && (material->flag_is_set(model::Material::FlagBright))) { + if (state_power && (material->has_flag(model::Material::FlagBright))) { gl::disable(GL_LIGHTING); } else if (state_power && (material->colortype() == model::Material::ColorEngine)) { @@ -300,12 +300,12 @@ void State::use_material(const model::Material * material) { } // texture - if (material->flag_is_set(model::Material::FlagTexture)) { + if (material->has_flag(model::Material::FlagTexture)) { Textures::bind(material->texture_id()); gl::enable(GL_TEXTURE_2D); - if (material->flag_is_set(model::Material::FlagEnvironment)) { + if (material->has_flag(model::Material::FlagEnvironment)) { gl::texgen(GL_S, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); gl::texgen(GL_T, GL_TEXTURE_GEN_MODE, GL_SPHERE_MAP); @@ -315,7 +315,7 @@ void State::use_material(const model::Material * material) { } else { // envmapped without texture: use the skybox as envmap - if (material->flag_is_set(model::Material::FlagEnvironment)) { + if (material->has_flag(model::Material::FlagEnvironment)) { if (core::localplayer()->zone()->sky().size()) { gl::enable(GL_TEXTURE_CUBE_MAP); diff --git a/src/render/textures.cc b/src/render/textures.cc index 05c73da..5a90640 100644 --- a/src/render/textures.cc +++ b/src/render/textures.cc @@ -418,7 +418,7 @@ size_t Textures::bind(const size_t texture, const bool filter) void Textures::material_loader(model::Material *material) { - if (material->flag_is_set(model::Material::FlagTexture) && (material->texture().size() > 0)) { + 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]); |