@ -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");
@ -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;