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>2010-12-05 21:36:38 +0000
committerStijn Buys <ingar@osirion.org>2010-12-05 21:36:38 +0000
commit98a3ca91ed9aad07057e7de30c6c498d36f7f422 (patch)
treef8b56129a397f903acb2a6ec7a44d92634c30e75 /src/model/mapfile.cc
parentd1fc8b10f6731a27e9b7fa39ce42aaa4c6e0bcee (diff)
Support for func_move vertex groups.
Diffstat (limited to 'src/model/mapfile.cc')
-rw-r--r--src/model/mapfile.cc35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/model/mapfile.cc b/src/model/mapfile.cc
index 09bb3af..f21484a 100644
--- a/src/model/mapfile.cc
+++ b/src/model/mapfile.cc
@@ -152,6 +152,7 @@ MapFile::MapFile()
warning_q2brush = false;
class_engine = false;
class_speed = 0;
+ class_distance = 0;
// the initial bounding box value is invalid: max and min are switched
class_box.assign(MAX_BOUNDS, -MAX_BOUNDS);
@@ -1123,6 +1124,7 @@ void MapFile::clear_bbox()
class_box.assign(MAX_BOUNDS, -MAX_BOUNDS);
class_axis.clear();
class_speed = 0;
+ class_distance = 0;
class_engine = false;
}
@@ -1143,6 +1145,11 @@ void MapFile::load_fragmentgroup(Model *model, const FragmentGroup::Type class_t
}
group->set_speed(class_speed);
group->set_engine(class_engine);
+
+ } else if (class_type == FragmentGroup::Move) {
+ group->set_speed(class_speed);
+ group->set_distance(class_distance);
+ group->set_engine(class_engine);
}
// expand bounding box
@@ -1351,6 +1358,34 @@ Model * MapFile::load(std::string const &name)
mapfile.load_fragmentgroup(model, FragmentGroup::None);
mapfile.clear_materials();
+ } else if (mapfile.got_classname("func_move")) {
+ mapfile.clear_bbox();
+
+ } else if (mapfile.got_classend("func_move")) {
+ mapfile.load_fragmentgroup(model, FragmentGroup::Move);
+ mapfile.clear_materials();
+
+ } else if (mapfile.in_class("func_move")) {
+
+ if (mapfile.got_key_axis(mapfile.class_axis)) {
+ continue;
+
+ } else if (mapfile.got_key_int("spawnflags", u)) {
+ mapfile.class_engine = spawnflag_isset(u, 4);
+ continue;
+
+ } else if (mapfile.got_key_float("speed", s)) {
+ mapfile.class_speed = s * SCALE;
+ continue;
+
+ } else if (mapfile.got_key_float("distance", s)) {
+ mapfile.class_distance = s * SCALE;
+ continue;
+
+ } else if (mapfile.got_key()) {
+ mapfile.unknown_key();
+ }
+
} else if (mapfile.got_classname("func_rotate")) {
mapfile.clear_bbox();