Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
Diffstat (limited to 'src/model')
-rw-r--r--src/model/map.cc31
-rw-r--r--src/model/map.h7
2 files changed, 29 insertions, 9 deletions
diff --git a/src/model/map.cc b/src/model/map.cc
index 549abff..955410f 100644
--- a/src/model/map.cc
+++ b/src/model/map.cc
@@ -802,6 +802,21 @@ void Map::load_fragmentgroup(Model *model, const FragmentGroup::Type class_type)
model->add_group(group);
}
+void Map::unknown_value() const
+{
+ con_warn << name() << " unknown value '" << value() << "' for '" << classname() << ":" << key() << "' at line " << line() << std::endl;
+}
+
+void Map::unknown_key() const
+{
+ con_warn << name() << " unknown key '" << classname() << ":" << key() << "' at line " << line() << std::endl;
+}
+
+void Map::unknown_class() const
+{
+ con_warn << name() << " unknown class '" << classname() << "' at line " << line() << std::endl;
+}
+
Model * Map::load(std::string const &name)
{
// open the .map file
@@ -849,7 +864,7 @@ Model * Map::load(std::string const &name)
continue;
} else if (mapfile.got_key()) {
- con_warn "Unknown key " << mapfile.classname() << ":" << mapfile.key() << std::endl;
+ mapfile.unknown_key();
}
@@ -899,7 +914,7 @@ Model * Map::load(std::string const &name)
continue;
} else if (mapfile.got_key()) {
- con_warn "Unknown key " << mapfile.classname() << ":" << mapfile.key() << std::endl;
+ mapfile.unknown_key();
}
} else if (mapfile.got_classend()) {
@@ -944,7 +959,7 @@ Model * Map::load(std::string const &name)
continue;
} else if (mapfile.got_key()) {
- con_warn "Unknown key " << mapfile.classname() << ":" << mapfile.key() << std::endl;
+ mapfile.unknown_key();
}
@@ -969,7 +984,7 @@ Model * Map::load(std::string const &name)
continue;
} else if (mapfile.got_key()) {
- con_warn "Unknown key " << mapfile.classname() << ":" << mapfile.key() << std::endl;
+ mapfile.unknown_key();
}
@@ -1042,7 +1057,7 @@ Model * Map::load(std::string const &name)
flare->flare_axis.change_roll(angle);
} else if (mapfile.got_key()) {
- con_warn "Unknown key " << mapfile.classname() << ":" << mapfile.key() << std::endl;
+ mapfile.unknown_key();
}
} else if (mapfile.got_classname("fx_particles")) {
@@ -1084,12 +1099,10 @@ Model * Map::load(std::string const &name)
particles->particles_radius *= LIGHTSCALE;
*/
} else if (mapfile.got_key()) {
- con_warn << "Unknown key " << mapfile.classname() << ":" << mapfile.key() << std::endl;
+ mapfile.unknown_key();
}
-
} else if (mapfile.got_classname()) {
-
- con_warn << "Unkown class " << mapfile.classname() << std::endl;
+ mapfile.unknown_class();
}
}
diff --git a/src/model/map.h b/src/model/map.h
index 86bada6..b46be7c 100644
--- a/src/model/map.h
+++ b/src/model/map.h
@@ -142,9 +142,16 @@ private:
/// clear class bounding box
void clear_bbox();
+
+ void unknown_class() const;
+
+ void unknown_key() const;
+
+ void unknown_value() const;
/// list of planes for the current brush
std::vector<Plane *> planes;
+
std::string classname_current;
std::string key_current;