diff options
| author | Prakxo <87568477+Prakxo@users.noreply.github.com> | 2024-02-09 17:55:22 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-09 09:55:22 -0700 |
| commit | 4a679da4895cf66b68dd90a601a4c0c9e41e5409 (patch) | |
| tree | 65dba5a6079692096fdd9dd78ac0793e7a42f38f /include | |
| parent | bebacf3ba88c75c66f60ffc6f48371430607338e (diff) | |
m_actor_shadow OK (#142)
* werk
* more werk
* m_actor_shadow OK
* format
* protos fix
* jenkins happy
Diffstat (limited to 'include')
| -rw-r--r-- | include/gfx.h | 4 | ||||
| -rw-r--r-- | include/m_actor.h | 16 | ||||
| -rw-r--r-- | include/m_actor_shadow.h | 73 | ||||
| -rw-r--r-- | include/m_collision_bg.h | 4 | ||||
| -rw-r--r-- | include/m_field_info.h | 1 | ||||
| -rw-r--r-- | include/m_kankyo.h | 6 | ||||
| -rw-r--r-- | include/m_rcp.h | 2 | ||||
| -rw-r--r-- | include/sys_math3d.h | 6 |
8 files changed, 67 insertions, 45 deletions
diff --git a/include/gfx.h b/include/gfx.h index 3ab54a0..485c543 100644 --- a/include/gfx.h +++ b/include/gfx.h @@ -20,7 +20,7 @@ typedef struct GraphicsContext { /* 0x290 */ TwoHeadGfxArena polyOpa; /* 0x2A0 */ TwoHeadGfxArena polyXlu; /* 0x2B0 */ TwoHeadGfxArena unk_2B0; - /* 0x2C0 */ TwoHeadGfxArena unk_2C0; + /* 0x2C0 */ TwoHeadGfxArena shadow; /* 0x2D0 */ TwoHeadGfxArena light; /* 0x2E0 */ UNK_TYPE1 unk_2E0[0x4]; /* 0x2E4 */ UNK_PTR unk_2E4; @@ -40,7 +40,7 @@ typedef struct GraphicsContext { #define POLY_OPA_DISP __gfxCtx->polyOpa.p #define POLY_XLU_DISP __gfxCtx->polyXlu.p #define UNK_2B0_DISP __gfxCtx->unk_2B0.p -#define UNK_2C0_DISP __gfxCtx->unk_2C0.p +#define SHADOW_DISP __gfxCtx->shadow.p #define LIGHT_DISP __gfxCtx->light.p // __gfxCtx shouldn't be used directly. diff --git a/include/m_actor.h b/include/m_actor.h index 1c08512..808b592 100644 --- a/include/m_actor.h +++ b/include/m_actor.h @@ -76,16 +76,16 @@ typedef struct Shape_Info { /* 0x00 */ s_xyz rot; /* 0x08 */ f32 unk_08; /* 0x0C */ Shape_Info_unk_0C unk_0C; - /* 0x10 */ f32 unk_10; - /* 0x14 */ f32 unk_14; - /* 0x18 */ f32 unk_18; - /* 0x1C */ f32 unk_1C; - /* 0x20 */ s32 unk_20; - /* 0x24 */ xyz_t* unk_24; // maybe PosRot* + /* 0x10 */ f32 shadowSizeX; + /* 0x14 */ f32 shadowSizeZ; + /* 0x18 */ f32 shadowSizeRate; + /* 0x1C */ f32 shadowAlphaRate; + /* 0x20 */ u32 unk_20; + /* 0x24 */ xyz_t* shadowPosition; // maybe PosRot* /* 0x28 */ s32 unk_28; - /* 0x2C */ s8 unk_2C; + /* 0x2C */ u8 drawShadow; /* 0x2D */ s8 unk_2D; - /* 0x2E */ s8 unk_2E; + /* 0x2E */ u8 forceShadow; /* 0x2F */ UNK_TYPE1 unk_2F[0x1]; /* 0x30 */ xyz_t feetPos[FOOT_MAX]; } Shape_Info; // size = 0x48 diff --git a/include/m_actor_shadow.h b/include/m_actor_shadow.h index 14eac8d..2b81471 100644 --- a/include/m_actor_shadow.h +++ b/include/m_actor_shadow.h @@ -2,33 +2,52 @@ #define M_ACTOR_SHADOW_H #include "ultra64.h" +#include "m_lib.h" + +typedef struct ShadowInfo{ + /* 0x00 */ xyz_t position; + /* 0x0C */ f32 groundY; + /* 0x10 */ f32 unk10; + /* 0x14 */ f32 unk14; + /* 0x18 */ f32 unk18; + /* 0x1C */ f32 unk1C; + /* 0x20 */ s16 unk20; + /* 0x22 */ s16 unk22; + /* 0x24 */ s16 unk24; + /* 0x26 */ s16 unk26; + /* 0x28 */ char pad28[0xC]; + /* 0x34 */ s32 unk34; + /* 0x38 */ s32 kind; +}ShadowInfo; + + +s32 mActorShadow_OperateScrollLimit(s32 value, s32 step, s32 limit); +Gfx* mActorShadow_TileScroll2(u32* x1, u32* y1, s32 step1, s32 step2, s32 limit1, s32 limit2, s32 width1, s32 height1, u32* x2, u32* y2, s32 step3, s32 step4, s32 limit3, s32 limit4, s32 width2, s32 height2, Game* game); +void mActorShadow_AdjustRate(f32* rate); +void mActorShadow_GetTimeAngleY_TimeAlpha(ShadowInfo* shadow, Game_Play* play); +void mActorShadow_GetGroundAverageAngle(ShadowInfo* shadow); +void mActorShadow_GetDistanceRate(ShadowInfo* shadow, f32 rate); +f32 mActorShadow_GetAbsBigger(f32 a, f32 b); +void mActorShadow_RadiusScaleRate(Actor* actor, ShadowInfo* shadow); +void mActorShadow_GetShadowTopPos_GetSlideS(ShadowInfo* shadow); +Gfx* mActorShadow_SetTexScroll(Actor* actor, ShadowInfo* shadow, Game* game); +void mActorShadow_GetLastAlphaScale(f32* scale, u8* alpha, Actor* actor, ShadowInfo* shadow); +void mActorShadow_DrawActorShadow(Actor* actor, ShadowInfo* shadow, Game* game, f32 rad, s32 id, xyz_t ofs); +void mActorShadow_GetShadowPosition(Actor* actor, xyz_t* position); +s32 mActorShadow_GetShadowKind(void); +f32 mAc_GetShadowGroundY_NoneForce(ShadowInfo* shadow); +f32 mAc_GetShadowGroundY_Force(ShadowInfo* shadow); +void mAc_DecideShadowRadius_IamNotFish(ShadowInfo* shadow, Actor* actor, f32* radius); +void mAc_DecideShadowRadius_IamFish(ShadowInfo* shadow, Actor* actor, f32* radius); +void mAc_ActorShadowDraw_ShadowDrawFlagOff(Actor* actor, Game_Play* play, s32 arg2, xyz_t arg3, f32 arg6); +void mAc_ActorShadowDraw_ShadowDrawFlagOn(Actor* actor, Game_Play* play, s32 proc, xyz_t pos, f32 rate); +void mAc_ActorShadowDraw(Actor* actor, Game_Play* play, s32 arg2, xyz_t arg3, f32 arg6); +void mActorShadow_SetForceShadowPos(Actor* actor, xyz_t* pos); +void mActorShadow_UnSetForceShadowPos(Actor* actor); +void mAc_NormalActorShadow(Actor* actor, Game_Play* play, f32 rad); +void mAc_UnagiActorShadow(Actor* actor, Game_Play* play, xyz_t pos); +void mAc_ActorShadowCircle(Actor* actor, LightsN* lights, Game_Play* play); +void mAc_ActorShadowEllipse(Actor* actor, LightsN* lights, Game_Play* play); -// void mActorShadow_OperateScrollLimit(); -// void mActorShadow_TileScroll2(); -// void mActorShadow_AdjustRate(); -// void mActorShadow_GetTimeAngleY_TimeAlpha(); -// void mActorShadow_GetGroundAverageAngle(); -// void mActorShadow_GetDistanceRate(); -// void mActorShadow_GetAbsBigger(); -// void mActorShadow_RadiusScaleRate(); -// void mActorShadow_GetShadowTopPos_GetSlideS(); -// void mActorShadow_SetTexScroll(); -// void mActorShadow_GetLastAlphaScale(); -// void mActorShadow_DrawActorShadow(); -// void mActorShadow_GetShadowPosition(); -// void mActorShadow_GetShadowKind(); -// void mAc_GetShadowGroundY_NoneForce(); -// void mAc_GetShadowGroundY_Force(); -// void mAc_DecideShadowRadius_IamNotFish(); -// void mAc_DecideShadowRadius_IamFish(); -// void mAc_ActorShadowDraw_ShadowDrawFlagOff(); -// void mAc_ActorShadowDraw_ShadowDrawFlagOn(); -// void mAc_ActorShadowDraw(); -// void mActorShadow_SetForceShadowPos(); -// void mActorShadow_UnSetForceShadowPos(); -// void mAc_NormalActorShadow(); -// void mAc_UnagiActorShadow(); -// void mAc_ActorShadowCircle(); -// void mAc_ActorShadowEllipse(); #endif diff --git a/include/m_collision_bg.h b/include/m_collision_bg.h index a55f16f..b231c38 100644 --- a/include/m_collision_bg.h +++ b/include/m_collision_bg.h @@ -193,12 +193,12 @@ void func_8006C8D0_jp(void); // void func_80071064_jp(); // void func_800713CC_jp(); // void func_80071460_jp(); -// void mCoBG_GetShadowBgY_AngleS_FromWpos(); +f32 mCoBG_GetShadowBgY_AngleS_FromWpos(s_xyz*, xyz_t,f32); // void func_800715B4_jp(); // void func_80071604_jp(); // void func_80071728_jp(); // void func_8007175C_jp(); -// void func_80071884_jp(); +f32 mCoBG_GetBgY_AngleS_FromWpos(s_xyz* angleToGround, xyz_t wpos, f32 offsetY); // void func_80071A08_jp(); // void func_80071AB8_jp(); f32 mCoBG_GetBgY_OnlyCenter_FromWpos2(xyz_t arg0, f32 arg1); diff --git a/include/m_field_info.h b/include/m_field_info.h index b9a6f13..6dd33d5 100644 --- a/include/m_field_info.h +++ b/include/m_field_info.h @@ -23,6 +23,7 @@ typedef enum FieldType { #define FI_TO_FIELD_ID(type, index) (((type) << 12) | (index)) +#define FI_GET_TYPE(id) ((id) & 0xF000) typedef enum FieldRoom { /* 0x6000 */ FI_FIELD_PLAYER0_ROOM = FI_TO_FIELD_ID(FI_FIELDTYPE_PLAYER_ROOM, 0), diff --git a/include/m_kankyo.h b/include/m_kankyo.h index 5447f4f..8061f79 100644 --- a/include/m_kankyo.h +++ b/include/m_kankyo.h @@ -24,7 +24,9 @@ typedef struct Kankyo { /* 0xAE */ u8 unk_AE; /* 0xAF */ u8 unk_AF; /* 0xB0 */ u8 unk_B0; - /* 0xB1 */ UNK_TYPE1 unk_B1[0xF]; + /* 0xB1 */ UNK_TYPE1 unk_B1[0xB]; + /* 0xBC */ u8 shadowAlpha; + /* 0xBD */ UNK_TYPE1 unk_BD[0x2]; /* 0xC0 */ Kankyo_unk_C0 unk_C0; /* 0xC4 */ UNK_TYPE1 unk_C4[0x4]; } Kankyo; // size = 0xC8 @@ -78,7 +80,7 @@ void mEnv_DecideWeather_NormalGameStart(void); // void func_8009949C_jp(); // void func_80099594_jp(); // void func_800996CC_jp(); -// void mEnv_GetShadowPrimColor_Light(); +void mEnv_GetShadowPrimColor_Light(u8*,u8*,u8*, struct Game*); // void func_80099718_jp(); // void func_80099728_jp(); // void mEnv_MakeWindowLightAlpha(); diff --git a/include/m_rcp.h b/include/m_rcp.h index e4a33d3..93dd903 100644 --- a/include/m_rcp.h +++ b/include/m_rcp.h @@ -15,7 +15,7 @@ Gfx* gfx_set_fog_nosync(Gfx* gfx, u8 arg1, u8 arg2, u8 arg3, s32 arg4, s16 arg5, // void func_800BD498_jp(); // void func_800BD4C0_jp(); void _texture_z_light_fog_prim(struct GraphicsContext *gfxCtx); -// void _texture_z_light_fog_prim_shadow(); +void _texture_z_light_fog_prim_shadow(struct GraphicsContext*); // void func_800BD538_jp(); void _texture_z_light_fog_prim_xlu(struct GraphicsContext *gfxCtx); void func_800BD5C0_jp(struct GraphicsContext* gfxCtx); diff --git a/include/sys_math3d.h b/include/sys_math3d.h index 525a89f..58e1405 100644 --- a/include/sys_math3d.h +++ b/include/sys_math3d.h @@ -111,9 +111,9 @@ s32 Math3D_pipeVsPipe_cl(Pipe* pipe1, Pipe* pipe2, f32* arg2); // void func_800DFCA4_jp(); // void func_800DFD10_jp(); // void func_800DFD7C_jp(); -// void sMath_RotateY(); -// void sMath_RotateX(); -// void sMath_RotateZ(); +void sMath_RotateY(xyz_t* pos, f32 rad); +void sMath_RotateX(xyz_t* pos, f32 rad); +void sMath_RotateZ(xyz_t* pos, f32 rad); extern xyz_t ZeroVec; |
