isle-portable/LEGO1/lego/legoomni/src/act1/act1state.cpp

296 lines
5.5 KiB
C++
Raw Normal View History

#include "act1state.h"
#include "legoutils.h"
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,
};
extern MxAtomId* g_isleScript;
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// STUB: LEGO1 0x100334b0
Act1State::Act1State() : m_unk0x00c(0), m_unk0x00e(0), m_unk0x008(NULL), m_unk0x010(0)
{
m_unk0x01e = FALSE;
m_unk0x018 = 1;
m_unk0x010 = 0;
m_planeActive = FALSE;
m_unk0x00e = 0;
m_unk0x01f = FALSE;
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;
m_elevFloor = Act1State::c_floor1;
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();
}
// FUNCTION: LEGO1 0x10033ac0
MxResult Act1State::Serialize(LegoFile* p_legoFile)
Enforce vtable match (#464) * vtable enforce * Vtable progress * IslePathActor subclasses * LegoState subclasses * LegoWorld subclasses * Presenter progress * Remaining presenters * All but two that need new files * Merge into vtable branch (#3) * Implement MxDisplaySurface::VTable0x44 (#467) * Update mxdisplaysurface.cpp * add arguments to header * Fix glitched bitmaps * WIP fixes * Match * Fix * Changes * Fixes --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * Implmement PoliceState::VTable0x1c (#468) * Implmement PoliceState::VTable0x1c * Fixes --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * Implement Lego3DView::Render (#470) * Implement Lego3DView::Render * use MxDouble * Revert "use MxDouble" This reverts commit a006b60e2066b79ded3e15e143a302d8fd707deb. * Begin work on Police class (#469) * Begin work on Police class * Use JukeBox::e_policeStation value * Fixes --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * Implement MxDisplaySurface::CreateCursorSurface (#471) * Update mxdisplaysurface.cpp * Fixes * Update legovideomanager.cpp * Match to 100% --------- Co-authored-by: Christian Semmler <mail@csemmler.com> --------- Co-authored-by: Misha <106913236+MishaProductions@users.noreply.github.com> Co-authored-by: Christian Semmler <mail@csemmler.com> Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com> * Police fix * Finish * motocycle lower case * Update historybook.h * Update hospitalstate.h * Update jetski.h * Update legoinputmanager.h * Update legolocomotionanimpresenter.h * Update pizza.h * Update act3shark.h * Update ambulancemissionstate.h * Update bumpbouy.h * Update doors.h --------- Co-authored-by: Misha <106913236+MishaProductions@users.noreply.github.com> Co-authored-by: Christian Semmler <mail@csemmler.com> Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com>
2024-01-20 18:04:46 -05:00
{
LegoState::Serialize(p_legoFile);
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));
}
Enforce vtable match (#464) * vtable enforce * Vtable progress * IslePathActor subclasses * LegoState subclasses * LegoWorld subclasses * Presenter progress * Remaining presenters * All but two that need new files * Merge into vtable branch (#3) * Implement MxDisplaySurface::VTable0x44 (#467) * Update mxdisplaysurface.cpp * add arguments to header * Fix glitched bitmaps * WIP fixes * Match * Fix * Changes * Fixes --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * Implmement PoliceState::VTable0x1c (#468) * Implmement PoliceState::VTable0x1c * Fixes --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * Implement Lego3DView::Render (#470) * Implement Lego3DView::Render * use MxDouble * Revert "use MxDouble" This reverts commit a006b60e2066b79ded3e15e143a302d8fd707deb. * Begin work on Police class (#469) * Begin work on Police class * Use JukeBox::e_policeStation value * Fixes --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * Implement MxDisplaySurface::CreateCursorSurface (#471) * Update mxdisplaysurface.cpp * Fixes * Update legovideomanager.cpp * Match to 100% --------- Co-authored-by: Christian Semmler <mail@csemmler.com> --------- Co-authored-by: Misha <106913236+MishaProductions@users.noreply.github.com> Co-authored-by: Christian Semmler <mail@csemmler.com> Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com> * Police fix * Finish * motocycle lower case * Update historybook.h * Update hospitalstate.h * Update jetski.h * Update legoinputmanager.h * Update legolocomotionanimpresenter.h * Update pizza.h * Update act3shark.h * Update ambulancemissionstate.h * Update bumpbouy.h * Update doors.h --------- Co-authored-by: Misha <106913236+MishaProductions@users.noreply.github.com> Co-authored-by: Christian Semmler <mail@csemmler.com> Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com>
2024-01-20 18:04:46 -05:00
// TODO
return SUCCESS;
}
// 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;
}
}
// FUNCTION: LEGO1 0x100346d0
Enforce vtable match (#464) * vtable enforce * Vtable progress * IslePathActor subclasses * LegoState subclasses * LegoWorld subclasses * Presenter progress * Remaining presenters * All but two that need new files * Merge into vtable branch (#3) * Implement MxDisplaySurface::VTable0x44 (#467) * Update mxdisplaysurface.cpp * add arguments to header * Fix glitched bitmaps * WIP fixes * Match * Fix * Changes * Fixes --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * Implmement PoliceState::VTable0x1c (#468) * Implmement PoliceState::VTable0x1c * Fixes --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * Implement Lego3DView::Render (#470) * Implement Lego3DView::Render * use MxDouble * Revert "use MxDouble" This reverts commit a006b60e2066b79ded3e15e143a302d8fd707deb. * Begin work on Police class (#469) * Begin work on Police class * Use JukeBox::e_policeStation value * Fixes --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * Implement MxDisplaySurface::CreateCursorSurface (#471) * Update mxdisplaysurface.cpp * Fixes * Update legovideomanager.cpp * Match to 100% --------- Co-authored-by: Christian Semmler <mail@csemmler.com> --------- Co-authored-by: Misha <106913236+MishaProductions@users.noreply.github.com> Co-authored-by: Christian Semmler <mail@csemmler.com> Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com> * Police fix * Finish * motocycle lower case * Update historybook.h * Update hospitalstate.h * Update jetski.h * Update legoinputmanager.h * Update legolocomotionanimpresenter.h * Update pizza.h * Update act3shark.h * Update ambulancemissionstate.h * Update bumpbouy.h * Update doors.h --------- Co-authored-by: Misha <106913236+MishaProductions@users.noreply.github.com> Co-authored-by: Christian Semmler <mail@csemmler.com> Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com>
2024-01-20 18:04:46 -05:00
MxBool Act1State::SetFlag()
{
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;
Enforce vtable match (#464) * vtable enforce * Vtable progress * IslePathActor subclasses * LegoState subclasses * LegoWorld subclasses * Presenter progress * Remaining presenters * All but two that need new files * Merge into vtable branch (#3) * Implement MxDisplaySurface::VTable0x44 (#467) * Update mxdisplaysurface.cpp * add arguments to header * Fix glitched bitmaps * WIP fixes * Match * Fix * Changes * Fixes --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * Implmement PoliceState::VTable0x1c (#468) * Implmement PoliceState::VTable0x1c * Fixes --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * Implement Lego3DView::Render (#470) * Implement Lego3DView::Render * use MxDouble * Revert "use MxDouble" This reverts commit a006b60e2066b79ded3e15e143a302d8fd707deb. * Begin work on Police class (#469) * Begin work on Police class * Use JukeBox::e_policeStation value * Fixes --------- Co-authored-by: Christian Semmler <mail@csemmler.com> * Implement MxDisplaySurface::CreateCursorSurface (#471) * Update mxdisplaysurface.cpp * Fixes * Update legovideomanager.cpp * Match to 100% --------- Co-authored-by: Christian Semmler <mail@csemmler.com> --------- Co-authored-by: Misha <106913236+MishaProductions@users.noreply.github.com> Co-authored-by: Christian Semmler <mail@csemmler.com> Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com> * Police fix * Finish * motocycle lower case * Update historybook.h * Update hospitalstate.h * Update jetski.h * Update legoinputmanager.h * Update legolocomotionanimpresenter.h * Update pizza.h * Update act3shark.h * Update ambulancemissionstate.h * Update bumpbouy.h * Update doors.h --------- Co-authored-by: Misha <106913236+MishaProductions@users.noreply.github.com> Co-authored-by: Christian Semmler <mail@csemmler.com> Co-authored-by: Joshua Peisach <itzswirlz2020@outlook.com>
2024-01-20 18:04:46 -05:00
}
// STUB: LEGO1 0x10034b60
void Act1State::FUN_10034b60()
{
// TODO
}
// STUB: LEGO1 0x10034d00
void Act1State::FUN_10034d00()
{
2023-10-24 19:38:27 -04:00
// TODO
}