diff options
| author | fig02 <fig02srl@gmail.com> | 2022-12-24 12:18:57 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-12-24 12:18:57 -0500 |
| commit | 92e03cf747933ea8dbdea0dd996c5d6ef7635ffe (patch) | |
| tree | 5c8828d115b05a896b3e018398939f5af859a279 /src/code | |
| parent | 4a9873775cfda32008cc1f66bd26310b3c2afdf3 (diff) | |
speedXZ -> speed (#1477)
* speedXZ -> speed
* +=
* revert arg in player function
* anon review
* engineer review
* forgot one
* last review
* revert decimal
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_actor.c | 22 | ||||
| -rw-r--r-- | src/code/z_en_a_keep.c | 14 | ||||
| -rw-r--r-- | src/code/z_en_item00.c | 16 | ||||
| -rw-r--r-- | src/code/z_player_lib.c | 4 |
4 files changed, 28 insertions, 28 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c index a58bc208a..964d434b4 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -850,8 +850,8 @@ void func_8002D7EC(Actor* actor) { } void func_8002D868(Actor* actor) { - actor->velocity.x = Math_SinS(actor->world.rot.y) * actor->speedXZ; - actor->velocity.z = Math_CosS(actor->world.rot.y) * actor->speedXZ; + actor->velocity.x = Math_SinS(actor->world.rot.y) * actor->speed; + actor->velocity.z = Math_CosS(actor->world.rot.y) * actor->speed; actor->velocity.y += actor->gravity; if (actor->velocity.y < actor->minVelocityY) { @@ -865,11 +865,11 @@ void Actor_MoveForward(Actor* actor) { } void func_8002D908(Actor* actor) { - f32 sp24 = Math_CosS(actor->world.rot.x) * actor->speedXZ; + f32 speedXZ = Math_CosS(actor->world.rot.x) * actor->speed; - actor->velocity.x = Math_SinS(actor->world.rot.y) * sp24; - actor->velocity.y = Math_SinS(actor->world.rot.x) * actor->speedXZ; - actor->velocity.z = Math_CosS(actor->world.rot.y) * sp24; + actor->velocity.x = Math_SinS(actor->world.rot.y) * speedXZ; + actor->velocity.y = Math_SinS(actor->world.rot.x) * actor->speed; + actor->velocity.z = Math_CosS(actor->world.rot.y) * speedXZ; } void func_8002D97C(Actor* actor) { @@ -878,7 +878,7 @@ void func_8002D97C(Actor* actor) { } void func_8002D9A4(Actor* actor, f32 arg1) { - actor->speedXZ = Math_CosS(actor->world.rot.x) * arg1; + actor->speed = Math_CosS(actor->world.rot.x) * arg1; actor->velocity.y = -Math_SinS(actor->world.rot.x) * arg1; } @@ -3350,9 +3350,9 @@ Actor* Actor_GetProjectileActor(PlayState* play, Actor* refActor, f32 radius) { (((ArmsHook*)actor)->timer == 0)) { actor = actor->next; } else { - deltaX = Math_SinS(actor->world.rot.y) * (actor->speedXZ * 10.0f); + deltaX = Math_SinS(actor->world.rot.y) * (actor->speed * 10.0f); deltaY = actor->velocity.y + (actor->gravity * 10.0f); - deltaZ = Math_CosS(actor->world.rot.y) * (actor->speedXZ * 10.0f); + deltaZ = Math_CosS(actor->world.rot.y) * (actor->speed * 10.0f); spA8.x = actor->world.pos.x + deltaX; spA8.y = actor->world.pos.y + deltaY; @@ -4091,7 +4091,7 @@ s32 func_80035124(Actor* actor, PlayState* play) { actor->params = 1; } else if (!(actor->bgCheckFlags & BGCHECKFLAG_GROUND)) { Actor_MoveForward(actor); - Math_SmoothStepToF(&actor->speedXZ, 0.0f, 1.0f, 0.1f, 0.0f); + Math_SmoothStepToF(&actor->speed, 0.0f, 1.0f, 0.1f, 0.0f); } else if ((actor->bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) && (actor->velocity.y < -4.0f)) { ret = 1; } else { @@ -4299,7 +4299,7 @@ Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, spawnPos->z, spawnRot->x, spawnRot->y, actor->objBankIndex, params); if (spawnedEnPart != NULL) { spawnedEnPart->actor.scale = actor->scale; - spawnedEnPart->actor.speedXZ = arg3[0]; + spawnedEnPart->actor.speed = arg3[0]; spawnedEnPart->displayList = dList; spawnedEnPart->action = 2; spawnedEnPart->timer = timer; diff --git a/src/code/z_en_a_keep.c b/src/code/z_en_a_keep.c index 61d48446d..b58e813cd 100644 --- a/src/code/z_en_a_keep.c +++ b/src/code/z_en_a_keep.c @@ -265,11 +265,11 @@ void EnAObj_SetupBoulderFragment(EnAObj* this, s16 type) { } void EnAObj_BoulderFragment(EnAObj* this, PlayState* play) { - Math_SmoothStepToF(&this->dyna.actor.speedXZ, 1.0f, 1.0f, 0.5f, 0.0f); + Math_SmoothStepToF(&this->dyna.actor.speed, 1.0f, 1.0f, 0.5f, 0.0f); this->dyna.actor.shape.rot.x += this->dyna.actor.world.rot.x >> 1; this->dyna.actor.shape.rot.z += this->dyna.actor.world.rot.z >> 1; - if (this->dyna.actor.speedXZ != 0.0f && this->dyna.actor.bgCheckFlags & BGCHECKFLAG_WALL) { + if (this->dyna.actor.speed != 0.0f && this->dyna.actor.bgCheckFlags & BGCHECKFLAG_WALL) { this->dyna.actor.world.rot.y = this->dyna.actor.wallYaw - this->dyna.actor.world.rot.y + this->dyna.actor.wallYaw - 0x8000; if (1) {} @@ -279,7 +279,7 @@ void EnAObj_BoulderFragment(EnAObj* this, PlayState* play) { if (this->dyna.actor.bgCheckFlags & BGCHECKFLAG_GROUND_TOUCH) { if (this->dyna.actor.velocity.y < -8.0f) { this->dyna.actor.velocity.y *= -0.6f; - this->dyna.actor.speedXZ *= 0.6f; + this->dyna.actor.speed *= 0.6f; this->dyna.actor.bgCheckFlags &= ~(BGCHECKFLAG_GROUND | BGCHECKFLAG_GROUND_TOUCH); } else { Actor_Kill(&this->dyna.actor); @@ -294,13 +294,13 @@ void EnAObj_SetupBlock(EnAObj* this, s16 type) { } void EnAObj_Block(EnAObj* this, PlayState* play) { - this->dyna.actor.speedXZ += this->dyna.unk_150; + this->dyna.actor.speed += this->dyna.unk_150; this->dyna.actor.world.rot.y = this->dyna.unk_158; - this->dyna.actor.speedXZ = CLAMP(this->dyna.actor.speedXZ, -2.5f, 2.5f); + this->dyna.actor.speed = CLAMP(this->dyna.actor.speed, -2.5f, 2.5f); - Math_SmoothStepToF(&this->dyna.actor.speedXZ, 0.0f, 1.0f, 1.0f, 0.0f); + Math_SmoothStepToF(&this->dyna.actor.speed, 0.0f, 1.0f, 1.0f, 0.0f); - if (this->dyna.actor.speedXZ != 0.0f) { + if (this->dyna.actor.speed != 0.0f) { Actor_PlaySfx(&this->dyna.actor, NA_SE_EV_ROCK_SLIDE - SFX_FLAG); } diff --git a/src/code/z_en_item00.c b/src/code/z_en_item00.c index f1ad80087..18e8ef111 100644 --- a/src/code/z_en_item00.c +++ b/src/code/z_en_item00.c @@ -280,7 +280,7 @@ void EnItem00_Init(Actor* thisx, PlayState* play) { this->despawnTimer = 15; this->unk_154 = 35; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.velocity.y = 0.0f; this->actor.gravity = 0.0f; @@ -390,7 +390,7 @@ void func_8001DFC8(EnItem00* this, PlayState* play) { this->actor.shape.yOffset = Math_SinS(this->actor.shape.rot.y) * 150.0f + 850.0f; } - Math_SmoothStepToF(&this->actor.speedXZ, 0.0f, 1.0f, 0.5f, 0.0f); + Math_SmoothStepToF(&this->actor.speed, 0.0f, 1.0f, 0.5f, 0.0f); if (this->unk_154 == 0) { if ((this->actor.params != ITEM00_SMALL_KEY) && (this->actor.params != ITEM00_HEART_PIECE) && @@ -448,7 +448,7 @@ void func_8001E304(EnItem00* this, PlayState* play) { if (this->actor.params == ITEM00_RECOVERY_HEART) { if (this->actor.velocity.y < 0.0f) { - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; this->actor.gravity = -0.4f; if (this->actor.velocity.y < -1.5f) { this->actor.velocity.y = -1.5f; @@ -489,7 +489,7 @@ void func_8001E304(EnItem00* this, PlayState* play) { EnItem00_SetupAction(this, func_8001DFC8); this->actor.shape.rot.z = 0; this->actor.velocity.y = 0.0f; - this->actor.speedXZ = 0.0f; + this->actor.speed = 0.0f; } } @@ -733,7 +733,7 @@ void EnItem00_Update(Actor* thisx, PlayState* play) { this->despawnTimer = 15; this->unk_154 = 35; this->actor.shape.rot.z = 0; - this->actor.speedXZ = 0; + this->actor.speed = 0; this->actor.velocity.y = 0; this->actor.gravity = 0; @@ -969,7 +969,7 @@ EnItem00* Item_DropCollectible(PlayState* play, Vec3f* spawnPos, s16 params) { spawnPos->z, 0, 0, 0, params | param8000 | param3F00); if ((spawnedActor != NULL) && !param8000) { spawnedActor->actor.velocity.y = !param4000 ? 8.0f : -2.0f; - spawnedActor->actor.speedXZ = 2.0f; + spawnedActor->actor.speed = 2.0f; spawnedActor->actor.gravity = -0.9f; spawnedActor->actor.world.rot.y = Rand_CenteredFloat(65536.0f); Actor_SetScale(&spawnedActor->actor, 0.0f); @@ -1009,7 +1009,7 @@ EnItem00* Item_DropCollectible2(PlayState* play, Vec3f* spawnPos, s16 params) { spawnPos->z, 0, 0, 0, params | param8000 | param3F00); if ((spawnedActor != NULL) && !param8000) { spawnedActor->actor.velocity.y = 0.0f; - spawnedActor->actor.speedXZ = 0.0f; + spawnedActor->actor.speed = 0.0f; spawnedActor->actor.gravity = param4000 ? 0.0f : -0.9f; spawnedActor->actor.world.rot.y = Rand_CenteredFloat(65536.0f); spawnedActor->actor.flags |= ACTOR_FLAG_4; @@ -1119,7 +1119,7 @@ void Item_DropCollectibleRandom(PlayState* play, Actor* fromActor, Vec3f* spawnP spawnPos->y, spawnPos->z, 0, 0, 0, dropId); if ((spawnedActor != NULL) && (dropId != ITEM00_NONE)) { spawnedActor->actor.velocity.y = 8.0f; - spawnedActor->actor.speedXZ = 2.0f; + spawnedActor->actor.speed = 2.0f; spawnedActor->actor.gravity = -0.9f; spawnedActor->actor.world.rot.y = Rand_ZeroOne() * 40000.0f; Actor_SetScale(&spawnedActor->actor, 0.0f); diff --git a/src/code/z_player_lib.c b/src/code/z_player_lib.c index b7fac803d..83ed0dc15 100644 --- a/src/code/z_player_lib.c +++ b/src/code/z_player_lib.c @@ -1130,7 +1130,7 @@ s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx** } else if ((sLeftHandType == PLAYER_MODELTYPE_LH_BOOMERANG) && (this->stateFlags1 & PLAYER_STATE1_25)) { dLists = gPlayerLeftHandOpenDLs + gSaveContext.linkAge; sLeftHandType = PLAYER_MODELTYPE_LH_OPEN; - } else if ((this->leftHandType == PLAYER_MODELTYPE_LH_OPEN) && (this->actor.speedXZ > 2.0f) && + } else if ((this->leftHandType == PLAYER_MODELTYPE_LH_OPEN) && (this->actor.speed > 2.0f) && !(this->stateFlags1 & PLAYER_STATE1_27)) { dLists = gPlayerLeftHandClosedDLs + gSaveContext.linkAge; sLeftHandType = PLAYER_MODELTYPE_LH_CLOSED; @@ -1142,7 +1142,7 @@ s32 Player_OverrideLimbDrawGameplayDefault(PlayState* play, s32 limbIndex, Gfx** if (sRightHandType == PLAYER_MODELTYPE_RH_SHIELD) { dLists += this->currentShield * 4; - } else if ((this->rightHandType == PLAYER_MODELTYPE_RH_OPEN) && (this->actor.speedXZ > 2.0f) && + } else if ((this->rightHandType == PLAYER_MODELTYPE_RH_OPEN) && (this->actor.speed > 2.0f) && !(this->stateFlags1 & PLAYER_STATE1_27)) { dLists = sPlayerRightHandClosedDLs + gSaveContext.linkAge; sRightHandType = PLAYER_MODELTYPE_RH_CLOSED; |
