Skip to content

Commit

Permalink
improve creatureLOD
Browse files Browse the repository at this point in the history
  • Loading branch information
PikHacker committed Sep 27, 2023
1 parent 4757a2e commit ea67048
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 236 deletions.
6 changes: 3 additions & 3 deletions docs/recommended_todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/cellIterator.cpp">cellIterator.cpp</a> | 9434 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemHole.cpp">itemHole.cpp</a> | 11712 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemBigFountain.cpp">itemBigFountain.cpp</a> | 12679 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiRescue.cpp">aiRescue.cpp</a> | 13908 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/texCaster.cpp">texCaster.cpp</a> | 13913 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiBreakGate.cpp">aiBreakGate.cpp</a> | 13918 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/flockMgr.cpp">flockMgr.cpp</a> | 14542 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/naviWhistle.cpp">naviWhistle.cpp</a> | 16714 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemRock.cpp">itemRock.cpp</a> | 17257 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiBattle.cpp">aiBattle.cpp</a> | 17401 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/creatureLOD.cpp">creatureLOD.cpp</a> | 18468 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemCave.cpp">itemCave.cpp</a> | 20150 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/creatureLOD.cpp">creatureLOD.cpp</a> | 14136 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/flockMgr.cpp">flockMgr.cpp</a> | 14542 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/naviWhistle.cpp">naviWhistle.cpp</a> | 16714 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemRock.cpp">itemRock.cpp</a> | 17257 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/aiBattle.cpp">aiBattle.cpp</a> | 17401 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/itemCave.cpp">itemCave.cpp</a> | 20150 |
| <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/gameResultTexMgr.cpp">gameResultTexMgr.cpp</a> | 21221 | <a href="https://github.com/projectPiki/pikmin2/tree/main/src/plugProjectKandoU/singleGS_MainResult.cpp">singleGS_MainResult.cpp</a> | 21236 |
| <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 |
Expand Down
18 changes: 9 additions & 9 deletions include/Game/AILOD.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
#include "types.h"

enum AILODFlags {
AILOD_NULL = 0x0,
AILOD_IsMid = 0x1, // is in mid-ground camera
AILOD_IsFar = 0x2, // is in far-ground camera
AILOD_IsVisible = 0x4, // is marked as visible
AILOD_Unk4 = 0x8, // unknown - possibly to do with sound culling?
AILOD_IsVisVP0 = 0x10, // is visible in viewport 0
AILOD_IsVisVP1 = 0x20, // is visible in viewport 1
AILOD_IsVisVP2 = 0x40, // is visible in viewport 2
AILOD_IsVisVP3 = 0x80, // is visible in viewport 3
AILOD_NULL = 0x0,
AILOD_IsMid = 0x1, // is in mid-ground camera
AILOD_IsFar = 0x2, // is in far-ground camera
AILOD_IsVisible = 0x4, // is marked as visible
AILOD_PikiInCell = 0x8, // is at least 1 piki in its cell
AILOD_IsVisVP0 = 0x10, // is visible in viewport 0
AILOD_IsVisVP1 = 0x20, // is visible in viewport 1
AILOD_IsVisVP2 = 0x40, // is visible in viewport 2
AILOD_IsVisVP3 = 0x80, // is visible in viewport 3
};

namespace Game {
Expand Down
2 changes: 1 addition & 1 deletion include/Game/EnemyBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ struct EnemyBase : public Creature, public SysShape::MotionListener, virtual pub
{
bool culling = false;
if (isEvent(0, EB_14)) {
if (!mLod.isFlag(AILOD_IsVisible) && !mLod.isFlag(AILOD_Unk4)) {
if (!mLod.isFlag(AILOD_IsVisible) && !mLod.isFlag(AILOD_PikiInCell)) {
culling = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/plugProjectKandoU/creature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ bool Creature::isPellet() { return mObjectTypeID == OBJTYPE_Pellet; }
* Address: 8013BA30
* Size: 000020
*/
bool Creature::sound_culling() { return !(mLod.isFlag(AILOD_Unk4) || mLod.isFlag(AILOD_IsVisible)); }
bool Creature::sound_culling() { return !(mLod.isFlag(AILOD_PikiInCell) || mLod.isFlag(AILOD_IsVisible)); }

/*
* --INFO--
Expand Down
Loading

0 comments on commit ea67048

Please sign in to comment.