mirror of
https://github.com/zeldaret/mm.git
synced 2026-07-11 14:18:39 -04:00
General cleanup (#1636)
* totalLoadedActors comparision * OBJMINE_PARAMS * Sort z64.h header includes * MapSelect_LoadConsoleLogo * Combine notebook tables into 1 * TGSw clean up
This commit is contained in:
+1
-1
@@ -3322,7 +3322,7 @@ Actor* Actor_SpawnAsChildAndCutscene(ActorContext* actorCtx, PlayState* play, s1
|
||||
s32 objectSlot;
|
||||
ActorOverlay* overlayEntry;
|
||||
|
||||
if (actorCtx->totalLoadedActors >= 0xFF) {
|
||||
if (actorCtx->totalLoadedActors >= 255) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,7 @@ u8 gPageSwitchNextButtonStatus[][5] = {
|
||||
#define DEFINE_EVENT(_enum, _icon, _colorFlag, _description, completedMessage, _completedFlag) completedMessage,
|
||||
|
||||
u16 sBombersNotebookEventMessages[BOMBERS_NOTEBOOK_EVENT_MAX] = {
|
||||
#include "tables/bombers_notebook/person_table.h"
|
||||
#include "tables/bombers_notebook/event_table.h"
|
||||
#include "tables/notebook_table.h"
|
||||
};
|
||||
|
||||
#undef DEFINE_PERSON
|
||||
@@ -47,8 +46,7 @@ u16 sBombersNotebookEventMessages[BOMBERS_NOTEBOOK_EVENT_MAX] = {
|
||||
#define DEFINE_EVENT(_enum, _icon, _colorFlag, _description, _completedMessage, completedFlag) completedFlag,
|
||||
|
||||
u16 gBombersNotebookWeekEventFlags[BOMBERS_NOTEBOOK_EVENT_MAX] = {
|
||||
#include "tables/bombers_notebook/person_table.h"
|
||||
#include "tables/bombers_notebook/event_table.h"
|
||||
#include "tables/notebook_table.h"
|
||||
};
|
||||
|
||||
#undef DEFINE_PERSON
|
||||
|
||||
@@ -262,23 +262,27 @@ TexturePtr sBombersNotebookDayTextures[] = {
|
||||
gBombersNotebookDayFinalENGTex,
|
||||
};
|
||||
|
||||
#define DEFINE_PERSON(_enum, _photo, _description, metEnum, _metMessage, _metFlag)
|
||||
#define DEFINE_EVENT(_enum, icon, _colorFlag, _description, _completedMessage, _completedFlag) icon,
|
||||
|
||||
s32 sBombersNotebookEventIcons[] = {
|
||||
#include "tables/bombers_notebook/event_table.h"
|
||||
#include "tables/notebook_table.h"
|
||||
};
|
||||
|
||||
#undef DEFINE_PERSON
|
||||
#undef DEFINE_EVENT
|
||||
|
||||
s32 sBombersNotebookEventIconWidths[] = { 16, 24, 32 };
|
||||
s32 sBombersNotebookEventIconHeights[] = { 16, 28, 28 };
|
||||
|
||||
#define DEFINE_PERSON(_enum, _photo, _description, metEnum, _metMessage, _metFlag)
|
||||
#define DEFINE_EVENT(_enum, _icon, colorFlag, _description, _completedMessage, _completedFlag) colorFlag,
|
||||
|
||||
u16 sBombersNotebookEventColorWeekEventFlags[] = {
|
||||
#include "tables/bombers_notebook/event_table.h"
|
||||
#include "tables/notebook_table.h"
|
||||
};
|
||||
|
||||
#undef DEFINE_PERSON
|
||||
#undef DEFINE_EVENT
|
||||
|
||||
void BombersNotebook_DrawScisTexRect(Gfx** gfxP, s32 rxl, s32 ryl, s32 rxh, s32 ryh, s32 tile, s32 s, s32 t, s32 dsdx,
|
||||
@@ -556,12 +560,14 @@ void BombersNotebook_DrawEntries(Gfx** gfxP, s32 row, u32 rectTop) {
|
||||
}
|
||||
|
||||
#define DEFINE_PERSON(_enum, photo, _description, _metEnum, _metMessage, _metFlag) photo,
|
||||
#define DEFINE_EVENT(enum, _icon, _colorFlag, _description, _completedMessage, _completedFlag)
|
||||
|
||||
TexturePtr sBombersNotebookPhotoTextures[] = {
|
||||
#include "tables/bombers_notebook/person_table.h"
|
||||
#include "tables/notebook_table.h"
|
||||
};
|
||||
|
||||
#undef DEFINE_PERSON
|
||||
#undef DEFINE_EVENT
|
||||
|
||||
void BombersNotebook_DrawRows(BombersNotebook* this, Gfx** gfxP) {
|
||||
static s16 sBarColorR = 0;
|
||||
@@ -1127,8 +1133,7 @@ void BombersNotebook_LoadFiles(BombersNotebook* this, s32 flag) {
|
||||
#define DEFINE_EVENT(_enum, _icon, _colorFlag, description, _completedMessage, _completedFlag) description,
|
||||
|
||||
u16 sBombersNotebookTextIds[] = {
|
||||
#include "tables/bombers_notebook/person_table.h"
|
||||
#include "tables/bombers_notebook/event_table.h"
|
||||
#include "tables/notebook_table.h"
|
||||
};
|
||||
|
||||
#undef DEFINE_PERSON
|
||||
|
||||
@@ -10,6 +10,8 @@ typedef void (*EnSwActionFunc)(struct EnSw*, PlayState*);
|
||||
|
||||
#define ENSW_GETS_3(params) ((params & 3) & 0xFF)
|
||||
#define ENSW_GET_3(thisx) (ENSW_GETS_3((thisx)->params))
|
||||
#define ENSW_GETS_FC(params) (((params & 0xFC) >> 2) & 0xFF)
|
||||
#define ENSW_GET_FC(thisx) (ENSW_GETS_FC((thisx)->params))
|
||||
#define ENSW_GETS_3FC(params) (((params & 0x3FC) >> 2) & 0xFF)
|
||||
#define ENSW_GET_3FC(thisx) (ENSW_GETS_3FC((thisx)->params))
|
||||
#define ENSW_GET_PATH_INDEX(thisx) ((((thisx)->params & 0xFF00) >> 8) & 0xFF)
|
||||
|
||||
@@ -12,10 +12,10 @@ typedef void (*ObjMineActionFunc)(struct ObjMine*, PlayState*);
|
||||
#define OBJMINE_GET_PATH_SPEED(thisx) (((thisx)->params >> 8) & 7)
|
||||
#define OBJMINE_GET_TYPE(thisx) (((thisx)->params >> 12) & 3)
|
||||
|
||||
#define OBJMINE_PARAM(type, linkCount, pathIndex, pathSpeed) (((type) << 0xC) | ((type == OBJMINE_TYPE_PATH) ? ((pathIndex) | ((pathSpeed) << 8)) : (linkCount)))
|
||||
#define OBJMINE_PATH_PARAM(pathIndex, pathSpeed) OBJMINE_PARAM(OBJMINE_TYPE_PATH, 0, pathIndex, pathSpeed)
|
||||
#define OBJMINE_AIR_PARAM(linkCount) OBJMINE_PARAM(OBJMINE_TYPE_AIR, linkCount, 0, 0)
|
||||
#define OBJMINE_WATER_PARAM(linkCount) OBJMINE_PARAM(OBJMINE_TYPE_WATER, linkCount, 0, 0)
|
||||
#define OBJMINE_PARAMS(type, linkCount, pathIndex, pathSpeed) (((type) << 0xC) | ((type == OBJMINE_TYPE_PATH) ? ((pathIndex) | ((pathSpeed) << 8)) : (linkCount)))
|
||||
#define OBJMINE_PATH_PARAMS(pathIndex, pathSpeed) OBJMINE_PARAMS(OBJMINE_TYPE_PATH, 0, pathIndex, pathSpeed)
|
||||
#define OBJMINE_AIR_PARAMS(linkCount) OBJMINE_PARAMS(OBJMINE_TYPE_AIR, linkCount, 0, 0)
|
||||
#define OBJMINE_WATER_PARAMS(linkCount) OBJMINE_PARAMS(OBJMINE_TYPE_WATER, linkCount, 0, 0)
|
||||
|
||||
#define OBJMINE_CHAIN_MAX 63
|
||||
|
||||
|
||||
@@ -5,7 +5,9 @@
|
||||
*/
|
||||
|
||||
#include "z_tg_sw.h"
|
||||
|
||||
#include "z64debug_display.h"
|
||||
#include "overlays/actors/ovl_En_Sw/z_en_sw.h"
|
||||
|
||||
#define FLAGS (ACTOR_FLAG_10)
|
||||
|
||||
@@ -17,7 +19,7 @@ void TGSw_Destroy(Actor* thisx, PlayState* play);
|
||||
void TGSw_Update(Actor* thisx, PlayState* play);
|
||||
void TGSw_Draw(Actor* thisx, PlayState* play);
|
||||
|
||||
void TGSw_ActionExecuteOneShot(struct TGSw* this, PlayState* play);
|
||||
void TGSw_Die(struct TGSw* this, PlayState* play);
|
||||
|
||||
ActorInit TG_Sw_InitVars = {
|
||||
/**/ ACTOR_TG_SW,
|
||||
@@ -31,7 +33,7 @@ ActorInit TG_Sw_InitVars = {
|
||||
/**/ TGSw_Draw,
|
||||
};
|
||||
|
||||
void TGSw_ActionDecider(TGSw* this, PlayState* play) {
|
||||
void TGSw_Idle(TGSw* this, PlayState* play) {
|
||||
f32 scaledAbsoluteRotZ;
|
||||
f32 scaledAbsoluteRotY;
|
||||
PlayerImpactType playerImpactType;
|
||||
@@ -45,12 +47,12 @@ void TGSw_ActionDecider(TGSw* this, PlayState* play) {
|
||||
}
|
||||
playerImpactType = play->actorCtx.playerImpact.type;
|
||||
if ((playerImpactType == PLAYER_IMPACT_BONK) || (playerImpactType == PLAYER_IMPACT_GORON_GROUND_POUND)) {
|
||||
this->actionFunc = TGSw_ActionExecuteOneShot;
|
||||
this->actionFunc = TGSw_Die;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void TGSw_ActionExecuteOneShot(TGSw* this, PlayState* play) {
|
||||
void TGSw_Die(TGSw* this, PlayState* play) {
|
||||
Actor* actorIter = NULL;
|
||||
|
||||
// FAKE:
|
||||
@@ -61,7 +63,7 @@ void TGSw_ActionExecuteOneShot(TGSw* this, PlayState* play) {
|
||||
if (actorIter == NULL) {
|
||||
break;
|
||||
}
|
||||
if ((((this->actor.params & 0xFC) >> 2) & 0xFF) == (((actorIter->params & 0xFC) >> 2) & 0xFF)) {
|
||||
if (TGSW_GET_FC(&this->actor) == ENSW_GET_FC(actorIter)) {
|
||||
actorIter->parent = &this->actor;
|
||||
actorIter->speed = ABS_ALT(this->actor.world.rot.x);
|
||||
break;
|
||||
@@ -77,7 +79,7 @@ void TGSw_ActionExecuteOneShot(TGSw* this, PlayState* play) {
|
||||
if (actorIter == NULL) {
|
||||
break;
|
||||
}
|
||||
if ((((this->actor.params & 0xFC) >> 2) & 0xFF) == (((actorIter->params & 0xFC) >> 2) & 0xFF)) {
|
||||
if (TGSW_GET_FC(&this->actor) == ENSW_GET_FC(actorIter)) {
|
||||
actorIter->parent = &this->actor;
|
||||
actorIter->speed = ABS_ALT(this->actor.world.rot.x);
|
||||
break;
|
||||
@@ -92,7 +94,7 @@ void TGSw_Init(Actor* thisx, PlayState* play) {
|
||||
TGSw* this = THIS;
|
||||
|
||||
this->actor.csId = this->actor.world.rot.z;
|
||||
this->actionFunc = TGSw_ActionDecider;
|
||||
this->actionFunc = TGSw_Idle;
|
||||
}
|
||||
|
||||
void TGSw_Destroy(Actor* thisx, PlayState* play) {
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
struct TGSw;
|
||||
typedef void (*TGSwActionFunc)(struct TGSw*, PlayState*);
|
||||
|
||||
#define TGSW_GET_FC(thisx) ((((thisx)->params & 0xFC) >> 2) & 0xFF)
|
||||
|
||||
typedef struct TGSw {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ TGSwActionFunc actionFunc;
|
||||
|
||||
@@ -10,7 +10,10 @@
|
||||
#include "libc/alloca.h"
|
||||
#include "overlays/gamestates/ovl_title/z_title.h"
|
||||
|
||||
void MapSelect_LoadConsoleLogo(MapSelectState* this) {
|
||||
void MapSelect_LoadConsoleLogo(MapSelectState* this, u32 entrance, s32 spawn) {
|
||||
s32 unused1 = entrance ? 0 : 0;
|
||||
s32 unused2 = spawn ? 0 : 0;
|
||||
|
||||
STOP_GAMESTATE(&this->state);
|
||||
SET_NEXT_GAMESTATE(&this->state, ConsoleLogo_Init, sizeof(ConsoleLogoState));
|
||||
}
|
||||
@@ -496,7 +499,7 @@ static SceneSelectEntry sScenes[] = {
|
||||
{ "X 1:SPOT00", MapSelect_LoadGame, ENTRANCE(CUTSCENE, 0) },
|
||||
|
||||
// "Title" (Title Screen)
|
||||
{ "title", (void*)MapSelect_LoadConsoleLogo, 0 },
|
||||
{ "title", MapSelect_LoadConsoleLogo, 0 },
|
||||
};
|
||||
|
||||
void MapSelect_UpdateMenu(MapSelectState* this) {
|
||||
|
||||
Reference in New Issue
Block a user