mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-28 18:51:16 +00:00
Fixes
This commit is contained in:
parent
1f1c2851e9
commit
67ec1f7508
@ -3,18 +3,21 @@
|
||||
|
||||
#include "decomp.h"
|
||||
#include "lego/sources/misc/legostorage.h"
|
||||
#include "legovariables.h"
|
||||
#include "mxstl/stlcompat.h"
|
||||
#include "mxtypes.h"
|
||||
|
||||
class LegoROI;
|
||||
|
||||
#pragma warning(disable : 4237)
|
||||
|
||||
// TODO: generic string comparator?
|
||||
struct LegoUnkSaveDataMapComparator {
|
||||
bool operator()(const char* const& p_a, const char* const& p_b) const { return strcmpi(p_a, p_b) > 0; }
|
||||
};
|
||||
|
||||
// TODO: pair instead?
|
||||
// SIZE 0x8
|
||||
// SIZE 0x08
|
||||
struct LegoUnkSaveDataMapValue {
|
||||
LegoROI* m_roi; // 0x00
|
||||
MxU32 m_counter; // 0x04
|
||||
@ -54,18 +57,19 @@ class LegoUnkSaveDataWriter {
|
||||
|
||||
MxResult WriteSaveData3(LegoStorage* p_stream);
|
||||
LegoROI* FUN_10083500(char*, MxBool);
|
||||
void InitSaveData();
|
||||
|
||||
static void InitSaveData();
|
||||
static void SetCustomizeAnimFile(const char* p_value);
|
||||
|
||||
void FUN_100832a0();
|
||||
void FUN_10083db0(LegoROI* p_roi);
|
||||
void FUN_10083f10(LegoROI* p_roi);
|
||||
|
||||
static void SetCustomizeAnimFile(const char* p_value);
|
||||
|
||||
private:
|
||||
static char* g_customizeAnimFile;
|
||||
|
||||
LegoUnkSaveDataMap* m_map; // 0x00
|
||||
undefined m_unk0x04[0x04]; // 0x04
|
||||
LegoUnkSaveDataMap* m_map; // 0x00
|
||||
CustomizeAnimFileVariable* m_customizeAnimFile; // 0x04
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
|
||||
@ -48,8 +48,7 @@ class WhoAmIVariable : public MxVariable {
|
||||
// SIZE 0x24
|
||||
class CustomizeAnimFileVariable : public MxVariable {
|
||||
public:
|
||||
// FUNCTION: LEGO1 0x10085aa0
|
||||
CustomizeAnimFileVariable() : MxVariable("CUSTOMIZE_ANIM_FILE") {}
|
||||
CustomizeAnimFileVariable(const char* p_key);
|
||||
|
||||
void SetValue(const char* p_value) override; // vtable+0x04
|
||||
};
|
||||
|
||||
@ -58,10 +58,10 @@ void LegoBuildingManager::SetCustomizeAnimFile(const char* p_value)
|
||||
}
|
||||
|
||||
strcpy(g_customizeAnimFile, p_value);
|
||||
return;
|
||||
}
|
||||
|
||||
g_customizeAnimFile = NULL;
|
||||
else {
|
||||
g_customizeAnimFile = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10030220
|
||||
|
||||
@ -49,10 +49,10 @@ void LegoPlantManager::SetCustomizeAnimFile(const char* p_value)
|
||||
}
|
||||
|
||||
strcpy(g_customizeAnimFile, p_value);
|
||||
return;
|
||||
}
|
||||
|
||||
g_customizeAnimFile = NULL;
|
||||
else {
|
||||
g_customizeAnimFile = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10026e00
|
||||
|
||||
@ -2,7 +2,6 @@
|
||||
|
||||
#include "legogamestate.h"
|
||||
#include "legoomni.h"
|
||||
#include "legovariables.h"
|
||||
#include "roi/legoroi.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoUnkSaveDataWriter, 0x08)
|
||||
@ -23,9 +22,8 @@ LegoUnkSaveDataWriter::LegoUnkSaveDataWriter()
|
||||
m_map = new LegoUnkSaveDataMap();
|
||||
InitSaveData();
|
||||
|
||||
// DECOMP: this constructor is partially inlined
|
||||
CustomizeAnimFileVariable* v = new CustomizeAnimFileVariable();
|
||||
VariableTable()->SetVariable(v);
|
||||
m_customizeAnimFile = new CustomizeAnimFileVariable("CUSTOMIZE_ANIM_FILE");
|
||||
VariableTable()->SetVariable(m_customizeAnimFile);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10083270
|
||||
@ -125,8 +123,8 @@ void LegoUnkSaveDataWriter::SetCustomizeAnimFile(const char* p_value)
|
||||
}
|
||||
|
||||
strcpy(g_customizeAnimFile, p_value);
|
||||
return;
|
||||
}
|
||||
|
||||
g_customizeAnimFile = NULL;
|
||||
else {
|
||||
g_customizeAnimFile = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@ -44,15 +44,20 @@ void WhoAmIVariable::SetValue(const char* p_value)
|
||||
// TODO
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10085aa0
|
||||
CustomizeAnimFileVariable::CustomizeAnimFileVariable(const char* p_key)
|
||||
{
|
||||
m_key = p_key;
|
||||
m_key.ToUpperCase();
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10085b50
|
||||
void CustomizeAnimFileVariable::SetValue(const char* p_value)
|
||||
{
|
||||
// STRING: LEGO1 0x100fc4f4
|
||||
if (strcmp(m_key.GetData(), "CUSTOMIZE_ANIM_FILE") != 0) {
|
||||
return;
|
||||
if (strcmp(m_key.GetData(), "CUSTOMIZE_ANIM_FILE") == 0) {
|
||||
UnkSaveDataWriter()->SetCustomizeAnimFile(p_value);
|
||||
PlantManager()->SetCustomizeAnimFile(p_value);
|
||||
BuildingManager()->SetCustomizeAnimFile(p_value);
|
||||
}
|
||||
|
||||
UnkSaveDataWriter()->SetCustomizeAnimFile(p_value);
|
||||
PlantManager()->SetCustomizeAnimFile(p_value);
|
||||
BuildingManager()->SetCustomizeAnimFile(p_value);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user