2023-06-29 04:10:08 -04:00
|
|
|
#include "act1state.h"
|
|
|
|
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "legoutils.h"
|
2024-03-09 10:49:13 -05:00
|
|
|
|
2024-02-02 20:03:52 -05:00
|
|
|
DECOMP_SIZE_ASSERT(Act1State, 0x26c)
|
|
|
|
DECOMP_SIZE_ASSERT(Act1State::NamedPlane, 0x4c)
|
|
|
|
|
|
|
|
// GLOBAL: ISLE 0x100f37f0
|
|
|
|
MxS32 g_unk0x100f37f0[] = {
|
|
|
|
Act1State::e_unk953,
|
|
|
|
Act1State::e_unk954,
|
|
|
|
Act1State::e_unk955,
|
|
|
|
};
|
|
|
|
|
2024-03-18 12:31:22 -04:00
|
|
|
extern MxAtomId* g_isleScript;
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x100334b0
|
2024-02-02 20:03:52 -05:00
|
|
|
Act1State::Act1State() : m_unk0x00c(0), m_unk0x00e(0), m_unk0x008(NULL), m_unk0x010(0)
|
2024-01-13 15:42:09 -05:00
|
|
|
{
|
2024-03-18 15:00:58 -04:00
|
|
|
m_unk0x01e = FALSE;
|
2024-02-02 20:03:52 -05:00
|
|
|
m_unk0x018 = 1;
|
|
|
|
m_unk0x010 = 0;
|
2024-03-18 12:31:22 -04:00
|
|
|
m_planeActive = FALSE;
|
2024-02-02 20:03:52 -05:00
|
|
|
m_unk0x00e = 0;
|
2024-03-17 13:26:41 -04:00
|
|
|
m_unk0x01f = FALSE;
|
2024-02-02 20:03:52 -05:00
|
|
|
m_unk0x008 = g_unk0x100f37f0;
|
|
|
|
m_unk0x014 = -1;
|
|
|
|
m_unk0x022 = 0;
|
|
|
|
m_unk0x154 = NULL;
|
|
|
|
m_unk0x158 = NULL;
|
|
|
|
m_unk0x15c = NULL;
|
|
|
|
m_unk0x160 = NULL;
|
|
|
|
m_unk0x1b0 = NULL;
|
|
|
|
m_unk0x021 = 1;
|
2024-03-18 12:31:22 -04:00
|
|
|
m_elevFloor = Act1State::c_floor1;
|
2024-02-02 20:03:52 -05:00
|
|
|
m_unk0x00c = _countof(g_unk0x100f37f0);
|
|
|
|
m_unk0x1b4 = NULL;
|
|
|
|
m_unk0x1b8 = NULL;
|
|
|
|
m_unk0x208 = NULL;
|
|
|
|
m_unk0x20c = NULL;
|
|
|
|
m_unk0x25c = NULL;
|
|
|
|
m_unk0x260 = NULL;
|
|
|
|
m_unk0x264 = NULL;
|
|
|
|
m_unk0x268 = NULL;
|
|
|
|
SetFlag();
|
2024-01-13 15:42:09 -05:00
|
|
|
}
|
|
|
|
|
2024-02-02 20:03:52 -05:00
|
|
|
// FUNCTION: LEGO1 0x10033ac0
|
2024-04-21 09:42:08 -04:00
|
|
|
MxResult Act1State::Serialize(LegoFile* p_legoFile)
|
2024-01-20 18:04:46 -05:00
|
|
|
{
|
2024-04-21 09:42:08 -04:00
|
|
|
LegoState::Serialize(p_legoFile);
|
2024-02-02 20:03:52 -05:00
|
|
|
|
|
|
|
m_unk0x024.Serialize(p_legoFile);
|
|
|
|
m_unk0x070.Serialize(p_legoFile);
|
|
|
|
m_unk0x0bc.Serialize(p_legoFile);
|
|
|
|
m_unk0x108.Serialize(p_legoFile);
|
|
|
|
m_unk0x164.Serialize(p_legoFile);
|
|
|
|
m_unk0x1bc.Serialize(p_legoFile);
|
|
|
|
m_unk0x210.Serialize(p_legoFile);
|
|
|
|
|
|
|
|
if (p_legoFile->IsWriteMode()) {
|
|
|
|
if (m_unk0x108.GetName()->Compare("") != 0) {
|
|
|
|
if (m_unk0x154) {
|
|
|
|
WriteNamedTexture(p_legoFile, m_unk0x154);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_1003f540(p_legoFile, "chwind.gif");
|
|
|
|
}
|
|
|
|
if (m_unk0x158) {
|
|
|
|
WriteNamedTexture(p_legoFile, m_unk0x158);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_1003f540(p_legoFile, "chjetl.gif");
|
|
|
|
}
|
|
|
|
if (m_unk0x15c) {
|
|
|
|
WriteNamedTexture(p_legoFile, m_unk0x15c);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_1003f540(p_legoFile, "chjetr.gif");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (m_unk0x164.GetName()->Compare("") != 0) {
|
|
|
|
if (m_unk0x1b0) {
|
|
|
|
WriteNamedTexture(p_legoFile, m_unk0x1b0);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_1003f540(p_legoFile, "jsfrnt.gif");
|
|
|
|
}
|
|
|
|
if (m_unk0x1b4) {
|
|
|
|
WriteNamedTexture(p_legoFile, m_unk0x1b4);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_1003f540(p_legoFile, "jswnsh.gif");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (m_unk0x1bc.GetName()->Compare("") != 0) {
|
|
|
|
if (m_unk0x208) {
|
|
|
|
WriteNamedTexture(p_legoFile, m_unk0x208);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_1003f540(p_legoFile, "dbfrfn.gif");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (m_unk0x210.GetName()->Compare("") != 0) {
|
|
|
|
if (m_unk0x25c) {
|
|
|
|
WriteNamedTexture(p_legoFile, m_unk0x25c);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_1003f540(p_legoFile, "rcfrnt.gif");
|
|
|
|
}
|
|
|
|
if (m_unk0x260) {
|
|
|
|
WriteNamedTexture(p_legoFile, m_unk0x260);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_1003f540(p_legoFile, "rcback.gif");
|
|
|
|
}
|
|
|
|
if (m_unk0x264) {
|
|
|
|
WriteNamedTexture(p_legoFile, m_unk0x264);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
FUN_1003f540(p_legoFile, "rctail.gif");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
p_legoFile->Write(&m_unk0x010, sizeof(undefined2));
|
|
|
|
p_legoFile->Write(&m_unk0x022, sizeof(undefined));
|
|
|
|
}
|
|
|
|
else if (p_legoFile->IsReadMode()) {
|
|
|
|
if (m_unk0x108.GetName()->Compare("") != 0) {
|
|
|
|
m_unk0x154 = ReadNamedTexture(p_legoFile);
|
|
|
|
if (m_unk0x154 == NULL) {
|
|
|
|
return FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_unk0x158 = ReadNamedTexture(p_legoFile);
|
|
|
|
if (m_unk0x158 == NULL) {
|
|
|
|
return FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_unk0x15c = ReadNamedTexture(p_legoFile);
|
|
|
|
if (m_unk0x15c == NULL) {
|
|
|
|
return FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (m_unk0x164.GetName()->Compare("") != 0) {
|
|
|
|
m_unk0x1b0 = ReadNamedTexture(p_legoFile);
|
|
|
|
if (m_unk0x1b0 == NULL) {
|
|
|
|
return FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_unk0x1b4 = ReadNamedTexture(p_legoFile);
|
|
|
|
if (m_unk0x1b4 == NULL) {
|
|
|
|
return FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (m_unk0x1bc.GetName()->Compare("") != 0) {
|
|
|
|
m_unk0x208 = ReadNamedTexture(p_legoFile);
|
|
|
|
if (m_unk0x208 == NULL) {
|
|
|
|
return FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (m_unk0x210.GetName()->Compare("") != 0) {
|
|
|
|
m_unk0x25c = ReadNamedTexture(p_legoFile);
|
|
|
|
if (m_unk0x25c == NULL) {
|
|
|
|
return FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_unk0x260 = ReadNamedTexture(p_legoFile);
|
|
|
|
if (m_unk0x260 == NULL) {
|
|
|
|
return FAILURE;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_unk0x264 = ReadNamedTexture(p_legoFile);
|
|
|
|
if (m_unk0x264 == NULL) {
|
|
|
|
return FAILURE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
p_legoFile->Read(&m_unk0x010, sizeof(undefined2));
|
|
|
|
p_legoFile->Read(&m_unk0x022, sizeof(undefined));
|
|
|
|
}
|
|
|
|
|
2024-01-20 18:04:46 -05:00
|
|
|
// TODO
|
|
|
|
return SUCCESS;
|
|
|
|
}
|
|
|
|
|
2024-03-18 12:31:22 -04:00
|
|
|
// STUB: LEGO1 0x10034660
|
|
|
|
void Act1State::FUN_10034660()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x100346a0
|
|
|
|
void Act1State::FUN_100346a0()
|
|
|
|
{
|
|
|
|
if (m_unk0x014 != -1) {
|
|
|
|
InvokeAction(Extra::e_stop, *g_isleScript, m_unk0x014, NULL);
|
|
|
|
m_unk0x014 = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-02-02 20:03:52 -05:00
|
|
|
// FUNCTION: LEGO1 0x100346d0
|
2024-01-20 18:04:46 -05:00
|
|
|
MxBool Act1State::SetFlag()
|
|
|
|
{
|
2024-02-02 20:03:52 -05:00
|
|
|
m_unk0x024.SetName("");
|
|
|
|
m_unk0x070.SetName("");
|
|
|
|
m_unk0x0bc.SetName("");
|
|
|
|
m_unk0x022 = 0;
|
|
|
|
m_unk0x108.SetName("");
|
|
|
|
|
|
|
|
if (m_unk0x154) {
|
|
|
|
delete m_unk0x154;
|
|
|
|
m_unk0x154 = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_unk0x158) {
|
|
|
|
delete m_unk0x158;
|
|
|
|
m_unk0x158 = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_unk0x15c) {
|
|
|
|
delete m_unk0x15c;
|
|
|
|
m_unk0x15c = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_unk0x160) {
|
|
|
|
delete m_unk0x160;
|
|
|
|
m_unk0x160 = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_unk0x164.SetName("");
|
|
|
|
|
|
|
|
if (m_unk0x1b0) {
|
|
|
|
delete m_unk0x1b0;
|
|
|
|
m_unk0x1b0 = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_unk0x1b4) {
|
|
|
|
delete m_unk0x1b4;
|
|
|
|
m_unk0x1b4 = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_unk0x1b8) {
|
|
|
|
delete m_unk0x1b8;
|
|
|
|
m_unk0x1b8 = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_unk0x1bc.SetName("");
|
|
|
|
|
|
|
|
if (m_unk0x208) {
|
|
|
|
delete m_unk0x208;
|
|
|
|
m_unk0x208 = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_unk0x20c) {
|
|
|
|
delete m_unk0x20c;
|
|
|
|
m_unk0x20c = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
m_unk0x210.SetName("");
|
|
|
|
|
|
|
|
if (m_unk0x25c) {
|
|
|
|
delete m_unk0x25c;
|
|
|
|
m_unk0x25c = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_unk0x260) {
|
|
|
|
delete m_unk0x260;
|
|
|
|
m_unk0x260 = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_unk0x264) {
|
|
|
|
delete m_unk0x264;
|
|
|
|
m_unk0x264 = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (m_unk0x268) {
|
|
|
|
delete m_unk0x268;
|
|
|
|
m_unk0x268 = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
return TRUE;
|
2024-01-20 18:04:46 -05:00
|
|
|
}
|
|
|
|
|
2024-03-16 14:20:44 -04:00
|
|
|
// STUB: LEGO1 0x10034b60
|
|
|
|
void Act1State::FUN_10034b60()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
2024-01-13 15:42:09 -05:00
|
|
|
// STUB: LEGO1 0x10034d00
|
|
|
|
void Act1State::FUN_10034d00()
|
2023-06-29 04:10:08 -04:00
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
// TODO
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|