From 5992c46fc62db1bdf038b5b7be0e94dd10183e77 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Tue, 13 Jan 2009 19:29:54 +0000 Subject: adds 'cull' option to fx_flare and fx_particles --- src/model/map.cc | 30 +++++++++++++++++++++++++++++- 1 file changed, 29 insertions(+), 1 deletion(-) (limited to 'src/model/map.cc') diff --git a/src/model/map.cc b/src/model/map.cc index a59d2ff..9a1802f 100644 --- a/src/model/map.cc +++ b/src/model/map.cc @@ -4,6 +4,7 @@ the terms of the GNU General Public License version 2 */ +#include "auxiliary/functions.h" #include "filesystem/filesystem.h" #include "math/mathlib.h" #include "model/map.h" @@ -837,6 +838,7 @@ Model * Map::load(std::string const &name) unsigned int u; float angle; float r; + std::string str; while (mapfile.getline()) { @@ -1027,7 +1029,7 @@ Model * Map::load(std::string const &name) } else if (mapfile.got_key_float("radius", flare->light_radius)) { flare->light_radius *= LIGHTSCALE; - + } else if (mapfile.got_key_float("frequency", flare->light_frequency)) { continue; @@ -1056,6 +1058,19 @@ Model * Map::load(std::string const &name) } else if (mapfile.got_key_float("roll", angle)) { flare->flare_axis.change_roll(angle); + + } else if (mapfile.got_key_string("cull", str)) { + + aux::to_lowercase(str); + if (str.compare("none") == 0) { + flare->flare_cull = CullNone; + } else if (str.compare("back") == 0) { + flare->flare_cull = CullBack; + } else if (str.compare("front") == 0) { + flare->flare_cull = CullFront; + } else { + mapfile.unknown_value(); + } } else if (mapfile.got_key()) { mapfile.unknown_key(); @@ -1098,6 +1113,19 @@ Model * Map::load(std::string const &name) } else if (mapfile.got_key_float("radius", r)) { particles->set_radius(r * LIGHTSCALE); + + } else if (mapfile.got_key_string("cull", str)) { + + aux::to_lowercase(str); + if (str.compare("none") == 0) { + particles->particles_cull = CullNone; + } else if (str.compare("back") == 0) { + particles->particles_cull = CullBack; + } else if (str.compare("front") == 0) { + particles->particles_cull = CullFront; + } else { + mapfile.unknown_value(); + } } else if (mapfile.got_key()) { mapfile.unknown_key(); -- cgit v1.2.3