Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion include/Camera/Camera.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class CPolarSubCamera : public JDrama::TLookAtCamera {
void ctrlGameCamera_();
void perform(u32, JDrama::TGraphics*);
void getOffsetAngleX() const;
void getOffsetAngleY() const;
s16 getOffsetAngleY() const;
void getFinalAngleZ() const;
~CPolarSubCamera();
void controlByCameraCode_(int*);
Expand Down
36 changes: 35 additions & 1 deletion include/MSound/MSound.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,43 @@ class MSound : public JAIBasic {
}
// TODO: startSoundActor was also very likely here

void startForceJumpSound(Vec*, u32, f32, u32) { }
void startForceJumpSound(Vec*, u32, f32, u32);
};

#pragma dont_inline on
void MSound::startForceJumpSound(Vec* pos, u32 groundType, f32 height,
u32 dist)
{
u32 soundID;
u8 type = (u8)groundType;

switch (type) {
case 21:
case 23:
case 29:
soundID = 0x180A;
break;
case 30:
default:
if (dist < 6000) {
soundID = 0x1810;
} else if (dist < 12000) {
soundID = 0x1811;
} else {
soundID = 0x1812;
}
break;
}

if (gateCheck(soundID)) {
if (gateCheck(soundID)) {
MSoundSESystem::MSoundSE::startSoundActor(soundID, pos, 0,
(JAISound**)NULL, 0, 4);
}
}
}
#pragma dont_inline off

