2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-05-13 14:31:20 +00:00
metaforce/Runtime/Streams/CMemoryStreamOut.cpp

25 lines
418 B
C++

#include "CMemoryStreamOut.hpp"
#include <cstring>
namespace metaforce {
CMemoryStreamOut::~CMemoryStreamOut() {
Flush();
if (x88_owned) {
delete[] x7c_ptr;
}
}
void CMemoryStreamOut::Write(const u8* ptr, u32 len) {
const auto offset = (x80_len - x84_position);
if (offset < len) {
len = offset;
}
if (len != 0) {
memcpy(x7c_ptr + x84_position, ptr, len);
}
}
} // namespace metaforce