Merge remote-tracking branch 'decomp/main' into compile

This commit is contained in:
kipcode66
2026-01-26 18:11:18 -05:00
646 changed files with 5742 additions and 1789 deletions
+1 -1
View File
@@ -5,7 +5,7 @@
#include "JSystem/J3DGraphBase/J3DTexture.h"
#include "JSystem/JUtility/JUTPalette.h"
#include "JSystem/JUtility/JUTResource.h"
#include "dolphin/os.h"
#include <dolphin/os.h>
template<typename T>
f32 J2DGetKeyFrameInterpolation(f32 param_0, J3DAnmKeyTableBase* param_1, T* param_2) {
+1 -1
View File
@@ -1,7 +1,7 @@
#include "JSystem/JSystem.h" // IWYU pragma: keep
#include "JSystem/J2DGraph/J2DGrafContext.h"
#include "dolphin/gx.h"
#include <dolphin/gx.h>
J2DGrafContext::J2DGrafContext(f32 x, f32 y, f32 width, f32 height)
: mBounds(x, y, x + width, y + height), mScissorBounds(x, y, x + width, y + height) {
+1 -1
View File
@@ -5,7 +5,7 @@
#include "JSystem/JUtility/JUTPalette.h"
#include "JSystem/JUtility/JUTResFont.h"
#include "JSystem/JUtility/JUTTexture.h"
#include "dolphin/gx.h"
#include <dolphin/gx.h>
void J2DColorBlock::initialize() {
for (int i = 0; i < 2; i++) {
+1 -1
View File
@@ -6,7 +6,7 @@
#include "JSystem/JSupport/JSupport.h"
#include "JSystem/JUtility/JUTResource.h"
#include <string>
#include "dolphin/types.h"
#include <dolphin/types.h>
J2DMaterialFactory::J2DMaterialFactory(J2DMaterialBlock const& param_0) {
field_0x0 = param_0.field_0x8;
+1 -1
View File
@@ -1,7 +1,7 @@
#include "JSystem/JSystem.h" // IWYU pragma: keep
#include "JSystem/J2DGraph/J2DOrthoGraph.h"
#include "dolphin/gx.h"
#include <dolphin/gx.h>
J2DOrthoGraph::J2DOrthoGraph() : J2DGrafContext(0, 0, 0, 0) {
this->setLookat();
+1 -1
View File
@@ -7,7 +7,7 @@
#include "JSystem/JUtility/JUTTexture.h"
#include "JSystem/JUtility/JUTResource.h"
#include "JSystem/JSupport/JSURandomInputStream.h"
#include "dolphin/gx.h"
#include <dolphin/gx.h>
J2DPicture::J2DPicture() : mPalette(NULL) {
for (u32 i = 0; i < 2; i++) {
+1 -1
View File
@@ -5,7 +5,7 @@
#include "JSystem/J2DGraph/J2DScreen.h"
#include "JSystem/JSupport/JSURandomInputStream.h"
#include "JSystem/JUtility/JUTTexture.h"
#include "dolphin/types.h"
#include <dolphin/types.h>
void J2DPictureEx::initiate(ResTIMG const* param_0, ResTLUT const* param_1) {
u32 texGenNum = mMaterial->getTexGenBlock()->getTexGenNum();
+1 -1
View File
@@ -9,7 +9,7 @@
#include "JSystem/JKernel/JKRArchive.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JSupport/JSUMemoryStream.h"
#include "dolphin/types.h"
#include <dolphin/types.h>
J2DScreen::J2DScreen()
: J2DPane(NULL, true, 'root', JGeometry::TBox2<f32>(JGeometry::TVec2<f32>(0, 0), JGeometry::TVec2<f32>(640, 480))), mColor() {
+2 -2
View File
@@ -9,9 +9,9 @@
#ifdef __MWERKS__
#include <cmath>
#else
#include "dusk/math.h"
#include <dusk/math.h>
#endif
#include "dolphin/gx.h"
#include <dolphin/gx.h>
void J2DTexMtx::load(u32 mtxIdx) {
GXLoadTexMtxImm(mTexMtx, mtxIdx * 3 + GX_TEXMTX0, (GXTexMtxType)mInfo.mTexMtxType);
+1 -1
View File
@@ -4,7 +4,7 @@
#include "JSystem/J3DGraphAnimator/J3DAnimation.h"
#include "JSystem/J3DGraphAnimator/J3DModel.h"
#include "JSystem/JMath/JMATrigonometric.h"
#include "dolphin/base/PPCArch.h"
#include <dolphin/base/PPCArch.h>
J3DDeformData::J3DDeformData() {
mClusterNum = 0;
+1 -1
View File
@@ -7,7 +7,7 @@
#include "JSystem/J3DGraphLoader/J3DAnmLoader.h"
#include "JSystem/J3DGraphAnimator/J3DAnimation.h"
#include "JSystem/JSupport/JSupport.h"
#include "dolphin/os.h"
#include <dolphin/os.h>
J3DAnmBase* J3DAnmLoaderDataBase::load(const void* i_data, J3DAnmLoaderDataBaseFlag flag) {
const JUTDataFileHeader* header = (const JUTDataFileHeader*)i_data;
@@ -8,7 +8,7 @@
#include "JSystem/J3DGraphAnimator/J3DSkinDeform.h"
#include "JSystem/JSupport/JSupport.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "dolphin/os.h"
#include <dolphin/os.h>
#include <string>
void* J3DClusterLoaderDataBase::load(const void* i_data) {
@@ -8,7 +8,7 @@
#include "JSystem/J3DGraphAnimator/J3DJoint.h"
#include "JSystem/J3DGraphAnimator/J3DModelData.h"
#include "JSystem/JSupport/JSupport.h"
#include "dolphin/os.h"
#include <dolphin/os.h>
#include "global.h"
u16 J3DModelLoader::countMaterialNum(const void* stream) {
@@ -5,7 +5,7 @@
#include "JSystem/J3DGraphBase/J3DShapeMtx.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JSupport/JSupport.h"
#include "dolphin/os.h"
#include <dolphin/os.h>
#include "global.h"
J3DShapeFactory::J3DShapeFactory(J3DShapeBlock const& block) {
+1 -1
View File
@@ -14,7 +14,7 @@
#include "JSystem/JAudio2/JASLfo.h"
#include "JSystem/JKernel/JKRSolidHeap.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "dolphin/ai.h"
#include <dolphin/ai.h>
#include <dolphin/os.h>
#include <stdint.h>
+1 -1
View File
@@ -5,7 +5,7 @@
#include "JSystem/JAudio2/JASCriticalSection.h"
#include "JSystem/JAudio2/JASDriverIF.h"
#include "JSystem/JAudio2/JASDSPChannel.h"
#include "dolphin/types.h"
#include <dolphin/types.h>
JASAudioReseter::JASAudioReseter() {
field_0x0 = 0;
+1 -1
View File
@@ -9,7 +9,7 @@
#include "JSystem/JAudio2/JASProbe.h"
#include "JSystem/JAudio2/JASReport.h"
#include "JSystem/JKernel/JKRSolidHeap.h"
#include "dolphin/dsp.h"
#include <dolphin/dsp.h>
#include <stdint.h>
JASAudioThread::JASAudioThread(int stackSize, int msgCount, u32 threadPriority)
+1 -1
View File
@@ -6,7 +6,7 @@
#include "JSystem/JAudio2/JASCmdStack.h"
#include "JSystem/JAudio2/JASCriticalSection.h"
#include "dolphin/os.h"
#include <dolphin/os.h>
JASPortCmd::TPortHead JASPortCmd::sCommandListOnce;
+1 -1
View File
@@ -6,7 +6,7 @@
#include "JSystem/JKernel/JKRExpHeap.h"
#include "JSystem/JKernel/JKRSolidHeap.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "dolphin/ar.h"
#include <dolphin/ar.h>
JASHeap::JASHeap(JASDisposer* disposer) : mTree(this) {
mDisposer = disposer;
+1 -1
View File
@@ -6,7 +6,7 @@
#include "JSystem/JAudio2/JASMutex.h"
#include "JSystem/JKernel/JKRDvdAramRipper.h"
#include <string>
#include "dolphin/os.h"
#include <dolphin/os.h>
#include <stdint.h>
JASHeap* JASWaveArcLoader::sAramHeap;
+1 -1
View File
@@ -14,7 +14,7 @@
#include "JSystem/JAudio2/JAUSoundTable.h"
#include "JSystem/JAudio2/JAUStreamFileTable.h"
#include "JSystem/JKernel/JKRSolidHeap.h"
#include "dolphin/dvd.h"
#include <dolphin/dvd.h>
namespace {
class TPushCurrentHeap {
+1 -1
View File
@@ -7,7 +7,7 @@
#include "JSystem/JAudio2/JAUSeqDataBlockMgr.h"
#include "JSystem/JAudio2/JAUSoundInfo.h"
#include "JSystem/JAudio2/JASResArcLoader.h"
#include "dolphin/types.h"
#include <dolphin/types.h>
JAUSeqDataBlock::JAUSeqDataBlock() : field_0x0(this) {}
+1 -1
View File
@@ -2,7 +2,7 @@
#include "JSystem/JAudio2/osdsp.h"
#include "JSystem/JAudio2/osdsp_task.h"
#include "dolphin/os.h"
#include <dolphin/os.h>
#include <dolphin/dsp.h>
extern "C" void __DSP_insert_task(DSPTaskInfo*);
+1 -1
View File
@@ -6,7 +6,7 @@
#include "JSystem/JUtility/JUTConsole.h"
#include "JSystem/JUtility/JUTDbPrint.h"
#include "JSystem/JUtility/JUTProcBar.h"
#include "dolphin/gx.h"
#include <dolphin/gx.h>
#include <dolphin/vi.h>
#include "global.h"
#include <stdint.h>
+1 -1
View File
@@ -6,7 +6,7 @@
#include "JSystem/JKernel/JKRDecomp.h"
#include "JSystem/JKernel/JKRExpHeap.h"
#include "JSystem/JUtility/JUTException.h"
#include "dolphin/ar.h"
#include <dolphin/ar.h>
#include <dolphin/os.h>
#include <string>
+1 -1
View File
@@ -4,7 +4,7 @@
#include "JSystem/JKernel/JKRAram.h"
#include "JSystem/JKernel/JKRDecomp.h"
#include "JSystem/JUtility/JUTException.h"
#include "dolphin/os.h"
#include <dolphin/os.h>
JKRAMCommand* JKRAramPiece::prepareCommand(int direction, u32 src, u32 dst, u32 length,
JKRAramBlock* block,
+1 -1
View File
@@ -9,7 +9,7 @@
#include "JSystem/JSupport/JSUFileStream.h"
#include <dolphin/os.h>
#include <dolphin/os.h>
#include "dolphin/vi.h"
#include <dolphin/vi.h>
#include "global.h"
#include <string>
+1 -1
View File
@@ -10,7 +10,7 @@
#include "JSystem/JUtility/JUTException.h"
#include <string>
#include <dolphin/os.h>
#include "dolphin/vi.h"
#include <dolphin/vi.h>
#include <stdint.h>
static int JKRDecompressFromDVD(JKRDvdFile*, void*, u32, u32, u32, u32, u32*);
+1 -1
View File
@@ -1,7 +1,7 @@
#include "JSystem/JSystem.h" // IWYU pragma: keep
#include "JSystem/JKernel/JKRFile.h"
#include "dolphin/vi.h"
#include <dolphin/vi.h>
void JKRFile::read(void* data, s32 length, s32 offset) {
JUT_ASSERT(32, ( length & 0x1f ) == 0);
+2 -2
View File
@@ -6,8 +6,8 @@
#include "JSystem/JParticle/JPAEmitter.h"
#include "JSystem/JParticle/JPAResourceManager.h"
#include "JSystem/JMath/JMATrigonometric.h"
#include "dolphin/mtx.h"
#include "dolphin/gx.h"
#include <dolphin/mtx.h>
#include <dolphin/gx.h>
void JPASetPointSize(JPAEmitterWorkData* work) {
GXSetPointSize((u8)(25.0f * work->mGlobalPtclScl.x), GX_TO_ONE);
+2 -2
View File
@@ -3,8 +3,8 @@
#include "JSystem/JParticle/JPAChildShape.h"
#include "JSystem/JParticle/JPAParticle.h"
#include "JSystem/JParticle/JPAEmitter.h"
#include "dolphin/gx.h"
#include "dolphin/os.h"
#include <dolphin/gx.h>
#include <dolphin/os.h>
void JPARegistChildPrmEnv(JPAEmitterWorkData* work) {
JPAChildShape* csp = work->mpRes->getCsp();
+1 -1
View File
@@ -5,7 +5,7 @@
#include "JSystem/JParticle/JPAParticle.h"
#include "JSystem/JParticle/JPAResourceManager.h"
#include "JSystem/JParticle/JPABaseShape.h"
#include "dolphin/types.h"
#include <dolphin/types.h>
JPAEmitterCallBack::~JPAEmitterCallBack() {
}
+1 -1
View File
@@ -6,7 +6,7 @@
#include "JSystem/JParticle/JPAParticle.h"
#include "JSystem/JParticle/JPAResourceManager.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "dolphin/gx.h"
#include <dolphin/gx.h>
JPAEmitterManager::JPAEmitterManager(u32 i_ptclNum, u32 i_emtrNum, JKRHeap* pHeap, u8 i_gidMax,
u8 i_ridMax) {
+1 -1
View File
@@ -3,7 +3,7 @@
#include "JSystem/JParticle/JPAExTexShape.h"
#include "JSystem/JParticle/JPAResourceManager.h"
#include "JSystem/JParticle/JPAEmitter.h"
#include "dolphin/gx.h"
#include <dolphin/gx.h>
void JPALoadExTex(JPAEmitterWorkData* work) {
JPAExTexShape* ets = work->mpRes->getEts();
+1 -1
View File
@@ -4,7 +4,7 @@
#include "JSystem/JMath/JMATrigonometric.h"
#include "JSystem/JParticle/JPAParticle.h"
#include "JSystem/JParticle/JPAEmitter.h"
#include "dolphin/os.h"
#include <dolphin/os.h>
void JPACalcScaleX(JPAEmitterWorkData* work, JPABaseParticle* ptcl) {
JPAExtraShape* esp = work->mpRes->getEsp();
+1 -1
View File
@@ -11,7 +11,7 @@
#include "JSystem/JParticle/JPAKeyBlock.h"
#include "JSystem/JParticle/JPAParticle.h"
#include "JSystem/JParticle/JPAResourceManager.h"
#include "dolphin/gx.h"
#include <dolphin/gx.h>
#include "global.h"
JPAResource::JPAResource() {
@@ -2,7 +2,7 @@
#include "JSystem/JStudio/JStudio/stb-data-parse.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "dolphin/os.h"
#include <dolphin/os.h>
#include <stdint.h>
namespace JStudio {
@@ -0,0 +1,8 @@
#include "JSystem/JSystem.h" // IWYU pragma: keep
#include "JSystem/JStudio/JStudio_JPreviewer/control.h"
JStudioPreviewer::TControl::TControl() : JOREventCallbackListNode(0xc0000000,0xc00000ff,false) {
}
+1 -1
View File
@@ -5,7 +5,7 @@
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/JUtility/JUTConsole.h"
#include "JSystem/JKernel/JKRAram.h"
#include "dolphin/gx.h"
#include <dolphin/gx.h>
#include <stdint.h>
JUTCacheFont::JUTCacheFont(ResFONT const* p_fontRes, u32 cacheSize, JKRHeap* p_heap) {
+2 -2
View File
@@ -1,8 +1,8 @@
#include "JSystem/JSystem.h" // IWYU pragma: keep
#include "JSystem/JUtility/JUTPalette.h"
#include "dolphin/gx.h"
#include "dolphin/os.h"
#include <dolphin/gx.h>
#include <dolphin/os.h>
void JUTPalette::storeTLUT(GXTlut param_0, ResTLUT* tlut) {
if (tlut == NULL) {
+1 -1
View File
@@ -5,7 +5,7 @@
#include "JSystem/JSupport/JSupport.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "JSystem/JUtility/JUTConsole.h"
#include "dolphin/gx.h"
#include <dolphin/gx.h>
JUTResFont::JUTResFont() {
initialize_state();
+1 -1
View File
@@ -2,7 +2,7 @@
#include "JSystem/JUtility/JUTTexture.h"
#include "JSystem/JUtility/JUTPalette.h"
#include "dolphin/gx.h"
#include <dolphin/gx.h>
JUTTexture::~JUTTexture() {
if (getCaptureFlag()) {
+1 -1
View File
@@ -3,7 +3,7 @@
#include "JSystem/JUtility/JUTVideo.h"
#include "JSystem/JUtility/JUTDirectPrint.h"
#include "JSystem/JUtility/JUTXfb.h"
#include "dolphin/gx.h"
#include <dolphin/gx.h>
#include <dolphin/vi.h>
JUTVideo* JUTVideo::sManager;
+1 -1
View File
@@ -3,7 +3,7 @@
#include "JSystem/JUtility/JUTXfb.h"
#include "JSystem/JKernel/JKRHeap.h"
#include "JSystem/JUtility/JUTAssert.h"
#include "dolphin/gx.h"
#include <dolphin/gx.h>
void JUTXfb::clearIndex() {
mDrawingXfbIndex = -1;
@@ -1,5 +1,5 @@
#include "uart_console_io_gcn.h"
#include "dolphin/os.h"
#include <dolphin/os.h>
int InitializeUART(size_t);
int WriteUARTN(unsigned char*, size_t);
+2 -2
View File
@@ -1,7 +1,7 @@
#ifndef __METROTRK_TRK_H__
#define __METROTRK_TRK_H__
#include "dolphin/types.h"
#include <dolphin/types.h>
#ifdef __cplusplus
extern "C" {
@@ -375,4 +375,4 @@ void TRKSaveExtended1Block();
}
#endif
#endif /* __METROTRK_TRK_H__ */
#endif /* __METROTRK_TRK_H__ */
@@ -1,6 +1,6 @@
#ifndef CPLUSLIBPPC_H
#define CPLUSLIBPPC_H
#include "dolphin/types.h"
#include <dolphin/types.h>
#endif /* CPLUSLIBPPC_H */
#endif /* CPLUSLIBPPC_H */
@@ -1,6 +1,6 @@
#ifndef __INIT_CPP_EXCEPTIONS_H
#define __INIT_CPP_EXCEPTIONS_H
#include "dolphin/types.h"
#include <dolphin/types.h>
#endif /* __INIT_CPP_EXCEPTIONS_H */
#endif /* __INIT_CPP_EXCEPTIONS_H */
@@ -1,6 +1,6 @@
#ifndef RUNTIME_H
#define RUNTIME_H
#include "dolphin/types.h"
#include <dolphin/types.h>
#endif /* RUNTIME_H */
#endif /* RUNTIME_H */
@@ -3,7 +3,7 @@
* Description:
*/
#include "dolphin/os.h"
#include <dolphin/os.h>
inline static void InitDefaultHeap(void) {
void* arenaLo;
+1 -1
View File
@@ -5,7 +5,7 @@
#include "SSystem/SComponent/c_list_iter.h"
#include "SSystem/SComponent/c_list.h"
#include "dolphin/types.h"
#include <dolphin/types.h>
int cLsIt_Method(node_list_class* list, cNdIt_MethodFunc method, void* data) {
if (list->mSize > 0)
@@ -2,7 +2,7 @@
#include "TRK_MINNOW_DOLPHIN/Os/dolphin/DDH_Stubs.h"
#include "TRK_MINNOW_DOLPHIN/Os/dolphin/GDEV_Stubs.h"
#include "TRK_MINNOW_DOLPHIN/Os/dolphin/UDP_Stubs.h"
#include "dolphin/base/PPCArch.h"
#include <dolphin/base/PPCArch.h>
#include "trk.h"
void TRKInterruptHandler();
@@ -4,7 +4,7 @@
*/
#include "TRK_MINNOW_DOLPHIN/Os/dolphin/usr_put.h"
// #include "dolphin/os.h"
// #include <dolphin/os.h>
// void OSReport(char* fmt, ...) causes extra crclr instruction.
// look into issue later
@@ -3,7 +3,7 @@
* Description:
*/
#include "dolphin/types.h"
#include <dolphin/types.h>
asm void TRK_flush_cache(u32, int) {
// clang-format off
+1 -1
View File
@@ -1132,7 +1132,7 @@ static void* daAlink_searchHorseZelda(fopAc_ac_c* param_0, void* param_1) {
return NULL;
}
cPhs__Step daArrow_c::create() {
cPhs_Step daArrow_c::create() {
fopAcM_ct(this, daArrow_c);
mArrowType = fopAcM_GetParamBit(this, 8, 8);
+3 -3
View File
@@ -5426,10 +5426,10 @@ static int useHeapInit(fopAc_ac_c* i_this) {
return static_cast<daB_DS_c*>(i_this)->CreateHeap();
}
cPhs__Step daB_DS_c::create() {
cPhs_Step daB_DS_c::create() {
fopAcM_ct(this, daB_DS_c);
cPhs__Step phase_state = (cPhs__Step)dComIfG_resLoad(&mPhase, "B_DS");
cPhs_Step phase_state = dComIfG_resLoad(&mPhase, "B_DS");
if (phase_state == cPhs_COMPLEATE_e) {
if (arg0 == TYPE_BATTLE_1 && dComIfGs_isStageBossEnemy()) {
// "After B_DS defeated, so not re-setting\n"
@@ -5676,7 +5676,7 @@ cPhs__Step daB_DS_c::create() {
daB_DS_c::daB_DS_c() {}
static cPhs__Step daB_DS_Create(daB_DS_c* i_this) {
static cPhs_Step daB_DS_Create(daB_DS_c* i_this) {
return i_this->create();
}
+2 -2
View File
@@ -5048,9 +5048,9 @@ int daB_TN_c::create() {
}
}
cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq1, "B_tn");
cPhs_Step step = dComIfG_resLoad(&mPhaseReq1, "B_tn");
if (step == cPhs_COMPLEATE_e) {
step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq2, mArcName);
step = dComIfG_resLoad(&mPhaseReq2, mArcName);
if (step == cPhs_COMPLEATE_e) {
mBrkAnmFrame = fopAcM_GetParamBit(this, 16, 16);
+9 -9
View File
@@ -3242,9 +3242,9 @@ static int useHeapInit2(fopAc_ac_c* i_this) {
return static_cast<daB_YO_c*>(i_this)->CreateHeap2();
}
cPhs__Step daB_YO_c::create() {
cPhs_Step daB_YO_c::create() {
fopAcM_ct(this, daB_YO_c);
cPhs__Step step;
cPhs_Step step;
mSwNo = fopAcM_GetParam(this) & 0xff;
mSwNo2 = (fopAcM_GetParam(this) >> 8) & 0xff;
@@ -3258,7 +3258,7 @@ cPhs__Step daB_YO_c::create() {
mIsInactive2 = mIsInactive;
if (mIsInactive == 1) {
step = (cPhs__Step)dComIfG_resLoad(&mPhase2, "L5_R50");
step = dComIfG_resLoad(&mPhase2, "L5_R50");
if (step == cPhs_COMPLEATE_e) {
if (!daMirror_c::remove()) {
@@ -3292,11 +3292,11 @@ cPhs__Step daB_YO_c::create() {
return step;
} else {
if ((step = (cPhs__Step)dComIfG_resLoad(&mPhase1, "B_YO"), step == cPhs_COMPLEATE_e)
&& (step = (cPhs__Step)dComIfG_resLoad(&mPhase2, "L5_R50"), step == cPhs_COMPLEATE_e)
&& (step = (cPhs__Step)dComIfG_resLoad(&mPhase3, "ykW"), step == cPhs_COMPLEATE_e)
&& (step = (cPhs__Step)dComIfG_resLoad(&mPhase4, "ykW1"), step == cPhs_COMPLEATE_e)
&& (step = (cPhs__Step)dComIfG_resLoad(&mPhase5, "E_FZ"), step == cPhs_COMPLEATE_e))
if ((step = dComIfG_resLoad(&mPhase1, "B_YO"), step == cPhs_COMPLEATE_e)
&& (step = dComIfG_resLoad(&mPhase2, "L5_R50"), step == cPhs_COMPLEATE_e)
&& (step = dComIfG_resLoad(&mPhase3, "ykW"), step == cPhs_COMPLEATE_e)
&& (step = dComIfG_resLoad(&mPhase4, "ykW1"), step == cPhs_COMPLEATE_e)
&& (step = dComIfG_resLoad(&mPhase5, "E_FZ"), step == cPhs_COMPLEATE_e))
{
if (cDmr_SkipInfo != 0 && !daMirror_c::remove()) {
return cPhs_INIT_e;
@@ -3412,7 +3412,7 @@ cPhs__Step daB_YO_c::create() {
}
}
static cPhs__Step daB_YO_Create(daB_YO_c* i_this) {
static cPhs_Step daB_YO_Create(daB_YO_c* i_this) {
return i_this->create();
}
+3 -3
View File
@@ -1010,9 +1010,9 @@ static int useHeapInit(fopAc_ac_c* i_this) {
}
// data/rodata swap
cPhs__Step daB_YOI_c::create() {
cPhs_Step daB_YOI_c::create() {
fopAcM_ct(this, daB_YOI_c);
cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase, "B_YO");
cPhs_Step step = dComIfG_resLoad(&mPhase, "B_YO");
if (step == cPhs_COMPLEATE_e) {
if (!fopAcM_entrySolidHeap(this, useHeapInit, 0x1CA0)) {
@@ -1087,7 +1087,7 @@ daB_YOI_c::daB_YOI_c() {
/* empty function */
}
static cPhs__Step daB_YOI_Create(daB_YOI_c* i_this) {
static cPhs_Step daB_YOI_Create(daB_YOI_c* i_this) {
return i_this->create();
}
+1
View File
@@ -10,6 +10,7 @@
#include "d/d_com_static.h"
#include "d/actor/d_a_grass.h"
#include "d/d_bg_w.h"
#include "d/d_bg_parts.h"
#include "m_Do/m_Do_lib.h"
#include "d/d_demo.h"
#include "JSystem/JKernel/JKRExpHeap.h"
+1 -1
View File
@@ -8,7 +8,7 @@
#include "d/actor/d_a_bg_obj.h"
#include "JSystem/J3DGraphBase/J3DMaterial.h"
#include <cstdio>
#include "dolphin/os.h"
#include <dolphin/os.h>
#include "d/actor/d_a_set_bgobj.h"
#include "d/d_s_play.h"
#include "SSystem/SComponent/c_math.h"
+1 -1
View File
@@ -15,7 +15,7 @@
#include "d/d_com_inf_game.h"
#include "d/d_meter2_info.h"
#include "d/d_timer.h"
#include "dolphin/types.h"
#include <dolphin/types.h>
#include "f_op/f_op_actor_mng.h"
#include "f_op/f_op_camera_mng.h"
#include "m_Do/m_Do_ext.h"
+2 -2
View File
@@ -2402,11 +2402,11 @@ static int useHeapInit(fopAc_ac_c* i_this) {
return 1;
}
static cPhs__Step daDo_Create(fopAc_ac_c* i_this) {
static cPhs_Step daDo_Create(fopAc_ac_c* i_this) {
do_class* _this = static_cast<do_class*>(i_this);
fopAcM_ct(i_this, do_class);
cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhase, "Do");
cPhs_Step step = dComIfG_resLoad(&_this->mPhase, "Do");
if (step == cPhs_COMPLEATE_e) {
_this->mParam0 = fopAcM_GetParam(i_this) & 7;
+3 -3
View File
@@ -104,9 +104,9 @@ int daBdoor_c::CreateInit() {
return 1;
}
cPhs__Step daBdoor_c::create() {
cPhs_Step daBdoor_c::create() {
fopAcM_ct(this, daBdoor_c);
cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, getArcName());
cPhs_Step step = dComIfG_resLoad(&mPhaseReq, getArcName());
if (step == cPhs_COMPLEATE_e) {
if (!fopAcM_entrySolidHeap(this, CheckCreateHeap, 0xa000)) {
return cPhs_ERROR_e;
@@ -404,7 +404,7 @@ static int daBdoor_Delete(daBdoor_c* i_this) {
return 1;
}
static cPhs__Step daBdoor_Create(fopAc_ac_c* i_this) {
static cPhs_Step daBdoor_Create(fopAc_ac_c* i_this) {
return static_cast<daBdoor_c*>(i_this)->create();
}
+2 -2
View File
@@ -989,7 +989,7 @@ static int useHeapInit(fopAc_ac_c* i_this) {
}
}
static cPhs__Step daE_BA_Create(fopAc_ac_c* i_this) {
static cPhs_Step daE_BA_Create(fopAc_ac_c* i_this) {
static char* arc_name[3] = {"E_ba", "E_fb", "E_ib"};
static dCcD_SrcSph cc_sph_src = {
@@ -1013,7 +1013,7 @@ static cPhs__Step daE_BA_Create(fopAc_ac_c* i_this) {
}
_this->mArcName = arc_name[_this->mType];
cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhase, _this->mArcName);
cPhs_Step step = dComIfG_resLoad(&_this->mPhase, _this->mArcName);
if (step == cPhs_COMPLEATE_e) {
int sw = fopAcM_GetParam(_this) >> 24;
+2 -2
View File
@@ -716,11 +716,11 @@ static int useHeapInit(fopAc_ac_c* i_this) {
return true;
}
static cPhs__Step daE_Bee_Create(fopAc_ac_c* i_this) {
static cPhs_Step daE_Bee_Create(fopAc_ac_c* i_this) {
e_bee_class* _this = static_cast<e_bee_class*>(i_this);
fopAcM_ct(_this, e_bee_class);
cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhase, "E_bee");
cPhs_Step step = dComIfG_resLoad(&_this->mPhase, "E_bee");
if (step == cPhs_COMPLEATE_e) {
_this->mParam0 = (u8)fopAcM_GetParam(_this);
_this->mParam1 = (u8)(fopAcM_GetParam(_this) >> 8);
+2 -2
View File
@@ -864,11 +864,11 @@ static int useHeapInit(fopAc_ac_c* actor) {
return 1;
}
static cPhs__Step daE_BI_Create(fopAc_ac_c* actor) {
static cPhs_Step daE_BI_Create(fopAc_ac_c* actor) {
fopAcM_ct(actor, e_bi_class);
e_bi_class* i_this = (e_bi_class*)actor;
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->phase, "E_BI");
cPhs_Step phase = dComIfG_resLoad(&i_this->phase, "E_BI");
if (phase == cPhs_COMPLEATE_e) {
OS_REPORT("E_BI PARAM %x\n", fopAcM_GetParam(actor));
+2 -2
View File
@@ -801,12 +801,12 @@ static int useHeapInit(fopAc_ac_c* a_this) {
return 1;
}
static cPhs__Step daE_Bug_Create(fopAc_ac_c* a_this) {
static cPhs_Step daE_Bug_Create(fopAc_ac_c* a_this) {
e_bug_class* i_this = (e_bug_class*)a_this;
fopAcM_ct(a_this, e_bug_class);
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_bug");
cPhs_Step phase = dComIfG_resLoad(&i_this->mPhase, "E_bug");
if (phase == cPhs_COMPLEATE_e) {
OS_REPORT("E_BUG PARAM %x\n", fopAcM_GetParam(a_this));
i_this->field_0x570 = fopAcM_GetParam(a_this);
+2 -2
View File
@@ -1661,11 +1661,11 @@ static int kabe_initial_pos_set(e_dd_class* i_this) {
return 0;
}
static cPhs__Step daE_DD_Create(fopAc_ac_c* a_this) {
static cPhs_Step daE_DD_Create(fopAc_ac_c* a_this) {
e_dd_class* i_this = (e_dd_class*)a_this;
fopAcM_ct(a_this, e_dd_class);
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_dd");
cPhs_Step phase = dComIfG_resLoad(&i_this->mPhase, "E_dd");
if (phase == cPhs_COMPLEATE_e) {
OS_REPORT("E_DD PARAM %x\n", fopAcM_GetParam(a_this));
+1 -1
View File
@@ -649,7 +649,7 @@ static int daE_DF_Delete(daE_DF_c* i_this) {
int daE_DF_c::Create() {
fopAcM_ct(this, daE_DF_c);
cPhs__Step rv = (cPhs__Step)dComIfG_resLoad(&mPhaseReq, "E_DF");
cPhs_Step rv = dComIfG_resLoad(&mPhaseReq, "E_DF");
if (rv == cPhs_COMPLEATE_e) {
OS_REPORT("E_DF PARAM %x\n", fopAcM_GetParam(this));
mArg0 = (u8)fopAcM_GetParam(this);
+2 -2
View File
@@ -3358,12 +3358,12 @@ static int useHeapInit(fopAc_ac_c* actor) {
return 1;
}
static cPhs__Step daE_DN_Create(fopAc_ac_c* actor) {
static cPhs_Step daE_DN_Create(fopAc_ac_c* actor) {
e_dn_class* i_this = (e_dn_class*)actor;
fopAcM_ct(actor, e_dn_class);
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->phase, "E_dn");
cPhs_Step phase = dComIfG_resLoad(&i_this->phase, "E_dn");
if (phase == cPhs_COMPLEATE_e) {
int swBit = (fopAcM_GetParam(actor) & 0xFF000000) >> 24;
if (swBit != 0xFF) {
+5 -5
View File
@@ -2456,18 +2456,18 @@ static int useHeapInit(fopAc_ac_c* i_this) {
return static_cast<daE_DT_c*>(i_this)->CreateHeap();
}
cPhs__Step daE_DT_c::create() {
cPhs_Step daE_DT_c::create() {
fopAcM_ct(this, daE_DT_c);
cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase[0], "E_DT");
cPhs_Step step = dComIfG_resLoad(&mPhase[0], "E_DT");
if (step != cPhs_COMPLEATE_e) {
return step;
}
step = (cPhs__Step)dComIfG_resLoad(&mPhase[1], "Dalways");
step = dComIfG_resLoad(&mPhase[1], "Dalways");
if (step != cPhs_COMPLEATE_e) {
return step;
}
step = (cPhs__Step)dComIfG_resLoad(&mPhase[2], "E_OT");
step = dComIfG_resLoad(&mPhase[2], "E_OT");
if (step != cPhs_COMPLEATE_e) {
return step;
}
@@ -2548,7 +2548,7 @@ cPhs__Step daE_DT_c::create() {
return step;
}
static cPhs__Step daE_DT_Create(daE_DT_c* i_this) {
static cPhs_Step daE_DT_Create(daE_DT_c* i_this) {
return i_this->create();
}
+2 -2
View File
@@ -907,7 +907,7 @@ static int useHeapInit(fopAc_ac_c* i_this) {
return a_this->CreateHeap();
}
cPhs__Step daE_FB_c::create() {
cPhs_Step daE_FB_c::create() {
fopAcM_ct(this, daE_FB_c);
mType = fopAcM_GetParam(this);
swBit0 = (fopAcM_GetParam(this) & 0xFF00) >> 8;
@@ -916,7 +916,7 @@ cPhs__Step daE_FB_c::create() {
mType = 0;
}
cPhs__Step phase = (cPhs__Step) dComIfG_resLoad(&mPhaseReq, "E_FL");
cPhs_Step phase = dComIfG_resLoad(&mPhaseReq, "E_FL");
if (phase == cPhs_COMPLEATE_e) {
if (mType == 10 || mType == 11) {
fopAcM_OffStatus(this, 0);
+2 -2
View File
@@ -718,10 +718,10 @@ static int useHeapIe_fst(fopAc_ac_c* i_this) {
return 1;
}
static cPhs__Step daE_Fs_Create(fopAc_ac_c* i_this) {
static cPhs_Step daE_Fs_Create(fopAc_ac_c* i_this) {
fopAcM_ct(i_this, e_fs_class);
e_fs_class* _this = (e_fs_class*)(i_this);
cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhase, "E_FS");
cPhs_Step step = dComIfG_resLoad(&_this->mPhase, "E_FS");
if (step == cPhs_COMPLEATE_e) {
_this->field_0x5b4 = fopAcM_GetParam(_this) & 0xff;
+2 -2
View File
@@ -1614,7 +1614,7 @@ static int useHeapInit(fopAc_ac_c* actor) {
return 1;
}
static cPhs__Step daE_GB_Create(fopAc_ac_c* actor) {
static cPhs_Step daE_GB_Create(fopAc_ac_c* actor) {
static dCcD_SrcSph head_cc_sph_src = {
{
{0x0, {{AT_TYPE_CSTATUE_SWING, 0x2, 0xd}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj
@@ -1646,7 +1646,7 @@ static cPhs__Step daE_GB_Create(fopAc_ac_c* actor) {
e_gb_class* i_this = (e_gb_class*)actor;
fopAcM_ct(&i_this->actor, e_gb_class);
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->phase, "E_gb");
cPhs_Step phase = dComIfG_resLoad(&i_this->phase, "E_gb");
if (phase == cPhs_COMPLEATE_e) {
OS_REPORT("E_gb PARAM %x\n", fopAcM_GetParam(actor));
u8 sw_bit = (fopAcM_GetParam(actor) & 0xFF0000) >> 16;
+4 -4
View File
@@ -1699,7 +1699,7 @@ static u16 const l_heapsize[4] = {
0x3120, 0x3120, 0x21E0, 0x2DE0,
};
cPhs__Step daE_GM_c::create() {
cPhs_Step daE_GM_c::create() {
fopAcM_ct(this, daE_GM_c);
mType = fopAcM_GetParam(this);
@@ -1727,11 +1727,11 @@ cPhs__Step daE_GM_c::create() {
field_0xa54 = uVar1 * 100.0f;
}
cPhs__Step phase;
cPhs_Step phase;
if (mType == TYPE_GOMA) {
phase = (cPhs__Step)dComIfG_resLoad(&mPhase, "E_mg");
phase = dComIfG_resLoad(&mPhase, "E_mg");
} else {
phase = (cPhs__Step)dComIfG_resLoad(&mPhase, "E_gm");
phase = dComIfG_resLoad(&mPhase, "E_gm");
}
if (phase == cPhs_COMPLEATE_e) {
+2 -2
View File
@@ -3136,12 +3136,12 @@ static int useHeapInit(fopAc_ac_c* a_this) {
return 1;
}
static cPhs__Step daE_MF_Create(fopAc_ac_c* a_this) {
static cPhs_Step daE_MF_Create(fopAc_ac_c* a_this) {
e_mf_class* i_this = (e_mf_class*)a_this;
fopAcM_ct(a_this, e_mf_class);
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_mf");
cPhs_Step phase = dComIfG_resLoad(&i_this->mPhase, "E_mf");
if (phase == cPhs_COMPLEATE_e) {
int swBit = fopAcM_GetParam(a_this) >> 24;
if (swBit != 0xFF) {
+1 -1
View File
@@ -750,7 +750,7 @@ static int useHeapInit(fopAc_ac_c* i_this) {
}
static int daE_MM_MT_Create(fopAc_ac_c* i_this) {
cPhs__Step cVar1;
cPhs_Step cVar1;
bool bVar2;
f32 fVar3;
+2 -2
View File
@@ -959,11 +959,11 @@ static int useHeapInit(fopAc_ac_c* i_this) {
return 1;
}
static cPhs__Step daE_Nest_Create(fopAc_ac_c* i_this) {
static cPhs_Step daE_Nest_Create(fopAc_ac_c* i_this) {
fopAcM_ct(i_this, e_nest_class);
e_nest_class* _this = static_cast<e_nest_class*>(i_this);
cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhase, "E_nest");
cPhs_Step step = dComIfG_resLoad(&_this->mPhase, "E_nest");
if (step == cPhs_COMPLEATE_e) {
_this->mBrokenSwitch = (u8)((u16)_this->current.angle.z >> 8);
_this->shape_angle.z = 0;
+3 -3
View File
@@ -2669,7 +2669,7 @@ static int useHeapInit(fopAc_ac_c* i_this) {
return a_this->CreateHeap();
}
cPhs__Step daE_OC_c::create() {
cPhs_Step daE_OC_c::create() {
fopAcM_ct(this, daE_OC_c);
field_0x6b4 = fopAcM_GetParam(this) & 0xFF;
if (field_0x6b4 == 0xFF) {
@@ -2706,9 +2706,9 @@ cPhs__Step daE_OC_c::create() {
mName = "E_OC2";
}
cPhs__Step phase = (cPhs__Step) dComIfG_resLoad(&mPhaseReqs[0], mName);
cPhs_Step phase = dComIfG_resLoad(&mPhaseReqs[0], mName);
if (phase == cPhs_COMPLEATE_e) {
phase = (cPhs__Step) dComIfG_resLoad(&mPhaseReqs[1], "E_ocb");
phase = dComIfG_resLoad(&mPhaseReqs[1], "E_ocb");
if (phase == cPhs_COMPLEATE_e) {
OS_REPORT("E_OC PARAM %x\n", fopAcM_GetParam(this));
if (!fopAcM_entrySolidHeap(this, useHeapInit, 0x2e40)) {
+1 -1
View File
@@ -4,7 +4,7 @@
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "dolphin/types.h"
#include <dolphin/types.h>
#include "d/actor/d_a_e_oct_bg.h"
#include "f_op/f_op_actor_mng.h"
+3 -3
View File
@@ -741,10 +741,10 @@ static int useHeapInit(fopAc_ac_c* i_this) {
return static_cast<daE_OT_c*>(i_this)->CreateHeap();
}
cPhs__Step daE_OT_c::create() {
cPhs_Step daE_OT_c::create() {
fopAcM_ct(this, daE_OT_c);
cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase, "E_OT");
cPhs_Step step = dComIfG_resLoad(&mPhase, "E_OT");
if (step == cPhs_COMPLEATE_e) {
if (!fopAcM_entrySolidHeap(this, useHeapInit, 0x1f40)) {
return cPhs_ERROR_e;
@@ -825,7 +825,7 @@ cPhs__Step daE_OT_c::create() {
return step;
}
static cPhs__Step daE_OT_Create(daE_OT_c* i_this) {
static cPhs_Step daE_OT_Create(daE_OT_c* i_this) {
return i_this->create();
}
+3 -3
View File
@@ -2794,9 +2794,9 @@ void daE_PM_c::SkipChk() {
}
}
cPhs__Step daE_PM_c::Create() {
cPhs_Step daE_PM_c::Create() {
fopAcM_ct(this, daE_PM_c);
cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&mPhase, "E_PM");
cPhs_Step step = dComIfG_resLoad(&mPhase, "E_PM");
if (step == cPhs_COMPLEATE_e) {
if (!fopAcM_entrySolidHeap(this, useHeapInit, 0x45E0)) {
@@ -2855,7 +2855,7 @@ cPhs__Step daE_PM_c::Create() {
return step;
}
static cPhs__Step daE_PM_Create(fopAc_ac_c* i_this) {
static cPhs_Step daE_PM_Create(fopAc_ac_c* i_this) {
return static_cast<daE_PM_c*>(i_this)->Create();
}
+2 -2
View File
@@ -7274,7 +7274,7 @@ static int useHeapInit(fopAc_ac_c* a_this) {
return 1;
}
static cPhs__Step daE_RD_Create(fopAc_ac_c* a_this) {
static cPhs_Step daE_RD_Create(fopAc_ac_c* a_this) {
e_rd_class* i_this = (e_rd_class*)a_this;
fopAcM_ct(&i_this->actor, e_rd_class);
@@ -7302,7 +7302,7 @@ static cPhs__Step daE_RD_Create(fopAc_ac_c* a_this) {
i_this->mResName = "E_RD";
}
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, i_this->mResName);
cPhs_Step phase = dComIfG_resLoad(&i_this->mPhase, i_this->mResName);
if (phase == cPhs_COMPLEATE_e) {
if (strcmp(dComIfGp_getStartStageName(), "F_SP124") == 0) {
// Gerudo Desert
+2 -2
View File
@@ -4869,7 +4869,7 @@ static int useHeapInit(fopAc_ac_c* i_this) {
return 1;
}
static cPhs__Step daE_RDY_Create(fopAc_ac_c* i_this) {
static cPhs_Step daE_RDY_Create(fopAc_ac_c* i_this) {
e_rdy_class* _this = (e_rdy_class*)i_this;
fopAcM_ct(&_this->actor, e_rdy_class);
@@ -4881,7 +4881,7 @@ static cPhs__Step daE_RDY_Create(fopAc_ac_c* i_this) {
}
_this->mpArcName = "E_rdy";
cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhase, _this->mpArcName);
cPhs_Step step = dComIfG_resLoad(&_this->mPhase, _this->mpArcName);
if (step == cPhs_COMPLEATE_e) {
OS_REPORT("E_RDY PARAM %x\n", fopAcM_GetParam(i_this));
if (_this->field_0x5b8 != 3) {
+2 -2
View File
@@ -1094,9 +1094,9 @@ static int daE_SB_Delete(daE_SB_c* i_this) {
return i_this->Delete();
}
cPhs__Step daE_SB_c::Create() {
cPhs_Step daE_SB_c::Create() {
fopAcM_ct(this, daE_SB_c);
cPhs__Step phase = (cPhs__Step) dComIfG_resLoad(&mPhaseReq, "E_SB");
cPhs_Step phase = dComIfG_resLoad(&mPhaseReq, "E_SB");
if (phase == cPhs_COMPLEATE_e) {
field_0x61a = fopAcM_GetParam(this);
if (field_0x61a != 0xFF && dComIfGs_isSwitch(field_0x61a, fopAcM_GetRoomNo(this))) {
+2 -2
View File
@@ -1739,11 +1739,11 @@ static int useHeapInit(fopAc_ac_c* a_this) {
return 1;
}
static cPhs__Step daE_SF_Create(fopAc_ac_c* a_this) {
static cPhs_Step daE_SF_Create(fopAc_ac_c* a_this) {
e_sf_class* i_this = (e_sf_class*)a_this;
fopAcM_ct(a_this, e_sf_class);
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_sf");
cPhs_Step phase = dComIfG_resLoad(&i_this->mPhase, "E_sf");
if (phase == cPhs_COMPLEATE_e) {
i_this->mSwBit = a_this->current.angle.z & 0xFF;
if (i_this->mSwBit != 0xFF) {
+1 -1
View File
@@ -1163,7 +1163,7 @@ static int daE_SG_Create(fopAc_ac_c* i_this) {
e_sg_class* a_this = static_cast<e_sg_class*>(i_this);
fopAcM_ct(i_this, e_sg_class);
cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&a_this->mPhaseReq, "E_sg");
cPhs_Step step = dComIfG_resLoad(&a_this->mPhaseReq, "E_sg");
if (step == cPhs_COMPLEATE_e) {
if (!fopAcM_entrySolidHeap(i_this, useHeapInit, 4000)) {
+2 -2
View File
@@ -1895,10 +1895,10 @@ void daE_SM_c::initCoSph() {
mCoCore.OnTgNoHitMark();
}
cPhs__Step daE_SM_c::Create() {
cPhs_Step daE_SM_c::Create() {
fopAcM_ct(this, daE_SM_c);
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&mPhase, "E_SM");
cPhs_Step phase = dComIfG_resLoad(&mPhase, "E_SM");
if (phase == cPhs_COMPLEATE_e) {
OS_REPORT("E_SM PARAM %x\n", fopAcM_GetParam(this));
+2 -2
View File
@@ -3005,11 +3005,11 @@ static BOOL roof_initial_pos_set(e_st_class* i_this) {
return FALSE;
}
static cPhs__Step daE_ST_Create(fopAc_ac_c* a_this) {
static cPhs_Step daE_ST_Create(fopAc_ac_c* a_this) {
e_st_class* i_this = (e_st_class*)a_this;
fopAcM_ct(&i_this->actor, e_st_class);
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_st");
cPhs_Step phase = dComIfG_resLoad(&i_this->mPhase, "E_st");
if (phase == cPhs_COMPLEATE_e) {
OS_REPORT("E_st PARAM %x\n", fopAcM_GetParam(a_this));
i_this->arg0 = fopAcM_GetParam(a_this) & 0xF;
+2 -2
View File
@@ -1638,7 +1638,7 @@ static int useHeapInit(fopAc_ac_c* a_this) {
return i_this->CreateHeap();
}
cPhs__Step daE_SW_c::create() {
cPhs_Step daE_SW_c::create() {
fopAcM_ct(this, daE_SW_c);
field_0x68c = fopAcM_GetParam(this) & 15;
@@ -1682,7 +1682,7 @@ cPhs__Step daE_SW_c::create() {
field_0x696 = 0xFF;
}
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&mPhase, "E_SW");
cPhs_Step phase = dComIfG_resLoad(&mPhase, "E_SW");
if (phase == cPhs_COMPLEATE_e) {
OS_REPORT("E_SW PARAM %x %d %d\n", fopAcM_GetParam(this), field_0x696, fopAcM_GetID(this));
shape_angle.x = 0;
+205 -140
View File
@@ -1,13 +1,14 @@
/**
* @file d_a_e_tk.cpp
* @file d_a_e_tk.cpp
*
*/
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_e_tk.h"
#include "d/actor/d_a_e_tk_ball.h"
#include "d/d_com_inf_game.h"
#include "d/d_s_play.h"
#include "f_op/f_op_kankyo_mng.h"
enum Action {
@@ -45,26 +46,46 @@ static bool hio_set;
static daE_TK_HIO_c l_HIO;
daE_TK_HIO_c::daE_TK_HIO_c() {
field_0x04 = -1;
mRadiusScale = 1.9f;
mPlayerRange2 = 1400.0f;
mPlayerRange1 = 500.0f;
mSpeedModifier1 = 10.0f;
mSpeedModifier2 = 25.0f;
mNo = -1;
mBaseSize = 1.9f;
mPlayerDetectionDistanceFar = 1400.0f;
mPlayerDetectionDistanceNear = 500.0f;
mSwimSpeedModifier = 10.0f;
mFleeSpeedModifier = 25.0f;
}
static void anm_init(e_tk_class* i_this, int i_index, f32 i_morf, u8 i_attr, f32 i_rate) {
J3DAnmTransform* anm = (J3DAnmTransform*)dComIfG_getObjectRes("E_tk", i_index);
#if DEBUG
void daE_TK_HIO_c::genMessage(JORMContext* ctext) {
// Tadpole
ctext->genLabel(" タドポール", 0x80000001, 0U, NULL);
// Base Size
ctext->genSlider("基本サイズ", &mBaseSize, 0.0f, 5.0f);
// Player Detection Distance Far
ctext->genSlider("PL認識距離 遠", &mPlayerDetectionDistanceFar, 0.0f, 3000.0f);
// Player Detection Distance Near
ctext->genSlider("PL認識距離 近", &mPlayerDetectionDistanceNear, 0.0f, 3000.0f);
ctext->genLabel(" ", 0x80000001);
// ↓ Behavior not guaranteed if changed
ctext->genLabel(" ↓変更すると動作保証しません", 0x80000001);
// Swim Speed
ctext->genSlider("泳ぎ速度", &mSwimSpeedModifier, 0.0f, 40.0f);
// Flee Speed
ctext->genSlider("逃げ速度", &mFleeSpeedModifier, 0.0f, 40.0f);
}
#endif
i_this->mpMorf->setAnm(anm, i_attr, i_morf, i_rate, 0.0f, -1.0f);
static void anm_init(e_tk_class* i_this, int i_index, f32 i_morf, u8 i_attr, f32 i_rate) {
i_this->mpMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_tk", i_index), i_attr, i_morf,
i_rate, 0.0f, -1.0f);
i_this->mAnim = i_index;
}
static int daE_TK_Draw(e_tk_class* i_this) {
fopAc_ac_c* actor = i_this;
J3DModel* model = i_this->mpMorf->getModel();
g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr);
g_env_light.setLightTevColorType_MAJI(model, &i_this->tevStr);
g_env_light.settingTevStruct(0, &actor->current.pos, &actor->tevStr);
g_env_light.setLightTevColorType_MAJI(model, &actor->tevStr);
i_this->mpMorf->entryDL();
return 1;
}
@@ -72,6 +93,7 @@ static int daE_TK_Draw(e_tk_class* i_this) {
static int other_bg_check(e_tk_class* i_this, fopAc_ac_c* i_ac) {
fopAc_ac_c* actor = i_this;
dBgS_LinChk line_check;
cXyz _unk1;
cXyz start_pos;
cXyz end_pos;
@@ -90,7 +112,13 @@ static int other_bg_check(e_tk_class* i_this, fopAc_ac_c* i_ac) {
}
static int pl_y_check(e_tk_class* i_this) {
if (i_this->current.pos.y - dComIfGp_getPlayer(0)->current.pos.y > 130.0f) {
fopAc_ac_c* actor = i_this;
#if DEBUG // TODO: Debug Fakematch. On retail, actor is accessed before the gameInfo.
fopAc_ac_c* player = dComIfGp_getPlayer(0);
if (actor->current.pos.y - player->current.pos.y > 130.0f) {
#else
if (actor->current.pos.y - dComIfGp_getPlayer(0)->current.pos.y > 130.0f) {
#endif
return 0;
} else {
return 1;
@@ -98,10 +126,11 @@ static int pl_y_check(e_tk_class* i_this) {
}
static int pl_check(e_tk_class* i_this, f32 i_limit, s16 i_max_diff) {
fopAc_ac_c* actor = i_this;
fopAc_ac_c* player = dComIfGp_getPlayer(0);
if (i_this->mPlayerDistanceLimit < i_limit) {
s16 diff = i_this->shape_angle.y - i_this->mPlayerAngleY;
s16 diff = actor->shape_angle.y - i_this->mPlayerAngleY;
if (diff < i_max_diff && diff > (s16)-i_max_diff && !other_bg_check(i_this, player)) {
return 1;
}
@@ -111,6 +140,9 @@ static int pl_check(e_tk_class* i_this, f32 i_limit, s16 i_max_diff) {
}
static void damage_check(e_tk_class* i_this) {
fopAc_ac_c* actor = i_this;
fopAc_ac_c* player = dComIfGp_getPlayer(0);
if (i_this->mInvincibilityTimer == 0) {
i_this->mStts.Move();
@@ -129,7 +161,7 @@ static void damage_check(e_tk_class* i_this) {
i_this->mMode = MODE_TK_KYORO2;
i_this->mActionTimer[0] = 50;
} else {
cc_at_check(i_this, &i_this->mAtInfo);
cc_at_check(actor, &i_this->mAtInfo);
if (i_this->mAtInfo.mHitType == HIT_TYPE_STUN) {
i_this->mAction = ACT_TK_S_DAMAGE;
} else {
@@ -139,8 +171,8 @@ static void damage_check(e_tk_class* i_this) {
}
}
if (i_this->health <= 1) {
i_this->health = 0;
if (actor->health <= 1) {
actor->health = 0;
i_this->mSph.SetTgHitMark(CcG_Tg_UNK_MARK_3);
}
}
@@ -152,12 +184,12 @@ static int way_bg_check(e_tk_class* i_this, f32 i_limit) {
cXyz mtx_pos;
cXyz start_pos;
cXyz end_pos;
start_pos = actor->current.pos;
start_pos.y -= 50.0f;
mDoMtx_YrotS(*calc_mtx, actor->shape_angle.y);
cMtx_YrotS(*calc_mtx, actor->shape_angle.y);
cXyz end_pos;
mtx_pos.x = 0.0;
mtx_pos.y = -50.0f;
mtx_pos.z = i_limit;
@@ -174,8 +206,11 @@ static int way_bg_check(e_tk_class* i_this, f32 i_limit) {
}
static void e_tk_wait_0(e_tk_class* i_this) {
fopAc_ac_c* actor = i_this;
cXyz src_pos;
f32 speed_mul = 1.0f;
f32 speed_step = 1.0f + YREG_F(5);
i_this->mAttentionOFF = true;
@@ -187,23 +222,23 @@ static void e_tk_wait_0(e_tk_class* i_this) {
case MODE_TK_APPEAR:
if (i_this->mActionTimer[0] == 0) {
src_pos = i_this->home.pos - i_this->current.pos;
src_pos = actor->home.pos - actor->current.pos;
i_this->mSomeAngle = cM_atan2s(src_pos.x, src_pos.z) + (s16)cM_rndFX(8000.0f);
i_this->mActionTimer[0] = cM_rndF(30.0f) + 30.0f;
}
if (i_this->mActionTimer[2] == 0 && way_bg_check(i_this, 200.0f)) {
i_this->mActionTimer[2] = 40;
src_pos = i_this->home.pos - i_this->current.pos;
src_pos = actor->home.pos - actor->current.pos;
i_this->mSomeAngle = cM_atan2s(src_pos.x, src_pos.z) + (s16)cM_rndFX(2000.0f);
i_this->mActionTimer[0] = cM_rndF(30.0f) + 30.0f;
}
if (i_this->mActionTimer[1] == 0 && pl_y_check(i_this) &&
pl_check(i_this, l_HIO.mPlayerRange2, 0x4000))
pl_check(i_this, l_HIO.mPlayerDetectionDistanceFar, 0x4000))
{
i_this->mAction = ACT_TK_FIND;
if (pl_check(i_this, l_HIO.mPlayerRange1, 0x4000)) {
if (pl_check(i_this, l_HIO.mPlayerDetectionDistanceNear, 0x4000)) {
i_this->mMode = MODE_TK_WAIT01;
} else {
i_this->mMode = MODE_TK_NONE;
@@ -212,19 +247,22 @@ static void e_tk_wait_0(e_tk_class* i_this) {
break;
}
cLib_addCalcAngleS2(&i_this->shape_angle.y, i_this->mSomeAngle, 0x10, 0x400);
cLib_addCalcAngleS2(&i_this->shape_angle.x, 0, 0x10, 0x400);
cLib_addCalc2(&i_this->speedF, l_HIO.mSpeedModifier1 * speed_mul, 1.0f, 1.0f);
cMtx_YrotS(*calc_mtx, i_this->shape_angle.y);
cLib_addCalcAngleS2(&actor->shape_angle.y, i_this->mSomeAngle, 0x10, 0x400);
cLib_addCalcAngleS2(&actor->shape_angle.x, 0, 0x10, 0x400);
cLib_addCalc2(&actor->speedF, l_HIO.mSwimSpeedModifier * speed_mul, 1.0f, speed_step);
cMtx_YrotS(*calc_mtx, actor->shape_angle.y);
src_pos.x = 0.0f;
src_pos.y = 0.0f;
src_pos.z = i_this->speedF;
MtxPosition(&src_pos, &i_this->speed);
i_this->current.pos += i_this->speed;
src_pos.z = actor->speedF;
MtxPosition(&src_pos, &actor->speed);
actor->current.pos += actor->speed;
}
static void e_tk_find(e_tk_class* i_this) {
fopAc_ac_c* actor = i_this;
cXyz local_58;
f32 speed_target = 0.0f;
f32 speed_step = 3.0f;
@@ -247,7 +285,7 @@ static void e_tk_find(e_tk_class* i_this) {
i_this->mAction = ACT_TK_ATTACK;
i_this->mMode = MODE_TK_NONE;
} else {
if (pl_check(i_this, l_HIO.mPlayerRange1, 0x4000)) {
if (pl_check(i_this, l_HIO.mPlayerDetectionDistanceNear, 0x4000)) {
i_this->mMode = MODE_TK_KYORO2;
}
}
@@ -279,7 +317,7 @@ static void e_tk_find(e_tk_class* i_this) {
break;
case MODE_TK_SWIM:
i_this->mPlayerAngleY = i_this->mPlayerAngleY + -0x8000;
ADD_ANGLE(i_this->mPlayerAngleY, 0x8000);
i_this->mAttentionOFF = true;
if (i_this->mpMorf->isStop()) {
i_this->mAnimSpeed = 4.0f;
@@ -292,10 +330,10 @@ static void e_tk_find(e_tk_class* i_this) {
i_this->mAttentionOFF = true;
cLib_addCalc2(&i_this->mAnimSpeed, 2.0f, 1.0f, 0.15f);
i_this->mpMorf->setPlaySpeed(i_this->mAnimSpeed);
speed_target = 1.0f;
speed_step = 10.0f;
speed_target = 1.0f + YREG_F(17);
speed_step = 10.0f + YREG_F(18);
if (i_this->mActionTimer[0] == 0 &&
i_this->mPlayerDistanceLimit > l_HIO.mPlayerRange1 * 1.2f)
i_this->mPlayerDistanceLimit > l_HIO.mPlayerDetectionDistanceNear * 1.2f)
{
i_this->mMode = MODE_TK_NONE;
} else {
@@ -305,27 +343,28 @@ static void e_tk_find(e_tk_class* i_this) {
}
}
if (i_this->mActionTimer[1] == 0) {
i_this->mPlayerAngleY = i_this->mPlayerAngleY - 0x8000;
ADD_ANGLE(i_this->mPlayerAngleY, 0x8000);
} else {
i_this->mPlayerAngleY = i_this->mSomeAngle;
}
break;
}
cLib_addCalcAngleS2(&i_this->shape_angle.y, i_this->mPlayerAngleY, 4, 0x800);
cLib_addCalc2(&i_this->speedF, l_HIO.mSpeedModifier2 * speed_target, 1.0f, speed_step);
cMtx_YrotS(*calc_mtx, i_this->shape_angle.y);
cLib_addCalcAngleS2(&actor->shape_angle.y, i_this->mPlayerAngleY, 4, 0x800);
cLib_addCalc2(&actor->speedF, l_HIO.mFleeSpeedModifier * speed_target, 1.0f, speed_step);
cMtx_YrotS(*calc_mtx, actor->shape_angle.y);
cXyz local_58;
local_58.x = 0.0f;
local_58.y = 0.0f;
local_58.z = i_this->speedF;
MtxPosition(&local_58, &i_this->speed);
i_this->current.pos += i_this->speed;
cLib_addCalcAngleS2(&i_this->shape_angle.x, 0, 4, 0x400);
local_58.z = actor->speedF;
MtxPosition(&local_58, &actor->speed);
actor->current.pos += actor->speed;
cLib_addCalcAngleS2(&actor->shape_angle.x, 0, 4, 0x400);
}
static void e_tk_attack(e_tk_class* i_this) {
fopAc_ac_c* actor = i_this;
switch (i_this->mMode) {
case MODE_TK_NONE:
i_this->mMode = MODE_TK_APPEAR;
@@ -336,8 +375,8 @@ static void e_tk_attack(e_tk_class* i_this) {
if (pl_y_check(i_this)) {
if ((int)i_this->mpMorf->getFrame() == 24) {
i_this->mBallID =
fopAcM_createChild(PROC_E_TK_BALL, fopAcM_GetID(i_this), 0, &i_this->eyePos,
fopAcM_GetRoomNo(i_this), &i_this->shape_angle, 0, -1, 0);
fopAcM_createChild(PROC_E_TK_BALL, fopAcM_GetID(actor), 0, &actor->eyePos,
fopAcM_GetRoomNo(actor), &actor->shape_angle, 0, -1, 0);
}
if ((int)i_this->mpMorf->getFrame() == 28) {
i_this->mTKBallSpawned = true;
@@ -355,22 +394,24 @@ static void e_tk_attack(e_tk_class* i_this) {
i_this->mAction = ACT_TK_FIND;
i_this->mMode = MODE_TK_DAMAGE;
}
if (pl_check(i_this, l_HIO.mPlayerRange1, 0x4000)) {
if (pl_check(i_this, l_HIO.mPlayerDetectionDistanceNear, 0x4000)) {
i_this->mAction = ACT_TK_FIND;
i_this->mMode = MODE_TK_KYORO2;
}
break;
}
cLib_addCalcAngleS2(&i_this->shape_angle.y, i_this->mPlayerAngleY, 4, 0x800);
cLib_addCalcAngleS2(&actor->shape_angle.y, i_this->mPlayerAngleY, 4, 0x800);
}
static void e_tk_pathswim(e_tk_class* i_this) {
fopAc_ac_c* actor = i_this;
cXyz local_50;
cXyz _unk1;
f32 speed_target = 1.0f;
f32 speed_step = 1.0f;
f32 speed_step = 1.0f + YREG_F(5);
switch (i_this->mMode) {
case MODE_TK_NONE:
anm_init(i_this, ANM_TK_SWIM, 5.0f, 0x2, 1.0f);
@@ -400,7 +441,7 @@ static void e_tk_pathswim(e_tk_class* i_this) {
}
case MODE_TK_ATTACK:
local_50 = i_this->mPos - i_this->current.pos;
local_50 = i_this->mPos - actor->current.pos;
if (JMAFastSqrt(local_50.x * local_50.x + local_50.z * local_50.z) < 100.0f) {
dPnt* point = &i_this->mpPath->m_points[i_this->mPathID];
if (point->mArg0 != 0x2) {
@@ -412,14 +453,15 @@ static void e_tk_pathswim(e_tk_class* i_this) {
i_this->mMode = MODE_TK_APPEAR;
}
}
i_this->mSomeAngle = cM_atan2s(local_50.x, local_50.z);
i_this->mSomeAngle = (s16)cM_atan2s(local_50.x, local_50.z);
break;
case MODE_TK_DAMAGE:
speed_target = 0.0f;
speed_step = 3.0f;
dPnt* point;
if (i_this->mActionTimer[1] == 0 && pl_y_check(i_this) &&
pl_check(i_this, l_HIO.mPlayerRange2, 0x4000))
pl_check(i_this, l_HIO.mPlayerDetectionDistanceFar, 0x4000))
{
i_this->mAction = ACT_TK_FIND;
anm_init(i_this, ANM_TK_WAIT01, 5.0f, 0x2, 1.0f);
@@ -432,18 +474,20 @@ static void e_tk_pathswim(e_tk_class* i_this) {
break;
}
cLib_addCalcAngleS2(&i_this->shape_angle.y, i_this->mSomeAngle, 8, 0x400);
cLib_addCalc2(&i_this->speedF, l_HIO.mSpeedModifier1 * speed_target, 1.0f, speed_step);
cMtx_YrotS(*calc_mtx, i_this->shape_angle.y);
cLib_addCalcAngleS2(&actor->shape_angle.y, i_this->mSomeAngle, 8, 0x400);
cLib_addCalc2(&actor->speedF, l_HIO.mSwimSpeedModifier * speed_target, 1.0f, speed_step);
cMtx_YrotS(*calc_mtx, actor->shape_angle.y);
local_50.x = 0.0f;
local_50.y = 0.0f;
local_50.z = i_this->speedF;
MtxPosition(&local_50, &i_this->speed);
i_this->current.pos += i_this->speed;
local_50.z = actor->speedF;
MtxPosition(&local_50, &actor->speed);
actor->current.pos += actor->speed;
}
static void e_tk_s_damage(e_tk_class* i_this) {
fopAc_ac_c* actor = i_this;
switch (i_this->mMode) {
case MODE_TK_NONE:
anm_init(i_this, ANM_TK_DAMAGE, 2.0f, 0x0, 1.0f);
@@ -451,7 +495,7 @@ static void e_tk_s_damage(e_tk_class* i_this) {
break;
case MODE_TK_APPEAR:
if (i_this->mpMorf->getFrame() > 10.0f) {
if (i_this->mpMorf->getFrame() > 10.0f + YREG_F(3)) {
i_this->mAction = ACT_TK_FIND;
i_this->mMode = MODE_TK_DAMAGE;
}
@@ -460,6 +504,8 @@ static void e_tk_s_damage(e_tk_class* i_this) {
}
static void e_tk_damage(e_tk_class* i_this) {
fopAc_ac_c* actor = i_this;
i_this->mInvincibilityTimer = 6;
i_this->mAttentionOFF = true;
@@ -471,16 +517,21 @@ static void e_tk_damage(e_tk_class* i_this) {
case MODE_TK_APPEAR:
if (i_this->mpMorf->isStop()) {
fopAcM_createDisappear(i_this, &i_this->eyePos, 10, 0, 0x11);
fopAcM_delete(i_this);
fopAcM_createDisappear(actor, &actor->eyePos, 10, 0, 0x11);
fopAcM_delete(actor);
}
break;
}
}
static void action(e_tk_class* i_this) {
i_this->mPlayerAngleY = fopAcM_searchPlayerAngleY(i_this);
i_this->mPlayerDistanceLimit = fopAcM_searchPlayerDistance(i_this);
fopAc_ac_c* actor = i_this;
cXyz _unk1;
cXyz _unk2;
i_this->mPlayerAngleY = fopAcM_searchPlayerAngleY(actor);
i_this->mPlayerDistanceLimit = fopAcM_searchPlayerDistance(actor);
damage_check(i_this);
s8 link_search_flag = false;
@@ -513,27 +564,32 @@ static void action(e_tk_class* i_this) {
i_this->mSound.setLinkSearch(false);
}
if (i_this->speedF < 2.0f) {
cXyz this_pos = i_this->current.pos;
fopAcM_effHamonSet(&i_this->mHamonSet, &this_pos, 2.3f, 0.05f);
if (actor->speedF < 2.0f) {
cXyz this_pos = actor->current.pos;
f32 emit_rate = 0.05f + KREG_F(3);
fopAcM_effHamonSet(&i_this->mHamonSet, &this_pos, 2.3f + KREG_F(2), emit_rate);
}
}
static int daE_TK_Execute(e_tk_class* i_this) {
fopAc_ac_c* actor = i_this;
cXyz cStack_94;
cXyz cStack_a0;
if (i_this->mExecuteState == 0x00) {
dBgS_ObjGndChk_Spl ground_check;
cStack_94 = i_this->current.pos;
cStack_94 = actor->current.pos;
cStack_94.y += 200.0f;
ground_check.SetPos(&cStack_94);
i_this->current.pos.y = dComIfG_Bgsp().GroundCross(&ground_check);
f32 ground_cross = dComIfG_Bgsp().GroundCross(&ground_check);
actor->current.pos.y = ground_cross + KREG_F(17);
}
i_this->mLifetime++;
i_this->mAttentionOFF = false;
for (int i = 0; i <= 3; i++) {
for (int i = 0; i < 4; i++) {
(void)i; // Debug Fakematch: Force i into register.
if (i_this->mActionTimer[i] != 0) {
i_this->mActionTimer[i]--;
}
@@ -545,20 +601,20 @@ static int daE_TK_Execute(e_tk_class* i_this) {
action(i_this);
i_this->mAcch.CrrPos(dComIfG_Bgsp());
mDoMtx_stack_c::transS(i_this->current.pos.x, i_this->current.pos.y, i_this->current.pos.z);
mDoMtx_stack_c::YrotM(i_this->shape_angle.y);
mDoMtx_stack_c::XrotM(i_this->shape_angle.x);
mDoMtx_stack_c::scaleM(l_HIO.mRadiusScale, l_HIO.mRadiusScale, l_HIO.mRadiusScale);
mDoMtx_stack_c::transS(actor->current.pos.x, actor->current.pos.y, actor->current.pos.z);
mDoMtx_stack_c::YrotM(actor->shape_angle.y);
mDoMtx_stack_c::XrotM(actor->shape_angle.x);
mDoMtx_stack_c::scaleM(l_HIO.mBaseSize, l_HIO.mBaseSize, l_HIO.mBaseSize);
J3DModel* model = i_this->mpMorf->getModel();
model->setBaseTRMtx(mDoMtx_stack_c::get());
i_this->mpMorf->play(0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this)));
i_this->mpMorf->play(0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor)));
if (i_this->mpMorf->checkFrame(6.0f) &&
(i_this->mAnim == ANM_TK_APPEAR || i_this->mAnim == ANM_TK_HIDE))
{
fopKyM_createWpillar(&i_this->current.pos, 2.3f, 0);
fopKyM_createWpillar(&actor->current.pos, 2.3f + KREG_F(6), 0);
}
if (i_this->mAnim == ANM_TK_SWIM) {
@@ -602,33 +658,31 @@ static int daE_TK_Execute(e_tk_class* i_this) {
MTXCopy(model->getAnmMtx(3), *calc_mtx);
cStack_94.set(0.0f, 0.0f, 0.0f);
MtxPosition(&cStack_94, &i_this->eyePos);
MtxPosition(&cStack_94, &actor->eyePos);
i_this->attention_info.position = i_this->eyePos;
i_this->attention_info.position.y =
i_this->attention_info.position.y + l_HIO.mRadiusScale * 35.0f;
actor->attention_info.position = actor->eyePos;
actor->attention_info.position.y = actor->attention_info.position.y + l_HIO.mBaseSize * 35.0f;
if (i_this->mTKBallSpawned) {
e_tk_ball_class* ball_actor =
static_cast<e_tk_ball_class*>(fopAcM_SearchByID(i_this->mBallID));
if (ball_actor != NULL) {
ball_actor->current.pos = i_this->eyePos;
ball_actor->current.pos = actor->eyePos;
ball_actor->mSuspended = false;
}
cXyz scale;
scale.setall(2.0f);
dComIfGp_particle_set(0x819B, &i_this->eyePos, &i_this->shape_angle, &scale);
dComIfGp_particle_set(0x819C, &i_this->eyePos, &i_this->shape_angle, &scale);
cXyz scale(2.0f + TREG_F(8), 2.0f + TREG_F(8), 2.0f + TREG_F(8));
dComIfGp_particle_set(0x819B, &actor->eyePos, &actor->shape_angle, &scale);
dComIfGp_particle_set(0x819C, &actor->eyePos, &actor->shape_angle, &scale);
i_this->mTKBallSpawned = false;
}
if (i_this->mAttentionOFF) {
fopAcM_OffStatus(i_this, 0);
i_this->attention_info.flags = 0;
fopAcM_OffStatus(actor, 0);
actor->attention_info.flags = 0;
} else {
fopAcM_OnStatus(i_this, 0);
i_this->attention_info.flags = fopAc_AttnFlag_BATTLE_e;
fopAcM_OnStatus(actor, 0);
actor->attention_info.flags = fopAc_AttnFlag_BATTLE_e;
}
MTXCopy(model->getAnmMtx(2), *calc_mtx);
@@ -636,7 +690,7 @@ static int daE_TK_Execute(e_tk_class* i_this) {
MtxPosition(&cStack_94, &cStack_a0);
i_this->mSph.SetC(cStack_a0);
i_this->mSph.SetR(50.0f * l_HIO.mRadiusScale);
i_this->mSph.SetR((50.0f + JREG_F(3)) * l_HIO.mBaseSize);
dComIfG_Ccsp()->Set(&i_this->mSph);
@@ -648,18 +702,23 @@ static int daE_TK_IsDelete(e_tk_class* i_this) {
}
static int daE_TK_Delete(e_tk_class* i_this) {
fopAc_ac_c* actor = i_this;
fopAcM_RegisterDeleteID(i_this, "E_TK");
dComIfG_resDelete(&i_this->mPhaseReq, "E_tk");
if (i_this->mInitHIO) {
hio_set = false;
mDoHIO_DELETE_CHILD(l_HIO.mNo);
}
if (i_this->heap != NULL) {
if (actor->heap != NULL) {
i_this->mpMorf->stopZelAnime();
}
return 1;
}
static int useHeapInit(fopAc_ac_c* a_this) {
e_tk_class* i_this = static_cast<e_tk_class*>(a_this);
static int useHeapInit(fopAc_ac_c* actor) {
e_tk_class* i_this = static_cast<e_tk_class*>(actor);
i_this->mpMorf =
new mDoExt_McaMorfSO((J3DModelData*)dComIfG_getObjectRes("E_tk", 0xE), NULL, NULL,
@@ -673,70 +732,76 @@ static int useHeapInit(fopAc_ac_c* a_this) {
return 1;
}
static int daE_TK_Create(fopAc_ac_c* i_this) {
static dCcD_SrcSph cc_sph_src = {
{
{0x0, {{0x0, 0x0, 0xd}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg
{0x0}, // mGObjCo
}, // mObjInf
{
{{0.0f, 0.0f, 0.0f}, 40.0f} // mSph
} // mSphAttr
};
static int daE_TK_Create(fopAc_ac_c* actor) {
e_tk_class* i_this = (e_tk_class*)actor;
fopAcM_ct(i_this, e_tk_class);
e_tk_class* const a_this = static_cast<e_tk_class*>(i_this);
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&a_this->mPhaseReq, "E_tk");
cPhs_Step phase = dComIfG_resLoad(&i_this->mPhaseReq, "E_tk");
if (phase == cPhs_COMPLEATE_e) {
a_this->mArg0 = fopAcM_GetParamBit(a_this, 0, 8);
a_this->mArg1 = fopAcM_GetParamBit(a_this, 8, 4);
a_this->mArg2 = fopAcM_GetParamBit(a_this, 12, 4);
a_this->mParamPathIdx = fopAcM_GetParamBit(a_this, 16, 8);
OS_REPORT("E_tk PARAM %x\n", fopAcM_GetParam(actor));
i_this->mArg0 = (fopAcM_GetParam(actor) & 0xFF) >> 0;
i_this->mArg1 = (fopAcM_GetParam(actor) & 0xF00) >> 8;
i_this->mArg2 = (fopAcM_GetParam(actor) & 0xF000) >> 12;
i_this->mParamPathIdx = (fopAcM_GetParam(actor) & 0xFF0000) >> 16;
if (!fopAcM_entrySolidHeap(a_this, useHeapInit, 0x1e20)) {
OS_REPORT("E_tk//////////////E_TK SET 1 !!\n");
if (!fopAcM_entrySolidHeap(actor, useHeapInit, 0x1e20)) {
OS_REPORT("//////////////E_TK SET NON !!\n");
return cPhs_ERROR_e;
}
if (a_this->mParamPathIdx != 0xff) {
a_this->mpPath = dPath_GetRoomPath(a_this->mParamPathIdx, fopAcM_GetRoomNo(a_this));
if (a_this->mpPath == NULL) {
OS_REPORT("//////////////E_TK SET 2 !!\n");
if (i_this->mParamPathIdx != 0xff) {
i_this->mpPath = dPath_GetRoomPath(i_this->mParamPathIdx, fopAcM_GetRoomNo(actor));
if (i_this->mpPath == NULL) {
OS_REPORT("//////////////E_TK NON PATH !!!\n");
return cPhs_ERROR_e;
}
a_this->mPathLoaded = a_this->mParamPathIdx + 0x1;
a_this->mPathDirection = 0x1;
a_this->mAction = ACT_TK_PATHSWIM;
i_this->mPathLoaded = i_this->mParamPathIdx + 0x1;
i_this->mPathDirection = 0x1;
i_this->mAction = ACT_TK_PATHSWIM;
}
if (hio_set == false) {
a_this->mInitHIO = true;
i_this->mInitHIO = true;
hio_set = true;
l_HIO.field_0x04 = -1;
l_HIO.mNo = mDoHIO_CREATE_CHILD("たどぽーる", &l_HIO); // "Tadpole"
}
a_this->attention_info.flags = fopAc_AttnFlag_BATTLE_e;
actor->attention_info.flags = fopAc_AttnFlag_BATTLE_e;
fopAcM_SetMtx(a_this, a_this->mpMorf->getModel()->getBaseTRMtx());
fopAcM_SetMin(a_this, -100.0f, -100.0f, -100.0f);
fopAcM_SetMax(a_this, 100.0f, 100.0f, 100.0f);
fopAcM_SetMtx(actor, i_this->mpMorf->getModel()->getBaseTRMtx());
fopAcM_SetMin(actor, -100.0f, -100.0f, -100.0f);
fopAcM_SetMax(actor, 100.0f, 100.0f, 100.0f);
a_this->attention_info.distances[fopAc_attn_BATTLE_e] = 0x04;
a_this->health = 10;
a_this->field_0x560 = 10;
actor->attention_info.distances[fopAc_attn_BATTLE_e] = 0x04;
actor->field_0x560 = actor->health = 10;
a_this->mStts.Init(100, 0, a_this);
a_this->mSph.Set(cc_sph_src);
a_this->mSph.SetStts(&a_this->mStts);
static dCcD_SrcSph cc_sph_src = {
{
{0x0, {{0x0, 0x0, 0xd}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg
{0x0}, // mGObjCo
}, // mObjInf
{
{{0.0f, 0.0f, 0.0f}, 40.0f} // mSph
} // mSphAttr
};
a_this->mAcch.Set(&i_this->current.pos, &a_this->old.pos, a_this, 1, &a_this->mAcchCir,
fopAcM_GetSpeed_p(a_this), NULL, NULL);
i_this->mStts.Init(100, 0, actor);
i_this->mSph.Set(cc_sph_src);
i_this->mSph.SetStts(&i_this->mStts);
a_this->mAcchCir.SetWall(-50.0f, 60.0f);
a_this->mSound.init(&a_this->current.pos, &a_this->eyePos, 0x3, 0x1);
a_this->mSound.setEnemyName("E_tk");
a_this->mAtInfo.mpSound = &a_this->mSound;
a_this->mExecuteState = 0x14;
daE_TK_Execute(a_this);
i_this->mAcch.Set(fopAcM_GetPosition_p(actor), fopAcM_GetOldPosition_p(actor), actor, 1,
&i_this->mAcchCir, fopAcM_GetSpeed_p(actor), NULL, NULL);
i_this->mAcchCir.SetWall(-50.0f, 60.0f);
i_this->mSound.init(&actor->current.pos, &actor->eyePos, 0x3, 0x1);
i_this->mSound.setEnemyName("E_tk");
i_this->mAtInfo.mpSound = &i_this->mSound;
i_this->mExecuteState = 0x14;
daE_TK_Execute(i_this);
}
return phase;
}
+159 -96
View File
@@ -1,13 +1,14 @@
/**
* @file d_a_e_tk2.cpp
* @file d_a_e_tk2.cpp
*
*/
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_e_tk2.h"
#include "d/actor/d_a_e_tk_ball.h"
#include "d/d_com_inf_game.h"
#include "d/d_s_play.h"
enum Action {
/* 0x0 */ ACT_TK2_WAIT,
@@ -43,26 +44,46 @@ static bool hio_set;
static daE_TK2_HIO_c l_HIO;
daE_TK2_HIO_c::daE_TK2_HIO_c() {
field_0x04 = -1;
mRadiusScale = 2.3f;
mPlayerRange2 = 1400.0f;
mPlayerRange1 = 500.0f;
mSpeedModifier1 = 10.0f;
mSpeedModifier2 = 25.0f;
mNo = -1;
mBaseSize = 2.3f;
mPlayerDetectionDistanceFar = 1400.0f;
mPlayerDetectionDistanceNear = 500.0f;
mSwimSpeedModifier = 10.0f;
mFleeSpeedModifier = 25.0f;
}
static void anm_init(e_tk2_class* i_this, int i_index, f32 i_morf, u8 i_attr, f32 i_rate) {
J3DAnmTransform* anm = (J3DAnmTransform*)dComIfG_getObjectRes("E_tk2", i_index);
#if DEBUG
void daE_TK2_HIO_c::genMessage(JORMContext* ctext) {
// Tadpole
ctext->genLabel(" タドポール", 0x80000001, 0U, NULL);
// Base Size
ctext->genSlider("基本サイズ", &mBaseSize, 0.0f, 5.0f);
// Player Detection Distance Far
ctext->genSlider("PL認識距離 遠", &mPlayerDetectionDistanceFar, 0.0f, 3000.0f);
// Player Detection Distance Near
ctext->genSlider("PL認識距離 近", &mPlayerDetectionDistanceNear, 0.0f, 3000.0f);
ctext->genLabel(" ", 0x80000001);
// ↓ Behavior not guaranteed if changed
ctext->genLabel(" ↓変更すると動作保証しません", 0x80000001);
// Swim Speed
ctext->genSlider("泳ぎ速度", &mSwimSpeedModifier, 0.0f, 40.0f);
// Flee Speed
ctext->genSlider("逃げ速度", &mFleeSpeedModifier, 0.0f, 40.0f);
}
#endif
i_this->mpMorf->setAnm(anm, i_attr, i_morf, i_rate, 0.0f, -1.0f);
static void anm_init(e_tk2_class* i_this, int i_index, f32 i_morf, u8 i_attr, f32 i_rate) {
i_this->mpMorf->setAnm((J3DAnmTransform*)dComIfG_getObjectRes("E_tk2", i_index), i_attr, i_morf,
i_rate, 0.0f, -1.0f);
i_this->mAnim = i_index;
}
static int daE_TK2_Draw(e_tk2_class* i_this) {
fopAc_ac_c* actor = i_this;
J3DModel* model = i_this->mpMorf->getModel();
g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr);
g_env_light.setLightTevColorType_MAJI(model, &i_this->tevStr);
g_env_light.settingTevStruct(0, &actor->current.pos, &actor->tevStr);
g_env_light.setLightTevColorType_MAJI(model, &actor->tevStr);
i_this->mpMorf->entryDL();
return 1;
}
@@ -70,6 +91,7 @@ static int daE_TK2_Draw(e_tk2_class* i_this) {
static int other_bg_check(e_tk2_class* i_this, fopAc_ac_c* i_ac) {
fopAc_ac_c* actor = i_this;
dBgS_LinChk line_check;
cXyz _unk1;
cXyz start_pos;
cXyz end_pos;
@@ -88,10 +110,11 @@ static int other_bg_check(e_tk2_class* i_this, fopAc_ac_c* i_ac) {
}
static int pl_check(e_tk2_class* i_this, f32 i_limit, s16 i_max_diff) {
fopAc_ac_c* actor = i_this;
fopAc_ac_c* player = dComIfGp_getPlayer(0);
if (i_this->mPlayerDistanceLimit < i_limit) {
s16 diff = i_this->shape_angle.y - i_this->mPlayerAngleY;
s16 diff = actor->shape_angle.y - i_this->mPlayerAngleY;
if (diff < i_max_diff && diff > (s16)-i_max_diff && !other_bg_check(i_this, player)) {
return 1;
}
@@ -101,6 +124,9 @@ static int pl_check(e_tk2_class* i_this, f32 i_limit, s16 i_max_diff) {
}
static void damage_check(e_tk2_class* i_this) {
fopAc_ac_c* actor = i_this;
fopAc_ac_c* player = dComIfGp_getPlayer(0);
if (i_this->mInvincibilityTimer == 0) {
i_this->mStts.Move();
@@ -119,7 +145,7 @@ static void damage_check(e_tk2_class* i_this) {
i_this->mMode = MODE_TK2_KYORO2;
i_this->mActionTimer[0] = 50;
} else {
cc_at_check(i_this, &i_this->mAtInfo);
cc_at_check(actor, &i_this->mAtInfo);
if (i_this->mAtInfo.mHitType == HIT_TYPE_STUN) {
i_this->mAction = ACT_TK2_S_DAMAGE;
} else {
@@ -129,18 +155,24 @@ static void damage_check(e_tk2_class* i_this) {
}
}
if (i_this->health <= 1) {
i_this->health = 0;
if (actor->health <= 1) {
actor->health = 0;
i_this->mSph.SetTgHitMark(CcG_Tg_UNK_MARK_3);
}
if (i_this->health <= 1) { // Yes, this is a duplicate (??)
i_this->health = 0;
if (actor->health <= 1) { // Yes, this is a duplicate (??)
actor->health = 0;
i_this->mSph.SetTgHitMark(CcG_Tg_UNK_MARK_3);
}
}
}
static void e_tk2_wait_0(e_tk2_class* i_this) {
fopAc_ac_c* actor = i_this;
cXyz src_pos;
f32 speed_mul = 1.0f;
f32 speed_step = 1.0f + YREG_F(5);
i_this->mAttentionOFF = true;
switch (i_this->mMode) {
@@ -149,7 +181,9 @@ static void e_tk2_wait_0(e_tk2_class* i_this) {
break;
case MODE_TK2_APPEAR:
if (i_this->mActionTimer[1] == 0 && pl_check(i_this, l_HIO.mPlayerRange2, 0x4000)) {
if (i_this->mActionTimer[1] == 0 &&
pl_check(i_this, l_HIO.mPlayerDetectionDistanceFar, 0x4000))
{
i_this->mAction = ACT_TK2_FIND;
i_this->mMode = MODE_TK2_NONE;
}
@@ -157,10 +191,16 @@ static void e_tk2_wait_0(e_tk2_class* i_this) {
}
i_this->mSomeAngle = i_this->mPlayerAngleY;
cLib_addCalcAngleS2(&i_this->shape_angle.y, i_this->mSomeAngle, 0x10, 0x400);
cLib_addCalcAngleS2(&actor->shape_angle.y, i_this->mSomeAngle, 0x10, 0x400);
}
static void e_tk2_find(e_tk2_class* i_this) {
fopAc_ac_c* actor = i_this;
cXyz local_58;
f32 speed_target = 0.0f;
f32 speed_step = 3.0f;
switch (i_this->mMode) {
case MODE_TK2_NONE:
anm_init(i_this, ANM_TK2_APPEAR, 3.0f, 0x0, 1.0f);
@@ -202,7 +242,7 @@ static void e_tk2_find(e_tk2_class* i_this) {
break;
case MODE_TK2_SWIM:
i_this->mPlayerAngleY = i_this->mPlayerAngleY + -0x8000;
ADD_ANGLE(i_this->mPlayerAngleY, 0x8000);
i_this->mAttentionOFF = true;
if (i_this->mpMorf->isStop()) {
i_this->mAnimSpeed = 4.0f;
@@ -215,8 +255,10 @@ static void e_tk2_find(e_tk2_class* i_this) {
i_this->mAttentionOFF = true;
cLib_addCalc2(&i_this->mAnimSpeed, 2.0f, 1.0f, 0.15f);
i_this->mpMorf->setPlaySpeed(i_this->mAnimSpeed);
speed_target = 1.0f + YREG_F(17);
speed_step = 10.0f + YREG_F(18);
if (i_this->mActionTimer[0] == 0 &&
i_this->mPlayerDistanceLimit > l_HIO.mPlayerRange1 * 1.2f)
i_this->mPlayerDistanceLimit > l_HIO.mPlayerDetectionDistanceNear * 1.2f)
{
i_this->mMode = MODE_TK2_NONE;
} else {
@@ -226,16 +268,18 @@ static void e_tk2_find(e_tk2_class* i_this) {
}
}
if (i_this->mActionTimer[1] == 0) {
i_this->mPlayerAngleY = i_this->mPlayerAngleY - 0x8000;
ADD_ANGLE(i_this->mPlayerAngleY, 0x8000);
} else {
i_this->mPlayerAngleY = i_this->mSomeAngle;
}
}
cLib_addCalcAngleS2(&(i_this)->shape_angle.y, i_this->mPlayerAngleY, 4, 0x800);
cLib_addCalcAngleS2(&actor->shape_angle.y, i_this->mPlayerAngleY, 4, 0x800);
}
static void e_tk2_attack(e_tk2_class* i_this) {
fopAc_ac_c* actor = i_this;
switch (i_this->mMode) {
case MODE_TK2_NONE:
i_this->mMode = MODE_TK2_APPEAR;
@@ -245,15 +289,15 @@ static void e_tk2_attack(e_tk2_class* i_this) {
case MODE_TK2_APPEAR:
if ((int)i_this->mpMorf->getFrame() == 0x18) {
i_this->mBallID =
fopAcM_createChild(PROC_E_TK_BALL, fopAcM_GetID(i_this), 1, &i_this->eyePos,
fopAcM_GetRoomNo(i_this), &i_this->shape_angle, 0, -1, 0);
fopAcM_createChild(PROC_E_TK_BALL, fopAcM_GetID(actor), 1, &actor->eyePos,
fopAcM_GetRoomNo(actor), &actor->shape_angle, 0, -1, 0);
}
if ((int)i_this->mpMorf->getFrame() == 0x1c) {
i_this->mTKBallSpawned = true;
}
if (i_this->mpMorf->isStop()) {
anm_init(i_this, ANM_TK2_WAIT01, 1.0f, 0x02, 1.0f);
i_this->mActionTimer[0] = (short)(int)(cM_rndF(30.0f) + 70.0f);
i_this->mActionTimer[0] = cM_rndF(30.0f) + 70.0f;
i_this->mMode = MODE_TK2_ATTACK;
}
break;
@@ -261,17 +305,19 @@ static void e_tk2_attack(e_tk2_class* i_this) {
case MODE_TK2_ATTACK:
if (i_this->mActionTimer[0] == 0) {
i_this->mMode = MODE_TK2_NONE;
} else if (!pl_check(i_this, l_HIO.mPlayerRange2 + 50.0f, 0x6000)) {
} else if (!pl_check(i_this, l_HIO.mPlayerDetectionDistanceFar + 50.0f, 0x6000)) {
i_this->mAction = ACT_TK2_FIND;
i_this->mMode = MODE_TK2_DAMAGE;
}
break;
}
cLib_addCalcAngleS2(&i_this->shape_angle.y, i_this->mPlayerAngleY, 4, 0x800);
cLib_addCalcAngleS2(&actor->shape_angle.y, i_this->mPlayerAngleY, 4, 0x800);
}
static void e_tk2_s_damage(e_tk2_class* i_this) {
fopAc_ac_c* actor = i_this;
switch (i_this->mMode) {
case MODE_TK2_NONE:
anm_init(i_this, ANM_TK2_DAMAGE, 2.0f, 0x0, 1.0f);
@@ -279,7 +325,7 @@ static void e_tk2_s_damage(e_tk2_class* i_this) {
break;
case MODE_TK2_APPEAR:
if (i_this->mpMorf->getFrame() > 10.0f) {
if (i_this->mpMorf->getFrame() > 10.0f + YREG_F(3)) {
i_this->mAction = ACT_TK2_FIND;
i_this->mMode = MODE_TK2_DAMAGE;
}
@@ -288,6 +334,8 @@ static void e_tk2_s_damage(e_tk2_class* i_this) {
}
static void e_tk2_damage(e_tk2_class* i_this) {
fopAc_ac_c* actor = i_this;
i_this->mInvincibilityTimer = 6;
i_this->mAttentionOFF = true;
@@ -299,8 +347,8 @@ static void e_tk2_damage(e_tk2_class* i_this) {
case MODE_TK2_APPEAR:
if (i_this->mpMorf->isStop()) {
fopAcM_createDisappear(i_this, &i_this->eyePos, 10, 0, 0x12);
fopAcM_delete(i_this);
fopAcM_createDisappear(actor, &actor->eyePos, 10, 0, 0x12);
fopAcM_delete(actor);
}
break;
}
@@ -308,6 +356,10 @@ static void e_tk2_damage(e_tk2_class* i_this) {
static void action(e_tk2_class* i_this) {
fopAc_ac_c* actor = i_this;
cXyz _unk1;
cXyz _unk2;
i_this->mPlayerAngleY = fopAcM_searchPlayerAngleY(actor);
i_this->mPlayerDistanceLimit = fopAcM_searchPlayerDistance(actor);
damage_check(i_this);
@@ -341,20 +393,23 @@ static void action(e_tk2_class* i_this) {
}
static int daE_TK2_Execute(e_tk2_class* i_this) {
fopAc_ac_c* actor = i_this;
cXyz cStack_94;
cXyz cStack_a0;
if (i_this->mExecuteState == 0x00) {
dBgS_ObjGndChk_Spl ground_check;
cStack_94 = i_this->current.pos;
cStack_94 = actor->current.pos;
cStack_94.y += 200.0f;
ground_check.SetPos(&cStack_94);
i_this->current.pos.y = dComIfG_Bgsp().GroundCross(&ground_check) - 10.0f;
f32 ground_cross = dComIfG_Bgsp().GroundCross(&ground_check);
actor->current.pos.y = ground_cross - 10.0f + JREG_F(8);
}
i_this->mLifetime++;
i_this->mAttentionOFF = false;
for (int i = 0; i <= 3; i++) {
for (int i = 0; i < 4; i++) {
if (i_this->mActionTimer[i] != 0) {
i_this->mActionTimer[i]--;
}
@@ -366,14 +421,14 @@ static int daE_TK2_Execute(e_tk2_class* i_this) {
action(i_this);
i_this->mAcch.CrrPos(dComIfG_Bgsp());
mDoMtx_stack_c::transS(i_this->current.pos.x, i_this->current.pos.y, i_this->current.pos.z);
mDoMtx_stack_c::YrotM(i_this->shape_angle.y);
mDoMtx_stack_c::scaleM(l_HIO.mRadiusScale, l_HIO.mRadiusScale, l_HIO.mRadiusScale);
mDoMtx_stack_c::transS(actor->current.pos.x, actor->current.pos.y, actor->current.pos.z);
mDoMtx_stack_c::YrotM(actor->shape_angle.y);
mDoMtx_stack_c::scaleM(l_HIO.mBaseSize, l_HIO.mBaseSize, l_HIO.mBaseSize);
J3DModel* model = i_this->mpMorf->getModel();
model->setBaseTRMtx(mDoMtx_stack_c::get());
i_this->mpMorf->play(0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this)));
i_this->mpMorf->play(0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor)));
if (i_this->mAnim == ANM_TK2_SWIM) {
if (i_this->mpMorf->checkFrame(0.0f) || i_this->mpMorf->checkFrame(6.0f) ||
@@ -416,32 +471,30 @@ static int daE_TK2_Execute(e_tk2_class* i_this) {
MTXCopy(model->getAnmMtx(3), *calc_mtx);
cStack_94.set(0.0f, 0.0f, 0.0f);
MtxPosition(&cStack_94, &i_this->eyePos);
MtxPosition(&cStack_94, &actor->eyePos);
i_this->attention_info.position = i_this->eyePos;
i_this->attention_info.position.y =
i_this->attention_info.position.y + l_HIO.mRadiusScale * 35.0f;
actor->attention_info.position = actor->eyePos;
actor->attention_info.position.y = actor->attention_info.position.y + l_HIO.mBaseSize * 35.0f;
if (i_this->mTKBallSpawned) {
e_tk_ball_class* ball_actor =
static_cast<e_tk_ball_class*>(fopAcM_SearchByID(i_this->mBallID));
if (ball_actor != NULL) {
ball_actor->current.pos = i_this->eyePos;
ball_actor->current.pos = actor->eyePos;
ball_actor->mSuspended = false;
}
cXyz scale;
scale.setall(2.0f);
dComIfGp_particle_set(0x8198, &i_this->eyePos, &i_this->shape_angle, &scale);
dComIfGp_particle_set(0x8199, &i_this->eyePos, &i_this->shape_angle, &scale);
cXyz scale(2.0f + TREG_F(8), 2.0f + TREG_F(8), 2.0f + TREG_F(8));
dComIfGp_particle_set(0x8198, &actor->eyePos, &actor->shape_angle, &scale);
dComIfGp_particle_set(0x8199, &actor->eyePos, &actor->shape_angle, &scale);
i_this->mTKBallSpawned = false;
}
if (i_this->mAttentionOFF) {
fopAcM_OffStatus(i_this, 0);
i_this->attention_info.flags = 0;
fopAcM_OffStatus(actor, 0);
actor->attention_info.flags = 0;
} else {
fopAcM_OnStatus(i_this, 0);
i_this->attention_info.flags = fopAc_AttnFlag_BATTLE_e;
fopAcM_OnStatus(actor, 0);
actor->attention_info.flags = fopAc_AttnFlag_BATTLE_e;
}
MTXCopy(model->getAnmMtx(2), *calc_mtx);
@@ -449,7 +502,7 @@ static int daE_TK2_Execute(e_tk2_class* i_this) {
MtxPosition(&cStack_94, &cStack_a0);
i_this->mSph.SetC(cStack_a0);
i_this->mSph.SetR(50.0f * l_HIO.mRadiusScale);
i_this->mSph.SetR((50.0f + JREG_F(3)) * l_HIO.mBaseSize);
dComIfG_Ccsp()->Set(&i_this->mSph);
@@ -461,18 +514,23 @@ static int daE_TK2_IsDelete(e_tk2_class* i_this) {
}
static int daE_TK2_Delete(e_tk2_class* i_this) {
fopAc_ac_c* actor = i_this;
fopAcM_RegisterDeleteID(i_this, "E_TK2");
dComIfG_resDelete(&i_this->mPhaseReq, "E_tk2");
if (i_this->mInitHIO) {
hio_set = false;
mDoHIO_DELETE_CHILD(l_HIO.mNo);
}
if (i_this->heap != NULL) {
if (actor->heap != NULL) {
i_this->mpMorf->stopZelAnime();
}
return 1;
}
static int useHeapInit(fopAc_ac_c* a_this) {
e_tk2_class* i_this = static_cast<e_tk2_class*>(a_this);
static int useHeapInit(fopAc_ac_c* actor) {
e_tk2_class* i_this = static_cast<e_tk2_class*>(actor);
i_this->mpMorf =
new mDoExt_McaMorfSO((J3DModelData*)dComIfG_getObjectRes("E_tk2", 0xE), NULL, NULL,
@@ -486,61 +544,66 @@ static int useHeapInit(fopAc_ac_c* a_this) {
return 1;
}
static int daE_TK2_Create(fopAc_ac_c* i_this) {
static dCcD_SrcSph cc_sph_src = {
{
{0x0, {{0x0, 0x0, 0xd}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg
{0x0}, // mGObjCo
}, // mObjInf
{
{{0.0f, 0.0f, 0.0f}, 40.0f} // mSph
} // mSphAttr
};
static int daE_TK2_Create(fopAc_ac_c* actor) {
e_tk2_class* i_this = (e_tk2_class*)actor;
fopAcM_ct(i_this, e_tk2_class);
e_tk2_class* a_this = static_cast<e_tk2_class*>(i_this);
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&a_this->mPhaseReq, "E_tk2");
cPhs_Step phase = dComIfG_resLoad(&i_this->mPhaseReq, "E_tk2");
if (phase == cPhs_COMPLEATE_e) {
a_this->mArg0 = fopAcM_GetParamBit(a_this, 0, 8);
a_this->mArg1 = fopAcM_GetParamBit(a_this, 8, 4);
a_this->mArg2 = fopAcM_GetParamBit(a_this, 12, 4);
OS_REPORT("E_tk2 PARAM %x\n", fopAcM_GetParam(actor));
i_this->mArg0 = (fopAcM_GetParam(actor) & 0xFF) >> 0;
i_this->mArg1 = (fopAcM_GetParam(actor) & 0xF00) >> 8;
i_this->mArg2 = (fopAcM_GetParam(actor) & 0xF000) >> 12;
if (!fopAcM_entrySolidHeap(a_this, useHeapInit, 0x23a0)) {
OS_REPORT("E_tk2//////////////E_TK2 SET 1 !!\n");
if (!fopAcM_entrySolidHeap(actor, useHeapInit, 0x23a0)) {
OS_REPORT("//////////////E_TK2 SET NON !!\n");
return cPhs_ERROR_e;
}
OS_REPORT("//////////////E_TK2 SET 2 !!\n");
if (hio_set == false) {
a_this->mInitHIO = true;
i_this->mInitHIO = true;
hio_set = true;
l_HIO.field_0x04 = -1;
l_HIO.mNo = mDoHIO_CREATE_CHILD("たどぽーる2", &l_HIO); // "Tadpole 2"
}
a_this->attention_info.flags = fopAc_AttnFlag_BATTLE_e;
actor->attention_info.flags = fopAc_AttnFlag_BATTLE_e;
fopAcM_SetMtx(a_this, a_this->mpMorf->getModel()->getBaseTRMtx());
fopAcM_SetMin(a_this, -100.0f, -100.0f, -100.0f);
fopAcM_SetMax(a_this, 100.0f, 100.0f, 100.0f);
fopAcM_SetMtx(actor, i_this->mpMorf->getModel()->getBaseTRMtx());
fopAcM_SetMin(actor, -100.0f, -100.0f, -100.0f);
fopAcM_SetMax(actor, 100.0f, 100.0f, 100.0f);
a_this->attention_info.distances[fopAc_attn_BATTLE_e] = 0x04;
a_this->health = 0;
a_this->field_0x560 = 0;
actor->attention_info.distances[fopAc_attn_BATTLE_e] = 0x04;
actor->field_0x560 = actor->health = 0;
a_this->mStts.Init(100, 0, a_this);
a_this->mSph.Set(cc_sph_src);
a_this->mSph.SetStts(&a_this->mStts);
static dCcD_SrcSph cc_sph_src = {
{
{0x0, {{0x0, 0x0, 0xd}, {0xd8fbfdff, 0x3}, 0x75}}, // mObj
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg
{0x0}, // mGObjCo
}, // mObjInf
{
{{0.0f, 0.0f, 0.0f}, 40.0f} // mSph
} // mSphAttr
};
a_this->mAcch.Set(&i_this->current.pos, &a_this->old.pos, a_this, 1, &a_this->mAcchCir,
fopAcM_GetSpeed_p(a_this), NULL, NULL);
i_this->mStts.Init(100, 0, actor);
i_this->mSph.Set(cc_sph_src);
i_this->mSph.SetStts(&i_this->mStts);
a_this->mAcchCir.SetWall(-50.0f, 60.0f);
a_this->mSound.init(&a_this->current.pos, &a_this->eyePos, 0x3, 0x1);
a_this->mSound.setEnemyName("E_tk2");
a_this->mAtInfo.mpSound = &a_this->mSound;
a_this->mExecuteState = 0x14;
daE_TK2_Execute(a_this);
i_this->mAcch.Set(fopAcM_GetPosition_p(actor), fopAcM_GetOldPosition_p(actor), actor, 1,
&i_this->mAcchCir, fopAcM_GetSpeed_p(actor), NULL, NULL);
i_this->mAcchCir.SetWall(-50.0f, 60.0f);
i_this->mSound.init(&actor->current.pos, &actor->eyePos, 0x3, 0x1);
i_this->mSound.setEnemyName("E_tk2");
i_this->mAtInfo.mpSound = &i_this->mSound;
i_this->mExecuteState = 0x14;
daE_TK2_Execute(i_this);
}
return phase;
}
+139 -99
View File
@@ -1,12 +1,13 @@
/**
* @file d_a_e_tk_ball.cpp
* @file d_a_e_tk_ball.cpp
*
*/
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/dolzel_rel.h" // IWYU pragma: keep
#include "d/actor/d_a_e_tk_ball.h"
#include "d/actor/d_a_player.h"
#include "d/d_s_play.h"
enum Action {
/* 0x00 */ ACT_TK_BALL_MOVE, // Move in a straight line
@@ -30,8 +31,10 @@ static int daE_TK_BALL_Draw(e_tk_ball_class* i_this) {
return 1;
}
g_env_light.settingTevStruct(0, &i_this->current.pos, &i_this->tevStr);
g_env_light.setLightTevColorType_MAJI(i_this->mpModel, &i_this->tevStr);
fopAc_ac_c* actor = i_this;
g_env_light.settingTevStruct(0, &actor->current.pos, &actor->tevStr);
g_env_light.setLightTevColorType_MAJI(i_this->mpModel, &actor->tevStr);
mDoExt_modelUpdateDL(i_this->mpModel);
return 1;
}
@@ -39,15 +42,20 @@ static int daE_TK_BALL_Draw(e_tk_ball_class* i_this) {
static int simple_bg_check(e_tk_ball_class* i_this) {
fopAc_ac_c* actor = i_this;
cXyz current_pos = actor->current.pos;
cXyz current_pos;
cXyz start_pos;
cXyz end_pos;
cXyz ray_offset;
cXyz mtx_offset;
current_pos = actor->current.pos;
current_pos.y += i_this->mArcHeight;
cMtx_YrotS(*calc_mtx, actor->current.angle.y);
cXyz start_pos;
cXyz end_pos;
cXyz ray_offset(0.0f, 30.0f, -50.0f);
ray_offset.x = 0.0f;
ray_offset.y = 30.0f;
ray_offset.z = -50.0f;
cXyz mtx_offset;
MtxPosition(&ray_offset, &mtx_offset);
start_pos = current_pos + mtx_offset;
@@ -66,13 +74,14 @@ static int simple_bg_check(e_tk_ball_class* i_this) {
}
static void impact_eff_set(e_tk_ball_class* i_this) {
cXyz pos = i_this->current.pos;
fopAc_ac_c* actor = i_this;
cXyz pos = actor->current.pos;
pos.y += i_this->mArcHeight;
cXyz scale(2.0f, 2.0f, 2.0f);
cXyz scale(2.0f + TREG_F(8), 2.0f + TREG_F(8), 2.0f + TREG_F(8));
csXyz rotation = i_this->current.angle;
rotation.y -= 0x8000;
csXyz rotation = actor->current.angle;
ADD_ANGLE(rotation.y, 0x8000);
if (i_this->mType == TYPE_TK_BALL_WATER) {
dComIfGp_particle_set(0x819B, &pos, &rotation, &scale);
@@ -91,14 +100,14 @@ static void e_tk_ball_move(e_tk_ball_class* i_this) {
cXyz direction_vec;
cXyz speed_vec;
cXyz target_center;
cXyz unk1;
switch (i_this->mMode) {
case MODE_TK_BALL_INIT:
i_this->mMode = MODE_TK_BALL_MOVE;
i_this->mInitalPosition = actor->current.pos;
direction_vec = player->eyePos;
direction_vec.y += -20.0f;
direction_vec.y += -20.0f + TREG_F(9);
direction_vec -= i_this->mInitalPosition;
i_this->mInitalDistance = direction_vec.abs();
@@ -112,7 +121,9 @@ static void e_tk_ball_move(e_tk_ball_class* i_this) {
cMtx_YrotS(*calc_mtx, actor->current.angle.y);
cMtx_XrotM(*calc_mtx, actor->current.angle.x);
direction_vec.set(0.0f, 0.0f, 50.0f);
direction_vec.x = 0.0f;
direction_vec.y = 0.0f;
direction_vec.z = 50.0f + TREG_F(10);
MtxPosition(&direction_vec, &actor->speed);
i_this->mAtSph.OnAtVsPlayerBit();
@@ -126,7 +137,7 @@ static void e_tk_ball_move(e_tk_ball_class* i_this) {
break;
}
target_center = actor->current.pos;
cXyz target_center = actor->current.pos;
target_center.y += i_this->mArcHeight;
i_this->mTgSph.SetC(target_center);
dComIfG_Ccsp()->Set(&i_this->mTgSph);
@@ -146,7 +157,7 @@ static void e_tk_ball_move(e_tk_ball_class* i_this) {
if (actor_lockon && daPy_getPlayerActorClass()->getCutType() != daPy_py_c::CUT_TYPE_NONE) {
i_this->mAction = ACT_TK_BALL_RETURN;
i_this->mMode = MODE_TK_BALL_INIT;
actor->current.angle.y -= 0x8000;
ADD_ANGLE(actor->current.angle.y, 0x8000);
} else {
i_this->mAction = ACT_TK_BALL_DROP;
i_this->mMode = MODE_TK_BALL_INIT;
@@ -165,7 +176,7 @@ static void e_tk_ball_move(e_tk_ball_class* i_this) {
speed_vec.x = 0.0;
speed_vec.y = 0.0;
if (daPy_getPlayerActorClass()->getCutType() != daPy_py_c::CUT_TYPE_NONE) {
speed_vec.z = 60.0f;
speed_vec.z = 60.0f + TREG_F(16);
}
cMtx_YrotS(*calc_mtx, actor->current.angle.y);
cMtx_XrotM(*calc_mtx, actor->current.angle.x);
@@ -187,46 +198,59 @@ static void e_tk_ball_move(e_tk_ball_class* i_this) {
}
static void e_tk_ball_return(e_tk_ball_class* i_this) {
fopAc_ac_c* actor = i_this;
cXyz _unk1;
cXyz _unk2;
switch (i_this->mMode) {
case MODE_TK_BALL_INIT:
i_this->current.pos += i_this->speed;
actor->current.pos += actor->speed;
if (i_this->mActionTimer[1] == 0) {
i_this->mTgSph.SetTgHitMark(CcG_Tg_UNK_MARK_0);
}
break;
}
cXyz new_center = i_this->current.pos;
cXyz new_center = actor->current.pos;
new_center.y += i_this->mArcHeight;
i_this->mAtSph.MoveCAt(new_center);
dComIfG_Ccsp()->Set(&i_this->mAtSph);
if (i_this->mActionTimer[1] == 0 && (simple_bg_check(i_this) || i_this->mAtSph.ChkAtHit())) {
impact_eff_set(i_this);
fopAcM_delete(i_this);
fopAcM_delete(actor);
}
}
static void e_tk_ball_drop(e_tk_ball_class* i_this) {
fopAc_ac_c* actor = i_this;
cXyz _unk1;
cXyz _unk2;
switch (i_this->mMode) {
case MODE_TK_BALL_INIT:
i_this->current.pos += i_this->speed;
i_this->speed.y -= 2.0f;
if (i_this->speed.y < -50.0f) {
i_this->speed.y = -50.0f;
actor->current.pos += actor->speed;
actor->speed.y -= 2.0f;
if (actor->speed.y < -50.0f) {
actor->speed.y = -50.0f;
}
break;
}
if (simple_bg_check(i_this) || i_this->mActionTimer[0] == 0) {
impact_eff_set(i_this);
fopAcM_delete(i_this);
fopAcM_delete(actor);
}
}
static void action(e_tk_ball_class* i_this) {
fopAc_ac_c* actor = i_this;
cXyz position_diff;
cXyz _unk2;
static u16 e_id[3] = {0x819D, 0x819E, 0x819A};
s8 is_moving = true;
@@ -244,11 +268,11 @@ static void action(e_tk_ball_class* i_this) {
}
if (is_moving) {
cXyz position_diff = actor->home.pos - actor->current.pos;
position_diff = actor->home.pos - actor->current.pos;
f32 pos_diff_abs = position_diff.abs();
f32 height_scale = i_this->mInitalDistance * 0.1f;
if (height_scale > 300.0f) {
height_scale = 300.0f;
f32 height_scale = i_this->mInitalDistance * (TREG_F(19) + 0.1f);
if (height_scale > 300.0f + TREG_F(18)) {
height_scale = 300.0f + TREG_F(18);
}
i_this->mArcHeight =
height_scale * cM_ssin((pos_diff_abs / i_this->mInitalDistance) * 32768.0f);
@@ -262,7 +286,7 @@ static void action(e_tk_ball_class* i_this) {
cXyz particle_position = actor->current.pos;
particle_position.y += i_this->mArcHeight;
cXyz particle_scale(2.0f, 2.0f, 2.0f);
cXyz particle_scale(2.0f + TREG_F(8), 2.0f + TREG_F(8), 2.0f + TREG_F(8));
for (int i = 0; i < 2; i++) {
i_this->mParticleKey[i] = dComIfGp_particle_set(
@@ -294,6 +318,11 @@ static int daE_TK_BALL_Execute(e_tk_ball_class* i_this) {
return 1;
}
fopAc_ac_c* actor = i_this;
cXyz _unk1;
cXyz _unk2;
i_this->mLifetime++;
for (int i = 0; i < 2; i++) {
if (i_this->mActionTimer[i] != 0) {
@@ -306,17 +335,18 @@ static int daE_TK_BALL_Execute(e_tk_ball_class* i_this) {
action(i_this);
i_this->shape_angle.y += 0x1000;
i_this->shape_angle.x += 0xE00;
ADD_ANGLE(actor->shape_angle.y, 0x1000);
ADD_ANGLE(actor->shape_angle.x, 0xE00);
mDoMtx_stack_c::transS(i_this->current.pos.x, i_this->current.pos.y + i_this->mArcHeight,
i_this->current.pos.z);
mDoMtx_stack_c::YrotM(i_this->shape_angle.y);
mDoMtx_stack_c::XrotM(i_this->shape_angle.x);
mDoMtx_stack_c::scaleM(2.0f, 2.0f, 2.0f);
mDoMtx_stack_c::transS(actor->current.pos.x, actor->current.pos.y + i_this->mArcHeight,
actor->current.pos.z);
mDoMtx_stack_c::YrotM(actor->shape_angle.y);
mDoMtx_stack_c::XrotM(actor->shape_angle.x);
f32 scale = 2.0f + TREG_F(8);
mDoMtx_stack_c::scaleM(scale, scale, scale);
i_this->mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
i_this->mSound.framework(0, dComIfGp_getReverb(fopAcM_GetRoomNo(i_this)));
i_this->mSound.framework(0, dComIfGp_getReverb(fopAcM_GetRoomNo(actor)));
return 1;
}
@@ -325,29 +355,32 @@ static int daE_TK_BALL_IsDelete(e_tk_ball_class* i_this) {
}
static int daE_TK_BALL_Delete(e_tk_ball_class* i_this) {
fopAc_ac_c* actor = i_this;
fopAcM_RegisterDeleteID(i_this, "E_TK_BALL");
if (i_this->mType == TYPE_TK_BALL_WATER) {
dComIfG_resDelete(&i_this->mPhaseReq, "E_tk");
} else {
dComIfG_resDelete(&i_this->mPhaseReq, "E_tk2");
}
if (i_this->heap != NULL) {
if (actor->heap != NULL) {
i_this->mSound.deleteObject();
}
return 1;
}
static int useHeapInit(fopAc_ac_c* i_this) {
e_tk_ball_class* a_this = static_cast<e_tk_ball_class*>(i_this);
J3DModelData* ball_model;
e_tk_ball_class* actor = static_cast<e_tk_ball_class*>(i_this);
J3DModelData* modelData;
if (a_this->mType == TYPE_TK_BALL_WATER) {
ball_model = (J3DModelData*)dComIfG_getObjectRes("E_tk", 0xD);
if (actor->mType == TYPE_TK_BALL_WATER) {
modelData = (J3DModelData*)dComIfG_getObjectRes("E_tk", 0xD);
} else {
ball_model = (J3DModelData*)dComIfG_getObjectRes("E_tk2", 0xD);
modelData = (J3DModelData*)dComIfG_getObjectRes("E_tk2", 0xD);
}
a_this->mpModel = mDoExt_J3DModel__create(ball_model, 0x80000, 0x11000084);
JUT_ASSERT(679, modelData != 0);
actor->mpModel = mDoExt_J3DModel__create(modelData, 0x80000, 0x11000084);
if (a_this->mpModel == NULL) {
if (actor->mpModel == NULL) {
return 0;
} else {
return 1;
@@ -355,77 +388,84 @@ static int useHeapInit(fopAc_ac_c* i_this) {
}
static int daE_TK_BALL_Create(fopAc_ac_c* i_this) {
static dCcD_SrcSph at_sph_src = {
{
{0x0, {{AT_TYPE_CSTATUE_SWING, 0x1, 0xd}, {0x0, 0x0}, 0x0}}, // mObj
{dCcD_SE_METAL, 0x1, 0x0, 0x0, 0x0}, // mGObjAt
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg
{0x0}, // mGObjCo
}, // mObjInf
{
{{0.0f, 0.0f, 0.0f}, 20.0f} // mSph
} // mSphAttr
};
e_tk_ball_class* actor = (e_tk_ball_class*)i_this;
fopAcM_ct(actor, e_tk_ball_class);
static dCcD_SrcSph tg_sph_src = {
{
{0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x0}}, // mObj
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
{dCcD_SE_METAL, 0x5, 0x0, 0x0, 0x2}, // mGObjTg
{0x0}, // mGObjCo
}, // mObjInf
{
{{0.0f, 0.0f, 0.0f}, 35.0f} // mSph
} // mSphAttr
};
fopAcM_ct(i_this, e_tk_ball_class);
e_tk_ball_class* a_this = static_cast<e_tk_ball_class*>(i_this);
a_this->mType = fopAcM_GetParam(a_this);
if (a_this->mType == TYPE_TK_BALL_UNK) {
a_this->mType = TYPE_TK_BALL_WATER;
actor->mType = fopAcM_GetParam(i_this);
if (actor->mType == TYPE_TK_BALL_UNK) {
actor->mType = TYPE_TK_BALL_WATER;
}
cPhs__Step phase;
cPhs_Step phase;
u32 size;
if (a_this->mType == TYPE_TK_BALL_WATER) {
phase = (cPhs__Step)dComIfG_resLoad(&a_this->mPhaseReq, "E_tk");
if (actor->mType == TYPE_TK_BALL_WATER) {
phase = dComIfG_resLoad(&actor->mPhaseReq, "E_tk");
size = 0x820;
} else {
phase = (cPhs__Step)dComIfG_resLoad(&a_this->mPhaseReq, "E_tk2");
phase = dComIfG_resLoad(&actor->mPhaseReq, "E_tk2");
size = 0xEE0;
}
if (phase == cPhs_COMPLEATE_e) {
a_this->mArg1 = fopAcM_GetParamBit(i_this, 8, 8);
if (a_this->mArg1 == 0xff) {
a_this->mArg1 = 0x00;
OS_REPORT("E_tk_BALL PARAM %x\n", fopAcM_GetParam(i_this));
actor->mArg1 = (fopAcM_GetParam(i_this) & 0xFF00) >> 8;
if (actor->mArg1 == 0xff) {
actor->mArg1 = 0x00;
}
OS_REPORT("E_tk_BALL//////////////E_TK_BALL SET 1 !!\n");
if (!fopAcM_entrySolidHeap(i_this, useHeapInit, size)) {
OS_REPORT("//////////////E_TK_BALL SET NON !!\n");
return cPhs_ERROR_e;
}
fopAcM_SetMtx(a_this, a_this->mpModel->getBaseTRMtx());
a_this->mStts.Init(0xff, 0, a_this);
a_this->mAtSph.Set(at_sph_src);
a_this->mAtSph.SetStts(&a_this->mStts);
if (a_this->mType == TYPE_TK_BALL_FIRE) {
a_this->mAtSph.SetAtType(AT_TYPE_100);
a_this->mAtSph.SetAtMtrl(dCcD_MTRL_FIRE);
OS_REPORT("//////////////E_TK_BALL SET 2 !!\n");
static dCcD_SrcSph at_sph_src = {
{
{0x0, {{AT_TYPE_CSTATUE_SWING, 0x1, 0xd}, {0x0, 0x0}, 0x0}}, // mObj
{dCcD_SE_METAL, 0x1, 0x0, 0x0, 0x0}, // mGObjAt
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x2}, // mGObjTg
{0x0}, // mGObjCo
}, // mObjInf
{
{{0.0f, 0.0f, 0.0f}, 20.0f} // mSph
} // mSphAttr
};
static dCcD_SrcSph tg_sph_src = {
{
{0x0, {{0x0, 0x0, 0x0}, {0xd8fbfdff, 0x3}, 0x0}}, // mObj
{dCcD_SE_NONE, 0x0, 0x0, 0x0, 0x0}, // mGObjAt
{dCcD_SE_METAL, 0x5, 0x0, 0x0, 0x2}, // mGObjTg
{0x0}, // mGObjCo
}, // mObjInf
{
{{0.0f, 0.0f, 0.0f}, 35.0f} // mSph
} // mSphAttr
};
fopAcM_SetMtx(i_this, actor->mpModel->getBaseTRMtx());
actor->mStts.Init(0xff, 0, i_this);
actor->mAtSph.Set(at_sph_src);
actor->mAtSph.SetStts(&actor->mStts);
if (actor->mType == TYPE_TK_BALL_FIRE) {
actor->mAtSph.SetAtType(AT_TYPE_100);
actor->mAtSph.SetAtMtrl(dCcD_MTRL_FIRE);
}
a_this->mTgSph.Set(tg_sph_src);
a_this->mTgSph.SetStts(&a_this->mStts);
actor->mTgSph.Set(tg_sph_src);
actor->mTgSph.SetStts(&actor->mStts);
a_this->mSound.init(&a_this->current.pos, 1);
a_this->shape_angle.y = cM_rndFX(32768.0f);
a_this->shape_angle.x = cM_rndFX(32768.0f);
a_this->mSuspended = true;
actor->mSound.init(&i_this->current.pos, 1);
i_this->shape_angle.y = cM_rndFX(32768.0f);
i_this->shape_angle.x = cM_rndFX(32768.0f);
actor->mSuspended = true;
mDoMtx_stack_c::scaleS(0.0f, 0.0f, 0.0f);
a_this->mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
daE_TK_BALL_Execute(a_this);
actor->mpModel->setBaseTRMtx(mDoMtx_stack_c::get());
daE_TK_BALL_Execute(actor);
}
return phase;
}
+2 -2
View File
@@ -752,11 +752,11 @@ static int useHeapInit(fopAc_ac_c* i_this) {
return 1;
}
static cPhs__Step daE_YC_Create(fopAc_ac_c* i_this) {
static cPhs_Step daE_YC_Create(fopAc_ac_c* i_this) {
e_yc_class* _this = static_cast<e_yc_class*>(i_this);
fopAcM_ct(i_this, e_yc_class);
cPhs__Step step = (cPhs__Step)dComIfG_resLoad(&_this->mPhase, "E_yc");
cPhs_Step step = dComIfG_resLoad(&_this->mPhase, "E_yc");
if (step == cPhs_COMPLEATE_e) {
_this->mParam = (u8)fopAcM_GetParam(_this);
+2 -2
View File
@@ -1332,12 +1332,12 @@ static int useHeapInit(fopAc_ac_c* a_this) {
return 1;
}
static cPhs__Step daE_YG_Create(fopAc_ac_c* actor) {
static cPhs_Step daE_YG_Create(fopAc_ac_c* actor) {
e_yg_class* i_this = (e_yg_class*)actor;
fopAcM_ct(&i_this->actor, e_yg_class);
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&i_this->mPhase, "E_YG");
cPhs_Step phase = dComIfG_resLoad(&i_this->mPhase, "E_YG");
if (phase == cPhs_COMPLEATE_e) {
OS_REPORT("E_YG PARAM %x\n", fopAcM_GetParam(actor));
+2 -2
View File
@@ -3156,7 +3156,7 @@ static int useHeapInit(fopAc_ac_c* a_this) {
return i_this->CreateHeap();
}
cPhs__Step daE_YMB_c::create() {
cPhs_Step daE_YMB_c::create() {
fopAcM_ct(this, daE_YMB_c);
mSwitchBit = fopAcM_GetParam(this);
@@ -3168,7 +3168,7 @@ cPhs__Step daE_YMB_c::create() {
}
}
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&mPhase, "E_YB");
cPhs_Step phase = dComIfG_resLoad(&mPhase, "E_YB");
if (phase == cPhs_COMPLEATE_e) {
OS_REPORT("E_YMB PARAM %x\n", fopAcM_GetParam(this));
if (!fopAcM_entrySolidHeap(this, useHeapInit, 0x5200)) {
+2 -2
View File
@@ -2165,10 +2165,10 @@ static int useHeapInit(fopAc_ac_c* a_this) {
return i_this->CreateHeap();
}
cPhs__Step daE_ZH_c::create() {
cPhs_Step daE_ZH_c::create() {
fopAcM_ct(this, daE_ZH_c);
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&mPhase, "E_ZH");
cPhs_Step phase = dComIfG_resLoad(&mPhase, "E_ZH");
if (phase == cPhs_COMPLEATE_e) {
OS_REPORT("E_ZH PARAM %x\n", fopAcM_GetParam(this));
arg0 = fopAcM_GetParam(this);
+2 -2
View File
@@ -904,10 +904,10 @@ static int useHeapInit(fopAc_ac_c* a_this) {
return static_cast<daE_ZM_c*>(a_this)->CreateHeap();
}
cPhs__Step daE_ZM_c::create() {
cPhs_Step daE_ZM_c::create() {
fopAcM_ct(this, daE_ZM_c);
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&mPhase, "E_ZM");
cPhs_Step phase = dComIfG_resLoad(&mPhase, "E_ZM");
if (phase == cPhs_COMPLEATE_e) {
OS_REPORT("E_ZM PARAM %x\n", fopAcM_GetParam(this));
+2 -2
View File
@@ -3854,8 +3854,8 @@ static int daMg_Fish_Create(fopAc_ac_c* i_this) {
lit_1008 = 1;
#endif
cPhs__Step phase = (cPhs__Step)dComIfG_resLoad(&a_this->mPhaseReq, a_this->mResName);
cPhs__Step retval = phase;
cPhs_Step phase = dComIfG_resLoad(&a_this->mPhaseReq, a_this->mResName);
cPhs_Step retval = phase;
if (phase == cPhs_COMPLEATE_e) {
s32 params_0 = fopAcM_GetParam(i_this) >> 24;

Some files were not shown because too many files have changed in this diff Show More