Saveload: Add PeekByte method to ReadBuffer

This commit is contained in:
Jonathan G Rennison
2024-02-21 19:19:49 +00:00
parent bd2358f6cc
commit 6dec7a5b35

View File

@@ -69,6 +69,15 @@ struct ReadBuffer {
return RawReadByte();
}
inline byte PeekByte()
{
if (unlikely(this->bufp == this->bufe)) {
this->AcquireBytes();
}
return *this->bufp;
}
inline void CheckBytes(size_t bytes)
{
while (unlikely(this->bufp + bytes > this->bufe)) this->AcquireBytes();