1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-07 14:50: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

@ -41,7 +41,7 @@ extern FlexSkeletonHeader D_0600BE40;
const ActorInit En_Tk_InitVars = {
ACTOR_EN_TK,
ACTORTYPE_NPC,
ACTORCAT_NPC,
FLAGS,
OBJECT_TK,
sizeof(EnTk),
@ -227,7 +227,7 @@ s32 EnTk_CheckFacingPlayer(EnTk* this) {
s16 v0;
s16 v1;
if (this->actor.xyzDistToLinkSq > 10000.0f) {
if (this->actor.xyzDistToPlayerSq > 10000.0f) {
return 0;
}
@ -235,7 +235,7 @@ s32 EnTk_CheckFacingPlayer(EnTk* this) {
v0 -= this->h_21E;
v0 -= this->headRot;
v1 = this->actor.yawTowardsLink - v0;
v1 = this->actor.yawTowardsPlayer - v0;
if (ABS(v1) < 0x1554) {
return 1;
} else {
@ -248,7 +248,7 @@ s32 EnTk_CheckNextSpot(EnTk* this, GlobalContext* globalCtx) {
f32 dxz;
f32 dy;
prop = globalCtx->actorCtx.actorList[ACTORTYPE_PROP].first;
prop = globalCtx->actorCtx.actorLists[ACTORCAT_PROP].head;
while (prop != NULL) {
if (prop->id != ACTOR_EN_IT) {
@ -261,8 +261,8 @@ s32 EnTk_CheckNextSpot(EnTk* this, GlobalContext* globalCtx) {
continue;
}
dy = prop->posRot.pos.y - this->actor.groundY;
dxz = func_8002DB8C(&this->actor, prop);
dy = prop->world.pos.y - this->actor.floorHeight;
dxz = Actor_WorldDistXZToActor(&this->actor, prop);
if (dxz > 40.0f || dy > 10.0f) {
prop = prop->next;
continue;
@ -280,8 +280,8 @@ void EnTk_CheckCurrentSpot(EnTk* this) {
f32 dy;
if (this->currentSpot != NULL) {
dy = this->currentSpot->posRot.pos.y - this->actor.groundY;
dxz = func_8002DB8C(&this->actor, this->currentSpot);
dy = this->currentSpot->world.pos.y - this->actor.floorHeight;
dxz = Actor_WorldDistXZToActor(&this->actor, this->currentSpot);
if (dxz > 40.0f || dy > 10.0f) {
this->currentSpot = NULL;
}
@ -329,11 +329,11 @@ s32 EnTk_Orient(EnTk* this, GlobalContext* globalCtx) {
point = SEGMENTED_TO_VIRTUAL(path->points);
point += this->currentWaypoint;
dx = point->x - this->actor.posRot.pos.x;
dz = point->z - this->actor.posRot.pos.z;
dx = point->x - this->actor.world.pos.x;
dz = point->z - this->actor.world.pos.z;
Math_SmoothStepToS(&this->actor.shape.rot.y, Math_FAtan2F(dx, dz) * (0x8000 / M_PI), 10, 1000, 1);
this->actor.posRot.rot = this->actor.shape.rot;
this->actor.world.rot = this->actor.shape.rot;
if (SQ(dx) + SQ(dz) < 10.0f) {
this->currentWaypoint++;
@ -497,7 +497,7 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) {
EnTk* this = THIS;
s32 pad;
ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawFunc_Circle, 24.0f);
ActorShape_Init(&this->actor.shape, 0, ActorShadow_DrawCircle, 24.0f);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600BE40, NULL, this->jointTable, this->morphTable, 18);
Animation_Change(&this->skelAnime, &D_06002F84, 1.0f, 0.0f, Animation_GetLastFrame(&D_06002F84), ANIMMODE_LOOP,
@ -516,7 +516,7 @@ void EnTk_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_SetScale(&this->actor, 0.01f);
this->actor.unk_1F = 6;
this->actor.targetMode = 6;
this->actor.gravity = -0.1f;
this->currentReward = -1;
this->currentSpot = NULL;
@ -536,7 +536,7 @@ void EnTk_Rest(EnTk* this, GlobalContext* globalCtx) {
if (this->h_1E0 != 0) {
v1 = this->actor.shape.rot.y;
v1 -= this->h_21E;
v1 = this->actor.yawTowardsLink - v1;
v1 = this->actor.yawTowardsPlayer - v1;
if (this->h_1E0 == 2) {
EnTk_DigAnim(this, globalCtx);
@ -550,7 +550,7 @@ void EnTk_Rest(EnTk* this, GlobalContext* globalCtx) {
} else if (EnTk_CheckFacingPlayer(this)) {
v1 = this->actor.shape.rot.y;
v1 -= this->h_21E;
v1 = this->actor.yawTowardsLink - v1;
v1 = this->actor.yawTowardsPlayer - v1;
this->actionCountdown = 0;
func_800343CC(globalCtx, &this->actor, &this->h_1E0, this->collider.dim.radius + 30.0f, func_80B1C54C,
@ -558,7 +558,7 @@ void EnTk_Rest(EnTk* this, GlobalContext* globalCtx) {
} else if (func_8002F194(&this->actor, globalCtx)) {
v1 = this->actor.shape.rot.y;
v1 -= this->h_21E;
v1 = this->actor.yawTowardsLink - v1;
v1 = this->actor.yawTowardsPlayer - v1;
this->actionCountdown = 0;
this->h_1E0 = 1;
@ -617,9 +617,9 @@ void EnTk_Dig(EnTk* this, GlobalContext* globalCtx) {
Matrix_RotateY(this->actor.shape.rot.y, MTXMODE_NEW);
Matrix_MultVec3f(&rewardOrigin, &rewardPos);
rewardPos.x += this->actor.posRot.pos.x;
rewardPos.y += this->actor.posRot.pos.y;
rewardPos.z += this->actor.posRot.pos.z;
rewardPos.x += this->actor.world.pos.x;
rewardPos.y += this->actor.world.pos.y;
rewardPos.z += this->actor.world.pos.z;
this->currentReward = EnTk_ChooseReward(this);
if (this->currentReward == 3) {
@ -679,7 +679,7 @@ void EnTk_Update(Actor* thisx, GlobalContext* globalCtx) {
Actor_MoveForward(&this->actor);
func_8002E4B4(globalCtx, &this->actor, 40.0f, 10.0f, 0.0f, 5);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 40.0f, 10.0f, 0.0f, 5);
this->actionFunc(this, globalCtx);
@ -721,7 +721,7 @@ void EnTk_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
/* Limb 16 - Jaw */
if (limbIndex == 16) {
Matrix_MultVec3f(&sp1C, &this->actor.posRot2.pos);
Matrix_MultVec3f(&sp1C, &this->actor.focus.pos);
}
/* Limb 14 - Neck */