Fix region file loading

This commit is contained in:
DankParrot 2020-08-07 19:45:04 -07:00
parent 81e71dd452
commit 383f3122cf
1 changed files with 2 additions and 2 deletions

View File

@ -9,11 +9,11 @@ namespace Feather
{ {
RegionFile::RegionFile(string path) RegionFile::RegionFile(string path)
{ {
std::ifstream stream(path); std::ifstream stream(path, std::ifstream::binary);
stream.read(m_header, 8KB); stream.read(m_header, 8KB);
// Populate m_offsets // Populate m_offsets
for (int i = 0; i < 1KB; i++) for (int i = 0; i < 1024; i++)
{ {
int32_t readInt = 0; int32_t readInt = 0;
std::memcpy(&readInt, &m_header[i * 4], sizeof(int32_t)); std::memcpy(&readInt, &m_header[i * 4], sizeof(int32_t));