Add Read for char*

This commit is contained in:
Christian Semmler 2025-01-15 15:38:43 -07:00
parent 1a2b2f1a20
commit 2bccf4edd3
2 changed files with 10 additions and 4 deletions

View File

@ -390,10 +390,7 @@ MxResult LegoGameState::Load(MxULong p_slot)
if (count) {
for (MxS16 i = 0; i < count; i++) {
MxS16 stateNameLength;
storage.Read(stateNameLength);
storage.Read(stateName, (MxULong) stateNameLength);
stateName[stateNameLength] = 0;
storage.Read(stateName);
LegoState* state = GetState(stateName);
if (!state) {

View File

@ -155,6 +155,15 @@ class LegoFile : public LegoStorage {
return this;
}
LegoStorage* Read(char* p_data)
{
LegoS16 length;
Read(length);
Read(p_data, length);
p_data[length] = '\0';
return this;
}
// FUNCTION: LEGO1 0x10034470
LegoStorage* Read(MxString& p_data)
{