fork/training-mode-ce

git clone https://git.julia.blue/fork/training-mode-ce

AitchAdd warnings and fix them (#297)4f5d26e

nix
3.6 KiB103 linesraw
1#ifndef MEX_H_DYNAMICS
2#define MEX_H_DYNAMICS
3
4#include "structs.h"
5#include "obj.h"
6#include "useful.h"
7
8/*** Structs ***/
9
10struct DynamicBoneset
11{
12    DynamicBoneData *data; // is stored @ 8000fdd4, comes from a nonstandard heap @ -0x52fc(r13)
13    int bone_num;          // number of bones in this boneset
14    float x8;              // stored @ 80011718, 0x8 of dynamicdesc
15    float xc;              // stored @ 80011720, 0xC of dynamicdesc
16    float x10;             // stored @ 80011728, 0x10 of dynamicdesc
17};
18
19struct ftDynamics
20{
21    int dynamics_num;                   // number of dynamic bonesets for this fighter
22    DynamicsDesc *dynamics_desc;        // boneset data array (one for each boneset)
23    int dynamics_hit_num;               // (no collide bubbles), max is 11
24    DynamicsHitDesc *dynamics_hit_desc; // dynamic hit data array (one for each dynamic hit)
25    DynamicsBehave **dynamics_behave;   // pointer to an array of dynamics behavior pointers.
26};
27
28struct DynamicBoneData
29{
30    JOBJ *jobj;            // 0x0
31    Vec4 rot;              // 0x4 quaternion
32    Vec3 trans;            // 0x14
33    Vec3 scale;            // 0x20
34    Vec3 rot_global;       // 0x2C, copied from 0x50, 0x60, 0x70 of jobj
35    float x38;             // 0x38, initialized to 1 @ 8000ff30
36    float x3c;             // 0x3c, initialized to 0 @ 8000ff34
37    float x40;             // 0x40, initialized to 0 @ 8000ff38
38    float x44;             // 0x44, initialized to 0 @ 8000ff3c
39    float x48;             // x48, initialized to 0 @ 8000ff44
40    float x4c;             // x4c, THIS IS THE START OF A STRUCTURE, bunch of floats from the dynamicdesc. stored @ 80011744
41    float x50;             // 0x3c
42    float x54;             // 0x40
43    float x58;             // 0x44
44    float x5c;             // x048
45    float x60;             // 0x38
46    float x64;             // 0x3c
47    float x68;             // 0x40
48    float x6c;             // 0x44
49    float x70;             // x048
50    float x74;             // 0x38
51    float x78;             // 0x3c
52    float x7c;             // 0x40
53    float x80;             // 0x44
54    float x84;             // x048
55    float x88;             // 0x38
56    float x8c;             // 0x3c
57    DynamicBoneData *next; // 0x90
58    float x94;             // 0x44
59};
60
61struct DynamicHit
62{
63    Vec3 offset;    // 0x1670, 0x0
64    float size;     // 0x167C, 0xC
65    JOBJ *bone;     // 0x1680, 0x10
66    int x14;        // 0x1684, 0x14
67    Vec3 pos;       // 0x1688, 0x18
68    int bone_index; // 0x1694, 0x24
69};
70
71struct DynamicForceDesc
72{
73    u8 x0;        // 0x0
74    u8 x1;        // 0x1
75    float x4;     // 0x4
76    Vec3 pos;     // 0x8
77    float x14;    // 0x14
78    float x18;    // 0x18
79    float x1c;    // 0x1c
80    float radius; // 0x20
81    float decay;  // 0x24
82    int lifetime; // 0x28, is decremented
83    float x2c;    // 0x2c
84};
85
86struct DynamicForce
87{
88    DynamicForceDesc desc; // 0x0
89    int timer;             // 0x30, counts up
90    DynamicForce *next;    // 0x34
91};
92
93static DynamicForce **stc_dynamic_force = (void *)0x804d63b0;            // -0x52f0
94static DynamicForce **stc_dynamic_force_next_alloc = (void *)0x804d63ac; // -0x52f4
95
96void Dynamics_InitBones(JOBJ *joint, DynamicBoneset *boneset, int bone_num);
97void Dynamics_InitParams(void *dyn_desc_params, DynamicBoneset *boneset);
98void Dynamics_UpdateBoneset(DynamicBoneset *boneset, float f1, DynamicHit *dynamics_hit, int dynamics_hit_num, int r6, int r7, int r8, int r9); // 8001044c
99void Dynamics_FreeBones(DynamicBoneset *boneset);
100void Dynamics_InitForce();
101DynamicForce *Dynamics_CreateForce(DynamicForceDesc *);
102void Dynamics_DecayWind();
103#endif