src/core1/ml.c: more consistent function names

This commit is contained in:
mariob92
2024-10-17 16:45:16 +02:00
parent bc6680d618
commit e19c5f75d0
78 changed files with 216 additions and 248 deletions

View File

@@ -321,7 +321,7 @@ void chTiptup_update(Actor *this){
}
}
else{
if(ml_distance_vec3f(this->position, player_position) < 300.0f && player_getTransformation() == TRANSFORM_1_BANJO && !jiggyscore_isSpawned(JIGGY_27_BGS_TIPTUP)){
if(ml_vec3f_distance(this->position, player_position) < 300.0f && player_getTransformation() == TRANSFORM_1_BANJO && !jiggyscore_isSpawned(JIGGY_27_BGS_TIPTUP)){
chTiptup_setState(this, 2);
}
}
@@ -335,12 +335,12 @@ void chTiptup_update(Actor *this){
}
} //L80389370
else{
if(ml_distance_vec3f(this->position, player_position) >= 300.0f)
if(ml_vec3f_distance(this->position, player_position) >= 300.0f)
chTiptup_setState(this, 1);
}
}//L803893A0
if(this->state == 6){
if(ml_distance_vec3f(this->position, player_position) < 300.0f && !unqPtr->unk8){
if(ml_vec3f_distance(this->position, player_position) < 300.0f && !unqPtr->unk8){
unqPtr->unk8 = 1;
gcdialog_showText(0xc7d, 4, 0, 0, 0, 0);
}

View File

@@ -372,7 +372,7 @@ void chflibbit_update(Actor *this){
sp84[0] = (f32)local->unkE[0];
sp84[1] = (f32)local->unkE[1];
sp84[2] = (f32)local->unkE[2];
if(ml_distance_vec3f(this->position, sp84) < 30.0f){
if(ml_vec3f_distance(this->position, sp84) < 30.0f){
func_80386AEC(this, 1);
}
else{

View File

@@ -260,7 +260,7 @@ bool func_8038C2A8(ActorMarker *marker) {
local = (ActorLocal_MrVile *)&this->local;
player_getPosition(player_position);
if (this->state == 6) {
return ml_distance_vec3f(this->position, player_position) < 150.0f;
return ml_vec3f_distance(this->position, player_position) < 150.0f;
}
return local->unk0 == 1;
}
@@ -351,7 +351,7 @@ void chvile_update(Actor *this) {
local->game_marker = actorArray_findClosestActorFromActorId(this->position, 0x138, -1, &sp90)->marker;
}
player_getPosition(player_position);
sp90 = ml_distance_vec3f(this->position, player_position);
sp90 = ml_vec3f_distance(this->position, player_position);
if (sp90 <= 300.0f) {
local->unk0 = (local->unk0 == 0) ? 1 : 2;
} else if (sp90 > 300.0f) {
@@ -411,7 +411,7 @@ void chvile_update(Actor *this) {
if (this->state == 4) {
player_getPosition(local->target_position);
local->unk10 = 500.0f;
if ((local->unkC == 102) && (ml_distance_vec3f(this->position, local->target_position) < 200.0f)) {
if ((local->unkC == 102) && (ml_vec3f_distance(this->position, local->target_position) < 200.0f)) {
BGS_func_8038BBA0(this, 103);
}
if ((local->unkC == 103) && (skeletalAnim_getLoopCount(this->unk148) >= 2)) {
@@ -420,7 +420,7 @@ void chvile_update(Actor *this) {
}
if (this->state == 5) {
local->unk10 = 200.0f;
if (ml_distance_vec3f(this->position, local->target_position) < 100.0f) {
if (ml_vec3f_distance(this->position, local->target_position) < 100.0f) {
local->target_position[0] = randf2(-500.0f, 500.0f);
local->target_position[1] = 0.0f;
local->target_position[2] = randf2(-500.0f, 500.0f);
@@ -428,12 +428,12 @@ void chvile_update(Actor *this) {
}
if ((this->state == 6)){
local->unk10 = 400.0f;
if((ml_distance_vec3f(this->position, local->target_position) < 100.0f) || (ml_distance_vec3f(player_position, local->target_position) < 300.0f)) {
if((ml_vec3f_distance(this->position, local->target_position) < 100.0f) || (ml_vec3f_distance(player_position, local->target_position) < 300.0f)) {
for(i = 0; i < 10; i++){
random_position[0] = randf2(-500.0f, 500.0f);
random_position[1] = 0.0f;
random_position[2] = randf2(-500.0f, 500.0f);
if ((i == 0) || (ml_distance_vec3f(player_position, random_position) > ml_distance_vec3f(player_position, local->target_position))) {
if ((i == 0) || (ml_vec3f_distance(player_position, random_position) > ml_vec3f_distance(player_position, local->target_position))) {
local->target_position[0] = random_position[0];
local->target_position[1] = random_position[1];
local->target_position[2] = random_position[2];

View File

@@ -140,7 +140,7 @@ void func_8038F6A4(Actor *this)
player_getPosition(sp48);
if (!this->has_met_before)
{
if ((((ml_distance_vec3f(local->unk18, sp48) < 250.0f) && (ml_distance_vec3f(local->unk18, sp48) > 80.0f)) && (!func_8028ECAC())) && (player_getTransformation() == TRANSFORM_1_BANJO))
if ((((ml_vec3f_distance(local->unk18, sp48) < 250.0f) && (ml_vec3f_distance(local->unk18, sp48) > 80.0f)) && (!func_8028ECAC())) && (player_getTransformation() == TRANSFORM_1_BANJO))
{
gcdialog_showText(0xC7E, 0, 0, 0, 0, 0);
this->has_met_before = TRUE;

View File

@@ -423,7 +423,7 @@ void BGS_func_8038E034(Actor *this) {
sp7C[0] = (f32) local->unk10[0];
sp7C[1] = (f32) local->unk10[1];
sp7C[2] = (f32) local->unk10[2];
if (ml_distance_vec3f(this->position, sp7C) < 30.0f) {
if (ml_vec3f_distance(this->position, sp7C) < 30.0f) {
func_8038D9D0(this, 1);
} else {
func_8038D9D0(this, 5);

View File

@@ -169,7 +169,7 @@ void BGS_func_80389850(Actor *this, s32 arg1) {
sp7C[2] = 0.0f;
sp7C[1] = sp94[1];
sp7C[0] = 0.0f;
if(ml_distance_vec3f(sp94, sp7C) <= 1000.0f){
if(ml_vec3f_distance(sp94, sp7C) <= 1000.0f){
break;
}
}
@@ -428,7 +428,7 @@ void chvilegame_player_consume_piece(Actor *this) {
if ((end != begin) && BGS_func_80389810(sp44)){
sp44[1] = 0.0f;
for(i_ptr = begin; i_ptr < end; i_ptr++){
if ((ml_distance_vec3f(i_ptr->position, sp44) < 65.25) && chyumblie_is_edible(i_ptr->marker)) {
if ((ml_vec3f_distance(i_ptr->position, sp44) < 65.25) && chyumblie_is_edible(i_ptr->marker)) {
is_correct_type = ((local->current_type != YUMBLIE) && (i_ptr->type != YUMBLIE)) || (((local->current_type == YUMBLIE) && i_ptr->type == YUMBLIE));
if (is_correct_type) {
local->player_score++;
@@ -466,7 +466,7 @@ bool chvilegame_cpu_consume_piece(ActorMarker *marker, f32 position[3]) {
begin = vector_getBegin(local->game_pieces);
end = vector_getEnd(local->game_pieces);
for(i_ptr = begin; i_ptr < end; i_ptr++){
if ((ml_distance_vec3f(i_ptr->position, position) < 50.0f) && func_8038B684(i_ptr->marker)) {
if ((ml_vec3f_distance(i_ptr->position, position) < 50.0f) && func_8038B684(i_ptr->marker)) {
local->vile_score++;
timedFunc_set_1(0.0f, (GenFunction_1)func_802FDCB8, ITEM_1B_VILE_VILE_SCORE);
timedFunc_set_1(0.5f, (GenFunction_1)func_802FDCB8, ITEM_1B_VILE_VILE_SCORE);
@@ -545,12 +545,12 @@ bool chvilegame_find_closest_piece(ActorMarker *marker, f32 position[0], f32 yaw
piece_direction[0] = i_ptr->position[0] - position[0];
piece_direction[1] = i_ptr->position[1] - position[1];
piece_direction[2] = i_ptr->position[2] - position[2];
distance = ml_distance_vec3f(i_ptr->position, position);
distance = ml_vec3f_distance(i_ptr->position, position);
angle_diff = func_80256AB4(target_direction[0], target_direction[2], piece_direction[0], piece_direction[2]);
if( (distance > 300.0f)
|| ((-0.8 < angle_diff) && (angle_diff < 0.8) && ((piece_direction[0]*target_direction[0] + piece_direction[1]*target_direction[1] + piece_direction[2]*target_direction[2]) >= 0.0f))
) {
if ((closest_piece == NULL) || (distance < ml_distance_vec3f(position, closest_piece->position))){
if ((closest_piece == NULL) || (distance < ml_vec3f_distance(position, closest_piece->position))){
closest_piece = i_ptr;
}
}