mirror of
https://github.com/TwilitRealm/dusklight
synced 2026-07-30 07:34:37 -04:00
d_ky_thunder done / d_scope wip / m_Do_graphic wip (#308)
* d_ky_thunder OK + misc build fixes * d_scope mostly done * some m_Do_graphic wip * remove asm
This commit is contained in:
+237
-286
@@ -1,342 +1,293 @@
|
||||
//
|
||||
// Generated By: dol2asm
|
||||
// Translation Unit: d/d_ky_thunder
|
||||
//
|
||||
/**
|
||||
* d_ky_thunder.cpp
|
||||
* Environment - Thunder
|
||||
*/
|
||||
|
||||
#include "d/d_ky_thunder.h"
|
||||
#include "dol2asm.h"
|
||||
#include "dolphin/types.h"
|
||||
#include "JSystem/JMath/JMath.h"
|
||||
#include "SSystem/SComponent/c_counter.h"
|
||||
#include "SSystem/SComponent/c_math.h"
|
||||
#include "d/com/d_com_inf_game.h"
|
||||
#include "d/kankyo/d_kankyo_rain.h"
|
||||
|
||||
//
|
||||
// Types:
|
||||
//
|
||||
|
||||
struct kankyo_class {};
|
||||
|
||||
|
||||
|
||||
struct dRes_info_c {};
|
||||
|
||||
struct dRes_control_c {
|
||||
/* 8003C2EC */ void getRes(char const*, s32, dRes_info_c*, int);
|
||||
};
|
||||
|
||||
//
|
||||
// Forward References:
|
||||
//
|
||||
|
||||
extern "C" void createHeap__10dThunder_cFv();
|
||||
extern "C" void adjustHeap__10dThunder_cFv();
|
||||
extern "C" static void dThunder_Draw__FP10dThunder_c();
|
||||
extern "C" static void dThunder_Execute__FP10dThunder_c();
|
||||
extern "C" static bool dThunder_IsDelete__FP10dThunder_c();
|
||||
extern "C" static void dThunder_Delete__FP10dThunder_c();
|
||||
extern "C" static void dThunder_Create__FP12kankyo_class();
|
||||
extern "C" void create__10dThunder_cFv();
|
||||
extern "C" extern char const* const d_d_ky_thunder__stringBase0;
|
||||
extern "C" extern void* g_profile_KY_THUNDER[10 + 1 /* padding */];
|
||||
|
||||
//
|
||||
// External References:
|
||||
//
|
||||
|
||||
extern "C" void __dt__4cXyzFv();
|
||||
extern "C" void mDoMtx_XrotM__FPA4_fs();
|
||||
extern "C" void mDoMtx_YrotM__FPA4_fs();
|
||||
extern "C" void mDoMtx_ZrotM__FPA4_fs();
|
||||
extern "C" void play__14mDoExt_baseAnmFv();
|
||||
extern "C" void init__13mDoExt_brkAnmFP16J3DMaterialTableP15J3DAnmTevRegKeyiifss();
|
||||
extern "C" void entry__13mDoExt_brkAnmFP16J3DMaterialTablef();
|
||||
extern "C" void mDoExt_modelUpdateDL__FP8J3DModel();
|
||||
extern "C" void mDoExt_createSolidHeapFromGameToCurrent__FUlUl();
|
||||
extern "C" void mDoExt_adjustSolidHeap__FP12JKRSolidHeap();
|
||||
extern "C" void mDoExt_destroySolidHeap__FP12JKRSolidHeap();
|
||||
extern "C" void mDoExt_restoreCurrentHeap__Fv();
|
||||
extern "C" void mDoExt_J3DModel__create__FP12J3DModelDataUlUl();
|
||||
extern "C" void fopKyM_Delete__FPv();
|
||||
extern "C" void getRes__14dRes_control_cFPCclP11dRes_info_ci();
|
||||
extern "C" void dKyr_get_vectle_calc__FP4cXyzP4cXyzP4cXyz();
|
||||
extern "C" void cM_atan2s__Fff();
|
||||
extern "C" void cM_rndF__Ff();
|
||||
extern "C" void cM_rndFX__Ff();
|
||||
extern "C" void cLib_addCalc__FPfffff();
|
||||
extern "C" void cLib_targetAngleY__FPC3VecPC3Vec();
|
||||
extern "C" void startFarThunderSe__10Z2EnvSeMgrFP3VecSc();
|
||||
extern "C" void init__12J3DFrameCtrlFs();
|
||||
extern "C" void removeTevRegAnimator__16J3DMaterialTableFP15J3DAnmTevRegKey();
|
||||
extern "C" void __register_global_object();
|
||||
extern "C" void _savegpr_27();
|
||||
extern "C" void _restgpr_27();
|
||||
extern "C" void strcmp();
|
||||
extern "C" extern void* __vt__12J3DFrameCtrl[3];
|
||||
extern "C" extern void* g_fopKy_Method[5 + 1 /* padding */];
|
||||
extern "C" extern void* g_fpcLf_Method[5 + 1 /* padding */];
|
||||
extern "C" u8 now__14mDoMtx_stack_c[48];
|
||||
extern "C" extern u8 g_dComIfG_gameInfo[122384];
|
||||
extern "C" extern u8 g_env_light[4880];
|
||||
extern "C" extern u8 g_Counter[12 + 4 /* padding */];
|
||||
extern "C" u8 sincosTable___5JMath[65536];
|
||||
extern "C" extern u8 mStayNo__20dStage_roomControl_c[4];
|
||||
extern "C" extern u8 struct_80451070[8];
|
||||
|
||||
//
|
||||
// Declarations:
|
||||
//
|
||||
#define EF_THUNDER01_BMD 0x1E
|
||||
#define EF_THUNDER02_BMD 0x1F
|
||||
#define EF_THUNDER_BRK 0x2F
|
||||
|
||||
/* 801ADF58-801ADFB4 1A8898 005C+00 1/1 0/0 0/0 .text createHeap__10dThunder_cFv */
|
||||
int dThunder_c::createHeap() {
|
||||
if (!mpHeap) {
|
||||
mpHeap = mDoExt_createSolidHeapFromGameToCurrent(0,0x20);
|
||||
if (!mpHeap) {
|
||||
if (mpHeap == NULL) {
|
||||
mpHeap = mDoExt_createSolidHeapFromGameToCurrent(0, 0x20);
|
||||
|
||||
if (mpHeap == NULL) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 801ADFB4-801AE000 1A88F4 004C+00 1/1 0/0 0/0 .text adjustHeap__10dThunder_cFv */
|
||||
void dThunder_c::adjustHeap() {
|
||||
mDoExt_restoreCurrentHeap();
|
||||
|
||||
if ((s32)mDoExt_adjustSolidHeap(mpHeap) >= 0) {
|
||||
DCStoreRangeNoSync(mpHeap->getStartAddr(),mpHeap->getHeapSize());
|
||||
DCStoreRangeNoSync(mpHeap->getStartAddr(), mpHeap->getHeapSize());
|
||||
}
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 8042E7F0-8042E7FC 05B510 000C+00 1/1 0/0 0/0 .bss @3816 */
|
||||
static u8 lit_3816[12];
|
||||
int dThunder_c::draw() {
|
||||
static cXyz l_offsetPos(0.0f, 40.0f, -250.0f);
|
||||
static cXyz l_scale(1.0f, 1.0f, 1.0f);
|
||||
|
||||
/* 8042E7FC-8042E808 05B51C 000C+00 1/1 0/0 0/0 .bss @3818 */
|
||||
static u8 lit_3818[12];
|
||||
camera_class* camera_p = dComIfGp_getCamera(0);
|
||||
|
||||
/* 8042E808-8042E814 05B528 000C+00 1/1 0/0 0/0 .bss l_offsetPos$localstatic3$draw__10dThunder_cFv
|
||||
*/
|
||||
static f32 data_8042E808[3];
|
||||
mDoMtx_stack_c::transS(mThunderPos.x, mThunderPos.y, mThunderPos.z);
|
||||
mDoMtx_stack_c::YrotM(field_0x168);
|
||||
mDoMtx_stack_c::ZrotM(field_0x15c);
|
||||
mDoMtx_stack_c::XrotM(field_0x15c);
|
||||
|
||||
/* 8042E814-8042E820 05B534 000C+00 1/1 0/0 0/0 .bss l_scale$localstatic5$draw__10dThunder_cFv */
|
||||
static f32 data_8042E814[3];
|
||||
Mtx m;
|
||||
PSMTXCopy(mDoMtx_stack_c::get(), m);
|
||||
|
||||
/* 80453E70-80453E74 002470 0004+00 2/2 0/0 0/0 .sdata2 @3882 */
|
||||
SECTION_SDATA2 static u8 lit_3882[4] = {
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
0x00,
|
||||
};
|
||||
mModelInfo.mpModel->setBaseScale(field_0x138);
|
||||
mModelInfo.mpModel->i_setBaseTRMtx(m);
|
||||
mModelInfo.mBrk.entry(mModelInfo.mpModel->getModelData());
|
||||
|
||||
/* 80453E74-80453E78 002474 0004+00 1/1 0/0 0/0 .sdata2 @3883 */
|
||||
SECTION_SDATA2 static f32 lit_3883 = 40.0f;
|
||||
|
||||
/* 80453E78-80453E7C 002478 0004+00 1/1 0/0 0/0 .sdata2 @3884 */
|
||||
SECTION_SDATA2 static f32 lit_3884 = -250.0f;
|
||||
|
||||
/* 80453E7C-80453E80 00247C 0004+00 3/3 0/0 0/0 .sdata2 @3885 */
|
||||
SECTION_SDATA2 static f32 lit_3885 = 1.0f;
|
||||
dComIfGd_setList();
|
||||
mDoExt_modelUpdateDL(mModelInfo.mpModel);
|
||||
mModelInfo.mBrk.remove(mModelInfo.mpModel->getModelData());
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 801AE000-801AE19C 1A8940 019C+00 1/0 0/0 0/0 .text dThunder_Draw__FP10dThunder_c */
|
||||
#ifdef NONMATCHING
|
||||
// needs to have inline defined
|
||||
void dThunder_Draw(dThunder_c* i_dthunderP) {
|
||||
i_dthunderP->draw();
|
||||
static int dThunder_Draw(dThunder_c* i_this) {
|
||||
return i_this->draw();
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm void dThunder_Draw(dThunder_c* param_0) {
|
||||
nofralloc
|
||||
#include "asm/d/d_ky_thunder/dThunder_Draw__FP10dThunder_c.s"
|
||||
|
||||
int dThunder_c::execute(dThunder_c* i_thunder) {
|
||||
dScnKy_env_light_c* env_light = i_dKy_getEnvlight();
|
||||
|
||||
if (env_light->mThunderEff.mStateTimer < 10) {
|
||||
cLib_addCalc(&mBrkSpeed, 0.1f, 0.05f, 0.017f, 9.999999747378752e-06f);
|
||||
}
|
||||
|
||||
mModelInfo.mBrk.setPlaySpeed(mBrkSpeed);
|
||||
if (mModelInfo.mBrk.play()) {
|
||||
mDoAud_mEnvSe_startFarThunderSe(&mThunderPos);
|
||||
fopKyM_Delete(i_thunder);
|
||||
}
|
||||
|
||||
f32 fvar7;
|
||||
if (dComIfGd_getView() != NULL) {
|
||||
fvar7 = dComIfGd_getView()->mFovy / 60.0f;
|
||||
if (fvar7 >= 1.0f) {
|
||||
fvar7 = 1.0f;
|
||||
}
|
||||
|
||||
fvar7 = fvar7 * fvar7 * fvar7;
|
||||
} else {
|
||||
fvar7 = 1.0f;
|
||||
}
|
||||
|
||||
fvar7 *= mBrkSpeed;
|
||||
|
||||
if (env_light->mThunderEff.mStateTimer < 10) {
|
||||
field_0x138.x += fvar7 * field_0x138.x * 0.01f * cM_ssin(field_0x16a);
|
||||
field_0x138.y += fvar7 * field_0x138.y * 0.01f * cM_scos(field_0x16c);
|
||||
field_0x16a += -25000;
|
||||
field_0x16c += 28900;
|
||||
} else {
|
||||
field_0x138.x += fvar7 * field_0x138.x * 0.02f * cM_ssin(field_0x16a);
|
||||
field_0x138.y += fvar7 * field_0x138.y * 0.02f * cM_scos(field_0x16c);
|
||||
field_0x16a += -35000;
|
||||
field_0x16c += 38900;
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80453E80-80453E84 002480 0004+00 2/2 0/0 0/0 .sdata2 @3923 */
|
||||
SECTION_SDATA2 static f32 lit_3923 = 1.0f / 10.0f;
|
||||
|
||||
/* 80453E84-80453E88 002484 0004+00 1/1 0/0 0/0 .sdata2 @3924 */
|
||||
SECTION_SDATA2 static f32 lit_3924 = 1.0f / 20.0f;
|
||||
|
||||
/* 80453E88-80453E8C 002488 0004+00 1/1 0/0 0/0 .sdata2 @3925 */
|
||||
SECTION_SDATA2 static f32 lit_3925 = 0.017000000923871994f;
|
||||
|
||||
/* 80453E8C-80453E90 00248C 0004+00 1/1 0/0 0/0 .sdata2 @3926 */
|
||||
SECTION_SDATA2 static f32 lit_3926 = 9.999999747378752e-06f;
|
||||
|
||||
/* 80453E90-80453E94 002490 0004+00 1/1 0/0 0/0 .sdata2 @3927 */
|
||||
SECTION_SDATA2 static f32 lit_3927 = 60.0f;
|
||||
|
||||
/* 80453E94-80453E98 002494 0004+00 1/1 0/0 0/0 .sdata2 @3928 */
|
||||
SECTION_SDATA2 static f32 lit_3928 = 1.0f / 100.0f;
|
||||
|
||||
/* 80453E98-80453E9C 002498 0004+00 1/1 0/0 0/0 .sdata2 @3929 */
|
||||
SECTION_SDATA2 static f32 lit_3929 = 1.0f / 50.0f;
|
||||
|
||||
/* 801AE19C-801AE374 1A8ADC 01D8+00 1/0 0/0 0/0 .text dThunder_Execute__FP10dThunder_c */
|
||||
#ifdef NONMATCHING
|
||||
// needs to have inline defined
|
||||
void dThunder_Execute(dThunder_c* i_dthunderP) {
|
||||
i_dthunderP->execute();
|
||||
static int dThunder_Execute(dThunder_c* i_this) {
|
||||
return i_this->execute(i_this);
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm void dThunder_Execute(dThunder_c* param_0) {
|
||||
nofralloc
|
||||
#include "asm/d/d_ky_thunder/dThunder_Execute__FP10dThunder_c.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 801AE374-801AE37C 1A8CB4 0008+00 1/0 0/0 0/0 .text dThunder_IsDelete__FP10dThunder_c
|
||||
*/
|
||||
static bool dThunder_IsDelete(dThunder_c* param_0) {
|
||||
return true;
|
||||
static int dThunder_IsDelete(dThunder_c* i_this) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int dThunder_c::thunder_delete(dThunder_c* i_thunder) {
|
||||
i_thunder->~dThunder_c();
|
||||
return 1;
|
||||
}
|
||||
|
||||
/* 801AE37C-801AE3FC 1A8CBC 0080+00 1/0 0/0 0/0 .text dThunder_Delete__FP10dThunder_c */
|
||||
#ifdef NONMATCHING
|
||||
// needs to have destructor defined
|
||||
void dThunder_Delete(dThunder_c* i_dthunderP) {
|
||||
thunder_delete(i_dthunderP);
|
||||
static int dThunder_Delete(dThunder_c* i_this) {
|
||||
return i_this->thunder_delete(i_this);
|
||||
}
|
||||
#else
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
static asm void dThunder_Delete(dThunder_c* param_0) {
|
||||
nofralloc
|
||||
#include "asm/d/d_ky_thunder/dThunder_Delete__FP10dThunder_c.s"
|
||||
}
|
||||
#pragma pop
|
||||
#endif
|
||||
|
||||
/* 801AE3FC-801AE458 1A8D3C 005C+00 1/0 0/0 0/0 .text dThunder_Create__FP12kankyo_class
|
||||
*/
|
||||
static int dThunder_Create(kankyo_class* param_0) {
|
||||
dThunder_c* thunder_ptr = (dThunder_c*)param_0;
|
||||
int ret;
|
||||
static int dThunder_Create(kankyo_class* i_this) {
|
||||
dThunder_c* this_ = (dThunder_c*)i_this;
|
||||
|
||||
if (thunder_ptr->createHeap() == 0) {
|
||||
return 5;
|
||||
} else {
|
||||
ret = thunder_ptr->create();
|
||||
thunder_ptr->adjustHeap();
|
||||
if (!this_->createHeap()) {
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
|
||||
int ret = this_->create();
|
||||
this_->adjustHeap();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 80394F40-80394F40 0215A0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
|
||||
#pragma push
|
||||
#pragma force_active on
|
||||
SECTION_DEAD static char const* const stringBase_80394F40 = "Always";
|
||||
SECTION_DEAD static char const* const stringBase_80394F47 = "R_SP30";
|
||||
/* @stringBase0 padding */
|
||||
SECTION_DEAD static char const* const pad_80394F4E = "\0";
|
||||
#pragma pop
|
||||
|
||||
/* 80453E9C-80453EA0 00249C 0004+00 1/1 0/0 0/0 .sdata2 @4079 */
|
||||
SECTION_SDATA2 static f32 lit_4079 = 0.5f;
|
||||
|
||||
/* 80453EA0-80453EA4 0024A0 0004+00 1/1 0/0 0/0 .sdata2 @4080 */
|
||||
SECTION_SDATA2 static f32 lit_4080 = 0.25f;
|
||||
|
||||
/* 80453EA4-80453EA8 0024A4 0004+00 1/1 0/0 0/0 .sdata2 @4081 */
|
||||
SECTION_SDATA2 static f32 lit_4081 = 14.0f;
|
||||
|
||||
/* 80453EA8-80453EAC 0024A8 0004+00 1/1 0/0 0/0 .sdata2 @4082 */
|
||||
SECTION_SDATA2 static f32 lit_4082 = 20.0f;
|
||||
|
||||
/* 80453EAC-80453EB0 0024AC 0004+00 1/1 0/0 0/0 .sdata2 @4083 */
|
||||
SECTION_SDATA2 static f32 lit_4083 = 60000.0f;
|
||||
|
||||
/* 80453EB0-80453EB4 0024B0 0004+00 1/1 0/0 0/0 .sdata2 @4084 */
|
||||
SECTION_SDATA2 static f32 lit_4084 = -5000.0f;
|
||||
|
||||
/* 80453EB4-80453EB8 0024B4 0004+00 1/1 0/0 0/0 .sdata2 @4085 */
|
||||
SECTION_SDATA2 static f32 lit_4085 = 2000.0f;
|
||||
|
||||
/* 80453EB8-80453EBC 0024B8 0004+00 1/1 0/0 0/0 .sdata2 @4086 */
|
||||
SECTION_SDATA2 static f32 lit_4086 = 24.0f;
|
||||
|
||||
/* 80453EBC-80453EC0 0024BC 0004+00 1/1 0/0 0/0 .sdata2 @4087 */
|
||||
SECTION_SDATA2 static f32 lit_4087 = 2500.0f;
|
||||
|
||||
/* 80453EC0-80453EC4 0024C0 0004+00 1/1 0/0 0/0 .sdata2 @4088 */
|
||||
SECTION_SDATA2 static f32 lit_4088 = 6000.0f;
|
||||
|
||||
/* 80453EC4-80453EC8 0024C4 0004+00 1/1 0/0 0/0 .sdata2 @4089 */
|
||||
SECTION_SDATA2 static f32 lit_4089 = 3.0f / 20.0f;
|
||||
|
||||
/* 80453EC8-80453ED0 0024C8 0004+04 1/1 0/0 0/0 .sdata2 @4090 */
|
||||
SECTION_SDATA2 static f32 lit_4090[1 + 1 /* padding */] = {
|
||||
1.0f / 5.0f,
|
||||
/* padding */
|
||||
0.0f,
|
||||
};
|
||||
|
||||
/* 80453ED0-80453ED8 0024D0 0008+00 1/1 0/0 0/0 .sdata2 @4091 */
|
||||
SECTION_SDATA2 static f64 lit_4091 = 0.5;
|
||||
|
||||
/* 80453ED8-80453EDC 0024D8 0004+00 1/1 0/0 0/0 .sdata2 @4092 */
|
||||
SECTION_SDATA2 static f32 lit_4092 = -1.0f;
|
||||
|
||||
/* 80453EDC-80453EE0 0024DC 0004+00 1/1 0/0 0/0 .sdata2 @4093 */
|
||||
SECTION_SDATA2 static f32 lit_4093 = 100000.0f;
|
||||
|
||||
/* 80453EE0-80453EE4 0024E0 0004+00 1/1 0/0 0/0 .sdata2 @4094 */
|
||||
SECTION_SDATA2 static f32 lit_4094 = 19635.0f;
|
||||
|
||||
/* 80453EE4-80453EE8 0024E4 0004+00 1/1 0/0 0/0 .sdata2 @4095 */
|
||||
SECTION_SDATA2 static f32 lit_4095 = 260.0f;
|
||||
|
||||
/* 80453EE8-80453EEC 0024E8 0004+00 1/1 0/0 0/0 .sdata2 @4096 */
|
||||
SECTION_SDATA2 static f32 lit_4096 = 4592.0f;
|
||||
|
||||
/* 80453EEC-80453EF0 0024EC 0004+00 1/1 0/0 0/0 .sdata2 @4097 */
|
||||
SECTION_SDATA2 static f32 lit_4097 = 1507.0f;
|
||||
|
||||
/* 80453EF0-80453EF4 0024F0 0004+00 1/1 0/0 0/0 .sdata2 @4098 */
|
||||
SECTION_SDATA2 static f32 lit_4098 = 100.0f;
|
||||
|
||||
/* 80453EF4-80453EF8 0024F4 0004+00 1/1 0/0 0/0 .sdata2 @4099 */
|
||||
SECTION_SDATA2 static f32 lit_4099 = 3.0f / 10.0f;
|
||||
|
||||
/* 801AE458-801AE938 1A8D98 04E0+00 1/1 0/0 0/0 .text create__10dThunder_cFv */
|
||||
#pragma push
|
||||
#pragma optimization_level 0
|
||||
#pragma optimizewithasm off
|
||||
asm int dThunder_c::create() {
|
||||
nofralloc
|
||||
#include "asm/d/d_ky_thunder/create__10dThunder_cFv.s"
|
||||
int dThunder_c::create() {
|
||||
dScnKy_env_light_c* env_light = i_dKy_getEnvlight();
|
||||
camera_class* camera_p = dComIfGp_getCamera(0);
|
||||
cXyz spB8;
|
||||
cXyz spC4;
|
||||
cXyz spD0;
|
||||
f32 var_f31;
|
||||
f32 var_f30;
|
||||
f32 var_f29;
|
||||
f32 var_f29_2;
|
||||
f32 var_r28;
|
||||
f32 var_r27;
|
||||
|
||||
new (this) dThunder_c();
|
||||
|
||||
J3DModelData* modelData;
|
||||
if (cM_rndF(1.0f) < 0.5f) {
|
||||
modelData = (J3DModelData*)dComIfG_getObjectRes("Always", EF_THUNDER01_BMD);
|
||||
} else {
|
||||
modelData = (J3DModelData*)dComIfG_getObjectRes("Always", EF_THUNDER02_BMD);
|
||||
}
|
||||
|
||||
mModelInfo.mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x1000000);
|
||||
if (mModelInfo.mpModel == NULL) {
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
|
||||
J3DAnmTevRegKey* canm = (J3DAnmTevRegKey*)dComIfG_getObjectRes("Always", EF_THUNDER_BRK);
|
||||
if (!mModelInfo.mBrk.init(modelData, canm, TRUE, 0, 1.0f, 0, -1)) {
|
||||
return cPhs_ERROR_e;
|
||||
}
|
||||
|
||||
mBrkSpeed = 1.0f;
|
||||
mModelInfo.mBrk.setPlaySpeed(mBrkSpeed);
|
||||
|
||||
if (env_light->mThunderEff.mStateTimer < 10) {
|
||||
var_f29 = 1.0f;
|
||||
} else {
|
||||
var_f29 = 0.25f;
|
||||
}
|
||||
|
||||
field_0x168 = cLib_targetAngleY(&camera_p->mLookat.mEye, &camera_p->mLookat.mCenter);
|
||||
|
||||
if (!(g_Counter.mCounter0 & 1)) {
|
||||
field_0x168 += 0x7FFF;
|
||||
}
|
||||
|
||||
var_r28 = 14.0f;
|
||||
var_r27 = 20.0f;
|
||||
var_f31 = var_r28;
|
||||
var_f30 = var_r27;
|
||||
spC4.set(60000.0f, -5000.0f, 0.0f);
|
||||
field_0x15c = 2000.0f;
|
||||
|
||||
if (env_light->mThunderEff.mStateTimer >= 10) {
|
||||
var_f31 = var_r27;
|
||||
var_f30 = 24.0f;
|
||||
field_0x15c = 2500.0f;
|
||||
spC4.y = 6000.0f;
|
||||
}
|
||||
|
||||
if (!strcmp(dComIfGp_getStartStageName(), "R_SP30") && dComIfGp_roomControl_getStayNo() == 4) {
|
||||
var_r28 = 0.1f;
|
||||
var_r27 = 0.25f;
|
||||
var_f31 = 0.15f;
|
||||
var_f30 = 0.2f;
|
||||
}
|
||||
|
||||
field_0x15c = var_f29 * cM_rndFX(field_0x15c);
|
||||
field_0x138.x = var_f29 * (var_r28 + cM_rndF(var_r27 - var_r28));
|
||||
|
||||
if (cM_rndFX(1.0f) >= 0.5) {
|
||||
field_0x138.x *= -1.0f;
|
||||
}
|
||||
|
||||
field_0x138.y = var_f29 * (var_f31 + cM_rndF(var_f30 - var_f31));
|
||||
field_0x138.z = 1.0f;
|
||||
|
||||
dKyr_get_vectle_calc(&camera_p->mLookat.mEye, &camera_p->mLookat.mCenter, &spB8);
|
||||
|
||||
// JMAFastSqrt doesn't match here when it should, probably needs to be fixed
|
||||
// var_f29_2 = JMAFastSqrt(spB8.x * spB8.x + spB8.z * spB8.z);
|
||||
|
||||
var_f29_2 = spB8.x * spB8.x + spB8.z * spB8.z;
|
||||
if (var_f29_2 > 0.0f) {
|
||||
f32 tmp = __frsqrtes(var_f29_2);
|
||||
var_f29_2 = tmp * var_f29_2;
|
||||
}
|
||||
|
||||
s16 temp_r28 = cM_atan2s(spB8.x, spB8.z);
|
||||
s16 temp_r31 = cM_atan2s(spB8.y, var_f29_2);
|
||||
|
||||
if (cM_rndFX(1.0f) >= 0.0f) {
|
||||
temp_r28 += 0x4000;
|
||||
} else {
|
||||
temp_r28 -= 0x4000;
|
||||
}
|
||||
|
||||
spD0.x = cM_scos(temp_r31) * cM_ssin(temp_r28);
|
||||
spD0.z = cM_scos(temp_r31) * cM_scos(temp_r28);
|
||||
|
||||
f32 temp_f1_3 = cM_rndF(spC4.x);
|
||||
mThunderPos.x = camera_p->mLookat.mEye.x + (spB8.x * 100000.0f) + (spD0.x * temp_f1_3);
|
||||
mThunderPos.y = camera_p->mLookat.mEye.y + 2000.0f + cM_rndF(spC4.y);
|
||||
mThunderPos.z = camera_p->mLookat.mEye.z + (spB8.z * 100000.0f) + (spD0.z * temp_f1_3);
|
||||
|
||||
if (!strcmp(dComIfGp_getStartStageName(), "R_SP30") && dComIfGp_roomControl_getStayNo() == 4) {
|
||||
mThunderPos.x = cM_rndFX(260.0f) + 19635.0f;
|
||||
mThunderPos.y = 4592.0f;
|
||||
mThunderPos.z = cM_rndFX(100.0f) + 1507.0f;
|
||||
}
|
||||
|
||||
if (cM_rndF(1.0f) < 0.3f) {
|
||||
field_0x150.x = -mThunderPos.x;
|
||||
field_0x150.y = -mThunderPos.y;
|
||||
field_0x150.z = -mThunderPos.z;
|
||||
mDoAud_mEnvSe_startFarThunderSe(&field_0x150);
|
||||
}
|
||||
|
||||
return cPhs_COMPLEATE_e;
|
||||
}
|
||||
#pragma pop
|
||||
|
||||
/* ############################################################################################## */
|
||||
/* 803BC1D8-803BC1EC -00001 0014+00 1/0 0/0 0/0 .data l_dThunder_Method */
|
||||
SECTION_DATA static void* l_dThunder_Method[5] = {
|
||||
(void*)dThunder_Create__FP12kankyo_class, (void*)dThunder_Delete__FP10dThunder_c,
|
||||
(void*)dThunder_Execute__FP10dThunder_c, (void*)dThunder_IsDelete__FP10dThunder_c,
|
||||
(void*)dThunder_Draw__FP10dThunder_c,
|
||||
static leafdraw_method_class l_dThunder_Method = {
|
||||
(process_method_func)dThunder_Create, (process_method_func)dThunder_Delete,
|
||||
(process_method_func)dThunder_Execute, (process_method_func)dThunder_IsDelete,
|
||||
(process_method_func)dThunder_Draw,
|
||||
};
|
||||
|
||||
/* 803BC1EC-803BC218 -00001 0028+04 0/0 0/0 1/0 .data g_profile_KY_THUNDER */
|
||||
SECTION_DATA extern void* g_profile_KY_THUNDER[10 + 1 /* padding */] = {
|
||||
(void*)0xFFFFFFFD,
|
||||
(void*)0x0007FFFD,
|
||||
(void*)0x02D90000,
|
||||
(void*)&g_fpcLf_Method,
|
||||
(void*)0x00000170,
|
||||
(void*)NULL,
|
||||
(void*)NULL,
|
||||
(void*)&g_fopKy_Method,
|
||||
(void*)0x00060000,
|
||||
(void*)&l_dThunder_Method,
|
||||
/* padding */
|
||||
NULL,
|
||||
extern kankyo_process_profile_definition g_profile_KY_THUNDER = {
|
||||
-3,
|
||||
7,
|
||||
-3,
|
||||
PROC_KY_THUNDER,
|
||||
0,
|
||||
&g_fpcLf_Method.mBase,
|
||||
sizeof(dThunder_c),
|
||||
0,
|
||||
0,
|
||||
&g_fopKy_Method,
|
||||
6,
|
||||
0,
|
||||
0,
|
||||
&l_dThunder_Method,
|
||||
};
|
||||
|
||||
/* 80394F40-80394F40 0215A0 0000+00 0/0 0/0 0/0 .rodata @stringBase0 */
|
||||
|
||||
Reference in New Issue
Block a user