mirror of
https://github.com/OpenMW/openmw.git
synced 2025-12-13 05:43:08 +00:00
Merge branch 'esm_read_on_skip' into 'master'
Read when need to skip few bytes See merge request OpenMW/openmw!1765
This commit is contained in:
commit
292dda0c78
1 changed files with 8 additions and 1 deletions
|
|
@ -265,7 +265,14 @@ public:
|
||||||
// them from native encoding to UTF8 in the process.
|
// them from native encoding to UTF8 in the process.
|
||||||
std::string getString(int size);
|
std::string getString(int size);
|
||||||
|
|
||||||
void skip(int bytes) { mEsm->seekg(getFileOffset()+bytes); };
|
void skip(std::size_t bytes)
|
||||||
|
{
|
||||||
|
char buffer[4096];
|
||||||
|
if (bytes > std::size(buffer))
|
||||||
|
mEsm->seekg(getFileOffset() + bytes);
|
||||||
|
else
|
||||||
|
mEsm->read(buffer, bytes);
|
||||||
|
}
|
||||||
|
|
||||||
/// Used for error handling
|
/// Used for error handling
|
||||||
[[noreturn]] void fail(const std::string &msg);
|
[[noreturn]] void fail(const std::string &msg);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue