mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-22 16:04:17 +00:00
Name/rename functions in LegoCharacterManager (#982)
* Name/rename functions in LegoCharacterManager * Name flag
This commit is contained in:

committed by
GitHub

parent
375ac29b9b
commit
23e5ad7d15
@@ -321,11 +321,11 @@ add_library(lego1 SHARED
|
|||||||
LEGO1/lego/legoomni/src/build/legovehiclebuildstate.cpp
|
LEGO1/lego/legoomni/src/build/legovehiclebuildstate.cpp
|
||||||
LEGO1/lego/legoomni/src/common/animstate.cpp
|
LEGO1/lego/legoomni/src/common/animstate.cpp
|
||||||
LEGO1/lego/legoomni/src/common/legoactioncontrolpresenter.cpp
|
LEGO1/lego/legoomni/src/common/legoactioncontrolpresenter.cpp
|
||||||
|
LEGO1/lego/legoomni/src/common/legoactors.cpp
|
||||||
LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp
|
LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp
|
||||||
LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp
|
LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp
|
||||||
LEGO1/lego/legoomni/src/common/legobackgroundcolor.cpp
|
LEGO1/lego/legoomni/src/common/legobackgroundcolor.cpp
|
||||||
LEGO1/lego/legoomni/src/common/legocharactermanager.cpp
|
LEGO1/lego/legoomni/src/common/legocharactermanager.cpp
|
||||||
LEGO1/lego/legoomni/src/common/legocharacters.cpp
|
|
||||||
LEGO1/lego/legoomni/src/common/legofullscreenmovie.cpp
|
LEGO1/lego/legoomni/src/common/legofullscreenmovie.cpp
|
||||||
LEGO1/lego/legoomni/src/common/legogamestate.cpp
|
LEGO1/lego/legoomni/src/common/legogamestate.cpp
|
||||||
LEGO1/lego/legoomni/src/common/legoobjectfactory.cpp
|
LEGO1/lego/legoomni/src/common/legoobjectfactory.cpp
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
#ifndef LEGOCHARACTERS_H
|
#ifndef LEGOACTORS_H
|
||||||
#define LEGOCHARACTERS_H
|
#define LEGOACTORS_H
|
||||||
|
|
||||||
#include "decomp.h"
|
#include "decomp.h"
|
||||||
#include "mxtypes.h"
|
#include "mxtypes.h"
|
||||||
@@ -8,7 +8,7 @@ class LegoExtraActor;
|
|||||||
class LegoROI;
|
class LegoROI;
|
||||||
|
|
||||||
// SIZE 0x108
|
// SIZE 0x108
|
||||||
struct LegoCharacterInfo {
|
struct LegoActorInfo {
|
||||||
// SIZE 0x18
|
// SIZE 0x18
|
||||||
struct Part {
|
struct Part {
|
||||||
MxU8* m_unk0x00; // 0x00
|
MxU8* m_unk0x00; // 0x00
|
||||||
@@ -29,7 +29,7 @@ struct LegoCharacterInfo {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// SIZE 0x58
|
// SIZE 0x58
|
||||||
struct LegoCharacterLOD {
|
struct LegoActorLOD {
|
||||||
enum {
|
enum {
|
||||||
c_flag1 = 0x01,
|
c_flag1 = 0x01,
|
||||||
c_flag2 = 0x02
|
c_flag2 = 0x02
|
||||||
@@ -45,7 +45,7 @@ struct LegoCharacterLOD {
|
|||||||
float m_up[3]; // 0x4c
|
float m_up[3]; // 0x4c
|
||||||
};
|
};
|
||||||
|
|
||||||
enum LegoCharacterLODs {
|
enum LegoActorLODs {
|
||||||
c_topLOD,
|
c_topLOD,
|
||||||
c_bodyLOD,
|
c_bodyLOD,
|
||||||
c_infohatLOD,
|
c_infohatLOD,
|
||||||
@@ -59,7 +59,7 @@ enum LegoCharacterLODs {
|
|||||||
c_legrtLOD
|
c_legrtLOD
|
||||||
};
|
};
|
||||||
|
|
||||||
enum LegoCharacterParts {
|
enum LegoActorParts {
|
||||||
c_bodyPart,
|
c_bodyPart,
|
||||||
c_infohatPart,
|
c_infohatPart,
|
||||||
c_infogronPart,
|
c_infogronPart,
|
||||||
@@ -72,7 +72,7 @@ enum LegoCharacterParts {
|
|||||||
c_legrtPart
|
c_legrtPart
|
||||||
};
|
};
|
||||||
|
|
||||||
extern LegoCharacterInfo g_characterInfoInit[66];
|
extern LegoActorInfo g_actorInfoInit[66];
|
||||||
extern LegoCharacterLOD g_characterLODs[11];
|
extern LegoActorLOD g_actorLODs[11];
|
||||||
|
|
||||||
#endif // LEGOCHARACTERS_H
|
#endif // LEGOACTORS_H
|
@@ -41,7 +41,7 @@ struct LegoCharacter {
|
|||||||
MxU32 m_refCount; // 0x04
|
MxU32 m_refCount; // 0x04
|
||||||
};
|
};
|
||||||
|
|
||||||
struct LegoCharacterInfo;
|
struct LegoActorInfo;
|
||||||
|
|
||||||
typedef map<char*, LegoCharacter*, LegoCharacterComparator> LegoCharacterMap;
|
typedef map<char*, LegoCharacter*, LegoCharacterComparator> LegoCharacterMap;
|
||||||
|
|
||||||
@@ -53,32 +53,32 @@ public:
|
|||||||
|
|
||||||
MxResult Write(LegoStorage* p_storage);
|
MxResult Write(LegoStorage* p_storage);
|
||||||
MxResult Read(LegoStorage* p_storage);
|
MxResult Read(LegoStorage* p_storage);
|
||||||
LegoROI* GetROI(const char* p_key, MxBool p_createEntity);
|
LegoROI* GetActorROI(const char* p_name, MxBool p_createEntity);
|
||||||
|
|
||||||
void Init();
|
void Init();
|
||||||
static void SetCustomizeAnimFile(const char* p_value);
|
static void SetCustomizeAnimFile(const char* p_value);
|
||||||
static MxBool Exists(const char* p_key);
|
static MxBool IsActor(const char* p_name);
|
||||||
|
|
||||||
void FUN_100832a0();
|
void ReleaseAllActors();
|
||||||
MxBool FUN_10083b20(const char* p_key);
|
MxBool Exists(const char* p_name);
|
||||||
MxU32 GetRefCount(LegoROI* p_roi);
|
MxU32 GetRefCount(LegoROI* p_roi);
|
||||||
void FUN_10083c30(const char* p_name);
|
void ReleaseActor(const char* p_name);
|
||||||
void FUN_10083db0(LegoROI* p_roi);
|
void ReleaseActor(LegoROI* p_roi);
|
||||||
void FUN_10083f10(LegoROI* p_roi);
|
void ReleaseAutoROI(LegoROI* p_roi);
|
||||||
MxBool FUN_100849a0(LegoROI* p_roi, LegoTextureInfo* p_textureInfo);
|
MxBool FUN_100849a0(LegoROI* p_roi, LegoTextureInfo* p_textureInfo);
|
||||||
LegoExtraActor* GetActor(const char* p_key);
|
LegoExtraActor* GetExtraActor(const char* p_name);
|
||||||
LegoCharacterInfo* GetInfo(const char* p_key);
|
LegoActorInfo* GetActorInfo(const char* p_name);
|
||||||
LegoCharacterInfo* GetInfo(LegoROI* p_roi);
|
LegoActorInfo* GetActorInfo(LegoROI* p_roi);
|
||||||
MxBool SwitchHat(LegoROI* p_roi);
|
MxBool SwitchHat(LegoROI* p_roi);
|
||||||
MxU32 FUN_10085140(LegoROI* p_roi, MxBool p_und);
|
MxU32 FUN_10085140(LegoROI* p_roi, MxBool p_und);
|
||||||
MxU8 GetMood(LegoROI* p_roi);
|
MxU8 GetMood(LegoROI* p_roi);
|
||||||
LegoROI* FUN_10085210(const char* p_name, const char* p_lodName, MxBool p_createEntity);
|
LegoROI* CreateAutoROI(const char* p_name, const char* p_lodName, MxBool p_createEntity);
|
||||||
LegoROI* FUN_10085a80(const char* p_name, const char* p_lodName, MxBool p_createEntity);
|
LegoROI* FUN_10085a80(const char* p_name, const char* p_lodName, MxBool p_createEntity);
|
||||||
|
|
||||||
static const char* GetCustomizeAnimFile() { return g_customizeAnimFile; }
|
static const char* GetCustomizeAnimFile() { return g_customizeAnimFile; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
LegoROI* CreateROI(const char* p_key);
|
LegoROI* CreateActorROI(const char* p_key);
|
||||||
void RemoveROI(LegoROI* p_roi);
|
void RemoveROI(LegoROI* p_roi);
|
||||||
LegoROI* FindChildROI(LegoROI* p_roi, const char* p_name);
|
LegoROI* FindChildROI(LegoROI* p_roi, const char* p_name);
|
||||||
MxResult FUN_10085870(LegoROI* p_roi);
|
MxResult FUN_10085870(LegoROI* p_roi);
|
||||||
|
@@ -14,16 +14,16 @@ class Vector3;
|
|||||||
class LegoEntity : public MxEntity {
|
class LegoEntity : public MxEntity {
|
||||||
public:
|
public:
|
||||||
enum Type {
|
enum Type {
|
||||||
e_character = 0,
|
e_actor = 0,
|
||||||
e_unk1,
|
e_unk1,
|
||||||
e_plant,
|
e_plant,
|
||||||
e_building,
|
e_building,
|
||||||
e_unk4
|
e_autoROI
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
c_bit1 = 0x01,
|
c_bit1 = 0x01,
|
||||||
c_bit2 = 0x02
|
c_managerOwned = 0x02
|
||||||
};
|
};
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
|
@@ -53,8 +53,8 @@ MxResult Lego3DSound::Create(LPDIRECTSOUNDBUFFER p_directSoundBuffer, const char
|
|||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (CharacterManager()->Exists(p_name)) {
|
if (CharacterManager()->IsActor(p_name)) {
|
||||||
m_roi = CharacterManager()->GetROI(p_name, TRUE);
|
m_roi = CharacterManager()->GetActorROI(p_name, TRUE);
|
||||||
m_enabled = m_isActor = TRUE;
|
m_enabled = m_isActor = TRUE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -62,7 +62,7 @@ MxResult Lego3DSound::Create(LPDIRECTSOUNDBUFFER p_directSoundBuffer, const char
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (m_roi == NULL) {
|
if (m_roi == NULL) {
|
||||||
m_roi = CharacterManager()->FUN_10085210(NULL, p_name, TRUE);
|
m_roi = CharacterManager()->CreateAutoROI(NULL, p_name, TRUE);
|
||||||
|
|
||||||
if (m_roi != NULL) {
|
if (m_roi != NULL) {
|
||||||
m_enabled = TRUE;
|
m_enabled = TRUE;
|
||||||
@@ -113,10 +113,10 @@ void Lego3DSound::Destroy()
|
|||||||
|
|
||||||
if (m_enabled && m_roi && CharacterManager()) {
|
if (m_enabled && m_roi && CharacterManager()) {
|
||||||
if (m_isActor) {
|
if (m_isActor) {
|
||||||
CharacterManager()->FUN_10083db0(m_roi);
|
CharacterManager()->ReleaseActor(m_roi);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CharacterManager()->FUN_10083f10(m_roi);
|
CharacterManager()->ReleaseAutoROI(m_roi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,16 +1,16 @@
|
|||||||
#include "legocharacters.h"
|
#include "legoactors.h"
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(LegoCharacterInfo, 0x108)
|
DECOMP_SIZE_ASSERT(LegoActorInfo, 0x108)
|
||||||
DECOMP_SIZE_ASSERT(LegoCharacterInfo::Part, 0x18)
|
DECOMP_SIZE_ASSERT(LegoActorInfo::Part, 0x18)
|
||||||
DECOMP_SIZE_ASSERT(LegoCharacterLOD, 0x58)
|
DECOMP_SIZE_ASSERT(LegoActorLOD, 0x58)
|
||||||
|
|
||||||
// Unclear whether g_characterLODs[0] (top) is its own global, see: LegoCharacterManager::CreateROI
|
// Unclear whether g_actorLODs[0] (top) is its own global, see: LegoCharacterManager::CreateActorROI
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100da3b0
|
// GLOBAL: LEGO1 0x100da3b0
|
||||||
LegoCharacterLOD g_characterLODs[] = {
|
LegoActorLOD g_actorLODs[] = {
|
||||||
{"top", "top", 0, 0.000267, 0.780808, -0.01906, 0.951612, -0.461166, -0.002794, -0.299442, 0.4617,
|
{"top", "top", 0, 0.000267, 0.780808, -0.01906, 0.951612, -0.461166, -0.002794, -0.299442, 0.4617,
|
||||||
1.56441, 0.261321, 0, 0, 0, 0, 0, 1, 0, 1, 0},
|
1.56441, 0.261321, 0, 0, 0, 0, 0, 1, 0, 1, 0},
|
||||||
{"body", "body", LegoCharacterLOD::c_flag1,
|
{"body", "body", LegoActorLOD::c_flag1,
|
||||||
0.00158332, 0.401828, -0.00048697,
|
0.00158332, 0.401828, -0.00048697,
|
||||||
0.408071, -0.287507, 0.150419,
|
0.408071, -0.287507, 0.150419,
|
||||||
-0.147452, 0.289219, 0.649774,
|
-0.147452, 0.289219, 0.649774,
|
||||||
@@ -18,7 +18,7 @@ LegoCharacterLOD g_characterLODs[] = {
|
|||||||
0.007277, 0, 0,
|
0.007277, 0, 0,
|
||||||
1, 0, 1,
|
1, 0, 1,
|
||||||
0},
|
0},
|
||||||
{"infohat", "infohat", LegoCharacterLOD::c_flag2,
|
{"infohat", "infohat", LegoActorLOD::c_flag2,
|
||||||
0, -0.00938, -0.01955,
|
0, -0.00938, -0.01955,
|
||||||
0.35, -0.231822, -0.140237,
|
0.35, -0.231822, -0.140237,
|
||||||
-0.320954, 0.234149, 0.076968,
|
-0.320954, 0.234149, 0.076968,
|
||||||
@@ -26,7 +26,7 @@ LegoCharacterLOD g_characterLODs[] = {
|
|||||||
0.001767, 0, 0,
|
0.001767, 0, 0,
|
||||||
1, 0, 1,
|
1, 0, 1,
|
||||||
0},
|
0},
|
||||||
{"infogron", "infogron", LegoCharacterLOD::c_flag2,
|
{"infogron", "infogron", LegoActorLOD::c_flag2,
|
||||||
0, 0.11477, 0.00042,
|
0, 0.11477, 0.00042,
|
||||||
0.26, -0.285558, -0.134391,
|
0.26, -0.285558, -0.134391,
|
||||||
-0.142231, 0.285507, 0.152986,
|
-0.142231, 0.285507, 0.152986,
|
||||||
@@ -34,7 +34,7 @@ LegoCharacterLOD g_characterLODs[] = {
|
|||||||
0.007277, 0, 0,
|
0.007277, 0, 0,
|
||||||
1, 0, 1,
|
1, 0, 1,
|
||||||
0},
|
0},
|
||||||
{"head", "head", LegoCharacterLOD::c_flag1,
|
{"head", "head", LegoActorLOD::c_flag1,
|
||||||
0, -0.03006, 0,
|
0, -0.03006, 0,
|
||||||
0.3, -0.189506, -0.209665,
|
0.3, -0.189506, -0.209665,
|
||||||
-0.189824, 0.189532, 0.228822,
|
-0.189824, 0.189532, 0.228822,
|
||||||
@@ -42,7 +42,7 @@ LegoCharacterLOD g_characterLODs[] = {
|
|||||||
0.001781, 0, 0,
|
0.001781, 0, 0,
|
||||||
1, 0, 1,
|
1, 0, 1,
|
||||||
0},
|
0},
|
||||||
{"arm-lft", "arm-lft", LegoCharacterLOD::c_flag2,
|
{"arm-lft", "arm-lft", LegoActorLOD::c_flag2,
|
||||||
-0.06815, -0.0973747, 0.0154655,
|
-0.06815, -0.0973747, 0.0154655,
|
||||||
0.237, -0.137931, -0.282775,
|
0.237, -0.137931, -0.282775,
|
||||||
-0.105316, 0.000989, 0.100221,
|
-0.105316, 0.000989, 0.100221,
|
||||||
@@ -50,7 +50,7 @@ LegoCharacterLOD g_characterLODs[] = {
|
|||||||
0.023286, -0.003031, -0.017187,
|
0.023286, -0.003031, -0.017187,
|
||||||
0.999848, 0.173622, 0.984658,
|
0.999848, 0.173622, 0.984658,
|
||||||
0.017453},
|
0.017453},
|
||||||
{"arm-rt", "arm-rt", LegoCharacterLOD::c_flag2,
|
{"arm-rt", "arm-rt", LegoActorLOD::c_flag2,
|
||||||
0.0680946, -0.097152, 0.0152722,
|
0.0680946, -0.097152, 0.0152722,
|
||||||
0.237, 0.00141, -0.289604,
|
0.237, 0.00141, -0.289604,
|
||||||
-0.100831, 0.138786, 0.09291,
|
-0.100831, 0.138786, 0.09291,
|
||||||
@@ -58,7 +58,7 @@ LegoCharacterLOD g_characterLODs[] = {
|
|||||||
0.018302, 0, 0,
|
0.018302, 0, 0,
|
||||||
1, -0.173648, 0.984808,
|
1, -0.173648, 0.984808,
|
||||||
0},
|
0},
|
||||||
{"claw-lft", "claw-lft", LegoCharacterLOD::c_flag2,
|
{"claw-lft", "claw-lft", LegoActorLOD::c_flag2,
|
||||||
0.000773381, -0.101422, -0.0237761,
|
0.000773381, -0.101422, -0.0237761,
|
||||||
0.15, -0.089838, -0.246208,
|
0.15, -0.089838, -0.246208,
|
||||||
-0.117735, 0.091275, 0.000263,
|
-0.117735, 0.091275, 0.000263,
|
||||||
@@ -66,7 +66,7 @@ LegoCharacterLOD g_characterLODs[] = {
|
|||||||
0.092779, 0.000001, 0.000003,
|
0.092779, 0.000001, 0.000003,
|
||||||
1, 0.190812, 0.981627,
|
1, 0.190812, 0.981627,
|
||||||
-0.000003},
|
-0.000003},
|
||||||
{"claw-rt", "claw-lft", LegoCharacterLOD::c_flag2,
|
{"claw-rt", "claw-lft", LegoActorLOD::c_flag2,
|
||||||
0.000773381, -0.101422, -0.0237761,
|
0.000773381, -0.101422, -0.0237761,
|
||||||
0.15, -0.095016, -0.245349,
|
0.15, -0.095016, -0.245349,
|
||||||
-0.117979, 0.086528, 0.00067,
|
-0.117979, 0.086528, 0.00067,
|
||||||
@@ -74,7 +74,7 @@ LegoCharacterLOD g_characterLODs[] = {
|
|||||||
0.096123, 0.00606, -0.034369,
|
0.096123, 0.00606, -0.034369,
|
||||||
0.999391, -0.190704, 0.981027,
|
0.999391, -0.190704, 0.981027,
|
||||||
0.034894},
|
0.034894},
|
||||||
{"leg-lft", "leg", LegoCharacterLOD::c_flag2,
|
{"leg-lft", "leg", LegoActorLOD::c_flag2,
|
||||||
0.00433584, -0.177404, -0.0313928,
|
0.00433584, -0.177404, -0.0313928,
|
||||||
0.33, -0.129782, -0.440428,
|
0.33, -0.129782, -0.440428,
|
||||||
-0.184207, 0.13817, 0.118415,
|
-0.184207, 0.13817, 0.118415,
|
||||||
@@ -82,7 +82,7 @@ LegoCharacterLOD g_characterLODs[] = {
|
|||||||
0.006822, 0, 0,
|
0.006822, 0, 0,
|
||||||
1, 0, 1,
|
1, 0, 1,
|
||||||
0},
|
0},
|
||||||
{"leg-rt", "leg", LegoCharacterLOD::c_flag2,
|
{"leg-rt", "leg", LegoActorLOD::c_flag2,
|
||||||
0.00433584, -0.177404, -0.0313928,
|
0.00433584, -0.177404, -0.0313928,
|
||||||
0.33, -0.132864, -0.437138,
|
0.33, -0.132864, -0.437138,
|
||||||
-0.183944, 0.134614, 0.12043,
|
-0.183944, 0.134614, 0.12043,
|
||||||
@@ -172,7 +172,7 @@ const char* g_unk0x100f80a0[] =
|
|||||||
{"lego white", "lego black", "lego yellow", "lego red", "lego blue", "lego brown", "lego lt grey", "lego green"};
|
{"lego white", "lego black", "lego yellow", "lego red", "lego blue", "lego brown", "lego lt grey", "lego green"};
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x100f80c0
|
// GLOBAL: LEGO1 0x100f80c0
|
||||||
LegoCharacterInfo g_characterInfoInit[] = {
|
LegoActorInfo g_actorInfoInit[] = {
|
||||||
{"pepper",
|
{"pepper",
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
@@ -344,14 +344,14 @@ LegoAnimationManager::~LegoAnimationManager()
|
|||||||
LegoROI* roi = m_extras[i].m_roi;
|
LegoROI* roi = m_extras[i].m_roi;
|
||||||
|
|
||||||
if (roi != NULL) {
|
if (roi != NULL) {
|
||||||
LegoPathActor* actor = CharacterManager()->GetActor(roi->GetName());
|
LegoPathActor* actor = CharacterManager()->GetExtraActor(roi->GetName());
|
||||||
|
|
||||||
if (actor != NULL && actor->GetController() != NULL && CurrentWorld() != NULL) {
|
if (actor != NULL && actor->GetController() != NULL && CurrentWorld() != NULL) {
|
||||||
CurrentWorld()->RemoveActor(actor);
|
CurrentWorld()->RemoveActor(actor);
|
||||||
actor->SetController(NULL);
|
actor->SetController(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
CharacterManager()->FUN_10083db0(roi);
|
CharacterManager()->ReleaseActor(roi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -430,14 +430,14 @@ void LegoAnimationManager::Suspend()
|
|||||||
LegoROI* roi = m_extras[i].m_roi;
|
LegoROI* roi = m_extras[i].m_roi;
|
||||||
|
|
||||||
if (roi != NULL) {
|
if (roi != NULL) {
|
||||||
LegoPathActor* actor = CharacterManager()->GetActor(roi->GetName());
|
LegoPathActor* actor = CharacterManager()->GetExtraActor(roi->GetName());
|
||||||
|
|
||||||
if (actor != NULL && actor->GetController() != NULL) {
|
if (actor != NULL && actor->GetController() != NULL) {
|
||||||
actor->GetController()->RemoveActor(actor);
|
actor->GetController()->RemoveActor(actor);
|
||||||
actor->SetController(NULL);
|
actor->SetController(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
CharacterManager()->FUN_10083db0(roi);
|
CharacterManager()->ReleaseActor(roi);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_extras[i].m_unk0x14) {
|
if (m_extras[i].m_unk0x14) {
|
||||||
@@ -1069,8 +1069,8 @@ MxResult LegoAnimationManager::StartEntityAction(MxDSAction& p_dsAction, LegoEnt
|
|||||||
MxResult result = FAILURE;
|
MxResult result = FAILURE;
|
||||||
LegoROI* roi = p_entity->GetROI();
|
LegoROI* roi = p_entity->GetROI();
|
||||||
|
|
||||||
if (p_entity->GetType() == LegoEntity::e_character) {
|
if (p_entity->GetType() == LegoEntity::e_actor) {
|
||||||
LegoPathActor* actor = CharacterManager()->GetActor(roi->GetName());
|
LegoPathActor* actor = CharacterManager()->GetExtraActor(roi->GetName());
|
||||||
|
|
||||||
if (actor) {
|
if (actor) {
|
||||||
LegoPathController* controller = actor->GetController();
|
LegoPathController* controller = actor->GetController();
|
||||||
@@ -1395,7 +1395,7 @@ MxLong LegoAnimationManager::Notify(MxParam& p_param)
|
|||||||
LegoROI* roi = m_extras[i].m_roi;
|
LegoROI* roi = m_extras[i].m_roi;
|
||||||
|
|
||||||
if (roi != NULL) {
|
if (roi != NULL) {
|
||||||
LegoExtraActor* actor = CharacterManager()->GetActor(roi->GetName());
|
LegoExtraActor* actor = CharacterManager()->GetExtraActor(roi->GetName());
|
||||||
if (actor != NULL) {
|
if (actor != NULL) {
|
||||||
actor->Restart();
|
actor->Restart();
|
||||||
}
|
}
|
||||||
@@ -1444,14 +1444,14 @@ MxResult LegoAnimationManager::Tickle()
|
|||||||
LegoROI* roi = m_extras[i].m_roi;
|
LegoROI* roi = m_extras[i].m_roi;
|
||||||
|
|
||||||
if (roi != NULL && m_extras[i].m_unk0x0d) {
|
if (roi != NULL && m_extras[i].m_unk0x0d) {
|
||||||
LegoPathActor* actor = CharacterManager()->GetActor(roi->GetName());
|
LegoPathActor* actor = CharacterManager()->GetExtraActor(roi->GetName());
|
||||||
|
|
||||||
if (actor != NULL && actor->GetController() != NULL) {
|
if (actor != NULL && actor->GetController() != NULL) {
|
||||||
actor->GetController()->RemoveActor(actor);
|
actor->GetController()->RemoveActor(actor);
|
||||||
actor->SetController(NULL);
|
actor->SetController(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
CharacterManager()->FUN_10083db0(roi);
|
CharacterManager()->ReleaseActor(roi);
|
||||||
|
|
||||||
if (m_extras[i].m_unk0x14) {
|
if (m_extras[i].m_unk0x14) {
|
||||||
m_extras[i].m_unk0x14 = FALSE;
|
m_extras[i].m_unk0x14 = FALSE;
|
||||||
@@ -1701,7 +1701,7 @@ void LegoAnimationManager::FUN_10062580(AnimInfo& p_info)
|
|||||||
|
|
||||||
if (models != NULL && modelCount) {
|
if (models != NULL && modelCount) {
|
||||||
for (MxU8 i = 0; i < modelCount; i++) {
|
for (MxU8 i = 0; i < modelCount; i++) {
|
||||||
LegoPathActor* actor = CharacterManager()->GetActor(models[i].m_name);
|
LegoPathActor* actor = CharacterManager()->GetExtraActor(models[i].m_name);
|
||||||
|
|
||||||
if (actor) {
|
if (actor) {
|
||||||
LegoPathController* controller = actor->GetController();
|
LegoPathController* controller = actor->GetController();
|
||||||
@@ -1814,13 +1814,13 @@ void LegoAnimationManager::PurgeExtra(MxBool p_und)
|
|||||||
!viewManager->FUN_100a6150(roi->GetWorldBoundingBox()))) {
|
!viewManager->FUN_100a6150(roi->GetWorldBoundingBox()))) {
|
||||||
m_unk0x414--;
|
m_unk0x414--;
|
||||||
|
|
||||||
LegoPathActor* actor = CharacterManager()->GetActor(roi->GetName());
|
LegoPathActor* actor = CharacterManager()->GetExtraActor(roi->GetName());
|
||||||
if (actor != NULL && actor->GetController() != NULL) {
|
if (actor != NULL && actor->GetController() != NULL) {
|
||||||
actor->GetController()->RemoveActor(actor);
|
actor->GetController()->RemoveActor(actor);
|
||||||
actor->SetController(NULL);
|
actor->SetController(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
CharacterManager()->FUN_10083db0(roi);
|
CharacterManager()->ReleaseActor(roi);
|
||||||
|
|
||||||
if (m_extras[i].m_unk0x14) {
|
if (m_extras[i].m_unk0x14) {
|
||||||
m_extras[i].m_unk0x14 = FALSE;
|
m_extras[i].m_unk0x14 = FALSE;
|
||||||
@@ -1930,15 +1930,15 @@ void LegoAnimationManager::AddExtra(MxS32 p_location, MxBool p_und)
|
|||||||
g_characters[m_lastExtraCharacterId].m_unk0x08 &&
|
g_characters[m_lastExtraCharacterId].m_unk0x08 &&
|
||||||
!g_characters[m_lastExtraCharacterId].m_inExtras &&
|
!g_characters[m_lastExtraCharacterId].m_inExtras &&
|
||||||
g_characters[m_lastExtraCharacterId].m_active == active) {
|
g_characters[m_lastExtraCharacterId].m_active == active) {
|
||||||
if (!CharacterManager()->FUN_10083b20(g_characters[m_lastExtraCharacterId].m_name
|
if (!CharacterManager()->Exists(g_characters[m_lastExtraCharacterId].m_name)) {
|
||||||
)) {
|
m_extras[i].m_roi = CharacterManager()->GetActorROI(
|
||||||
m_extras[i].m_roi = CharacterManager()->GetROI(
|
|
||||||
g_characters[m_lastExtraCharacterId].m_name,
|
g_characters[m_lastExtraCharacterId].m_name,
|
||||||
TRUE
|
TRUE
|
||||||
);
|
);
|
||||||
|
|
||||||
LegoExtraActor* actor =
|
LegoExtraActor* actor = CharacterManager()->GetExtraActor(
|
||||||
CharacterManager()->GetActor(g_characters[m_lastExtraCharacterId].m_name);
|
g_characters[m_lastExtraCharacterId].m_name
|
||||||
|
);
|
||||||
|
|
||||||
switch (g_unk0x100f7504++ % 4) {
|
switch (g_unk0x100f7504++ % 4) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -2002,7 +2002,7 @@ void LegoAnimationManager::AddExtra(MxS32 p_location, MxBool p_und)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
CharacterManager()->FUN_10083db0(m_extras[i].m_roi);
|
CharacterManager()->ReleaseActor(m_extras[i].m_roi);
|
||||||
m_extras[i].m_roi = NULL;
|
m_extras[i].m_roi = NULL;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -2042,7 +2042,7 @@ MxBool LegoAnimationManager::FUN_10062e20(LegoROI* p_roi, LegoAnimPresenter* p_p
|
|||||||
MxBool inExtras = FALSE;
|
MxBool inExtras = FALSE;
|
||||||
const char* name = p_roi->GetName();
|
const char* name = p_roi->GetName();
|
||||||
|
|
||||||
LegoExtraActor* actor = CharacterManager()->GetActor(name);
|
LegoExtraActor* actor = CharacterManager()->GetExtraActor(name);
|
||||||
if (actor != NULL) {
|
if (actor != NULL) {
|
||||||
MxS32 characterId = -1;
|
MxS32 characterId = -1;
|
||||||
MxS32 i;
|
MxS32 i;
|
||||||
@@ -2104,7 +2104,7 @@ MxBool LegoAnimationManager::FUN_10062e20(LegoROI* p_roi, LegoAnimPresenter* p_p
|
|||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
CharacterManager()->FUN_10083db0(p_roi);
|
CharacterManager()->ReleaseActor(p_roi);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (inExtras) {
|
if (inExtras) {
|
||||||
@@ -2216,7 +2216,7 @@ void LegoAnimationManager::FUN_10063270(LegoROIList* p_list, LegoAnimPresenter*
|
|||||||
FUN_10063950(roi);
|
FUN_10063950(roi);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LegoExtraActor* actor = CharacterManager()->GetActor(roi->GetName());
|
LegoExtraActor* actor = CharacterManager()->GetExtraActor(roi->GetName());
|
||||||
|
|
||||||
if (actor != NULL) {
|
if (actor != NULL) {
|
||||||
for (MxS32 i = 0; i < (MxS32) sizeOfArray(m_extras); i++) {
|
for (MxS32 i = 0; i < (MxS32) sizeOfArray(m_extras); i++) {
|
||||||
@@ -2277,7 +2277,7 @@ void LegoAnimationManager::FUN_10063780(LegoROIList* p_list)
|
|||||||
while (cursor.Next(roi)) {
|
while (cursor.Next(roi)) {
|
||||||
const char* name = roi->GetName();
|
const char* name = roi->GetName();
|
||||||
|
|
||||||
if (CharacterManager()->Exists(name)) {
|
if (CharacterManager()->IsActor(name)) {
|
||||||
m_unk0x424->Append(roi);
|
m_unk0x424->Append(roi);
|
||||||
cursor.Detach();
|
cursor.Detach();
|
||||||
}
|
}
|
||||||
@@ -2292,7 +2292,7 @@ void LegoAnimationManager::FUN_10063950(LegoROI* p_roi)
|
|||||||
LegoROIListCursor cursor(m_unk0x424);
|
LegoROIListCursor cursor(m_unk0x424);
|
||||||
|
|
||||||
if (cursor.Find(p_roi)) {
|
if (cursor.Find(p_roi)) {
|
||||||
CharacterManager()->FUN_10083db0(p_roi);
|
CharacterManager()->ReleaseActor(p_roi);
|
||||||
cursor.Detach();
|
cursor.Detach();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -2305,7 +2305,7 @@ void LegoAnimationManager::FUN_10063aa0()
|
|||||||
LegoROI* roi;
|
LegoROI* roi;
|
||||||
|
|
||||||
while (cursor.Next(roi)) {
|
while (cursor.Next(roi)) {
|
||||||
CharacterManager()->FUN_10083db0(roi);
|
CharacterManager()->ReleaseActor(roi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2388,7 +2388,7 @@ void LegoAnimationManager::FUN_10063d10()
|
|||||||
|
|
||||||
m_extras[i].m_unk0x0c = FALSE;
|
m_extras[i].m_unk0x0c = FALSE;
|
||||||
|
|
||||||
LegoExtraActor* actor = CharacterManager()->GetActor(roi->GetName());
|
LegoExtraActor* actor = CharacterManager()->GetExtraActor(roi->GetName());
|
||||||
if (actor != NULL) {
|
if (actor != NULL) {
|
||||||
float speed = m_extras[i].m_speed;
|
float speed = m_extras[i].m_speed;
|
||||||
|
|
||||||
@@ -2405,7 +2405,7 @@ void LegoAnimationManager::FUN_10063d10()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
LegoExtraActor* actor = CharacterManager()->GetActor(roi->GetName());
|
LegoExtraActor* actor = CharacterManager()->GetExtraActor(roi->GetName());
|
||||||
if (actor != NULL) {
|
if (actor != NULL) {
|
||||||
actor->Restart();
|
actor->Restart();
|
||||||
}
|
}
|
||||||
@@ -2424,7 +2424,7 @@ void LegoAnimationManager::FUN_10063e40(LegoAnimPresenter* p_presenter)
|
|||||||
|
|
||||||
while (cursor.Next(roi)) {
|
while (cursor.Next(roi)) {
|
||||||
if (!FUN_10062e20(roi, p_presenter)) {
|
if (!FUN_10062e20(roi, p_presenter)) {
|
||||||
CharacterManager()->FUN_10083db0(roi);
|
CharacterManager()->ReleaseActor(roi);
|
||||||
}
|
}
|
||||||
|
|
||||||
cursor.Detach();
|
cursor.Detach();
|
||||||
@@ -2594,7 +2594,7 @@ MxResult LegoAnimationManager::FUN_10064380(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (roi != NULL && !strcmpi(roi->GetName(), p_name)) {
|
if (roi != NULL && !strcmpi(roi->GetName(), p_name)) {
|
||||||
actor = CharacterManager()->GetActor(p_name);
|
actor = CharacterManager()->GetExtraActor(p_name);
|
||||||
|
|
||||||
if (actor != NULL && actor->GetController() != NULL) {
|
if (actor != NULL && actor->GetController() != NULL) {
|
||||||
actor->GetController()->RemoveActor(actor);
|
actor->GetController()->RemoveActor(actor);
|
||||||
@@ -2620,11 +2620,11 @@ MxResult LegoAnimationManager::FUN_10064380(
|
|||||||
return FAILURE;
|
return FAILURE;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_extras[extraIndex].m_roi = CharacterManager()->GetROI(p_name, TRUE);
|
m_extras[extraIndex].m_roi = CharacterManager()->GetActorROI(p_name, TRUE);
|
||||||
m_extras[extraIndex].m_characterId = characterId;
|
m_extras[extraIndex].m_characterId = characterId;
|
||||||
m_extras[extraIndex].m_speed = p_speed;
|
m_extras[extraIndex].m_speed = p_speed;
|
||||||
|
|
||||||
actor = CharacterManager()->GetActor(p_name);
|
actor = CharacterManager()->GetExtraActor(p_name);
|
||||||
m_unk0x414++;
|
m_unk0x414++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2634,7 +2634,7 @@ MxResult LegoAnimationManager::FUN_10064380(
|
|||||||
actor->SetWorldSpeed(0.0f);
|
actor->SetWorldSpeed(0.0f);
|
||||||
|
|
||||||
if (world->PlaceActor(actor, p_boundaryName, p_src, p_srcScale, p_dest, p_destScale) != SUCCESS) {
|
if (world->PlaceActor(actor, p_boundaryName, p_src, p_srcScale, p_dest, p_destScale) != SUCCESS) {
|
||||||
CharacterManager()->FUN_10083db0(m_extras[i].m_roi);
|
CharacterManager()->ReleaseActor(m_extras[i].m_roi);
|
||||||
m_extras[i].m_roi = NULL;
|
m_extras[i].m_roi = NULL;
|
||||||
m_unk0x414--;
|
m_unk0x414--;
|
||||||
return FAILURE;
|
return FAILURE;
|
||||||
|
@@ -1,8 +1,8 @@
|
|||||||
#include "legocharactermanager.h"
|
#include "legocharactermanager.h"
|
||||||
|
|
||||||
#include "3dmanager/lego3dmanager.h"
|
#include "3dmanager/lego3dmanager.h"
|
||||||
|
#include "legoactors.h"
|
||||||
#include "legoanimactor.h"
|
#include "legoanimactor.h"
|
||||||
#include "legocharacters.h"
|
|
||||||
#include "legoextraactor.h"
|
#include "legoextraactor.h"
|
||||||
#include "legogamestate.h"
|
#include "legogamestate.h"
|
||||||
#include "legovariables.h"
|
#include "legovariables.h"
|
||||||
@@ -40,7 +40,7 @@ MxU32 g_unk0x100fc4ec = 2;
|
|||||||
MxU32 g_unk0x100fc4f0 = 0;
|
MxU32 g_unk0x100fc4f0 = 0;
|
||||||
|
|
||||||
// GLOBAL: LEGO1 0x10104f20
|
// GLOBAL: LEGO1 0x10104f20
|
||||||
LegoCharacterInfo g_characterInfo[66];
|
LegoActorInfo g_actorInfo[66];
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10082a20
|
// FUNCTION: LEGO1 0x10082a20
|
||||||
LegoCharacterManager::LegoCharacterManager()
|
LegoCharacterManager::LegoCharacterManager()
|
||||||
@@ -75,26 +75,26 @@ LegoCharacterManager::~LegoCharacterManager()
|
|||||||
// FUNCTION: LEGO1 0x10083270
|
// FUNCTION: LEGO1 0x10083270
|
||||||
void LegoCharacterManager::Init()
|
void LegoCharacterManager::Init()
|
||||||
{
|
{
|
||||||
for (MxS32 i = 0; i < sizeOfArray(g_characterInfo); i++) {
|
for (MxS32 i = 0; i < sizeOfArray(g_actorInfo); i++) {
|
||||||
g_characterInfo[i] = g_characterInfoInit[i];
|
g_actorInfo[i] = g_actorInfoInit[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100832a0
|
// FUNCTION: LEGO1 0x100832a0
|
||||||
void LegoCharacterManager::FUN_100832a0()
|
void LegoCharacterManager::ReleaseAllActors()
|
||||||
{
|
{
|
||||||
for (MxS32 i = 0; i < sizeOfArray(g_characterInfo); i++) {
|
for (MxS32 i = 0; i < sizeOfArray(g_actorInfo); i++) {
|
||||||
LegoCharacterInfo* info = GetInfo(g_characterInfo[i].m_name);
|
LegoActorInfo* info = GetActorInfo(g_actorInfo[i].m_name);
|
||||||
|
|
||||||
if (info != NULL) {
|
if (info != NULL) {
|
||||||
LegoExtraActor* actor = info->m_actor;
|
LegoExtraActor* actor = info->m_actor;
|
||||||
|
|
||||||
if (actor != NULL && actor->IsA("LegoExtraActor")) {
|
if (actor != NULL && actor->IsA("LegoExtraActor")) {
|
||||||
LegoROI* roi = g_characterInfo[i].m_roi;
|
LegoROI* roi = g_actorInfo[i].m_roi;
|
||||||
MxU32 refCount = GetRefCount(roi);
|
MxU32 refCount = GetRefCount(roi);
|
||||||
|
|
||||||
while (refCount != 0) {
|
while (refCount != 0) {
|
||||||
FUN_10083db0(roi);
|
ReleaseActor(roi);
|
||||||
refCount = GetRefCount(roi);
|
refCount = GetRefCount(roi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -107,8 +107,8 @@ MxResult LegoCharacterManager::Write(LegoStorage* p_storage)
|
|||||||
{
|
{
|
||||||
MxResult result = FAILURE;
|
MxResult result = FAILURE;
|
||||||
|
|
||||||
for (MxS32 i = 0; i < sizeOfArray(g_characterInfo); i++) {
|
for (MxS32 i = 0; i < sizeOfArray(g_actorInfo); i++) {
|
||||||
LegoCharacterInfo* info = &g_characterInfo[i];
|
LegoActorInfo* info = &g_actorInfo[i];
|
||||||
|
|
||||||
if (p_storage->Write(&info->m_unk0x0c, sizeof(info->m_unk0x0c)) != SUCCESS) {
|
if (p_storage->Write(&info->m_unk0x0c, sizeof(info->m_unk0x0c)) != SUCCESS) {
|
||||||
goto done;
|
goto done;
|
||||||
@@ -162,8 +162,8 @@ MxResult LegoCharacterManager::Read(LegoStorage* p_storage)
|
|||||||
{
|
{
|
||||||
MxResult result = FAILURE;
|
MxResult result = FAILURE;
|
||||||
|
|
||||||
for (MxS32 i = 0; i < sizeOfArray(g_characterInfo); i++) {
|
for (MxS32 i = 0; i < sizeOfArray(g_actorInfo); i++) {
|
||||||
LegoCharacterInfo* info = &g_characterInfo[i];
|
LegoActorInfo* info = &g_actorInfo[i];
|
||||||
|
|
||||||
if (p_storage->Read(&info->m_unk0x0c, sizeof(info->m_unk0x0c)) != SUCCESS) {
|
if (p_storage->Read(&info->m_unk0x0c, sizeof(info->m_unk0x0c)) != SUCCESS) {
|
||||||
goto done;
|
goto done;
|
||||||
@@ -213,10 +213,10 @@ done:
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10083500
|
// FUNCTION: LEGO1 0x10083500
|
||||||
LegoROI* LegoCharacterManager::GetROI(const char* p_key, MxBool p_createEntity)
|
LegoROI* LegoCharacterManager::GetActorROI(const char* p_name, MxBool p_createEntity)
|
||||||
{
|
{
|
||||||
LegoCharacter* character = NULL;
|
LegoCharacter* character = NULL;
|
||||||
LegoCharacterMap::iterator it = m_characters->find(const_cast<char*>(p_key));
|
LegoCharacterMap::iterator it = m_characters->find(const_cast<char*>(p_name));
|
||||||
|
|
||||||
if (it != m_characters->end()) {
|
if (it != m_characters->end()) {
|
||||||
character = (*it).second;
|
character = (*it).second;
|
||||||
@@ -224,7 +224,7 @@ LegoROI* LegoCharacterManager::GetROI(const char* p_key, MxBool p_createEntity)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (character == NULL) {
|
if (character == NULL) {
|
||||||
LegoROI* roi = CreateROI(p_key);
|
LegoROI* roi = CreateActorROI(p_name);
|
||||||
|
|
||||||
if (roi == NULL) {
|
if (roi == NULL) {
|
||||||
goto done;
|
goto done;
|
||||||
@@ -234,11 +234,11 @@ LegoROI* LegoCharacterManager::GetROI(const char* p_key, MxBool p_createEntity)
|
|||||||
|
|
||||||
if (roi != NULL) {
|
if (roi != NULL) {
|
||||||
character = new LegoCharacter(roi);
|
character = new LegoCharacter(roi);
|
||||||
char* key = new char[strlen(p_key) + 1];
|
char* name = new char[strlen(p_name) + 1];
|
||||||
|
|
||||||
if (key != NULL) {
|
if (name != NULL) {
|
||||||
strcpy(key, p_key);
|
strcpy(name, p_name);
|
||||||
(*m_characters)[key] = character;
|
(*m_characters)[name] = character;
|
||||||
VideoManager()->Get3DManager()->Add(*roi);
|
VideoManager()->Get3DManager()->Add(*roi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -254,9 +254,9 @@ done:
|
|||||||
LegoExtraActor* actor = new LegoExtraActor();
|
LegoExtraActor* actor = new LegoExtraActor();
|
||||||
|
|
||||||
actor->SetROI(character->m_roi, FALSE, FALSE);
|
actor->SetROI(character->m_roi, FALSE, FALSE);
|
||||||
actor->SetType(LegoEntity::e_character);
|
actor->SetType(LegoEntity::e_actor);
|
||||||
actor->SetFlag(LegoActor::c_bit2);
|
actor->SetFlag(LegoEntity::c_managerOwned);
|
||||||
GetInfo(p_key)->m_actor = actor;
|
GetActorInfo(p_name)->m_actor = actor;
|
||||||
}
|
}
|
||||||
|
|
||||||
return character->m_roi;
|
return character->m_roi;
|
||||||
@@ -267,10 +267,10 @@ done:
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x10083b20
|
// FUNCTION: LEGO1 0x10083b20
|
||||||
// FUNCTION: BETA10 0x10074608
|
// FUNCTION: BETA10 0x10074608
|
||||||
MxBool LegoCharacterManager::FUN_10083b20(const char* p_key)
|
MxBool LegoCharacterManager::Exists(const char* p_name)
|
||||||
{
|
{
|
||||||
LegoCharacter* character = NULL;
|
LegoCharacter* character = NULL;
|
||||||
LegoCharacterMap::iterator it = m_characters->find(const_cast<char*>(p_key));
|
LegoCharacterMap::iterator it = m_characters->find(const_cast<char*>(p_name));
|
||||||
|
|
||||||
if (it != m_characters->end()) {
|
if (it != m_characters->end()) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -298,7 +298,7 @@ MxU32 LegoCharacterManager::GetRefCount(LegoROI* p_roi)
|
|||||||
|
|
||||||
// FUNCTION: LEGO1 0x10083c30
|
// FUNCTION: LEGO1 0x10083c30
|
||||||
// FUNCTION: BETA10 0x10074701
|
// FUNCTION: BETA10 0x10074701
|
||||||
void LegoCharacterManager::FUN_10083c30(const char* p_name)
|
void LegoCharacterManager::ReleaseActor(const char* p_name)
|
||||||
{
|
{
|
||||||
LegoCharacter* character = NULL;
|
LegoCharacter* character = NULL;
|
||||||
LegoCharacterMap::iterator it = m_characters->find(const_cast<char*>(p_name));
|
LegoCharacterMap::iterator it = m_characters->find(const_cast<char*>(p_name));
|
||||||
@@ -307,7 +307,7 @@ void LegoCharacterManager::FUN_10083c30(const char* p_name)
|
|||||||
character = (*it).second;
|
character = (*it).second;
|
||||||
|
|
||||||
if (character->RemoveRef() == 0) {
|
if (character->RemoveRef() == 0) {
|
||||||
LegoCharacterInfo* info = GetInfo(p_name);
|
LegoActorInfo* info = GetActorInfo(p_name);
|
||||||
LegoEntity* entity = character->m_roi->GetEntity();
|
LegoEntity* entity = character->m_roi->GetEntity();
|
||||||
|
|
||||||
if (entity != NULL) {
|
if (entity != NULL) {
|
||||||
@@ -323,11 +323,11 @@ void LegoCharacterManager::FUN_10083c30(const char* p_name)
|
|||||||
|
|
||||||
if (info != NULL) {
|
if (info != NULL) {
|
||||||
if (info->m_actor != NULL) {
|
if (info->m_actor != NULL) {
|
||||||
info->m_actor->ClearFlag(LegoEntity::c_bit2);
|
info->m_actor->ClearFlag(LegoEntity::c_managerOwned);
|
||||||
delete info->m_actor;
|
delete info->m_actor;
|
||||||
}
|
}
|
||||||
else if (entity != NULL && entity->GetFlagsIsSet(LegoEntity::c_bit2)) {
|
else if (entity != NULL && entity->GetFlagsIsSet(LegoEntity::c_managerOwned)) {
|
||||||
entity->ClearFlag(LegoEntity::c_bit2);
|
entity->ClearFlag(LegoEntity::c_managerOwned);
|
||||||
delete entity;
|
delete entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -339,7 +339,7 @@ void LegoCharacterManager::FUN_10083c30(const char* p_name)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10083db0
|
// FUNCTION: LEGO1 0x10083db0
|
||||||
void LegoCharacterManager::FUN_10083db0(LegoROI* p_roi)
|
void LegoCharacterManager::ReleaseActor(LegoROI* p_roi)
|
||||||
{
|
{
|
||||||
LegoCharacter* character = NULL;
|
LegoCharacter* character = NULL;
|
||||||
LegoCharacterMap::iterator it;
|
LegoCharacterMap::iterator it;
|
||||||
@@ -349,7 +349,7 @@ void LegoCharacterManager::FUN_10083db0(LegoROI* p_roi)
|
|||||||
|
|
||||||
if (character->m_roi == p_roi) {
|
if (character->m_roi == p_roi) {
|
||||||
if (character->RemoveRef() == 0) {
|
if (character->RemoveRef() == 0) {
|
||||||
LegoCharacterInfo* info = GetInfo(character->m_roi->GetName());
|
LegoActorInfo* info = GetActorInfo(character->m_roi->GetName());
|
||||||
LegoEntity* entity = character->m_roi->GetEntity();
|
LegoEntity* entity = character->m_roi->GetEntity();
|
||||||
|
|
||||||
if (entity != NULL) {
|
if (entity != NULL) {
|
||||||
@@ -365,11 +365,11 @@ void LegoCharacterManager::FUN_10083db0(LegoROI* p_roi)
|
|||||||
|
|
||||||
if (info != NULL) {
|
if (info != NULL) {
|
||||||
if (info->m_actor != NULL) {
|
if (info->m_actor != NULL) {
|
||||||
info->m_actor->ClearFlag(LegoEntity::c_bit2);
|
info->m_actor->ClearFlag(LegoEntity::c_managerOwned);
|
||||||
delete info->m_actor;
|
delete info->m_actor;
|
||||||
}
|
}
|
||||||
else if (entity != NULL && entity->GetFlagsIsSet(LegoEntity::c_bit2)) {
|
else if (entity != NULL && entity->GetFlagsIsSet(LegoEntity::c_managerOwned)) {
|
||||||
entity->ClearFlag(LegoEntity::c_bit2);
|
entity->ClearFlag(LegoEntity::c_managerOwned);
|
||||||
delete entity;
|
delete entity;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -384,7 +384,7 @@ void LegoCharacterManager::FUN_10083db0(LegoROI* p_roi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10083f10
|
// FUNCTION: LEGO1 0x10083f10
|
||||||
void LegoCharacterManager::FUN_10083f10(LegoROI* p_roi)
|
void LegoCharacterManager::ReleaseAutoROI(LegoROI* p_roi)
|
||||||
{
|
{
|
||||||
LegoCharacter* character = NULL;
|
LegoCharacter* character = NULL;
|
||||||
LegoCharacterMap::iterator it;
|
LegoCharacterMap::iterator it;
|
||||||
@@ -407,8 +407,8 @@ void LegoCharacterManager::FUN_10083f10(LegoROI* p_roi)
|
|||||||
|
|
||||||
m_characters->erase(it);
|
m_characters->erase(it);
|
||||||
|
|
||||||
if (entity != NULL && entity->GetFlagsIsSet(LegoEntity::c_bit2)) {
|
if (entity != NULL && entity->GetFlagsIsSet(LegoEntity::c_managerOwned)) {
|
||||||
entity->ClearFlag(LegoEntity::c_bit2);
|
entity->ClearFlag(LegoEntity::c_managerOwned);
|
||||||
delete entity;
|
delete entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -425,7 +425,7 @@ void LegoCharacterManager::RemoveROI(LegoROI* p_roi)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10084030
|
// FUNCTION: LEGO1 0x10084030
|
||||||
LegoROI* LegoCharacterManager::CreateROI(const char* p_key)
|
LegoROI* LegoCharacterManager::CreateActorROI(const char* p_key)
|
||||||
{
|
{
|
||||||
MxBool success = FALSE;
|
MxBool success = FALSE;
|
||||||
LegoROI* roi = NULL;
|
LegoROI* roi = NULL;
|
||||||
@@ -438,14 +438,14 @@ LegoROI* LegoCharacterManager::CreateROI(const char* p_key)
|
|||||||
Tgl::Renderer* renderer = VideoManager()->GetRenderer();
|
Tgl::Renderer* renderer = VideoManager()->GetRenderer();
|
||||||
ViewLODListManager* lodManager = GetViewLODListManager();
|
ViewLODListManager* lodManager = GetViewLODListManager();
|
||||||
LegoTextureContainer* textureContainer = TextureContainer();
|
LegoTextureContainer* textureContainer = TextureContainer();
|
||||||
LegoCharacterInfo* info = GetInfo(p_key);
|
LegoActorInfo* info = GetActorInfo(p_key);
|
||||||
|
|
||||||
if (info == NULL) {
|
if (info == NULL) {
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmpi(p_key, "pep")) {
|
if (!strcmpi(p_key, "pep")) {
|
||||||
LegoCharacterInfo* pepper = GetInfo("pepper");
|
LegoActorInfo* pepper = GetActorInfo("pepper");
|
||||||
|
|
||||||
info->m_unk0x0c = pepper->m_unk0x0c;
|
info->m_unk0x0c = pepper->m_unk0x0c;
|
||||||
info->m_unk0x10 = pepper->m_unk0x10;
|
info->m_unk0x10 = pepper->m_unk0x10;
|
||||||
@@ -459,33 +459,33 @@ LegoROI* LegoCharacterManager::CreateROI(const char* p_key)
|
|||||||
roi = new LegoROI(renderer);
|
roi = new LegoROI(renderer);
|
||||||
roi->SetName(p_key);
|
roi->SetName(p_key);
|
||||||
|
|
||||||
boundingSphere.Center()[0] = g_characterLODs[c_topLOD].m_boundingSphere[0];
|
boundingSphere.Center()[0] = g_actorLODs[c_topLOD].m_boundingSphere[0];
|
||||||
boundingSphere.Center()[1] = g_characterLODs[c_topLOD].m_boundingSphere[1];
|
boundingSphere.Center()[1] = g_actorLODs[c_topLOD].m_boundingSphere[1];
|
||||||
boundingSphere.Center()[2] = g_characterLODs[c_topLOD].m_boundingSphere[2];
|
boundingSphere.Center()[2] = g_actorLODs[c_topLOD].m_boundingSphere[2];
|
||||||
boundingSphere.Radius() = g_characterLODs[c_topLOD].m_boundingSphere[3];
|
boundingSphere.Radius() = g_actorLODs[c_topLOD].m_boundingSphere[3];
|
||||||
roi->SetBoundingSphere(boundingSphere);
|
roi->SetBoundingSphere(boundingSphere);
|
||||||
|
|
||||||
boundingBox.Min()[0] = g_characterLODs[c_topLOD].m_boundingBox[0];
|
boundingBox.Min()[0] = g_actorLODs[c_topLOD].m_boundingBox[0];
|
||||||
boundingBox.Min()[1] = g_characterLODs[c_topLOD].m_boundingBox[1];
|
boundingBox.Min()[1] = g_actorLODs[c_topLOD].m_boundingBox[1];
|
||||||
boundingBox.Min()[2] = g_characterLODs[c_topLOD].m_boundingBox[2];
|
boundingBox.Min()[2] = g_actorLODs[c_topLOD].m_boundingBox[2];
|
||||||
boundingBox.Max()[0] = g_characterLODs[c_topLOD].m_boundingBox[3];
|
boundingBox.Max()[0] = g_actorLODs[c_topLOD].m_boundingBox[3];
|
||||||
boundingBox.Max()[1] = g_characterLODs[c_topLOD].m_boundingBox[4];
|
boundingBox.Max()[1] = g_actorLODs[c_topLOD].m_boundingBox[4];
|
||||||
boundingBox.Max()[2] = g_characterLODs[c_topLOD].m_boundingBox[5];
|
boundingBox.Max()[2] = g_actorLODs[c_topLOD].m_boundingBox[5];
|
||||||
roi->SetUnknown0x80(boundingBox);
|
roi->SetUnknown0x80(boundingBox);
|
||||||
|
|
||||||
comp = new CompoundObject();
|
comp = new CompoundObject();
|
||||||
roi->SetComp(comp);
|
roi->SetComp(comp);
|
||||||
|
|
||||||
for (i = 0; i < sizeOfArray(g_characterLODs) - 1; i++) {
|
for (i = 0; i < sizeOfArray(g_actorLODs) - 1; i++) {
|
||||||
char lodName[256];
|
char lodName[256];
|
||||||
LegoCharacterInfo::Part& part = info->m_parts[i];
|
LegoActorInfo::Part& part = info->m_parts[i];
|
||||||
|
|
||||||
const char* parentName;
|
const char* parentName;
|
||||||
if (i == 0 || i == 1) {
|
if (i == 0 || i == 1) {
|
||||||
parentName = part.m_unk0x04[part.m_unk0x00[part.m_unk0x08]];
|
parentName = part.m_unk0x04[part.m_unk0x00[part.m_unk0x08]];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
parentName = g_characterLODs[i + 1].m_parentName;
|
parentName = g_actorLODs[i + 1].m_parentName;
|
||||||
}
|
}
|
||||||
|
|
||||||
ViewLODList* lodList = lodManager->Lookup(parentName);
|
ViewLODList* lodList = lodManager->Lookup(parentName);
|
||||||
@@ -505,35 +505,34 @@ LegoROI* LegoCharacterManager::CreateROI(const char* p_key)
|
|||||||
LegoROI* childROI = new LegoROI(renderer, lodList);
|
LegoROI* childROI = new LegoROI(renderer, lodList);
|
||||||
lodList->Release();
|
lodList->Release();
|
||||||
|
|
||||||
childROI->SetName(g_characterLODs[i + 1].m_name);
|
childROI->SetName(g_actorLODs[i + 1].m_name);
|
||||||
childROI->SetParentROI(roi);
|
childROI->SetParentROI(roi);
|
||||||
|
|
||||||
BoundingSphere childBoundingSphere;
|
BoundingSphere childBoundingSphere;
|
||||||
childBoundingSphere.Center()[0] = g_characterLODs[i + 1].m_boundingSphere[0];
|
childBoundingSphere.Center()[0] = g_actorLODs[i + 1].m_boundingSphere[0];
|
||||||
childBoundingSphere.Center()[1] = g_characterLODs[i + 1].m_boundingSphere[1];
|
childBoundingSphere.Center()[1] = g_actorLODs[i + 1].m_boundingSphere[1];
|
||||||
childBoundingSphere.Center()[2] = g_characterLODs[i + 1].m_boundingSphere[2];
|
childBoundingSphere.Center()[2] = g_actorLODs[i + 1].m_boundingSphere[2];
|
||||||
childBoundingSphere.Radius() = g_characterLODs[i + 1].m_boundingSphere[3];
|
childBoundingSphere.Radius() = g_actorLODs[i + 1].m_boundingSphere[3];
|
||||||
childROI->SetBoundingSphere(childBoundingSphere);
|
childROI->SetBoundingSphere(childBoundingSphere);
|
||||||
|
|
||||||
BoundingBox childBoundingBox;
|
BoundingBox childBoundingBox;
|
||||||
childBoundingBox.Min()[0] = g_characterLODs[i + 1].m_boundingBox[0];
|
childBoundingBox.Min()[0] = g_actorLODs[i + 1].m_boundingBox[0];
|
||||||
childBoundingBox.Min()[1] = g_characterLODs[i + 1].m_boundingBox[1];
|
childBoundingBox.Min()[1] = g_actorLODs[i + 1].m_boundingBox[1];
|
||||||
childBoundingBox.Min()[2] = g_characterLODs[i + 1].m_boundingBox[2];
|
childBoundingBox.Min()[2] = g_actorLODs[i + 1].m_boundingBox[2];
|
||||||
childBoundingBox.Max()[0] = g_characterLODs[i + 1].m_boundingBox[3];
|
childBoundingBox.Max()[0] = g_actorLODs[i + 1].m_boundingBox[3];
|
||||||
childBoundingBox.Max()[1] = g_characterLODs[i + 1].m_boundingBox[4];
|
childBoundingBox.Max()[1] = g_actorLODs[i + 1].m_boundingBox[4];
|
||||||
childBoundingBox.Max()[2] = g_characterLODs[i + 1].m_boundingBox[5];
|
childBoundingBox.Max()[2] = g_actorLODs[i + 1].m_boundingBox[5];
|
||||||
childROI->SetUnknown0x80(childBoundingBox);
|
childROI->SetUnknown0x80(childBoundingBox);
|
||||||
|
|
||||||
CalcLocalTransform(
|
CalcLocalTransform(
|
||||||
Mx3DPointFloat(g_characterLODs[i + 1].m_position),
|
Mx3DPointFloat(g_actorLODs[i + 1].m_position),
|
||||||
Mx3DPointFloat(g_characterLODs[i + 1].m_direction),
|
Mx3DPointFloat(g_actorLODs[i + 1].m_direction),
|
||||||
Mx3DPointFloat(g_characterLODs[i + 1].m_up),
|
Mx3DPointFloat(g_actorLODs[i + 1].m_up),
|
||||||
mat
|
mat
|
||||||
);
|
);
|
||||||
childROI->WrappedSetLocalTransform(mat);
|
childROI->WrappedSetLocalTransform(mat);
|
||||||
|
|
||||||
if (g_characterLODs[i + 1].m_flags & LegoCharacterLOD::c_flag1 &&
|
if (g_actorLODs[i + 1].m_flags & LegoActorLOD::c_flag1 && (i != 0 || part.m_unk0x00[part.m_unk0x08] != 0)) {
|
||||||
(i != 0 || part.m_unk0x00[part.m_unk0x08] != 0)) {
|
|
||||||
|
|
||||||
LegoTextureInfo* textureInfo = textureContainer->Get(part.m_unk0x10[part.m_unk0x0c[part.m_unk0x14]]);
|
LegoTextureInfo* textureInfo = textureContainer->Get(part.m_unk0x10[part.m_unk0x0c[part.m_unk0x14]]);
|
||||||
|
|
||||||
@@ -542,7 +541,7 @@ LegoROI* LegoCharacterManager::CreateROI(const char* p_key)
|
|||||||
childROI->FUN_100a9170(1.0F, 1.0F, 1.0F, 0.0F);
|
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)) {
|
else if (g_actorLODs[i + 1].m_flags & LegoActorLOD::c_flag2 || (i == 0 && part.m_unk0x00[part.m_unk0x08] == 0)) {
|
||||||
LegoFloat red, green, blue, alpha;
|
LegoFloat red, green, blue, alpha;
|
||||||
childROI->FUN_100a9bf0(part.m_unk0x10[part.m_unk0x0c[part.m_unk0x14]], 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);
|
childROI->FUN_100a9170(red, green, blue, alpha);
|
||||||
@@ -552,9 +551,9 @@ LegoROI* LegoCharacterManager::CreateROI(const char* p_key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
CalcLocalTransform(
|
CalcLocalTransform(
|
||||||
Mx3DPointFloat(g_characterLODs[c_topLOD].m_position),
|
Mx3DPointFloat(g_actorLODs[c_topLOD].m_position),
|
||||||
Mx3DPointFloat(g_characterLODs[c_topLOD].m_direction),
|
Mx3DPointFloat(g_actorLODs[c_topLOD].m_direction),
|
||||||
Mx3DPointFloat(g_characterLODs[c_topLOD].m_up),
|
Mx3DPointFloat(g_actorLODs[c_topLOD].m_up),
|
||||||
mat
|
mat
|
||||||
);
|
);
|
||||||
roi->WrappedSetLocalTransform(mat);
|
roi->WrappedSetLocalTransform(mat);
|
||||||
@@ -576,12 +575,12 @@ done:
|
|||||||
MxBool LegoCharacterManager::FUN_100849a0(LegoROI* p_roi, LegoTextureInfo* p_textureInfo)
|
MxBool LegoCharacterManager::FUN_100849a0(LegoROI* p_roi, LegoTextureInfo* p_textureInfo)
|
||||||
{
|
{
|
||||||
LegoResult result = SUCCESS;
|
LegoResult result = SUCCESS;
|
||||||
LegoROI* head = FindChildROI(p_roi, g_characterLODs[c_headLOD].m_name);
|
LegoROI* head = FindChildROI(p_roi, g_actorLODs[c_headLOD].m_name);
|
||||||
|
|
||||||
if (head != NULL) {
|
if (head != NULL) {
|
||||||
char lodName[256];
|
char lodName[256];
|
||||||
|
|
||||||
ViewLODList* lodList = GetViewLODListManager()->Lookup(g_characterLODs[c_headLOD].m_parentName);
|
ViewLODList* lodList = GetViewLODListManager()->Lookup(g_actorLODs[c_headLOD].m_parentName);
|
||||||
MxS32 lodSize = lodList->Size();
|
MxS32 lodSize = lodList->Size();
|
||||||
sprintf(lodName, "%s%s%d", p_roi->GetName(), "head", g_unk0x100fc4e8++);
|
sprintf(lodName, "%s%s%d", p_roi->GetName(), "head", g_unk0x100fc4e8++);
|
||||||
ViewLODList* dupLodList = GetViewLODListManager()->Create(lodName, lodSize);
|
ViewLODList* dupLodList = GetViewLODListManager()->Create(lodName, lodSize);
|
||||||
@@ -589,8 +588,8 @@ MxBool LegoCharacterManager::FUN_100849a0(LegoROI* p_roi, LegoTextureInfo* p_tex
|
|||||||
Tgl::Renderer* renderer = VideoManager()->GetRenderer();
|
Tgl::Renderer* renderer = VideoManager()->GetRenderer();
|
||||||
|
|
||||||
if (p_textureInfo == NULL) {
|
if (p_textureInfo == NULL) {
|
||||||
LegoCharacterInfo* info = GetInfo(p_roi->GetName());
|
LegoActorInfo* info = GetActorInfo(p_roi->GetName());
|
||||||
LegoCharacterInfo::Part& part = info->m_parts[c_headPart];
|
LegoActorInfo::Part& part = info->m_parts[c_headPart];
|
||||||
p_textureInfo = TextureContainer()->Get(part.m_unk0x10[part.m_unk0x0c[part.m_unk0x14]]);
|
p_textureInfo = TextureContainer()->Get(part.m_unk0x10[part.m_unk0x0c[part.m_unk0x14]]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -620,10 +619,10 @@ MxBool LegoCharacterManager::FUN_100849a0(LegoROI* p_roi, LegoTextureInfo* p_tex
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10084c00
|
// FUNCTION: LEGO1 0x10084c00
|
||||||
MxBool LegoCharacterManager::Exists(const char* p_key)
|
MxBool LegoCharacterManager::IsActor(const char* p_name)
|
||||||
{
|
{
|
||||||
for (MxU32 i = 0; i < sizeOfArray(g_characterInfo); i++) {
|
for (MxU32 i = 0; i < sizeOfArray(g_actorInfo); i++) {
|
||||||
if (!strcmpi(g_characterInfo[i].m_name, p_key)) {
|
if (!strcmpi(g_actorInfo[i].m_name, p_name)) {
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -632,9 +631,9 @@ MxBool LegoCharacterManager::Exists(const char* p_key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10084c40
|
// FUNCTION: LEGO1 0x10084c40
|
||||||
LegoExtraActor* LegoCharacterManager::GetActor(const char* p_key)
|
LegoExtraActor* LegoCharacterManager::GetExtraActor(const char* p_name)
|
||||||
{
|
{
|
||||||
LegoCharacterInfo* info = GetInfo(p_key);
|
LegoActorInfo* info = GetActorInfo(p_name);
|
||||||
|
|
||||||
if (info != NULL) {
|
if (info != NULL) {
|
||||||
return info->m_actor;
|
return info->m_actor;
|
||||||
@@ -644,36 +643,36 @@ LegoExtraActor* LegoCharacterManager::GetActor(const char* p_key)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10084c60
|
// FUNCTION: LEGO1 0x10084c60
|
||||||
LegoCharacterInfo* LegoCharacterManager::GetInfo(const char* p_key)
|
LegoActorInfo* LegoCharacterManager::GetActorInfo(const char* p_name)
|
||||||
{
|
{
|
||||||
MxU32 i;
|
MxU32 i;
|
||||||
|
|
||||||
for (i = 0; i < sizeOfArray(g_characterInfo); i++) {
|
for (i = 0; i < sizeOfArray(g_actorInfo); i++) {
|
||||||
if (!strcmpi(g_characterInfo[i].m_name, p_key)) {
|
if (!strcmpi(g_actorInfo[i].m_name, p_name)) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i < sizeOfArray(g_characterInfo)) {
|
if (i < sizeOfArray(g_actorInfo)) {
|
||||||
return &g_characterInfo[i];
|
return &g_actorInfo[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10084cb0
|
// FUNCTION: LEGO1 0x10084cb0
|
||||||
LegoCharacterInfo* LegoCharacterManager::GetInfo(LegoROI* p_roi)
|
LegoActorInfo* LegoCharacterManager::GetActorInfo(LegoROI* p_roi)
|
||||||
{
|
{
|
||||||
MxU32 i;
|
MxU32 i;
|
||||||
|
|
||||||
for (i = 0; i < sizeOfArray(g_characterInfo); i++) {
|
for (i = 0; i < sizeOfArray(g_actorInfo); i++) {
|
||||||
if (g_characterInfo[i].m_roi == p_roi) {
|
if (g_actorInfo[i].m_roi == p_roi) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (i < sizeOfArray(g_characterInfo)) {
|
if (i < sizeOfArray(g_actorInfo)) {
|
||||||
return &g_characterInfo[i];
|
return &g_actorInfo[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@@ -703,13 +702,13 @@ LegoROI* LegoCharacterManager::FindChildROI(LegoROI* p_roi, const char* p_name)
|
|||||||
// FUNCTION: LEGO1 0x10084ec0
|
// FUNCTION: LEGO1 0x10084ec0
|
||||||
MxBool LegoCharacterManager::SwitchHat(LegoROI* p_roi)
|
MxBool LegoCharacterManager::SwitchHat(LegoROI* p_roi)
|
||||||
{
|
{
|
||||||
LegoCharacterInfo* info = GetInfo(p_roi->GetName());
|
LegoActorInfo* info = GetActorInfo(p_roi->GetName());
|
||||||
|
|
||||||
if (info == NULL) {
|
if (info == NULL) {
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
LegoCharacterInfo::Part& part = info->m_parts[c_infohatPart];
|
LegoActorInfo::Part& part = info->m_parts[c_infohatPart];
|
||||||
|
|
||||||
part.m_unk0x08++;
|
part.m_unk0x08++;
|
||||||
MxU8 unk0x00 = part.m_unk0x00[part.m_unk0x08];
|
MxU8 unk0x00 = part.m_unk0x00[part.m_unk0x08];
|
||||||
@@ -719,7 +718,7 @@ MxBool LegoCharacterManager::SwitchHat(LegoROI* p_roi)
|
|||||||
unk0x00 = part.m_unk0x00[part.m_unk0x08];
|
unk0x00 = part.m_unk0x00[part.m_unk0x08];
|
||||||
}
|
}
|
||||||
|
|
||||||
LegoROI* childROI = FindChildROI(p_roi, g_characterLODs[c_infohatLOD].m_name);
|
LegoROI* childROI = FindChildROI(p_roi, g_actorLODs[c_infohatLOD].m_name);
|
||||||
|
|
||||||
if (childROI != NULL) {
|
if (childROI != NULL) {
|
||||||
char lodName[256];
|
char lodName[256];
|
||||||
@@ -757,7 +756,7 @@ MxBool LegoCharacterManager::SwitchHat(LegoROI* p_roi)
|
|||||||
// FUNCTION: LEGO1 0x10085140
|
// FUNCTION: LEGO1 0x10085140
|
||||||
MxU32 LegoCharacterManager::FUN_10085140(LegoROI* p_roi, MxBool p_und)
|
MxU32 LegoCharacterManager::FUN_10085140(LegoROI* p_roi, MxBool p_und)
|
||||||
{
|
{
|
||||||
LegoCharacterInfo* info = GetInfo(p_roi);
|
LegoActorInfo* info = GetActorInfo(p_roi);
|
||||||
|
|
||||||
if (p_und) {
|
if (p_und) {
|
||||||
return info->m_mood + g_unk0x100fc4dc;
|
return info->m_mood + g_unk0x100fc4dc;
|
||||||
@@ -774,7 +773,7 @@ MxU32 LegoCharacterManager::FUN_10085140(LegoROI* p_roi, MxBool p_und)
|
|||||||
// FUNCTION: BETA10 0x100768c5
|
// FUNCTION: BETA10 0x100768c5
|
||||||
MxU8 LegoCharacterManager::GetMood(LegoROI* p_roi)
|
MxU8 LegoCharacterManager::GetMood(LegoROI* p_roi)
|
||||||
{
|
{
|
||||||
LegoCharacterInfo* info = GetInfo(p_roi);
|
LegoActorInfo* info = GetActorInfo(p_roi);
|
||||||
|
|
||||||
if (info != NULL) {
|
if (info != NULL) {
|
||||||
return info->m_mood;
|
return info->m_mood;
|
||||||
@@ -803,7 +802,7 @@ void LegoCharacterManager::SetCustomizeAnimFile(const char* p_value)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10085210
|
// FUNCTION: LEGO1 0x10085210
|
||||||
LegoROI* LegoCharacterManager::FUN_10085210(const char* p_name, const char* p_lodName, MxBool p_createEntity)
|
LegoROI* LegoCharacterManager::CreateAutoROI(const char* p_name, const char* p_lodName, MxBool p_createEntity)
|
||||||
{
|
{
|
||||||
LegoROI* roi = NULL;
|
LegoROI* roi = NULL;
|
||||||
|
|
||||||
@@ -853,8 +852,8 @@ LegoROI* LegoCharacterManager::FUN_10085210(const char* p_name, const char* p_lo
|
|||||||
LegoEntity* entity = new LegoEntity();
|
LegoEntity* entity = new LegoEntity();
|
||||||
|
|
||||||
entity->SetROI(roi, FALSE, FALSE);
|
entity->SetROI(roi, FALSE, FALSE);
|
||||||
entity->SetType(LegoEntity::e_unk4);
|
entity->SetType(LegoEntity::e_autoROI);
|
||||||
entity->SetFlag(LegoActor::c_bit2);
|
entity->SetFlag(LegoEntity::c_managerOwned);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -907,5 +906,5 @@ MxResult LegoCharacterManager::FUN_10085870(LegoROI* p_roi)
|
|||||||
// FUNCTION: LEGO1 0x10085a80
|
// FUNCTION: LEGO1 0x10085a80
|
||||||
LegoROI* LegoCharacterManager::FUN_10085a80(const char* p_name, const char* p_lodName, MxBool p_createEntity)
|
LegoROI* LegoCharacterManager::FUN_10085a80(const char* p_name, const char* p_lodName, MxBool p_createEntity)
|
||||||
{
|
{
|
||||||
return FUN_10085210(p_name, p_lodName, p_createEntity);
|
return CreateAutoROI(p_name, p_lodName, p_createEntity);
|
||||||
}
|
}
|
||||||
|
@@ -177,7 +177,7 @@ void LegoGameState::SetActor(MxU8 p_actorId)
|
|||||||
|
|
||||||
IslePathActor* newActor = new IslePathActor();
|
IslePathActor* newActor = new IslePathActor();
|
||||||
const char* actorName = LegoActor::GetActorName(m_actorId);
|
const char* actorName = LegoActor::GetActorName(m_actorId);
|
||||||
LegoROI* roi = CharacterManager()->GetROI(actorName, FALSE);
|
LegoROI* roi = CharacterManager()->GetActorROI(actorName, FALSE);
|
||||||
MxDSAction action;
|
MxDSAction action;
|
||||||
|
|
||||||
action.SetAtomId(*g_isleScript);
|
action.SetAtomId(*g_isleScript);
|
||||||
|
@@ -129,7 +129,7 @@ void LegoActor::SetROI(LegoROI* p_roi, MxBool p_bool1, MxBool p_bool2)
|
|||||||
|
|
||||||
for (MxU32 i = 1; i <= sizeOfArray(g_actorNames) - 1; i++) {
|
for (MxU32 i = 1; i <= sizeOfArray(g_actorNames) - 1; i++) {
|
||||||
if (!strcmpi(name, g_actorNames[i])) {
|
if (!strcmpi(name, g_actorNames[i])) {
|
||||||
m_type = e_character;
|
m_type = e_actor;
|
||||||
m_actorId = i;
|
m_actorId = i;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@@ -31,7 +31,7 @@ void LegoEntity::Init()
|
|||||||
m_flags = 0;
|
m_flags = 0;
|
||||||
m_actionType = Extra::ActionType::e_unknown;
|
m_actionType = Extra::ActionType::e_unknown;
|
||||||
m_targetEntityId = -1;
|
m_targetEntityId = -1;
|
||||||
m_type = e_unk4;
|
m_type = e_autoROI;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10010650
|
// FUNCTION: LEGO1 0x10010650
|
||||||
@@ -93,7 +93,7 @@ void LegoEntity::Destroy(MxBool p_fromDestructor)
|
|||||||
m_roi->SetEntity(NULL);
|
m_roi->SetEntity(NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
CharacterManager()->FUN_10083db0(m_roi);
|
CharacterManager()->ReleaseActor(m_roi);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
VideoManager()->Get3DManager()->GetLego3DView()->Remove(*m_roi);
|
VideoManager()->Get3DManager()->GetLego3DView()->Remove(*m_roi);
|
||||||
@@ -252,7 +252,7 @@ void LegoEntity::VTable0x34(MxBool p_und)
|
|||||||
const LegoChar* roiName = m_roi->GetName();
|
const LegoChar* roiName = m_roi->GetName();
|
||||||
|
|
||||||
switch (m_type) {
|
switch (m_type) {
|
||||||
case e_character:
|
case e_actor:
|
||||||
objectId = CharacterManager()->FUN_10085140(m_roi, p_und);
|
objectId = CharacterManager()->FUN_10085140(m_roi, p_und);
|
||||||
break;
|
break;
|
||||||
case e_unk1:
|
case e_unk1:
|
||||||
@@ -285,7 +285,7 @@ void LegoEntity::VTable0x38()
|
|||||||
void LegoEntity::VTable0x3c()
|
void LegoEntity::VTable0x3c()
|
||||||
{
|
{
|
||||||
switch (m_type) {
|
switch (m_type) {
|
||||||
case e_character:
|
case e_actor:
|
||||||
CharacterManager()->SwitchHat(m_roi);
|
CharacterManager()->SwitchHat(m_roi);
|
||||||
break;
|
break;
|
||||||
case e_unk1:
|
case e_unk1:
|
||||||
@@ -366,7 +366,7 @@ MxLong LegoEntity::Notify(MxParam& p_param)
|
|||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
switch (m_type) {
|
switch (m_type) {
|
||||||
case e_character:
|
case e_actor:
|
||||||
case e_unk1:
|
case e_unk1:
|
||||||
break;
|
break;
|
||||||
case e_plant:
|
case e_plant:
|
||||||
@@ -375,7 +375,7 @@ MxLong LegoEntity::Notify(MxParam& p_param)
|
|||||||
case e_building:
|
case e_building:
|
||||||
BuildingManager()->FUN_10030000(this);
|
BuildingManager()->FUN_10030000(this);
|
||||||
break;
|
break;
|
||||||
case e_unk4:
|
case e_autoROI:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -187,7 +187,7 @@ void LegoWorld::Destroy(MxBool p_fromDestructor)
|
|||||||
while (cursor.First(entity)) {
|
while (cursor.First(entity)) {
|
||||||
cursor.Detach();
|
cursor.Detach();
|
||||||
|
|
||||||
if (!(entity->GetFlags() & LegoEntity::c_bit2)) {
|
if (!(entity->GetFlags() & LegoEntity::c_managerOwned)) {
|
||||||
delete entity;
|
delete entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -188,7 +188,7 @@ LegoChar* LegoAnimPresenter::FUN_10069150(const LegoChar* p_und1)
|
|||||||
{
|
{
|
||||||
LegoChar* str;
|
LegoChar* str;
|
||||||
|
|
||||||
if (LegoCharacterManager::Exists(p_und1 + 1)) {
|
if (LegoCharacterManager::IsActor(p_und1 + 1)) {
|
||||||
str = new LegoChar[strlen(p_und1)];
|
str = new LegoChar[strlen(p_und1)];
|
||||||
|
|
||||||
if (str != NULL) {
|
if (str != NULL) {
|
||||||
@@ -232,7 +232,7 @@ void LegoAnimPresenter::FUN_100692b0()
|
|||||||
src = str;
|
src = str;
|
||||||
}
|
}
|
||||||
|
|
||||||
roi = CharacterManager()->GetROI(src, TRUE);
|
roi = CharacterManager()->GetActorROI(src, TRUE);
|
||||||
|
|
||||||
if (roi != NULL && str[0] == '*') {
|
if (roi != NULL && str[0] == '*') {
|
||||||
roi->SetVisibility(FALSE);
|
roi->SetVisibility(FALSE);
|
||||||
@@ -268,7 +268,7 @@ void LegoAnimPresenter::FUN_100692b0()
|
|||||||
strlwr(lodName);
|
strlwr(lodName);
|
||||||
|
|
||||||
LegoChar* und = FUN_10069150(str);
|
LegoChar* und = FUN_10069150(str);
|
||||||
roi = CharacterManager()->FUN_10085210(und, lodName, TRUE);
|
roi = CharacterManager()->CreateAutoROI(und, lodName, TRUE);
|
||||||
|
|
||||||
if (roi != NULL) {
|
if (roi != NULL) {
|
||||||
roi->SetVisibility(FALSE);
|
roi->SetVisibility(FALSE);
|
||||||
@@ -313,7 +313,7 @@ void LegoAnimPresenter::FUN_100695c0()
|
|||||||
|
|
||||||
strlwr(lodName);
|
strlwr(lodName);
|
||||||
|
|
||||||
CharacterManager()->FUN_10085210(actorName, lodName, FALSE);
|
CharacterManager()->CreateAutoROI(actorName, lodName, FALSE);
|
||||||
FUN_100698b0(rois, actorName);
|
FUN_100698b0(rois, actorName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -530,8 +530,8 @@ void LegoAnimPresenter::FUN_1006aa60()
|
|||||||
while (cursor.Next(roi)) {
|
while (cursor.Next(roi)) {
|
||||||
const char* name = roi->GetName();
|
const char* name = roi->GetName();
|
||||||
|
|
||||||
if (m_unk0x96 || !CharacterManager()->Exists(name)) {
|
if (m_unk0x96 || !CharacterManager()->IsActor(name)) {
|
||||||
CharacterManager()->FUN_10083c30(name);
|
CharacterManager()->ReleaseActor(name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -224,7 +224,7 @@ MxResult LegoModelPresenter::FUN_1007ff70(
|
|||||||
|
|
||||||
if (p_entity != NULL) {
|
if (p_entity != NULL) {
|
||||||
p_entity->SetROI(m_roi, TRUE, TRUE);
|
p_entity->SetROI(m_roi, TRUE, TRUE);
|
||||||
p_entity->ClearFlag(LegoEntity::c_bit2);
|
p_entity->ClearFlag(LegoEntity::c_managerOwned);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
p_world->GetROIList().push_back(m_roi);
|
p_world->GetROIList().push_back(m_roi);
|
||||||
@@ -249,9 +249,10 @@ void LegoModelPresenter::ReadyTickle()
|
|||||||
((LegoEntityPresenter*) m_compositePresenter)
|
((LegoEntityPresenter*) m_compositePresenter)
|
||||||
->GetInternalEntity()
|
->GetInternalEntity()
|
||||||
->SetFlags(
|
->SetFlags(
|
||||||
((LegoEntityPresenter*) m_compositePresenter)->GetInternalEntity()->GetFlags() & ~LegoEntity::c_bit2
|
((LegoEntityPresenter*) m_compositePresenter)->GetInternalEntity()->GetFlags() &
|
||||||
|
~LegoEntity::c_managerOwned
|
||||||
);
|
);
|
||||||
((LegoEntityPresenter*) m_compositePresenter)->GetInternalEntity()->SetType(LegoEntity::e_character);
|
((LegoEntityPresenter*) m_compositePresenter)->GetInternalEntity()->SetType(LegoEntity::e_actor);
|
||||||
}
|
}
|
||||||
|
|
||||||
ParseExtra();
|
ParseExtra();
|
||||||
@@ -276,7 +277,7 @@ void LegoModelPresenter::ReadyTickle()
|
|||||||
->GetInternalEntity()
|
->GetInternalEntity()
|
||||||
->SetFlags(
|
->SetFlags(
|
||||||
((LegoEntityPresenter*) m_compositePresenter)->GetInternalEntity()->GetFlags() &
|
((LegoEntityPresenter*) m_compositePresenter)->GetInternalEntity()->GetFlags() &
|
||||||
~LegoEntity::c_bit2
|
~LegoEntity::c_managerOwned
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -306,7 +307,7 @@ void LegoModelPresenter::ParseExtra()
|
|||||||
char* token = strtok(output, g_parseExtraTokens);
|
char* token = strtok(output, g_parseExtraTokens);
|
||||||
|
|
||||||
if (m_roi == NULL) {
|
if (m_roi == NULL) {
|
||||||
m_roi = CharacterManager()->GetROI(token, FALSE);
|
m_roi = CharacterManager()->GetActorROI(token, FALSE);
|
||||||
m_addedToView = FALSE;
|
m_addedToView = FALSE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -52,7 +52,7 @@ void LegoPhonemePresenter::StartingTickle()
|
|||||||
m_unk0x84 = TRUE;
|
m_unk0x84 = TRUE;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
entityROI = CharacterManager()->GetROI(m_roiName.GetData(), TRUE);
|
entityROI = CharacterManager()->GetActorROI(m_roiName.GetData(), TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
head = entityROI->FindChildROI("head", entityROI);
|
head = entityROI->FindChildROI("head", entityROI);
|
||||||
@@ -143,7 +143,7 @@ void LegoPhonemePresenter::EndAction()
|
|||||||
roi = FindROI(m_roiName.GetData());
|
roi = FindROI(m_roiName.GetData());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
roi = CharacterManager()->GetROI(m_roiName.GetData(), TRUE);
|
roi = CharacterManager()->GetActorROI(m_roiName.GetData(), TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (roi != NULL) {
|
if (roi != NULL) {
|
||||||
@@ -151,7 +151,7 @@ void LegoPhonemePresenter::EndAction()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!m_unk0x84) {
|
if (!m_unk0x84) {
|
||||||
CharacterManager()->FUN_10083c30(m_roiName.GetData());
|
CharacterManager()->ReleaseActor(m_roiName.GetData());
|
||||||
}
|
}
|
||||||
|
|
||||||
TextureContainer()->EraseCached(phoneme->VTable0x10());
|
TextureContainer()->EraseCached(phoneme->VTable0x10());
|
||||||
@@ -164,7 +164,7 @@ void LegoPhonemePresenter::EndAction()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!m_unk0x84) {
|
if (!m_unk0x84) {
|
||||||
CharacterManager()->FUN_10083c30(m_roiName.GetData());
|
CharacterManager()->ReleaseActor(m_roiName.GetData());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1308,7 +1308,7 @@ void Infocenter::Reset()
|
|||||||
PlantManager()->FUN_10027120();
|
PlantManager()->FUN_10027120();
|
||||||
BuildingManager()->FUN_10030590();
|
BuildingManager()->FUN_10030590();
|
||||||
AnimationManager()->Reset(FALSE);
|
AnimationManager()->Reset(FALSE);
|
||||||
CharacterManager()->FUN_100832a0();
|
CharacterManager()->ReleaseAllActors();
|
||||||
GameState()->SetCurrentAct(LegoGameState::e_act1);
|
GameState()->SetCurrentAct(LegoGameState::e_act1);
|
||||||
GameState()->SetPreviousArea(LegoGameState::e_undefined);
|
GameState()->SetPreviousArea(LegoGameState::e_undefined);
|
||||||
GameState()->SetUnknown0x42c(LegoGameState::e_undefined);
|
GameState()->SetUnknown0x42c(LegoGameState::e_undefined);
|
||||||
|
Reference in New Issue
Block a user