Merge branch 'mr-origin-89'
This commit is contained in:
@@ -149,7 +149,7 @@ void func_8024E6E0(s32 controller_index, s32 *dst[4]){
|
||||
dst[3] = D_80281138[controller_index].unk24[3];
|
||||
}
|
||||
|
||||
void func_8024E71C(s32 controller_index, f32 dst[2]){
|
||||
void controller_getJoystick(s32 controller_index, f32 dst[2]){
|
||||
if(func_802E4A08()){
|
||||
dst[0] = D_80281250[controller_index].joystick[0];
|
||||
dst[1] = D_80281250[controller_index].joystick[1];
|
||||
|
@@ -345,14 +345,12 @@ void ml_vec3f_roll_rotate_copy(f32 dst[3], f32 src[3], f32 roll)
|
||||
dst[0] = val;
|
||||
}
|
||||
|
||||
void ml_vec3f_set_length(f32 arg0[3], f32 arg1)
|
||||
{
|
||||
f32 length = LENGTH_VEC3F(arg0);
|
||||
void ml_vec3f_set_length(f32 vec[3], f32 length) {
|
||||
f32 vec_length = LENGTH_VEC3F(vec);
|
||||
|
||||
if (length != 0)
|
||||
{
|
||||
f32 inv_length = arg1 / length;
|
||||
TUPLE_SCALE_COPY(arg0, arg0, inv_length)
|
||||
if (vec_length != 0) {
|
||||
f32 inv_length = length / vec_length;
|
||||
TUPLE_SCALE_COPY(vec, vec, inv_length)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -598,16 +596,12 @@ void ml_defrag(void)
|
||||
|
||||
//ml_timer_update
|
||||
//decrement a counter and returns True if timer reaches 0
|
||||
bool ml_timer_update(f32 *timer, f32 delta)
|
||||
{
|
||||
if (*timer > 0)
|
||||
{
|
||||
bool ml_timer_update(f32 *timer, f32 delta) {
|
||||
if (*timer > 0) {
|
||||
*timer -= delta;
|
||||
|
||||
if (*timer <= 0)
|
||||
{
|
||||
if (*timer <= 0) {
|
||||
*timer = 0;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
}
|
||||
@@ -946,14 +940,13 @@ int func_802585E0(s32 vec[3], s32 minX, s32 minY, s32 minZ, s32 maxX, s32 maxY,
|
||||
&& vec[2] > minZ && vec[2] < maxZ;
|
||||
}
|
||||
|
||||
//ml_vec3f_horizontal_distance_zero_likely
|
||||
f32 func_80258640(f32 vec1[3], f32 vec2[3])
|
||||
{
|
||||
f32 ml_vec3f_horizontal_distance_zero_likely(f32 vec1[3], f32 vec2[3]) {
|
||||
f32 dX = vec1[0] - vec2[0];
|
||||
f32 dZ = vec1[2] - vec2[2];
|
||||
|
||||
if (dX != 0 || dZ != 0)
|
||||
if (dX != 0 || dZ != 0) {
|
||||
return gu_sqrtf(_SQ2(dX, dZ));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@@ -14,7 +14,7 @@ void func_802409C0(f32 arg0[3], f32 arg1){
|
||||
f32 dt;
|
||||
|
||||
dt = time_getDelta()*arg1;
|
||||
func_8024E71C(0, sp28);
|
||||
controller_getJoystick(0, sp28);
|
||||
|
||||
sp30[0] = sp28[0] * dt;
|
||||
sp30[1] = 0.0f;
|
||||
@@ -46,7 +46,7 @@ void func_80240AC8(f32 arg0[3], f32 arg1){
|
||||
f32 dt;
|
||||
|
||||
dt = time_getDelta()*arg1;
|
||||
func_8024E71C(0, sp28);
|
||||
controller_getJoystick(0, sp28);
|
||||
|
||||
if(0.0f != sp28[0] || 0.0f != sp28[1]){
|
||||
D_80275860++;
|
||||
|
@@ -2,7 +2,7 @@
|
||||
#include "functions.h"
|
||||
#include "variables.h"
|
||||
|
||||
int func_802458E0(f32 arg0[3], Actor *arg1, s32 arg2);
|
||||
int collisionTri_isHitFromAbove_actor(f32 arg0[3], Actor *arg1, s32 arg2);
|
||||
extern bool func_80320DB0(f32[3], f32, f32[3], u32);
|
||||
extern bool func_80323240(struct56s *, f32, f32[3]);
|
||||
extern f32 ml_dotProduct_vec3f(f32[3], f32[3]);
|
||||
@@ -308,31 +308,32 @@ BKCollisionTri *func_802457C4(f32 arg0[3], f32 arg1[3], f32 arg2, f32 arg3, f32
|
||||
return var_v1;
|
||||
}
|
||||
|
||||
void collisionTri_copy(BKCollisionTri *dst, BKCollisionTri *src){
|
||||
dst->unk0[0] = src->unk0[0];
|
||||
dst->unk0[1] = src->unk0[1];
|
||||
dst->unk0[2] = src->unk0[2];
|
||||
void collisionTri_copy(BKCollisionTri *dst, BKCollisionTri *src) {
|
||||
TUPLE_COPY(dst->unk0, src->unk0)
|
||||
dst->flags = src->flags;
|
||||
dst->unk6 = src->unk6;
|
||||
}
|
||||
|
||||
int func_802458A8(f32 arg0[3], ActorMarker *arg1, s32 arg2){
|
||||
return func_802458E0(arg0, marker_getActor(arg1), arg2);
|
||||
int collisionTri_isHitFromAbove_marker(f32 position[3], ActorMarker *marker, s32 verticalOffset) {
|
||||
return collisionTri_isHitFromAbove_actor(position, marker_getActor(marker), verticalOffset);
|
||||
}
|
||||
|
||||
int func_802458E0(f32 arg0[3], Actor *arg1, s32 arg2){
|
||||
int collisionTri_isHitFromAbove_actor(f32 position[3], Actor *actor, s32 verticalOffset) {
|
||||
f32 sp34[3];
|
||||
f32 sp28[3];
|
||||
f32 sp1C[3];
|
||||
f32 tmp_position[3];
|
||||
f32 adjusted_actor_position[3];
|
||||
|
||||
ml_vec3f_copy(sp28, arg0);
|
||||
ml_vec3f_copy(sp1C, arg1->position);
|
||||
sp1C[1] += (f32)arg2;
|
||||
if(sp1C[1] < sp28[1])
|
||||
return FALSE;
|
||||
ml_vec3f_copy(tmp_position, position);
|
||||
ml_vec3f_copy(adjusted_actor_position, actor->position);
|
||||
adjusted_actor_position[1] += (f32) verticalOffset;
|
||||
|
||||
if(func_80320B98(sp28, sp1C, sp34, 0x25e0000)){
|
||||
if (adjusted_actor_position[1] < tmp_position[1]) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
if (func_80320B98(tmp_position, adjusted_actor_position, sp34, 0x25e0000)) {
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user