From 130349e0cd044b3972920380f81655cb6d6ed93f Mon Sep 17 00:00:00 2001 From: greye Date: Tue, 20 May 2014 08:14:29 +0400 Subject: [PATCH] open files in binary mode when necessary --- apps/opencs/model/doc/savingstages.cpp | 4 +++- libs/openengine/ogre/renderer.cpp | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/opencs/model/doc/savingstages.cpp b/apps/opencs/model/doc/savingstages.cpp index 34d93c49a..066c76734 100644 --- a/apps/opencs/model/doc/savingstages.cpp +++ b/apps/opencs/model/doc/savingstages.cpp @@ -27,7 +27,9 @@ void CSMDoc::OpenSaveStage::perform (int stage, Messages& messages) { mState.start (mDocument, mProjectFile); - mState.getStream().open (mProjectFile ? mState.getPath() : mState.getTmpPath()); + mState.getStream().open ( + mProjectFile ? mState.getPath() : mState.getTmpPath(), + std::ios::binary); if (!mState.getStream().is_open()) throw std::runtime_error ("failed to open stream for saving"); diff --git a/libs/openengine/ogre/renderer.cpp b/libs/openengine/ogre/renderer.cpp index ae0d477d2..64d65ea0d 100644 --- a/libs/openengine/ogre/renderer.cpp +++ b/libs/openengine/ogre/renderer.cpp @@ -52,7 +52,7 @@ void OgreRenderer::update(float dt) void OgreRenderer::screenshot(const std::string &file) { namespace bfs = boost::filesystem; - bfs::ofstream out((bfs::path(file))); + bfs::ofstream out(bfs::path(file), std::ios::binary); Ogre::Image image;