From 18dc1f6d0e044e5e4b1f3a40fcc65e532ec2e765 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sat, 28 Sep 2013 12:13:29 +0000 Subject: Cleanup of the material API: split flags into flags and colortype. --- src/model/mapfile.cc | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'src/model/mapfile.cc') diff --git a/src/model/mapfile.cc b/src/model/mapfile.cc index 359efe7..d4632e2 100644 --- a/src/model/mapfile.cc +++ b/src/model/mapfile.cc @@ -397,7 +397,7 @@ bool MapFile::read_patchdef() } // ignore materials with the 'Ignore' flag set - if ((material->flags() & Material::Ignore) == Material::Ignore) { + if (material->ignore_is_set()) { return true; } @@ -527,7 +527,7 @@ bool MapFile::read_patchdef() for (size_t i = 0; i < subdivide_u; i++) { for (size_t j = 0; j < subdivide_v; j++) { - if ((material->flags() & Material::Clip) == Material::Clip) { + if (material->flag_is_set(Material::FlagClip)) { // if the current material is clip, the patch needs to be converted to triangles if (map_load_clip) { @@ -754,7 +754,7 @@ void MapFile::make_brushface(Face *face) using math::Vector3f; // ignore materials with the 'Ignore' flag set - if ((face->material()->flags() & Material::Ignore) == Material::Ignore) { + if (face->material()->ignore_is_set()) { return; } @@ -954,7 +954,7 @@ void MapFile::make_brushface(Face *face) primitives = (*mit).second; } - if ((face->material()->flags() & Material::Origin)) { + if (face->material()->origin_is_set()) { // add vertices to the origin list for (std::vector::iterator it = vl.begin(); it != vl.end(); ++it) { class_origin_vertices.push_back(new math::Vector3f((*(*it) * SCALE))); @@ -972,7 +972,7 @@ void MapFile::make_brushface(Face *face) face_normal.normalize(); // clip faces have to be triangulated and can not be split into quads - if (!(face->material()->flags() & Material::Clip)) { + if (!face->material()->flag_is_set(Material::FlagClip)) { // split polygon into quads while (vl.size() > 3) { @@ -987,7 +987,7 @@ void MapFile::make_brushface(Face *face) Quad *quad = new Quad(*(*vn2) * SCALE, *(*vn1) * SCALE, *(*vn) * SCALE, *(*v0) * SCALE, face_normal, face->detail()); primitives->add_quad(quad); - if (face->material()->flags() & Material::Texture) { + if (face->material()->flag_is_set(Material::FlagTexture)) { quad->t0().assign(map_texture_coords(face, *(*vn2))); quad->t1().assign(map_texture_coords(face, *(*vn1))); quad->t2().assign(map_texture_coords(face, *(*vn))); @@ -1011,7 +1011,7 @@ void MapFile::make_brushface(Face *face) Triangle * triangle = new Triangle(*(*vn1) * SCALE, *(*vn) * SCALE, *(*v0) * SCALE, face_normal, face->detail()); primitives->add_triangle(triangle); - if (face->material()->flags() & Material::Texture) { + if (face->material()->flag_is_set(Material::FlagTexture)) { triangle->t0().assign(map_texture_coords(face, *(*vn1))); triangle->t1().assign(map_texture_coords(face, *(*vn))); triangle->t2().assign(map_texture_coords(face, *(*v0))); @@ -1245,7 +1245,7 @@ void MapFile::load_fragmentgroup(Model *model, const FragmentGroup::Type class_t // store triangles if (primitives->triangles().size()) { - if ((primitives->material()->flags() & Material::Clip) == Material::Clip) { + if (primitives->material()->flag_is_set(Material::FlagClip)) { if (map_load_clip) { // clip materials are loaded into the CollisionMesh -- cgit v1.2.3