Skip to content

Commit

Permalink
improve gameSeaMgr
Browse files Browse the repository at this point in the history
  • Loading branch information
PikHacker committed Sep 28, 2023
1 parent ea67048 commit 476f2f3
Show file tree
Hide file tree
Showing 4 changed files with 171 additions and 1,404 deletions.
18 changes: 9 additions & 9 deletions docs/recommended_todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,15 +99,15 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/singleGS_CaveResult.cpp">singleGS_CaveResult.cpp</a> | 22845 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/naviMgr.cpp">naviMgr.cpp</a> | 24409 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/creatureStick.cpp">creatureStick.cpp</a> | 25340 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiBore.cpp">aiBore.cpp</a> | 26633 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiCrop.cpp">aiCrop.cpp</a> | 26982 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiTransport.cpp">aiTransport.cpp</a> | 27275 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameSystem.cpp">gameSystem.cpp</a> | 27889 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/pathfinder.cpp">pathfinder.cpp</a> | 28318 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiAttack.cpp">aiAttack.cpp</a> | 28457 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/vsCardMgr.cpp">vsCardMgr.cpp</a> | 31094 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiEnter.cpp">aiEnter.cpp</a> | 31721 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/singleGS_DayEnd.cpp">singleGS_DayEnd.cpp</a> | 31850 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemBridge.cpp">itemBridge.cpp</a> | 32146 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameDynamics.cpp">gameDynamics.cpp</a> | 34058 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/baseGameSectionKantei.cpp">baseGameSectionKantei.cpp</a> | 35202 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gamePlayDataMemCard.cpp">gamePlayDataMemCard.cpp</a> | 36035 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/piki.cpp">piki.cpp</a> | 36373 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameGeneratorCache.cpp">gameGeneratorCache.cpp</a> | 37575 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiWeed.cpp">aiWeed.cpp</a> | 38056 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/vsGameSection.cpp">vsGameSection.cpp</a> | 39925 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/collinfo.cpp">collinfo.cpp</a> | 42246 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiFormation.cpp">aiFormation.cpp</a> | 43348 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameCPlate.cpp">gameCPlate.cpp</a> | 43760 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameSystem.cpp">gameSystem.cpp</a> | 27889 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameSeaMgr.cpp">gameSeaMgr.cpp</a> | 27984 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/pathfinder.cpp">pathfinder.cpp</a> | 28318 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiAttack.cpp">aiAttack.cpp</a> | 28457 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/vsCardMgr.cpp">vsCardMgr.cpp</a> | 31094 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiEnter.cpp">aiEnter.cpp</a> | 31721 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/singleGS_DayEnd.cpp">singleGS_DayEnd.cpp</a> | 31850 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemBridge.cpp">itemBridge.cpp</a> | 32146 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameDynamics.cpp">gameDynamics.cpp</a> | 34058 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/baseGameSectionKantei.cpp">baseGameSectionKantei.cpp</a> | 35202 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gamePlayDataMemCard.cpp">gamePlayDataMemCard.cpp</a> | 36035 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/piki.cpp">piki.cpp</a> | 36373 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameGeneratorCache.cpp">gameGeneratorCache.cpp</a> | 37575 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiWeed.cpp">aiWeed.cpp</a> | 38056 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/vsGameSection.cpp">vsGameSection.cpp</a> | 39925 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/collinfo.cpp">collinfo.cpp</a> | 42246 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiFormation.cpp">aiFormation.cpp</a> | 43348 |

