summaryrefslogtreecommitdiff
path: root/include/z64keyframe.h
blob: 30130d95bd81f0d9039ae67d71a17d1a549c0811 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#ifndef Z64_KEYFRAME_H
#define Z64_KEYFRAME_H

#include "ultra64.h"
#include "z64math.h"

struct PlayState;

#define KEYFRAME_OPA (0 << 0)
#define KEYFRAME_XLU (1 << 0)

struct SkeletonInfo;
struct SkeletonInfo2;

typedef s32 (*OverrideKeyframeDraw)(struct PlayState* play, struct SkeletonInfo2* skeleton, s32 limbIndex, Gfx** dList,
                                    u8* flags, void* arg, Vec3s* rot, Vec3f* pos);
typedef void (*PostKeyframeDraw)(struct PlayState* play, struct SkeletonInfo2* skeleton, s32 limbIndex, Gfx** dList,
                                 u8* flags, void* arg, Vec3s* rot, Vec3f* pos);

typedef s32 (*OverrideKeyframeDrawScaled)(struct PlayState* play, struct SkeletonInfo* skeleton, s32 limbIndex, Gfx** dList,
                                          u8* flags, void* arg, Vec3f* scale, Vec3s* rot, Vec3f* pos);
typedef void (*PostKeyframeDrawScaled)(struct PlayState* play, struct SkeletonInfo* skeleton, s32 limbIndex, Gfx** dList,
                                       u8* flags, void* arg, Vec3f* scale, Vec3s* rot, Vec3f* pos);

typedef s32 (*UnkKeyframeCallback)(struct PlayState* play, struct SkeletonInfo* skeletonInfo, s32* arg2, Gfx** dList, u8* arg4, void*);

// Keyframe limb?
typedef struct {
    /* 0x00 */ Gfx* dList;
    /* 0x04 */ u8 unk_4;
    /* 0x05 */ u8 flags;
    /* 0x06 */ Vec3s root;
} Struct_801BFA14_Arg1_Field4; // size = 0xC

// Other limb type?
typedef struct {
    /* 0x00 */ Gfx* dList;
    /* 0x04 */ u8 unk_4;
    /* 0x05 */ u8 flags;
    /* 0x06 */ u8 unk_6;         // transform limb draw index
} Struct_801BFA14_Arg1_Field4_2; // size = 0x8

typedef struct {
    /* 0x00 */ u8 limbCount;
    /* 0x01 */ u8 unk_1; // non-zero in object files, number of non-null-dlist limbs?
    /* 0x04 */ union {
        Struct_801BFA14_Arg1_Field4* unk_4; // arrays
        Struct_801BFA14_Arg1_Field4_2* unk_4_2;
    };
    /* 0x08 */ s16* unk_8;
    /* 0x0C */ s16* unk_C;
    /* 0x0C */ char unk_10[0x2];
    /* 0x12 */ s16 unk_12;
} Struct_801BFA14_Arg1;

typedef struct {
    /* 0x00 */ u16* unk_0;
    /* 0x04 */ s16* unk_4;
    /* 0x08 */ s16* unk_8;
    /* 0x0C */ s16* unk_C;
    /* 0x0C */ char unk_10[0x2];
    /* 0x12 */ s16 unk_12;
} SkeletonInfo_1C;

typedef struct {
    /* 0x00 */ f32 unk_0;
    /* 0x04 */ f32 unk_4;
    /* 0x08 */ f32 unk_8;
    /* 0x0C */ f32 unk_C;
    /* 0x10 */ f32 unk_10;
    /* 0x14 */ s32 unk_14;
} FrameControl;

// FlexKeyframeSkeleton ?
typedef struct SkeletonInfo {
    /* 0x00 */ FrameControl frameCtrl;
    /* 0x18 */ Struct_801BFA14_Arg1* unk_18;    // array
    /* 0x1C */ SkeletonInfo_1C* unk_1C;
    /* 0x20 */ UnkKeyframeCallback* unk_20;     // pointer to array of functions
    /* 0x24 */ f32 unk_24;                      // duration? current time?
    /* 0x28 */ Vec3s* frameData;                // array of 3 Vec3s
    /* 0x2C */ s16* unk_2C;
} SkeletonInfo;

// KeyframeSkeleton ?
typedef struct SkeletonInfo2 {
    /* 0x00 */ FrameControl frameCtrl;
    /* 0x18 */ Struct_801BFA14_Arg1* unk_18;    // array
    /* 0x1C */ SkeletonInfo_1C* unk_1C;
    /* 0x20 */ f32 unk_20;                      // duration? current time?
    /* 0x24 */ Vec3s* frameData;
    /* 0x28 */ s16* unk_28;
    /* 0x2C */ Vec3s* unk_2C;
} SkeletonInfo2;

#endif