1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-25 03:42:48 +01:00

Open binary files in binary mode

This commit is contained in:
darkf 2016-08-02 04:27:31 -07:00
parent 77ca9054c6
commit 6d6d772653
6 changed files with 5 additions and 7 deletions

View File

@ -34,7 +34,7 @@ public:
sectionHeader_t *next = nullptr;
} *rootHeader;
static std::unique_ptr<BinaryStream> parse(std::string filename);
static std::unique_ptr<BinaryStream> parse(const std::string& filename);
static std::string sectionIdString(uint32_t id);
};

View File

@ -7,9 +7,9 @@
namespace RW
{
std::unique_ptr<BinaryStream> BinaryStream::parse(std::string filename)
std::unique_ptr<BinaryStream> BinaryStream::parse(const std::string& filename)
{
std::ifstream dfile(filename);
std::ifstream dfile(filename, std::ios_base::binary);
if ( ! dfile.is_open()) {
std::cerr << "Error opening file " << filename << std::endl;
return nullptr;

View File

@ -235,7 +235,7 @@ bool LoaderCOL::load(char* data, const size_t size)
bool LoaderCOL::load(const std::string& file)
{
std::ifstream dfile(file.c_str());
std::ifstream dfile(file.c_str(), std::ios_base::binary);
if ( ! dfile.is_open()) {
return false;
}

View File

@ -1,5 +1,4 @@
#include <png.h>
#include <fstream>
#include <core/Logger.hpp>
#include "GameWindow.hpp"

View File

@ -1,7 +1,6 @@
#include <loaders/LoaderTXD.hpp>
#include <gl/TextureData.hpp>
#include <fstream>
#include <iostream>
#include <algorithm>

View File

@ -62,7 +62,7 @@ void ModelViewer::showObject(uint16_t object)
void ModelViewer::loadAnimations(const QString& file)
{
std::ifstream dfile(file.toStdString().c_str());
std::ifstream dfile(file.toStdString().c_str(), std::ios_base::binary);
AnimationList anims;
if(dfile.is_open())