Skip to content

Commit

Permalink
clean up d_wood and d_tree data, match d_wood on JPN, match rest of d…
Browse files Browse the repository at this point in the history
…_tree .data section
  • Loading branch information
LagoLunatic committed Oct 31, 2024
1 parent 64cc277 commit 2dfcdd8
Show file tree
Hide file tree
Showing 5 changed files with 925 additions and 184 deletions.
2 changes: 1 addition & 1 deletion configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def MatchingFor(*versions):
Object(NonMatching, "d/d_cam_style.cpp"),
Object(NonMatching, "d/d_cam_type2.cpp"),
Object(NonMatching, "d/d_ev_camera.cpp"),
Object(MatchingFor("GZLE01", "GZLP01"), "d/d_wood.cpp", extra_cflags=["-sym off"]),
Object(Matching, "d/d_wood.cpp", extra_cflags=["-sym off"]),
Object(NonMatching, "d/d_flower.cpp"),
Object(Matching, "d/d_item_data.cpp"),
Object(Matching, "d/d_seafightgame.cpp"),
Expand Down
11 changes: 7 additions & 4 deletions include/d/d_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,20 @@
#define D_TREE_H

#include "SSystem/SComponent/c_xyz.h"
#include "d/d_particle.h"
#include "dolphin/mtx/mtx.h"
#include "JSystem/J3DGraphBase/J3DPacket.h"

class cCcD_Obj;
class dCcMassS_HitInf;
class fopAc_ac_c;

extern const u32 g_dTree_shadowMatDL_SIZE;
extern const u32 g_dTree_Oba_kage_32DL_SIZE;
extern u8 g_dTree_shadowPos[4][3];
extern u8 g_dTree_shadowTexCoord[4][2];
extern u8 g_dTree_shadowMatDL[];
extern u8 g_dTree_Oba_kage_32DL[];
extern u8 g_dTree_shadowPos[12];
extern u8 g_dTree_shadowTexCoord[8];
extern const u32 g_dTree_shadowMatDL_SIZE;
extern const u32 g_dTree_Oba_kage_32DL_SIZE;

class dTree_data_c {
public:
Expand All @@ -38,6 +39,8 @@ class dTree_data_c {
/* 0x0A0 */ Mtx mShadowMtx;
/* 0x0D0 */ u8 field_0x0D0[0x100 - 0x0D0];
/* 0x100 */ dTree_data_c* mpNext;

static dPa_smokeEcallBack mSmokeEcallback;
};

class dTree_anm_c {
Expand Down
22 changes: 10 additions & 12 deletions include/d/d_wood.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#define D_WOOD_H

#include "JSystem/J3DGraphBase/J3DPacket.h"
#include "JSystem/J3DGraphBase/J3DStruct.h"
#include "SSystem/SComponent/c_xyz.h"
#include "dolphin/mtx/mtx.h"
#include "d/d_kankyo.h"
Expand Down Expand Up @@ -48,19 +47,18 @@ class Unit_c {

/* 0x000 */ cXyz mPos;
/* 0x00C */ s16 mAnimCooldown; // In frames. Animations will not change unless this is 0.
/* 0x00E */ u8 field_0x00C[0x010 - 0x00E];
/* 0x010 */ State_e mFlags;
/* 0x014 */ AnmID_e mAnmIdx;
/* 0x018 */ Mtx mModelViewMtx;
/* 0x048 */ Mtx mTrunkModelViewMtx;
/* 0x078 */ Mtx mShadowModelMtx;
/* 0x0A8 */ Mtx mShadowModelViewMtx;
/* 0x0D8 */ Unit_c* mpNext;

/* 0x0DC */ dKy_tevstr_c mTevStr;
};
}; // Size: 0x18C

STATIC_ASSERT(sizeof(Unit_c) == 0x18C);

class Anm_c {
public:
enum Mode_e {
Expand All @@ -85,16 +83,16 @@ class Anm_c {
// The mode_*() function is called to update the animation each frame, until finished
// Their are 8 pre-allocated "normal" animations. When not animating, each unit is assigned one of the 8.

void mode_cut_init(const Anm_c*, short);
void mode_cut_init(const Anm_c*, s16);
void mode_cut(Packet_c*);
void mode_push_into_init(const Anm_c*, short);
void mode_push_into_init(const Anm_c*, s16);
void mode_push_into(Packet_c*);
void mode_push_back_init();
void mode_push_back(Packet_c*);
void mode_fan(Packet_c*);
void mode_norm_init();
void mode_norm(Packet_c*);
void mode_norm_set_wind(float, short);
void mode_norm_set_wind(f32, s16);
void mode_to_norm_init(AnmID_e);
void mode_to_norm(Packet_c*);

Expand All @@ -109,11 +107,11 @@ class Anm_c {
/* 0x60 */ Mode_e mMode;

/* 0x64 */ s16 mCountdown;
/* 0x66 */ s16 mForceDir; // The direction from the wind or actor who instigated this animation
/* 0x68 */ float mWindPow; // 0.0 - 1.0
/* 0x6c */ float mPosOffsetY;
/* 0x70 */ float mPosOffsetZ;
/* 0x74 */ float mVelY;
/* 0x66 */ s16 mForceDir; // The direction from the wind or actor who instigated this animation
/* 0x68 */ f32 mWindPow; // 0.0 - 1.0
/* 0x6c */ f32 mPosOffsetY;
/* 0x70 */ f32 mPosOffsetZ;
/* 0x74 */ f32 mVelY;

/* 0x78 */ s16 mPhaseY[2];
/* 0x7c */ s16 mPhaseX[2];
Expand Down
Loading

0 comments on commit 2dfcdd8

Please sign in to comment.