mirror of
https://github.com/n64decomp/mk64
synced 2026-07-01 19:00:19 -04:00
cleaning camera, kart_dma, menu, math_util (#436)
* cleaning camera.h * cleaning math_utils.h and remove space * cleaning kart_dma * cleaning menu.h
This commit is contained in:
@@ -122,7 +122,6 @@ extern u16 D_802BA260; // Box Truck sub-type?
|
||||
|
||||
extern u16 gNearestWaypointByPlayerId[];
|
||||
|
||||
extern Camera *camera1;
|
||||
extern s16 gCurrentCourseId;
|
||||
extern u16 isCrossingTriggeredByIndex[];
|
||||
extern Lights1 D_800DC610[];
|
||||
@@ -247,6 +246,4 @@ extern s8 D_802B8864[];
|
||||
|
||||
extern u16 D_800DC5BC;
|
||||
|
||||
extern Vec3f D_802B91C8;
|
||||
|
||||
#endif // ACTORS_H
|
||||
|
||||
+11
-11
@@ -72,7 +72,7 @@ f32 func_802B51E8(Vec3f arg0, Vec3f arg1) {
|
||||
temp_f14 = arg1[2] - arg0[2];
|
||||
return (temp_f2 * temp_f2) + (temp_f12 * temp_f12) + temp_f14 + temp_f14;
|
||||
}
|
||||
//u32 atan2s(f32, f32); // might be s32
|
||||
|
||||
u32 get_angle_between_points(Vec3f arg0, Vec3f arg1) {
|
||||
f32 temp_v1;
|
||||
f32 temp_v2;
|
||||
@@ -87,7 +87,7 @@ u32 func_802B5258(Vec3f arg0, Vec3s arg1) {
|
||||
f32 temp_v2;
|
||||
temp_v1 = arg1[0] - arg0[0];
|
||||
temp_v2 = arg1[2] - arg0[2];
|
||||
|
||||
|
||||
return atan2s(temp_v1, temp_v2);
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ void mtxf_identity(Mat4 mtx) {
|
||||
for (k = 0; k < 4; k++) {
|
||||
mtx[i][k] = (i == k) ? 1.0f : 0.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void func_802B5450(Mat4 arg0, Mat4 arg1, Vec3f arg2) {
|
||||
@@ -606,11 +606,11 @@ void func_802B6540(Mat3 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4) {
|
||||
mtx2[0][0] = cossValue;
|
||||
mtx2[2][1] = 0;
|
||||
mtx2[1][2] = 0;
|
||||
|
||||
|
||||
mtx2[1][1] = 1;
|
||||
mtx2[2][0] = sinValue;
|
||||
mtx2[0][2] = -sinValue;
|
||||
|
||||
|
||||
mtx2[2][2] = cossValue;
|
||||
mtx2[1][0] = 0;
|
||||
mtx2[0][1] = 0;
|
||||
@@ -622,7 +622,7 @@ void func_802B6540(Mat3 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4) {
|
||||
matrix[i][j] = (i == j) ? 1.0f : 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
} else if (arg2 == -1) {
|
||||
|
||||
for (i = 0; i < 3; i++) {
|
||||
@@ -630,16 +630,16 @@ void func_802B6540(Mat3 arg0, f32 arg1, f32 arg2, f32 arg3, s16 arg4) {
|
||||
matrix[i][j] = (i == j) ? 1.0f : 0.0f;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
matrix[1][1] = -1;
|
||||
|
||||
|
||||
} else {
|
||||
a = (f32) -(360.0 - ((f64) (func_802B7CE8(arg2) * 180.0f) / 3.141592653589793));
|
||||
b = -arg3 / sqrtf((arg1 * arg1) + (arg3 * arg3));
|
||||
c = 0;
|
||||
d = arg1 / sqrtf((arg1 * arg1) + (arg3 * arg3));
|
||||
func_802B6A84(matrix, a, b, c, d);
|
||||
|
||||
|
||||
}
|
||||
arg0[0][0] = (mtx2[0][0] * matrix[0][0]) + (mtx2[0][1] * matrix[1][0]) + (mtx2[0][2] * matrix[2][0]);
|
||||
arg0[1][0] = (mtx2[1][0] * matrix[0][0]) + (mtx2[1][1] * matrix[1][0]) + (mtx2[1][2] * matrix[2][0]);
|
||||
@@ -665,7 +665,7 @@ UNUSED void func_802B68F8(Mat3 matrix, f32 arg1, f32 arg2, f32 arg3) {
|
||||
|
||||
if (arg2 == 1) {
|
||||
for (i = 0; i < 3; i++) {
|
||||
for (j = 0; j < 3; j++) {
|
||||
for (j = 0; j < 3; j++) {
|
||||
matrix[i][j] = (i == j) ? 1.0f : 0.0f;
|
||||
}
|
||||
}
|
||||
@@ -840,7 +840,7 @@ void mtxf_to_mtx(Mtx *dest, Mat4 src) {
|
||||
|
||||
/**
|
||||
* Comment from sm64 unverified. mk64 verison is modified
|
||||
*
|
||||
*
|
||||
* Helper function for atan2s. Does a look up of the arctangent of y/x assuming
|
||||
* the resulting angle is in range [0, 0x2000] (1/8 of a circle).
|
||||
*/
|
||||
|
||||
+7
-15
@@ -16,9 +16,6 @@
|
||||
// Here to appease the pragma gods
|
||||
double fabs(double x);
|
||||
|
||||
void func_802B6A84(Mat3, s16, f32, f32, f32);
|
||||
void func_802B4FF0(void);
|
||||
void func_802B5794(Mat4, Vec3f, Vec3f);
|
||||
s32 render_set_position(Mat4, s32);
|
||||
f32 func_802B51E8(Vec3f, Vec3f);
|
||||
u32 get_angle_between_points(Vec3f, Vec3f);
|
||||
@@ -27,14 +24,13 @@ void vec3f_set(Vec3f, f32, f32, f32);
|
||||
void vec3s_set(Vec3s, s16, s16, s16);
|
||||
void *vec3f_copy(Vec3f, Vec3f);
|
||||
void vec3s_copy(Vec3s, Vec3s);
|
||||
void *sm64_vec3f_set(Vec3f, f32, f32, f32);
|
||||
void func_802B5350(Mat4, Mat4);
|
||||
void func_802B5398(s32*, s32*, s32);
|
||||
void mtxf_identity(Mat4);
|
||||
void func_802B5450(Mat4, Mat4, Vec3f);
|
||||
void func_802B54EC(Mat4, Mat4, Vec3f);
|
||||
void mtxf_translate(Mat4, Vec3f);
|
||||
void func_802B5564(Mat4, u16*, f32, f32, f32, f32, f32);
|
||||
void func_802B5794(Mat4, Vec3f, Vec3f);
|
||||
void func_802B59DC(Mat4, s16);
|
||||
void func_802B5A44(Mat4, s16);
|
||||
void func_802B5AAC(Mat4, s16);
|
||||
@@ -43,14 +39,11 @@ void func_802B5D30(s16, s16, s32);
|
||||
void func_802B5D64(uintptr_t, s16, s16, s32);
|
||||
void func_802B5F00(Mat4, f32);
|
||||
void func_802B5F74(Mat4, Vec3f, Vec3s);
|
||||
void func_802B60B4(Mat4, Vec3s, Vec3s);
|
||||
void func_802B6214(Mat4, Vec3s, Vec3s);
|
||||
void func_802B6374(Vec3f);
|
||||
void func_802B63B8(Vec3f, Mat3);
|
||||
void func_802B6434(Vec3f, Mat4);
|
||||
void func_802B64B0(s32, s32, s32, s32);
|
||||
void func_802B64C4(Vec3f, s16);
|
||||
void func_802B6540(Mat3, f32, f32, f32, s16);
|
||||
void func_802B6A84(Mat3, s16, f32, f32, f32);
|
||||
void func_802B6BC0(Mat4, s16, f32, f32, f32);
|
||||
void func_802B6D58(Mat4, Vec3f, Vec3f);
|
||||
void func_802B71CC(Mat4, Mat4, Mat4);
|
||||
@@ -58,14 +51,9 @@ void mtxf_to_mtx(Mtx*, Mat4);
|
||||
u16 atan2_lookup(f32, f32);
|
||||
u16 atan2s(f32, f32);
|
||||
f32 func_802B79B8(f32, f32);
|
||||
f32 func_802B79F0(f32, f32);
|
||||
u16 func_802B7B50(f32, f32);
|
||||
void func_802B7C18(f32);
|
||||
s16 func_802B7C40(f32);
|
||||
void func_802B7C6C(f32);
|
||||
s16 func_802B7CA8(f32);
|
||||
f32 func_802B7CE8(f32);
|
||||
s16 func_802B7D28(f32);
|
||||
u16 random_u16(void);
|
||||
u16 random_int(u16);
|
||||
s16 func_802B7F34(f32, f32, f32, f32);
|
||||
@@ -74,7 +62,11 @@ f32 sins(u16);
|
||||
f32 coss(u16);
|
||||
s32 is_visible_between_angle(u16, u16, u16);
|
||||
f32 is_within_render_distance(Vec3f, Vec3f, u16, f32, f32, f32);
|
||||
void func_802B8414(uintptr_t, Mat4, s16, s16, s32);
|
||||
|
||||
extern s32 D_802B91C0[];
|
||||
extern Vec3f D_802B91C8;
|
||||
|
||||
// end of math_util.c variables
|
||||
|
||||
extern u16 gRandomSeed16;
|
||||
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
#include "math_util_2.h"
|
||||
#include "code_8008C1D0.h"
|
||||
#include "math.h"
|
||||
#include "menus.h"
|
||||
|
||||
#pragma intrinsic (sqrtf)
|
||||
|
||||
extern s16 gPlayerBalloonCount[];
|
||||
extern s16 D_8016348C;
|
||||
extern s8 gCupCourseSelection;
|
||||
|
||||
extern s32 gLapCountByPlayerId[];
|
||||
extern u16 D_802BA048;
|
||||
@@ -34,9 +34,7 @@ extern u16 D_802BA048;
|
||||
extern u16 D_800DC5B4;
|
||||
extern u16 D_800DC5B0;
|
||||
extern u16 D_800DC5B8;
|
||||
extern s32 gMenuSelection;
|
||||
|
||||
extern s8 D_8018EE08;
|
||||
extern s32 D_8018D2AC;
|
||||
extern s16 gCurrentCourseId;
|
||||
extern u32 D_800DC5AC;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
#include "render_courses.h"
|
||||
#include "math_util.h"
|
||||
#include "main.h"
|
||||
#include "menus.h"
|
||||
|
||||
|
||||
Vp D_802B8880[] = {
|
||||
|
||||
@@ -59,8 +59,6 @@ extern struct UnkStruct_800DC5EC *D_800DC5F8;
|
||||
extern u16 D_800DC5B0;
|
||||
extern u16 gIsInQuitToMenuTransition;
|
||||
extern u16 gQuitToMenuTransitionCounter;
|
||||
extern s32 gMenuSelection;
|
||||
extern s32 D_800E86A4;
|
||||
|
||||
extern s32 D_800DC5D0;
|
||||
extern s32 D_800DC5D4;
|
||||
|
||||
Reference in New Issue
Block a user