mirror of
https://github.com/zeldaret/tww.git
synced 2026-07-31 07:56:24 -04:00
d_menu_cloth matching (#937)
* Add `l_matDL` symbols and assets to config files for all regions for d_menu_cloth * Extend `daCLOTH_HIO_c` with `JORReflexible` and add static instance `l_HIO` in `d_menu_cloth` * Refactor `d_menu_cloth.h` to improve naming consistency for member variables. * Initialize `dMCloth_c` member variables and create HIO child in constructor * Include `l_matDL` in `d_menu_cloth` and call it in `dMCloth_c::draw`. * Add private member variables to `daCLOTH_HIO_c` in `d_menu_cloth.h` * Add virtual destructor to `daCLOTH_HIO_c` in `d_menu_cloth.h` * Swap `daCLOTH_HIO_c` and `daCLOTH_ChildHIO_c` class definitions and adjust member variables in `d_menu_cloth.h`. * Remove non-matching comments from `daCLOTH_ChildHIO_c` constructor and destructor in `d_menu_cloth.cpp`. * Initialize `daCLOTH_HIO_c` member variables and update `daCLOTH_ChildHIO_c` access modifiers in `d_menu_cloth`. * Remove unused member variables from `daCLOTH_HIO_c` and `daCLOTH_ChildHIO_c` in `d_menu_cloth.h`. * Match dMCloth_c::dMCloth_c * Match `dMCloth_c::init`. * Match `dMCloth_c` destructor. * Refactor `dMCloth_c` to use `mCurArr` for indexing and update structure definitions in `d_menu_cloth`. * Define `ARR_SIZE` constant and replace hardcoded array sizes in `d_menu_cloth`. * Match dMCloth_c::TevSetting * Match dMCloth_c::TevSettingMenu * Match `dMCloth_c::TevSettingMenu` and `dMCloth_c::TevSettingFileSelect`. * Match `dMCloth_c::lightSet1` * Start matching `dMCloth_c::cloth_init` and update structure definitions to use `INNER_SIZE` constant, optimize initialization logic, and replace redundant assignments with consolidated methods. * Match `dMCloth_c::setNrmVtx` implementation and update header declaration. * Match `daCLOTH_HIO_c` destructor implementation. * Match `dMenu_ClothCreate`, `dMenu_ClothDelete`, `dMenu_ClothExecute`, `dMenu_ClothDraw`, and `dMenu_ClothIsDelete` implementations and update related structure definitions. * Update `g_fopAc_Method` reference to `g_fopMsg_Method` in cloth menu structure. * Match `dMCloth_c::cloth_move` implementation and update type definitions for `field_0xa` and `field_0x34` to `s16`. * Start matching `dMCloth_c::cloth_move_sin` and `dMCloth_c::cloth_move_simple` implementations. * Match `dMCloth_c::ShadowTevSetting` implementation. * Match `dMCloth_c::ShadowTevSettingMenu` and `dMCloth_c::ShadowTevSettingFileSelect` implementations. * Match `dMCloth_c::alpha_out` implementation. * Match `dMCloth_c::plot` implementation and minor formatting fix in `dMCloth_c::ShadowTevSettingMenu`. * Refactor `d_menu_cloth` to replace s16 color fields with `GXColorS10` and `GXColor` structures. Update all related logic and structure definitions accordingly. * Match `dMCloth_c::draw` implementation, refactor initialization of `field_0x10`, and update associated structure definitions. * Match `dMCloth_c::plot_shadow` implementation and update parameter names in `plot` and `plot_shadow` declarations. * Update `d_menu_cloth` to use `msg_method_class` and `msg_process_profile_definition`. Refactor structure definitions and add TODO comment for size clarification. * Add member comments in `dMenu_ClothMethodTable` * Refactor `d_menu_cloth` to improve pointer arithmetic in `plot` loop and add missing implementations for `getOffsetVec` and `getShadowPos`. * Refactor `dMCloth_c::plot` to improve naming consistency for loop variables and pointer arithmetic. * Refactor `d_menu_cloth` to replace repeated member accesses with `HIO_CHILD` macro for improved readability and maintainability. * Rename fields in `d_menu_cloth` * Add clarifying comments in `dMenu_ClothMethodTable` about function order and usage * Use `TRUE` and `FALSE` macros instead of literal values in `d_menu_cloth` methods for consistency. * Replace numeric cloth type values with `MenuClothType` enum for improved readability and maintainability in `d_menu_cloth`. * Refactor `dMCloth_c::cloth_init`: replace raw pointer arithmetic with `set` calls for improved clarity and maintainability. * Refactor `MENU_CLOTH_TYPE_2` logic: replace hardcoded rotation calculation with `cM_deg2s` for clarity and maintainability. * Change `wavePreSteps` type from `u16` to `s16` in `d_menu_cloth` for alignment with signed calculations. * Replace hardcoded angle conversion with `cM_deg2s` in `MENU_CLOTH_TYPE_0` logic for improved clarity and maintainability. * Change `mWaveProgress` type from `u16` to `s16` in `d_menu_cloth` for consistency with signed calculations. * Match `cloth_init` in `d_menu_cloth` * Fix `INNER_SIZE` iteration in `d_menu_cloth` to properly handle loop bounds. * Update vertex attribute formats in `d_menu_cloth` for improved correctness. * Add inline utility function `GXColor4x8` to `GX.h` for streamlined color input handling * Refactor triangle strip generation in `d_menu_cloth` for improved readability and maintainability. * Refactor vertex and texture coordinate handling in `dMCloth_c::plot_shadow` for improved clarity and correctness. * Refactor vertex handling in `d_menu_cloth` to group vertex and texture operations for improved readability and structure. * Add `GXNormal1x16` and `GXColor3x8` inline utility functions to `GX.h` for simplified normal and color input handling. * Update vertex format in `d_menu_cloth` to use `GXPosition1x16` and `GXNormal1x16` for improved attribute handling. * Add `dMs_clothOnly_create` and `dMs_clothOnly_delete` implementations in `d_menu_window` * Implement `dMs_cloth_create` and `dMs_cloth_delete` functions in `d_menu_window` and update related structure definitions. * Replace hardcoded cloth type with `MENU_CLOTH_TYPE_2` constant in `d_menu_window`. * Refactor `MENU_CLOTH_TYPE` enum names for clarity and update all references across `d_menu_cloth`, `d_s_name`, and `d_menu_window`. * Refactor `mChildren` array indexing in `daCLOTH_HIO_c` constructor to use `MENU_CLOTH_TYPE` constants for improved readability and maintainability. * Refactor `color1` and `color2` fields to `clothColor` and `shadowColor` for improved clarity in `d_menu_cloth` structure and related logic. * Simplify alpha blending logic by removing redundant variables in `d_menu_cloth`. * Refactor `mColor1`/`mColor2` to `mClothColor`/`mShadowColor` for improved clarity in `d_menu_cloth` and update all related logic. * Add temporary `dummy0` function in `d_menu_window` for placeholder debug strings. * Refactor position array access in `d_menu_cloth` to use `getPos()` result for better clarity and maintainability. * Change `waveFreqX` and `waveFreqY` types from `u16` to `s16` in `d_menu_cloth` structure for consistency. * Add demo version-specific mipmap handling logic in `d_menu_cloth` initialization. * Remove demo version-specific mipmap handling logic in `d_menu_cloth` initialization. * Match `cloth_move_sin` and `cloth_move_simple`. * Refactor loop variable initialization in `d_menu_cloth` for improved clarity. * Refactor variable names in alpha calculation for improved clarity in `d_menu_cloth`. * Inline vertex index calculations in `d_menu_cloth` to simplify code and reduce redundant variables. * Match `plot` and `plot_shadow`. * Refactor `lightDistance` variable in `d_menu_cloth` for improved clarity. * Inline empty destructor for `daCLOTH_HIO_c` in `d_menu_cloth` to simplify code. * Match `plot` and `plot_shadow` in demo build. * Update vertex attribute formats and streamline vertex function calls in `d_cloth_packet`. * Match `cloth_init` for JP version * Match `init` for JP version * Match `draw` for JP version * Add TODO note to identify superclass for correct size in `menu_cloth_class`. * Match `d_menu_cloth` for specific regions: GZLJ01, GZLE01, GZLP01. * Adjust `plot_shadow` parameters in `d_menu_cloth` for consistent shadow scaling. * Add dummy functions to ensure correct float order in `d_menu_cloth`. * Use version-specific scale values for `MENU_CLOTH_TYPE_DEFAULT` in `d_menu_cloth`. * Normalize hex color and value formatting in `d_menu_cloth`. * Add `STATIC_ASSERT` checks for struct size validation in `d_menu_cloth`. * Rename ambiguous `field` members to `padding` in `d_menu_cloth` and update struct size. * Replace `menu_cloth_class` size calculation with `sizeof(dMCloth_c)` in `d_menu_cloth`. * Revert "Replace `menu_cloth_class` size calculation with `sizeof(dMCloth_c)` in `d_menu_cloth`." This reverts commit3920b07e1a. * Revert "Rename ambiguous `field` members to `padding` in `d_menu_cloth` and update struct size." This reverts commit153ee490bf. * Rename placeholder fields to `padding_*` in `d_menu_cloth` for clarity. * Update `menu_cloth_class` size handling with `STATIC_ASSERT` and padding. * Clarify comment for `dMenu_ClothMethodTable` initialization. * Replace hardcoded offsets with calculated `INNER_SIZE`-based sizes in `d_menu_cloth`. * Remove stray comments in `setClothType` definition and invocation. * Annotate `mStatus` with offset comment in `dDlst_MENU_CAPTURE_c`. * Replace `g_dComIfG_gameInfo.play` calls with `dComIfGp_` equivalents in `d_menu_window`.
This commit is contained in:
+84
-27
@@ -7,27 +7,34 @@
|
||||
|
||||
class JKRArchive;
|
||||
|
||||
enum {
|
||||
MENU_CLOTH_TYPE_DEFAULT = 0,
|
||||
MENU_CLOTH_TYPE_FILE_SELECT = 1,
|
||||
MENU_CLOTH_TYPE_CLOTH_ONLY = 2,
|
||||
};
|
||||
typedef u8 MenuClothType;
|
||||
|
||||
class dMCloth_c {
|
||||
public:
|
||||
dMCloth_c();
|
||||
virtual ~dMCloth_c();
|
||||
|
||||
void getBackNrm() {}
|
||||
void getNrm() {}
|
||||
void getOffsetVec() {}
|
||||
void getPos() {}
|
||||
void getShadowPos() {}
|
||||
void getTexObj() {}
|
||||
void setArchive(JKRArchive* arc) { field_0x44 = arc; }
|
||||
void setClothType(u8 type) { field_0x913d = type; } // ?
|
||||
cXyz* getPos() { return mPosArr[mCurArr]; }
|
||||
cXyz* getNrm() { return mNrmArr[mCurArr]; }
|
||||
cXyz* getBackNrm() { return mBackNrmArr; }
|
||||
cXyz* getOffsetVec() { return mOffsetVecArr; }
|
||||
cXyz* getShadowPos() { return mShadowPosArr; }
|
||||
GXTexObj* getTexObj() { return &mTexObj; }
|
||||
void setArchive(JKRArchive* arc) { mpArc = arc; }
|
||||
void setClothType(MenuClothType type) { mClothType = type; }
|
||||
|
||||
void lightSet1(cXyz);
|
||||
void cloth_init();
|
||||
void init();
|
||||
void setBackNrm();
|
||||
void setNrmVtx(cXyz*, int, int);
|
||||
void plot(float, float, float, float);
|
||||
void plot_shadow(float, float, float, float);
|
||||
void setNrmVtx(cXyz* pDst, int x, int y);
|
||||
void plot(float xMin, float yMin, float xMax, float yMax);
|
||||
void plot_shadow(float xMin, float yMin, float xMax, float yMax);
|
||||
void alpha_out();
|
||||
void TevSettingMenu();
|
||||
void TevSettingFileSelect();
|
||||
@@ -40,28 +47,78 @@ public:
|
||||
void cloth_move_simple();
|
||||
void cloth_move();
|
||||
|
||||
/* 0x0004 */ u8 field_0x4[0x44 - 0x04];
|
||||
/* 0x0044 */ JKRArchive* field_0x44;
|
||||
/* 0x0048 */ cXyz field_0x48[882];
|
||||
/* 0x29A0 */ cXyz field_0x29a0[882];
|
||||
/* 0x52F8 */ cXyz field_0x52f8[441];
|
||||
/* 0x67A4 */ cXyz field_0x67a4[441];
|
||||
/* 0x7C50 */ cXyz field_0x7c50[441];
|
||||
/* 0x90FC */ GXTexObj field_0x90fc;
|
||||
/* 0x911C */ u8 field_0x911c[0x913D - 0x911C];
|
||||
/* 0x913D */ u8 field_0x913d;
|
||||
/* 0x913E */ u8 field_913e[0x9168 - 0x913E];
|
||||
private:
|
||||
static s16 init_angle_z;
|
||||
|
||||
public:
|
||||
static const int ARR_SIZE = 441;
|
||||
static const int INNER_SIZE = 11;
|
||||
|
||||
/* 0x0004 */ u16 unused_0x4;
|
||||
/* 0x0006 */ u8 padding_0x6[0x08 - 0x06];
|
||||
/* 0x0008 */ s16 mWaveProgress;
|
||||
/* 0x000A */ s16 mFadeInCounter;
|
||||
/* 0x000C */ u8 mAlphaOut;
|
||||
/* 0x000D */ u8 mCurrentAlpha;
|
||||
/* 0x000E */ u8 padding_0xe[0x44 - 0x0E];
|
||||
/* 0x0044 */ JKRArchive* mpArc;
|
||||
/* 0x0048 */ cXyz mPosArr[2][ARR_SIZE];
|
||||
/* 0x29A0 */ cXyz mNrmArr[2][ARR_SIZE];
|
||||
/* 0x52F8 */ cXyz mBackNrmArr[ARR_SIZE];
|
||||
/* 0x67A4 */ cXyz mOffsetVecArr[ARR_SIZE];
|
||||
/* 0x7C50 */ cXyz mShadowPosArr[ARR_SIZE];
|
||||
/* 0x90FC */ GXTexObj mTexObj;
|
||||
/* 0x911C */ u8 padding_0x911c[0x913C - 0x911C];
|
||||
/* 0x913C */ u8 mCurArr;
|
||||
/* 0x913D */ MenuClothType mClothType;
|
||||
/* 0x913E */ u8 padding_0x913e[0x9140 - 0x913E];
|
||||
/* 0x9140 */ cXyz mScale;
|
||||
/* 0x914C */ u8 padding_0x914C[0x9158 - 0x914C];
|
||||
/* 0x9158 */ csXyz mRot;
|
||||
/* 0x915E */ GXColor mClothColor;
|
||||
/* 0x9162 */ GXColor mShadowColor;
|
||||
};
|
||||
|
||||
class daCLOTH_HIO_c {
|
||||
public:
|
||||
daCLOTH_HIO_c();
|
||||
};
|
||||
STATIC_ASSERT(sizeof(dMCloth_c) == 0x9168);
|
||||
|
||||
class daCLOTH_ChildHIO_c {
|
||||
public:
|
||||
daCLOTH_ChildHIO_c();
|
||||
~daCLOTH_ChildHIO_c();
|
||||
virtual ~daCLOTH_ChildHIO_c();
|
||||
|
||||
public:
|
||||
/* 0x0004 */ cXyz scale;
|
||||
/* 0x0010 */ cXyz pos;
|
||||
/* 0x001c */ csXyz rot;
|
||||
/* 0x0022 */ GXColorS10 clothColor;
|
||||
/* 0x002a */ GXColorS10 shadowColor;
|
||||
/* 0x0032 */ s16 startAlpha;
|
||||
/* 0x0034 */ s16 fadeInLength;
|
||||
/* 0x0036 */ s16 waveProgressStep;
|
||||
/* 0x0038 */ s16 waveFreqX;
|
||||
/* 0x003a */ s16 waveFreqY;
|
||||
/* 0x003c */ f32 waveAmpX;
|
||||
/* 0x0040 */ f32 waveAmpY;
|
||||
/* 0x0044 */ f32 waveAmpZ;
|
||||
/* 0x0048 */ s16 lightPitch;
|
||||
/* 0x004a */ s16 lightYaw;
|
||||
/* 0x004c */ f32 lightDistance;
|
||||
/* 0x0050 */ s16 wavePreSteps;
|
||||
/* 0x0054 */ f32 maxStep;
|
||||
};
|
||||
|
||||
STATIC_ASSERT(sizeof(daCLOTH_ChildHIO_c) == 0x58);
|
||||
|
||||
class daCLOTH_HIO_c : public JORReflexible {
|
||||
public:
|
||||
daCLOTH_HIO_c();
|
||||
virtual ~daCLOTH_HIO_c() {}
|
||||
|
||||
public:
|
||||
/* 0x0004 */ s8 mNo;
|
||||
/* 0x0008 */ daCLOTH_ChildHIO_c mChildren[3];
|
||||
};
|
||||
|
||||
STATIC_ASSERT(sizeof(daCLOTH_HIO_c) == 0x110);
|
||||
|
||||
#endif /* D_MENU_CLOTH_H */
|
||||
|
||||
@@ -3,9 +3,13 @@
|
||||
|
||||
#include "dolphin/types.h"
|
||||
|
||||
class JKRExpHeap;
|
||||
|
||||
class sub_ms_screen_class {
|
||||
public:
|
||||
|
||||
u8 field_0x00[0xFC - 0x00];
|
||||
JKRHeap* parentHeap_0xfc;
|
||||
JKRHeap* childHeap;
|
||||
};
|
||||
|
||||
class dMw_HIO_c {
|
||||
@@ -18,5 +22,4 @@ public:
|
||||
dMw_DHIO_c();
|
||||
};
|
||||
|
||||
|
||||
#endif /* D_MENU_WINDOW_H */
|
||||
|
||||
Reference in New Issue
Block a user