summaryrefslogtreecommitdiff
path: root/src/port/interpolation/FrameInterpolation.h
blob: 7ca85eca0a18de5c18b916a84a40532a0bbf58c9 (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
97
98
99
#ifndef __FRAME_INTERPOLATION_H
#define __FRAME_INTERPOLATION_H

// #include "sf64math.h"
#include <libultraship.h>
#include <common_structs.h>

#ifdef __cplusplus

#include "src/engine/CoreMath.h"
#include <unordered_map>



std::unordered_map<Mtx*, MtxF> FrameInterpolation_Interpolate(float step);
void FrameInterpolation_ApplyMatrixTransformations(Mat4* matrix, FVector pos, IRotator rot, FVector scale);

extern "C" {
#endif

#define TAG_ITEM_ADDR(x) ((u32) 0x10000000 | (u32)x)
#define TAG_SMOKE_DUST(x) ((u32) 0x20000000 | (u32) (x))
#define TAG_LETTER(x) ((u32)0x30000000 | ((u32) (uintptr_t) (x) & 0x0FFFFFFF))
#define TAG_OBJECT(x) ((u32)0x40000000 | (u32)  (uintptr_t) (x))
#define TAG_CLOUDS(x) ((u32)0x50000000 | (u32)  (uintptr_t) (x))
#define TAG_THWOMP(x) ((u32)0x60000000 | ((u32) (uintptr_t) (x) & 0x0FFFFFFF))
//                          Mask the bits so that the 7 can't get overridden
#define TAG_TRACK(x) ((u32)0x70000000 | ((u32)(x) & 0x0FFFFFFF))
#define TAG_MINIMAP_DOTS(x) ((u32)0x80000000 | ((u32)(x) & 0x0FFFFFFF))
#define TAG_PORTRAITS(x) ((u32)0x90000000 | ((u32)(x) & 0x0FFFFFFF))

void FrameInterpolation_ShouldInterpolateFrame(bool shouldInterpolate);

bool check_if_recording();

void FrameInterpolation_StartRecord(void);

void FrameInterpolation_StopRecord(void);

void FrameInterpolation_RecordMarker(const char* file, int line);

void FrameInterpolation_RecordOpenChild(const void* a, uintptr_t b);

void FrameInterpolation_RecordCloseChild(void);

void FrameInterpolation_DontInterpolateCamera(void);

int FrameInterpolation_GetCameraEpoch(void);

void FrameInterpolation_RecordActorPosRotMatrix(void);

void FrameInterpolation_RecordMatrixPosRotXYZ(Mat4* out, Vec3f pos, Vec3s orientation);

void FrameInterpolation_RecordMatrixPosRotScaleXY(Mat4* matrix, s32 x, s32 y, u16 angle, f32 scale);

void FrameInterpolation_Record_SetTextMatrix(Mat4* matrix, f32 x, f32 y, f32 arg3, f32 arg4);

//void FrameInterpolation_RecordMatrixPush(Mat4* matrix);

//void FrameInterpolation_RecordMatrixPop(Mat4* matrix);

void FrameInterpolation_RecordMatrixMult(Mat4* matrix, MtxF* mf, u8 mode);

void FrameInterpolation_RecordMatrixTranslate(Mat4* matrix, Vec3f b);

void FrameInterpolation_RecordMatrixScale(Mat4* matrix, f32 scale);

void FrameInterpolation_RecordMatrixRotate1Coord(Mat4* matrix, u32 coord, s16 value);

void FrameInterpolation_RecordMatrixMtxFToMtx(MtxF* src, Mtx* dest);

void FrameInterpolation_RecordMatrixToMtx(Mtx* dest, char* file, s32 line);

void FrameInterpolation_RecordMatrixReplaceRotation(MtxF* mf);

//void FrameInterpolation_RecordMatrixRotateAxis(f32 angle, Vec3f* axis, u8 mode);

void FrameInterpolation_RecordSkinMatrixMtxFToMtx(MtxF* src, Mtx* dest);

//void FrameInterpolation_RecordMatrixMultVec3f(Matrix* matrix, Vec3f src, Vec3f dest);

//void FrameInterpolation_RecordMatrixMultVec3fNoTranslate(Matrix* matrix, Vec3f src, Vec3f dest);

void FrameInterpolation_RecordSetTransformMatrix(Mat4* dest, Vec3f orientationVector, Vec3f positionVector, u16 rotationAngle,
                          f32 scaleFactor);

void FrameInterpolation_RecordSetMatrixTransformation(Mat4* dest, Vec3f location, Vec3su rotation, f32 scale);

void FrameInterpolation_RecordCalculateOrientationMatrix(Mat3*, f32, f32, f32, s16);

void FrameInterpolation_RecordTranslateRotate(Mat4* dest, Vec3f pos, Vec3s rotation);

//void FrameInterpolation_func_80062B18(f32* arg0, f32* arg1, f32* arg2, arg3, arg4, arg5, arg6, arg7);

#ifdef __cplusplus
}
#endif

#endif // __FRAME_INTERPOLATION_H