diff options
Diffstat (limited to 'src/model')
-rw-r--r-- | src/model/map.cc | 19 | ||||
-rw-r--r-- | src/model/map.h | 4 |
2 files changed, 6 insertions, 17 deletions
diff --git a/src/model/map.cc b/src/model/map.cc index 9a1802f..45ae3fd 100644 --- a/src/model/map.cc +++ b/src/model/map.cc @@ -52,7 +52,7 @@ void Map::clear_materials() map_materials.clear(); } -bool Map::open(std::string const & name) +bool Map::open(std::string const & mapname) { last_read_was_classname = false; @@ -66,25 +66,14 @@ bool Map::open(std::string const & name) clear_materials(); mapfile_name.assign("maps/"); - mapfile_name.append(name); + mapfile_name.append(mapname); mapfile_name.append(".map"); - filesystem::File *f = filesystem::open(mapfile_name.c_str()); - if (!f) { - con_warn << "Could not open " << mapfile_name << std::endl; - return false; - } - - std::string fn = f->path(); - fn.append(f->name()); - filesystem::close(f); - - mapfile_ifs.open(fn.c_str()); + mapfile_ifs.open(mapfile_name); if (!mapfile_ifs.is_open()) { - con_warn << "Could not stream " << fn << "!\n"; + con_warn << "Could not open " << mapfile_name << "!\n"; return false; } - return true; } diff --git a/src/model/map.h b/src/model/map.h index b46be7c..e38b9ec 100644 --- a/src/model/map.h +++ b/src/model/map.h @@ -7,13 +7,13 @@ #ifndef __INCLUDED_MODEL_MAP_H__ #define __INCLUDED_MODEL_MAP_H__ -#include <fstream> #include <string> #include <vector> #include "model/model.h" #include "model/plane.h" #include "model/primitives.h" +#include "filesystem/filestream.h" namespace model { @@ -167,7 +167,7 @@ private: unsigned int parse_level; unsigned int line_number; - std::ifstream mapfile_ifs; + filesystem::IFileStream mapfile_ifs; std::string mapfile_name; math::Vector3f class_maxbbox; |