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

@ -24,7 +24,7 @@ void func_80AABD0C(EnMd* this, GlobalContext* globalCtx);
const ActorInit En_Md_InitVars = {
ACTOR_EN_MD,
ACTORTYPE_NPC,
ACTORCAT_NPC,
FLAGS,
OBJECT_MD,
sizeof(EnMd),
@ -494,8 +494,8 @@ void func_80AAB158(EnMd* this, GlobalContext* globalCtx) {
s16 temp2;
s16 yawDiff;
if (this->actor.xzDistToLink < 170.0f) {
yawDiff = (f32)this->actor.yawTowardsLink - this->actor.shape.rot.y;
if (this->actor.xzDistToPlayer < 170.0f) {
yawDiff = (f32)this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
absYawDiff = ABS(yawDiff);
temp = (absYawDiff <= func_800347E8(2)) ? 2 : 1;
@ -523,7 +523,7 @@ void func_80AAB158(EnMd* this, GlobalContext* globalCtx) {
this->unk_1E0.unk_14 = 40.0f;
temp = 2;
} else {
this->unk_1E0.unk_18 = player->actor.posRot.pos;
this->unk_1E0.unk_18 = player->actor.world.pos;
this->unk_1E0.unk_14 = (gSaveContext.linkAge > 0) ? 0.0f : -18.0f;
}
@ -550,9 +550,9 @@ u8 EnMd_FollowPath(EnMd* this, GlobalContext* globalCtx) {
pointPos = SEGMENTED_TO_VIRTUAL(path->points);
pointPos += this->waypoint;
pathDiffX = pointPos->x - this->actor.posRot.pos.x;
pathDiffZ = pointPos->z - this->actor.posRot.pos.z;
Math_SmoothStepToS(&this->actor.posRot.rot.y, Math_FAtan2F(pathDiffX, pathDiffZ) * (65536.0f / (2 * M_PI)), 4, 4000,
pathDiffX = pointPos->x - this->actor.world.pos.x;
pathDiffZ = pointPos->z - this->actor.world.pos.z;
Math_SmoothStepToS(&this->actor.world.rot.y, Math_FAtan2F(pathDiffX, pathDiffZ) * (65536.0f / (2 * M_PI)), 4, 4000,
1);
if ((SQ(pathDiffX) + SQ(pathDiffZ)) < 100.0f) {
@ -577,9 +577,9 @@ u8 EnMd_SetMovedPos(EnMd* this, GlobalContext* globalCtx) {
lastPointPos = SEGMENTED_TO_VIRTUAL(path->points);
lastPointPos += path->count - 1;
this->actor.posRot.pos.x = lastPointPos->x;
this->actor.posRot.pos.y = lastPointPos->y;
this->actor.posRot.pos.z = lastPointPos->z;
this->actor.world.pos.x = lastPointPos->x;
this->actor.world.pos.y = lastPointPos->y;
this->actor.world.pos.z = lastPointPos->z;
return 1;
}
@ -593,10 +593,10 @@ void func_80AAB5A4(EnMd* this, GlobalContext* globalCtx) {
? 100.0f
: 400.0f;
this->alpha = func_80034DD4(this, globalCtx, this->alpha, temp);
this->actor.shape.unk_14 = this->alpha;
this->actor.shape.shadowAlpha = this->alpha;
} else {
this->alpha = 255;
this->actor.shape.unk_14 = this->alpha;
this->actor.shape.shadowAlpha = this->alpha;
}
}
@ -604,7 +604,7 @@ void EnMd_Init(Actor* thisx, GlobalContext* globalCtx) {
EnMd* this = THIS;
s32 pad;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 24.0f);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 24.0f);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007FB8, NULL, this->jointTable, this->morphTable, 17);
Collider_InitCylinder(globalCtx, &this->collider);
@ -617,16 +617,16 @@ void EnMd_Init(Actor* thisx, GlobalContext* globalCtx) {
func_80034EC0(&this->skelAnime, sAnimations, 0);
Actor_SetScale(&this->actor, 0.01f);
this->actor.unk_1F = 6;
this->actor.targetMode = 6;
this->alpha = 255;
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ELF, this->actor.posRot.pos.x,
this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, FAIRY_KOKIRI);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_EN_ELF, this->actor.world.pos.x,
this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, FAIRY_KOKIRI);
if (((globalCtx->sceneNum == SCENE_SPOT04) && !(gSaveContext.eventChkInf[0] & 0x10)) ||
((globalCtx->sceneNum == SCENE_SPOT04) && (gSaveContext.eventChkInf[0] & 0x10) &&
CHECK_QUEST_ITEM(QUEST_KOKIRI_EMERALD)) ||
((globalCtx->sceneNum == SCENE_SPOT10) && !(gSaveContext.eventChkInf[0] & 0x400))) {
this->actor.initPosRot.pos = this->actor.posRot.pos;
this->actor.home.pos = this->actor.world.pos;
this->actionFunc = func_80AAB948;
return;
}
@ -669,18 +669,18 @@ void func_80AAB948(EnMd* this, GlobalContext* globalCtx) {
func_80AAAA24(this);
if (this->unk_1E0.unk_00 == 0) {
this->actor.posRot.rot.y = this->actor.yawTowardsLink;
this->actor.shape.rot.y = this->actor.yawTowardsLink;
this->actor.world.rot.y = this->actor.yawTowardsPlayer;
this->actor.shape.rot.y = this->actor.yawTowardsPlayer;
yaw = Math_Vec3f_Yaw(&this->actor.initPosRot.pos, &actorToBlock->posRot.pos);
yaw = Math_Vec3f_Yaw(&this->actor.home.pos, &actorToBlock->world.pos);
this->actor.posRot.pos.x = this->actor.initPosRot.pos.x;
this->actor.posRot.pos.x += 60.0f * Math_SinS(yaw);
this->actor.world.pos.x = this->actor.home.pos.x;
this->actor.world.pos.x += 60.0f * Math_SinS(yaw);
this->actor.posRot.pos.z = this->actor.initPosRot.pos.z;
this->actor.posRot.pos.z += 60.0f * Math_CosS(yaw);
this->actor.world.pos.z = this->actor.home.pos.z;
this->actor.world.pos.z += 60.0f * Math_CosS(yaw);
temp = fabsf((f32)this->actor.yawTowardsLink - yaw) * 0.001f * 3.0f;
temp = fabsf((f32)this->actor.yawTowardsPlayer - yaw) * 0.001f * 3.0f;
this->skelAnime.playSpeed = CLAMP(temp, 1.0f, 3.0f);
}
@ -719,7 +719,7 @@ void func_80AAB948(EnMd* this, GlobalContext* globalCtx) {
return;
}
if (this->actor.xzDistToLink < (30.0f + this->collider.dim.radius)) {
if (this->actor.xzDistToPlayer < (30.0f + this->collider.dim.radius)) {
player->stateFlags2 |= 0x800000;
}
}
@ -748,7 +748,7 @@ void func_80AABD0C(EnMd* this, GlobalContext* globalCtx) {
func_80AAA93C(this);
if (!(EnMd_FollowPath(this, globalCtx)) || (this->waypoint != 0)) {
this->actor.shape.rot = this->actor.posRot.rot;
this->actor.shape.rot = this->actor.world.rot;
return;
}
@ -764,7 +764,7 @@ void func_80AABD0C(EnMd* this, GlobalContext* globalCtx) {
this->skelAnime.playSpeed = 0.0f;
this->actor.speedXZ = 0.0f;
this->actor.initPosRot.pos = this->actor.posRot.pos;
this->actor.home.pos = this->actor.world.pos;
this->actionFunc = func_80AAB8F8;
}
@ -779,7 +779,7 @@ void EnMd_Update(Actor* thisx, GlobalContext* globalCtx) {
func_80AAB5A4(this, globalCtx);
Actor_MoveForward(&this->actor);
func_80AAB158(this, globalCtx);
func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
this->actionFunc(this, globalCtx);
}
@ -814,7 +814,7 @@ void EnMd_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
Vec3f vec = { 400.0f, 0.0f, 0.0f };
if (limbIndex == 16) {
Matrix_MultVec3f(&vec, &this->actor.posRot2.pos);
Matrix_MultVec3f(&vec, &this->actor.focus.pos);
}
}