summaryrefslogtreecommitdiff
path: root/src/d
diff options
context:
space:
mode:
authorLagoLunatic <LagoLunatic@users.noreply.github.com>2025-09-08 17:47:54 -0400
committerLagoLunatic <LagoLunatic@users.noreply.github.com>2025-09-08 17:47:54 -0400
commitc3fdf89c3abd7e85da56edb2b0e8ee3b775131ca (patch)
tree1be6e553f1523a08d4b7e6577f4066a1bf6362e4 /src/d
parenteb3b4ea2b6868ef8aa2ac6ce57fbbaec44cadf22 (diff)
d_a_arrow OK for demo
Diffstat (limited to 'src/d')
-rw-r--r--src/d/actor/d_a_arrow.cpp66
-rw-r--r--src/d/actor/d_a_arrow_lighteff.cpp8
2 files changed, 50 insertions, 24 deletions
diff --git a/src/d/actor/d_a_arrow.cpp b/src/d/actor/d_a_arrow.cpp
index b2f9cfb8..6d156801 100644
--- a/src/d/actor/d_a_arrow.cpp
+++ b/src/d/actor/d_a_arrow.cpp
@@ -177,11 +177,12 @@ void daArrow_c::setBlur() {
if (!blurEmitter) {
return;
}
- s32 alpha = blurEmitter->getGlobalAlpha();
- if (alpha - 50 <= 0) {
+ int alpha = blurEmitter->getGlobalAlpha();
+ alpha -= 50;
+ if (alpha <= 0) {
mBlurFollowCb.remove();
} else {
- blurEmitter->setGlobalAlpha(alpha - 50);
+ blurEmitter->setGlobalAlpha(alpha);
}
mDoMtx_stack_c::transS(current.pos);
@@ -383,7 +384,10 @@ bool daArrow_c::check_water_in() {
if (mArrowType == TYPE_FIRE) {
mInWaterTimer = 1;
dComIfGp_particle_setP1(dPa_name::ID_COMMON_035A, &waterHitPos);
- if (!field_0x6e4) {
+#if VERSION > VERSION_DEMO
+ if (!field_0x6e4)
+#endif
+ {
dKy_arrowcol_chg_on(&current.pos, 0);
}
} else if (mArrowType == TYPE_ICE) {
@@ -392,13 +396,19 @@ bool daArrow_c::check_water_in() {
PROC_ARROW_ICEEFF, fopAcM_GetID(this), mArrowType,
&waterHitPos, current.roomNo, &current.angle
);
- if (!field_0x6e4) {
+#if VERSION > VERSION_DEMO
+ if (!field_0x6e4)
+#endif
+ {
dKy_arrowcol_chg_on(&current.pos, 1);
}
} else if (mArrowType == TYPE_LIGHT) {
dComIfGp_particle_setP1(dPa_name::ID_COMMON_02A1, &waterHitPos);
fopAcM_seStartCurrent(this, JA_SE_OBJ_LIGHT_ARW_EFF, 0);
- if (!field_0x6e4) {
+#if VERSION > VERSION_DEMO
+ if (!field_0x6e4)
+#endif
+ {
dKy_arrowcol_chg_on(&current.pos, 2);
}
mInWaterTimer = 1;
@@ -451,7 +461,7 @@ daArrow_c* daArrow_c::changeArrowType() {
if (mArrowType != origArrowType) {
m_keep_type = mArrowType;
- daArrow_c* newNockedArrow = (daArrow_c*)fopAcM_fastCreate(PROC_ARROW, 0, &current.pos, current.roomNo);
+ daArrow_c* newNockedArrow = (daArrow_c*)fopAcM_fastCreate(PROC_ARROW, 0, &current.pos, fopAcM_GetRoomNo(this));
if (!newNockedArrow) {
mArrowType = origArrowType;
m_keep_type = origArrowType;
@@ -522,12 +532,10 @@ void daArrow_c::setKeepMatrix() {
mDoMtx_stack_c::transS(0.7f, -0.07f, -0.2f);
mDoMtx_stack_c::XYZrotM(0x238E, 0x2CDF, 0x29BE);
mDoMtx_stack_c::revConcat(zelda->getRightHandMatrix());
- mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
-
MtxP mtx = mDoMtx_stack_c::get();
+ mpModel->setBaseTRMtx(mtx);
current.pos.set(mtx[0][3], mtx[1][3], mtx[2][3]);
-
- mDoMtx_MtxToRot(mDoMtx_stack_c::get(), &shape_angle);
+ mDoMtx_MtxToRot(mtx, &shape_angle);
current.angle.y = shape_angle.y;
current.angle.x = -shape_angle.x;
} else {
@@ -539,12 +547,10 @@ void daArrow_c::setKeepMatrix() {
// Z rotation must be an int literal to pass a signed short as normal.
mDoMtx_stack_c::XYZrotM((248.5f*65536)/360, 0x238E, -0x6333);
mDoMtx_stack_c::revConcat(player->getLeftHandMatrix());
- mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
-
MtxP mtx = mDoMtx_stack_c::get();
+ mpModel->setBaseTRMtx(mtx);
current.pos.set(mtx[0][3], mtx[1][3], mtx[2][3]);
-
- mDoMtx_MtxToRot(mDoMtx_stack_c::get(), &shape_angle);
+ mDoMtx_MtxToRot(mtx, &shape_angle);
current.angle.y = shape_angle.y;
current.angle.x = -shape_angle.x;
}
@@ -655,7 +661,10 @@ BOOL daArrow_c::procMove() {
field_0x6a8 = hitPos;
current.pos = hitPos - (speed * 0.25f);
- if (!field_0x6e4) {
+ #if VERSION > VERSION_DEMO
+ if (!field_0x6e4)
+ #endif
+ {
dKy_arrowcol_chg_on(&current.pos, 2);
}
@@ -664,7 +673,7 @@ BOOL daArrow_c::procMove() {
fopAcM_SetParam(this, 2);
field_0x604 = 0x28;
- dComIfG_Bgsp()->GetTriPla(mLinChk);
+ dComIfG_Bgsp()->GetTriPla(mLinChk.GetBgIndex(), mLinChk.GetPolyIndex());
csXyz temp10;
temp10.x = cM_atan2s(speed.y, speed.absXZ());
@@ -736,9 +745,8 @@ BOOL daArrow_c::procMove() {
setStopActorMatrix();
}
} else if (dComIfG_Bgsp()->LineCross(&mLinChk)) {
- cXyz* linEnd = mLinChk.GetLinP()->GetEndP();
- field_0x6a8 = *linEnd;
- current.pos = *linEnd - (speed * 0.25f);
+ field_0x6a8 = *mLinChk.GetCrossP();
+ current.pos = *mLinChk.GetCrossP() - (speed * 0.25f);
if (!check_water_in()) {
s32 temp8;
@@ -756,7 +764,12 @@ BOOL daArrow_c::procMove() {
temp8 = -1;
}
- if (temp8 >= 0 && !field_0x6e4) {
+ if (
+ temp8 >= 0
+#if VERSION > VERSION_DEMO
+ && !field_0x6e4
+#endif
+ ) {
dKy_arrowcol_chg_on(&current.pos, temp8);
}
@@ -915,8 +928,7 @@ BOOL daArrow_c::procStop_BG() {
if (field_0x604 > 0) {
field_0x604--;
- f32 temp4 = (field_0x604*(1/40.0f)) * 1024.0f * (field_0x604*(1/40.0f)) * cM_ssin(field_0x604*0x52FB);
- shape_angle.x = field_0x6e6.x + temp4;
+ shape_angle.x = field_0x6e6.x + cM_ssin(field_0x604*0x52FB) * ((field_0x604*(1/40.0f)) * 1024.0f * (field_0x604*(1/40.0f)));
shape_angle.y = field_0x6e6.y;
temp2 = TRUE;
} else if (field_0x600) {
@@ -971,10 +983,12 @@ BOOL daArrow_c::procStop_BG() {
return TRUE;
}
}
-
+
+#if VERSION > VERSION_DEMO
if (mbSetByZelda) {
field_0x600 = true;
}
+#endif
return TRUE;
}
@@ -1072,13 +1086,16 @@ BOOL daArrow_c::createInit() {
field_0x6e4 = false;
mbHasLightEff = false;
mbLinkReflect = false;
+#if VERSION > VERSION_DEMO
field_0x604 = 0;
+#endif
return TRUE;
}
/* 800D74FC-800D7820 .text _execute__9daArrow_cFv */
BOOL daArrow_c::_execute() {
+#if VERSION > VERSION_DEMO
if (mbSetByZelda) {
if (!mbLinkReflect) {
if (daPy_getPlayerLinkActorClass()->checkPlayerGuard()) {
@@ -1134,6 +1151,7 @@ BOOL daArrow_c::_execute() {
return TRUE;
}
}
+#endif
if (field_0x602 == m_count) {
field_0x600 = true;
diff --git a/src/d/actor/d_a_arrow_lighteff.cpp b/src/d/actor/d_a_arrow_lighteff.cpp
index cfc94d24..4b0046bf 100644
--- a/src/d/actor/d_a_arrow_lighteff.cpp
+++ b/src/d/actor/d_a_arrow_lighteff.cpp
@@ -235,9 +235,13 @@ static BOOL daArrow_Lighteff_Delete(void* i_this) {
}
bool daArrow_Lighteff_c::_draw() {
+#if VERSION == VERSION_DEMO
+ if(field_0x2E9 != 0) {
+#else
if(field_0x2E9 == 0) {
return true;
}
+#endif
J3DModelData* modelData = field_0x298->getModelData();
if(mDoGph_gInf_c::isMonotone()) {
@@ -255,6 +259,10 @@ bool daArrow_Lighteff_c::_draw() {
dComIfGd_setList();
+#if VERSION == VERSION_DEMO
+ }
+#endif
+
return true;
}