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

@ -28,7 +28,7 @@ void func_80B4BF2C(EnZl1* this, GlobalContext* globalCtx);
const ActorInit En_Zl1_InitVars = {
ACTOR_EN_ZL1,
ACTORTYPE_NPC,
ACTORCAT_NPC,
FLAGS,
OBJECT_ZL1,
sizeof(EnZl1),
@ -92,8 +92,8 @@ void EnZl1_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_InitCylinder(globalCtx, &this->collider);
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
Actor_SetScale(&this->actor, 0.01f);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 24.0f);
this->actor.unk_1F = 0;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
this->actor.targetMode = 0;
if (gSaveContext.sceneSetupIndex >= 4) {
frameCount = Animation_GetLastFrame(&D_06000438);
@ -147,7 +147,7 @@ void func_80B4AF18(EnZl1* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
s32 pad;
func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.posRot2.pos);
func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.focus.pos);
if (this->unk_1E6 != 0) {
if (func_8002F334(&this->actor, globalCtx)) {
@ -155,7 +155,7 @@ void func_80B4AF18(EnZl1* this, GlobalContext* globalCtx) {
}
} else if (func_8002F194(&this->actor, globalCtx)) {
this->unk_1E6 = 1;
} else if (this->actor.posRot.pos.y <= player->actor.posRot.pos.y) {
} else if (this->actor.world.pos.y <= player->actor.world.pos.y) {
func_8002F2F4(&this->actor, globalCtx);
}
@ -189,15 +189,15 @@ void func_80B4B010(EnZl1* this, GlobalContext* globalCtx) {
Gameplay_CameraSetFov(globalCtx, this->unk_1E8, 30.0f);
ShrinkWindow_SetVal(0x20);
Interface_ChangeAlpha(2);
player->actor.posRot.pos = playerPos;
player->actor.world.pos = playerPos;
player->actor.speedXZ = 0.0f;
this->unk_1E2 = 0;
this->actionFunc = func_80B4B240;
func_800F5C64(0x51);
} else {
if (1) {} // necessary to match
rotDiff = ABS(this->actor.yawTowardsLink - this->actor.shape.rot.y);
if ((rotDiff < 0x238E) && !(player->actor.posRot.pos.y < this->actor.posRot.pos.y)) {
rotDiff = ABS(this->actor.yawTowardsPlayer - this->actor.shape.rot.y);
if ((rotDiff < 0x238E) && !(player->actor.world.pos.y < this->actor.world.pos.y)) {
func_8002F2F4(&this->actor, globalCtx);
}
}
@ -241,7 +241,7 @@ void func_80B4B240(EnZl1* this, GlobalContext* globalCtx) {
globalCtx->envCtx.unk_E1 = 0;
Gameplay_CameraSetAtEye(globalCtx, this->unk_1E8, &sp74, &sp68);
Gameplay_CameraSetFov(globalCtx, this->unk_1E8, 25.0f);
player->actor.posRot.pos = sp58;
player->actor.world.pos = sp58;
this->actor.textId = 0x702F;
func_8010B720(globalCtx, this->actor.textId);
this->unk_1E2++;
@ -336,7 +336,7 @@ void func_80B4B240(EnZl1* this, GlobalContext* globalCtx) {
frameCount = Animation_GetLastFrame(animHeaderSeg);
Animation_Change(&this->skelAnime, animHeaderSeg, 1.0f, 0.0f, frameCount, sp54[sp3C], -10.0f);
}
func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.posRot2.pos);
func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.focus.pos);
}
void func_80B4B7F4(CsCmdActorAction* npcAction, Vec3f* pos) {
@ -389,8 +389,8 @@ void func_80B4B8B4(EnZl1* this, GlobalContext* globalCtx) {
func_80B4B834(npcAction, &sp68);
if (this->unk_1E6 == 0) {
sp48 = sp74;
this->actor.initPosRot.pos = sp48;
this->actor.posRot.pos = sp48;
this->actor.home.pos = sp48;
this->actor.world.pos = sp48;
}
if (this->unk_1E6 != npcAction->action) {
frameCount = Animation_GetLastFrame(spB0[npcAction->action]);
@ -409,7 +409,7 @@ void func_80B4B8B4(EnZl1* this, GlobalContext* globalCtx) {
}
this->actor.velocity.z = (sp68.z - sp74.z) / actionLength;
}
func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.posRot2.pos);
func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.focus.pos);
Gameplay_CameraSetAtEye(globalCtx, this->unk_1E8, &sp98, &sp8C);
Gameplay_CameraSetFov(globalCtx, this->unk_1E8, 70.0f);
}
@ -456,7 +456,7 @@ void func_80B4BC78(EnZl1* this, GlobalContext* globalCtx) {
func_80B4B7F4(npcAction, &sp70);
func_80B4B834(npcAction, &sp64);
if (this->unk_1E6 == 0) {
this->actor.posRot.pos = this->actor.initPosRot.pos = sp70;
this->actor.world.pos = this->actor.home.pos = sp70;
}
if (this->unk_1E6 != npcAction->action) {
@ -529,7 +529,7 @@ void func_80B4BF2C(EnZl1* this, GlobalContext* globalCtx) {
}
break;
case 4:
if (player->actor.posRot.pos.y < this->actor.posRot.pos.y) {
if (player->actor.world.pos.y < this->actor.world.pos.y) {
break;
} else {
if (func_8002F194(&this->actor, globalCtx)) {
@ -553,7 +553,7 @@ void func_80B4BF2C(EnZl1* this, GlobalContext* globalCtx) {
}
break;
}
func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.posRot2.pos);
func_80038290(globalCtx, &this->actor, &this->unk_200, &this->unk_206, this->actor.focus.pos);
}
void EnZl1_Update(Actor* thisx, GlobalContext* globalCtx) {
@ -563,15 +563,15 @@ void EnZl1_Update(Actor* thisx, GlobalContext* globalCtx) {
if ((this->actionFunc != func_80B4B8B4) && (this->actionFunc != func_80B4BC78)) {
SkelAnime_Update(&this->skelAnime);
}
func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 5);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 5);
this->actionFunc(this, globalCtx);
if (this->actionFunc != func_80B4B8B4) {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.posRot.rot.x, 0xA, 0x3E8, 1);
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.posRot.rot.y, 0xA, 0x3E8, 1);
Math_SmoothStepToS(&this->actor.shape.rot.z, this->actor.posRot.rot.z, 0xA, 0x3E8, 1);
Math_SmoothStepToS(&this->actor.shape.rot.x, this->actor.world.rot.x, 0xA, 0x3E8, 1);
Math_SmoothStepToS(&this->actor.shape.rot.y, this->actor.world.rot.y, 0xA, 0x3E8, 1);
Math_SmoothStepToS(&this->actor.shape.rot.z, this->actor.world.rot.z, 0xA, 0x3E8, 1);
func_80B4AE18(this);
}
@ -601,7 +601,7 @@ void func_80B4C400(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
EnZl1* this = THIS;
if (limbIndex == 17) {
Matrix_MultVec3f(&vec, &this->actor.posRot2.pos);
Matrix_MultVec3f(&vec, &this->actor.focus.pos);
}
}