mirror of
https://github.com/n64decomp/mk64
synced 2026-07-01 10:58:50 -04:00
Rename wayPoint to waypoint (#448)
* Rename wayPoint to waypoint * other
This commit is contained in:
+6
-6
@@ -513,9 +513,9 @@ void update_actor_kiwano_fruit(struct KiwanoFruit *fruit) {
|
||||
fruit->velocity[0] = 80.0f;
|
||||
case 1:
|
||||
nearestWaypoint = gNearestWaypointByPlayerId[(u16)(player - gPlayerOne)];
|
||||
temp_f2 = player->pos[0] - D_80164490[nearestWaypoint].wayPointX;
|
||||
temp_f16 = player->pos[1] - D_80164490[nearestWaypoint].wayPointY;
|
||||
temp_f14 = player->pos[2] - D_80164490[nearestWaypoint].wayPointZ;
|
||||
temp_f2 = player->pos[0] - D_80164490[nearestWaypoint].posX;
|
||||
temp_f16 = player->pos[1] - D_80164490[nearestWaypoint].posY;
|
||||
temp_f14 = player->pos[2] - D_80164490[nearestWaypoint].posZ;
|
||||
temp_f12 = fruit->velocity[0] / sqrtf((temp_f2 * temp_f2) + (temp_f16 * temp_f16) + (temp_f14 * temp_f14));
|
||||
temp_f2 *= temp_f12;
|
||||
temp_f16 *= temp_f12;
|
||||
@@ -1605,10 +1605,10 @@ void func_8029B8E8(Camera *camera, struct TrainCar *actor) {
|
||||
} else if (distance < 640000.0f) {
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1D670);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1D160);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1D160);
|
||||
} else {
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1E910);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1E480);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1E910);
|
||||
gSPDisplayList(gDisplayListHead++, d_course_kalimari_desert_dl_1E480);
|
||||
}
|
||||
if (1440000.0f < distance) { return; }
|
||||
|
||||
|
||||
@@ -1175,8 +1175,8 @@ void update_actor_green_shell(struct ShellActor *shell) {
|
||||
}
|
||||
if ((player->type & 0x4000) != 0) {
|
||||
controller = &gControllers[shell->playerId];
|
||||
if ((controller->buttonDepressed & 0x2000) != 0) {
|
||||
controller->buttonDepressed &= ~0x2000;
|
||||
if ((controller->buttonDepressed & Z_TRIG) != 0) {
|
||||
controller->buttonDepressed &= ~Z_TRIG;
|
||||
if (controller->rawStickY < -0x2D) {
|
||||
var_f2 = 8.0f;
|
||||
if (player->unk_094 > 8.0f) {
|
||||
@@ -1314,7 +1314,7 @@ void update_actor_green_shell(struct ShellActor *shell) {
|
||||
|
||||
void func_802B3B44(struct ShellActor *shell) {
|
||||
u16 currentWaypoint;
|
||||
u16 nextWayPoint;
|
||||
u16 nextWaypoint;
|
||||
f32 temp_f0;
|
||||
f32 temp_f0_2;
|
||||
f32 temp_f0_3;
|
||||
@@ -1336,13 +1336,13 @@ void func_802B3B44(struct ShellActor *shell) {
|
||||
Vec3f origPos;
|
||||
|
||||
currentWaypoint = shell->pathIndex;
|
||||
temp_f2 = D_80164490[currentWaypoint].wayPointX;
|
||||
temp_f12 = D_80164490[currentWaypoint].wayPointY;
|
||||
temp_f28 = D_80164490[currentWaypoint].wayPointZ;
|
||||
nextWayPoint = currentWaypoint + 1;
|
||||
temp_f2 = D_80164490[currentWaypoint].posX;
|
||||
temp_f12 = D_80164490[currentWaypoint].posY;
|
||||
temp_f28 = D_80164490[currentWaypoint].posZ;
|
||||
nextWaypoint = currentWaypoint + 1;
|
||||
|
||||
if (nextWayPoint >= D_80164430) {
|
||||
nextWayPoint -= D_80164430;
|
||||
if (nextWaypoint >= D_80164430) {
|
||||
nextWaypoint -= D_80164430;
|
||||
}
|
||||
|
||||
temp_f20 = temp_f2 - shell->pos[0];
|
||||
@@ -1350,9 +1350,9 @@ void func_802B3B44(struct ShellActor *shell) {
|
||||
temp_f24 = temp_f28 - shell->pos[2];
|
||||
temp_f0 = (temp_f20 * temp_f20) + (temp_f22 * temp_f22) + (temp_f24 * temp_f24);
|
||||
if (temp_f0 > 400.0f) {
|
||||
temp_f18_3 = D_80164490[nextWayPoint].wayPointX;
|
||||
temp_f16_3 = D_80164490[nextWayPoint].wayPointY;
|
||||
temp_f26 = D_80164490[nextWayPoint].wayPointZ;
|
||||
temp_f18_3 = D_80164490[nextWaypoint].posX;
|
||||
temp_f16_3 = D_80164490[nextWaypoint].posY;
|
||||
temp_f26 = D_80164490[nextWaypoint].posZ;
|
||||
|
||||
temp_f12_0 = temp_f18_3 - shell->pos[0];
|
||||
temp_f12_1 = temp_f16_3 - shell->pos[1];
|
||||
@@ -1360,7 +1360,7 @@ void func_802B3B44(struct ShellActor *shell) {
|
||||
|
||||
temp_f0_3 = (temp_f12_0 * temp_f12_0) + (temp_f12_1 * temp_f12_1) + (temp_f12_2 * temp_f12_2);
|
||||
if (temp_f0_3 < temp_f0) {
|
||||
shell->pathIndex = nextWayPoint;
|
||||
shell->pathIndex = nextWaypoint;
|
||||
} else {
|
||||
temp_f0_2 = sqrtf(temp_f0) * 4.0f;
|
||||
temp_f20 /= temp_f0_2;
|
||||
@@ -1400,11 +1400,11 @@ void func_802B3B44(struct ShellActor *shell) {
|
||||
shell->pos[0] = temp_f2;
|
||||
shell->pos[1] = shell->boundingBoxSize + temp_f12;
|
||||
shell->pos[2] = temp_f28;
|
||||
shell->pathIndex = nextWayPoint;
|
||||
shell->pathIndex = nextWaypoint;
|
||||
} else {
|
||||
temp_f18_3 = D_80164490[nextWayPoint].wayPointX;
|
||||
temp_f16_3 = D_80164490[nextWayPoint].wayPointY;
|
||||
temp_f26 = D_80164490[nextWayPoint].wayPointZ;
|
||||
temp_f18_3 = D_80164490[nextWaypoint].posX;
|
||||
temp_f16_3 = D_80164490[nextWaypoint].posY;
|
||||
temp_f26 = D_80164490[nextWaypoint].posZ;
|
||||
|
||||
shell->pos[0] = (temp_f2 + temp_f18_3) * 0.5f;
|
||||
shell->pos[1] = ((temp_f12 + temp_f16_3) * 0.5f) + shell->boundingBoxSize;
|
||||
@@ -1564,8 +1564,8 @@ void update_actor_red_blue_shell(struct ShellActor *shell) {
|
||||
controller = gControllerOne;
|
||||
}
|
||||
|
||||
if ((controller->buttonDepressed & 0x2000) != 0) {
|
||||
controller->buttonDepressed &= ~0x2000;
|
||||
if ((controller->buttonDepressed & Z_TRIG) != 0) {
|
||||
controller->buttonDepressed &= ~Z_TRIG;
|
||||
shell->state = RELEASED_SHELL;
|
||||
if (player->unk_0C0 > 0) {
|
||||
shell->rotAngle = 0x78E3;
|
||||
|
||||
@@ -1988,7 +1988,7 @@ void set_vertex_colours(uintptr_t addr, u32 vertexCount, UNUSED s32 vert3, s8 al
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursive search for Veretices and set their colour values.
|
||||
* Recursive search for vertices and set their colour values.
|
||||
*/
|
||||
void find_vtx_and_set_colours(uintptr_t displayList, s8 alpha, u8 red, u8 green, u8 blue) {
|
||||
s32 segment = SEGMENT_NUMBER2(displayList);
|
||||
|
||||
+16
-3
@@ -40,7 +40,10 @@ UNUSED void func_802B4FF0() {
|
||||
|
||||
}
|
||||
|
||||
// set the position, rotation and mode of where to render the next object and check number of object already render
|
||||
/**
|
||||
* Inserts matrix into the rsp. Position, rotation and mode of where to render the next object and check number of object already render
|
||||
* Note that gMatrixObjectCount gets reset at the beginning of the game loop. So no cleanup needs to be performed.
|
||||
*/
|
||||
s32 render_set_position(Mat4 arg0, s32 arg1) {
|
||||
if (gMatrixObjectCount >= MTX_OBJECT_POOL_SIZE) {
|
||||
return 0;
|
||||
@@ -1092,8 +1095,18 @@ s32 is_visible_between_angle(u16 arg0, u16 arg1, u16 arg2) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns distance or -1.0f if exceeds render distance.
|
||||
*/
|
||||
* Determines whether an object is within the render distance of a camera.
|
||||
*
|
||||
* @param cameraPos The position of the camera in 3D space.
|
||||
* @param objectPos The position of the object in 3D space.
|
||||
* @param orientationY The orientation angle of the object around the Y-axis.
|
||||
* @param minDistance The minimum distance at which the object is considered within render distance.
|
||||
* @param fov The field of view (FOV) of the camera.
|
||||
* @param maxDistance The maximum render distance.
|
||||
* @return The distance between the camera and the object if it's within render distance,
|
||||
* or -1.0f if it exceeds the render distance.
|
||||
*/
|
||||
|
||||
f32 is_within_render_distance(Vec3f cameraPos, Vec3f objectPos, u16 orientationY, f32 minDistance, f32 fov, f32 maxDistance) {
|
||||
u16 angleObject;
|
||||
UNUSED u16 pad;
|
||||
|
||||
@@ -926,7 +926,7 @@ void func_8028FCBC(void) {
|
||||
func_80002DAC();
|
||||
D_800DC510 = 1;
|
||||
D_80150118 = 3.0f;
|
||||
D_800DC518 = 0;
|
||||
creditsRenderMode = 0;
|
||||
D_802BA032 = 0;
|
||||
D_8015011E = 0;
|
||||
gCourseTimer = 0.0f;
|
||||
|
||||
+26
-23
@@ -68,9 +68,11 @@ void parse_course_displaylists(uintptr_t addr) {
|
||||
}
|
||||
}
|
||||
|
||||
extern u32 isFlycam;
|
||||
|
||||
void load_surface_map(uintptr_t addr, struct UnkStruct_800DC5EC *arg1) {
|
||||
Player *temp_t1 = arg1->player;
|
||||
Camera *temp_a2 = arg1->camera;
|
||||
Player *player = arg1->player;
|
||||
Camera *camera = arg1->camera;
|
||||
u32 segment = SEGMENT_NUMBER2(addr);
|
||||
u32 offset = SEGMENT_OFFSET(addr);
|
||||
// todo: Should be Gfx*
|
||||
@@ -79,32 +81,31 @@ void load_surface_map(uintptr_t addr, struct UnkStruct_800DC5EC *arg1) {
|
||||
s16 temp_v1;
|
||||
s16 sp1E;
|
||||
s16 temp_v0_3;
|
||||
u16 temp_v0;
|
||||
|
||||
u16 rot;
|
||||
if (gIsMirrorMode) {
|
||||
temp_v0 = (u16) temp_a2->rot[1];
|
||||
if (temp_v0 < 0x2000) {
|
||||
rot = (u16) camera->rot[1];
|
||||
if (rot < 0x2000) {
|
||||
var_a3 = 2;
|
||||
} else if (temp_v0 < 0x6000) {
|
||||
} else if (rot < 0x6000) {
|
||||
var_a3 = 3;
|
||||
} else if (temp_v0 < 0xA000) {
|
||||
} else if (rot < 0xA000) {
|
||||
var_a3 = 0;
|
||||
} else if (temp_v0 < 0xE000) {
|
||||
} else if (rot < 0xE000) {
|
||||
var_a3 = 1;
|
||||
} else {
|
||||
var_a3 = 2;
|
||||
}
|
||||
} else {
|
||||
temp_v0 = (u16) temp_a2->rot[1];
|
||||
if (temp_v0 < 0x2000) {
|
||||
rot = (u16) camera->rot[1];
|
||||
if (rot < 0x2000) {
|
||||
var_a3 = 2;
|
||||
} else if (temp_v0 < 0x6000) {
|
||||
} else if (rot < 0x6000) {
|
||||
var_a3 = 1;
|
||||
}
|
||||
else if (temp_v0 < 0xA000) {
|
||||
else if (rot < 0xA000) {
|
||||
var_a3 = 0;
|
||||
}
|
||||
else if (temp_v0 < 0xE000) {
|
||||
else if (rot < 0xE000) {
|
||||
var_a3 = 3;
|
||||
}
|
||||
else {
|
||||
@@ -113,20 +114,20 @@ void load_surface_map(uintptr_t addr, struct UnkStruct_800DC5EC *arg1) {
|
||||
}
|
||||
arg1->playerDirection = var_a3;
|
||||
|
||||
if (D_80152300[temp_a2 - camera1] == 1) {
|
||||
sp1E = func_802ABD40(temp_a2->unk_54.unk3A);
|
||||
temp_v0_3 = func_802ABD40(temp_t1->unk_110.unk3A);
|
||||
if (D_80152300[camera - camera1] == 1) {
|
||||
sp1E = func_802ABD40(camera->unk_54.unk3A);
|
||||
temp_v0_3 = func_802ABD40(player->unk_110.unk3A);
|
||||
temp_v1 = sp1E - temp_v0_3;
|
||||
if ((temp_v1 < 2) && (temp_v1 >= -1)) {
|
||||
if (sp1E == 255) {
|
||||
if (temp_v0_3 == 255) {
|
||||
temp_v1 = arg1->pathCounter;
|
||||
} else if (temp_t1->unk_110.unk3C[2] > 30.0f) {
|
||||
} else if (player->unk_110.unk3C[2] > 30.0f) {
|
||||
temp_v1 = arg1->pathCounter;
|
||||
} else {
|
||||
temp_v1 = temp_v0_3;
|
||||
}
|
||||
} else if (temp_a2->unk_54.unk3C[2] > 30.0f) {
|
||||
} else if (camera->unk_54.unk3C[2] > 30.0f) {
|
||||
temp_v1 = arg1->pathCounter;
|
||||
} else {
|
||||
temp_v1 = sp1E;
|
||||
@@ -159,7 +160,7 @@ void load_surface_map(uintptr_t addr, struct UnkStruct_800DC5EC *arg1) {
|
||||
default:
|
||||
if (temp_v0_3 == 255) {
|
||||
temp_v1 = arg1->pathCounter;
|
||||
} else if (temp_t1->unk_110.unk3C[2] > 30.0f) {
|
||||
} else if (player->unk_110.unk3C[2] > 30.0f) {
|
||||
temp_v1 = arg1->pathCounter;
|
||||
} else {
|
||||
temp_v1 = temp_v0_3;
|
||||
@@ -168,15 +169,17 @@ void load_surface_map(uintptr_t addr, struct UnkStruct_800DC5EC *arg1) {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
temp_v1 = func_802ABD40(temp_a2->unk_54.unk3A);
|
||||
if (temp_a2->unk_54.unk3C[2] > 30.0f) {
|
||||
temp_v1 = func_802ABD40(camera->unk_54.unk3A);
|
||||
if (camera->unk_54.unk3C[2] > 30.0f) {
|
||||
temp_v1 = arg1->pathCounter;
|
||||
} else if (temp_v1 == 255) {
|
||||
temp_v1 = arg1->pathCounter;
|
||||
}
|
||||
}
|
||||
|
||||
arg1->pathCounter = temp_v1;
|
||||
temp_v1 = ((temp_v1 - 1) * 4) + var_a3;
|
||||
|
||||
gSPDisplayList(gDisplayListHead++, gfx[temp_v1]);
|
||||
}
|
||||
|
||||
@@ -1257,7 +1260,7 @@ void func_8029569C(void) {
|
||||
void func_80295A38(struct UnkStruct_800DC5EC *arg0) {
|
||||
|
||||
func_802B5D64((uintptr_t) D_800DC610, D_802B87D4, 0, 1);
|
||||
if (D_800DC518 != 0) {
|
||||
if (creditsRenderMode) {
|
||||
func_8029569C();
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user