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