mirror of
https://github.com/zeldaret/mm.git
synced 2024-11-23 21:09:52 +00:00
object_keikoku_demo
: documented (Lost Woods Trees) (#863)
* object_keikoku_demo: Doc'd * Update src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.c Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * DmOpstage: requested changes * Update assets/xml/objects/object_keikoku_demo.xml Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> * DmOpstage: SnakeCase * DmOpStage: Mention duplicate textures in xml * DmOpstage: formater pls * Update src/overlays/actors/ovl_Dm_Opstage/z_dm_opstage.h Co-authored-by: Derek Hensley <hensley.derek58@gmail.com> * DmOpstage: moved object description Co-authored-by: Isghj8 <isghj8@gmail.com> Co-authored-by: EllipticEllipsis <elliptic.ellipsis@gmail.com> Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
This commit is contained in:
parent
2995d72965
commit
d9a39c6ccc
@ -1,21 +1,65 @@
|
||||
<Root>
|
||||
<!-- Trees and the ground of the Lost woods (DmOpstage actor) -->
|
||||
<!-- (DmRavine) uses it as an object, but does not draw or use any of its assets as far as I can tell -->
|
||||
<File Name="object_keikoku_demo" Segment="6">
|
||||
<DList Name="object_keikoku_demo_DL_000970" Offset="0x970" />
|
||||
<DList Name="object_keikoku_demo_DL_000978" Offset="0x978" />
|
||||
<Texture Name="object_keikoku_demo_Tex_000C50" OutName="tex_000C50" Format="rgba16" Width="32" Height="32" Offset="0xC50" />
|
||||
<Texture Name="object_keikoku_demo_Tex_001450" OutName="tex_001450" Format="rgba16" Width="32" Height="32" Offset="0x1450" />
|
||||
<Collision Name="object_keikoku_demo_Colheader_001C98" Offset="0x1C98" />
|
||||
<DList Name="object_keikoku_demo_DL_002870" Offset="0x2870" />
|
||||
<DList Name="object_keikoku_demo_DL_002878" Offset="0x2878" />
|
||||
<DList Name="object_keikoku_demo_DL_003060" Offset="0x3060" />
|
||||
<DList Name="object_keikoku_demo_DL_003068" Offset="0x3068" />
|
||||
<DList Name="object_keikoku_demo_DL_003720" Offset="0x3720" />
|
||||
<DList Name="object_keikoku_demo_DL_003728" Offset="0x3728" />
|
||||
<Texture Name="object_keikoku_demo_Tex_003930" OutName="tex_003930" Format="ia16" Width="32" Height="32" Offset="0x3930" />
|
||||
<Texture Name="object_keikoku_demo_Tex_004130" OutName="tex_004130" Format="rgba16" Width="32" Height="32" Offset="0x4130" />
|
||||
<!-- <Blob Name="object_keikoku_demo_Blob_004930" Size="0x6600" Offset="0x4930" /> -->
|
||||
<Texture Name="object_keikoku_demo_Tex_00AF30" OutName="tex_00AF30" Format="rgba16" Width="16" Height="64" Offset="0xAF30" />
|
||||
<Texture Name="object_keikoku_demo_Tex_00B730" OutName="tex_00B730" Format="i4" Width="64" Height="64" Offset="0xB730" />
|
||||
<!-- <Blob Name="object_keikoku_demo_Blob_00BF30" Size="0x1400" Offset="0xBF30" /> -->
|
||||
<!-- the following textures have duplicates in Z2_LOSTWOODS scene: -->
|
||||
<!-- gKeikokuDemoYellowFlowersOnGrassTex, gKeikokuDemoFallLeavesOnGrassTex, unused: gKeikokuDemoWrinkledBarkTex -->
|
||||
|
||||
<!-- DmOpstage draws both an empty XLU and non-empty OPA at the same time, each version has its own empty DL instead of reusing. -->
|
||||
<DList Name="gKeikokuDemoFloorEmptyDL" Offset="0x970" />
|
||||
<DList Name="gKeikokuDemoFloorDL" Offset="0x978" />
|
||||
|
||||
<!-- DmOpstage type DMOPSTAGE_TYPE_GROUND textures -->
|
||||
<Texture Name="gKeikokuDemoYellowFlowersOnGrassTex" OutName="yellow_flowers_on_grass" Format="rgba16" Width="32" Height="32" Offset="0xC50" />
|
||||
<Texture Name="gKeikokuDemoFallLeavesOnGrassTex" OutName="fall_leaves_on_grass" Format="rgba16" Width="32" Height="32" Offset="0x1450" />
|
||||
|
||||
<!-- DmOpstage type DMOPSTAGE_TYPE_GROUND Dyna Collider -->
|
||||
<Collision Name="gKeikokuDemoFloorColliderHeader" Offset="0x1C98" />
|
||||
|
||||
<DList Name="gKeikokuDemoTallTreeWithRootBaseEmptyDL" Offset="0x2870" />
|
||||
<DList Name="gKeikokuDemoTallTreeWithRootBaseDL" Offset="0x2878" />
|
||||
<DList Name="gKeikokuDemoTallTreeCutEmptyDL" Offset="0x3060" />
|
||||
<DList Name="gKeikokuDemoTallTreeCutDL" Offset="0x3068" />
|
||||
<DList Name="gKeikokuDemoTallTreeStraightEmptyDL" Offset="0x3720" />
|
||||
<DList Name="gKeikokuDemoTallTreeStraightDL" Offset="0x3728" />
|
||||
<Texture Name="gKeikokuDemoTreeLeavesTex" OutName="tree_leaves" Format="ia16" Width="32" Height="32" Offset="0x3930" />
|
||||
<Texture Name="gKeikokuDemoTreeCutEndGrainTex" OutName="cut_end_grain" Format="rgba16" Width="32" Height="32" Offset="0x4130" />
|
||||
|
||||
<!-- From this point on, all assets are unused. -->
|
||||
|
||||
<!-- Side texture of raised bed of clover, clover on top of stems seen from side. -->
|
||||
<Texture Name="gKeikokuDemoCloverEdgeTex" OutName="clover_edge" Format="rgba16" Width="64" Height="16" Offset="0x4930" />
|
||||
<!-- Top texture of bed of clover (like the kind of raised grass that hide gold skultula). -->
|
||||
<Texture Name="gKeikokuDemoCloverTopTex" OutName="clover_top" Format="rgba16" Width="32" Height="32" Offset="0x5130" />
|
||||
<!-- Darker brown wrinkly bark with moss on I think, low resolution so not sure. -->
|
||||
<Texture Name="gKeikokuDemoDarkMossyBarkTex" OutName="dark_mossy_bark" Format="rgba16" Width="32" Height="32" Offset="0x5930" />
|
||||
<Texture Name="gKeikokuDemoDarkGreenMossTex" OutName="dark_moss" Format="rgba16" Width="16" Height="16" Offset="0x6130" />
|
||||
<!-- Bright tan wrinkly bark with moss on I think, low resolution so not sure. -->
|
||||
<Texture Name="gKeikokuDemoBrightMossyBarkTex" OutName="bright_mossy_bark" Format="rgba16" Width="32" Height="32" Offset="0x6330" />
|
||||
<!-- This dirt wall looks similar to OoT:Kokiri forest wall, but brighter sand color. -->
|
||||
<Texture Name="gKeikokuDemoDirtWallTex" OutName="dirt_wall" Format="rgba16" Width="32" Height="64" Offset="0x6B30" />
|
||||
<!-- Does NOT look like the wall of trees from Lostwoods. -->
|
||||
<Texture Name="gKeikokuDemoTreeWallBackdropTex" OutName="tree_wall_backdrop" Format="i4" Width="64" Height="64" Offset="0x7B30" />
|
||||
|
||||
<Texture Name="gKeikokuDemoHangingMossTex" OutName="hanging_moss" Format="rgba16" Width="32" Height="32" Offset="0x8330" />
|
||||
<Texture Name="gKeikokuDemoStumpRingsDarkTex" OutName="stump_rings_dark" Format="rgba16" Width="32" Height="32" Offset="0x8B30" />
|
||||
|
||||
<!-- Might be mistyped, looks like pink rings to match the following stump rings texture, but pink. -->
|
||||
<Texture Name="gKeikokuDemoStumpRingsPinkTex" OutName="stump_rings_pink" Format="rgba16" Width="16" Height="32" Offset="0x9330" />
|
||||
<!-- Looks like a duplicate of gKeikokuDemoTreeCutEndGrainTex, but rotated clockwise 90deg. -->
|
||||
<Texture Name="gKeikokuDemoTreeCutEndGrain2Tex" OutName="stump_rings" Format="rgba16" Width="32" Height="32" Offset="0x9730" />
|
||||
|
||||
<!-- Duplicates of used textures: -->
|
||||
<Texture Name="gKeikokuDemoYellowFlowersOnGrass2Tex" OutName="yellow_flowers_on_grass2" Format="rgba16" Width="32" Height="32" Offset="0x9F30" />
|
||||
<Texture Name="gKeikokuDemoFallLeavesOnGrass2Tex" OutName="fall_leaves_on_grass2" Format="rgba16" Width="32" Height="32" Offset="0xA730" />
|
||||
|
||||
<Texture Name="gKeikokuDemoYoungerBarkTex" OutName="younger_bark" Format="rgba16" Width="16" Height="64" Offset="0xAF30" />
|
||||
<Texture Name="gKeikokuDemoWrinkledBarkTex" OutName="wrinkled_bark" Format="i4" Width="64" Height="64" Offset="0xB730" />
|
||||
<!-- Could be moss, could be leaves, could be dying grass, hard to tell. -->
|
||||
<Texture Name="gKeikokuDemoGreenSludgeTex" OutName="green_sludge" Format="rgba16" Width="32" Height="32" Offset="0xBF30" />
|
||||
<!-- This might be something else, nothing else looked any more accurate. -->
|
||||
<Texture Name="gKeikokuDemoWhiteYellowArtifactTex" OutName="white_yellow_artifact" Format="rgba16" Width="16" Height="32" Offset="0xC730" />
|
||||
<!-- Seems to be a dimmer version of the bright yellow on grass texture. -->
|
||||
<Texture Name="gKeikokuDemoDullYellowFlowersOnGrassTex" OutName="dull_yellow_flowers_on_grass" Format="rgba16" Width="32" Height="32" Offset="0xCB30" />
|
||||
</File>
|
||||
</Root>
|
||||
|
@ -1,7 +1,7 @@
|
||||
/*
|
||||
* File: z_dm_opstage.c
|
||||
* Overlay: ovl_Dm_Opstage
|
||||
* Description: Lost Woods cutscene objects
|
||||
* Description: Lost Woods Cutscene Trees and Floor
|
||||
*/
|
||||
|
||||
#include "z_dm_opstage.h"
|
||||
@ -44,14 +44,17 @@ void DmOpstage_Init(Actor* thisx, PlayState* play) {
|
||||
Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
|
||||
DmOpstage_SetupAction(this, DmOpstage_FollowCutsceneScript);
|
||||
Actor_SetScale(&this->dyna.actor, 0.1f);
|
||||
if (DMOPSTAGE_GET_TYPE(&this->dyna.actor) == DM_OPSTAGE_TYPE_FLOOR) {
|
||||
|
||||
if (DMOPSTAGE_GET_TYPE(&this->dyna.actor) == DMOPSTAGE_TYPE_GROUND) {
|
||||
DynaPolyActor_Init(&this->dyna, 0);
|
||||
DynaPolyActor_LoadMesh(play, &this->dyna, &object_keikoku_demo_Colheader_001C98);
|
||||
DynaPolyActor_LoadMesh(play, &this->dyna, &gKeikokuDemoFloorColliderHeader);
|
||||
}
|
||||
if (DMOPSTAGE_GET_TYPE(&this->dyna.actor) > DM_OPSTAGE_TYPE_FLOOR) {
|
||||
this->pos.x = this->dyna.actor.world.pos.x;
|
||||
this->pos.y = this->dyna.actor.world.pos.y;
|
||||
this->pos.z = this->dyna.actor.world.pos.z;
|
||||
|
||||
if (DMOPSTAGE_GET_TYPE(&this->dyna.actor) > DMOPSTAGE_TYPE_GROUND) {
|
||||
// trees move their world pos to map origin/center, then draw at their starting position
|
||||
this->drawOffset.x = this->dyna.actor.world.pos.x;
|
||||
this->drawOffset.y = this->dyna.actor.world.pos.y;
|
||||
this->drawOffset.z = this->dyna.actor.world.pos.z;
|
||||
this->dyna.actor.world.pos.x = 0.0f;
|
||||
this->dyna.actor.world.pos.y = 0.0f;
|
||||
this->dyna.actor.world.pos.z = 0.0f;
|
||||
@ -61,7 +64,7 @@ void DmOpstage_Init(Actor* thisx, PlayState* play) {
|
||||
void DmOpstage_Destroy(Actor* thisx, PlayState* play) {
|
||||
DmOpstage* this = THIS;
|
||||
|
||||
if (DMOPSTAGE_GET_TYPE(&this->dyna.actor) == DM_OPSTAGE_TYPE_FLOOR) {
|
||||
if (DMOPSTAGE_GET_TYPE(&this->dyna.actor) == DMOPSTAGE_TYPE_GROUND) {
|
||||
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
|
||||
}
|
||||
}
|
||||
@ -69,7 +72,7 @@ void DmOpstage_Destroy(Actor* thisx, PlayState* play) {
|
||||
void DmOpstage_FollowCutsceneScript(DmOpstage* this, PlayState* play) {
|
||||
s32 actionIndex;
|
||||
|
||||
if (DMOPSTAGE_GET_TYPE(&this->dyna.actor) == DM_OPSTAGE_TYPE_FLOOR) {
|
||||
if (DMOPSTAGE_GET_TYPE(&this->dyna.actor) == DMOPSTAGE_TYPE_GROUND) {
|
||||
if (Cutscene_CheckActorAction(play, 0x73)) {
|
||||
actionIndex = Cutscene_GetActorActionIndex(play, 0x73);
|
||||
if (play->csCtx.actorActions[actionIndex]->action == 2) {
|
||||
@ -81,9 +84,10 @@ void DmOpstage_FollowCutsceneScript(DmOpstage* this, PlayState* play) {
|
||||
}
|
||||
Cutscene_ActorTranslateAndYaw(&this->dyna.actor, play, actionIndex);
|
||||
}
|
||||
} else if (Cutscene_CheckActorAction(play, DMOPSTAGE_GET_08(&this->dyna.actor) + 0x74)) {
|
||||
Cutscene_ActorTranslateAndYaw(&this->dyna.actor, play,
|
||||
Cutscene_GetActorActionIndex(play, DMOPSTAGE_GET_08(&this->dyna.actor) + 0x74));
|
||||
} else if (Cutscene_CheckActorAction(play, DMOPSTAGE_GET_ACTORACTION(&this->dyna.actor) + 0x74)) {
|
||||
Cutscene_ActorTranslateAndYaw(
|
||||
&this->dyna.actor, play,
|
||||
Cutscene_GetActorActionIndex(play, DMOPSTAGE_GET_ACTORACTION(&this->dyna.actor) + 0x74));
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,6 +96,8 @@ void DmOpstage_Update(Actor* thisx, PlayState* play) {
|
||||
|
||||
this->actionFunc(this, play);
|
||||
if ((play->sceneNum == SCENE_SPOT00) && (gSaveContext.sceneSetupIndex == 0) && (play->csCtx.frames == 480)) {
|
||||
// This actor is responsible for playing the fairy sound during the exposition in the intro,
|
||||
// during the transition to Lost Woods, before Ocarina gets stolen.
|
||||
func_8019F128(NA_SE_EV_NAVY_FLY_REBIRTH);
|
||||
}
|
||||
}
|
||||
@ -99,31 +105,34 @@ void DmOpstage_Update(Actor* thisx, PlayState* play) {
|
||||
void DmOpstage_Draw(Actor* thisx, PlayState* play) {
|
||||
DmOpstage* this = THIS;
|
||||
|
||||
if (DMOPSTAGE_GET_TYPE(&this->dyna.actor) > DM_OPSTAGE_TYPE_FLOOR) {
|
||||
Matrix_Translate(this->dyna.actor.world.pos.x + this->pos.x, this->dyna.actor.world.pos.y + this->pos.y,
|
||||
this->dyna.actor.world.pos.z + this->pos.z, MTXMODE_NEW);
|
||||
if (DMOPSTAGE_GET_TYPE(&this->dyna.actor) > DMOPSTAGE_TYPE_GROUND) {
|
||||
// Assumption: worldPos is being manipulated by cutscene
|
||||
Matrix_Translate(this->dyna.actor.world.pos.x + this->drawOffset.x,
|
||||
this->dyna.actor.world.pos.y + this->drawOffset.y,
|
||||
this->dyna.actor.world.pos.z + this->drawOffset.z, MTXMODE_NEW);
|
||||
Matrix_RotateYS(this->dyna.actor.world.rot.y, MTXMODE_APPLY);
|
||||
Matrix_Scale(0.1f, 0.1f, 0.1f, MTXMODE_APPLY);
|
||||
}
|
||||
|
||||
switch (DMOPSTAGE_GET_TYPE(&this->dyna.actor)) {
|
||||
case DM_OPSTAGE_TYPE_FLOOR:
|
||||
Gfx_DrawDListOpa(play, object_keikoku_demo_DL_000978);
|
||||
Gfx_DrawDListXlu(play, object_keikoku_demo_DL_000970);
|
||||
case DMOPSTAGE_TYPE_GROUND:
|
||||
Gfx_DrawDListOpa(play, gKeikokuDemoFloorDL);
|
||||
Gfx_DrawDListXlu(play, gKeikokuDemoFloorEmptyDL);
|
||||
break;
|
||||
|
||||
case DM_OPSTAGE_TYPE_TREE1:
|
||||
Gfx_DrawDListOpa(play, object_keikoku_demo_DL_002878);
|
||||
Gfx_DrawDListXlu(play, object_keikoku_demo_DL_002870);
|
||||
case DMOPSTAGE_TYPE_ROOT_TREE:
|
||||
Gfx_DrawDListOpa(play, gKeikokuDemoTallTreeWithRootBaseDL);
|
||||
Gfx_DrawDListXlu(play, gKeikokuDemoTallTreeWithRootBaseEmptyDL);
|
||||
break;
|
||||
|
||||
case DM_OPSTAGE_TYPE_TREE2:
|
||||
Gfx_DrawDListOpa(play, object_keikoku_demo_DL_003068);
|
||||
Gfx_DrawDListXlu(play, object_keikoku_demo_DL_003060);
|
||||
case DMOPSTAGE_TYPE_CUT_TREE:
|
||||
Gfx_DrawDListOpa(play, gKeikokuDemoTallTreeCutDL);
|
||||
Gfx_DrawDListXlu(play, gKeikokuDemoTallTreeCutEmptyDL);
|
||||
break;
|
||||
|
||||
case DM_OPSTAGE_TYPE_TREE3:
|
||||
Gfx_DrawDListOpa(play, object_keikoku_demo_DL_003728);
|
||||
Gfx_DrawDListXlu(play, object_keikoku_demo_DL_003720);
|
||||
case DMOPSTAGE_TYPE_STRAIGHT_TREE:
|
||||
Gfx_DrawDListOpa(play, gKeikokuDemoTallTreeStraightDL);
|
||||
Gfx_DrawDListXlu(play, gKeikokuDemoTallTreeStraightEmptyDL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -3,26 +3,27 @@
|
||||
|
||||
#include "global.h"
|
||||
|
||||
#define DMOPSTAGE_GET_TYPE(thisx) (((thisx)->params & 0xFF))
|
||||
#define DMOPSTAGE_GET_08(thisx) (((thisx)->params >> 8) & 0xFF)
|
||||
#define DMOPSTAGE_GET_TYPE(thisx) ((thisx)->params & 0xFF)
|
||||
#define DMOPSTAGE_GET_ACTORACTION(thisx) (((thisx)->params >> 8) & 0xFF)
|
||||
|
||||
struct DmOpstage;
|
||||
|
||||
typedef void (*DmOpstageActionFunc)(struct DmOpstage*, PlayState*);
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ DMOPSTAGE_TYPE_GROUND,
|
||||
/* 1 */ DMOPSTAGE_TYPE_ROOT_TREE,
|
||||
/* 2 */ DMOPSTAGE_TYPE_CUT_TREE,
|
||||
/* 3 */ DMOPSTAGE_TYPE_STRAIGHT_TREE,
|
||||
} DmOpStageTypes;
|
||||
|
||||
typedef struct DmOpstage {
|
||||
/* 0x000 */ DynaPolyActor dyna;
|
||||
/* 0x15C */ UNK_TYPE1 pad_15C[0x44];
|
||||
/* 0x1A0 */ DmOpstageActionFunc actionFunc;
|
||||
/* 0x1A4 */ Vec3f pos;
|
||||
/* 0x1A4 */ Vec3f drawOffset;
|
||||
} DmOpstage; // size = 0x1B0
|
||||
|
||||
typedef enum {
|
||||
/* 0 */ DM_OPSTAGE_TYPE_FLOOR,
|
||||
/* 1 */ DM_OPSTAGE_TYPE_TREE1,
|
||||
/* 2 */ DM_OPSTAGE_TYPE_TREE2,
|
||||
/* 3 */ DM_OPSTAGE_TYPE_TREE3,
|
||||
} DmOpStageTypes;
|
||||
|
||||
extern const ActorInit Dm_Opstage_InitVars;
|
||||
|
||||
#endif // Z_DM_OPSTAGE_H
|
||||
|
Loading…
Reference in New Issue
Block a user