From 36281fd10ff17b719eade7fb61b630437446f201 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Tue, 17 Oct 2023 18:02:04 -0400 Subject: [PATCH] Match and relocate FUN_10006030 --- LEGO1/legostate.cpp | 13 +++++++++++++ LEGO1/legostream.cpp | 12 ------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/LEGO1/legostate.cpp b/LEGO1/legostate.cpp index e5aa042f..4b808624 100644 --- a/LEGO1/legostate.cpp +++ b/LEGO1/legostate.cpp @@ -25,3 +25,16 @@ MxResult LegoState::VTable0x1C(LegoFileStream *p_legoFileStream) } 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; +} \ No newline at end of file diff --git a/LEGO1/legostream.cpp b/LEGO1/legostream.cpp index 65a10c60..0bc24db9 100644 --- a/LEGO1/legostream.cpp +++ b/LEGO1/legostream.cpp @@ -116,18 +116,6 @@ MxResult LegoFileStream::Open(const char* p_filename, OpenFlags p_mode) return (m_hFile = fopen(p_filename, modeString)) ? SUCCESS : FAILURE; } -// OFFSET: LEGO1 0x10006030 -LegoFileStream *LegoFileStream::FUN_10006030(MxString p_str) -{ - MxS16 strLength = strlen(p_str.GetData()); - const char *strData = p_str.GetData(); - - Write(&strLength, sizeof(strLength)); - Write(strData, strLength); - - return this; -} - // OFFSET: LEGO1 0x10099080 LegoMemoryStream::LegoMemoryStream(char* p_buffer) : LegoStream()