From ebaac0b06302286cfa41fc4c3bef9bf7f9fab3b0 Mon Sep 17 00:00:00 2001 From: aMannus Date: Wed, 15 Nov 2023 18:33:00 +0100 Subject: [PATCH] Christmas Decorations base actor --- .../object_kakariko_decor/SnowBuildup_32 | Bin 0 -> 2140 bytes .../object_kakariko_decor/String_GRGR_32 | Bin 0 -> 2140 bytes .../object_kakariko_decor/gFrontGateDecorDL | 16 ++++++ .../gFrontGateDecorDL_tri_0 | 10 ++++ .../gFrontGateDecorDL_tri_1 | 19 ++++++ .../gFrontGateDecorDL_vtx_0 | 22 +++++++ .../gFrontGateDecorDL_vtx_1 | 54 ++++++++++++++++++ .../gFrontGateDecorDL_vtx_cull | 10 ++++ .../mat_gFrontGateDecorDL_f3dlite_SnowBuildup | 21 +++++++ .../mat_gFrontGateDecorDL_f3dlite_StringGRGR | 21 +++++++ soh/assets/soh_assets.h | 3 + soh/soh/ActorDB.cpp | 17 ++++++ soh/src/code/z_play.c | 5 +- .../ovl_En_ChristmasDeco/z_en_christmasdeco.c | 42 ++++++++++++++ .../ovl_En_ChristmasDeco/z_en_christmasdeco.h | 27 +++++++++ 15 files changed, 266 insertions(+), 1 deletion(-) create mode 100644 soh/assets/custom/objects/object_kakariko_decor/SnowBuildup_32 create mode 100644 soh/assets/custom/objects/object_kakariko_decor/String_GRGR_32 create mode 100644 soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL create mode 100644 soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_tri_0 create mode 100644 soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_tri_1 create mode 100644 soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_vtx_0 create mode 100644 soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_vtx_1 create mode 100644 soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_vtx_cull create mode 100644 soh/assets/custom/objects/object_kakariko_decor/mat_gFrontGateDecorDL_f3dlite_SnowBuildup create mode 100644 soh/assets/custom/objects/object_kakariko_decor/mat_gFrontGateDecorDL_f3dlite_StringGRGR create mode 100644 soh/src/overlays/actors/ovl_En_ChristmasDeco/z_en_christmasdeco.c create mode 100644 soh/src/overlays/actors/ovl_En_ChristmasDeco/z_en_christmasdeco.h diff --git a/soh/assets/custom/objects/object_kakariko_decor/SnowBuildup_32 b/soh/assets/custom/objects/object_kakariko_decor/SnowBuildup_32 new file mode 100644 index 0000000000000000000000000000000000000000..4653f07d12c713b4a2c302beb9d5ff96da6a1c09 GIT binary patch literal 2140 zcmeHHI~Kwq5JW4F;Z3ZpZ7jTtjTiC=@hG;Ilyt!zhGof5DJ(3)z6dNkJHzBf=bXD7 z&!>&d{&9cek!ADPO65L31lj+IQLkd0n^8zBBwh zX2e$1Ou6bx)l&5rrdQ{S!s?{trV4x%)RmD}(gl0!Rvx$ofVNYE^bL=4;*Zi;D9@A5DgmW4@4f&@btxRhw&#s@`&N(v1s zXa*vLl$lQ3i|PIJzGEr%*R;dUX_S;%D$?;c z?O}iSWcVZUD2suaG;Lpu=LzKx>u8>-QbObiUDTJJG7mA@o zDD&tZoieHcWFzQPiTm-+Nt}#KjKZCz7&4=T5+$OtoR>@ie6e6(`w8#+Zqbto|ZdL5%{6N67@i z6X={Q5eM&Nz`Bawup||hfdTP*L&57~-QN%AA0=Uv!lK)>=qnZ*CQ>Ga1+nc}&^M7i5Tm+T5XH0m0g2z~? V!kCjR944?&PVzd=&XL1u + + + + + + + + + + + + + + + diff --git a/soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_tri_0 b/soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_tri_0 new file mode 100644 index 000000000..bce87b152 --- /dev/null +++ b/soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_tri_0 @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_tri_1 b/soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_tri_1 new file mode 100644 index 000000000..ac9146850 --- /dev/null +++ b/soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_tri_1 @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_vtx_0 b/soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_vtx_0 new file mode 100644 index 000000000..3b2a2a21c --- /dev/null +++ b/soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_vtx_0 @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_vtx_1 b/soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_vtx_1 new file mode 100644 index 000000000..a5aeeaa53 --- /dev/null +++ b/soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_vtx_1 @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_vtx_cull b/soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_vtx_cull new file mode 100644 index 000000000..6e79464b2 --- /dev/null +++ b/soh/assets/custom/objects/object_kakariko_decor/gFrontGateDecorDL_vtx_cull @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/soh/assets/custom/objects/object_kakariko_decor/mat_gFrontGateDecorDL_f3dlite_SnowBuildup b/soh/assets/custom/objects/object_kakariko_decor/mat_gFrontGateDecorDL_f3dlite_SnowBuildup new file mode 100644 index 000000000..a79cca54f --- /dev/null +++ b/soh/assets/custom/objects/object_kakariko_decor/mat_gFrontGateDecorDL_f3dlite_SnowBuildup @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/custom/objects/object_kakariko_decor/mat_gFrontGateDecorDL_f3dlite_StringGRGR b/soh/assets/custom/objects/object_kakariko_decor/mat_gFrontGateDecorDL_f3dlite_StringGRGR new file mode 100644 index 000000000..b8478fa90 --- /dev/null +++ b/soh/assets/custom/objects/object_kakariko_decor/mat_gFrontGateDecorDL_f3dlite_StringGRGR @@ -0,0 +1,21 @@ + + + + + + + + + + + + + + + + + + + + + diff --git a/soh/assets/soh_assets.h b/soh/assets/soh_assets.h index a4a471f9f..b31e3f388 100644 --- a/soh/assets/soh_assets.h +++ b/soh/assets/soh_assets.h @@ -92,6 +92,9 @@ static const ALIGN_ASSET(2) char gXmasDecor100DL[] = dgXmasDecor100DL; #define dgXmasStarDL "__OTR__objects/object_xmas_tree/gXmasStarDL" static const ALIGN_ASSET(2) char gXmasStarDL[] = dgXmasStarDL; +#define dgFrontGateDecorDL "__OTR__objects/object_kakariko_decor/gFrontGateDecorDL" +static const ALIGN_ASSET(2) char gFrontGateDecorDL[] = dgFrontGateDecorDL; + // overlays #define dgOptionsDividerChangeLangVtx "__OTR__overlays/ovl_file_choose/gOptionsDividerChangeLangVtx" static const ALIGN_ASSET(2) char gOptionsDividerChangeLangVtx[] = dgOptionsDividerChangeLangVtx; diff --git a/soh/soh/ActorDB.cpp b/soh/soh/ActorDB.cpp index 4e36f5e51..fe7d87a25 100644 --- a/soh/soh/ActorDB.cpp +++ b/soh/soh/ActorDB.cpp @@ -620,9 +620,26 @@ static ActorDBInit EnChristmasTreeInit = { }; extern "C" s16 gEnChristmasTreeId; +#include "src/overlays/actors/ovl_En_ChristmasDeco/z_en_christmasdeco.h" +static ActorDBInit EnChristmasDecoInit = { + "En_ChristmasDeco", + "Christmas Decos", + ACTORCAT_PROP, + (ACTOR_FLAG_DRAW_WHILE_CULLED), + OBJECT_GAMEPLAY_KEEP, + sizeof(EnChristmasDeco), + (ActorFunc)EnChristmasDeco_Init, + (ActorFunc)EnChristmasDeco_Destroy, + (ActorFunc)EnChristmasDeco_Update, + (ActorFunc)EnChristmasDeco_Draw, + nullptr, +}; +extern "C" s16 gEnChristmasDecoId; + void ActorDB::AddBuiltInCustomActors() { gEnPartnerId = ActorDB::Instance->AddEntry(EnPartnerInit).entry.id; gEnChristmasTreeId = ActorDB::Instance->AddEntry(EnChristmasTreeInit).entry.id; + gEnChristmasDecoId = ActorDB::Instance->AddEntry(EnChristmasDecoInit).entry.id; } extern "C" ActorDBEntry* ActorDB_Retrieve(const int id) { diff --git a/soh/src/code/z_play.c b/soh/src/code/z_play.c index de13f78e9..c61b2a33b 100644 --- a/soh/src/code/z_play.c +++ b/soh/src/code/z_play.c @@ -36,6 +36,7 @@ PlayState* gPlayState; s16 gEnPartnerId; s16 gEnChristmasTreeId; +s16 gEnChristmasDecoId; void OTRPlay_SpawnScene(PlayState* play, s32 sceneNum, s32 spawn); @@ -762,8 +763,10 @@ void Play_Init(GameState* thisx) { } if (play->sceneNum == SCENE_KAKARIKO_VILLAGE && Randomizer_GetSettingValue(RSK_TRIFORCE_HUNT)) { - Actor_Spawn(&play->actorCtx, play, gEnChristmasTreeId, -734, 0, 420, 0, 0, 0, 1, true); + Actor_Spawn(&play->actorCtx, play, gEnChristmasTreeId, -734, 0, 420, 0, 0, 0, 0, true); } + + Actor_Spawn(&play->actorCtx, play, gEnChristmasDecoId, 0, 0, 0, 0, 0, 0, 0, true); } void Play_Update(PlayState* play) { diff --git a/soh/src/overlays/actors/ovl_En_ChristmasDeco/z_en_christmasdeco.c b/soh/src/overlays/actors/ovl_En_ChristmasDeco/z_en_christmasdeco.c new file mode 100644 index 000000000..49059b6bc --- /dev/null +++ b/soh/src/overlays/actors/ovl_En_ChristmasDeco/z_en_christmasdeco.c @@ -0,0 +1,42 @@ +/* + * File: z_en_christmasdeco.c + * Overlay: ovl_En_ChristmasDeco + * Description: Custom Christmas Decorations + */ + +#include "z_en_christmasdeco.h" +#include "soh_assets.h" + +void EnChristmasDeco_Init(Actor* thisx, PlayState* play); +void EnChristmasDeco_Destroy(Actor* thisx, PlayState* play); +void EnChristmasDeco_Update(Actor* thisx, PlayState* play); +void EnChristmasDeco_Draw(Actor* thisx, PlayState* play); + +void EnChristmasDeco_Init(Actor* thisx, PlayState* play) { + +} + +void EnChristmasDeco_Destroy(Actor* thisx, PlayState* play) { + +} + +void EnChristmasDeco_Update(Actor* thisx, PlayState* play) { + +} + +void EnChristmasDeco_Draw(Actor* thisx, PlayState* play) { + float decoSize = 1000.0f; + + OPEN_DISPS(play->state.gfxCtx); + + Gfx_SetupDL_25Opa(play->state.gfxCtx); + + Matrix_Scale(decoSize, decoSize, decoSize, MTXMODE_APPLY); + gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(play->state.gfxCtx, (char*)__FILE__, __LINE__), G_MTX_MODELVIEW | G_MTX_LOAD); + + if (play->sceneNum == SCENE_KAKARIKO_VILLAGE) { + gSPDisplayList(POLY_OPA_DISP++, (Gfx*)gFrontGateDecorDL); + } + + CLOSE_DISPS(play->state.gfxCtx); +} diff --git a/soh/src/overlays/actors/ovl_En_ChristmasDeco/z_en_christmasdeco.h b/soh/src/overlays/actors/ovl_En_ChristmasDeco/z_en_christmasdeco.h new file mode 100644 index 000000000..f2a317648 --- /dev/null +++ b/soh/src/overlays/actors/ovl_En_ChristmasDeco/z_en_christmasdeco.h @@ -0,0 +1,27 @@ +#ifndef Z_EN_CHRISTMASDECO_H +#define Z_EN_CHRISTMASDECO_H + +#include +#include "global.h" + +struct EnChristmasDeco; + +typedef void (*EnChristmasDecoActionFunc)(struct EnChristmasDeco*, PlayState*); + +typedef struct EnChristmasDeco { + Actor actor; + EnChristmasDecoActionFunc actionFunc; +} EnChristmasDeco; + +#ifdef __cplusplus +extern "C" { +#endif +void EnChristmasDeco_Init(Actor* thisx, PlayState* play); +void EnChristmasDeco_Destroy(Actor* thisx, PlayState* play); +void EnChristmasDeco_Update(Actor* thisx, PlayState* play); +void EnChristmasDeco_Draw(Actor* thisx, PlayState* play); +#ifdef __cplusplus +} +#endif + +#endif