2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-05-13 13:51:21 +00:00
metaforce/Runtime/Streams/CMemoryStreamOut.cpp
Luke Street 5e7b8ebacf Merge branch 'dawn' into new-cmodel
# Conflicts:
#	Runtime/Streams/ContainerReaders.hpp
2022-03-01 01:37:08 -05:00

26 lines
443 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);
x84_position += len;
}
}
} // namespace metaforce