From 847f84e1e3797277407bc34f5acc51b801b2bf29 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Thu, 18 Nov 2010 13:50:47 +0000 Subject: Unified radiant angles conversion into a single math::Axis.assign() method, corrected transformation order. Removed unnecessary model::LIGHTSCALE constant, light and flare sizes are rescaled according to the global model::SCALE. Added gl::depthfunc, enabled GL_LEQUAL while drawing lights and flares. --- src/model/mapfile.cc | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) (limited to 'src/model/mapfile.cc') diff --git a/src/model/mapfile.cc b/src/model/mapfile.cc index 560bbc1..b74cdbe 100644 --- a/src/model/mapfile.cc +++ b/src/model/mapfile.cc @@ -808,10 +808,7 @@ bool MapFile::got_key_axis(math::Axis &axis) std::istringstream str(value()); if (str >> pitch >> yaw >> roll) { - axis.clear(); - axis.change_pitch(-pitch); - axis.change_direction(yaw); - axis.change_roll(-roll); + axis.assign(yaw, pitch, roll); } else { unknown_value(); } @@ -820,7 +817,7 @@ bool MapFile::got_key_axis(math::Axis &axis) } else if (got_key_float("pitch", pitch)) { // TODO this warning should eventually disappear - unknown_error("'" + classname() + ":" + key() + "' has changed polarity"); + unknown_error("'" + classname() + ":" + key() + "' has switched sign"); axis.change_pitch(-pitch); return true; @@ -832,7 +829,7 @@ bool MapFile::got_key_axis(math::Axis &axis) } else if (got_key_float("roll", roll)) { // TODO this warning should eventually disappear - unknown_error("'" + classname() + ":" + key() + "' has changed polarity"); + unknown_error("'" + classname() + ":" + key() + "' has switched sign"); axis.change_roll(-roll); return true; @@ -1131,11 +1128,11 @@ Model * MapFile::load(std::string const &name) continue; } else if (mapfile.got_key_float("light", r)) { - tag_light->set_radius(r * LIGHTSCALE); + tag_light->set_radius(r * SCALE); continue; } else if (mapfile.got_key_float("radius", r)) { - tag_light->set_radius(r * LIGHTSCALE); + tag_light->set_radius(r * SCALE); continue; } else if (mapfile.got_key_float("frequency", r)) { @@ -1186,11 +1183,11 @@ Model * MapFile::load(std::string const &name) tag_flare->set_engine(spawnflag_isset(u, 4)); } else if (mapfile.got_key_float("light", r)) { - tag_flare->set_radius(r * LIGHTSCALE); + tag_flare->set_radius(r * SCALE); continue; } else if (mapfile.got_key_float("radius", r)) { - tag_flare->set_radius(r * LIGHTSCALE); + tag_flare->set_radius(r * SCALE); continue; } else if (mapfile.got_key_float("frequency", r)) { -- cgit v1.2.3