Skip to content
Merged
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
6 changes: 4 additions & 2 deletions include/M3DUtil/M3UModel.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
#define M3DUTIL_M3U_MODEL_HPP

#include <JSystem/JDrama/JDRGraphics.hpp>
#include <JSystem/J3D/J3DGraphAnimator/J3DAnimation.hpp>

struct M3UMtxCalcSetInfo;
class J3DModel;
class J3DFrameCtrl;
class J3DAnmTexPattern;
class J3DTexNoAnm;

class M3UModelCommon {
Expand Down Expand Up @@ -36,6 +35,9 @@ class M3UModel {
void updateInTexPatternAnm();
void updateInMotion();

// Fabricated
J3DFrameCtrl* getFrameCtrl() { return unkC; }

public:
/* 0x4 */ M3UModelCommon* unk4;
/* 0x8 */ J3DModel* unk8;
Expand Down
24 changes: 24 additions & 0 deletions include/M3DUtil/M3UModelMario.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef M3DUTIL_M3U_MODEL_MARIO_HPP
#define M3DUTIL_M3U_MODEL_MARIO_HPP

#include <M3DUtil/M3UModel.hpp>

class M3UModelCommonMario : public M3UModelCommon {
public:
virtual void getMtxCalc(const M3UMtxCalcSetInfo&);

public:
};

class M3UModelMario : public M3UModel {
public:
virtual void changeMtxCalcSIAnmBQAnmTransform(int, u8);
virtual void updateIn();
virtual void updateInMotion();
virtual void updateOut();

public:
// TODO:
};

#endif
44 changes: 35 additions & 9 deletions include/Player/MarioMain.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
#include <System/ParamInst.hpp>
#include <System/DrawSyncCallback.hpp>
#include <Strategic/TakeActor.hpp>
#include <JSystem/J3D/J3DGraphBase/J3DDrawBuffer.hpp>
#include <JSystem/J3D/J3DGraphAnimator/J3DModel.hpp>
#include <M3DUtil/M3UModelMario.hpp>
#include <Player/Yoshi.hpp>

class TLiveActor;
Expand Down Expand Up @@ -584,12 +587,12 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
virtual void damageExec(THitActor*, int, int, int, f32, int, f32, s16);
virtual void getVoiceStatus();

void actnMain();
bool actnMain();
void pitching();
void putting();
void catchLost();
void takePose();
void taking();
bool taking();
void demoMain();
void disappear();
void nomotion();
Expand Down Expand Up @@ -656,7 +659,7 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void changeHandByRate(f32);
void changeHand(int);
void isAnimeLoopOrStop();
void isLast1AnimeFrame();
BOOL isLast1AnimeFrame();
void getMotionFrameCtrl();
void getCurrentFrame(int);
void getRailMtx() const;
Expand Down Expand Up @@ -772,10 +775,10 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void checkGraffitoDamage();
void makeGraffitoDamage(const TMario::TEParams&);
void checkAllMotions();
void changePlayerDropping(u32, u32);
void changePlayerJumping(u32, u32);
bool changePlayerDropping(u32, u32);
bool changePlayerJumping(u32, u32);
void changePlayerTriJump();
void changePlayerStatus(u32, u32, bool);
bool changePlayerStatus(u32, u32, bool);
void throwMario(const JGeometry::TVec3<f32>&, f32);
void setStatusToRunning(u32, u32);
void setStatusToJumping(u32, u32);
Expand All @@ -798,7 +801,7 @@ class TMario : public TTakeActor, public TDrawSyncCallback {
void changePos(const Vec&);
void isSpeedZero();
void canBendBody();
void considerRotateJumpStart();
BOOL considerRotateJumpStart();
void addVelocity(f32);
s32 onYoshi() const;
void getGroundJumpPower() const;
Expand Down Expand Up @@ -1171,8 +1174,31 @@ class TMario : public TTakeActor, public TDrawSyncCallback {

// TODO: Make enum (0 = red, 1 = yellow, 2 = green)
/* 0x388 */ u16 mBlooperColor;

/* 0x38A */ char unk38A[0x5A];
/* 0x38A */ u16 unk38A;
/* 0x38C */ f32 mHolderHeightDiff;
/* 0x390 */ u32 unk390;
/* 0x394 */ J3DDrawBuffer* unk394;
/* 0x398 */ J3DDrawBuffer* unk398;
/* 0x39C */ u32 unk39C;
/* 0x3A0 */ u32 unk3A0;
/* 0x3A4 */ u32 unk3A4;
/* 0x3A8 */ M3UModelMario* unk3A8; // Full model data
/* 0x3AC */ J3DModelData* unk3AC; // Body model data
/* 0x3B0 */ J3DModel* unk3B0; // R Hand 2nd model
/* 0x3B4 */ J3DModel* unk3B4; // L Hand 2nd model
/* 0x3B8 */ J3DModel* unk3B8; // R Hand 3nd model
/* 0x3BC */ J3DModel* unk3BC; // L Hand 3nd model
/* 0x3C0 */ J3DModel* unk3C0; // R Hand 4nd model
/* 0x3C4 */ u8 unk3C4;
/* 0x3C5 */ u8 unk3C5[12]; // Array of bone ids
/* 0x3D1 */ u8 unk3D1;
/* 0x3D2 */ u8 unk3D2;
/* 0x3D3 */ u8 unk3D3;
/* 0x3D4 */ u16 unk3D4;
/* 0x3D6 */ u16 unk3D6;
/* 0x3D8 */ f32 unk3D8;
/* 0x3DC */ f32 unk3DC;
/* 0x3E0 */ void* mCap; // TMarioCap

/* 0x3E4 */ TWaterGun* mWaterGun;

Expand Down
71 changes: 71 additions & 0 deletions src/Player/MarioAction.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
#include <Player/MarioMain.hpp>

bool TMario::actnMain()
{
u32 action = mAction;

bool result = false;

// TODO: Action enum
switch (action) {
case 0x383:
result = taking();
break;
case 0x384:
if ((mInput & 4) != 0) {
result = changePlayerDropping(0x88C, 0);
} else {
if (isLast1AnimeFrame()) {
setAnimation(0xC3, 1.0f);
result = changePlayerStatus(0xC400201, 0, false);
} else {
stopCommon(0x110, 0xC400201);
result = false;
}
}
break;
case 0x386:
if ((mInput & 2) != 0) {
if (considerRotateJumpStart()) {
result = true;
} else {
result = changePlayerJumping(0x2000880, false);
}
} else {
if ((mInput & 4) != 0) {
result = changePlayerStatus(0x88C, 0, false);
} else {
if ((mInput & 8) != 0) {
result = changePlayerStatus(0x50, 0, false);
} else {
stopCommon(0x5A, 0xC400201);
result = false;
}
}
}
break;
case 0x80000387:
if ((mInput & 4) != 0) {
result = changePlayerDropping(0x88c, 0);
} else {
stopCommon(0x6E, 0xC400201);
if (mHeldObject != nullptr
&& unk3A8->getFrameCtrl()->checkPass(20.0f)) {
mHeldObject->receiveMessage(this, 0x6);
mHeldObject = nullptr;
}
result = false;
}
break;
case 0x80000588:
if ((mInput & 4) != 0) {
result = changePlayerDropping(0x88C, 0);
} else {
stopCommon(0x65, 0xC400201);
checkThrowObject();
result = false;
}
break;
}
return result;
}