mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-12-17 22:02:19 -05:00
Name alpha-distance update function from decomp (#4658)
This commit is contained in:
parent
ad23298500
commit
6823b6990b
@ -537,7 +537,7 @@ void func_80034BA0(PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overr
|
||||
PostLimbDraw postLimbDraw, Actor* actor, s16 alpha);
|
||||
void func_80034CC4(PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw,
|
||||
PostLimbDraw postLimbDraw, Actor* actor, s16 alpha);
|
||||
s16 func_80034DD4(Actor* actor, PlayState* play, s16 arg2, f32 arg3);
|
||||
s16 Actor_UpdateAlphaByDistance(Actor* actor, PlayState* play, s16 arg2, f32 arg3);
|
||||
void Animation_ChangeByInfo(SkelAnime* skelAnime, AnimationInfo* animationInfo, s32 index);
|
||||
void func_80034F54(PlayState* play, s16* arg1, s16* arg2, s32 arg3);
|
||||
void Actor_Noop(Actor* actor, PlayState* play);
|
||||
|
@ -4547,25 +4547,25 @@ void func_80034CC4(PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overr
|
||||
CLOSE_DISPS(play->state.gfxCtx);
|
||||
}
|
||||
|
||||
s16 func_80034DD4(Actor* actor, PlayState* play, s16 arg2, f32 arg3) {
|
||||
s16 Actor_UpdateAlphaByDistance(Actor* actor, PlayState* play, s16 alpha, f32 radius) {
|
||||
Player* player = GET_PLAYER(play);
|
||||
f32 var;
|
||||
f32 distance;
|
||||
|
||||
if ((play->csCtx.state != CS_STATE_IDLE) || (gDbgCamEnabled)) {
|
||||
var = Math_Vec3f_DistXYZ(&actor->world.pos, &play->view.eye) * 0.25f;
|
||||
distance = Math_Vec3f_DistXYZ(&actor->world.pos, &play->view.eye) * 0.25f;
|
||||
} else {
|
||||
var = Math_Vec3f_DistXYZ(&actor->world.pos, &player->actor.world.pos);
|
||||
distance = Math_Vec3f_DistXYZ(&actor->world.pos, &player->actor.world.pos);
|
||||
}
|
||||
|
||||
if (arg3 < var) {
|
||||
if (radius < distance) {
|
||||
actor->flags &= ~ACTOR_FLAG_TARGETABLE;
|
||||
Math_SmoothStepToS(&arg2, 0, 6, 0x14, 1);
|
||||
Math_SmoothStepToS(&alpha, 0, 6, 0x14, 1);
|
||||
} else {
|
||||
actor->flags |= ACTOR_FLAG_TARGETABLE;
|
||||
Math_SmoothStepToS(&arg2, 0xFF, 6, 0x14, 1);
|
||||
Math_SmoothStepToS(&alpha, 0xFF, 6, 0x14, 1);
|
||||
}
|
||||
|
||||
return arg2;
|
||||
return alpha;
|
||||
}
|
||||
|
||||
void Animation_ChangeByInfo(SkelAnime* skelAnime, AnimationInfo* animationInfo, s32 index) {
|
||||
|
@ -629,7 +629,7 @@ void func_80AAB5A4(EnMd* this, PlayState* play) {
|
||||
: 400.0f;
|
||||
}
|
||||
|
||||
this->alpha = func_80034DD4(&this->actor, play, this->alpha, temp);
|
||||
this->alpha = Actor_UpdateAlphaByDistance(&this->actor, play, this->alpha, temp);
|
||||
this->actor.shape.shadowAlpha = this->alpha;
|
||||
} else {
|
||||
this->alpha = 255;
|
||||
|
@ -742,10 +742,10 @@ void EnSa_Update(Actor* thisx, PlayState* play) {
|
||||
|
||||
if (this->actionFunc != func_80AF68E4) {
|
||||
if (CVarGetInteger(CVAR_ENHANCEMENT("DisableKokiriDrawDistance"), 0) != 0) {
|
||||
this->alpha = func_80034DD4(&this->actor, play, this->alpha, 32767);
|
||||
this->alpha = Actor_UpdateAlphaByDistance(&this->actor, play, this->alpha, 32767);
|
||||
}
|
||||
else {
|
||||
this->alpha = func_80034DD4(&this->actor, play, this->alpha, 400.0f);
|
||||
this->alpha = Actor_UpdateAlphaByDistance(&this->actor, play, this->alpha, 400.0f);
|
||||
}
|
||||
} else {
|
||||
this->alpha = 255;
|
||||
|
Loading…
Reference in New Issue
Block a user