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-03-29 10:36:54 +0000
committerStijn Buys <ingar@osirion.org>2008-03-29 10:36:54 +0000
commitec749a67a8dac87dc01421fc74fa9ee8ec6a6164 (patch)
treedd81c71bf6bfab13f3433e26d5a2ecf3beff0baf
parent1b5dcbc5a2a4e08ee3b6026257d2fcb253bfe0d3 (diff)
read/write files in binary mode
-rw-r--r--src/filesystem/diskfile.cc8
-rw-r--r--src/render/tga.cc2
2 files changed, 5 insertions, 5 deletions
diff --git a/src/filesystem/diskfile.cc b/src/filesystem/diskfile.cc
index 11070f2..a01a327 100644
--- a/src/filesystem/diskfile.cc
+++ b/src/filesystem/diskfile.cc
@@ -36,7 +36,7 @@ bool DiskFile::open(const char *filename)
file_path.append(moddir);
fn = file_path;
fn.append(filename);
- diskfile_handle = fopen(fn.c_str(), "r");
+ diskfile_handle = fopen(fn.c_str(), "rb");
if (diskfile_handle)
return true;
@@ -45,7 +45,7 @@ bool DiskFile::open(const char *filename)
file_path.append(moddir);
fn = file_path;
fn.append(filename);
- diskfile_handle = fopen(fn.c_str(), "r");
+ diskfile_handle = fopen(fn.c_str(), "rb");
if (diskfile_handle)
return true;
}
@@ -54,7 +54,7 @@ bool DiskFile::open(const char *filename)
file_path.append(basedir);
fn = file_path;
fn.append(filename);
- diskfile_handle = fopen(fn.c_str(), "r");
+ diskfile_handle = fopen(fn.c_str(), "rb");
if (diskfile_handle)
return true;
@@ -63,7 +63,7 @@ bool DiskFile::open(const char *filename)
file_path.append(basedir);
fn = file_path;
fn.append(filename);
- diskfile_handle = fopen(fn.c_str(), "r");
+ diskfile_handle = fopen(fn.c_str(), "rb");
if (diskfile_handle)
return true;
diff --git a/src/render/tga.cc b/src/render/tga.cc
index d8e2216..fb4301b 100644
--- a/src/render/tga.cc
+++ b/src/render/tga.cc
@@ -222,7 +222,7 @@ void TGA::save(const char *filename, Image & image)
if (!filename)
return;
- std::ofstream ofs(filename);
+ std::ofstream ofs(filename, std::ios_base::out | std::ios_base::binary );
if (!ofs.is_open()) {
con_warn << "Could not write " << filename << std::endl;