Skip to content

Commit

Permalink
work a bit on ItemObjMgr
Browse files Browse the repository at this point in the history
  • Loading branch information
SwareJonge committed Jan 2, 2025
1 parent 9cb8371 commit ce46cbd
Show file tree
Hide file tree
Showing 10 changed files with 180 additions and 99 deletions.
6 changes: 3 additions & 3 deletions include/Sato/ItemBanana.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ItemBananaBig : public ItemBanana
void doUniv();
void initEquip();
void callHitItemSound(ItemObj *);
void calcColReaction(ItemObj *);
ItemColFlag calcColReaction(ItemObj *);
void initDisappear();

// static J3DAnmObjTrans *mAnmTrans[3];
Expand All @@ -82,7 +82,7 @@ class ItemFakeItemBox : public ItemBanana
void initEquip();
void callHitItemSound(ItemObj *);
void moveNormal(CrsGround &);
void calcColReaction(ItemObj *);
ItemColFlag calcColReaction(ItemObj *);
void initDisappear();
void doDisappear();
void calcBaseRotQt();
Expand All @@ -106,4 +106,4 @@ class ItemFakeItemBox : public ItemBanana
// void AnmControlTrans::changeAnm(u8, bool) // AnmControlTrans.h; // 0x8025202c
// void TAnmControlBase<J3DAnmObjMatTexSRT>::frameProc() // TAnmControlBase.h; // 0x8025409c

#endif // ITEMBANANA_H
#endif // ITEMBANANA_H
6 changes: 2 additions & 4 deletions include/Sato/ItemBomb.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@ class ItemBomb : public ItemObj
void update(); // 0x8025bdb0
void setAnimation(BombBck, int); // 0x8025bf68
void deleteEffect(); // 0x8025bf7c
void IsHitKart(int, const JGeometry::TVec3f &, f32); // 0x8025bfc0
bool IsHitKart(int, const JGeometry::TVec3f &, f32); // 0x8025bfc0
void doUniv(); // 0x8025c034
void doScale(); // 0x8025c2d8
void setSparkTranslation(); // 0x8025c3a8
void calcColReaction(ItemObj *); // 0x8025c464
ItemColFlag calcColReaction(ItemObj *); // 0x8025c464
void initEquip(); // 0x8025c46c
void setMiniGameBombColor(); // 0x8025c4f4
void doEquip(); // 0x8025c618
Expand Down Expand Up @@ -92,8 +92,6 @@ class ItemBombSuc : public ItemObjSuc
ItemBombSuc(u32);
void reset();
virtual ~ItemBombSuc() {} // 0x8025d858

u8 _[0x300 - 0x2b0];
};

// Inline Functions referenced in TU:
Expand Down
22 changes: 13 additions & 9 deletions include/Sato/ItemObj.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class ItemObj
virtual void viewCalc(u32); // 18
virtual void setCurrentViewNo(u32); // 1C
virtual void drawSimpleModel(u32, f32 (*)[4], J3DUClipper *, f32 (*)[4]); // 20
virtual void calcColReaction(ItemObj *); // 24
virtual ItemColFlag calcColReaction(ItemObj *); // 24
virtual const char *getBmdFileName(); // 28
virtual u32 getModelDataAppendLoadFlg() { return 0; } // 2C
virtual void callHitItemSound(ItemObj *); // 30
Expand Down Expand Up @@ -98,8 +98,8 @@ class ItemObj
virtual void selectSucChild(); // B4
virtual void doSucReleaseFunc(ItemObj *); // B8
virtual void doSucSpReleaseFunc(ItemObj *); // BC
virtual void IsHitKart(int, const JGeometry::TVec3f &, f32); // C0
virtual void IsHitObject(ObjColBase *, const JGeometry::TVec3f &, ObjColBase *); // C4
virtual bool IsHitKart(int, const JGeometry::TVec3f &, f32); // C0
virtual bool IsHitObject(ObjColBase *, const JGeometry::TVec3f &, ObjColBase *); // C4
virtual void executeGeoObjHitCallBack(GeographyObj *); // C8

