1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-10 00:40:16 +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

@ -91,7 +91,7 @@ static DemoImDrawFunc sDrawFuncs[] = {
const ActorInit Demo_Im_InitVars = {
ACTOR_DEMO_IM,
ACTORTYPE_NPC,
ACTORCAT_NPC,
FLAGS,
OBJECT_IM,
sizeof(DemoIm),
@ -135,7 +135,7 @@ void func_80984C68(DemoIm* this) {
this->drawConfig = 0;
this->unk_26C = 0;
this->unk_270 = 0;
this->actor.shape.unk_14 = 0;
this->actor.shape.shadowAlpha = 0;
this->unk_268 = 0.0f;
}
@ -193,10 +193,10 @@ void func_80984E58(DemoIm* this, GlobalContext* globalCtx) {
s16 yawDiff;
s16 phi_a3;
this->unk_2D4.unk_18 = player->actor.posRot.pos;
this->unk_2D4.unk_18 = player->actor.world.pos;
this->unk_2D4.unk_14 = kREG(16) + 4.0f;
yawDiff = this->actor.yawTowardsLink - this->actor.shape.rot.y;
yawDiff = this->actor.yawTowardsPlayer - this->actor.shape.rot.y;
phi_a3 = (ABS(yawDiff) < 0x18E3) ? 2 : 1;
func_80034A14(&this->actor, &this->unk_2D4, kREG(17) + 0xC, phi_a3);
}
@ -204,7 +204,7 @@ void func_80984E58(DemoIm* this, GlobalContext* globalCtx) {
void func_80984F10(DemoIm* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
this->unk_2D4.unk_18 = player->actor.posRot.pos;
this->unk_2D4.unk_18 = player->actor.world.pos;
this->unk_2D4.unk_14 = kREG(16) + 12.0f;
func_80034A14(&this->actor, &this->unk_2D4, kREG(17) + 0xC, 2);
@ -213,13 +213,13 @@ void func_80984F10(DemoIm* this, GlobalContext* globalCtx) {
void func_80984F94(DemoIm* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
this->unk_2D4.unk_18 = player->actor.posRot.pos;
this->unk_2D4.unk_18 = player->actor.world.pos;
this->unk_2D4.unk_14 = kREG(16) + 4.0f;
func_80034A14(&this->actor, &this->unk_2D4, kREG(17) + 0xC, 4);
}
void func_80985018(DemoIm* this, GlobalContext* globalCtx) {
func_8002E4B4(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5);
Actor_UpdateBgCheckInfo(globalCtx, &this->actor, 75.0f, 30.0f, 30.0f, 5);
}
s32 func_80985060(DemoIm* this) {
@ -269,10 +269,10 @@ void func_80985180(DemoIm* this, GlobalContext* globalCtx, s32 actionIdx) {
CsCmdActorAction* npcAction = func_809850A0(globalCtx, actionIdx);
if (npcAction != NULL) {
this->actor.posRot.pos.x = npcAction->startPos.x;
this->actor.posRot.pos.y = npcAction->startPos.y;
this->actor.posRot.pos.z = npcAction->startPos.z;
this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y;
this->actor.world.pos.x = npcAction->startPos.x;
this->actor.world.pos.y = npcAction->startPos.y;
this->actor.world.pos.z = npcAction->startPos.z;
this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y;
}
}
@ -280,10 +280,10 @@ void func_80985200(DemoIm* this, GlobalContext* globalCtx, s32 actionIdx) {
CsCmdActorAction* npcAction = func_809850A0(globalCtx, actionIdx);
if (npcAction != NULL) {
this->actor.posRot.pos.x = npcAction->startPos.x;
this->actor.posRot.pos.y = npcAction->startPos.y;
this->actor.posRot.pos.z = npcAction->startPos.z;
this->actor.posRot.rot.y = this->actor.shape.rot.y = npcAction->rot.y;
this->actor.world.pos.x = npcAction->startPos.x;
this->actor.world.pos.y = npcAction->startPos.y;
this->actor.world.pos.z = npcAction->startPos.z;
this->actor.world.rot.y = this->actor.shape.rot.y = npcAction->rot.y;
}
}
@ -308,22 +308,22 @@ void func_80985280(DemoIm* this, AnimationHeader* animHeaderSeg, u8 arg2, f32 tr
void func_80985310(DemoIm* this, GlobalContext* globalCtx) {
func_80985280(this, &D_06001868, 0, 0.0f, 0);
this->actor.shape.unk_08 = -10000.0f;
this->actor.shape.yOffset = -10000.0f;
}
void func_80985358(DemoIm* this, GlobalContext* globalCtx) {
f32 posX = this->actor.posRot.pos.x;
f32 posY = this->actor.posRot.pos.y;
f32 posZ = this->actor.posRot.pos.z;
f32 posX = this->actor.world.pos.x;
f32 posY = this->actor.world.pos.y;
f32 posZ = this->actor.world.pos.z;
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DOOR_WARP1, posX, posY, posZ, 0, 0, 0, 2);
}
void func_809853B4(DemoIm* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
f32 playerX = player->actor.posRot.pos.x;
f32 playerY = player->actor.posRot.pos.y + 80.0f;
f32 playerZ = player->actor.posRot.pos.z;
f32 playerX = player->actor.world.pos.x;
f32 playerY = player->actor.world.pos.y + 80.0f;
f32 playerZ = player->actor.world.pos.z;
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_EFFECT, playerX, playerY, playerZ, 0,
0, 0, 0xD);
@ -331,7 +331,7 @@ void func_809853B4(DemoIm* this, GlobalContext* globalCtx) {
}
void func_80985430(DemoIm* this, GlobalContext* globalCtx) {
this->actor.shape.unk_08 += 250.0f / 3.0f;
this->actor.shape.yOffset += 250.0f / 3.0f;
}
void func_8098544C(DemoIm* this, GlobalContext* globalCtx) {
@ -344,7 +344,7 @@ void func_8098544C(DemoIm* this, GlobalContext* globalCtx) {
globalCtx->csCtx.segment = D_8098786C;
gSaveContext.cutsceneTrigger = 2;
Item_Give(globalCtx, ITEM_MEDALLION_SHADOW);
player->actor.posRot.rot.y = player->actor.shape.rot.y = this->actor.posRot.rot.y + 0x8000;
player->actor.world.rot.y = player->actor.shape.rot.y = this->actor.world.rot.y + 0x8000;
}
}
@ -360,9 +360,9 @@ void func_809854DC(DemoIm* this, GlobalContext* globalCtx) {
}
void func_8098557C(DemoIm* this) {
if (this->actor.shape.unk_08 >= 0.0f) {
if (this->actor.shape.yOffset >= 0.0f) {
this->action = 3;
this->actor.shape.unk_08 = 0.0f;
this->actor.shape.yOffset = 0.0f;
}
}
@ -438,7 +438,7 @@ void func_80985830(DemoIm* this, GlobalContext* globalCtx) {
void func_80985860(DemoIm* this, GlobalContext* globalCtx) {
func_80985280(this, &D_06001868, 0, 0.0f, 0);
this->action = 7;
this->actor.shape.unk_14 = 0;
this->actor.shape.shadowAlpha = 0;
}
void func_809858A8(void) {
@ -446,8 +446,8 @@ void func_809858A8(void) {
}
void func_809858C8(DemoIm* this, GlobalContext* globalCtx) {
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.posRot.pos.x,
(kREG(17) + 24.0f) + this->actor.posRot.pos.y, this->actor.posRot.pos.z, 0, 0, 0, 6);
Actor_SpawnAsChild(&globalCtx->actorCtx, &this->actor, globalCtx, ACTOR_DEMO_6K, this->actor.world.pos.x,
(kREG(17) + 24.0f) + this->actor.world.pos.y, this->actor.world.pos.z, 0, 0, 0, 6);
}
void func_80985948(DemoIm* this, GlobalContext* globalCtx) {
@ -457,7 +457,7 @@ void func_80985948(DemoIm* this, GlobalContext* globalCtx) {
this->action = 8;
this->drawConfig = 2;
this->unk_26C = 0;
this->actor.shape.unk_14 = 0;
this->actor.shape.shadowAlpha = 0;
this->unk_268 = 0.0f;
func_809858A8();
}
@ -473,7 +473,7 @@ void func_809859E0(DemoIm* this, GlobalContext* globalCtx) {
this->action = 9;
this->drawConfig = 1;
*unk_268 = kREG(5) + 10.0f;
this->unk_26C = this->actor.shape.unk_14 = alpha;
this->unk_26C = this->actor.shape.shadowAlpha = alpha;
return;
}
} else {
@ -483,11 +483,11 @@ void func_809859E0(DemoIm* this, GlobalContext* globalCtx) {
this->drawConfig = 0;
*unk_268 = 0.0f;
this->unk_26C = 0;
this->actor.shape.unk_14 = 0;
this->actor.shape.shadowAlpha = 0;
return;
}
}
this->actor.shape.unk_14 = this->unk_26C = (*unk_268 / (kREG(5) + 10.0f)) * 255.0f;
this->actor.shape.shadowAlpha = this->unk_26C = (*unk_268 / (kREG(5) + 10.0f)) * 255.0f;
}
void func_80985B34(DemoIm* this, GlobalContext* globalCtx) {
@ -502,7 +502,7 @@ void func_80985B34(DemoIm* this, GlobalContext* globalCtx) {
func_809858C8(this, globalCtx);
this->unk_270 = 1;
}
this->actor.shape.unk_14 = 0xFF;
this->actor.shape.shadowAlpha = 0xFF;
}
}
@ -730,7 +730,7 @@ void func_80986570(DemoIm* this, GlobalContext* globalCtx) {
if ((Animation_OnFrame(&this->skelAnime, 7.0f)) && (this->actor.bgCheckFlags & 1)) {
u32 sfxId = SFX_FLAG;
sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorPolySource);
sfxId += SurfaceType_GetSfx(&globalCtx->colCtx, this->actor.floorPoly, this->actor.floorBgId);
Audio_PlaySoundGeneral(sfxId, &this->actor.projectedPos, 4, &D_801333E0, &D_801333E0, &D_801333E8);
}
}
@ -743,7 +743,7 @@ void func_809865F8(DemoIm* this, GlobalContext* globalCtx, s32 arg2) {
if (*unk_278 >= 0.0f) {
if (this->unk_27C == 0) {
Vec3f* thisPos = &this->actor.posRot.pos;
Vec3f* thisPos = &this->actor.world.pos;
s16 shapeRotY = this->actor.shape.rot.y;
f32 spawnPosX = thisPos->x + (Math_SinS(shapeRotY) * 30.0f);
f32 spawnPosY = thisPos->y;
@ -833,13 +833,13 @@ void func_80986948(DemoIm* this, GlobalContext* globalCtx) {
void func_809869B0(DemoIm* this, GlobalContext* globalCtx) {
func_80985280(this, &D_06001868, 0, 0.0f, 0);
this->action = 18;
this->actor.shape.unk_14 = 0;
this->actor.shape.shadowAlpha = 0;
}
s32 func_809869F8(DemoIm* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
f32 playerPosX = player->actor.posRot.pos.x;
f32 thisPosX = this->actor.posRot.pos.x;
f32 playerPosX = player->actor.world.pos.x;
f32 thisPosX = this->actor.world.pos.x;
if ((thisPosX - (kREG(16) + 30.0f) > playerPosX) && (!(this->actor.flags & 0x40))) {
return 1;
@ -849,8 +849,8 @@ s32 func_809869F8(DemoIm* this, GlobalContext* globalCtx) {
s32 func_80986A5C(DemoIm* this, GlobalContext* globalCtx) {
Player* player = PLAYER;
f32 playerPosX = player->actor.posRot.pos.x;
f32 thisPosX = this->actor.posRot.pos.x;
f32 playerPosX = player->actor.world.pos.x;
f32 thisPosX = this->actor.world.pos.x;
if ((thisPosX - (kREG(17) + 130.0f) < playerPosX) && (!Gameplay_InCsMode(globalCtx))) {
return 1;
@ -885,7 +885,7 @@ void func_80986BA0(DemoIm* this, GlobalContext* globalCtx) {
this->action = 21;
this->drawConfig = 1;
this->unk_280 = 1;
this->actor.shape.unk_14 = 0xFF;
this->actor.shape.shadowAlpha = 0xFF;
}
}
@ -900,7 +900,7 @@ void func_80986BF8(DemoIm* this, GlobalContext* globalCtx) {
this->action = 24;
this->drawConfig = 1;
this->unk_280 = 1;
this->actor.shape.unk_14 = 0xFF;
this->actor.shape.shadowAlpha = 0xFF;
}
}
@ -919,7 +919,7 @@ void func_80986CC8(DemoIm* this) {
this->action = 26;
this->drawConfig = 1;
this->unk_280 = 1;
this->actor.shape.unk_14 = 0xFF;
this->actor.shape.shadowAlpha = 0xFF;
}
}
@ -1004,7 +1004,7 @@ void func_80987018(DemoIm* this, GlobalContext* globalCtx) {
func_80985280(this, &D_06001868, 0, 0.0f, 0);
this->action = 27;
this->drawConfig = 0;
this->actor.shape.unk_14 = 0;
this->actor.shape.shadowAlpha = 0;
}
void func_80987064(DemoIm* this) {
@ -1016,9 +1016,9 @@ void func_80987064(DemoIm* this) {
temp = kREG(17) + 10.0f;
if (*unk_268 >= temp) {
this->actor.shape.unk_14 = this->unk_26C = alpha;
this->actor.shape.shadowAlpha = this->unk_26C = alpha;
} else {
this->actor.shape.unk_14 = this->unk_26C = (*unk_268 / temp) * 255.0f;
this->actor.shape.shadowAlpha = this->unk_26C = (*unk_268 / temp) * 255.0f;
}
}
@ -1110,7 +1110,7 @@ void DemoIm_Update(Actor* thisx, GlobalContext* globalCtx) {
void DemoIm_Init(Actor* thisx, GlobalContext* globalCtx) {
DemoIm* this = THIS;
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 30.0f);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 30.0f);
func_80984D00(thisx, globalCtx);
SkelAnime_InitFlex(globalCtx, &this->skelAnime, &D_0600F788, NULL, this->jointTable, this->morphTable, 17);
thisx->flags &= ~1;
@ -1176,12 +1176,12 @@ void func_809875C0(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec3s*
Vec3f dest;
Matrix_MultVec3f(&sp28, &dest);
this->actor.posRot2.pos.x = dest.x;
this->actor.posRot2.pos.y = dest.y;
this->actor.posRot2.pos.z = dest.z;
this->actor.posRot2.rot.x = this->actor.posRot.rot.x;
this->actor.posRot2.rot.y = this->actor.posRot.rot.y;
this->actor.posRot2.rot.z = this->actor.posRot.rot.z;
this->actor.focus.pos.x = dest.x;
this->actor.focus.pos.y = dest.y;
this->actor.focus.pos.z = dest.z;
this->actor.focus.rot.x = this->actor.world.rot.x;
this->actor.focus.rot.y = this->actor.world.rot.y;
this->actor.focus.rot.z = this->actor.world.rot.z;
}
}