From 302f11ce816ffe4b51f48c42972bb58475bcca5d Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 16 Nov 2013 18:25:03 +0000 Subject: Material API cleanups, added support for bounds materials. --- src/render/state.cc | 10 +++++----- src/render/textures.cc | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) (limited to 'src/render') 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]); -- cgit v1.2.3