void loadmodel(J3DModelData *); // 0x8024a4a4
Expand Down Expand Up @@ -147,7 +147,7 @@ class ItemObj
void rotationRad(f32 &, f32); // 0x8024ccf0
void QuatRotX(f32, Quaternion *); // 0x8024cd40
void QuatRotY(f32, Quaternion *); // 0x8024cd84
void IsSpecialItem(int); // 0x8024cdc8
static bool IsSpecialItem(int); // 0x8024cdc8
void getCompVecLength(JGeometry::TVec3f &, f32 &); // 0x8024cdf8
void setFrameNoColKart(u8, bool); // 0x8024ced0
void doFrameNoColKart(); // 0x8024cfa0
Expand All @@ -171,7 +171,7 @@ class ItemObj
void moveFall(); // 0x8024e558
void doHeartWaiting(); // 0x8024e880
void doFallScaling(); // 0x8024e8dc
void colItemReflect(ItemObj *, ItemObj *, ItemColFlag, ItemColFlag); // 0x8024e93c
static void colItemReflect(ItemObj *, ItemObj *, ItemColFlag, ItemColFlag); // 0x8024e93c
void doColMoveReflect(JGeometry::TVec3f, f32); // 0x8024eba8
void doColMoveReflectAndStopDisappear(JGeometry::TVec3f, f32); // 0x8024ecdc
void doColMoveJumpDown(JGeometry::TVec3f, f32); // 0x8024ef28
Expand Down Expand Up @@ -228,12 +228,14 @@ class ItemObj
return mItemKind;
}

bool isCertainState() const {
return mState != 10 && mState != 8 && mState != 7;
bool isCertainState() const {
int state = getState();
return ((state != 10 && state != 8 && state != 7));
}

bool tst_80() const { return _12c & 0x80; }

void setTransfer1() { mTransferFlags |= 1; }
void clrTransferPartner() { mTransferFlags &= ~0x200; }
void setTransferPartner() { mTransferFlags |= 0x200; }

Expand All @@ -259,13 +261,15 @@ class ItemObj
bool IsSuccessionChildItem() { return mSuccessionItemLink.getList() != 0; } // 0x8024b324
void doOccur() { doFall(); } // 0x8024af68, ptmf shit

const JGeometry::TVec3f getColPos() const { return mColPos; }

// private:

typedef void (ItemObj::*StateFunc)();

JGeometry::TVec3f mPos; // 04
JGeometry::TVec3f _10; //
JGeometry::TVec3f _1c; //
JGeometry::TVec3f mColPos; // 1C
f32 _28; //
f32 _2c; //
f32 mMaxVel; // 30
Expand Down Expand Up @@ -326,4 +330,4 @@ class ItemObj
u8 _2ac[0x2b0 - 0x2ac]; //
}; // 2b0

#endif
#endif
30 changes: 7 additions & 23 deletions include/Sato/ItemObjMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ class ItemShuffleMgr

struct KartSlotRankDataSet
{
KartSlotData *data; // 0
u32 specialItemIndex; // 4
u32 specialItemChance; // 8
int kart_rank; // C
int total; // 10
int kart_index; // 14
const KartSlotData *slotData; // 0
int specialItemIndex; // 4
u32 specialItemChance; // 8
int kart_rank; // C
int total; // 10
int kart_index; // 14
};
static KartSlotData mSlotList;
static KartSlotData mSlotListEnemy;
Expand Down Expand Up @@ -287,23 +287,7 @@ class ItemObjMgr : public SysDbUsrPage
void drawColModel(u32); // 0x80241f64
static void setLANDebugInfo(); // 0x80241f68

ItemObj *equipItem2(int kind, int kart_index, u8 driver_index) { // fabricated

if (GetGeoObjMgr()->isBombBattle())
{
ItemObj *obj = equipItemSuccession(kind, kart_index, driver_index);
removeMiniGameList(obj);
return obj;
}
else if (kind > 0x10)
{
return equipItemSuccession(kind, kart_index, driver_index);
}
else
{
return equipItem(kind);
}
}
ItemObj *equipItem2(int kind, int kart_index, u8 driver_index);

// Inline/Unused
ItemObj *equipItem(u32);
Expand Down
14 changes: 6 additions & 8 deletions include/Sato/ItemTurtle.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ItemGTurtle : public ItemObj
const char *getBmdFileName(); // 0x8024424c
void createModel(JKRSolidHeap *, u32, u32); // 0x80244274
void doUniv(); // 0x80244278
void calcColReaction(ItemObj *); // 0x80244370
ItemColFlag calcColReaction(ItemObj *); // 0x80244370
void callHitItemSound(ItemObj *); // 0x80244378
void initEquip(); // 0x802443c4
void doEquip(); // 0x802444c0
Expand Down Expand Up @@ -64,7 +64,7 @@ class ItemRTurtle : public ItemGTurtle
void reset();
const char *getBmdFileName();
void doUniv();
void calcColReaction(ItemObj *);
ItemColFlag calcColReaction(ItemObj *);
void initRelease();
void searchTarget(float, bool);
void checkOver1stKart();
Expand Down Expand Up @@ -97,7 +97,7 @@ class ItemGTurtleBig : public ItemGTurtle
void initRelease();
void initSpRelease();
void initDisappear();
void calcColReaction(ItemObj *);
ItemColFlag calcColReaction(ItemObj *);
void getMaxColWallNum();
void calcBalanceFlying();
void checkKartColDisappear(int);
Expand Down Expand Up @@ -131,7 +131,7 @@ class ItemFireBall : public ItemGTurtle
void doDivested();
void doUnivRelease();
void moveNormal(CrsGround &);
void calcColReaction(ItemObj *);
ItemColFlag calcColReaction(ItemObj *);
void calcRotQuat(Quaternion *);
void getMaxColWallNum();
void executeGeoObjHitCallBack(GeographyObj *);
Expand All @@ -152,8 +152,6 @@ class ItemGTurtleSuc : public ItemObjSuc
void doSucReleaseFunc(ItemObj *);
void doSucSpReleaseFunc(ItemObj *);
virtual ~ItemGTurtleSuc() {} // 0x80247da4

