Skip to content

Commit

Permalink
fix up some various ebi effects
Browse files Browse the repository at this point in the history
  • Loading branch information
PikHacker committed Sep 27, 2023
1 parent d5aaeb1 commit 236b970
Show file tree
Hide file tree
Showing 11 changed files with 146 additions and 1,100 deletions.
8 changes: 4 additions & 4 deletions docs/recommended_todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebi2DGraph.cpp">ebi2DGraph.cpp</a> | 4210 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiScreenOmakeCardE.cpp">ebiScreenOmakeCardE.cpp</a> | 5774 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiOmakeMgr.cpp">ebiOmakeMgr.cpp</a> | 7786 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiCardEReader.cpp">ebiCardEReader.cpp</a> | 9524 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/particle2dMgr.cpp">particle2dMgr.cpp</a> | 9790 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebi2DCallBack.cpp">ebi2DCallBack.cpp</a> | 10813 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiScreenSaveMenu.cpp">ebiScreenSaveMenu.cpp</a> | 11850 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiScreenTitleMenu.cpp">ebiScreenTitleMenu.cpp</a> | 11996 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiScreenOmakeGame.cpp">ebiScreenOmakeGame.cpp</a> | 12403 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiMainTitleMgr.cpp">ebiMainTitleMgr.cpp</a> | 12858 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiP2TitleUnit.cpp">ebiP2TitleUnit.cpp</a> | 13380 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiSaveMgr.cpp">ebiSaveMgr.cpp</a> | 15440 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/efxTPkEffectMgr.cpp">efxTPkEffectMgr.cpp</a> | 15831 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/efx2dEffect.cpp">efx2dEffect.cpp</a> | 17839 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/efxObject.cpp">efxObject.cpp</a> | 11070 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiScreenSaveMenu.cpp">ebiScreenSaveMenu.cpp</a> | 11850 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiScreenTitleMenu.cpp">ebiScreenTitleMenu.cpp</a> | 11996 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiScreenOmakeGame.cpp">ebiScreenOmakeGame.cpp</a> | 12403 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiMainTitleMgr.cpp">ebiMainTitleMgr.cpp</a> | 12858 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiP2TitleUnit.cpp">ebiP2TitleUnit.cpp</a> | 13380 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/ebiSaveMgr.cpp">ebiSaveMgr.cpp</a> | 15440 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectEbisawaU/efxTPkEffectMgr.cpp">efxTPkEffectMgr.cpp</a> | 15831 |

### <section id="plugProjectHikinoU">plugProjectHikinoU</section>
| File | Size (bytes) | File | Size (bytes) |
Expand Down
4 changes: 2 additions & 2 deletions include/efx/Arg.h
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ struct ArgKouhai : public Arg {
ArgKouhai(Vector3f position, int type)
: Arg(position)
{
_10 = type;
mSize = type;
}

virtual const char* getName() // _08 (weak)
Expand All @@ -224,7 +224,7 @@ struct ArgKouhai : public Arg {

// _00 = VTBL
// _00-_10 = Arg
int _10; // _10
int mSize; // _10
};

struct ArgPelType : public Arg {
Expand Down
2 changes: 1 addition & 1 deletion include/efx/Container.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ struct Container : public TForever {
{
}
virtual bool create(Arg*); // _08
virtual ~Container(); // _48 (weak)
virtual ~Container() { } // _48 (weak)

// _00 = VTBL
// _00-_10 = TForever
Expand Down
6 changes: 3 additions & 3 deletions include/efx/TOtakara.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@ struct TOtakaraAp : public TBase {
: TBase()
{
}
virtual bool create(Arg*); // _08
virtual void forceKill(); // _0C (weak)
virtual void fade(); // _10 (weak)
virtual bool create(Arg*); // _08
virtual void forceKill() { } // _0C (weak)
virtual void fade() { } // _10 (weak)

// _00 VTBL
};
Expand Down
2 changes: 1 addition & 1 deletion include/efx/TPelkira.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct TPelkira_ver01 : public TChasePos {
virtual bool create(Arg*); // _08
// _0C-_14
// vtable 2 (JPAEmitterCallBack + Self)
virtual ~TPelkira_ver01(); // _48 (weak)
virtual ~TPelkira_ver01() { } // _48 (weak)
};
} // namespace efx

Expand Down
3 changes: 1 addition & 2 deletions include/efx2d/FileSelect.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,7 @@ struct ArgFilecopy : public Arg {

// _00-_08 = Vector2f
// _08 = VTBL
int _0C;
int _10;
Vector2f mAltPosition;
JUtility::TColor mColor; // _14
};

Expand Down
57 changes: 19 additions & 38 deletions src/plugProjectEbisawaU/efx2dEffect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -362,13 +362,29 @@ bool FileSelect::T2DFilecopyBase::create(Arg* arg)
bool nameCheck = strcmp("ArgFilecopy", arg->getName()) == 0;
P2ASSERTLINE(160, nameCheck);
ArgFilecopy* args = static_cast<ArgFilecopy*>(arg);
f32 dist = args->mAltPosition.distance(*args);
f32 scale = dist /= 200.0f;

f32 scale = 200.0f; // yeah nope
Vector3f test(args->mAltPosition.x - args->x, args->mAltPosition.y - args->y, 0.0f);
test.normalise();
JUtility::TColor col = args->mColor;
Matrixf mtx;

Mtx mtx;
mtx[0][0] = test.x;
mtx[0][1] = test.x;
mtx[0][2] = 0.0f;
mtx[0][3] = test.y;
mtx[1][0] = test.y;
mtx[1][1] = test.x;
mtx[1][2] = 0.0f;
mtx[1][3] = test.y;
mtx[2][0] = test.z;
mtx[2][1] = 0.0f;
mtx[2][2] = 1.0f;
mtx[2][3] = 0.0f;
if (TForever::create(arg)) {
mEmitter->setColorRGB(col);
JPASetRMtxfromMtx(mtx.mMatrix.mtxView, mEmitter->mMatrix);
JPASetRMtxfromMtx(mtx, mEmitter->mMatrix);
mEmitter->setScaleOnly(scale);
return true;
}
Expand Down Expand Up @@ -664,39 +680,4 @@ void WorldMap::T2DRocketB::setGlobalParticleScale(f32 scale)
mEmitter->setScaleMain(test.x, test.y, test.z);
}

/*
* --INFO--
* Address: 803BAC6C
* Size: 00009C
*/
// WorldMap::T2DRocketB::~T2DRocketB() { }

/*
* --INFO--
* Address: 803BAD08
* Size: 00009C
*/
// WorldMap::T2DOnyonKira::~T2DOnyonKira() { }

/*
* --INFO--
* Address: 803BADA4
* Size: 000084
*/
FileSelect::T2DFilecopyBase::~T2DFilecopyBase() { }

/*
* --INFO--
* Address: 803BAE28
* Size: 000084
*/
// T2DCountKira::~T2DCountKira() { }

/*
* --INFO--
* Address: 803BAEAC
* Size: 00009C
*/
// T2DCursor::~T2DCursor() { }

} // namespace efx2d
44 changes: 5 additions & 39 deletions src/plugProjectEbisawaU/efxBase.cpp
Original file line number Diff line number Diff line change
@@ -1,22 +1,15 @@
#include "JSystem/JGeometry.h"
#include "JSystem/JParticle/JPAEmitter.h"
#include "JSystem/JParticle/JPAMath.h"
#include "JSystem/JUtility/JUTException.h"
#include "ParticleMgr.h"
#include "efx/Arg.h"
#include "efx/Context.h"
#include "efx/TBase.h"
#include "efx/TCallBack_StaticClipping.h"
#include "efx/TChaseMtx.h"
#include "efx/TChasePos.h"
#include "efx/TForever.h"
#include "efx/TOneEmitter.h"
#include "efx/TSimple.h"
#include "efx/TSimpleMtx.h"
#include "efx/TSyncGroup.h"
#include "sysMath.h"
#include "types.h"
#include "Vector3.h"

