Rename LegoUnkSaveDataWriter -> LegoCharacterManager

This commit is contained in:
Christian Semmler 2024-03-09 13:15:28 -05:00
parent c62469fef4
commit 3c36d65d8d
12 changed files with 60 additions and 62 deletions

View File

@ -305,13 +305,13 @@ add_library(lego1 SHARED
LEGO1/lego/legoomni/src/common/animstate.cpp
LEGO1/lego/legoomni/src/common/legoactioncontrolpresenter.cpp
LEGO1/lego/legoomni/src/common/legobackgroundcolor.cpp
LEGO1/lego/legoomni/src/common/legocharactermanager.cpp
LEGO1/lego/legoomni/src/common/legofullscreenmovie.cpp
LEGO1/lego/legoomni/src/common/legogamestate.cpp
LEGO1/lego/legoomni/src/common/legoobjectfactory.cpp
LEGO1/lego/legoomni/src/common/legoplantmanager.cpp
LEGO1/lego/legoomni/src/common/legostate.cpp
LEGO1/lego/legoomni/src/common/legotextureinfo.cpp
LEGO1/lego/legoomni/src/common/legounksavedatawriter.cpp
LEGO1/lego/legoomni/src/common/legoutil.cpp
LEGO1/lego/legoomni/src/common/legovariables.cpp
LEGO1/lego/legoomni/src/common/mxcompositemediapresenter.cpp

View File

@ -1,5 +1,5 @@
#ifndef LEGOUNKSAVEDATAWRITER_H
#define LEGOUNKSAVEDATAWRITER_H
#ifndef LEGOCHARACTERMANAGER_H
#define LEGOCHARACTERMANAGER_H
#include "decomp.h"
#include "legovariables.h"
@ -51,9 +51,9 @@ struct LegoSaveDataEntry3 {
};
// SIZE 0x08
class LegoUnkSaveDataWriter {
class LegoCharacterManager {
public:
LegoUnkSaveDataWriter();
LegoCharacterManager();
MxResult WriteSaveData3(LegoStorage* p_storage);
MxResult ReadSaveData3(LegoStorage* p_storage);
@ -80,7 +80,6 @@ class LegoUnkSaveDataWriter {
};
// clang-format off
// FUNCTION: LEGO1 0x10082b90
// _Tree<char *,pair<char * const,LegoUnkSaveDataMapValue *>,map<char *,LegoUnkSaveDataMapValue *,LegoUnkSaveDataMapComparator,allocator<LegoUnkSaveDataMapValue *> >::_Kfn,LegoUnkSaveDataMapComparator,allocator<LegoUnkSaveDataMapValue *> >::~_Tree<char *,pair<char * const,LegoUnkSaveDataMapValue *>,map<char *,LegoUnkSaveDataMapValue *,LegoUnkSaveDataMapComparator,allocator<LegoUnkSaveDataMapValue *> >::_Kfn,LegoUnkSaveDataMapComparator,allocator<LegoUnkSaveDataMapValue *> >
@ -98,7 +97,6 @@ class LegoUnkSaveDataWriter {
// GLOBAL: LEGO1 0x100fc508
// _Tree<char *,pair<char * const,LegoUnkSaveDataMapValue *>,map<char *,LegoUnkSaveDataMapValue *,LegoUnkSaveDataMapComparator,allocator<LegoUnkSaveDataMapValue *> >::_Kfn,LegoUnkSaveDataMapComparator,allocator<LegoUnkSaveDataMapValue *> >::_Nil
// clang-format on
#endif // LEGOUNKSAVEDATAWRITER_H
#endif // LEGOCHARACTERMANAGER_H

View File

@ -19,7 +19,7 @@ class LegoPathBoundary;
class LegoPlantManager;
class LegoROI;
class LegoSoundManager;
class LegoUnkSaveDataWriter;
class LegoCharacterManager;
class LegoVideoManager;
class LegoWorld;
class LegoWorldList;
@ -224,7 +224,7 @@ class LegoOmni : public MxOmni {
MxBackgroundAudioManager* GetBackgroundAudioManager() { return m_bkgAudioManager; }
MxTransitionManager* GetTransitionManager() { return m_transitionManager; }
MxDSAction& GetCurrentAction() { return m_action; }
LegoUnkSaveDataWriter* GetUnkSaveDataWriter() { return m_saveDataWriter; }
LegoCharacterManager* GetCharacterManager() { return m_characterManager; }
LegoWorldList* GetWorldList() { return m_worldList; }
inline void SetNavController(LegoNavController* p_navController) { m_navController = p_navController; }
@ -247,7 +247,7 @@ class LegoOmni : public MxOmni {
MxBool m_exit; // 0x80
LegoNavController* m_navController; // 0x84
IslePathActor* m_currentActor; // 0x88
LegoUnkSaveDataWriter* m_saveDataWriter; // 0x8c
LegoCharacterManager* m_characterManager; // 0x8c
LegoPlantManager* m_plantManager; // 0x90
LegoAnimationManager* m_animationManager; // 0x94
LegoBuildingManager* m_buildingManager; // 0x98
@ -276,7 +276,7 @@ IslePathActor* CurrentActor();
ViewManager* GetViewManager();
LegoPlantManager* PlantManager();
LegoWorld* CurrentWorld();
LegoUnkSaveDataWriter* UnkSaveDataWriter();
LegoCharacterManager* CharacterManager();
LegoTextureContainer* TextureContainer();
ViewLODListManager* GetViewLODListManager();
void FUN_10015820(MxBool p_disable, MxU16 p_flags);

View File

@ -1,7 +1,7 @@
#include "legounknown100d5778.h"
#include "legocharactermanager.h"
#include "legoomni.h"
#include "legounksavedatawriter.h"
DECOMP_SIZE_ASSERT(LegoUnknown100d5778, 0x30)
@ -56,12 +56,12 @@ void LegoUnknown100d5778::Destroy()
m_dsBuffer = NULL;
}
if (m_unk0x14 && m_unk0xc && UnkSaveDataWriter()) {
if (m_unk0x14 && m_unk0xc && CharacterManager()) {
if (m_unk0x15) {
UnkSaveDataWriter()->FUN_10083db0(m_unk0xc);
CharacterManager()->FUN_10083db0(m_unk0xc);
}
else {
UnkSaveDataWriter()->FUN_10083f10(m_unk0xc);
CharacterManager()->FUN_10083f10(m_unk0xc);
}
}

View File

@ -1,23 +1,23 @@
#include "legounksavedatawriter.h"
#include "legocharactermanager.h"
#include "legogamestate.h"
#include "legoomni.h"
#include "roi/legoroi.h"
DECOMP_SIZE_ASSERT(LegoUnkSaveDataWriter, 0x08)
DECOMP_SIZE_ASSERT(LegoCharacterManager, 0x08)
DECOMP_SIZE_ASSERT(LegoSaveDataEntry3, 0x108)
// GLOBAL: LEGO1 0x100f80c0
LegoSaveDataEntry3 g_saveDataInit[66]; // TODO: add data
// GLOBAL: LEGO1 0x100fc4e4
char* LegoUnkSaveDataWriter::g_customizeAnimFile = NULL;
char* LegoCharacterManager::g_customizeAnimFile = NULL;
// GLOBAL: LEGO1 0x10104f20
LegoSaveDataEntry3 g_saveData3[66];
// FUNCTION: LEGO1 0x10082a20
LegoUnkSaveDataWriter::LegoUnkSaveDataWriter()
LegoCharacterManager::LegoCharacterManager()
{
m_map = new LegoUnkSaveDataMap();
InitSaveData();
@ -27,7 +27,7 @@ LegoUnkSaveDataWriter::LegoUnkSaveDataWriter()
}
// FUNCTION: LEGO1 0x10083270
void LegoUnkSaveDataWriter::InitSaveData()
void LegoCharacterManager::InitSaveData()
{
for (MxS32 i = 0; i < 66; i++) {
g_saveData3[i] = g_saveDataInit[i];
@ -35,13 +35,13 @@ void LegoUnkSaveDataWriter::InitSaveData()
}
// STUB: LEGO1 0x100832a0
void LegoUnkSaveDataWriter::FUN_100832a0()
void LegoCharacterManager::FUN_100832a0()
{
// TODO
}
// FUNCTION: LEGO1 0x10083310
MxResult LegoUnkSaveDataWriter::WriteSaveData3(LegoStorage* p_storage)
MxResult LegoCharacterManager::WriteSaveData3(LegoStorage* p_storage)
{
MxResult result = FAILURE;
@ -91,13 +91,13 @@ MxResult LegoUnkSaveDataWriter::WriteSaveData3(LegoStorage* p_storage)
}
// STUB: LEGO1 0x100833f0
MxResult LegoUnkSaveDataWriter::ReadSaveData3(LegoStorage* p_storage)
MxResult LegoCharacterManager::ReadSaveData3(LegoStorage* p_storage)
{
return SUCCESS;
}
// STUB: LEGO1 0x10083500
LegoROI* LegoUnkSaveDataWriter::FUN_10083500(const char* p_key, MxBool p_option)
LegoROI* LegoCharacterManager::FUN_10083500(const char* p_key, MxBool p_option)
{
// TODO
// involves an STL map with a _Nil node at 0x100fc508
@ -105,33 +105,33 @@ LegoROI* LegoUnkSaveDataWriter::FUN_10083500(const char* p_key, MxBool p_option)
}
// STUB: LEGO1 0x10083db0
void LegoUnkSaveDataWriter::FUN_10083db0(LegoROI* p_roi)
void LegoCharacterManager::FUN_10083db0(LegoROI* p_roi)
{
// TODO
}
// STUB: LEGO1 0x10083f10
void LegoUnkSaveDataWriter::FUN_10083f10(LegoROI* p_roi)
void LegoCharacterManager::FUN_10083f10(LegoROI* p_roi)
{
// TODO
}
// STUB: LEGO1 0x10084c00
MxBool LegoUnkSaveDataWriter::FUN_10084c00(const LegoChar*)
MxBool LegoCharacterManager::FUN_10084c00(const LegoChar*)
{
// TODO
return FALSE;
}
// STUB: LEGO1 0x10085140
MxU32 LegoUnkSaveDataWriter::FUN_10085140(LegoROI*, MxBool)
MxU32 LegoCharacterManager::FUN_10085140(LegoROI*, MxBool)
{
// TODO
return 0;
}
// FUNCTION: LEGO1 0x100851a0
void LegoUnkSaveDataWriter::SetCustomizeAnimFile(const char* p_value)
void LegoCharacterManager::SetCustomizeAnimFile(const char* p_value)
{
if (g_customizeAnimFile != NULL) {
delete[] g_customizeAnimFile;
@ -150,13 +150,13 @@ void LegoUnkSaveDataWriter::SetCustomizeAnimFile(const char* p_value)
}
// STUB: LEGO1 0x10085210
LegoROI* LegoUnkSaveDataWriter::FUN_10085210(const LegoChar*, LegoChar*, undefined)
LegoROI* LegoCharacterManager::FUN_10085210(const LegoChar*, LegoChar*, undefined)
{
return NULL;
}
// FUNCTION: LEGO1 0x10085a80
LegoROI* LegoUnkSaveDataWriter::FUN_10085a80(LegoChar* p_und1, LegoChar* p_und2, undefined p_und3)
LegoROI* LegoCharacterManager::FUN_10085a80(LegoChar* p_und1, LegoChar* p_und2, undefined p_und3)
{
return FUN_10085210(p_und1, p_und2, p_und3);
}

View File

@ -10,11 +10,11 @@
#include "jetski.h"
#include "legoanimationmanager.h"
#include "legobuildingmanager.h"
#include "legocharactermanager.h"
#include "legonavcontroller.h"
#include "legoomni.h"
#include "legoplantmanager.h"
#include "legostate.h"
#include "legounksavedatawriter.h"
#include "legoutil.h"
#include "legovideomanager.h"
#include "legoworld.h"
@ -144,7 +144,7 @@ void LegoGameState::SetActor(MxU8 p_actorId)
IslePathActor* newActor = new IslePathActor();
const char* actorName = LegoActor::GetActorName(m_actorId);
LegoROI* roi = UnkSaveDataWriter()->FUN_10083500(actorName, FALSE);
LegoROI* roi = CharacterManager()->FUN_10083500(actorName, FALSE);
MxDSAction action;
action.SetAtomId(*g_isleScript);
@ -232,7 +232,7 @@ MxResult LegoGameState::Save(MxULong p_slot)
}
WriteEndOfVariables(&fileStorage);
UnkSaveDataWriter()->WriteSaveData3(&fileStorage);
CharacterManager()->WriteSaveData3(&fileStorage);
PlantManager()->Save(&fileStorage);
result = BuildingManager()->Save(&fileStorage);
@ -331,7 +331,7 @@ MxResult LegoGameState::Load(MxULong p_slot)
SetLightPosition(atoi(lightPosition));
}
if (UnkSaveDataWriter()->ReadSaveData3(&fileStorage) == FAILURE) {
if (CharacterManager()->ReadSaveData3(&fileStorage) == FAILURE) {
goto done;
}
if (PlantManager()->Load(&fileStorage) == FAILURE) {
@ -1048,7 +1048,7 @@ void LegoGameState::Init()
SetLightPosition(2);
PlantManager()->Init();
BuildingManager()->Init();
UnkSaveDataWriter()->InitSaveData();
CharacterManager()->InitSaveData();
AnimationManager()->FUN_1005ee80(TRUE);
SetColors();
RemoveActor();

View File

@ -1,9 +1,9 @@
#include "legovariables.h"
#include "legobuildingmanager.h"
#include "legocharactermanager.h"
#include "legoomni.h"
#include "legoplantmanager.h"
#include "legounksavedatawriter.h"
DECOMP_SIZE_ASSERT(VisibilityVariable, 0x24)
DECOMP_SIZE_ASSERT(CameraLocationVariable, 0x24)
@ -62,7 +62,7 @@ void CustomizeAnimFileVariable::SetValue(const char* p_value)
{
// STRING: LEGO1 0x100fc4f4
if (strcmp(m_key.GetData(), "CUSTOMIZE_ANIM_FILE") == 0) {
UnkSaveDataWriter()->SetCustomizeAnimFile(p_value);
CharacterManager()->SetCustomizeAnimFile(p_value);
PlantManager()->SetCustomizeAnimFile(p_value);
BuildingManager()->SetCustomizeAnimFile(p_value);
}

View File

@ -2,9 +2,9 @@
#include "define.h"
#include "legobuildingmanager.h"
#include "legocharactermanager.h"
#include "legoomni.h"
#include "legoplantmanager.h"
#include "legounksavedatawriter.h"
#include "legoutil.h"
#include "legovideomanager.h"
#include "legoworld.h"
@ -86,7 +86,7 @@ void LegoEntity::Destroy(MxBool p_fromDestructor)
m_roi->SetEntity(NULL);
}
UnkSaveDataWriter()->FUN_10083db0(m_roi);
CharacterManager()->FUN_10083db0(m_roi);
}
else {
VideoManager()->Get3DManager()->GetLego3DView()->Remove(*m_roi);
@ -214,7 +214,7 @@ void LegoEntity::VTable0x34(MxBool p_und)
switch (m_unk0x59) {
case 0:
objectId = UnkSaveDataWriter()->FUN_10085140(m_roi, p_und);
objectId = CharacterManager()->FUN_10085140(m_roi, p_und);
break;
case 1:
break;
@ -228,7 +228,7 @@ void LegoEntity::VTable0x34(MxBool p_und)
if (objectId) {
MxDSAction action;
action.SetAtomId(MxAtomId(UnkSaveDataWriter()->GetCustomizeAnimFile(), e_lowerCase2));
action.SetAtomId(MxAtomId(CharacterManager()->GetCustomizeAnimFile(), e_lowerCase2));
action.SetObjectId(objectId);
action.AppendData(strlen(roiName) + 1, roiName);
Start(&action);

View File

@ -7,12 +7,12 @@
#include "legoact2state.h"
#include "legoanimationmanager.h"
#include "legobuildingmanager.h"
#include "legocharactermanager.h"
#include "legocontrolmanager.h"
#include "legogamestate.h"
#include "legoinputmanager.h"
#include "legoomni.h"
#include "legoplantmanager.h"
#include "legounksavedatawriter.h"
#include "legoutil.h"
#include "legovideomanager.h"
#include "mxactionnotificationparam.h"
@ -1284,7 +1284,7 @@ void Infocenter::Reset()
PlantManager()->FUN_10027120();
BuildingManager()->FUN_10030590();
AnimationManager()->FUN_1005ee80(FALSE);
UnkSaveDataWriter()->FUN_100832a0();
CharacterManager()->FUN_100832a0();
GameState()->SetCurrentAct(LegoGameState::e_act1);
GameState()->SetPreviousArea(LegoGameState::e_noArea);
GameState()->SetUnknown0x42c(LegoGameState::e_noArea);

View File

@ -2,12 +2,12 @@
#include "legoanimationmanager.h"
#include "legobuildingmanager.h"
#include "legocharactermanager.h"
#include "legogamestate.h"
#include "legoinputmanager.h"
#include "legoobjectfactory.h"
#include "legoplantmanager.h"
#include "legosoundmanager.h"
#include "legounksavedatawriter.h"
#include "legoutil.h"
#include "legovariables.h"
#include "legovideomanager.h"
@ -191,9 +191,9 @@ LegoWorld* CurrentWorld()
}
// FUNCTION: LEGO1 0x100157b0
LegoUnkSaveDataWriter* UnkSaveDataWriter()
LegoCharacterManager* CharacterManager()
{
return LegoOmni::GetInstance()->GetUnkSaveDataWriter();
return LegoOmni::GetInstance()->GetCharacterManager();
}
// FUNCTION: LEGO1 0x100157c0
@ -485,7 +485,7 @@ void LegoOmni::Init()
m_currentWorld = NULL;
m_exit = FALSE;
m_currentActor = NULL;
m_saveDataWriter = NULL;
m_characterManager = NULL;
m_plantManager = NULL;
m_gameState = NULL;
m_animationManager = NULL;
@ -517,9 +517,9 @@ void LegoOmni::Destroy()
m_animationManager = NULL;
}
if (m_saveDataWriter) {
delete m_saveDataWriter;
m_saveDataWriter = NULL;
if (m_characterManager) {
delete m_characterManager;
m_characterManager = NULL;
}
if (m_plantManager) {
@ -621,14 +621,14 @@ MxResult LegoOmni::Create(MxOmniCreateParam& p_param)
m_textureContainer->SetOwnership(FALSE);
// FUN_10046c10
m_saveDataWriter = new LegoUnkSaveDataWriter();
m_characterManager = new LegoCharacterManager();
m_plantManager = new LegoPlantManager();
m_animationManager = new LegoAnimationManager();
m_buildingManager = new LegoBuildingManager();
m_gameState = new LegoGameState();
m_worldList = new LegoWorldList(TRUE);
if (!m_viewLODListManager || !m_textureContainer || !m_worldList || !m_saveDataWriter || !m_plantManager ||
if (!m_viewLODListManager || !m_textureContainer || !m_worldList || !m_characterManager || !m_plantManager ||
!m_animationManager || !m_buildingManager) {
goto done;
}

View File

@ -1,8 +1,8 @@
#include "legoanimpresenter.h"
#include "legoanimmmpresenter.h"
#include "legocharactermanager.h"
#include "legoomni.h"
#include "legounksavedatawriter.h"
#include "legovideomanager.h"
#include "legoworld.h"
#include "mxcompositepresenter.h"
@ -113,7 +113,7 @@ LegoChar* LegoAnimPresenter::FUN_10069150(const LegoChar* p_und1)
{
LegoChar* str;
if (LegoUnkSaveDataWriter::FUN_10084c00(p_und1 + 1)) {
if (LegoCharacterManager::FUN_10084c00(p_und1 + 1)) {
str = new LegoChar[strlen(p_und1)];
if (str != NULL) {
@ -157,7 +157,7 @@ void LegoAnimPresenter::FUN_100692b0()
src = str;
}
roi = UnkSaveDataWriter()->FUN_10083500(src, TRUE);
roi = CharacterManager()->FUN_10083500(src, TRUE);
if (roi != NULL && str[0] == '*') {
roi->SetUnknown0x0c(0);
@ -169,7 +169,7 @@ void LegoAnimPresenter::FUN_100692b0()
strlwr(src);
LegoChar* und = FUN_10069150(str);
roi = UnkSaveDataWriter()->FUN_10085a80(und, src, 1);
roi = CharacterManager()->FUN_10085a80(und, src, 1);
if (roi != NULL) {
roi->SetUnknown0x0c(0);
@ -193,7 +193,7 @@ void LegoAnimPresenter::FUN_100692b0()
strlwr(src);
LegoChar* und = FUN_10069150(str);
roi = UnkSaveDataWriter()->FUN_10085210(und, src, 1);
roi = CharacterManager()->FUN_10085210(und, src, 1);
if (roi != NULL) {
roi->SetUnknown0x0c(0);
@ -238,7 +238,7 @@ void LegoAnimPresenter::FUN_100695c0()
strlwr(dest);
UnkSaveDataWriter()->FUN_10085210(str, dest, 0);
CharacterManager()->FUN_10085210(str, dest, 0);
FUN_100698b0(rois, str);
}
}

View File

@ -2,10 +2,10 @@
#include "anim/legoanim.h"
#include "define.h"
#include "legocharactermanager.h"
#include "legoentity.h"
#include "legoentitypresenter.h"
#include "legoomni.h"
#include "legounksavedatawriter.h"
#include "legovideomanager.h"
#include "legoworld.h"
#include "misc/legocontainer.h"
@ -308,7 +308,7 @@ void LegoModelPresenter::ParseExtra()
char* token = strtok(output, g_parseExtraTokens);
if (m_roi == NULL) {
m_roi = UnkSaveDataWriter()->FUN_10083500(token, FALSE);
m_roi = CharacterManager()->FUN_10083500(token, FALSE);
m_addedToView = FALSE;
}
}