1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-23 07:21:19 +00:00

Actor Struct Changes (and a few related things) (#617)

* reformat header

* type -> category

* done for now i think

* some more stuff

* first -> head

* focus

* flag comment

* ground -> floor

* remove asm, name wrapper funcs

* name func, format

* review

* targetPriority, format

* git subrepo pull --force tools/ZAPD

subrepo:
  subdir:   "tools/ZAPD"
  merged:   "0305ec2c2"
upstream:
  origin:   "https://github.com/zeldaret/ZAPD.git"
  branch:   "master"
  commit:   "0305ec2c2"
git-subrepo:
  version:  "0.4.3"
  origin:   "https://github.com/ingydotnet/git-subrepo.git"
  commit:   "2f68596"

* comment

* review

* feet flags

* horse shadow
This commit is contained in:
fig02 2021-01-18 16:04:04 -05:00 committed by GitHub
parent 20206fba0d
commit 00a5edea71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
697 changed files with 8157 additions and 7942 deletions

View file

@ -21,7 +21,7 @@ void func_80AFC478(EnSiofuki* this, GlobalContext* globalCtx);
const ActorInit En_Siofuki_InitVars = {
ACTOR_EN_SIOFUKI,
ACTORTYPE_BG,
ACTORCAT_BG,
FLAGS,
OBJECT_SIOFUKI,
sizeof(EnSiofuki),
@ -61,7 +61,7 @@ void EnSiofuki_Init(Actor* thisx, GlobalContext* globalCtx) {
return;
}
this->initPosY = thisx->posRot.pos.y;
this->initPosY = thisx->world.pos.y;
this->unk_174 = 35.0f;
this->unk_170 = -6058.0f + this->unk_174;
@ -78,9 +78,9 @@ void EnSiofuki_Init(Actor* thisx, GlobalContext* globalCtx) {
thisx->scale.z = thisx->shape.rot.z * 0.5f * 0.1f;
}
thisx->posRot.rot.x = 0;
thisx->posRot.rot.y = 0;
thisx->posRot.rot.z = 0;
thisx->world.rot.x = 0;
thisx->world.rot.y = 0;
thisx->world.rot.z = 0;
thisx->shape.rot.x = 0;
thisx->shape.rot.y = 0;
thisx->shape.rot.z = 0;
@ -112,7 +112,7 @@ void func_80AFBDC8(EnSiofuki* this, GlobalContext* globalCtx) {
this->oscillation = sinf((globalCtx->gameplayFrames & 0x1F) / 32.0f * M_PI * 2.0f) * 4.0f;
this->unk_170 = this->unk_174 * 10.0f + -6058.0f - this->oscillation * 10.0f;
this->unk_174 = 35.0f;
this->dyna.actor.posRot.pos.y = this->initPosY + this->currentHeight + this->oscillation;
this->dyna.actor.world.pos.y = this->initPosY + this->currentHeight + this->oscillation;
}
void func_80AFBE8C(EnSiofuki* this, GlobalContext* globalCtx) {
@ -125,15 +125,15 @@ void func_80AFBE8C(EnSiofuki* this, GlobalContext* globalCtx) {
f32 dist2d;
f32 speedScale;
dX = player->actor.posRot.pos.x - this->dyna.actor.posRot.pos.x;
dY = player->actor.posRot.pos.y - this->dyna.actor.posRot.pos.y;
dZ = player->actor.posRot.pos.z - this->dyna.actor.posRot.pos.z;
dX = player->actor.world.pos.x - this->dyna.actor.world.pos.x;
dY = player->actor.world.pos.y - this->dyna.actor.world.pos.y;
dZ = player->actor.world.pos.z - this->dyna.actor.world.pos.z;
if ((dX > (this->dyna.actor.scale.x * -346.0f)) && (dX < (this->dyna.actor.scale.x * 346.0f)) &&
(dZ > (this->dyna.actor.scale.z * -400.0f)) && (dZ < (this->dyna.actor.scale.z * 400.0f)) && (dY < 0.0f)) {
if (func_8004356C(&this->dyna)) {
if (this->splashTimer <= 0) {
EffectSsGSplash_Spawn(globalCtx, &player->actor.posRot.pos, NULL, NULL, 1, 1);
EffectSsGSplash_Spawn(globalCtx, &player->actor.world.pos, NULL, NULL, 1, 1);
this->splashTimer = 10;
} else {
this->splashTimer--;
@ -147,13 +147,13 @@ void func_80AFBE8C(EnSiofuki* this, GlobalContext* globalCtx) {
this->applySpeed = true;
this->splashTimer = 0;
angle = Math_FAtan2F(dX, dZ) * (0x8000 / M_PI);
dAngle = (player->actor.posRot.rot.y ^ 0x8000) - angle;
dAngle = (player->actor.world.rot.y ^ 0x8000) - angle;
player->actor.gravity = 0.0f;
player->actor.velocity.y = 0.0f;
Math_SmoothStepToF(&player->actor.posRot.pos.y, this->dyna.actor.posRot.pos.y, 0.5f, 4.0f, 1.0f);
Math_SmoothStepToF(&player->actor.world.pos.y, this->dyna.actor.world.pos.y, 0.5f, 4.0f, 1.0f);
if ((dAngle < 0x4000) && (dAngle > -0x4000)) {
this->appliedYaw = player->actor.posRot.rot.y ^ 0x8000;
this->appliedYaw = player->actor.world.rot.y ^ 0x8000;
speedScale = dist2d / (this->dyna.actor.scale.x * 40.0f * 10.0f);
speedScale = CLAMP_MIN(speedScale, 0.0f);
speedScale = CLAMP_MAX(speedScale, 1.0f);
@ -161,7 +161,7 @@ void func_80AFBE8C(EnSiofuki* this, GlobalContext* globalCtx) {
Math_ApproachF(&this->targetAppliedSpeed, 3.0f, 1.0f, 1.0f);
Math_ApproachF(&this->appliedSpeed, this->targetAppliedSpeed, 1.0f, 0.3f * speedScale);
} else {
this->appliedYaw = player->actor.posRot.rot.y;
this->appliedYaw = player->actor.world.rot.y;
player->linearVelocity /= 2.0f;
Math_ApproachF(&this->targetAppliedSpeed, 3.0f, 1.0f, 1.0f);
Math_ApproachF(&this->appliedSpeed, this->targetAppliedSpeed, 1.0f, 0.1f);