u8 _2b0[0x300 - 0x2b0];
};

class ItemRTurtleSuc : public ItemGTurtleSuc
Expand Down Expand Up @@ -185,7 +183,7 @@ class ItemFireBallSuc : public ItemObjSuc
void IsEfctTypeRed() const;
virtual ~ItemFireBallSuc() {} // 0x80249b44

u8 _[0x310 - 0x2b0];
u8 _[0x310 - 0x300];
};

// Inline/Unknown Functions Referenced in TU:
Expand All @@ -208,4 +206,4 @@ class ItemFireBallSuc : public ItemObjSuc
// void ItemObj::initDisappear() // ItemObj.h; // 0x80249edc
// void ItemObj::deleteEffect() // ItemObj.h; // 0x80249ee0

#endif // ITEMGTURTLE_H
#endif // ITEMGTURTLE_H
4 changes: 2 additions & 2 deletions include/Sato/ItemWanWan.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ItemWanWanObj : public ItemObj
void viewCalc(u32);
void setCurrentViewNo(u32);
void doUniv();
void calcColReaction(ItemObj *);
ItemColFlag calcColReaction(ItemObj *);
void initEquip();
void doEquip();
void initRelease();
Expand Down Expand Up @@ -62,4 +62,4 @@ class ItemWanWanObj : public ItemObj
u8 _[0x35c - 0x2b0];
};

#endif // ITEMWANWAN_H
#endif // ITEMWANWAN_H
4 changes: 2 additions & 2 deletions include/Sato/ItemYoshiEgg.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ItemYoshiEgg : public ItemObj
void calcRotQuat(Quaternion *); // 0x8027e3d0
void calcCreateItem(u32 *); // 0x8027e4b4
void calcRndItemKind(u32, u32 *, u32 *); // 0x8027e620
void calcColReaction(ItemObj *); // 0x8027e6cc
ItemColFlag calcColReaction(ItemObj *); // 0x8027e6cc
void moveColWall(CrsGround &); // 0x8027e728
void checkKartColDisappear(int); // 0x8027e774

Expand All @@ -39,4 +39,4 @@ class ItemYoshiEgg : public ItemObj
u8 _[0x334 - 0x2b0];
}; // class ItemYoshiEgg

#endif // ITEMYOSHIEGG_H
#endif // ITEMYOSHIEGG_H
3 changes: 1 addition & 2 deletions src/Kaneshige/GeoStartLine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ void GeoStartLine::reset() {

CrsGround ground;
ground.search(mPos);
f32 gndHeight = ground.getHeight();
mPos.y = 2.0f + gndHeight;
mPos.y = 2.0f + ground.getHeight();

ground.getNormal(&upDir);
frDir.cross(lfDir, upDir);
Expand Down
8 changes: 4 additions & 4 deletions src/Sato/ItemFlyTurtle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -676,9 +676,9 @@ void ItemFlyTurtle::initDisappear() {

JGeometry::TMtx34f r_m;
ObjUtility::setRMtx(r_m, norm, frDir);
r_m[0][3] = _1c.x;
r_m[1][3] = _1c.y;
r_m[2][3] = _1c.z;
r_m[0][3] = mColPos.x;
r_m[1][3] = mColPos.y;
r_m[2][3] = mColPos.z;
mNewBounds = mBounds;
mBounds = mBombEffect->mSphere1;
mBombEffect->init(r_m,1, 1.0f);
Expand Down Expand Up @@ -808,4 +808,4 @@ void CLPointControllerFlyTurtle::recursiveTargetCalcBack(CLPoint *point, int gro
}
}

#include "JSystem/JAudio/JASFakeMatch2.h"
#include "JSystem/JAudio/JASFakeMatch2.h"
Loading

0 comments on commit ce46cbd

Please sign in to comment.