mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-08-13 17:03:47 -04:00
a5df9dddf0
* First batch some overlay
* Almost all overlay
* effect & gamestate
* kaleido stuffs
* more overlay
* more left over from code folder
* remaining hardcoded line and file
* Open & Close _DISP __FILE__ & __LINE__ clean up
* Some if (1) {} remove
* LOG_xxxx __FILE__ , __LINE__ cleaned
* ASSERT macro __FILE__ __LINE__
* mtx without line/file in functions
* " if (1) {} " & "if (0) {}" and tab/white place
* LogUtils as macro
* GameState_, GameAlloc_, SystemArena_ & ZeldaArena_
* Revert "GameState_, GameAlloc_, SystemArena_ & ZeldaArena_"
This reverts commit 0d85caaf7e
.
* Like last commit but as macro
* Fix matrix not using macros
* use function not macro
* DebugArena_* functions
GameAlloc_MallocDebug
BgCheck_PosErrorCheck as macros
removed issues with ; in macro file
99 lines
2.9 KiB
C
99 lines
2.9 KiB
C
/*
|
|
* File: z_en_tana.c
|
|
* Overlay: ovl_En_Tana
|
|
* Description: Shop Shelves
|
|
*/
|
|
|
|
#include "z_en_tana.h"
|
|
#include "objects/object_shop_dungen/object_shop_dungen.h"
|
|
|
|
#define FLAGS (ACTOR_FLAG_0 | ACTOR_FLAG_3)
|
|
|
|
void EnTana_Init(Actor* thisx, GlobalContext* globalCtx);
|
|
void EnTana_Destroy(Actor* thisx, GlobalContext* globalCtx);
|
|
void EnTana_Update(Actor* thisx, GlobalContext* globalCtx);
|
|
void EnTana_DrawWoodenShelves(Actor* thisx, GlobalContext* globalCtx);
|
|
void EnTana_DrawStoneShelves(Actor* thisx, GlobalContext* globalCtx);
|
|
|
|
const ActorInit En_Tana_InitVars = {
|
|
ACTOR_EN_TANA,
|
|
ACTORCAT_PROP,
|
|
FLAGS,
|
|
OBJECT_SHOP_DUNGEN,
|
|
sizeof(EnTana),
|
|
(ActorFunc)EnTana_Init,
|
|
(ActorFunc)EnTana_Destroy,
|
|
(ActorFunc)EnTana_Update,
|
|
NULL,
|
|
NULL,
|
|
};
|
|
|
|
//! @bug A third entry is missing here. When printing the string indexed by `params` for type 2, the
|
|
//! next data entry will be dereferenced and print garbage, stopping any future printing.
|
|
//! In a non-matching context, this can cause a crash if the next item isn't a valid pointer.
|
|
static const char* sShelfTypes[] = {
|
|
"木の棚", // "Wooden Shelves"
|
|
"石の棚", // "Stone Shelves"
|
|
"石の棚", // "Stone Shelves"
|
|
};
|
|
|
|
static const ActorFunc sDrawFuncs[] = {
|
|
EnTana_DrawWoodenShelves,
|
|
EnTana_DrawStoneShelves,
|
|
EnTana_DrawStoneShelves,
|
|
};
|
|
|
|
static Gfx* sShelfDLists[] = {
|
|
gShopDungenWoodenShelvesDL,
|
|
gShopDungenStoneShelvesDL,
|
|
gShopDungenStoneShelvesDL,
|
|
};
|
|
|
|
static void* sStoneTextures[] = {
|
|
NULL,
|
|
gShopDungenStone1Tex,
|
|
gShopDungenStone2Tex,
|
|
};
|
|
|
|
void EnTana_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|
EnTana* this = (EnTana*)thisx;
|
|
|
|
osSyncPrintf("☆☆☆ %s ☆☆☆\n", sShelfTypes[thisx->params]);
|
|
Actor_SetScale(thisx, 1.0f);
|
|
thisx->flags &= ~ACTOR_FLAG_0;
|
|
thisx->draw = sDrawFuncs[thisx->params];
|
|
}
|
|
|
|
void EnTana_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
|
}
|
|
|
|
void EnTana_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|
}
|
|
|
|
void EnTana_DrawWoodenShelves(Actor* thisx, GlobalContext* globalCtx) {
|
|
EnTana* this = (EnTana*)thisx;
|
|
|
|
OPEN_DISPS(globalCtx->state.gfxCtx);
|
|
|
|
func_80093D18(globalCtx->state.gfxCtx);
|
|
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
|
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
|
gSPDisplayList(POLY_OPA_DISP++, sShelfDLists[thisx->params]);
|
|
|
|
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
|
}
|
|
|
|
void EnTana_DrawStoneShelves(Actor* thisx, GlobalContext* globalCtx) {
|
|
EnTana* this = (EnTana*)thisx;
|
|
|
|
OPEN_DISPS(globalCtx->state.gfxCtx);
|
|
|
|
func_80093D18(globalCtx->state.gfxCtx);
|
|
gSPSegment(POLY_OPA_DISP++, 0x08, SEGMENTED_TO_VIRTUAL(sStoneTextures[thisx->params]));
|
|
gSPMatrix(POLY_OPA_DISP++, MATRIX_NEWMTX(globalCtx->state.gfxCtx),
|
|
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
|
gSPDisplayList(POLY_OPA_DISP++, sShelfDLists[thisx->params]);
|
|
|
|
CLOSE_DISPS(globalCtx->state.gfxCtx);
|
|
}
|