mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 08:24:16 +00:00
Implement LegoCharacterManager::CreateROI (#709)
* WIP * Create globals * Add Read * Name Init * Add LegoCharacter init data * Add define for NULL * Use MxS8 * Add LegoCharacterLOD * WIP CreateROI * Fix * WIP * Match * Match * Match, implement Find * Fix MeshBuilder * Fix * space
This commit is contained in:

committed by
GitHub

parent
8cffa7cf8c
commit
68bb20f04f
@@ -31,50 +31,27 @@ struct LegoCharacter {
|
||||
MxU32 m_refCount; // 0x04
|
||||
};
|
||||
|
||||
typedef map<const char*, LegoCharacter*, LegoCharacterComparator> LegoCharacterMap;
|
||||
struct LegoCharacterData;
|
||||
|
||||
struct LegoSaveDataEntry3 {
|
||||
char* m_name;
|
||||
void* m_unk0x04;
|
||||
LegoActor* m_actor;
|
||||
MxS32 m_savePart1;
|
||||
MxS32 m_savePart2;
|
||||
MxU8 m_savePart3;
|
||||
undefined4 m_unk0x18[6];
|
||||
MxU8 m_frameOffsetInDwords; // 0x30
|
||||
MxS32* m_pFrameData;
|
||||
MxU8 m_currentFrame;
|
||||
undefined4 m_unk0x3c[2];
|
||||
MxU8 m_savePart5; // 0x44
|
||||
undefined4 m_unk0x48[5];
|
||||
MxU8 m_savePart6; // 0x5c
|
||||
undefined4 m_unk0x60[11];
|
||||
MxU8 m_savePart7; // 0x8c
|
||||
undefined4 m_unk0x90[5];
|
||||
MxU8 m_savePart8; // 0xa4
|
||||
undefined4 m_unk0xa8[17];
|
||||
MxU8 m_savePart9; // 0xec
|
||||
undefined4 m_unk0xf0[5];
|
||||
MxU8 m_savePart10; // 0x104
|
||||
};
|
||||
typedef map<const char*, LegoCharacter*, LegoCharacterComparator> LegoCharacterMap;
|
||||
|
||||
// SIZE 0x08
|
||||
class LegoCharacterManager {
|
||||
public:
|
||||
LegoCharacterManager();
|
||||
|
||||
MxResult WriteSaveData3(LegoStorage* p_storage);
|
||||
MxResult ReadSaveData3(LegoStorage* p_storage);
|
||||
MxResult Write(LegoStorage* p_storage);
|
||||
MxResult Read(LegoStorage* p_storage);
|
||||
LegoROI* GetROI(const char* p_key, MxBool p_createEntity);
|
||||
|
||||
void InitSaveData();
|
||||
void Init();
|
||||
static void SetCustomizeAnimFile(const char* p_value);
|
||||
static MxBool FUN_10084c00(const LegoChar*);
|
||||
|
||||
void FUN_100832a0();
|
||||
void FUN_10083db0(LegoROI* p_roi);
|
||||
void FUN_10083f10(LegoROI* p_roi);
|
||||
LegoSaveDataEntry3* FUN_10084c60(const char* p_key);
|
||||
LegoCharacterData* Find(const char* p_key);
|
||||
MxBool FUN_10084ec0(LegoROI* p_roi);
|
||||
MxU32 FUN_10085140(LegoROI*, MxBool);
|
||||
LegoROI* FUN_10085210(const LegoChar*, LegoChar*, undefined);
|
||||
@@ -92,6 +69,12 @@ private:
|
||||
};
|
||||
|
||||
// clang-format off
|
||||
// TEMPLATE: LEGO1 0x1001a690
|
||||
// list<ROI *,allocator<ROI *> >::_Buynode
|
||||
|
||||
// TEMPLATE: LEGO1 0x10035790
|
||||
// _Construct
|
||||
|
||||
// TEMPLATE: LEGO1 0x10082b90
|
||||
// _Tree<char const *,pair<char const * const,LegoCharacter *>,map<char const *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::~_Tree<char const *,pair<char const * const,LegoCharacter *>,map<char const *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >
|
||||
|
||||
|
51
LEGO1/lego/legoomni/include/legocharacters.h
Normal file
51
LEGO1/lego/legoomni/include/legocharacters.h
Normal file
@@ -0,0 +1,51 @@
|
||||
#ifndef LEGOCHARACTERS_H
|
||||
#define LEGOCHARACTERS_H
|
||||
|
||||
#include "decomp.h"
|
||||
#include "mxtypes.h"
|
||||
|
||||
class LegoActor;
|
||||
class LegoROI;
|
||||
|
||||
// SIZE 0x108
|
||||
struct LegoCharacterData {
|
||||
// SIZE 0x18
|
||||
struct Part {
|
||||
MxU8* m_unk0x00; // 0x00
|
||||
const char** m_unk0x04; // 0x04
|
||||
MxU8 m_unk0x08; // 0x08
|
||||
MxU8* m_unk0x0c; // 0x0c
|
||||
const char** m_unk0x10; // 0x10
|
||||
MxU8 m_unk0x14; // 0x14
|
||||
};
|
||||
|
||||
char* m_name; // 0x00
|
||||
LegoROI* m_roi; // 0x04
|
||||
LegoActor* m_actor; // 0x08
|
||||
MxS32 m_unk0x0c; // 0x0c
|
||||
MxS32 m_unk0x10; // 0x10
|
||||
MxU8 m_unk0x14; // 0x14
|
||||
Part m_parts[10]; // 0x18
|
||||
};
|
||||
|
||||
// SIZE 0x58
|
||||
struct LegoCharacterLOD {
|
||||
enum {
|
||||
c_flag1 = 0x01,
|
||||
c_flag2 = 0x02
|
||||
};
|
||||
|
||||
const char* m_name; // 0x00
|
||||
const char* m_parentName; // 0x04
|
||||
MxU32 m_flags; // 0x08
|
||||
float m_boundingSphere[4]; // 0x0c
|
||||
float m_boundingBox[6]; // 0x1c
|
||||
float m_position[3]; // 0x34
|
||||
float m_direction[3]; // 0x40
|
||||
float m_up[3]; // 0x4c
|
||||
};
|
||||
|
||||
extern LegoCharacterData g_characterDataInit[66];
|
||||
extern LegoCharacterLOD g_characterLODs[11];
|
||||
|
||||
#endif // LEGOCHARACTERS_H
|
@@ -1,40 +1,40 @@
|
||||
#include "legocharactermanager.h"
|
||||
|
||||
#include "legoanimactor.h"
|
||||
#include "legocharacters.h"
|
||||
#include "legogamestate.h"
|
||||
#include "legovideomanager.h"
|
||||
#include "misc.h"
|
||||
#include "misc/legocontainer.h"
|
||||
#include "mxmisc.h"
|
||||
#include "realtime/realtime.h"
|
||||
#include "roi/legolod.h"
|
||||
#include "roi/legoroi.h"
|
||||
|
||||
DECOMP_SIZE_ASSERT(LegoCharacter, 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* LegoCharacterManager::g_customizeAnimFile = NULL;
|
||||
|
||||
// GLOBAL: LEGO1 0x10104f20
|
||||
LegoSaveDataEntry3 g_saveData3[66];
|
||||
LegoCharacterData g_characterData[66];
|
||||
|
||||
// FUNCTION: LEGO1 0x10082a20
|
||||
LegoCharacterManager::LegoCharacterManager()
|
||||
{
|
||||
m_characters = new LegoCharacterMap();
|
||||
InitSaveData();
|
||||
Init();
|
||||
|
||||
m_customizeAnimFile = new CustomizeAnimFileVariable("CUSTOMIZE_ANIM_FILE");
|
||||
VariableTable()->SetVariable(m_customizeAnimFile);
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10083270
|
||||
void LegoCharacterManager::InitSaveData()
|
||||
void LegoCharacterManager::Init()
|
||||
{
|
||||
for (MxS32 i = 0; i < 66; i++) {
|
||||
g_saveData3[i] = g_saveDataInit[i];
|
||||
for (MxS32 i = 0; i < _countof(g_characterData); i++) {
|
||||
g_characterData[i] = g_characterDataInit[i];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -45,59 +45,95 @@ void LegoCharacterManager::FUN_100832a0()
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10083310
|
||||
MxResult LegoCharacterManager::WriteSaveData3(LegoStorage* p_storage)
|
||||
MxResult LegoCharacterManager::Write(LegoStorage* p_storage)
|
||||
{
|
||||
MxResult result = FAILURE;
|
||||
|
||||
// This should probably be a for loop but I can't figure out how to
|
||||
// make it match as a for loop.
|
||||
LegoSaveDataEntry3* entry = g_saveData3;
|
||||
const LegoSaveDataEntry3* end = &g_saveData3[66];
|
||||
for (MxS32 i = 0; i < _countof(g_characterData) - 1; i++) {
|
||||
LegoCharacterData* data = &g_characterData[i];
|
||||
|
||||
while (TRUE) {
|
||||
if (p_storage->Write(&entry->m_savePart1, 4) != SUCCESS) {
|
||||
break;
|
||||
if (p_storage->Write(&data->m_unk0x0c, sizeof(data->m_unk0x0c)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&entry->m_savePart2, 4) != SUCCESS) {
|
||||
break;
|
||||
if (p_storage->Write(&data->m_unk0x10, sizeof(data->m_unk0x10)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&entry->m_savePart3, 1) != SUCCESS) {
|
||||
break;
|
||||
if (p_storage->Write(&data->m_unk0x14, sizeof(data->m_unk0x14)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&entry->m_currentFrame, 1) != SUCCESS) {
|
||||
break;
|
||||
if (p_storage->Write(&data->m_parts[1].m_unk0x08, sizeof(data->m_parts[1].m_unk0x08)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&entry->m_savePart5, 1) != SUCCESS) {
|
||||
break;
|
||||
if (p_storage->Write(&data->m_parts[1].m_unk0x14, sizeof(data->m_parts[1].m_unk0x14)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&entry->m_savePart6, 1) != SUCCESS) {
|
||||
break;
|
||||
if (p_storage->Write(&data->m_parts[2].m_unk0x14, sizeof(data->m_parts[2].m_unk0x14)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&entry->m_savePart7, 1) != SUCCESS) {
|
||||
break;
|
||||
if (p_storage->Write(&data->m_parts[4].m_unk0x14, sizeof(data->m_parts[4].m_unk0x14)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&entry->m_savePart8, 1) != SUCCESS) {
|
||||
break;
|
||||
if (p_storage->Write(&data->m_parts[5].m_unk0x14, sizeof(data->m_parts[5].m_unk0x14)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&entry->m_savePart9, 1) != SUCCESS) {
|
||||
break;
|
||||
if (p_storage->Write(&data->m_parts[8].m_unk0x14, sizeof(data->m_parts[8].m_unk0x14)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Write(&entry->m_savePart10, 1) != SUCCESS) {
|
||||
break;
|
||||
}
|
||||
if (++entry >= end) {
|
||||
result = SUCCESS;
|
||||
break;
|
||||
if (p_storage->Write(&data->m_parts[9].m_unk0x14, sizeof(data->m_parts[9].m_unk0x14)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
result = SUCCESS;
|
||||
|
||||
done:
|
||||
return result;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x100833f0
|
||||
MxResult LegoCharacterManager::ReadSaveData3(LegoStorage* p_storage)
|
||||
// FUNCTION: LEGO1 0x100833f0
|
||||
MxResult LegoCharacterManager::Read(LegoStorage* p_storage)
|
||||
{
|
||||
return SUCCESS;
|
||||
MxResult result = FAILURE;
|
||||
|
||||
for (MxS32 i = 0; i < _countof(g_characterData) - 1; i++) {
|
||||
LegoCharacterData* data = &g_characterData[i];
|
||||
|
||||
if (p_storage->Read(&data->m_unk0x0c, sizeof(data->m_unk0x0c)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&data->m_unk0x10, sizeof(data->m_unk0x10)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&data->m_unk0x14, sizeof(data->m_unk0x14)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&data->m_parts[1].m_unk0x08, sizeof(data->m_parts[1].m_unk0x08)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&data->m_parts[1].m_unk0x14, sizeof(data->m_parts[1].m_unk0x14)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&data->m_parts[2].m_unk0x14, sizeof(data->m_parts[2].m_unk0x14)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&data->m_parts[4].m_unk0x14, sizeof(data->m_parts[4].m_unk0x14)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&data->m_parts[5].m_unk0x14, sizeof(data->m_parts[5].m_unk0x14)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&data->m_parts[8].m_unk0x14, sizeof(data->m_parts[8].m_unk0x14)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
if (p_storage->Read(&data->m_parts[9].m_unk0x14, sizeof(data->m_parts[9].m_unk0x14)) != SUCCESS) {
|
||||
goto done;
|
||||
}
|
||||
}
|
||||
|
||||
result = SUCCESS;
|
||||
|
||||
done:
|
||||
return result;
|
||||
}
|
||||
|
||||
// FUNCTION: LEGO1 0x10083500
|
||||
@@ -139,7 +175,7 @@ LegoROI* LegoCharacterManager::GetROI(const char* p_key, MxBool p_createEntity)
|
||||
actor->SetROI(character->m_roi, FALSE, FALSE);
|
||||
actor->FUN_100114e0(0);
|
||||
actor->SetFlag(LegoActor::c_bit2);
|
||||
FUN_10084c60(p_key)->m_actor = actor;
|
||||
Find(p_key)->m_actor = actor;
|
||||
}
|
||||
|
||||
return character->m_roi;
|
||||
@@ -160,10 +196,153 @@ void LegoCharacterManager::FUN_10083f10(LegoROI* p_roi)
|
||||
// TODO
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10084030
|
||||
// FUNCTION: LEGO1 0x10084030
|
||||
LegoROI* LegoCharacterManager::CreateROI(const char* p_key)
|
||||
{
|
||||
return NULL;
|
||||
MxBool success = FALSE;
|
||||
LegoROI* roi = NULL;
|
||||
BoundingSphere boundingSphere;
|
||||
BoundingBox boundingBox;
|
||||
MxMatrix mat;
|
||||
CompoundObject* comp;
|
||||
MxS32 i, j;
|
||||
|
||||
Tgl::Renderer* renderer = VideoManager()->GetRenderer();
|
||||
ViewLODListManager* lodManager = GetViewLODListManager();
|
||||
LegoTextureContainer* textureContainer = TextureContainer();
|
||||
LegoCharacterData* characterData = Find(p_key);
|
||||
|
||||
if (characterData == NULL) {
|
||||
goto done;
|
||||
}
|
||||
|
||||
if (!strcmpi(p_key, "pep")) {
|
||||
LegoCharacterData* pepper = Find("pepper");
|
||||
|
||||
characterData->m_unk0x0c = pepper->m_unk0x0c;
|
||||
characterData->m_unk0x10 = pepper->m_unk0x10;
|
||||
characterData->m_unk0x14 = pepper->m_unk0x14;
|
||||
|
||||
for (i = 0; i < _countof(characterData->m_parts); i++) {
|
||||
characterData->m_parts[i] = pepper->m_parts[i];
|
||||
}
|
||||
}
|
||||
|
||||
roi = new LegoROI(renderer);
|
||||
roi->SetName(p_key);
|
||||
|
||||
boundingSphere.Center()[0] = g_characterLODs[0].m_boundingSphere[0];
|
||||
boundingSphere.Center()[1] = g_characterLODs[0].m_boundingSphere[1];
|
||||
boundingSphere.Center()[2] = g_characterLODs[0].m_boundingSphere[2];
|
||||
boundingSphere.Radius() = g_characterLODs[0].m_boundingSphere[3];
|
||||
roi->SetBoundingSphere(boundingSphere);
|
||||
|
||||
boundingBox.Min()[0] = g_characterLODs[0].m_boundingBox[0];
|
||||
boundingBox.Min()[1] = g_characterLODs[0].m_boundingBox[1];
|
||||
boundingBox.Min()[2] = g_characterLODs[0].m_boundingBox[2];
|
||||
boundingBox.Max()[0] = g_characterLODs[0].m_boundingBox[3];
|
||||
boundingBox.Max()[1] = g_characterLODs[0].m_boundingBox[4];
|
||||
boundingBox.Max()[2] = g_characterLODs[0].m_boundingBox[5];
|
||||
roi->SetUnknown0x80(boundingBox);
|
||||
|
||||
comp = new CompoundObject();
|
||||
roi->SetComp(comp);
|
||||
|
||||
for (i = 0; i < _countof(g_characterLODs) - 1; i++) {
|
||||
ViewLODList *lodList, *dupLodList;
|
||||
LegoROI* childROI;
|
||||
MxS32 lodSize;
|
||||
const char* parentName;
|
||||
char lodName[64];
|
||||
|
||||
LegoCharacterData::Part& part = characterData->m_parts[i];
|
||||
|
||||
if (i == 0 || i == 1) {
|
||||
parentName = part.m_unk0x04[part.m_unk0x00[part.m_unk0x08]];
|
||||
}
|
||||
else {
|
||||
parentName = g_characterLODs[i + 1].m_parentName;
|
||||
}
|
||||
|
||||
lodList = lodManager->Lookup(parentName);
|
||||
lodSize = lodList->Size();
|
||||
sprintf(lodName, "%s%d", p_key, i);
|
||||
dupLodList = lodManager->Create(lodName, lodSize);
|
||||
|
||||
for (j = 0; j < lodSize; j++) {
|
||||
dupLodList->PushBack(((LegoLOD*) (*lodList)[j])->Clone(renderer));
|
||||
}
|
||||
|
||||
lodList->Release();
|
||||
lodList = dupLodList;
|
||||
|
||||
childROI = new LegoROI(renderer, lodList);
|
||||
lodList->Release();
|
||||
|
||||
childROI->SetName(g_characterLODs[i + 1].m_name);
|
||||
childROI->SetParentROI(roi);
|
||||
|
||||
BoundingSphere childBoundingSphere;
|
||||
childBoundingSphere.Center()[0] = g_characterLODs[i + 1].m_boundingSphere[0];
|
||||
childBoundingSphere.Center()[1] = g_characterLODs[i + 1].m_boundingSphere[1];
|
||||
childBoundingSphere.Center()[2] = g_characterLODs[i + 1].m_boundingSphere[2];
|
||||
childBoundingSphere.Radius() = g_characterLODs[i + 1].m_boundingSphere[3];
|
||||
childROI->SetBoundingSphere(childBoundingSphere);
|
||||
|
||||
BoundingBox childBoundingBox;
|
||||
childBoundingBox.Min()[0] = g_characterLODs[i + 1].m_boundingBox[0];
|
||||
childBoundingBox.Min()[1] = g_characterLODs[i + 1].m_boundingBox[1];
|
||||
childBoundingBox.Min()[2] = g_characterLODs[i + 1].m_boundingBox[2];
|
||||
childBoundingBox.Max()[0] = g_characterLODs[i + 1].m_boundingBox[3];
|
||||
childBoundingBox.Max()[1] = g_characterLODs[i + 1].m_boundingBox[4];
|
||||
childBoundingBox.Max()[2] = g_characterLODs[i + 1].m_boundingBox[5];
|
||||
childROI->SetUnknown0x80(childBoundingBox);
|
||||
|
||||
CalcLocalTransform(
|
||||
Mx3DPointFloat(g_characterLODs[i + 1].m_position),
|
||||
Mx3DPointFloat(g_characterLODs[i + 1].m_direction),
|
||||
Mx3DPointFloat(g_characterLODs[i + 1].m_up),
|
||||
mat
|
||||
);
|
||||
childROI->WrappedSetLocalTransform(mat);
|
||||
|
||||
if (g_characterLODs[i + 1].m_flags & LegoCharacterLOD::c_flag1 &&
|
||||
(i != 0 || part.m_unk0x00[part.m_unk0x08] != 0)) {
|
||||
|
||||
LegoTextureInfo* textureInfo = textureContainer->Get(part.m_unk0x10[part.m_unk0x0c[part.m_unk0x14]]);
|
||||
|
||||
if (textureInfo != NULL) {
|
||||
childROI->FUN_100a9210(textureInfo);
|
||||
childROI->FUN_100a9170(1.0F, 1.0F, 1.0F, 0.0F);
|
||||
}
|
||||
}
|
||||
else if (g_characterLODs[i + 1].m_flags & LegoCharacterLOD::c_flag2 || (i == 0 && part.m_unk0x00[part.m_unk0x08] == 0)) {
|
||||
LegoFloat red, green, blue, alpha;
|
||||
childROI->FUN_100a9bf0(part.m_unk0x10[part.m_unk0x0c[part.m_unk0x14]], red, green, blue, alpha);
|
||||
childROI->FUN_100a9170(red, green, blue, alpha);
|
||||
}
|
||||
|
||||
comp->push_back(childROI);
|
||||
}
|
||||
|
||||
CalcLocalTransform(
|
||||
Mx3DPointFloat(g_characterLODs[0].m_position),
|
||||
Mx3DPointFloat(g_characterLODs[0].m_direction),
|
||||
Mx3DPointFloat(g_characterLODs[0].m_up),
|
||||
mat
|
||||
);
|
||||
roi->WrappedSetLocalTransform(mat);
|
||||
|
||||
characterData->m_roi = roi;
|
||||
success = TRUE;
|
||||
|
||||
done:
|
||||
if (!success && roi != NULL) {
|
||||
delete roi;
|
||||
roi = NULL;
|
||||
}
|
||||
|
||||
return roi;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10084c00
|
||||
@@ -173,9 +352,21 @@ MxBool LegoCharacterManager::FUN_10084c00(const LegoChar*)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
// STUB: LEGO1 0x10084c60
|
||||
LegoSaveDataEntry3* LegoCharacterManager::FUN_10084c60(const char* p_key)
|
||||
// FUNCTION: LEGO1 0x10084c60
|
||||
LegoCharacterData* LegoCharacterManager::Find(const char* p_key)
|
||||
{
|
||||
MxU32 i;
|
||||
|
||||
for (i = 0; i < _countof(g_characterData) - 1; i++) {
|
||||
if (!strcmpi(g_characterData[i].m_name, p_key)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i < _countof(g_characterData)) {
|
||||
return &g_characterData[i];
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
1232
LEGO1/lego/legoomni/src/common/legocharacters.cpp
Normal file
1232
LEGO1/lego/legoomni/src/common/legocharacters.cpp
Normal file
File diff suppressed because it is too large
Load Diff
@@ -235,7 +235,7 @@ MxResult LegoGameState::Save(MxULong p_slot)
|
||||
}
|
||||
|
||||
WriteEndOfVariables(&fileStorage);
|
||||
CharacterManager()->WriteSaveData3(&fileStorage);
|
||||
CharacterManager()->Write(&fileStorage);
|
||||
PlantManager()->Save(&fileStorage);
|
||||
result = BuildingManager()->Save(&fileStorage);
|
||||
|
||||
@@ -334,7 +334,7 @@ MxResult LegoGameState::Load(MxULong p_slot)
|
||||
SetLightPosition(atoi(lightPosition));
|
||||
}
|
||||
|
||||
if (CharacterManager()->ReadSaveData3(&fileStorage) == FAILURE) {
|
||||
if (CharacterManager()->Read(&fileStorage) == FAILURE) {
|
||||
goto done;
|
||||
}
|
||||
if (PlantManager()->Load(&fileStorage) == FAILURE) {
|
||||
@@ -1057,7 +1057,7 @@ void LegoGameState::Init()
|
||||
SetLightPosition(2);
|
||||
PlantManager()->Init();
|
||||
BuildingManager()->Init();
|
||||
CharacterManager()->InitSaveData();
|
||||
CharacterManager()->Init();
|
||||
AnimationManager()->FUN_1005ee80(TRUE);
|
||||
SetColors();
|
||||
RemoveActor();
|
||||
|
@@ -128,7 +128,7 @@ Mx3DPointFloat LegoCameraController::GetWorldUp()
|
||||
{
|
||||
if (m_lego3DView && m_lego3DView->GetPointOfView()) {
|
||||
Mx3DPointFloat vec;
|
||||
vec = Vector3(m_lego3DView->GetPointOfView()->GetWorldUp());
|
||||
vec = m_lego3DView->GetPointOfView()->GetWorldUp();
|
||||
return Mx3DPointFloat(vec[0], vec[1], vec[2]);
|
||||
}
|
||||
else {
|
||||
@@ -141,7 +141,7 @@ Mx3DPointFloat LegoCameraController::GetWorldLocation()
|
||||
{
|
||||
if (m_lego3DView && m_lego3DView->GetPointOfView()) {
|
||||
Mx3DPointFloat vec;
|
||||
vec = Vector3(m_lego3DView->GetPointOfView()->GetWorldPosition());
|
||||
vec = m_lego3DView->GetPointOfView()->GetWorldPosition();
|
||||
return Mx3DPointFloat(vec[0], vec[1] - m_entityOffsetUp, vec[2]);
|
||||
}
|
||||
else {
|
||||
@@ -154,7 +154,7 @@ Mx3DPointFloat LegoCameraController::GetWorldDirection()
|
||||
{
|
||||
if (m_lego3DView && m_lego3DView->GetPointOfView()) {
|
||||
Mx3DPointFloat vec;
|
||||
vec = Vector3(m_lego3DView->GetPointOfView()->GetWorldDirection());
|
||||
vec = m_lego3DView->GetPointOfView()->GetWorldDirection();
|
||||
return Mx3DPointFloat(vec[0], vec[1], vec[2]);
|
||||
}
|
||||
else {
|
||||
|
Reference in New Issue
Block a user