mirror of
https://github.com/HarbourMasters/SpaghettiKart
synced 2026-09-04 02:49:38 -04:00
WIP Compilation
This commit is contained in:
+112
-112
@@ -1,4 +1,4 @@
|
||||
#include <ultra64.h>
|
||||
#include <libultraship.h>
|
||||
#include <macros.h>
|
||||
#include <common_structs.h>
|
||||
#include <mk64.h>
|
||||
@@ -45,9 +45,9 @@ void func_80086F60(s32 objectIndex) {
|
||||
}
|
||||
|
||||
bool func_80086FA4(s32 objectIndex) {
|
||||
bool ret = FALSE;
|
||||
bool ret = false;
|
||||
if (gObjectList[objectIndex].unk_0AE == 0) {
|
||||
ret = TRUE;
|
||||
ret = true;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
@@ -66,7 +66,7 @@ s32 func_80087060(s32 objectIndex, s32 arg1) {
|
||||
s32 sp1C;
|
||||
|
||||
sp1C = 0;
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != FALSE) {
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != false) {
|
||||
set_object_flag_status_true(objectIndex, 8);
|
||||
gObjectList[objectIndex].unk_0B0 = arg1;
|
||||
}
|
||||
@@ -82,7 +82,7 @@ s32 func_80087104(s32 objectIndex, u16 arg1) {
|
||||
s32 sp24;
|
||||
|
||||
sp24 = 0;
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != FALSE) {
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != false) {
|
||||
set_object_flag_status_true(objectIndex, 8);
|
||||
gObjectList[objectIndex].unk_0B0 = random_int(arg1);
|
||||
}
|
||||
@@ -98,7 +98,7 @@ s32 func_800871AC(s32 objectIndex, s32 arg1) {
|
||||
s32 sp24;
|
||||
|
||||
sp24 = 0;
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != FALSE) {
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != false) {
|
||||
set_object_flag_status_true(objectIndex, 8);
|
||||
gObjectList[objectIndex].unk_0B0 = (s16) arg1;
|
||||
}
|
||||
@@ -218,7 +218,7 @@ s32 func_8008789C(s32 objectIndex, s32 arg1) {
|
||||
s32 sp24;
|
||||
|
||||
sp24 = 0;
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != FALSE) {
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != false) {
|
||||
set_object_flag_status_true(objectIndex, 8);
|
||||
func_8008751C(objectIndex);
|
||||
gObjectList[objectIndex].unk_0B0 = arg1;
|
||||
@@ -237,7 +237,7 @@ s32 func_80087954(s32 objectIndex, s32 arg1) {
|
||||
s32 sp24;
|
||||
|
||||
sp24 = 0;
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != FALSE) {
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != false) {
|
||||
set_object_flag_status_true(objectIndex, 8);
|
||||
func_80087620(objectIndex);
|
||||
gObjectList[objectIndex].unk_0B0 = arg1;
|
||||
@@ -258,8 +258,8 @@ bool func_80087A0C(s32 objectIndex, s16 arg1, s16 arg2, s16 arg3, s16 arg4) {
|
||||
s16 temp_v0;
|
||||
bool sp2C;
|
||||
|
||||
sp2C = FALSE;
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != FALSE) {
|
||||
sp2C = false;
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != false) {
|
||||
set_object_flag_status_true(objectIndex, 8);
|
||||
temp_v0 = arg2 - arg1;
|
||||
temp_a0 = arg4 - arg3;
|
||||
@@ -272,7 +272,7 @@ bool func_80087A0C(s32 objectIndex, s16 arg1, s16 arg2, s16 arg3, s16 arg4) {
|
||||
gObjectList[objectIndex].unk_0B0--;
|
||||
if (gObjectList[objectIndex].unk_0B0 < 0) {
|
||||
set_object_flag_status_false(objectIndex, 8);
|
||||
sp2C = TRUE;
|
||||
sp2C = true;
|
||||
} else {
|
||||
object_add_velocity_offset_xz(objectIndex);
|
||||
}
|
||||
@@ -283,7 +283,7 @@ s32 func_80087B84(s32 objectIndex, f32 arg1, f32 arg2) {
|
||||
s32 sp24;
|
||||
|
||||
sp24 = 0;
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != FALSE) {
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != false) {
|
||||
set_object_flag_status_true(objectIndex, 8);
|
||||
gObjectList[objectIndex].velocity[1] = -arg1;
|
||||
}
|
||||
@@ -300,7 +300,7 @@ s32 func_80087C48(s32 objectIndex, f32 arg1, f32 arg2, s32 arg3) {
|
||||
s32 sp24;
|
||||
|
||||
sp24 = 0;
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != FALSE) {
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != false) {
|
||||
set_object_flag_status_true(objectIndex, 8);
|
||||
gObjectList[objectIndex].velocity[1] = arg1;
|
||||
gObjectList[objectIndex].unk_0B0 = (s16) arg3;
|
||||
@@ -340,7 +340,7 @@ bool func_80087E08(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s32
|
||||
bool sp2C;
|
||||
UNUSED s32 pad;
|
||||
|
||||
sp2C = FALSE;
|
||||
sp2C = false;
|
||||
if (is_obj_index_flag_status_inactive(objectIndex, 8) != 0) {
|
||||
set_object_flag_status_true(objectIndex, 8);
|
||||
gObjectList[objectIndex].offset[2] = 0.0f;
|
||||
@@ -356,7 +356,7 @@ bool func_80087E08(s32 objectIndex, f32 arg1, f32 arg2, f32 arg3, s16 arg4, s32
|
||||
if (gObjectList[objectIndex].unk_0B0 < 0) {
|
||||
set_object_flag_status_false(objectIndex, 8);
|
||||
func_80086FD4(objectIndex);
|
||||
sp2C = TRUE;
|
||||
sp2C = true;
|
||||
} else {
|
||||
gObjectList[objectIndex].velocity[1] -= arg2;
|
||||
object_add_velocity_offset_xyz(objectIndex);
|
||||
@@ -585,10 +585,10 @@ void func_800887C0(s32 objectIndex) {
|
||||
|
||||
/**
|
||||
* @brief Returns the distance between the object and the player.
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @return UNUSED
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @return UNUSED
|
||||
*/
|
||||
UNUSED s32 get_horizontal_distance_to_player(s32 objectIndex, Player *player) {
|
||||
s32 x;
|
||||
@@ -601,10 +601,10 @@ UNUSED s32 get_horizontal_distance_to_player(s32 objectIndex, Player *player) {
|
||||
|
||||
/**
|
||||
* @brief Returns the distance between the object and the player.
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @return UNUSED
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @return UNUSED
|
||||
*/
|
||||
UNUSED s32 get_distance_to_player(s32 objectIndex, Player *player) {
|
||||
s32 x;
|
||||
@@ -619,10 +619,10 @@ UNUSED s32 get_distance_to_player(s32 objectIndex, Player *player) {
|
||||
|
||||
/**
|
||||
* @brief Returns the distance between the object and the camera.
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param camera
|
||||
* @return UNUSED
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param camera
|
||||
* @return UNUSED
|
||||
*/
|
||||
u32 get_horizontal_distance_to_camera(s32 objectIndex, Camera *camera) {
|
||||
s32 x;
|
||||
@@ -635,10 +635,10 @@ u32 get_horizontal_distance_to_camera(s32 objectIndex, Camera *camera) {
|
||||
|
||||
/**
|
||||
* @brief Returns the distance between the object and the camera.
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param camera
|
||||
* @return UNUSED
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param camera
|
||||
* @return UNUSED
|
||||
*/
|
||||
UNUSED s32 get_distance_to_camera(s32 objectIndex, Camera *camera) {
|
||||
s32 x;
|
||||
@@ -653,36 +653,36 @@ UNUSED s32 get_distance_to_camera(s32 objectIndex, Camera *camera) {
|
||||
|
||||
/**
|
||||
* @brief Returns if the object is closer than the distance to the player.
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @param distance
|
||||
* @return true
|
||||
* @return false
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool is_within_horizontal_distance_of_player(s32 objectIndex, Player *player, f32 distance) {
|
||||
f32 x;
|
||||
f32 y;
|
||||
bool var_v1;
|
||||
|
||||
var_v1 = FALSE;
|
||||
var_v1 = false;
|
||||
x = gObjectList[objectIndex].pos[0] - player->pos[0];
|
||||
y = gObjectList[objectIndex].pos[2] - player->pos[2];
|
||||
if (((x * x) + (y * y)) <= (distance * distance)) {
|
||||
var_v1 = TRUE;
|
||||
var_v1 = true;
|
||||
}
|
||||
return var_v1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns if the object is between the distance_min and distance_max to the player.
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @param distance_min
|
||||
* @param distance_max
|
||||
* @return true
|
||||
* @return false
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @param distance_min
|
||||
* @param distance_max
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool is_in_bounds_to_player(s32 objectIndex, Player *player, f32 distance_min, f32 distance_max) {
|
||||
f32 x;
|
||||
@@ -690,24 +690,24 @@ bool is_in_bounds_to_player(s32 objectIndex, Player *player, f32 distance_min, f
|
||||
f32 z;
|
||||
bool var_v1;
|
||||
|
||||
var_v1 = FALSE;
|
||||
var_v1 = false;
|
||||
x = gObjectList[objectIndex].pos[0] - player->pos[0];
|
||||
z = gObjectList[objectIndex].pos[2] - player->pos[2];
|
||||
distance = (x * x) + (z * z);
|
||||
if (((distance_min * distance_min) <= distance) && (distance <= (distance_max * distance_max))) {
|
||||
var_v1 = TRUE;
|
||||
var_v1 = true;
|
||||
}
|
||||
return var_v1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns if the object is closer than the distance to the player.
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @param distance
|
||||
* @return true
|
||||
* @return false
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @param distance
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool is_within_distance_to_player(s32 objectIndex, Player *player, f32 distance) {
|
||||
f32 x;
|
||||
@@ -715,47 +715,47 @@ bool is_within_distance_to_player(s32 objectIndex, Player *player, f32 distance)
|
||||
f32 y;
|
||||
bool var_v1;
|
||||
|
||||
var_v1 = FALSE;
|
||||
var_v1 = false;
|
||||
x = gObjectList[objectIndex].pos[0] - player->pos[0];
|
||||
y = gObjectList[objectIndex].pos[1] - player->pos[1];
|
||||
z = gObjectList[objectIndex].pos[2] - player->pos[2];
|
||||
if (((x * x) + (y * y) + (z * z)) <= (distance * distance)) {
|
||||
var_v1 = TRUE;
|
||||
var_v1 = true;
|
||||
}
|
||||
return var_v1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns if the object is between the distance_min and distance_max to the camera.
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param camera
|
||||
* @param distance
|
||||
* @return true
|
||||
* @return false
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param camera
|
||||
* @param distance
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool is_within_horizontal_distance_to_camera(s32 objectIndex, Camera *camera, f32 distance) {
|
||||
f32 x;
|
||||
f32 y;
|
||||
bool var_v1;
|
||||
|
||||
var_v1 = FALSE;
|
||||
var_v1 = false;
|
||||
x = gObjectList[objectIndex].pos[0] - camera->pos[0];
|
||||
y = gObjectList[objectIndex].pos[2] - camera->pos[2];
|
||||
if (((x * x) + (y * y)) <= (distance * distance)) {
|
||||
var_v1 = TRUE;
|
||||
var_v1 = true;
|
||||
}
|
||||
return var_v1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns if the object is between the distance_min and distance_max to the camera.
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param camera
|
||||
* @param distance_min
|
||||
* @param distance_max
|
||||
* @return UNUSED
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param camera
|
||||
* @param distance_min
|
||||
* @param distance_max
|
||||
* @return UNUSED
|
||||
*/
|
||||
UNUSED bool is_within_bounds_to_camera(s32 objectIndex, Camera *camera, f32 distance_min, f32 distance_max) {
|
||||
f32 x;
|
||||
@@ -763,23 +763,23 @@ UNUSED bool is_within_bounds_to_camera(s32 objectIndex, Camera *camera, f32 dist
|
||||
f32 z;
|
||||
bool var_v1;
|
||||
|
||||
var_v1 = FALSE;
|
||||
var_v1 = false;
|
||||
x = gObjectList[objectIndex].pos[0] - camera->pos[0];
|
||||
z = gObjectList[objectIndex].pos[2] - camera->pos[2];
|
||||
distance = (x * x) + (z * z);
|
||||
if (((distance_min * distance_min) <= distance) && (distance <= (distance_max * distance_max))) {
|
||||
var_v1 = TRUE;
|
||||
var_v1 = true;
|
||||
}
|
||||
return var_v1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns if the object is closer than the distance to the camera.
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param camera
|
||||
* @param distance
|
||||
* @return UNUSED
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param camera
|
||||
* @param distance
|
||||
* @return UNUSED
|
||||
*/
|
||||
UNUSED bool is_within_distance_to_camera(s32 objectIndex, Camera *camera, f32 distance) {
|
||||
f32 x;
|
||||
@@ -787,23 +787,23 @@ UNUSED bool is_within_distance_to_camera(s32 objectIndex, Camera *camera, f32 di
|
||||
f32 y;
|
||||
bool var_v1;
|
||||
|
||||
var_v1 = FALSE;
|
||||
var_v1 = false;
|
||||
x = gObjectList[objectIndex].pos[0] - camera->pos[0];
|
||||
y = gObjectList[objectIndex].pos[1] - camera->pos[1];
|
||||
z = gObjectList[objectIndex].pos[2] - camera->pos[2];
|
||||
if (((x * x) + (y * y) + (z * z)) <= (distance * distance)) {
|
||||
var_v1 = TRUE;
|
||||
var_v1 = true;
|
||||
}
|
||||
return var_v1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns if the object collided with the player.
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @return true
|
||||
* @return false
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool has_collided_horizontally_with_player(s32 objectIndex, Player *player) {
|
||||
f32 x;
|
||||
@@ -811,23 +811,23 @@ bool has_collided_horizontally_with_player(s32 objectIndex, Player *player) {
|
||||
f32 z;
|
||||
bool var_v1;
|
||||
|
||||
var_v1 = FALSE;
|
||||
var_v1 = false;
|
||||
x = gObjectList[objectIndex].pos[0] - player->pos[0];
|
||||
z = gObjectList[objectIndex].pos[2] - player->pos[2];
|
||||
distance = gObjectList[objectIndex].boundingBoxSize + player->boundingBoxSize;
|
||||
if (((x * x) + (z * z)) <= (distance * distance)) {
|
||||
var_v1 = TRUE;
|
||||
var_v1 = true;
|
||||
}
|
||||
return var_v1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns if the object collided with the player.
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @return true
|
||||
* @return false
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool has_collided_with_player(s32 objectIndex, Player *player) {
|
||||
f32 x;
|
||||
@@ -836,45 +836,45 @@ bool has_collided_with_player(s32 objectIndex, Player *player) {
|
||||
f32 y;
|
||||
bool var_v1;
|
||||
|
||||
var_v1 = FALSE;
|
||||
var_v1 = false;
|
||||
x = gObjectList[objectIndex].pos[0] - player->pos[0];
|
||||
y = gObjectList[objectIndex].pos[1] - player->pos[1];
|
||||
z = gObjectList[objectIndex].pos[2] - player->pos[2];
|
||||
distance = gObjectList[objectIndex].boundingBoxSize + player->boundingBoxSize;
|
||||
if (((x * x) + (y * y) + (z * z)) <= (distance * distance)) {
|
||||
var_v1 = TRUE;
|
||||
var_v1 = true;
|
||||
}
|
||||
return var_v1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns if the object collided with the player.
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @param distance
|
||||
* @return UNUSED
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @param distance
|
||||
* @return UNUSED
|
||||
*/
|
||||
UNUSED bool has_collided_with_player_1d(s32 objectIndex, Player *player, f32 distance) {
|
||||
f32 x;
|
||||
bool var_v1;
|
||||
|
||||
var_v1 = FALSE;
|
||||
var_v1 = false;
|
||||
x = gObjectList[objectIndex].pos[1] - player->pos[1];
|
||||
if ((x * x) <= (distance * distance)) {
|
||||
var_v1 = TRUE;
|
||||
var_v1 = true;
|
||||
}
|
||||
return var_v1;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief Returns if the object collided with the player and is closer than the distance in the y axis.
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @param distance_y
|
||||
* @return true
|
||||
* @return false
|
||||
*
|
||||
* @param objectIndex
|
||||
* @param player
|
||||
* @param distance_y
|
||||
* @return true
|
||||
* @return false
|
||||
*/
|
||||
bool has_collided_with_player_and_within_height(s32 objectIndex, Player *player, f32 distance_y) {
|
||||
f32 x;
|
||||
@@ -883,7 +883,7 @@ bool has_collided_with_player_and_within_height(s32 objectIndex, Player *player,
|
||||
f32 y;
|
||||
bool var_v1;
|
||||
|
||||
var_v1 = FALSE;
|
||||
var_v1 = false;
|
||||
x = gObjectList[objectIndex].pos[0] - player->pos[0];
|
||||
y = gObjectList[objectIndex].pos[1] - player->pos[1];
|
||||
z = gObjectList[objectIndex].pos[2] - player->pos[2];
|
||||
@@ -893,7 +893,7 @@ bool has_collided_with_player_and_within_height(s32 objectIndex, Player *player,
|
||||
y = -y;
|
||||
}
|
||||
if ((((x * x) + (z * z)) <= (distance * distance)) && (y <= distance_y)) {
|
||||
var_v1 = TRUE;
|
||||
var_v1 = true;
|
||||
}
|
||||
return var_v1;
|
||||
}
|
||||
@@ -914,13 +914,13 @@ UNUSED bool func_80088F94(s32 objectIndex, Player *player, f32 arg2) {
|
||||
bool var_v1;
|
||||
|
||||
distance = gObjectList[objectIndex].pos[1] - player->unk_074;
|
||||
var_v1 = FALSE;
|
||||
var_v1 = false;
|
||||
// abs(distance)
|
||||
if (distance < 0.0f) {
|
||||
distance = -distance;
|
||||
}
|
||||
if (distance <= arg2) {
|
||||
var_v1 = TRUE;
|
||||
var_v1 = true;
|
||||
}
|
||||
return var_v1;
|
||||
}
|
||||
@@ -1238,7 +1238,7 @@ s32 func_8008A060(s32 objectIndex, Camera *camera, u16 arg2) {
|
||||
|
||||
var_v1 = 0;
|
||||
temp_t3 = (((u16)camera->rot[1] - gObjectList[objectIndex].direction_angle[1]) + (arg2 >> 1));
|
||||
|
||||
|
||||
//! @warning Always true
|
||||
if ((temp_t3 >= 0) && (arg2 >= temp_t3)) {
|
||||
var_v1 = 1;
|
||||
@@ -1266,10 +1266,10 @@ bool is_object_visible_on_camera(s32 objectIndex, Camera *camera, u16 angle) {
|
||||
u16 temp_t2;
|
||||
s32 var_t0;
|
||||
|
||||
var_t0 = FALSE;
|
||||
var_t0 = false;
|
||||
temp_t2 = (get_angle_between_xy(camera->pos[0], gObjectList[objectIndex].pos[0], camera->pos[2], gObjectList[objectIndex].pos[2]) + ((s32) angle / 2)) - camera->rot[1];
|
||||
if ((temp_t2 >= 0) && (angle >= temp_t2)) {
|
||||
var_t0 = TRUE;
|
||||
var_t0 = true;
|
||||
}
|
||||
return var_t0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user