mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Merge remote-tracking branch 'remotes/origin/develop' into feature/VCMIMapFormat1
Conflicts: lib/CMakeLists.txt lib/VCMI_lib.cbp lib/filesystem/CFileInputStream.cpp lib/filesystem/CZipLoader.cpp lib/rmg/CRmgTemplateZone.cpp vcmi.workspace
This commit is contained in:
@@ -1,8 +1,6 @@
|
||||
#include "StdInc.h"
|
||||
#include "CFileInputStream.h"
|
||||
|
||||
#include "CFileInfo.h"
|
||||
|
||||
CFileInputStream::CFileInputStream(const boost::filesystem::path & file, si64 start, si64 size)
|
||||
: dataStart{start},
|
||||
dataSize{size},
|
||||
@@ -20,22 +18,6 @@ CFileInputStream::CFileInputStream(const boost::filesystem::path & file, si64 st
|
||||
fileStream.seekg(dataStart, std::ios::beg);
|
||||
}
|
||||
|
||||
CFileInputStream::CFileInputStream(const CFileInfo & file, si64 start, si64 size)
|
||||
: dataStart{start},
|
||||
dataSize{size},
|
||||
fileStream{file.getName(), std::ios::in | std::ios::binary}
|
||||
{
|
||||
if (fileStream.fail())
|
||||
throw std::runtime_error("File " + file.getName() + " isn't available.");
|
||||
|
||||
if (dataSize == 0)
|
||||
{
|
||||
fileStream.seekg(0, std::ios::end);
|
||||
dataSize = tell();
|
||||
}
|
||||
|
||||
fileStream.seekg(dataStart, std::ios::beg);
|
||||
}
|
||||
|
||||
si64 CFileInputStream::read(ui8 * data, si64 size)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user