### <section id="plugProjectKonoU">plugProjectKonoU</section>
| File | Size (bytes) | File | Size (bytes) |
Expand Down
59 changes: 33 additions & 26 deletions include/Game/WaterBox.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,33 +36,40 @@ struct WaterBox {
{
return false;
}
virtual bool inWater2d(Sys::Sphere&); // _0C (weak)
virtual f32 getSeaLevel() = 0; // _10
virtual f32* getSeaHeightPtr() = 0; // _14
virtual bool update() = 0; // _18
virtual void startDown(f32); // _1C (weak)
virtual void startUp(f32); // _20 (weak)
virtual void directDraw(Graphics&); // _24 (weak)
virtual void doAnimation(); // _28 (weak)
virtual void doEntry(); // _2C (weak)
virtual void doSetView(int viewportNumber); // _30 (weak)
virtual void doViewCalc(); // _34 (weak)
virtual void doSimulation(f32); // _38 (weak)
virtual void doDirectDraw(Graphics& gfx); // _3C (weak)
virtual bool inWater2d(Sys::Sphere&) { return false; } // _0C (weak)
virtual f32 getSeaLevel() = 0; // _10
virtual f32* getSeaHeightPtr() = 0; // _14
virtual bool update() = 0; // _18
virtual void startDown(f32) { } // _1C (weak)
virtual void startUp(f32) { } // _20 (weak)
virtual void directDraw(Graphics&) { } // _24 (weak)
virtual void doAnimation(); // _28 (weak)
virtual void doEntry(); // _2C (weak)
virtual void doSetView(int viewportNumber); // _30 (weak)
virtual void doViewCalc(); // _34 (weak)
virtual void doSimulation(f32) { } // _38 (weak)
virtual void doDirectDraw(Graphics& gfx) { } // _3C (weak)
virtual void attachModel(J3DModelData*, Sys::MatTexAnimation*,
f32); // _40 (weak)
virtual void calcMatrix(); // _44 (weak)
virtual void calcMatrix() { } // _44 (weak)

u8 mFlags; // _04
};

struct AABBWaterBox : public WaterBox {
AABBWaterBox();

enum StateID {
WaterBox_Active,
WaterBox_Lowering,
WaterBox_Unk2,
WaterBox_Dead,
};

virtual bool inWater(Sys::Sphere&); // _08
virtual bool inWater2d(Sys::Sphere&); // _0C
virtual f32 getSeaLevel(); // _10 (weak)
virtual f32* getSeaHeightPtr(); // _14 (weak)
virtual f32 getSeaLevel() { return mWaterTop + mLoweredAmount; } // _10 (weak)
virtual f32* getSeaHeightPtr() { return &mWaterHeight; } // _14 (weak)
virtual bool update(); // _18
virtual void startDown(f32); // _1C
virtual void startUp(f32); // _20
Expand All @@ -78,20 +85,20 @@ struct AABBWaterBox : public WaterBox {

void create(Vector3f&, Vector3f&);

u16 _08; // _08
f32 _0C; // _0C
f32 _10; // _10
f32 _14; // _14
u16 mState; // _08 (1 = lowering)
f32 mLoweredAmount; // _0C (total amount moved downward)
f32 mLoweringGoalDiff; // _10 (how far to move down when lowering starts)
f32 _14; // _14 (is this used for anything?)
BoundBox mBounds; // _18
f32 _30; // _30
f32 _34; // _34
f32 _38; // _38
f32 mWaterTop; // _30 (surface level of water)
f32 mWaterHeight; // _34 (depth of the waterbox, from top to bottom)
f32 mLowerTimer; // _38
Vector2f mXzPieceSize; // _3C, length from one side to another, divided by some number (so as to split into pieces)
Vector3f mCentrePoint; // _44
Vector3f mCenterPosition; // _44
SysShape::Model* mModel; // _50
Sys::MatLoopAnimator mMatAnimator; // _54
J3DTexture* _60; // _60
short _64; // _64
J3DTexture* mFbTexture; // _60
short mFbTexIndex; // _64
};
} // namespace Game

Expand Down
4 changes: 2 additions & 2 deletions include/Game/seaMgr.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ namespace Game {
struct SeaMgr : public NodeObjectMgr<WaterBox> {
SeaMgr();

virtual ~SeaMgr(); // _08 (weak)
virtual ~SeaMgr() { } // _08 (weak)

void addSeaMgr(SeaMgr*, Matrixf&);
void addWaterBox(WaterBox*);
Expand All @@ -21,7 +21,7 @@ struct SeaMgr : public NodeObjectMgr<WaterBox> {
// Unused/inlined:
void directDraw(Graphics&);

int _3C; // _3C
int mModelCount; // _3C
J3DModelData** mModelData; // _40
Sys::MatTexAnimation* mAnimations; // _44
};
Expand Down
Loading

0 comments on commit 476f2f3

Please sign in to comment.