extern MSound* MSGMSound;
extern JAIBasic* MSGBasic;
extern MSound* gpMSound;
Expand Down
2 changes: 1 addition & 1 deletion include/Map/PollutionManager.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class TPollutionManager : public TJointModelManager {
void stamp(u16, f32 x, f32 y, f32 z, f32 range);
void clean(f32, f32, f32, f32);
void stampGround(u16, f32, f32, f32, f32);
u16 getPollutionType(f32, f32, f32) const;
u32 getPollutionType(f32, f32, f32) const;
u32 getPollutionDegree() const;
void isProhibit(f32, f32, f32) const;
bool isPolluted(f32, f32, f32) const;
Expand Down
125 changes: 69 additions & 56 deletions include/Player/MarioMain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,14 @@ class TMarioGamePad;

class TMario : public TTakeActor, public TDrawSyncCallback {
public:
struct JumpSlipRecord;
struct JumpSlipRecord {
s16 mTimer;
u16 _pad;
u32 mStatus;
u32 mJumpStatus;
u32 mFallbackStatus;
u32 _unk10;
};

class TOptionParams : public TParams {
public:
Expand Down Expand Up @@ -610,7 +617,7 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
virtual MtxPtr getTakingMtx();
virtual bool moveRequest(const JGeometry::TVec3<f32>&);

virtual void drawSyncCallback(u16);
void drawSyncCallback(u16);
virtual void initValues();
virtual void checkReturn();
virtual void checkController(JDrama::TGraphics*);
Expand Down Expand Up @@ -715,7 +722,7 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
Mtx* getRootAnmMtx();
void getHeadRot();
void getJumpIntoWaterModelData();
void jumpMain();
BOOL jumpMain();
void fallDead();
void diving();
void hipAttacking();
Expand Down Expand Up @@ -789,11 +796,11 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void checkRideMovement();
void getActorMtx(const THitActor&, f32 (*)[4]);
void checkCurrentPlane();
void getDmgMapCode(int) const;
void checkGroundPlane(f32, f32, f32, f32*, const TBGCheckData**);
TEParams* getDmgMapCode(int code) const;
BOOL checkGroundPlane(f32 x, f32 y, f32 z, f32* outHeight, const TBGCheckData** outPlane);
void makeHistory();
void checkStickSmash();
void checkStickRotate(int*);
BOOL checkStickRotate(int*);
void getLRLevel(unsigned char);
void getDizzyPower();
void getDizzyAngle();
Expand All @@ -811,28 +818,28 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void checkGraffitoFire();
void checkGraffitoDamage();
void makeGraffitoDamage(const TMario::TEParams&);
void checkAllMotions();
BOOL checkAllMotions();
BOOL changePlayerDropping(u32, u32);
BOOL changePlayerJumping(u32, u32);
void changePlayerTriJump();
BOOL changePlayerTriJump();
BOOL changePlayerStatus(u32, u32, bool);
void throwMario(const JGeometry::TVec3<f32>&, f32);
void setStatusToRunning(u32, u32);
void setStatusToJumping(u32, u32);
u32 setStatusToJumping(u32, u32);
void setPlayerJumpSpeed(f32, f32);
void setMissJumping();
void isTurnning();
void isTurnStart();
void checkPlayerAround(int, f32);
void isJumpMiss();
void isSlipLimit();
void getSlideStopCatch();
void getSlideStopNormal();
void canSlipJump();
void isSlipStart();
void isFrontSlip(int);
void checkRoofPlane(const Vec&, f32, const TBGCheckData**);
void checkWallPlane(Vec*, f32, f32);
f32 getSlideStopCatch();
f32 getSlideStopNormal();
BOOL canSlipJump();
BOOL isSlipStart();
bool isFrontSlip(int);
f32 checkRoofPlane(const Vec&, f32, const TBGCheckData**);
const TBGCheckData* checkWallPlane(Vec*, f32, f32);
void setPlayerVelocity(f32);
void setNormalAttackArea();
void changePos(const Vec&);
Expand All @@ -845,36 +852,36 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void windMove(const JGeometry::TVec3<f32>&);
void flowMove(const JGeometry::TVec3<f32>&);
void warpRequest(const JGeometry::TVec3<f32>&, f32);
void isForceSlip();
BOOL isForceSlip();
void getRidingMtx(f32 (*)[4]);
bool isWallInFront() const;
bool isInvincible() const;
bool isUnderWater() const;
void canSquat() const;
void getJumpSlideControl() const;
void getJumpAccelControl() const;
BOOL jumpProcess(int);
BOOL canSquat() const;
f32 getJumpSlideControl() const;
f32 getJumpAccelControl() const;
int jumpProcess(int);
void fallProcess();
void isFallCancel();
void checkGroundAtJumping(const Vec&, int);
void hangonCheck(const TBGCheckData*, const Vec&, const Vec&);
void barProcess();
void walkProcess();
void waitProcess();
int checkGroundAtJumping(const Vec&, int);
int hangonCheck(const TBGCheckData*, const Vec&, const Vec&);
int barProcess();
int walkProcess();
int waitProcess();
void stopProcess();
void checkGroundAtWalking(Vec*);
int checkGroundAtWalking(Vec*);
void checkDescent();
void keepDistance(const THitActor&, f32);
void keepDistance(const JGeometry::TVec3<f32>&, f32, f32);
void playerRefrection(int);
void moveMain();
BOOL moveMain();
void broadJumpSlip();
void ultraJumpSlip();
void uTurnJumpSlip();
void secJumpSlip();
void landSlip();
void jumpSlip();
void jumpSlipEvents(TMario::JumpSlipRecord*);
BOOL jumpSlipEvents(TMario::JumpSlipRecord*);
void jumpSlipCommon(short, u32);
void loserDown();
void catchDown();
Expand All @@ -884,7 +891,7 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void shortBackDown();
void foreDown();
void backDown();
void downingCommon(int, f32, int);
f32 downingCommon(int, f32, int);
void oilSlope();
void oilSlip();
void oilRun();
Expand All @@ -909,31 +916,31 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void changePlayerWaiting();
void doBraking(f32);
void doSurfing();
void getSurfingParamsGround(); // UNUSED
void getSurfingParamsWater();
TSurfingParams& getSurfingParamsGround(); // UNUSED
TSurfingParams& getSurfingParamsWater();
void doRunning();
void doStopping();
void doSlipping(f32);
void slopeProcess();
void doSliding(f32);
int doSliding(f32);
void slideProcess(f32, f32);
void getSlideStickMult();
void getChangeAngleSpeed();
f32 getSlideStickMult();
f32 getChangeAngleSpeed();
void getSlopeSlideAccele(f32*, f32*);
void getSlopeNormalAccele(f32*, f32*);
void doRunningAnimation();
void getRunningInWaterBrake();
void isRunningInWater();
BOOL isRunningInWater();
void changePlayerCatching();
void isRunningTurnning();
void isRunningSlipStart();
BOOL isRunningTurnning();
BOOL isRunningSlipStart();
void changePlayerPower(f32, u32, u32);
void clashStandard(u32, u32);
void postureControl();
void isThrowStart();
void considerRotateStart();
void specMain();
void fencePunch();
BOOL isThrowStart();
BOOL considerRotateStart();
BOOL specMain();
BOOL fencePunch();
void fenceMove();
void fenceJumpCatch();
void fenceCatch();
Expand All @@ -954,7 +961,7 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void wireWaitToSWaitL();
void wireSWait();
void wireWait();
void wireMove(f32);
int wireMove(f32);
void getOnWirePosAngle(JGeometry::TVec3<f32>*, short*);
void taken();
void hangJumping();
Expand All @@ -970,10 +977,10 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void moveRoof();
void waitRoof();
void hangRoof();
void roofCommonEvents();
BOOL roofCommonEvents();
void doRoofWaitingProcess();
void doRoofMovingProcess();
void hangingCheckRoof(JGeometry::TVec3<f32>*);
int doRoofMovingProcess();
int hangingCheckRoof(JGeometry::TVec3<f32>*);
void barHang();
void barClimb();
void barWait();
Expand Down Expand Up @@ -1034,7 +1041,7 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void emitParticle(int);
void moveParticle();
void initParticle();
void waitMain();
BOOL waitMain();
void slipEnd();
void brakeEnd();
void hipAttackEnd();
Expand All @@ -1061,10 +1068,10 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void stopCommon(int, int);
void waitingCommonEvents();
void checkPutStart();
void canPut();
BOOL canPut();
void canSleep();
void startTalking();
void swimMain();
BOOL swimMain();
void swimPDown();
void swimDown();
void swimPDamage();
Expand Down Expand Up @@ -1214,7 +1221,8 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
/* 0xB4 */ f32 mSlideVelX;
/* 0xB8 */ f32 mSlideVelZ;

/* 0xBC */ char unkBC[0x1C];
/* 0xBC */ f32 unkBC;
/* 0xC0 */ char unkC0[0x18];

/* 0xD8 */ const TBGCheckData* mWallPlane; // TBGCheckData 0xD8
/* 0xDC */ const TBGCheckData* mRoofPlane; // TBGCheckData 0xDC
Expand Down Expand Up @@ -1265,7 +1273,7 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
/* 0x150 */ u32 unk150;
/* 0x154 */ TWaterEmitInfo* unk154;
/* 0x158 */ u32 unk158;
/* 0x15C */ u32 unk15C;
/* 0x15C */ f32 unk15C;
/* 0x160 */ JGeometry::TVec3<f32>
unk160[4]; // Bone position, probably larger array
/* 0x190 */ u32 unk190;
Expand All @@ -1282,17 +1290,22 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
/* 0x1E4 */ u32 unk1E4;
/* 0x1E8 */ u32 unk1E8;
/* 0x1EC */ f32 unk1EC;
/* 0x1F0 */ char unk1F0[0x29C - 0x1F0];
/* 0x1F0 */ char unk1F0[0x250 - 0x1F0];
/* 0x250 */ Mtx mGroundMtx;
/* 0x280 */ char unk280[0x29C - 0x280];
/* 0x29C */ JGeometry::TVec3<f32> unk29C;
/* 0x2A8 */ char unk2A8[0x2BC - 0x2A8];
/* 0x2A8 */ char unk2A8[0x2BA - 0x2A8];
/* 0x2BA */ s16 unk2BA;
/* 0x2BC */ f32 unk2BC;
/* 0x2C0 */ char unk2C0[0x348 - 0x2C0];
/* 0x2C0 */ TLiveActor* mRidingActor;
/* 0x2C4 */ char unk2C4[0x348 - 0x2C4];
/* 0x348 */ f32 unk348;
/* 0x34C */ u16 unk34C;
/* 0x34E */ u16 unk34E;
/* 0x350 */ s32 unk350;
/* 0x354 */ char unk354[0x370 - 0x354];
/* 0x370 */ u32 unk370;
/* 0x354 */ char unk354[0x36C - 0x354];
/* 0x36C */ f32 unk36C;
/* 0x370 */ f32 unk370;
/* 0x374 */ u32 unk374;
/* 0x378 */ u32 unk378;
/* 0x37C */ u16 unk37C;
Expand Down
23 changes: 22 additions & 1 deletion include/Player/Watergun.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class TWaterGun {
/* 0x1C85 */ u8 mSecondNozzle;
/* 0x1C86 */ bool mIsEmitWater;
/* 0x1C87 */ u8 unk1C87;
/* 0x1C88 */ u32 unk1C88;
/* 0x1C88 */ f32 unk1C88;
/* 0x1C8C */ u8 mCurrentPressure;
/* 0x1C8D */ u8 mPreviousPressure;
/* 0x1C8E */ u8 unk1C8E;
Expand Down Expand Up @@ -235,4 +235,25 @@ class TWaterGun {
/* 0x1D14 */ TWaterGunParams mWatergunParams;
};

bool TWaterGun::isEmitting()
{
if (mCurrentWater == 0) {
return false;
}
s32 kind = getCurrentNozzle()->getNozzleKind();
if (kind == 1) {
TNozzleTrigger* triggerNozzle
= (TNozzleTrigger*)getCurrentNozzle();
if (triggerNozzle->unk385 == TNozzleTrigger::ACTIVE) {
return true;
} else {
return false;
}
} else if (getCurrentNozzle()->unk378 > 0.0f) {
return true;
} else {
return false;
}
}

#endif
6 changes: 5 additions & 1 deletion include/Player/Yoshi.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class TYoshi {
void initInLoadAfter();
void kill();
void movement();
bool onYoshi();
BOOL onYoshi();
void ride();
void setEggYoshiPtr(void*); // TEggYoshi*
void thinkAnimation();
Expand Down Expand Up @@ -73,4 +73,8 @@ class TYoshi {

extern JUtility::TColor bodyColor[4];

#pragma dont_inline on
BOOL TYoshi::onYoshi() { return (u8)mState == MOUNTED ? 1 : 0; }
#pragma dont_inline off

#endif
Loading
Loading