diff --git a/r5dev/public/tier1/bitbuf.h b/r5dev/public/tier1/bitbuf.h index da5ea3e3..9aec7195 100644 --- a/r5dev/public/tier1/bitbuf.h +++ b/r5dev/public/tier1/bitbuf.h @@ -188,6 +188,8 @@ public: // Write a list of bits in. bool WriteBits(const void* pIn, int nBits); + bool WriteBytes(const void* pIn, int nBytes); + // How many bytes are filled in? int GetNumBytesWritten() const; int GetNumBitsWritten() const; diff --git a/r5dev/tier1/bitbuf.cpp b/r5dev/tier1/bitbuf.cpp index a269c2f2..87e42603 100644 --- a/r5dev/tier1/bitbuf.cpp +++ b/r5dev/tier1/bitbuf.cpp @@ -651,6 +651,14 @@ bool bf_write::WriteBits(const void* pInData, int nBits) return !IsOverflowed(); } +//----------------------------------------------------------------------------- +// Purpose: writes a list of bytes to the buffer +//----------------------------------------------------------------------------- +bool bf_write::WriteBytes(const void* pBuf, int nBytes) +{ + return WriteBits(pBuf, nBytes << 3); +} + //----------------------------------------------------------------------------- // Purpose: writes a bit into the buffer //-----------------------------------------------------------------------------