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

@ -44,10 +44,10 @@ u32 EffectSsEnFire_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, voi
this->rUnused = -15;
if (initParams->bodyPart < 0) {
this->rYaw = Math_Vec3f_Yaw(&initParams->actor->posRot.pos, &initParams->pos) - initParams->actor->shape.rot.y;
this->rYaw = Math_Vec3f_Yaw(&initParams->actor->world.pos, &initParams->pos) - initParams->actor->shape.rot.y;
this->rPitch =
Math_Vec3f_Pitch(&initParams->actor->posRot.pos, &initParams->pos) - initParams->actor->shape.rot.x;
this->vec.z = Math_Vec3f_DistXYZ(&initParams->pos, &initParams->actor->posRot.pos);
Math_Vec3f_Pitch(&initParams->actor->world.pos, &initParams->pos) - initParams->actor->shape.rot.x;
this->vec.z = Math_Vec3f_DistXYZ(&initParams->pos, &initParams->actor->world.pos);
}
this->rScaleMax = initParams->scale;
@ -120,14 +120,14 @@ void EffectSsEnFire_Update(GlobalContext* globalCtx, u32 index, EffectSs* this)
this->rScroll++;
if (this->actor != NULL) {
if (this->actor->dmgEffectTimer >= 22) {
if (this->actor->colorFilterTimer >= 22) {
this->life++;
}
if (this->actor->update != NULL) {
Math_SmoothStepToS(&this->rScale, this->rScaleMax, 1, this->rScaleMax >> 3, 0);
if (this->rBodyPart < 0) {
Matrix_Translate(this->actor->posRot.pos.x, this->actor->posRot.pos.y, this->actor->posRot.pos.z,
Matrix_Translate(this->actor->world.pos.x, this->actor->world.pos.y, this->actor->world.pos.z,
MTXMODE_NEW);
Matrix_RotateY((this->rYaw + this->actor->shape.rot.y) * 0.0000958738f, MTXMODE_APPLY);
Matrix_RotateX((this->rPitch + this->actor->shape.rot.x) * 0.0000958738f, MTXMODE_APPLY);

View file

@ -39,9 +39,9 @@ u32 EffectSsEnIce_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void
Vec3f zeroVec = { 0.0f, 0.0f, 0.0f };
this->pos = initParams->pos;
this->vec.x = this->pos.x - initParams->actor->posRot.pos.x;
this->vec.y = this->pos.y - initParams->actor->posRot.pos.y;
this->vec.z = this->pos.z - initParams->actor->posRot.pos.z;
this->vec.x = this->pos.x - initParams->actor->world.pos.x;
this->vec.y = this->pos.y - initParams->actor->world.pos.y;
this->vec.z = this->pos.z - initParams->actor->world.pos.z;
this->velocity = zeroVec;
this->accel = zeroVec;
this->life = 10;
@ -138,14 +138,14 @@ void EffectSsEnIce_UpdateFlying(GlobalContext* globalCtx, u32 index, EffectSs* t
s16 rand;
if ((this->actor != NULL) && (this->actor->update != NULL)) {
if ((this->life >= 9) && (this->actor->dmgEffectTimer != 0) && (!(this->actor->dmgEffectParams & 0xC000))) {
this->pos.x = this->actor->posRot.pos.x + this->vec.x;
this->pos.y = this->actor->posRot.pos.y + this->vec.y;
this->pos.z = this->actor->posRot.pos.z + this->vec.z;
if ((this->life >= 9) && (this->actor->colorFilterTimer != 0) && (!(this->actor->colorFilterParams & 0xC000))) {
this->pos.x = this->actor->world.pos.x + this->vec.x;
this->pos.y = this->actor->world.pos.y + this->vec.y;
this->pos.z = this->actor->world.pos.z + this->vec.z;
this->life++;
} else if (this->life == 9) {
this->accel.x = Math_SinS(Math_Vec3f_Yaw(&this->actor->posRot.pos, &this->pos)) * (Rand_ZeroOne() + 1.0f);
this->accel.z = Math_CosS(Math_Vec3f_Yaw(&this->actor->posRot.pos, &this->pos)) * (Rand_ZeroOne() + 1.0f);
this->accel.x = Math_SinS(Math_Vec3f_Yaw(&this->actor->world.pos, &this->pos)) * (Rand_ZeroOne() + 1.0f);
this->accel.z = Math_CosS(Math_Vec3f_Yaw(&this->actor->world.pos, &this->pos)) * (Rand_ZeroOne() + 1.0f);
this->accel.y = -1.5f;
this->velocity.y = 5.0f;
}

View file

@ -28,9 +28,9 @@ u32 EffectSsFcircle_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, vo
this->pos = initParams->pos;
this->actor = initParams->actor;
this->vec.x = initParams->pos.x - initParams->actor->posRot.pos.x;
this->vec.y = initParams->pos.y - initParams->actor->posRot.pos.y;
this->vec.z = initParams->pos.z - initParams->actor->posRot.pos.z;
this->vec.x = initParams->pos.x - initParams->actor->world.pos.x;
this->vec.y = initParams->pos.y - initParams->actor->world.pos.y;
this->vec.z = initParams->pos.z - initParams->actor->world.pos.z;
this->gfx = D_040184B0;
this->life = 20;
this->draw = EffectSsFcircle_Draw;
@ -77,15 +77,15 @@ void EffectSsFcircle_Update(GlobalContext* globalCtx, u32 index, EffectSs* this)
if (actor != NULL) {
if (actor->update != NULL) {
this->pos.x = actor->posRot.pos.x + this->vec.x;
this->pos.y = actor->posRot.pos.y + this->vec.y;
this->pos.z = actor->posRot.pos.z + this->vec.z;
this->pos.x = actor->world.pos.x + this->vec.x;
this->pos.y = actor->world.pos.y + this->vec.y;
this->pos.z = actor->world.pos.z + this->vec.z;
this->rYaw = actor->shape.rot.y;
if (actor->dmgEffectTimer > 20) {
if (actor->colorFilterTimer > 20) {
this->life = 20;
} else {
this->life = actor->dmgEffectTimer;
this->life = actor->colorFilterTimer;
}
Math_StepToS(&this->rScale, 100, 20);

View file

@ -85,8 +85,8 @@ void EffectSsFireTail_Draw(GlobalContext* globalCtx, u32 index, EffectSs* this)
this->vec = this->actor->velocity;
if (this->rBodyPart < 0) {
Matrix_Translate(this->pos.x + this->actor->posRot.pos.x, this->pos.y + this->actor->posRot.pos.y,
this->pos.z + this->actor->posRot.pos.z, MTXMODE_NEW);
Matrix_Translate(this->pos.x + this->actor->world.pos.x, this->pos.y + this->actor->world.pos.y,
this->pos.z + this->actor->world.pos.z, MTXMODE_NEW);
} else {
Player* player = PLAYER;
s16 bodyPart = this->rBodyPart;

View file

@ -40,9 +40,9 @@ u32 EffectSsGSpk_Init(GlobalContext* globalCtx, u32 index, EffectSs* this, void*
if (initParams->updateMode == 0) {
this->life = 10;
this->vec.x = initParams->pos.x - initParams->actor->posRot.pos.x;
this->vec.y = initParams->pos.y - initParams->actor->posRot.pos.y;
this->vec.z = initParams->pos.z - initParams->actor->posRot.pos.z;
this->vec.x = initParams->pos.x - initParams->actor->world.pos.x;
this->vec.y = initParams->pos.y - initParams->actor->world.pos.y;
this->vec.z = initParams->pos.z - initParams->actor->world.pos.z;
this->update = EffectSsGSpk_Update;
} else {
this->life = 5;
@ -114,10 +114,10 @@ void EffectSsGSpk_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) {
this->accel.z = (Rand_ZeroOne() - 0.5f) * 3.0f;
if (this->actor != NULL) {
if ((this->actor->type == ACTORTYPE_EXPLOSIVES) && (this->actor->update != NULL)) {
this->pos.x = this->actor->posRot.pos.x + this->vec.x;
this->pos.y = this->actor->posRot.pos.y + this->vec.y;
this->pos.z = this->actor->posRot.pos.z + this->vec.z;
if ((this->actor->category == ACTORCAT_EXPLOSIVE) && (this->actor->update != NULL)) {
this->pos.x = this->actor->world.pos.x + this->vec.x;
this->pos.y = this->actor->world.pos.y + this->vec.y;
this->pos.z = this->actor->world.pos.z + this->vec.z;
}
}
@ -133,9 +133,9 @@ void EffectSsGSpk_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) {
// with this update mode, the sparks dont move randomly in the xz plane, appearing to be on top of each other
void EffectSsGSpk_UpdateNoAccel(GlobalContext* globalCtx, u32 index, EffectSs* this) {
if (this->actor != NULL) {
if ((this->actor->type == ACTORTYPE_EXPLOSIVES) && (this->actor->update != NULL)) {
this->pos.x += (Math_SinS(this->actor->posRot.rot.y) * this->actor->speedXZ);
this->pos.z += (Math_CosS(this->actor->posRot.rot.y) * this->actor->speedXZ);
if ((this->actor->category == ACTORCAT_EXPLOSIVE) && (this->actor->update != NULL)) {
this->pos.x += (Math_SinS(this->actor->world.rot.y) * this->actor->speedXZ);
this->pos.z += (Math_CosS(this->actor->world.rot.y) * this->actor->speedXZ);
}
}

View file

@ -124,7 +124,7 @@ void EffectSsHahen_Update(GlobalContext* globalCtx, u32 index, EffectSs* this) {
this->rPitch += 55;
this->rYaw += 10;
if ((this->pos.y <= player->actor.groundY) && (this->life < this->rMinLife)) {
if ((this->pos.y <= player->actor.floorHeight) && (this->life < this->rMinLife)) {
this->life = 0;
}

View file

@ -352,7 +352,7 @@ void func_809AA230(EffectSs* this, GlobalContext* globalCtx) {
if (this->rReg8 == 0) {
if ((((this->rReg4 >> 4) & 1) * 0x10) == 0x10) {
if (this->pos.y <= (player->actor.groundY - ((this->rReg4 >> 2) & 3))) {
if (this->pos.y <= (player->actor.floorHeight - ((this->rReg4 >> 2) & 3))) {
this->rReg9 = 0;
this->rReg0 = 0;
this->rReg4 &= ~0x60;
@ -362,7 +362,7 @@ void func_809AA230(EffectSs* this, GlobalContext* globalCtx) {
this->rGravity = this->rReg9;
}
} else {
if (this->pos.y <= ((player->actor.groundY - ((this->rReg4 >> 2) & 3)) - 600.0f)) {
if (this->pos.y <= ((player->actor.floorHeight - ((this->rReg4 >> 2) & 3)) - 600.0f)) {
this->life = 0;
}
}

View file

@ -87,7 +87,7 @@ void EffectSsSibuki_Update(GlobalContext* globalCtx, u32 index, EffectSs* this)
s16 yaw;
Player* player = PLAYER;
if (this->pos.y <= player->actor.groundY) {
if (this->pos.y <= player->actor.floorHeight) {
this->life = 0;
}

View file

@ -39,9 +39,9 @@ void EffectSsSolderSrchBall_Update(GlobalContext* globalCtx, u32 index, EffectSs
linkDetected = this->actor;
playerPosDiffX = player->actor.posRot.pos.x - this->pos.x;
playerPosDiffY = player->actor.posRot.pos.y - this->pos.y;
playerPosDiffZ = player->actor.posRot.pos.z - this->pos.z;
playerPosDiffX = player->actor.world.pos.x - this->pos.x;
playerPosDiffY = player->actor.world.pos.y - this->pos.y;
playerPosDiffZ = player->actor.world.pos.z - this->pos.z;
if (!BgCheck_SphVsFirstPoly(&globalCtx->colCtx, &this->pos, 30.0f)) {
if (sqrtf(SQ(playerPosDiffX) + SQ(playerPosDiffY) + SQ(playerPosDiffZ)) < 70.0f) {