isle-portable/LEGO1/legostate.cpp
Ramen2X 7c26a4d2dc
fix LegoState::VTable0x1C fake-match & implement LegoFileStream::FUN_10006030 (#217)
* fix LegoState::VTable0x1C fake-match, implement LegoFileStream::FUN_10006030

* Match and relocate FUN_10006030

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2023-10-18 00:05:31 +02:00

40 lines
No EOL
795 B
C++

#include "legostate.h"
DECOMP_SIZE_ASSERT(LegoState, 0x08);
// OFFSET: LEGO1 0x10005f40
LegoState::~LegoState()
{
}
// OFFSET: LEGO1 0x10005f90
MxBool LegoState::VTable0x14() {
return TRUE;
}
// OFFSET: LEGO1 0x10005fa0
MxBool LegoState::VTable0x18() {
return FALSE;
}
// OFFSET: LEGO1 0x10005fb0
MxResult LegoState::VTable0x1C(LegoFileStream *p_legoFileStream)
{
if (p_legoFileStream->IsWriteMode()) {
p_legoFileStream->FUN_10006030(this->ClassName());
}
return SUCCESS;
}
// OFFSET: LEGO1 0x10006030
LegoFileStream *LegoFileStream::FUN_10006030(MxString p_str)
{
const char *data = p_str.GetData();
MxU32 fullLength = strlen(data);
MxU16 limitedLength = fullLength;
Write(&limitedLength, sizeof(limitedLength));
Write(data, (MxS16) fullLength);
return this;
}