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

@ -31,7 +31,7 @@ extern CollisionHeader D_06000B30;
const ActorInit Obj_Timeblock_InitVars = {
ACTOR_OBJ_TIMEBLOCK,
ACTORTYPE_ITEMACTION,
ACTORCAT_ITEMACTION,
FLAGS,
OBJECT_TIMEBLOCK,
sizeof(ObjTimeblock),
@ -55,7 +55,7 @@ static ObjTimeblockSizeOptions sSizeOptions[] = {
static f32 sRanges[] = { 60.0, 100.0, 140.0, 180.0, 220.0, 260.0, 300.0, 300.0 };
static InitChainEntry sInitChain[] = {
ICHAIN_U8(unk_1F, 2, ICHAIN_CONTINUE),
ICHAIN_U8(targetMode, 2, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneForward, 1800, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneScale, 300, ICHAIN_CONTINUE),
ICHAIN_F32(uncullZoneDownward, 1500, ICHAIN_STOP),
@ -85,8 +85,8 @@ u32 ObjTimeblock_CalculateIsVisible(ObjTimeblock* this) {
}
void ObjTimeblock_SpawnDemoEffect(ObjTimeblock* this, GlobalContext* globalCtx) {
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->dyna.actor.posRot.pos.x,
this->dyna.actor.posRot.pos.y, this->dyna.actor.posRot.pos.z, 0, 0, 0,
Actor_Spawn(&globalCtx->actorCtx, globalCtx, ACTOR_DEMO_EFFECT, this->dyna.actor.world.pos.x,
this->dyna.actor.world.pos.y, this->dyna.actor.world.pos.z, 0, 0, 0,
sSizeOptions[(this->dyna.actor.params >> 8) & 1].demoEffectParams);
}
@ -104,7 +104,7 @@ void ObjTimeblock_Init(Actor* thisx, GlobalContext* globalCtx) {
CollisionHeader* colHeader = NULL;
DynaPolyActor_Init(&this->dyna, DPM_UNK);
this->dyna.actor.posRot.rot.z = this->dyna.actor.shape.rot.z = 0;
this->dyna.actor.world.rot.z = this->dyna.actor.shape.rot.z = 0;
CollisionHeader_GetVirtual(&D_06000B30, &colHeader);
@ -121,7 +121,7 @@ void ObjTimeblock_Init(Actor* thisx, GlobalContext* globalCtx) {
this->songObserverFunc = ObjTimeblock_WaitForOcarina;
Actor_SetHeight(&this->dyna.actor, sSizeOptions[(this->dyna.actor.params >> 8) & 1].height);
Actor_SetFocus(&this->dyna.actor, sSizeOptions[(this->dyna.actor.params >> 8) & 1].height);
this->unk_174 = (Flags_GetSwitch(globalCtx, this->dyna.actor.params & 0x3F)) ? true : false;
this->unk_175 = ((this->dyna.actor.params >> 15) & 1) ? true : false;
@ -137,7 +137,7 @@ void ObjTimeblock_Init(Actor* thisx, GlobalContext* globalCtx) {
// "Block of time"
osSyncPrintf("時のブロック (<arg> %04xH <type> save:%d color:%d range:%d move:%d)\n", (u16)this->dyna.actor.params,
this->unk_177, this->dyna.actor.initPosRot.rot.z & 7, (this->dyna.actor.params >> 11) & 7,
this->unk_177, this->dyna.actor.home.rot.z & 7, (this->dyna.actor.params >> 11) & 7,
(this->dyna.actor.params >> 10) & 1);
}
@ -153,11 +153,11 @@ u8 ObjTimeblock_PlayerIsInRange(ObjTimeblock* this, GlobalContext* globalCtx) {
return false;
}
if (this->dyna.actor.xzDistToLink <= sRanges[(this->dyna.actor.params >> 11) & 7]) {
if (this->dyna.actor.xzDistToPlayer <= sRanges[(this->dyna.actor.params >> 11) & 7]) {
Vec3f distance;
f32 blockSize;
func_8002DBD0(&this->dyna.actor, &distance, &PLAYER->actor.posRot.pos);
func_8002DBD0(&this->dyna.actor, &distance, &PLAYER->actor.world.pos);
blockSize = this->dyna.actor.scale.x * 50.0f + 6.0f;
// Return true if player's xz position is not inside the block
if (blockSize < fabsf(distance.x) || blockSize < fabsf(distance.z)) {
@ -333,7 +333,7 @@ void ObjTimeblock_Update(Actor* thisx, GlobalContext* globalCtx) {
void ObjTimeblock_Draw(Actor* thisx, GlobalContext* globalCtx) {
if (((ObjTimeblock*)thisx)->isVisible) {
Color_RGB8* primColor = &sPrimColors[thisx->initPosRot.rot.z & 7];
Color_RGB8* primColor = &sPrimColors[thisx->home.rot.z & 7];
OPEN_DISPS(globalCtx->state.gfxCtx, "../z_obj_timeblock.c", 762);