Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2008-05-25 16:44:37 +0000
committerStijn Buys <ingar@osirion.org>2008-05-25 16:44:37 +0000
commitf7283b2b9a9bf305ac110ef00cd5c21d5304bfbb (patch)
tree8b595b0971a63678414daead588c6b27a209d819 /src/model/map.cc
parent18180a06fa99bd97587b7c6e5bc60395b1d01262 (diff)
target_flare
Diffstat (limited to 'src/model/map.cc')
-rw-r--r--src/model/map.cc46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/model/map.cc b/src/model/map.cc
index 4b78f762..6769ba8 100644
--- a/src/model/map.cc
+++ b/src/model/map.cc
@@ -30,6 +30,7 @@ Model * Map::load(std::string const &name)
Model *model = new Model(name);
Light *light = 0;
+ Flare *flare = 0;
Engine *engine = 0;
unsigned int u;
@@ -73,7 +74,48 @@ Model * Map::load(std::string const &name)
continue;
}
+
+ } else if (mapfile.got_classname("target_flare")) {
+
+ // new flare
+ flare = new Flare();
+ model->add_flare(flare);
+
+ } else if (mapfile.classname().compare("target_flare") == 0 ) {
+
+ // flare attributes
+ if (mapfile.got_key_vector3f("origin", flare->light_location)) {
+ flare->light_location *= SCALE;
+ continue;
+
+ } else if (mapfile.got_key_color("_color", flare->light_color)) {
+ continue;
+
+ } else if (mapfile.got_key_int("spawnflags", u)) {
+ flare->light_strobe = spawnflag_isset(u, 1);
+ flare->light_entity = spawnflag_isset(u, 2);
+
+ } else if (mapfile.got_key_float("radius", flare->light_radius)) {
+ flare->light_radius /= 100.0f;
+
+ } else if (mapfile.got_key_float("frequency", flare->light_frequency)) {
+ continue;
+ } else if (mapfile.got_key_float("offset", flare->light_offset)) {
+ continue;
+
+ } else if (mapfile.got_key_float("time", flare->light_time)) {
+ continue;
+
+ } else if (mapfile.got_key_int("flare", flare->light_flare)) {
+ continue;
+
+ } else if (mapfile.got_key_float("angle", flare->flare_angle)) {
+ flare->flare_angle = math::degrees360f(flare->flare_angle);
+ continue;
+
+ }
+
} else if (mapfile.got_classname("target_engine")) {
// new engine
engine = new Engine();
@@ -195,6 +237,10 @@ Model * Map::load(std::string const &name)
(*lit)->light_location -= center;
}
+ for (std::list<Flare *>::iterator flit = model->model_flare.begin(); flit != model->model_flare.end(); flit++) {
+ (*flit)->light_location -= center;
+ }
+
}
con_print << " maps/" << model->name() << ".map " << mapfile.brushes << " brushes " << model->tris()