1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-21 06:21:16 +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

@ -14,7 +14,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx);
const ActorInit Arms_Hook_InitVars = {
ACTOR_ARMS_HOOK,
ACTORTYPE_ITEMACTION,
ACTORCAT_ITEMACTION,
FLAGS,
OBJECT_LINK_BOY,
sizeof(ArmsHook),
@ -72,7 +72,7 @@ void ArmsHook_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitQuad(globalCtx, &this->collider);
Collider_SetQuad(globalCtx, &this->collider, &this->actor, &sQuadInit);
ArmsHook_SetupAction(this, ArmsHook_Wait);
this->unk_1E8 = this->actor.posRot.pos;
this->unk_1E8 = this->actor.world.pos;
}
void ArmsHook_Destroy(Actor* thisx, GlobalContext* globalCtx) {
@ -130,7 +130,7 @@ s32 ArmsHook_CheckForCancel(ArmsHook* this) {
((player->stateFlags1 & 0x4000080))) {
this->timer = 0;
ArmsHook_DetachHookFromActor(this);
Math_Vec3f_Copy(&this->actor.posRot.pos, &player->unk_3C8);
Math_Vec3f_Copy(&this->actor.world.pos, &player->unk_3C8);
return 1;
}
}
@ -140,7 +140,7 @@ s32 ArmsHook_CheckForCancel(ArmsHook* this) {
void ArmsHook_AttachHookToActor(ArmsHook* this, Actor* actor) {
actor->flags |= 0x2000;
this->grabbed = actor;
Math_Vec3f_Diff(&actor->posRot.pos, &this->actor.posRot.pos, &this->grabbedDistDiff);
Math_Vec3f_Diff(&actor->world.pos, &this->actor.world.pos, &this->grabbedDistDiff);
}
void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
@ -200,10 +200,10 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
this->grabbed = NULL;
} else {
if (this->actor.child != NULL) {
sp94 = func_8002DB48(this, grabbed);
sp94 = Actor_WorldDistXYZToActor(this, grabbed);
sp90 =
sqrtf(SQ(this->grabbedDistDiff.x) + SQ(this->grabbedDistDiff.y) + SQ(this->grabbedDistDiff.z));
Math_Vec3f_Diff(&grabbed->posRot.pos, &this->grabbedDistDiff, &this->actor.posRot.pos);
Math_Vec3f_Diff(&grabbed->world.pos, &this->grabbedDistDiff, &this->actor.world.pos);
if (50.0f < (sp94 - sp90)) {
ArmsHook_DetachHookFromActor(this);
grabbed = NULL;
@ -212,7 +212,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
}
}
bodyDistDiff = Math_Vec3f_DistXYZAndStoreDiff(&player->unk_3C8, &this->actor.posRot.pos, &bodyDistDiffVec);
bodyDistDiff = Math_Vec3f_DistXYZAndStoreDiff(&player->unk_3C8, &this->actor.world.pos, &bodyDistDiffVec);
if (bodyDistDiff < 30.0f) {
velocity = 0.0f;
phi_f16 = 0.0f;
@ -239,17 +239,17 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
if (this->actor.child == NULL) {
if ((grabbed != NULL) && (grabbed->id == ACTOR_BG_SPOT06_OBJECTS)) {
Math_Vec3f_Diff(&grabbed->posRot.pos, &this->grabbedDistDiff, &this->actor.posRot.pos);
Math_Vec3f_Diff(&grabbed->world.pos, &this->grabbedDistDiff, &this->actor.world.pos);
phi_f16 = 1.0f;
} else {
Math_Vec3f_Sum(&player->unk_3C8, &newPos, &this->actor.posRot.pos);
Math_Vec3f_Sum(&player->unk_3C8, &newPos, &this->actor.world.pos);
if (grabbed != NULL) {
Math_Vec3f_Sum(&this->actor.posRot.pos, &this->grabbedDistDiff, &grabbed->posRot.pos);
Math_Vec3f_Sum(&this->actor.world.pos, &this->grabbedDistDiff, &grabbed->world.pos);
}
}
} else {
Math_Vec3f_Diff(&bodyDistDiffVec, &newPos, &player->actor.velocity);
player->actor.posRot.rot.x =
player->actor.world.rot.x =
Math_Atan2S(sqrtf(SQ(bodyDistDiffVec.x) + SQ(bodyDistDiffVec.z)), -bodyDistDiffVec.y);
}
@ -258,7 +258,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
if (phi_f16 == 0.0f) {
ArmsHook_SetupAction(this, ArmsHook_Wait);
if (ArmsHook_AttachToPlayer(this, player)) {
Math_Vec3f_Diff(&this->actor.posRot.pos, &player->actor.posRot.pos, &player->actor.velocity);
Math_Vec3f_Diff(&this->actor.world.pos, &player->actor.world.pos, &player->actor.velocity);
player->actor.velocity.y -= 20.0f;
return;
}
@ -266,7 +266,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
}
} else {
Actor_MoveForward(&this->actor);
Math_Vec3f_Diff(&this->actor.posRot.pos, &this->actor.pos4, &prevFrameDiff);
Math_Vec3f_Diff(&this->actor.world.pos, &this->actor.prevPos, &prevFrameDiff);
Math_Vec3f_Sum(&this->unk_1E8, &prevFrameDiff, &this->unk_1E8);
this->actor.shape.rot.x = Math_Atan2S(this->actor.speedXZ, -this->actor.velocity.y);
sp60.x = this->unk_1F4.x - (this->unk_1E8.x - this->unk_1F4.x);
@ -276,9 +276,9 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
if (func_8002F9EC(globalCtx, &this->actor, poly, bgId, &sp78) == false) {
sp5C = COLPOLY_GET_NORMAL(poly->normal.x);
sp58 = COLPOLY_GET_NORMAL(poly->normal.z);
Math_Vec3f_Copy(&this->actor.posRot.pos, &sp78);
this->actor.posRot.pos.x += 10.0f * sp5C;
this->actor.posRot.pos.z += 10.0f * sp58;
Math_Vec3f_Copy(&this->actor.world.pos, &sp78);
this->actor.world.pos.x += 10.0f * sp5C;
this->actor.world.pos.z += 10.0f * sp58;
this->timer = 0;
if (SurfaceType_IsHookshotSurface(&globalCtx->colCtx, poly, bgId) != 0) {
if (bgId != BGCHECK_SCENE) {
@ -292,7 +292,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
&D_801333E0, &D_801333E8);
return;
}
CollisionCheck_SpawnShieldParticlesMetal(globalCtx, &this->actor.posRot.pos);
CollisionCheck_SpawnShieldParticlesMetal(globalCtx, &this->actor.world.pos);
Audio_PlaySoundGeneral(NA_SE_IT_HOOKSHOT_REFLECT, &this->actor.projectedPos, 4, &D_801333E0,
&D_801333E0, &D_801333E8);
return;
@ -342,8 +342,8 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPMatrix(POLY_OPA_DISP++, Matrix_NewMtx(globalCtx->state.gfxCtx, "../z_arms_hook.c", 895),
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
gSPDisplayList(POLY_OPA_DISP++, D_0602B288);
Matrix_Translate(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, MTXMODE_NEW);
Math_Vec3f_Diff(&player->unk_3C8, &this->actor.posRot.pos, &sp78);
Matrix_Translate(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, MTXMODE_NEW);
Math_Vec3f_Diff(&player->unk_3C8, &this->actor.world.pos, &sp78);
sp58 = SQ(sp78.x) + SQ(sp78.z);
sp5C = sqrtf(sp58);
Matrix_RotateY(Math_FAtan2F(sp78.x, sp78.z), MTXMODE_APPLY);