mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-04 21:40:03 +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
@ -265,7 +265,14 @@ public:
|
||||
// them from native encoding to UTF8 in the process.
|
||||
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
|
||||
[[noreturn]] void fail(const std::string &msg);
|
||||
|
Loading…
x
Reference in New Issue
Block a user