Implement misc.lib (#483)

* Implement misc.lib

* Lowercase files

* Minor changes

* Fix file cases

* Fixes

* Fix missing dtor

* Add override

* Match LegoImage::Read

* Fix delete call

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
Nathan M Gilbert
2024-01-24 12:12:57 -05:00
committed by GitHub
parent a19165a749
commit 2bebc09da3
44 changed files with 772 additions and 397 deletions

View File

@@ -20,23 +20,10 @@ MxBool LegoState::SetFlag()
}
// FUNCTION: LEGO1 0x10005fb0
MxResult LegoState::VTable0x1c(LegoFileStream* p_legoFileStream)
MxResult LegoState::VTable0x1c(LegoFile* p_legoFile)
{
if (p_legoFileStream->IsWriteMode()) {
p_legoFileStream->FUN_10006030(this->ClassName());
if (p_legoFile->IsWriteMode()) {
p_legoFile->FUN_10006030(this->ClassName());
}
return SUCCESS;
}
// FUNCTION: 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;
}