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:
parent
77ca9054c6
commit
6d6d772653
@ -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);
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -1,5 +1,4 @@
|
||||
#include <png.h>
|
||||
#include <fstream>
|
||||
|
||||
#include <core/Logger.hpp>
|
||||
#include "GameWindow.hpp"
|
||||
|
@ -1,7 +1,6 @@
|
||||
#include <loaders/LoaderTXD.hpp>
|
||||
#include <gl/TextureData.hpp>
|
||||
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
|
||||
|
@ -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())
|
||||
|
Loading…
Reference in New Issue
Block a user