mirror of
https://github.com/zeldaret/st
synced 2026-09-04 10:12:27 -04:00
started Actor.cpp
This commit is contained in:
@@ -0,0 +1,139 @@
|
||||
#pragma once
|
||||
|
||||
#include "System/SysNew.hpp"
|
||||
#include "nitro/math.h"
|
||||
#include "global.h"
|
||||
#include "types.h"
|
||||
|
||||
struct UnkStruct_vfunc_00 {
|
||||
unk32 mUnk_00;
|
||||
unk32 mUnk_04;
|
||||
unk32 mUnk_08;
|
||||
};
|
||||
|
||||
struct UnkStruct_vfunc_3c {
|
||||
unk32 mUnk_00;
|
||||
unk32 mUnk_04;
|
||||
unk32 mUnk_08;
|
||||
};
|
||||
|
||||
class Actor_5c {
|
||||
public:
|
||||
/* 00 */ unk32 mUnk_00;
|
||||
|
||||
void func_ov000_020975f8();
|
||||
};
|
||||
|
||||
class UnkStruct_ov000_020b539c_30 {
|
||||
public:
|
||||
/* 00 */ unk32 mUnk_00;
|
||||
/* 04 */ unk32 mUnk_04;
|
||||
/* 08 */ unk8 mUnk_08[0x18 - 0x08];
|
||||
/* 1c */ unk8 mUnk_18;
|
||||
/* 1c */ unk8 mUnk_19;
|
||||
/* 1c */ unk16 mUnk_1a;
|
||||
/* 1c */ unk16 mUnk_1c;
|
||||
/* 1e */ u16 mUnk_1e;
|
||||
/* 20 */
|
||||
};
|
||||
|
||||
class UnkStruct_ov000_020b539c {
|
||||
public:
|
||||
/* 00 */ unk8 mUnk_00[0x30];
|
||||
/* 30 */ UnkStruct_ov000_020b539c_30 *mUnk_30;
|
||||
/* 34 */
|
||||
|
||||
void func_02028cdc(Actor_5c *param1, unk32 param2);
|
||||
};
|
||||
|
||||
class Actor : public SysObject {
|
||||
public:
|
||||
/* 00 (vtable) */
|
||||
/* 04 */ unk32 mUnk_04;
|
||||
/* 08 */ unk32 mUnk_08;
|
||||
/* 0c */ unk32 mUnk_0c;
|
||||
/* 10 */ unk32 mUnk_10;
|
||||
/* 14 */ unk32 mUnk_14;
|
||||
/* 18 */ unk32 mUnk_18;
|
||||
/* 1c */ Vec3p mUnk_1c;
|
||||
/* 28 */ u16 mUnk_28;
|
||||
/* 28 */ unk16 mUnk_2a;
|
||||
/* 2c */ unk32 mUnk_2c;
|
||||
/* 30 */ unk32 *mUnk_30;
|
||||
/* 34 */ unk32 *mUnk_34;
|
||||
/* 38 */ unk32 mUnk_38;
|
||||
/* 3c */ unk32 mUnk_3c;
|
||||
/* 40 */ unk32 mUnk_40;
|
||||
/* 44 */ u16 mUnk_44;
|
||||
/* 46 */ unk16 mUnk_46;
|
||||
/* 48 */ unk16 mUnk_48;
|
||||
/* 4a */ unk8 mUnk_4a;
|
||||
/* 4a */ unk8 mUnk_4b;
|
||||
/* 4c */ unk16 mUnk_4c;
|
||||
/* 4e */ s16 mUnk_4e;
|
||||
/* 50 */ unk16 mUnk_50;
|
||||
/* 52 */ unk16 mUnk_52;
|
||||
/* 54 */ unk32 mUnk_54;
|
||||
/* 58 */ unk32 mUnk_58;
|
||||
/* 5c */ Actor_5c mUnk_5c;
|
||||
/* 60 */ unk32 mUnk_60;
|
||||
/* 64 */ unk32 mUnk_64;
|
||||
/* 68 */ s16 mUnk_68;
|
||||
/* 68 */ unk16 mUnk_6a;
|
||||
/* 6c */ unk32 mUnk_6c;
|
||||
/* 70 */ unk32 mUnk_70;
|
||||
/* 74 */ unk32 mUnk_74;
|
||||
/* 78 */ unk32 mUnk_78;
|
||||
/* 7c */ unk32 mUnk_7c;
|
||||
/* 80 */ unk16 mUnk_80;
|
||||
/* 80 */ unk16 mUnk_82;
|
||||
/* 84 */ unk32 mUnk_84;
|
||||
/* 88 */ unk32 mUnk_88;
|
||||
/* 8c */ unk32 mUnk_8c;
|
||||
/* 90 */ UnkStruct_ov000_020b539c_30 *mUnk_90;
|
||||
|
||||
/* 00 */ virtual unk32 vfunc_00(UnkStruct_vfunc_00 *param1);
|
||||
/* 04 */ virtual bool vfunc_04();
|
||||
/* 08 */ virtual unk16 vfunc_08();
|
||||
/* 0c */ virtual unk8 vfunc_0c();
|
||||
/* 10 */ virtual void vfunc_10();
|
||||
/* 14 */ virtual void vfunc_14();
|
||||
/* 18 */ virtual unk32 vfunc_18();
|
||||
/* 1c */ virtual void vfunc_1c();
|
||||
/* 20 */ virtual void vfunc_20();
|
||||
/* 24 */ virtual void vfunc_24();
|
||||
/* 28 */ virtual void vfunc_28();
|
||||
/* 2c */ virtual void vfunc_2c();
|
||||
/* 30 */ virtual void vfunc_30();
|
||||
/* 34 */ virtual unk32 vfunc_34();
|
||||
/* 38 */ virtual unk32 vfunc_38(unk32 param1);
|
||||
/* 3c */ virtual bool vfunc_3c(Vec3p* param1);
|
||||
/* 40 */ virtual void vfunc_40();
|
||||
/* 44 */ virtual void vfunc_44();
|
||||
/* 48 */ virtual void vfunc_48();
|
||||
/* 4c */ virtual ~Actor();
|
||||
/* 54 */
|
||||
|
||||
Actor();
|
||||
void func_ov000_0209848c(UnkStruct_ov000_020b539c_30 *param1);
|
||||
void func_ov000_020984b0();
|
||||
void func_ov000_020984b4();
|
||||
void func_ov000_020984b8();
|
||||
void func_ov000_020984bc();
|
||||
void func_ov000_020984c0();
|
||||
void func_ov000_020984c4();
|
||||
unk32 func_ov000_020984c8();
|
||||
void func_ov000_020984d0();
|
||||
void func_ov000_020984f0();
|
||||
|
||||
s32 func_ov000_02098518(unk32 *param1);
|
||||
void func_ov000_0209853c();
|
||||
s32 func_ov000_02098554();
|
||||
s16 func_ov000_0209856c();
|
||||
s8 func_ov000_02098578();
|
||||
s32 func_ov000_02098584();
|
||||
s32 func_ov000_020985f0(void *param1);
|
||||
void func_ov000_0209862c(unk32 param1);
|
||||
};
|
||||
|
||||
extern UnkStruct_ov000_020b539c data_ov000_020b539c;
|
||||
@@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "types.h"
|
||||
|
||||
class UnkStruct_027e0cd8 {
|
||||
public:
|
||||
void func_ov000_02081ecc(unk16 param1, unk32 param2);
|
||||
};
|
||||
|
||||
extern UnkStruct_027e0cd8* data_027e0cd8;
|
||||
@@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
|
||||
#include "global.h"
|
||||
#include "types.h"
|
||||
|
||||
#include "System/SysNew.hpp"
|
||||
|
||||
// PlayerManager?
|
||||
class UnkStruct_027e0ce0 {
|
||||
public:
|
||||
/* 00 */ unk32 mUnk_00;
|
||||
/* 04 */ unk32 mUnk_04;
|
||||
/* 08 */ unk32 mUnk_08;
|
||||
/* 0c */ unk32 mUnk_0c;
|
||||
/* 10 */ unk32 mUnk_10;
|
||||
/* 14 */ unk32 mUnk_14;
|
||||
/* 18 */ unk32 mUnk_18;
|
||||
/* 1c */ unk32 mUnk_1c;
|
||||
/* 20 */ unk32 mUnk_20;
|
||||
/* 24 */ unk32 mUnk_24;
|
||||
/* 28 */ unk32 mUnk_28;
|
||||
/* 2c */ unk32 mUnk_2c;
|
||||
/* 30 */
|
||||
|
||||
void func_01fff148();
|
||||
|
||||
void func_ov000_0208a318(unk32 param1, unk32 param2, unk32 param3);
|
||||
|
||||
void func_ov024_020d3d98(unk32 param1, unk32 param2);
|
||||
void func_ov024_020d3ee8(unk32, u16, unk32);
|
||||
|
||||
void func_ov110_02185d3c(unk32 param1);
|
||||
};
|
||||
|
||||
extern UnkStruct_027e0ce0 *data_027e0ce0;
|
||||
@@ -0,0 +1,190 @@
|
||||
#ifndef _NDS_MATH_H
|
||||
#define _NDS_MATH_H
|
||||
|
||||
#include "global.h"
|
||||
#include "types.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define ABS(x) ((x) < 0 ? -(x) : (x))
|
||||
|
||||
// Q20.12 fixed point number
|
||||
typedef s32 q20;
|
||||
// Q4.12 fixed point number
|
||||
typedef s16 q4;
|
||||
|
||||
#define INT_TO_Q20(n) ((s32) ((n) << 12))
|
||||
#define FLOAT_TO_Q21(n) ((s32) (((n) * 8192 + 1) / 4))
|
||||
#define FLOAT_TO_Q20(n) ((s32) (((n) * 8192 + 1) / 2))
|
||||
#define FLOAT_TO_Q19(n) ((s32) (((n) * 8192 + 1)))
|
||||
#define ROUND_Q20(n) (((s32) (n) + 0x800) >> 12)
|
||||
#define MUL_Q20(a, b) (q20)((((s64) (a)) * ((s64) (b)) + 0x800) >> 12)
|
||||
#define DIV_Q20(a, b) (((a) << 12) / (b))
|
||||
|
||||
#define DEG_TO_ANG(n) ((n) * 0x10000 / 360)
|
||||
#define SIN(n) (gSinCosTable[2 * ((n) >> 4)])
|
||||
#define COS(n) (gSinCosTable[2 * ((n) >> 4) + 1])
|
||||
|
||||
u32 func_01ff9f3c(s32 a, s32 b);
|
||||
s32 Atan2(s32 x, s32 y);
|
||||
|
||||
u32 CoDivide64By32(u32 a, u32 b);
|
||||
u32 func_01ff98f0(u32 a, u32 b);
|
||||
u32 CoReciprocal(u32 x);
|
||||
u64 func_01ff992c(u32 x);
|
||||
u32 CoSqrt(u32 x);
|
||||
u32 CoInvSqrt(u32 x);
|
||||
u32 AwaitDivisionResult();
|
||||
u32 GetDivisionResult();
|
||||
void StartReciprocal(u32 x);
|
||||
void StartSqrt(u32 x);
|
||||
void func_01ff9ac4(u32 x);
|
||||
u32 AwaitSqrtResult();
|
||||
void StartDivision64By32(u32 a, u32 b);
|
||||
u32 CoDivide32(u32 a, u32 b);
|
||||
u32 CoRemainder(u32 a, u32 b);
|
||||
|
||||
bool Approach(unk32 *src, unk32 dest, unk32 step);
|
||||
bool Approach_thunk(unk32 *src, unk32 dest, unk32 step);
|
||||
extern q4 gSinCosTable[];
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ u8 x;
|
||||
/* 1 */ u8 y;
|
||||
/* 2 */
|
||||
} Vec2b;
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ s16 x;
|
||||
/* 1 */ s16 y;
|
||||
/* 2 */
|
||||
} Vec2s;
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ q20 x;
|
||||
/* 4 */ q20 y;
|
||||
/* 8 */
|
||||
} Vec2p;
|
||||
|
||||
typedef struct {
|
||||
/* 0 */ q20 x;
|
||||
/* 4 */ q20 y;
|
||||
/* 8 */ q20 z;
|
||||
/* c */
|
||||
} Vec3p;
|
||||
|
||||
typedef struct {
|
||||
/* 00 */ q20 x;
|
||||
/* 04 */ q20 y;
|
||||
/* 08 */ q20 z;
|
||||
/* 0c */ q20 w;
|
||||
/* 10 */
|
||||
} Vec4p;
|
||||
|
||||
typedef struct {
|
||||
/* 00 */ Vec2p xColumn;
|
||||
/* 08 */ Vec2p yColumn;
|
||||
/* 10 */
|
||||
} Mat2p;
|
||||
|
||||
typedef struct {
|
||||
/* 00 */ Vec3p xColumn;
|
||||
/* 0c */ Vec3p yColumn;
|
||||
/* 18 */ Vec3p zColumn;
|
||||
/* 24 */
|
||||
} Mat3p;
|
||||
|
||||
typedef struct {
|
||||
/* 00 */ Vec3p xColumn;
|
||||
/* 0c */ Vec3p yColumn;
|
||||
/* 18 */ Vec3p zColumn;
|
||||
/* 24 */ Vec3p wColumn;
|
||||
/* 30 */
|
||||
} Mat4x3p;
|
||||
|
||||
typedef struct {
|
||||
/* 00 */ Vec4p xColumn;
|
||||
/* 10 */ Vec4p yColumn;
|
||||
/* 20 */ Vec4p zColumn;
|
||||
/* 30 */ Vec4p wColumn;
|
||||
/* 40 */
|
||||
} Mat4p;
|
||||
|
||||
extern const Vec3p gVec3p_ZERO;
|
||||
|
||||
void Vec3p_Add(Vec3p *a, Vec3p *b, Vec3p *out);
|
||||
void Vec3p_Sub(Vec3p *a, Vec3p *b, Vec3p *out);
|
||||
q20 Vec3p_Dot(Vec3p *a, Vec3p *b);
|
||||
void Vec3p_Cross(Vec3p *a, Vec3p *b, Vec3p *out);
|
||||
q20 Vec3p_Length(Vec3p *a);
|
||||
void Vec3p_Normalize(Vec3p *vec, Vec3p *out);
|
||||
void Vec3p_Axpy(q20 a, Vec3p *x, Vec3p *y, Vec3p *out);
|
||||
q20 Vec3p_Distance(Vec3p *a, Vec3p *b);
|
||||
bool Vec3p_TryNormalize(Vec3p *vec);
|
||||
q20 Vec3p_DistanceSquared(Vec3p *a, Vec3p *b);
|
||||
void Vec3p_Scale(Vec3p *vec, q20 scale);
|
||||
bool Vec3p_CalculateNormal(Vec3p *vec, Vec3p *a, Vec3p *b, Vec3p *c);
|
||||
|
||||
inline void Vec3p_Rotate(Vec3p *vec, q20 sin, q20 cos, Vec3p *out) {
|
||||
out->x += MUL_Q20(vec->z, sin);
|
||||
out->z += MUL_Q20(vec->z, cos);
|
||||
out->x += MUL_Q20(vec->x, cos);
|
||||
out->z += MUL_Q20(vec->x, -sin);
|
||||
}
|
||||
|
||||
inline void Vec3p_CopyXZ(Vec3p *vec, Vec3p *out) {
|
||||
q20 z = vec->z;
|
||||
q20 x = vec->x;
|
||||
|
||||
out->x = x;
|
||||
out->y = 0;
|
||||
out->z = z;
|
||||
}
|
||||
|
||||
inline void Vec3p_Copy(Vec3p *vec, Vec3p *out) {
|
||||
out->x = vec->x;
|
||||
out->y = vec->y;
|
||||
out->z = vec->z;
|
||||
}
|
||||
|
||||
void Mat2p_InitIdentity(Mat2p *m);
|
||||
void Mat2p_InitRotation(Mat2p *m, q20 sin, q20 cos);
|
||||
void Mat2p_Multiply(Mat2p *a, Mat2p *b, Mat2p *out);
|
||||
|
||||
void Mat3p_InitIdentity(Mat3p *m);
|
||||
void Mat3p_CopyToMat4x3p(Mat3p *m, Mat4x3p *out);
|
||||
void Mat3p_InitScale(Mat3p *m, q20 x, q20 y, q20 z);
|
||||
void Mat3p_ScaleColumns(Mat3p *m, Mat3p *out, q20 x, q20 y, q20 z);
|
||||
void Mat3p_InitXRotation(Mat3p *m, q20 sin, q20 cos);
|
||||
void Mat3p_InitYRotation(Mat3p *m, q20 sin, q20 cos);
|
||||
void Mat3p_InitZRotation(Mat3p *m, q20 sin, q20 cos);
|
||||
void Mat3p_func_01ff8248(Mat3p *m, Vec3p *v, q20 scale, q20 offset);
|
||||
void Mat3p_func_01ff83a0(Mat3p *a, Mat3p *b);
|
||||
void Mat3p_Multiply(Mat3p *a, Mat3p *b, Mat3p *out);
|
||||
void Mat3p_MultiplyVec(Vec3p *v, Mat3p *m, Vec3p *out);
|
||||
|
||||
void Mat4x3p_InitIdentity(Mat4x3p *m);
|
||||
void Mat4x3p_CopyToMat4p(Mat4x3p *m, Mat4p *out);
|
||||
void Mat4x3p_func_01ff8988(Mat4x3p *m, Mat4x3p *out, q20 x, q20 y, q20 z);
|
||||
void Mat4x3p_InitScale(Mat4x3p *m, q20 x, q20 y, q20 z);
|
||||
void Mat4x3p_ScaleColumns(Mat4x3p *m, Mat4x3p *out, q20 x, q20 y, q20 z);
|
||||
void Mat4x3p_InitXRotation(Mat4x3p *m, q20 sin, q20 cos);
|
||||
void Mat4x3p_InitYRotation(Mat4x3p *m, q20 sin, q20 cos);
|
||||
void Mat4x3p_InitZRotation(Mat4x3p *m, q20 sin, q20 cos);
|
||||
void Mat4x3p_func_01ff8ad8(Mat4x3p *m, Vec3p *v, q20 scale, q20 offset);
|
||||
void Mat4x3p_func_01ff8af8(Mat4x3p *a, Mat4x3p *b);
|
||||
void Mat4x3p_Multiply(Mat4x3p *a, Mat4x3p *b, Mat4x3p *out);
|
||||
void Mat4x3p_MultiplyVec(Vec3p *v, Mat4x3p *m, Vec3p *out);
|
||||
|
||||
void Mat4p_InitIdentity(Mat4p *m);
|
||||
void Mat4p_CopyToMat4x3p(Mat4p *m, Mat4x3p *out);
|
||||
void Mat4p_InitZRotation(Mat4p *m, q20 sin, q20 cos);
|
||||
void Mat4p_Multiply(Mat4p *a, Mat4p *b, Mat4p *out);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user