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:
parent
20206fba0d
commit
00a5edea71
697 changed files with 8157 additions and 7942 deletions
|
@ -61,7 +61,7 @@ extern FlexSkeletonHeader D_06007958;
|
|||
|
||||
const ActorInit En_Daiku_InitVars = {
|
||||
ACTOR_EN_DAIKU,
|
||||
ACTORTYPE_NPC,
|
||||
ACTORCAT_NPC,
|
||||
FLAGS,
|
||||
OBJECT_DAIKU,
|
||||
sizeof(EnDaiku),
|
||||
|
@ -180,7 +180,7 @@ void EnDaiku_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->startFightSwitchFlag = this->actor.shape.rot.z & 0x3F;
|
||||
this->actor.shape.rot.z = 0;
|
||||
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 40.0f);
|
||||
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 40.0f);
|
||||
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_06007958, NULL, this->jointTable, this->morphTable, 17);
|
||||
|
||||
if (!noKill) {
|
||||
|
@ -195,13 +195,13 @@ void EnDaiku_Init(Actor* thisx, GlobalContext* globalCtx) {
|
|||
Animation_Change(&this->skelAnime, sAnimations[0].anim, 1.0f, 0.0f, Animation_GetLastFrame(sAnimations[0].anim),
|
||||
sAnimations[0].mode, sAnimations[0].transitionRate);
|
||||
|
||||
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->actor.unk_1F = 6;
|
||||
this->actor.targetMode = 6;
|
||||
this->currentAnimIndex = -1;
|
||||
this->runSpeed = 5.0f;
|
||||
this->initRot = this->actor.posRot.rot;
|
||||
this->initPos = this->actor.posRot.pos;
|
||||
this->initRot = this->actor.world.rot;
|
||||
this->initPos = this->actor.world.pos;
|
||||
|
||||
if (globalCtx->sceneNum == SCENE_GERUDOWAY) {
|
||||
EnDaiku_Change(this, ENDAIKU_ANIM_STAND, &this->currentAnimIndex);
|
||||
|
@ -383,7 +383,7 @@ void EnDaiku_Jailed(EnDaiku* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
SkelAnime_Update(&this->skelAnime);
|
||||
|
||||
gerudo = (EnGeldB*)Actor_Find(&globalCtx->actorCtx, ACTOR_EN_GELDB, ACTORTYPE_ENEMY);
|
||||
gerudo = (EnGeldB*)Actor_Find(&globalCtx->actorCtx, ACTOR_EN_GELDB, ACTORCAT_ENEMY);
|
||||
if (gerudo == NULL) {
|
||||
this->stateFlags |= ENDAIKU_STATEFLAG_GERUDODEFEATED;
|
||||
this->stateFlags &= ~ENDAIKU_STATEFLAG_GERUDOFIGHTING;
|
||||
|
@ -433,8 +433,8 @@ void EnDaiku_InitEscape(EnDaiku* this, GlobalContext* globalCtx) {
|
|||
path = &globalCtx->setupPathList[this->actor.params >> 4 & 0xF];
|
||||
while (!exitLoop) {
|
||||
pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint;
|
||||
dx = pointPos->x - this->actor.posRot.pos.x;
|
||||
dz = pointPos->z - this->actor.posRot.pos.z;
|
||||
dx = pointPos->x - this->actor.world.pos.x;
|
||||
dz = pointPos->z - this->actor.world.pos.z;
|
||||
this->rotYtowardsPath = Math_FAtan2F(dx, dz) * (0x8000 / M_PI);
|
||||
dxz = sqrtf(SQ(dx) + SQ(dz));
|
||||
if (dxz > 10.0f) {
|
||||
|
@ -472,19 +472,19 @@ void EnDaiku_InitSubCamera(EnDaiku* this, GlobalContext* globalCtx) {
|
|||
eyePosDeltaLocal.x = sEscapeSubCamParams[this->actor.params & 3].eyePosDeltaLocal.x;
|
||||
eyePosDeltaLocal.y = sEscapeSubCamParams[this->actor.params & 3].eyePosDeltaLocal.y;
|
||||
eyePosDeltaLocal.z = sEscapeSubCamParams[this->actor.params & 3].eyePosDeltaLocal.z;
|
||||
Matrix_RotateY(this->actor.posRot.rot.y * (M_PI / 0x8000), MTXMODE_NEW);
|
||||
Matrix_RotateY(this->actor.world.rot.y * (M_PI / 0x8000), MTXMODE_NEW);
|
||||
Matrix_MultVec3f(&eyePosDeltaLocal, &eyePosDeltaWorld);
|
||||
|
||||
this->subCamEyeInit.x = this->subCamEye.x = this->actor.posRot.pos.x + eyePosDeltaWorld.x;
|
||||
this->subCamEyeInit.y = this->subCamEye.y = this->actor.posRot.pos.y + eyePosDeltaWorld.y;
|
||||
this->subCamEyeInit.x = this->subCamEye.x = this->actor.world.pos.x + eyePosDeltaWorld.x;
|
||||
this->subCamEyeInit.y = this->subCamEye.y = this->actor.world.pos.y + eyePosDeltaWorld.y;
|
||||
if (1) {}
|
||||
this->subCamEyeInit.z = this->subCamEye.z = this->actor.posRot.pos.z + eyePosDeltaWorld.z;
|
||||
this->subCamEyeInit.z = this->subCamEye.z = this->actor.world.pos.z + eyePosDeltaWorld.z;
|
||||
|
||||
if (1) {}
|
||||
this->subCamAtTarget.x = this->subCamAt.x = this->actor.posRot.pos.x;
|
||||
this->subCamAtTarget.y = this->subCamAt.y = this->actor.posRot.pos.y + 60.0f;
|
||||
this->subCamAtTarget.x = this->subCamAt.x = this->actor.world.pos.x;
|
||||
this->subCamAtTarget.y = this->subCamAt.y = this->actor.world.pos.y + 60.0f;
|
||||
if (1) {}
|
||||
this->subCamAtTarget.z = this->subCamAt.z = this->actor.posRot.pos.z;
|
||||
this->subCamAtTarget.z = this->subCamAt.z = this->actor.world.pos.z;
|
||||
|
||||
this->subCamId = Gameplay_CreateSubCamera(globalCtx);
|
||||
Gameplay_ChangeCameraStatus(globalCtx, 0, 1);
|
||||
|
@ -498,9 +498,9 @@ void EnDaiku_InitSubCamera(EnDaiku* this, GlobalContext* globalCtx) {
|
|||
void EnDaiku_UpdateSubCamera(EnDaiku* this, GlobalContext* globalCtx) {
|
||||
s32 pad;
|
||||
|
||||
this->subCamAtTarget.x = this->actor.posRot.pos.x;
|
||||
this->subCamAtTarget.y = this->actor.posRot.pos.y + 60.0f;
|
||||
this->subCamAtTarget.z = this->actor.posRot.pos.z;
|
||||
this->subCamAtTarget.x = this->actor.world.pos.x;
|
||||
this->subCamAtTarget.y = this->actor.world.pos.y + 60.0f;
|
||||
this->subCamAtTarget.z = this->actor.world.pos.z;
|
||||
|
||||
Math_SmoothStepToF(&this->subCamAt.x, this->subCamAtTarget.x, 1.0f, 1000.0f, 0.0f);
|
||||
Math_SmoothStepToF(&this->subCamAt.y, this->subCamAtTarget.y, 1.0f, 1000.0f, 0.0f);
|
||||
|
@ -548,8 +548,8 @@ void EnDaiku_EscapeRun(EnDaiku* this, GlobalContext* globalCtx) {
|
|||
|
||||
path = &globalCtx->setupPathList[this->actor.params >> 4 & 0xF];
|
||||
pointPos = (Vec3s*)SEGMENTED_TO_VIRTUAL(path->points) + this->waypoint;
|
||||
dx = pointPos->x - this->actor.posRot.pos.x;
|
||||
dz = pointPos->z - this->actor.posRot.pos.z;
|
||||
dx = pointPos->x - this->actor.world.pos.x;
|
||||
dz = pointPos->z - this->actor.world.pos.z;
|
||||
ry = Math_FAtan2F(dx, dz) * (0x8000 / M_PI);
|
||||
dxz = sqrtf(SQ(dx) + SQ(dz));
|
||||
if (dxz <= 20.88f) {
|
||||
|
@ -564,10 +564,10 @@ void EnDaiku_EscapeRun(EnDaiku* this, GlobalContext* globalCtx) {
|
|||
}
|
||||
|
||||
Math_SmoothStepToS(&this->actor.shape.rot.y, ry, 1, 0xFA0, 0);
|
||||
this->actor.posRot.rot.y = this->actor.shape.rot.y;
|
||||
this->actor.world.rot.y = this->actor.shape.rot.y;
|
||||
Math_SmoothStepToF(&this->actor.speedXZ, this->runSpeed, 0.6f, dxz, 0.0f);
|
||||
Actor_MoveForward(&this->actor);
|
||||
func_8002E4B4(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
|
||||
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 0.0f, 0.0f, 0.0f, 4);
|
||||
|
||||
if (this->subCamActive) {
|
||||
EnDaiku_UpdateSubCamera(this, globalCtx);
|
||||
|
@ -597,9 +597,9 @@ void EnDaiku_Update(Actor* thisx, GlobalContext* globalCtx) {
|
|||
this->actionFunc(this, globalCtx);
|
||||
|
||||
if (this->stateFlags & ENDAIKU_STATEFLAG_1) {
|
||||
this->unk_244.unk_18.x = player->actor.posRot2.pos.x;
|
||||
this->unk_244.unk_18.y = player->actor.posRot2.pos.y;
|
||||
this->unk_244.unk_18.z = player->actor.posRot2.pos.z;
|
||||
this->unk_244.unk_18.x = player->actor.focus.pos.x;
|
||||
this->unk_244.unk_18.y = player->actor.focus.pos.y;
|
||||
this->unk_244.unk_18.z = player->actor.focus.pos.z;
|
||||
|
||||
if (this->stateFlags & ENDAIKU_STATEFLAG_2) {
|
||||
func_80034A14(&this->actor, &this->unk_244, 0, 4);
|
||||
|
@ -657,7 +657,7 @@ void EnDaiku_PostLimbDraw(GlobalContext* globalCtx, s32 limb, Gfx** dList, Vec3s
|
|||
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_en_daiku.c", 1323);
|
||||
|
||||
if (limb == 15) { // head
|
||||
Matrix_MultVec3f(&targetPosHeadLocal, &this->actor.posRot2.pos);
|
||||
Matrix_MultVec3f(&targetPosHeadLocal, &this->actor.focus.pos);
|
||||
gSPDisplayList(POLY_OPA_DISP++, hairDLists[this->actor.params & 3]);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue