Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
path: root/src/model
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2009-02-08 15:27:59 +0000
committerStijn Buys <ingar@osirion.org>2009-02-08 15:27:59 +0000
commit2386bda56b33de68370fa8acc76e39ddddd836c6 (patch)
tree6de102324d33a70625c90c5839c17dcdc26ac47d /src/model
parentc8a6ff1c0693ca1bd9025dcbdd7c22e3d193f8dd (diff)
changed inifile and map to use filesystem::IFileStream
Diffstat (limited to 'src/model')
-rw-r--r--src/model/map.cc19
-rw-r--r--src/model/map.h4
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;