diff options
| author | fig02 <fig02srl@gmail.com> | 2025-06-04 14:38:33 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-04 14:38:33 -0400 |
| commit | 28cc9d68cfe4a037eb232d5465b84a943539bca3 (patch) | |
| tree | 4001d36dccb035576f3cbf17cf9a548cdc9c5b3f /include/curve.h | |
| parent | e8b708a4480e568f409c8e53986c2e96595b9405 (diff) | |
Remove "z64" prefix from all headers (#2518)
* z64 - a
* z64 - b
* z64 - c
* z64 - d
* z64 - e
* z64 - f
* z64 - g
* z64 - h
* z64 - i
* z64 - l
* z64 - m
* z64 - o
* z64 - p
* z64 - q
* z64 - r
* z64 - s
* z64 - t
* z64 - v
* restore file
* fix merge
* fix merge
---------
Co-authored-by: Dragorn421 <Dragorn421@users.noreply.github.com>
Diffstat (limited to 'include/curve.h')
| -rw-r--r-- | include/curve.h | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/include/curve.h b/include/curve.h new file mode 100644 index 000000000..8779b04b4 --- /dev/null +++ b/include/curve.h @@ -0,0 +1,62 @@ +#ifndef CURVE_H +#define CURVE_H + +#include "ultra64.h" + +struct PlayState; +struct Actor; + +typedef struct CurveInterpKnot { + /* 0x0 */ u16 flags; // Only the bottom two bits are used, although others are set in objects + /* 0x2 */ s16 abscissa; // knot input value + /* 0x4 */ s16 leftGradient; // left derivative at the point + /* 0x6 */ s16 rightGradient; // right derivative at the point + /* 0x8 */ f32 ordinate; // output value +} CurveInterpKnot; // size = 0xC + +typedef struct CurveAnimationHeader { + /* 0x0 */ u8* knotCounts; + /* 0x4 */ CurveInterpKnot* interpolationData; + /* 0x8 */ s16* constantData; + /* 0xC */ s16 unk_0C; // Set but not used, always 1 in objects + /* 0xE */ s16 frameCount; // Not used, inferred from use in objects +} CurveAnimationHeader; // size = 0x10 + +typedef struct SkelCurveLimb { + /* 0x0 */ u8 child; + /* 0x1 */ u8 sibling; + /* 0x4 */ Gfx* dList[2]; +} SkelCurveLimb; // size = 0xC + +typedef struct CurveSkeletonHeader { + /* 0x0 */ SkelCurveLimb** limbs; + /* 0x4 */ u8 limbCount; +} CurveSkeletonHeader; // size = 0x8 + +typedef struct SkelCurve { + /* 0x00 */ u8 limbCount; + /* 0x04 */ SkelCurveLimb** skeleton; + /* 0x08 */ CurveAnimationHeader* animation; + /* 0x0C */ f32 unk_0C; // set but not used + /* 0x10 */ f32 endFrame; + /* 0x14 */ f32 playSpeed; + /* 0x18 */ f32 curFrame; + /* 0x1C */ s16 (*jointTable)[9]; +} SkelCurve; // size = 0x20 + +typedef s32 (*OverrideCurveLimbDraw)(struct PlayState* play, SkelCurve* skelCuve, s32 limbIndex, void* thisx); +typedef void (*PostCurveLimbDraw)(struct PlayState* play, SkelCurve* skelCuve, s32 limbIndex, void* thisx); + +f32 Curve_Interpolate(f32 x, CurveInterpKnot* knots, s32 knotCount); + +void SkelCurve_Clear(SkelCurve* skelCurve); +s32 SkelCurve_Init(struct PlayState* play, SkelCurve* skelCurve, CurveSkeletonHeader* skeletonHeaderSeg, + CurveAnimationHeader* animation); +void SkelCurve_Destroy(struct PlayState* play, SkelCurve* skelCurve); +void SkelCurve_SetAnim(SkelCurve* skelCurve, CurveAnimationHeader* animation, f32 arg2, f32 endFrame, f32 curFrame, + f32 playSpeed); +s32 SkelCurve_Update(struct PlayState* play, SkelCurve* skelCurve); +void SkelCurve_Draw(struct Actor* actor, struct PlayState* play, SkelCurve* skelCurve, OverrideCurveLimbDraw overrideLimbDraw, + PostCurveLimbDraw postLimbDraw, s32 lod, void* data); + +#endif |
