d_a_syan OK

This commit is contained in:
LagoLunatic
2025-04-25 19:44:25 -04:00
parent b0874059dd
commit daf1badf85
2 changed files with 16 additions and 17 deletions
+1 -1
View File
@@ -1501,7 +1501,7 @@ config.libs = [
ActorRel(NonMatching, "d_a_sitem"),
ActorRel(NonMatching, "d_a_ss"),
ActorRel(NonMatching, "d_a_sss"),
ActorRel(NonMatching, "d_a_syan"),
ActorRel(Matching, "d_a_syan", extra_cflags=['-pragma "nosyminline on"']),
ActorRel(NonMatching, "d_a_tag_md_cb"),
ActorRel(NonMatching, "d_a_tag_mk"),
ActorRel(Matching, "d_a_tag_so"),
+15 -16
View File
@@ -10,6 +10,7 @@
#include "d/d_s_play.h"
#include "d/res/res_syan.h"
#include "weak_bss_936_to_1036.h" // IWYU pragma: keep
#include "weak_data_1811.h" // IWYU pragma: keep
static f32 b_pos_x[6] = { 870.0f, 420.0f, -420.0f, -880.0f, -400.0f, 440.0f };
@@ -80,7 +81,6 @@ static BOOL daSyan_Draw(syan_class* i_this) {
/* 000004AC-00000CA0 .text daSyan_Execute__FP10syan_class */
static BOOL daSyan_Execute(syan_class* i_this) {
/* Nonmatching */
for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->timer); i++)
if (i_this->timer[i] != 0)
i_this->timer[i]--;
@@ -91,8 +91,8 @@ static BOOL daSyan_Execute(syan_class* i_this) {
i_this->field_0x2c8 += i_this->field_0x2d0;
i_this->field_0x2a4[0].x = i_this->field_0x2bc * cM_ssin(i_this->field_0x2c4);
i_this->field_0x2a4[1].x = i_this->field_0x2c0 * cM_ssin(i_this->field_0x2c8);
i_this->field_0x2b0.y = i_this->field_0x2b8 * cM_ssin(i_this->frameCount * (REG0_S(8) + 800));
i_this->field_0x2b0.z = i_this->field_0x2b8 * cM_ssin(i_this->frameCount * (REG0_S(9) + 700));
i_this->field_0x2b0.y = i_this->field_0x2b8 * cM_ssin((s16)i_this->frameCount * (REG0_S(8) + 800));
i_this->field_0x2b0.z = i_this->field_0x2b8 * cM_ssin((s16)i_this->frameCount * (REG0_S(9) + 700));
switch (i_this->state) {
case 0:
@@ -135,7 +135,7 @@ static BOOL daSyan_Execute(syan_class* i_this) {
cLib_addCalc2(&i_this->partScale1[i], i_this->field_0x55c[i], 0.4f, 0.04f);
i_this->partRotY[i] += 0x100;
if (i_this->field_0x5a4[i] == 0) {
cLib_addCalc2(&i_this->partScale2[i], REG0_F(0) + 0.75f, 0.5f, 0.05f);
cLib_addCalc2(&i_this->partScale2[i], REG0_F(9) + 0.75f, 0.5f, 0.05f);
if (!i_this->emtrEnabled[i]) {
i_this->emtrEnabled[i] = true;
static cXyz fire_scale(0.7f, 0.7f, 0.7f);
@@ -143,22 +143,23 @@ static BOOL daSyan_Execute(syan_class* i_this) {
} else {
JPABaseEmitter* emtr = i_this->emtrCallBack[i].getEmitter();
if (emtr != NULL) {
f32 dirX = (REG0_F(3) + -0.03f) * (i_this->partPos[i].x - i_this->partPosOld[i].x);
if (dirX > 1.0f) dirX = 1.0f;
else if (dirX < -1.0f) dirX = -1.0f;
f32 dirZ = (REG0_F(3) + -0.03f) * (i_this->partPos[i].z - i_this->partPosOld[i].z);
if (dirZ > 1.0f) dirZ = 1.0f;
else if (dirZ < -1.0f) dirZ = -1.0f;
JGeometry::TVec3<f32> dir;
dir.x = (REG0_F(3) + -0.03f) * (i_this->partPos[i].x - i_this->partPosOld[i].x);
if (dir.x > 1.0f) dir.x = 1.0f;
else if (dir.x < -1.0f) dir.x = -1.0f;
dir.z = (REG0_F(3) + -0.03f) * (i_this->partPos[i].z - i_this->partPosOld[i].z);
if (dir.z > 1.0f) dir.z = 1.0f;
else if (dir.z < -1.0f) dir.z = -1.0f;
cXyz dir(dirZ, 0.1f, dirZ);
dir.y = 0.1f;
emtr->setDirection(dir);
f32 dirMag = std::sqrtf(dirX*dirX + dirZ*dirZ);
f32 dirMag = std::sqrtf(dir.x*dir.x + dir.z*dir.z);
f32 scaleY = (REG0_F(12) + 2.0f) * dirMag + 1.0f;
if (scaleY > REG0_F(13) + 4.0f)
scaleY = REG0_F(13) + 4.0f;
cXyz scale(1.0f, scaleY, 1.0f);
JGeometry::TVec3<f32> scale(1.0f, scaleY, 1.0f);
i_this->emtrCallBack[i].getEmitter()->setGlobalParticleScale(scale);
cXyz pos(i_this->partPos[i].x, i_this->partPos[i].y + REG0_F(7) + 20.0f, i_this->partPos[i].z);
@@ -185,10 +186,9 @@ static BOOL daSyan_IsDelete(syan_class* i_this) {
/* 00000CA8-00000D1C .text daSyan_Delete__FP10syan_class */
static BOOL daSyan_Delete(syan_class* i_this) {
/* Nonmatching */
dComIfG_resDelete(&i_this->mPhs, "Syan");
for (s32 i = 0; i < (s32)ARRAY_SIZE(i_this->emtrCallBack); i++)
i_this->emtrCallBack[i].~dPa_followEcallBack();
i_this->emtrCallBack[i].end();
return TRUE;
}
@@ -206,7 +206,6 @@ static BOOL daSyan_solidHeapCB(fopAc_ac_c* i_ac) {
/* 00000E10-00000FE0 .text daSyan_Create__FP10fopAc_ac_c */
static cPhs_State daSyan_Create(fopAc_ac_c* i_ac) {
/* Nonmatching */
fopAcM_SetupActor(i_ac, syan_class);
syan_class* i_this = (syan_class*)i_ac;
cPhs_State rt = dComIfG_resLoad(&i_this->mPhs, "Syan");