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

@ -25,7 +25,7 @@ void EnKz_StartTimer(EnKz* this, GlobalContext* globalCtx);
const ActorInit En_Kz_InitVars = {
ACTOR_EN_KZ,
ACTORTYPE_NPC,
ACTORCAT_NPC,
FLAGS,
OBJECT_KZ,
sizeof(EnKz),
@ -188,7 +188,7 @@ s32 func_80A9C95C(GlobalContext* globalCtx, EnKz* this, s16* arg2, f32 unkf, cal
Player* player = PLAYER;
s16 sp32;
s16 sp30;
f32 xzDistToLink;
f32 xzDistToPlayer;
f32 yaw;
if (func_8002F194(&this->actor, globalCtx) != 0) {
@ -201,9 +201,9 @@ s32 func_80A9C95C(GlobalContext* globalCtx, EnKz* this, s16* arg2, f32 unkf, cal
return 0;
}
yaw = Math_Vec3f_Yaw(&this->actor.initPosRot.pos, &player->actor.posRot.pos);
yaw = Math_Vec3f_Yaw(&this->actor.home.pos, &player->actor.world.pos);
yaw -= this->actor.shape.rot.y;
if ((fabsf(yaw) > 1638.0f) || (this->actor.xzDistToLink < 265.0f)) {
if ((fabsf(yaw) > 1638.0f) || (this->actor.xzDistToPlayer < 265.0f)) {
this->actor.flags &= ~1;
return 0;
}
@ -215,13 +215,13 @@ s32 func_80A9C95C(GlobalContext* globalCtx, EnKz* this, s16* arg2, f32 unkf, cal
return 0;
}
xzDistToLink = this->actor.xzDistToLink;
this->actor.xzDistToLink = Math_Vec3f_DistXZ(&this->actor.initPosRot.pos, &player->actor.posRot.pos);
xzDistToPlayer = this->actor.xzDistToPlayer;
this->actor.xzDistToPlayer = Math_Vec3f_DistXZ(&this->actor.home.pos, &player->actor.world.pos);
if (func_8002F2CC(&this->actor, globalCtx, unkf) == 0) {
this->actor.xzDistToLink = xzDistToLink;
this->actor.xzDistToPlayer = xzDistToPlayer;
return 0;
}
this->actor.xzDistToLink = xzDistToLink;
this->actor.xzDistToPlayer = xzDistToPlayer;
this->actor.textId = callback1(globalCtx, this);
return 0;
@ -278,9 +278,9 @@ s32 EnKz_FollowPath(EnKz* 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) * 10430.3779296875f), 0xA, 0x3E8,
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) * 10430.3779296875f), 0xA, 0x3E8,
1);
if ((SQ(pathDiffX) + SQ(pathDiffZ)) < 10.0f) {
@ -305,9 +305,9 @@ s32 EnKz_SetMovedPos(EnKz* 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;
}
@ -322,7 +322,7 @@ void EnKz_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
Actor_SetScale(&this->actor, 0.01);
this->actor.unk_1F = 3;
this->actor.targetMode = 3;
this->unk_1E0.unk_00 = 0;
func_80034EC0(&this->skelanime, sAnimations, 0);
@ -333,7 +333,7 @@ void EnKz_Init(Actor* thisx, GlobalContext* globalCtx) {
if (LINK_IS_ADULT) {
if (!(gSaveContext.infTable[19] & 0x100)) {
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_BG_ICE_SHELTER,
this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0,
this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0,
0x04FF);
}
this->actionFunc = EnKz_Wait;
@ -367,8 +367,8 @@ void EnKz_SetupMweep(EnKz* this, GlobalContext* globalCtx) {
this->gameplayCamera = globalCtx->activeCamera;
Gameplay_ChangeCameraStatus(globalCtx, this->gameplayCamera, 1);
Gameplay_ChangeCameraStatus(globalCtx, this->cutsceneCamera, 7);
pos = this->actor.posRot.pos;
initPos = this->actor.initPosRot.pos;
pos = this->actor.world.pos;
initPos = this->actor.home.pos;
pos.y += 60.0f;
initPos.y += -100.0f;
initPos.z += 260.0f;
@ -383,8 +383,8 @@ void EnKz_Mweep(EnKz* this, GlobalContext* globalCtx) {
Vec3f pos;
Vec3f initPos;
pos = this->actor.posRot.pos;
initPos = this->actor.initPosRot.pos;
pos = this->actor.world.pos;
initPos = this->actor.home.pos;
pos.y += 60.0f;
initPos.y += -100.0f;
initPos.z += 260.0f;
@ -429,8 +429,8 @@ void EnKz_SetupGetItem(EnKz* this, GlobalContext* globalCtx) {
this->actionFunc = EnKz_StartTimer;
} else {
getItemID = this->isTrading == true ? GI_FROG : GI_TUNIC_ZORA;
yRange = fabsf(this->actor.yDistToLink) + 1.0f;
xzRange = this->actor.xzDistToLink + 1.0f;
yRange = fabsf(this->actor.yDistToPlayer) + 1.0f;
xzRange = this->actor.xzDistToPlayer + 1.0f;
func_8002F434(&this->actor, globalCtx, getItemID, xzRange, yRange);
}
}
@ -480,7 +480,7 @@ void EnKz_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
Vec3f mult = { 2600.0f, 0.0f, 0.0f };
if (limbIndex == 11) {
Matrix_MultVec3f(&mult, &this->actor.posRot2.pos);
Matrix_MultVec3f(&mult, &this->actor.focus.pos);
}
}