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

@ -47,7 +47,7 @@ extern AnimationHeader D_06000214;
const ActorInit En_Kakasi2_InitVars = {
ACTOR_EN_KAKASI2,
ACTORTYPE_PROP,
ACTORCAT_PROP,
FLAGS,
OBJECT_KA,
sizeof(EnKakasi2),
@ -69,11 +69,11 @@ void EnKakasi2_Init(Actor* thisx, GlobalContext* globalCtx) {
this->switchFlag = this->actor.params & 0x3F;
spawnRangeY = (this->actor.params >> 6) & 0xFF;
spawnRangeXZ = this->actor.posRot.rot.z;
spawnRangeXZ = this->actor.world.rot.z;
if (this->switchFlag == 0x3F) {
this->switchFlag = -1;
}
this->actor.unk_1F = 4;
this->actor.targetMode = 4;
this->maxSpawnDistance.x = (spawnRangeY * 40.0f) + 40.0f;
this->maxSpawnDistance.y = (spawnRangeXZ * 40.0f) + 40.0f;
@ -104,7 +104,7 @@ void EnKakasi2_Init(Actor* thisx, GlobalContext* globalCtx) {
this->actionFunc = func_80A9062C;
} else {
this->actionFunc = func_80A90264;
this->actor.shape.unk_08 = -8000.0f;
this->actor.shape.yOffset = -8000.0f;
}
}
@ -120,8 +120,8 @@ void func_80A90264(EnKakasi2* this, GlobalContext* globalCtx) {
this->unk_194++;
if ((BREG(1) != 0) && (this->actor.xzDistToLink < this->maxSpawnDistance.x) &&
(fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < this->maxSpawnDistance.y)) {
if ((BREG(1) != 0) && (this->actor.xzDistToPlayer < this->maxSpawnDistance.x) &&
(fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < this->maxSpawnDistance.y)) {
this->actor.draw = func_80A90948;
Collider_InitCylinder(globalCtx, &this->collider);
@ -137,8 +137,8 @@ void func_80A90264(EnKakasi2* this, GlobalContext* globalCtx) {
osSyncPrintf(VT_FGCOL(GREEN) "☆☆☆☆☆ SAVE 終了 ☆☆☆☆☆ %d\n" VT_RST, this->switchFlag);
this->actionFunc = func_80A904D8;
} else if ((this->actor.xzDistToLink < this->maxSpawnDistance.x) &&
(fabsf(player->actor.posRot.pos.y - this->actor.posRot.pos.y) < this->maxSpawnDistance.y) &&
} else if ((this->actor.xzDistToPlayer < this->maxSpawnDistance.x) &&
(fabsf(player->actor.world.pos.y - this->actor.world.pos.y) < this->maxSpawnDistance.y) &&
(gSaveContext.eventChkInf[9] & 0x1000)) {
this->unk_194 = 0;
@ -180,11 +180,11 @@ void func_80A90578(EnKakasi2* this, GlobalContext* globalCtx) {
}
this->actor.shape.rot.y += 0x800;
Math_ApproachZeroF(&this->actor.shape.unk_08, 0.5f, 500.0f);
Math_ApproachZeroF(&this->actor.shape.yOffset, 0.5f, 500.0f);
if (this->actor.shape.unk_08 > -100.0f) {
if (this->actor.shape.yOffset > -100.0f) {
this->actionFunc = func_80A9062C;
this->actor.shape.unk_08 = 0.0f;
this->actor.shape.yOffset = 0.0f;
}
}
@ -207,12 +207,12 @@ void EnKakasi2_Update(Actor* thisx, GlobalContext* globalCtx) {
EnKakasi2* this = THIS;
GlobalContext* globalCtx2 = globalCtx;
this->actor.posRot.rot = this->actor.shape.rot;
Actor_SetHeight(&this->actor, this->height);
this->actor.world.rot = this->actor.shape.rot;
Actor_SetFocus(&this->actor, this->height);
this->actionFunc(this, globalCtx2);
Actor_MoveForward(&this->actor);
if (this->actor.shape.unk_08 == 0.0f) {
if (this->actor.shape.yOffset == 0.0f) {
Collider_UpdateCylinder(&this->actor, &this->collider);
CollisionCheck_SetAC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base);
CollisionCheck_SetOC(globalCtx2, &globalCtx2->colChkCtx, &this->collider.base);
@ -220,21 +220,21 @@ void EnKakasi2_Update(Actor* thisx, GlobalContext* globalCtx) {
if (BREG(0) != 0) {
if (BREG(5) != 0) {
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ this->actor.player_distance ☆☆☆☆☆ %f\n" VT_RST,
this->actor.xzDistToLink);
this->actor.xzDistToPlayer);
osSyncPrintf(VT_FGCOL(YELLOW) "☆☆☆☆☆ this->hosei.x ☆☆☆☆☆ %f\n" VT_RST, this->maxSpawnDistance.x);
osSyncPrintf("\n\n");
}
if (this->actor.draw == NULL) {
if (this->unk_194 != 0) {
if ((this->unk_194 % 2) == 0) {
DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z,
this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z,
DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z,
1.0f, 1.0f, 1.0f, 70, 70, 70, 255, 4, globalCtx2->state.gfxCtx);
}
} else {
DebugDisplay_AddObject(this->actor.posRot.pos.x, this->actor.posRot.pos.y, this->actor.posRot.pos.z,
this->actor.posRot.rot.x, this->actor.posRot.rot.y, this->actor.posRot.rot.z,
1.0f, 1.0f, 1.0f, 0, 255, 255, 255, 4, globalCtx2->state.gfxCtx);
DebugDisplay_AddObject(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
this->actor.world.rot.x, this->actor.world.rot.y, this->actor.world.rot.z, 1.0f,
1.0f, 1.0f, 0, 255, 255, 255, 4, globalCtx2->state.gfxCtx);
}
}
}