mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-27 18:21:15 +00:00
Add beta annotations and adjust style/naming
This commit is contained in:
parent
d2d7b706ea
commit
622720ebfd
@ -34,13 +34,22 @@ struct LegoBuildingInfo {
|
|||||||
float m_x; // 0x1c
|
float m_x; // 0x1c
|
||||||
float m_y; // 0x20
|
float m_y; // 0x20
|
||||||
float m_z; // 0x24
|
float m_z; // 0x24
|
||||||
LegoPathBoundary* m_pathBoundary; // 0x28
|
LegoPathBoundary* m_boundary; // 0x28
|
||||||
};
|
};
|
||||||
|
|
||||||
// VTABLE: LEGO1 0x100d6f50
|
// VTABLE: LEGO1 0x100d6f50
|
||||||
// SIZE 0x30
|
// SIZE 0x30
|
||||||
class LegoBuildingManager : public MxCore {
|
class LegoBuildingManager : public MxCore {
|
||||||
public:
|
public:
|
||||||
|
// SIZE 0x14
|
||||||
|
struct AnimEntry {
|
||||||
|
LegoEntity* m_entity; // 0x00
|
||||||
|
LegoROI* m_roi; // 0x04
|
||||||
|
LegoTime m_time; // 0x08
|
||||||
|
float m_unk0x0c; // 0x0c
|
||||||
|
MxBool m_muted; // 0x10
|
||||||
|
};
|
||||||
|
|
||||||
LegoBuildingManager();
|
LegoBuildingManager();
|
||||||
~LegoBuildingManager() override;
|
~LegoBuildingManager() override;
|
||||||
|
|
||||||
@ -72,25 +81,18 @@ class LegoBuildingManager : public MxCore {
|
|||||||
MxBool FUN_10030000(LegoEntity* p_entity);
|
MxBool FUN_10030000(LegoEntity* p_entity);
|
||||||
MxBool FUN_10030030(MxS32 p_index);
|
MxBool FUN_10030030(MxS32 p_index);
|
||||||
MxBool FUN_10030110(LegoBuildingInfo* p_data);
|
MxBool FUN_10030110(LegoBuildingInfo* p_data);
|
||||||
void ScheduleAnimation(LegoEntity*, MxU32 p_length, MxBool p_haveSound, MxBool);
|
void ScheduleAnimation(LegoEntity* p_entity, MxU32 p_length, MxBool p_haveSound, MxBool p_unk0x28);
|
||||||
void FUN_10030590();
|
void FUN_10030590();
|
||||||
void AdjustHeight(MxS32 p_index);
|
void AdjustHeight(MxS32 p_index);
|
||||||
MxResult FUN_10030630();
|
MxResult FUN_10030630();
|
||||||
LegoBuildingInfo* GetInfoArray(int* p_length);
|
LegoBuildingInfo* GetInfoArray(MxS32& p_length);
|
||||||
void FUN_100307b0(LegoEntity*, MxS32);
|
void FUN_100307b0(LegoEntity* p_entity, MxS32 p_adjust);
|
||||||
|
|
||||||
static void FUN_10030800();
|
static void FUN_10030800();
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x1002f940
|
// SYNTHETIC: LEGO1 0x1002f940
|
||||||
// LegoBuildingManager::`scalar deleting destructor'
|
// LegoBuildingManager::`scalar deleting destructor'
|
||||||
|
|
||||||
struct AnimEntry {
|
|
||||||
LegoEntity* m_entity;
|
|
||||||
LegoROI* m_roi;
|
|
||||||
LegoTime m_time;
|
|
||||||
float m_float;
|
|
||||||
MxBool m_muted;
|
|
||||||
};
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static char* g_customizeAnimFile;
|
static char* g_customizeAnimFile;
|
||||||
|
|
||||||
|
|||||||
@ -37,7 +37,7 @@ class LegoCacheSound : public MxCore {
|
|||||||
MxResult FUN_10006a30(const char* p_str, MxBool);
|
MxResult FUN_10006a30(const char* p_str, MxBool);
|
||||||
void FUN_10006b80();
|
void FUN_10006b80();
|
||||||
void FUN_10006be0();
|
void FUN_10006be0();
|
||||||
void FUN_10006cb0(undefined4, undefined4);
|
void FUN_10006cb0(undefined4 p_und1, undefined4 p_und2);
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x10006610
|
// SYNTHETIC: LEGO1 0x10006610
|
||||||
// LegoCacheSound::`scalar deleting destructor'
|
// LegoCacheSound::`scalar deleting destructor'
|
||||||
|
|||||||
@ -150,9 +150,9 @@ void LegoCacheSound::FUN_10006be0()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10006cb0
|
// FUNCTION: LEGO1 0x10006cb0
|
||||||
void LegoCacheSound::FUN_10006cb0(undefined4 p_unk0x1, undefined4 p_unk0x2)
|
void LegoCacheSound::FUN_10006cb0(undefined4 p_und1, undefined4 p_und2)
|
||||||
{
|
{
|
||||||
m_unk0x10.FUN_10011cf0(p_unk0x1, p_unk0x2);
|
m_unk0x10.FUN_10011cf0(p_und1, p_und2);
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10006cd0
|
// FUNCTION: LEGO1 0x10006cd0
|
||||||
|
|||||||
@ -297,7 +297,7 @@ void LegoBuildingManager::UpdatePosition(MxS32 p_index, LegoWorld* p_world)
|
|||||||
LegoROI* roi = entity->GetROI();
|
LegoROI* roi = entity->GetROI();
|
||||||
AdjustHeight(p_index);
|
AdjustHeight(p_index);
|
||||||
MxMatrix mat = roi->GetLocal2World();
|
MxMatrix mat = roi->GetLocal2World();
|
||||||
mat.SetY(g_buildingInfo[p_index].m_unk0x014);
|
mat[3][1] = g_buildingInfo[p_index].m_unk0x014;
|
||||||
roi->FUN_100a46b0(mat);
|
roi->FUN_100a46b0(mat);
|
||||||
VideoManager()->Get3DManager()->Moved(*roi);
|
VideoManager()->Get3DManager()->Moved(*roi);
|
||||||
}
|
}
|
||||||
@ -306,17 +306,18 @@ void LegoBuildingManager::UpdatePosition(MxS32 p_index, LegoWorld* p_world)
|
|||||||
// FUNCTION: LEGO1 0x1002fb30
|
// FUNCTION: LEGO1 0x1002fb30
|
||||||
void LegoBuildingManager::FUN_1002fb30()
|
void LegoBuildingManager::FUN_1002fb30()
|
||||||
{
|
{
|
||||||
for (MxU32 i = 0; i < _countof(g_buildingInfo); i++) {
|
MxU32 i;
|
||||||
|
|
||||||
|
for (i = 0; i < _countof(g_buildingInfo); i++) {
|
||||||
g_buildingInfo[i].m_entity = NULL;
|
g_buildingInfo[i].m_entity = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_unk0x09 = 0;
|
m_unk0x09 = 0;
|
||||||
// Weird if statement but the obvious != 0 does not produce
|
|
||||||
// the 100% match this does.
|
for (i = 0; i < m_numEntries; i++) {
|
||||||
if ((MxU32) m_numEntries >= 0) {
|
|
||||||
for (MxU32 i = 0; i < m_numEntries; i++) {
|
|
||||||
delete m_entries[i];
|
delete m_entries[i];
|
||||||
}
|
}
|
||||||
}
|
|
||||||
m_numEntries = 0;
|
m_numEntries = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -529,28 +530,36 @@ MxBool LegoBuildingManager::FUN_1002fed0(LegoEntity* p_entity)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002ff00
|
// FUNCTION: LEGO1 0x1002ff00
|
||||||
|
// FUNCTION: BETA10 0x1006432d
|
||||||
MxU32 LegoBuildingManager::GetBuildingEntityId(LegoEntity* p_entity)
|
MxU32 LegoBuildingManager::GetBuildingEntityId(LegoEntity* p_entity)
|
||||||
{
|
{
|
||||||
LegoBuildingInfo* data = GetInfo(p_entity);
|
LegoBuildingInfo* info = GetInfo(p_entity);
|
||||||
if (data != NULL && (data->m_flags & 0x4) != 0) {
|
|
||||||
return g_buildingEntityId[data - g_buildingInfo] + data->m_cycle2;
|
if (info != NULL && info->m_flags & LegoBuildingInfo::c_bit3) {
|
||||||
|
return g_buildingEntityId[info - g_buildingInfo] + info->m_cycle2;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x1002ff40
|
// FUNCTION: LEGO1 0x1002ff40
|
||||||
|
// FUNCTION: BETA10 0x10064398
|
||||||
MxU32 LegoBuildingManager::FUN_1002ff40(LegoEntity* p_entity, MxBool p_state)
|
MxU32 LegoBuildingManager::FUN_1002ff40(LegoEntity* p_entity, MxBool p_state)
|
||||||
{
|
{
|
||||||
LegoBuildingInfo* data = GetInfo(p_entity);
|
LegoBuildingInfo* info = GetInfo(p_entity);
|
||||||
if (data == NULL || (data->m_flags & 0x2) == 0) {
|
|
||||||
|
if (info == NULL || !(info->m_flags & LegoBuildingInfo::c_bit2)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (p_state) {
|
if (p_state) {
|
||||||
return data->m_cycle3 + g_cycleLengthOffset3;
|
return info->m_cycle3 + g_cycleLengthOffset3;
|
||||||
}
|
}
|
||||||
if (data != NULL) {
|
|
||||||
return data->m_cycle1 + g_cycleLengthOffset1;
|
if (info != NULL) {
|
||||||
|
return info->m_cycle1 + g_cycleLengthOffset1;
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -604,25 +613,28 @@ MxBool LegoBuildingManager::FUN_10030110(LegoBuildingInfo* p_data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10030150
|
// FUNCTION: LEGO1 0x10030150
|
||||||
void LegoBuildingManager::ScheduleAnimation(LegoEntity* p_entity, MxU32 p_length, MxBool p_haveSound, MxBool p_extra)
|
void LegoBuildingManager::ScheduleAnimation(LegoEntity* p_entity, MxU32 p_length, MxBool p_haveSound, MxBool p_unk0x28)
|
||||||
{
|
{
|
||||||
m_world = CurrentWorld();
|
m_world = CurrentWorld();
|
||||||
|
|
||||||
if (p_haveSound) {
|
if (p_haveSound) {
|
||||||
m_sound = SoundManager()->GetCacheSoundManager()->FUN_1003d170("bcrash");
|
m_sound = SoundManager()->GetCacheSoundManager()->FUN_1003d170("bcrash");
|
||||||
m_sound->FUN_10006cb0(0x23, 0x3c);
|
m_sound->FUN_10006cb0(35, 60);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_numEntries == 0) {
|
if (m_numEntries == 0) {
|
||||||
m_unk0x28 = p_extra;
|
m_unk0x28 = p_unk0x28;
|
||||||
TickleManager()->RegisterClient(this, 0x32);
|
TickleManager()->RegisterClient(this, 50);
|
||||||
}
|
}
|
||||||
m_entries[m_numEntries] = new AnimEntry;
|
|
||||||
AnimEntry* entry = m_entries[m_numEntries];
|
AnimEntry* entry = m_entries[m_numEntries] = new AnimEntry;
|
||||||
m_numEntries++;
|
m_numEntries++;
|
||||||
|
|
||||||
entry->m_entity = p_entity;
|
entry->m_entity = p_entity;
|
||||||
entry->m_roi = p_entity->GetROI();
|
entry->m_roi = p_entity->GetROI();
|
||||||
entry->m_time = Timer()->GetTime() + p_length + 1000;
|
entry->m_time = Timer()->GetTime() + p_length + 1000;
|
||||||
entry->m_float = entry->m_roi->GetLocal2World().GetY();
|
entry->m_unk0x0c = entry->m_roi->GetLocal2World()[3][1];
|
||||||
entry->m_muted = (p_haveSound == FALSE);
|
entry->m_muted = p_haveSound == FALSE;
|
||||||
FUN_100307b0(p_entity, -2);
|
FUN_100307b0(p_entity, -2);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -631,6 +643,7 @@ MxResult LegoBuildingManager::Tickle()
|
|||||||
{
|
{
|
||||||
// WIP, included some of this to understand the AnimEntry array.
|
// WIP, included some of this to understand the AnimEntry array.
|
||||||
LegoTime time = Timer()->GetTime();
|
LegoTime time = Timer()->GetTime();
|
||||||
|
|
||||||
if (m_numEntries != 0) {
|
if (m_numEntries != 0) {
|
||||||
if (m_numEntries > 0) {
|
if (m_numEntries > 0) {
|
||||||
for (MxS32 i = 0; i < m_numEntries; i++) {
|
for (MxS32 i = 0; i < m_numEntries; i++) {
|
||||||
@ -644,22 +657,25 @@ MxResult LegoBuildingManager::Tickle()
|
|||||||
else {
|
else {
|
||||||
TickleManager()->UnregisterClient(this);
|
TickleManager()->UnregisterClient(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
return SUCCESS;
|
return SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10030590
|
// FUNCTION: LEGO1 0x10030590
|
||||||
|
// FUNCTION: BETA10 0x1006474c
|
||||||
void LegoBuildingManager::FUN_10030590()
|
void LegoBuildingManager::FUN_10030590()
|
||||||
{
|
{
|
||||||
for (MxS32 i = 0; i < _countof(g_buildingInfo); i++) {
|
for (MxS32 i = 0; i < _countof(g_buildingInfo); i++) {
|
||||||
g_buildingInfo[i].m_unk0x11 = -1;
|
g_buildingInfo[i].m_unk0x11 = -1;
|
||||||
g_buildingInfo[i].m_initialUnk0x11 = -1;
|
g_buildingInfo[i].m_initialUnk0x11 = -1;
|
||||||
AdjustHeight(i);
|
AdjustHeight(i);
|
||||||
|
|
||||||
if (g_buildingInfo[i].m_entity != NULL) {
|
if (g_buildingInfo[i].m_entity != NULL) {
|
||||||
LegoROI* roi = g_buildingInfo[i].m_entity->GetROI();
|
LegoROI* roi = g_buildingInfo[i].m_entity->GetROI();
|
||||||
MxMatrix matrix = roi->GetLocal2World();
|
MxMatrix mat = roi->GetLocal2World();
|
||||||
matrix.SetY(g_buildingInfo[i].m_unk0x014);
|
mat[3][1] = g_buildingInfo[i].m_unk0x014;
|
||||||
roi->FUN_100a46b0(matrix);
|
roi->FUN_100a46b0(mat);
|
||||||
VideoManager()->Get3DManager()->GetLego3DView()->Moved(*roi);
|
VideoManager()->Get3DManager()->Moved(*roi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -671,27 +687,30 @@ MxResult LegoBuildingManager::FUN_10030630()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10030790
|
// FUNCTION: LEGO1 0x10030790
|
||||||
LegoBuildingInfo* LegoBuildingManager::GetInfoArray(int* p_length)
|
LegoBuildingInfo* LegoBuildingManager::GetInfoArray(MxS32& p_length)
|
||||||
{
|
{
|
||||||
if (m_unk0x09 == 0) {
|
if (m_unk0x09 == 0) {
|
||||||
FUN_10030630();
|
FUN_10030630();
|
||||||
}
|
}
|
||||||
*p_length = _countof(g_buildingInfo);
|
|
||||||
|
p_length = _countof(g_buildingInfo);
|
||||||
return g_buildingInfo;
|
return g_buildingInfo;
|
||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100307b0
|
// FUNCTION: LEGO1 0x100307b0
|
||||||
void LegoBuildingManager::FUN_100307b0(LegoEntity* p_entity, MxS32 p_adjust)
|
void LegoBuildingManager::FUN_100307b0(LegoEntity* p_entity, MxS32 p_adjust)
|
||||||
{
|
{
|
||||||
LegoBuildingInfo* data = GetInfo(p_entity);
|
LegoBuildingInfo* info = GetInfo(p_entity);
|
||||||
if (data != NULL) {
|
|
||||||
if (data->m_unk0x11 < 0) {
|
if (info != NULL) {
|
||||||
data->m_unk0x11 = g_buildingInfoDownshift[data - g_buildingInfo];
|
if (info->m_unk0x11 < 0) {
|
||||||
|
info->m_unk0x11 = g_buildingInfoDownshift[info - g_buildingInfo];
|
||||||
}
|
}
|
||||||
if (data->m_unk0x11 > 0) {
|
|
||||||
data->m_unk0x11 += p_adjust;
|
if (info->m_unk0x11 > 0) {
|
||||||
if (data->m_unk0x11 <= 1 && p_adjust < 0) {
|
info->m_unk0x11 += p_adjust;
|
||||||
data->m_unk0x11 = 0;
|
if (info->m_unk0x11 <= 1 && p_adjust < 0) {
|
||||||
|
info->m_unk0x11 = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,6 +68,7 @@ MxResult LegoPathController::FUN_10046b30(LegoPathBoundary** p_path, MxS32& p_va
|
|||||||
}
|
}
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x10046b50
|
// FUNCTION: LEGO1 0x10046b50
|
||||||
|
// FUNCTION: BETA10 0x100b7531
|
||||||
LegoPathBoundary* LegoPathController::GetPathBoundary(const char* p_name)
|
LegoPathBoundary* LegoPathController::GetPathBoundary(const char* p_name)
|
||||||
{
|
{
|
||||||
for (MxS32 i = 0; i < m_numL; i++) {
|
for (MxS32 i = 0; i < m_numL; i++) {
|
||||||
@ -75,6 +76,7 @@ LegoPathBoundary* LegoPathController::GetPathBoundary(const char* p_name)
|
|||||||
return &m_unk0x08[i];
|
return &m_unk0x08[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -147,14 +147,6 @@ class Matrix4 {
|
|||||||
float* operator[](int idx) { return m_data[idx]; }
|
float* operator[](int idx) { return m_data[idx]; }
|
||||||
const float* operator[](int idx) const { return m_data[idx]; }
|
const float* operator[](int idx) const { return m_data[idx]; }
|
||||||
|
|
||||||
inline void SetX(float p_x) { m_data[3][0] = p_x; }
|
|
||||||
inline void SetY(float p_y) { m_data[3][1] = p_y; }
|
|
||||||
inline void SetZ(float p_z) { m_data[3][2] = p_z; }
|
|
||||||
|
|
||||||
inline float GetX() const { return m_data[3][0]; }
|
|
||||||
inline float GetY() const { return m_data[3][1]; }
|
|
||||||
inline float GetZ() const { return m_data[3][2]; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
float (*m_data)[4];
|
float (*m_data)[4];
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user