efx::TCallBack_StaticClipping efx::TBase::mCallBack_StaticClipping;

Expand Down Expand Up @@ -725,8 +718,10 @@ void TChasePosPosLocalZScale::doExecuteEmitterOperation(JPABaseEmitter* emitter)
Vector3f vec1 = *_10;
Vector3f vec2 = *_14;
makeMtxZAxisAlongPosPos(mtxZ, vec1, vec2);
f32 dist = _distanceBetween(vec2, vec1);
JPASetRMtxTVecfromMtx(mtxZ, emitter->mMatrix, &emitter->mPosition);
// needs some extra math here
emitter->mScale.z = dist / _18;

/*
stwu r1, -0x70(r1)
mflr r0
Expand Down Expand Up @@ -836,8 +831,9 @@ void TChasePosPosLocalYScale::doExecuteEmitterOperation(JPABaseEmitter* emitter)
Vector3f vec1 = *_10;
Vector3f vec2 = *_14;
makeMtxZAxisAlongPosPos(mtxZ, vec1, vec2);
f32 dist = _distanceBetween(vec2, vec1);
JPASetRMtxTVecfromMtx(mtxZ, emitter->mMatrix, &emitter->mPosition);
// needs some extra math here
emitter->mScale.y = dist / _18;
/*
stwu r1, -0x70(r1)
mflr r0
Expand Down Expand Up @@ -2962,34 +2958,4 @@ TCallBack_StaticClipping::~TCallBack_StaticClipping() { }
// {
// }

/*
* --INFO--
* Address: 803B2CD0
* Size: 00004C
*/
// void __sinit_efxBase_cpp()
// {
// /*
// stwu r1, -0x10(r1)
// mflr r0
// lis r4, __vt__18JPAEmitterCallBack@ha
// lis r3, __vt__Q23efx24TCallBack_StaticClipping@ha
// stw r0, 0x14(r1)
// addi r0, r4, __vt__18JPAEmitterCallBack@l
// lis r4, __dt__Q23efx24TCallBack_StaticClippingFv@ha
// stw r0, mCallBack_StaticClipping__Q23efx5TBase@sda21(r13)
// addi r0, r3, __vt__Q23efx24TCallBack_StaticClipping@l
// lis r3, lbl_804F7C10@ha
// addi r4, r4, __dt__Q23efx24TCallBack_StaticClippingFv@l
// stw r0, mCallBack_StaticClipping__Q23efx5TBase@sda21(r13)
// addi r5, r3, lbl_804F7C10@l
// addi r3, r13, mCallBack_StaticClipping__Q23efx5TBase@sda21
// bl __register_global_object
// lwz r0, 0x14(r1)
// mtlr r0
// addi r1, r1, 0x10
// blr
// */
// }

} // namespace efx
Loading

0 comments on commit 236b970

Please sign in to comment.