mirror of
https://github.com/zeldaret/ss
synced 2026-08-20 14:14:40 -04:00
Tubo! (d_a_obj_tubo) (#95)
* begin work * fixup modifications to d_a_base header * progress * update from main again (forgor to fetch) * progress * Basically done * clean up some inlines * some at/tg hit typing and tubo naming * more naming
This commit is contained in:
@@ -3,12 +3,12 @@
|
||||
#include "d/a/d_a_player.h"
|
||||
#include "d/a/obj/d_a_obj_base.h"
|
||||
#include "d/d_heap.h"
|
||||
#include "d/flag/enemyflag_manager.h"
|
||||
#include "f/f_list_nd.h"
|
||||
#include "m/m_vec.h"
|
||||
#include "toBeSorted/event.h"
|
||||
#include "toBeSorted/event_manager.h"
|
||||
#include "toBeSorted/file_manager.h"
|
||||
#include "d/flag/enemyflag_manager.h"
|
||||
#include "toBeSorted/room_manager.h"
|
||||
#include "toBeSorted/scgame.h"
|
||||
#include "toBeSorted/special_item_drop_mgr.h"
|
||||
@@ -243,9 +243,7 @@ u32 dAcBase_c::itemDroppingAndGivingRelated(mVec3_c *spawnPos, int subtype) {
|
||||
u32 param2Copy = params2;
|
||||
params2 = param2Copy | 0xFF000000;
|
||||
// mAng3_c rot = {};
|
||||
return SpecialItemDropMgr::sInstance->giveSpecialDropItem(
|
||||
param2Copy >> 0x18, roomid, spawnPos, subtype, 0, -1
|
||||
);
|
||||
return SpecialItemDropMgr::sInstance->giveSpecialDropItem(param2Copy >> 0x18, roomid, spawnPos, subtype, 0, -1);
|
||||
}
|
||||
|
||||
// 8002cf90
|
||||
@@ -264,7 +262,7 @@ void dAcBase_c::setParams2Upper_ignoreLower(u32 val) {
|
||||
}
|
||||
|
||||
// 8002cfc0
|
||||
u8 dAcBase_c::getParams2UpperByte() {
|
||||
int dAcBase_c::getParams2UpperByte() {
|
||||
return params2 >> 0x18;
|
||||
}
|
||||
|
||||
@@ -450,7 +448,7 @@ void dAcBase_c::FUN_8002d6d0() {}
|
||||
// currently named ActorBase__playSoundEffect1
|
||||
void dAcBase_c::playSoundEffect1(u16) {}
|
||||
void dAcBase_c::FUN_8002d740() {}
|
||||
void dAcBase_c::FUN_8002d770() {}
|
||||
void dAcBase_c::FUN_8002d770(u16, f32) {}
|
||||
void dAcBase_c::FUN_8002d7a0() {}
|
||||
void dAcBase_c::FUN_8002d7d0() {}
|
||||
void dAcBase_c::FUN_8002d7f0() {}
|
||||
@@ -551,7 +549,7 @@ dAcBase_c *dAcBase_c::createActorStage(
|
||||
}
|
||||
|
||||
// 8002db80
|
||||
void *dAcBase_c::getCurrentEventActor() {}
|
||||
void dAcBase_c::registerInEvent() {}
|
||||
|
||||
// 8002db90
|
||||
void dAcBase_c::unkVirtFunc_0x6C() {}
|
||||
|
||||
+5
-14
@@ -10,20 +10,11 @@
|
||||
#include "d/col/bg/d_bg_w_base.h"
|
||||
#include "d/col/c/c_cc_d.h"
|
||||
#include "d/col/c/c_m3d_g_pla.h"
|
||||
#include "egg/math/eggMath.h"
|
||||
#include "m/m_angle.h"
|
||||
#include "m/m_mtx.h"
|
||||
#include "m/m_vec.h"
|
||||
#include "rvl/MTX/mtxvec.h"
|
||||
#include "toBeSorted/attention.h"
|
||||
|
||||
#include <cmath.h>
|
||||
|
||||
// Very Hack ??
|
||||
static inline bool IsZero(f32 in) {
|
||||
return in <= EGG::Math<f32>::epsilon();
|
||||
}
|
||||
|
||||
extern "C" void fn_800298B0(u16, mVec3_c *, mVec3_c *, u32, u32, u32, u32, u32);
|
||||
extern "C" u16 PARTICLE_RESOURCE_ID_MAPPING_394_;
|
||||
|
||||
@@ -179,10 +170,10 @@ bool dAcOInsect_c::checkDeath(cCcD_Obj &col) {
|
||||
}
|
||||
|
||||
if (col.ChkTgHit() &&
|
||||
(col.ChkTgAtHitType(AT_TYPE_0x2) || col.ChkTgAtHitType(AT_TYPE_0x8) || col.ChkTgAtHitType(AT_TYPE_0x20) ||
|
||||
col.ChkTgAtHitType(AT_TYPE_0x40) || col.ChkTgAtHitType(AT_TYPE_0x80) || col.ChkTgAtHitType(AT_TYPE_0x2000) ||
|
||||
col.ChkTgAtHitType(AT_TYPE_0x4000) || col.ChkTgAtHitType(AT_TYPE_0x800000) ||
|
||||
col.ChkTgAtHitType(AT_TYPE_0x800))) {
|
||||
(col.ChkTgAtHitType(AT_TYPE_SWORD) || col.ChkTgAtHitType(AT_TYPE_PHYSICS) || col.ChkTgAtHitType(AT_TYPE_BOMB) ||
|
||||
col.ChkTgAtHitType(AT_TYPE_0x40) || col.ChkTgAtHitType(AT_TYPE_SLINGSHOT) ||
|
||||
col.ChkTgAtHitType(AT_TYPE_ARROW) || col.ChkTgAtHitType(AT_TYPE_CLAWSHOT) ||
|
||||
col.ChkTgAtHitType(AT_TYPE_0x800000) || col.ChkTgAtHitType(AT_TYPE_WHIP))) {
|
||||
mLinkNearby = 0;
|
||||
return true;
|
||||
}
|
||||
@@ -212,7 +203,7 @@ bool dAcOInsect_c::fn_8018FAA0() {
|
||||
|
||||
bool dAcOInsect_c::fn_8018FAD0() {
|
||||
f32 speed = fabsf(forwardSpeed);
|
||||
if (IsZero(speed)) {
|
||||
if (cM::isLessThanZero(speed)) {
|
||||
fn_8018FDF0(mPlane_0x3A8.GetN());
|
||||
return true;
|
||||
} else {
|
||||
|
||||
@@ -16,8 +16,11 @@ STATE_DEFINE(dAcArrow_c, Bound);
|
||||
|
||||
cCcD_SrcGObj dAcArrow_c::sCcSrcInf = {
|
||||
|
||||
{0x2000, 0x8BB, 0x15000000, 0, 0, 0, 0, 0, 0},
|
||||
{0xFEB75C7F, 0x210, 0, 0x407, 0, 0},
|
||||
{AT_TYPE_ARROW, 0x8BB, {0x15,0, 0}, 0, 0, 0, 0, 0, 0},
|
||||
{
|
||||
~(AT_TYPE_BUGNET | AT_TYPE_BEETLE | AT_TYPE_0x80000 | AT_TYPE_0x8000 | AT_TYPE_ARROW | AT_TYPE_0x100 | AT_TYPE_WIND | AT_TYPE_SLINGSHOT),
|
||||
0x210, 0, 0x407, 0, 0
|
||||
},
|
||||
{0},
|
||||
};
|
||||
|
||||
@@ -28,7 +31,7 @@ dCcD_SrcCps dAcArrow_c::sCc1 = {
|
||||
|
||||
const dCcD_SrcSph dAcArrow_c::sCc2 = {
|
||||
{{0x0, 0x0, 0x0, 0, 0, 0, 0, 0, 0},
|
||||
{0x2, 0x211, 0, 0x407, 0, 0},
|
||||
{AT_TYPE_SWORD, 0x211, 0, 0x407, 0, 0},
|
||||
{0xC28}},
|
||||
{100.0f},
|
||||
};
|
||||
|
||||
@@ -96,7 +96,7 @@ void dAcObjFairy_c::executeState_CatchDemo() {
|
||||
}
|
||||
void dAcObjFairy_c::finalizeState_CatchDemo() {
|
||||
field_0xB89 = 0;
|
||||
mObjectActorFlags &= ~0x00000200;
|
||||
clearObjectProperty(0x200);
|
||||
}
|
||||
|
||||
bool dAcObjFairy_c::shouldAvoidLink() const {
|
||||
|
||||
@@ -58,7 +58,7 @@ void dAcOsw_c::rideCallback(dBgW *unknown, dAcObjBase_c *actor, dAcObjBase_c *in
|
||||
}
|
||||
}
|
||||
}
|
||||
interactor->mObjectActorFlags |= 0x40;
|
||||
interactor->setObjectProperty(0x40);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -58,8 +58,8 @@ void dBgS_ObjGndChk::ClearInstance() {
|
||||
sInstance.ClearPi();
|
||||
}
|
||||
|
||||
bool dBgS_ObjGndChk::CheckPos(const mVec3_c *pPos) {
|
||||
sInstance.SetPos(pPos);
|
||||
bool dBgS_ObjGndChk::CheckPos(const mVec3_c &pPos) {
|
||||
sInstance.SetPos(&pPos);
|
||||
sGroundHeight = dBgS::GetInstance()->GroundCross(&sInstance);
|
||||
return sGroundHeight != -1e9f;
|
||||
}
|
||||
|
||||
+7
-10
@@ -1,5 +1,6 @@
|
||||
#include "d/col/c/c_cc_d.h"
|
||||
|
||||
#include "c/c_math.h"
|
||||
#include "common.h"
|
||||
#include "d/a/obj/d_a_obj_base.h"
|
||||
#include "d/col/c/c_m3d.h"
|
||||
@@ -16,10 +17,6 @@
|
||||
#include "rvl/MTX.h" // IWYU pragma: export
|
||||
#include "s/s_Math.h"
|
||||
|
||||
// Very Hack ??
|
||||
static inline bool IsZero(f32 in) {
|
||||
return fabsf(in) <= EGG::Math<f32>::epsilon();
|
||||
}
|
||||
static inline void MtxTransMinusXYZ(mMtx_c &mtx, f32 x, f32 y, f32 z) {
|
||||
PSMTXTrans(mtx, -x, -y, -z);
|
||||
}
|
||||
@@ -441,7 +438,7 @@ bool cCcD_Obj::ChkTgAtHitType(u32 mask) const {
|
||||
return mTg.mAtHitSrc.mType & mask;
|
||||
}
|
||||
|
||||
u32 cCcD_Obj::GetTg_0x58() const {
|
||||
u32 cCcD_Obj::GetTgAtHitType() const {
|
||||
return mTg.mAtHitSrc.mType;
|
||||
}
|
||||
|
||||
@@ -508,8 +505,8 @@ dAcObjBase_c *cCcD_Obj::GetTgActor() {
|
||||
return mTg.GetActor();
|
||||
}
|
||||
|
||||
const mVec3_c &cCcD_Obj::GetTg_0x2C() const {
|
||||
return mTg.mField_0x2C;
|
||||
const mVec3_c &cCcD_Obj::GetTgAtHitDir() const {
|
||||
return mTg.mAtHitDir;
|
||||
}
|
||||
|
||||
dAcObjBase_c *cCcD_Obj::GetCoActor() {
|
||||
@@ -612,7 +609,7 @@ bool cCcD_TriAttr::Calc(const mVec3_c &start, const mVec3_c &end, mVec3_c *pOut)
|
||||
}
|
||||
mVec3_c tmp2 = tmp1 - tmp0;
|
||||
f32 mag = tmp2.squaredLength();
|
||||
if (IsZero(mag)) {
|
||||
if (cM::isZero(mag)) {
|
||||
bVar1 = true;
|
||||
} else {
|
||||
mag = tmp2.dot(*pOut - tmp0) / mag;
|
||||
@@ -978,7 +975,7 @@ bool cCcD_CpsAttr::Calc(const mVec3_c &start, const mVec3_c &end, mVec3_c *pOut)
|
||||
bool bInverse;
|
||||
|
||||
f32 dist = EGG::Math<f32>::sqrt(tmp0.x * tmp0.x + tmp0.z * tmp0.z);
|
||||
if (IsZero(dist)) {
|
||||
if (cM::isZero(dist)) {
|
||||
tmp1 = start;
|
||||
tmp2 = end;
|
||||
if (endRef.y > startRef.y) {
|
||||
@@ -1308,7 +1305,7 @@ void cCcD_SphAttr::Set(const cCcD_SrcSphAttr &src) {
|
||||
a.z = 0.0f;
|
||||
a.y = 0.0f;
|
||||
a.x = 0.0f;
|
||||
SetC(&a);
|
||||
SetC(a);
|
||||
}
|
||||
|
||||
mVec3_c &cCcD_SphAttr::GetCoP() {
|
||||
|
||||
@@ -6,12 +6,12 @@ cM3dGSph::cM3dGSph() {
|
||||
mRatio = 1.0f;
|
||||
}
|
||||
|
||||
void cM3dGSph::SetC(const mVec3_c *c) {
|
||||
mCenter = *c;
|
||||
void cM3dGSph::SetC(const mVec3_c &c) {
|
||||
mCenter = c;
|
||||
}
|
||||
|
||||
void cM3dGSph::Set(const mVec3_c *c, f32 r) {
|
||||
SetC(c);
|
||||
SetC(*c);
|
||||
SetR(r);
|
||||
}
|
||||
|
||||
@@ -24,7 +24,7 @@ void cM3dGSph::SetR(f32 r) {
|
||||
|
||||
void cM3dGSph::SetC(f32 x, f32 y, f32 z) {
|
||||
mVec3_c c(x, y, z);
|
||||
SetC(&c);
|
||||
SetC(c);
|
||||
}
|
||||
|
||||
bool cM3dGSph::Cross(cM3dGUnk &pUnk, mVec3_c *pOut) {
|
||||
|
||||
@@ -62,17 +62,17 @@ void dCcD_Sph::Set(const dCcD_SrcSph &src) {
|
||||
|
||||
void dCcD_Sph::setCenter(const mVec3_c &c) {
|
||||
SetAtVec(mVec3_c::Zero);
|
||||
SetC(&c);
|
||||
SetC(c);
|
||||
}
|
||||
|
||||
void dCcD_Sph::moveCenter(const mVec3_c &c) {
|
||||
SetAtVec(c - GetC());
|
||||
SetC(&c);
|
||||
SetC(c);
|
||||
}
|
||||
|
||||
void dCcD_Sph::setCenterAndAtVec(const mVec3_c &a, const mVec3_c &b) {
|
||||
SetAtVec(b);
|
||||
SetC(&a);
|
||||
SetC(a);
|
||||
}
|
||||
|
||||
cCcD_ShapeAttr *dCcD_Sph::GetShapeAttr() {
|
||||
|
||||
@@ -5,7 +5,6 @@
|
||||
#include "toBeSorted/event.h"
|
||||
#include "toBeSorted/scgame.h"
|
||||
|
||||
|
||||
SPECIAL_ACTOR_PROFILE(SW_TAG, dTgSw_c, fProfile::SW_TAG, 0x24, 0, 0);
|
||||
|
||||
STATE_DEFINE(dTgSw_c, OnWait);
|
||||
|
||||
Reference in New Issue
Block a user