Skip to content

Commit

Permalink
Refactor globals into class statics
Browse files Browse the repository at this point in the history
  • Loading branch information
foxtacles committed Oct 28, 2024
1 parent 37f0981 commit ecdca1d
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 15 deletions.
12 changes: 12 additions & 0 deletions LEGO1/lego/legoomni/include/pizza.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ class PizzaMissionState : public LegoState {
undefined4 m_unk0x0c; // 0x0c
Mission m_missions[5]; // 0x10
MxU32 m_unk0xb0; // 0xb0

static IsleScript::Script g_pepperActions[];
static IsleScript::Script g_mamaActions[];
static IsleScript::Script g_papaActions[];
static IsleScript::Script g_nickActions[];
static IsleScript::Script g_lauraActions[];

static MxLong g_pepperFinishTimes[];
static MxLong g_mamaFinishTimes[];
static MxLong g_papaFinishTimes[];
static MxLong g_nickFinishTimes[];
static MxLong g_lauraFinishTimes[];
};

// VTABLE: LEGO1 0x100d7380
Expand Down
7 changes: 7 additions & 0 deletions LEGO1/lego/legoomni/include/pizzeria.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#ifndef PIZZERIA_H
#define PIZZERIA_H

#include "actionsfwd.h"
#include "decomp.h"
#include "isleactor.h"
#include "legostate.h"
Expand Down Expand Up @@ -38,6 +39,12 @@ class PizzeriaState : public LegoState {

Playlist m_unk0x08[5]; // 0x08
MxS32 m_unk0x44[5]; // 0x44

static IsleScript::Script g_pepperActions[];
static IsleScript::Script g_mamaActions[];
static IsleScript::Script g_papaActions[];
static IsleScript::Script g_nickActions[];
static IsleScript::Script g_lauraActions[];
};

// VTABLE: LEGO1 0x100d5520
Expand Down
20 changes: 10 additions & 10 deletions LEGO1/lego/legoomni/src/actors/pizza.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ DECOMP_SIZE_ASSERT(PizzaMissionState::Mission, 0x20)
extern MxU32 g_isleFlags;

// GLOBAL: LEGO1 0x100f3a80
IsleScript::Script g_pepperActions[] = {
IsleScript::Script PizzaMissionState::g_pepperActions[] = {
IsleScript::c_pnsx48pr_RunAnim,
IsleScript::c_pnsx69pr_RunAnim,
IsleScript::c_pns125ni_RunAnim,
Expand All @@ -42,10 +42,10 @@ IsleScript::Script g_pepperActions[] = {
};

// GLOBAL: LEGO1 0x100f3ab8
MxLong g_pepperFinishTimes[] = {100000, 200000, 300000, 350000};
MxLong PizzaMissionState::g_pepperFinishTimes[] = {100000, 200000, 300000, 350000};

// GLOBAL: LEGO1 0x100f3ac8
IsleScript::Script g_lauraActions[] = {
IsleScript::Script PizzaMissionState::g_lauraActions[] = {
IsleScript::c_pns096pr_RunAnim,
IsleScript::c_pns097pr_RunAnim,
IsleScript::c_pns098pr_RunAnim,
Expand All @@ -62,10 +62,10 @@ IsleScript::Script g_lauraActions[] = {
};

// GLOBAL: LEGO1 0x100f3b00
MxLong g_lauraFinishTimes[] = {100000, 200000, 300000, 350000};
MxLong PizzaMissionState::g_lauraFinishTimes[] = {100000, 200000, 300000, 350000};

// GLOBAL: LEGO1 0x100f3b10
IsleScript::Script g_nickActions[] = {
IsleScript::Script PizzaMissionState::g_nickActions[] = {
IsleScript::c_pns042bm_RunAnim,
IsleScript::c_pns043en_RunAnim,
IsleScript::c_pns045p1_RunAnim,
Expand All @@ -82,10 +82,10 @@ IsleScript::Script g_nickActions[] = {
};

// GLOBAL: LEGO1 0x100f3b48
MxLong g_nickFinishTimes[] = {100000, 200000, 300000, 350000};
MxLong PizzaMissionState::g_nickFinishTimes[] = {100000, 200000, 300000, 350000};

// GLOBAL: LEGO1 0x100f3b58
IsleScript::Script g_mamaActions[] = {
IsleScript::Script PizzaMissionState::g_mamaActions[] = {
IsleScript::c_pns022pr_RunAnim,
IsleScript::c_pns021dl_RunAnim,
IsleScript::c_pns018rd_RunAnim,
Expand All @@ -102,10 +102,10 @@ IsleScript::Script g_mamaActions[] = {
};

// GLOBAL: LEGO1 0x100f3b90
MxLong g_mamaFinishTimes[] = {100000, 200000, 300000, 350000};
MxLong PizzaMissionState::g_mamaFinishTimes[] = {100000, 200000, 300000, 350000};

// GLOBAL: LEGO1 0x100f3ba0
IsleScript::Script g_papaActions[] = {
IsleScript::Script PizzaMissionState::g_papaActions[] = {
IsleScript::c_pns065rd_RunAnim,
IsleScript::c_pns066db_RunAnim,
IsleScript::c_pns067gd_RunAnim,
Expand All @@ -122,7 +122,7 @@ IsleScript::Script g_papaActions[] = {
};

// GLOBAL: LEGO1 0x100f3bd8
MxLong g_papaFinishTimes[] = {100000, 200000, 300000, 350000};
MxLong PizzaMissionState::g_papaFinishTimes[] = {100000, 200000, 300000, 350000};

// FUNCTION: LEGO1 0x10037ef0
Pizza::Pizza()
Expand Down
10 changes: 5 additions & 5 deletions LEGO1/lego/legoomni/src/actors/pizzeria.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,23 @@ DECOMP_SIZE_ASSERT(Pizzeria, 0x84)
DECOMP_SIZE_ASSERT(PizzeriaState, 0x58)

// GLOBAL: LEGO1 0x100f0ce8
IsleScript::Script g_pepperActions[] =
IsleScript::Script PizzeriaState::g_pepperActions[] =
{IsleScript::c_ppz107ma_RunAnim, IsleScript::c_ppz114pa_RunAnim, IsleScript::c_ppz114pa_RunAnim};

// GLOBAL: LEGO1 0x100f0cf8
IsleScript::Script g_mamaActions[] =
IsleScript::Script PizzeriaState::g_mamaActions[] =
{IsleScript::c_ppz001pe_RunAnim, IsleScript::c_ppz006pa_RunAnim, IsleScript::c_ppz007pa_RunAnim};

// GLOBAL: LEGO1 0x100f0d08
IsleScript::Script g_papaActions[] =
IsleScript::Script PizzeriaState::g_papaActions[] =
{IsleScript::c_ppz054ma_RunAnim, IsleScript::c_ppz055ma_RunAnim, IsleScript::c_ppz056ma_RunAnim};

// GLOBAL: LEGO1 0x100f0d18
IsleScript::Script g_nickActions[] =
IsleScript::Script PizzeriaState::g_nickActions[] =
{IsleScript::c_ppz031ma_RunAnim, IsleScript::c_ppz035pa_RunAnim, IsleScript::c_ppz036pa_RunAnim};

// GLOBAL: LEGO1 0x100f0d28
IsleScript::Script g_lauraActions[] =
IsleScript::Script PizzeriaState::g_lauraActions[] =
{IsleScript::c_ppz075pa_RunAnim, IsleScript::c_ppz082pa_RunAnim, IsleScript::c_ppz084pa_RunAnim};

// FUNCTION: LEGO1 0x100179c0
Expand Down

0 comments on commit ecdca1d

Please sign in to comment.