From aaac36217ba0d1df5faf573be08d82e06bce1fcc Mon Sep 17 00:00:00 2001 From: intns <84647527+intns@users.noreply.github.com> Date: Sun, 30 Oct 2022 12:49:01 +0000 Subject: [PATCH] Small tweak --- docs/classes.md | 9 +++ docs/recommended_todo.md | 8 +- docs/writing_code.md | 4 - include/AmbientLightObj.h | 8 -- include/BootSection.h | 2 +- include/Demo.h | 2 +- include/Game/BaseGameSection.h | 12 +-- include/Game/{BaseHIOSection.h => BaseHIO.h} | 9 +++ include/Game/BaseHIOParms.h | 17 ---- include/Game/CameraMgr.h | 2 +- include/Game/Creature.h | 10 +-- include/Game/EnemyBase.h | 2 +- include/Game/MoveInfo.h | 42 +++++----- include/Game/cellPyramid.h | 4 +- include/Title.h | 2 +- src/plugProjectKandoU/baseGameSection.cpp | 4 +- src/plugProjectKandoU/baseGameSectionDraw.cpp | 2 +- src/plugProjectKandoU/baseHIOSection.cpp | 2 +- src/plugProjectKandoU/baseHIOparms.cpp | 2 +- src/plugProjectKandoU/creature.cpp | 2 +- src/plugProjectKandoU/pikiState.cpp | 2 +- src/plugProjectNishimuraU/ImomushiState.cpp | 4 +- src/plugProjectYamashitaU/enemyBase.cpp | 80 +++++++++---------- src/plugProjectYamashitaU/pelplant.cpp | 2 +- src/sysGCU/demoSection.cpp | 4 +- 25 files changed, 111 insertions(+), 126 deletions(-) create mode 100644 docs/classes.md delete mode 100644 include/AmbientLightObj.h rename include/Game/{BaseHIOSection.h => BaseHIO.h} (81%) delete mode 100644 include/Game/BaseHIOParms.h diff --git a/docs/classes.md b/docs/classes.md new file mode 100644 index 000000000..1463f621f --- /dev/null +++ b/docs/classes.md @@ -0,0 +1,9 @@ +# Class definitions in header files +When writing code for the project, you will have to create definitions of classes. +Sometimes it is not entirely obvious where a class will be situated, so this file will aim to keep documentation regarding the location of those header files. +Please note that this list will not be exhaustive nor will it be completely up-to-date all the time. +Furthermore, always perform a search of the project for your target structure or namespace before creating a new header file. + +## Game +- `BaseHIOParms`, `BaseHIOSection`, `HIORootNode` can be found in `Game/BaseHIO.h` +- `TPositionObject`, `CollNode`, `CollisionBuffer`, `CellLeg`, `Cell`, `CellObject`, `CellLayer`, `CellPyramid`, `CellIteratorArg`, `CellIterator` can be found in `cellPyramid.h` \ No newline at end of file diff --git a/docs/recommended_todo.md b/docs/recommended_todo.md index a215ba107..fdf409688 100644 --- a/docs/recommended_todo.md +++ b/docs/recommended_todo.md @@ -120,7 +120,7 @@ | cellMgrParms.cpp | 6740 | singleGS_Load.cpp | 10000 | | mapMgrTraceMove.cpp | 10344 | efxModelObjects.cpp | 11463 | | gameDeathCount.cpp | 12494 | gamePelletList.cpp | 12594 | -| baseHIOSection.cpp | 13040 | cellIterator.cpp | 13172 | +| baseHIOSection.cpp | 13033 | cellIterator.cpp | 13172 | | vsGS_Load.cpp | 13331 | flockMgr.cpp | 13934 | | aiBridge.cpp | 14258 | genPiki.cpp | 14456 | | genPellet.cpp | 14546 | genItem.cpp | 15329 | @@ -142,7 +142,7 @@ | baseGameSectionKantei.cpp | 35291 | vsGS_Title.cpp | 37212 | | singleGS_DayEnd.cpp | 37384 | aiWeed.cpp | 38092 | | aiAttack.cpp | 38728 | collinfo.cpp | 42536 | -| gameCPlate.cpp | 43839 | creature.cpp | 45782 | +| gameCPlate.cpp | 43839 | creature.cpp | 45794 | ###
plugProjectKonoU
| File | Size (bytes) | File | Size (bytes) | @@ -173,7 +173,7 @@ | BigFootShadow.cpp | 15684 | HoudaiShadow.cpp | 17519 | | DamagumoShadow.cpp | 18421 | SnakeWholeShadow.cpp | 19376 | | SnakeCrowShadow.cpp | 19417 | MaroFrog.cpp | 20927 | -| RumbleMgr.cpp | 21535 | ImomushiState.cpp | 22020 | +| RumbleMgr.cpp | 21535 | ImomushiState.cpp | 22042 | | QueenState.cpp | 22718 | Demon.cpp | 24834 | | ElecHiba.cpp | 26887 | LeafChappy.cpp | 27467 | | OtakaraBase.cpp | 28244 | RandMapMgr.cpp | 28857 | @@ -244,7 +244,7 @@ | P2DScreen.cpp | 13009 | modelEffect.cpp | 13143 | | JSTObjectSpecialActor.cpp | 13400 | captionMgr.cpp | 14407 | | messageObj.cpp | 16076 | gameflow.cpp | 16519 | -| light.cpp | 17269 | demoSection.cpp | 17575 | +| light.cpp | 17269 | demoSection.cpp | 17568 | | wipe.cpp | 17651 | screenObj.cpp | 17888 | | pikmin2AramMgr.cpp | 18340 | screenScene.cpp | 18502 | | JSTObjectCamera.cpp | 18683 | movieConfig.cpp | 19260 | diff --git a/docs/writing_code.md b/docs/writing_code.md index c7f30767c..9928327a4 100644 --- a/docs/writing_code.md +++ b/docs/writing_code.md @@ -38,7 +38,3 @@ Which, for enemies, you may want to look at the ```isCreatureWithinRange``` func - ```C_PARMS``` is shorthand for ```static_cast(this->m_parms)```. - ```CG_PROPERPARMS(x)``` is shorthand for ```static_cast(x->m_parms)->m_properParms```. - ```C_PROPERPARMS(x)``` is shorthand for ```static_cast(this->m_parms)->m_properParms```. - -## Project Organisation -- Generally speaking, if a search of the include folder does not yield results, you may add a new file for a new structure / class. If it makes more sense for the structure definition to be within another file, prefer that option over a new file completely. -- The project is actively formatted using .clang-format, for a consistent code style. diff --git a/include/AmbientLightObj.h b/include/AmbientLightObj.h deleted file mode 100644 index bdfc90177..000000000 --- a/include/AmbientLightObj.h +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef _AMBIENTLIGHTOBJ_H -#define _AMBIENTLIGHTOBJ_H - -struct AmbientLightObj { - ~AmbientLightObj(); -}; - -#endif diff --git a/include/BootSection.h b/include/BootSection.h index 891adb3ce..6519ae2bd 100644 --- a/include/BootSection.h +++ b/include/BootSection.h @@ -2,7 +2,7 @@ #define _BOOTSECTION_H #include "DvdThreadCommand.h" -#include "Game/BaseHIOSection.h" +#include "Game/BaseHIO.h" struct Graphics; template diff --git a/include/Demo.h b/include/Demo.h index af58a3295..4cc6f7867 100644 --- a/include/Demo.h +++ b/include/Demo.h @@ -4,7 +4,7 @@ // Header for entire Demo namespace. #include "DvdThreadCommand.h" -#include "Game/BaseHIOSection.h" +#include "Game/BaseHIO.h" #include "Game/THPPlayer.h" struct JUTTexture; diff --git a/include/Game/BaseGameSection.h b/include/Game/BaseGameSection.h index 96e8a2929..669980557 100644 --- a/include/Game/BaseGameSection.h +++ b/include/Game/BaseGameSection.h @@ -1,7 +1,7 @@ #ifndef _GAME_BASEGAMESECTION_H #define _GAME_BASEGAMESECTION_H -#include "Game/BaseHIOSection.h" +#include "Game/BaseHIO.h" #include "Game/PikiContainer.h" #include "Camera.h" #include "DvdThreadCommand.h" @@ -197,7 +197,7 @@ struct BaseGameSection : public BaseHIOSection { // should there not be another 0x4 here in USA (not demo)? ... BlendCamera* m_blendCamera; // _50 f32 m_blendFactor; // _54 - bool m_blendCameraActive; // _58 + bool m_isBlendCameraActive; // _58 DvdThreadCommand m_dvdThreadCommand; // _5C IDelegate3* _C8; // _C8 IDelegate3* _CC; // _CC @@ -206,8 +206,8 @@ struct BaseGameSection : public BaseHIOSection { WipeOutFader* m_wipeOutFader; // _D8 WipeOutInFader* m_wipeOutInFader; // _DC u32 _E0; // _E0 - int m_lastActiveNaviIndex; // _E4 - f32 m_vp2YScale; // _E8 + int m_prevNaviIdx; // _E4 + f32 m_secondViewportHeight; // _E8 f32 m_split; // _EC u8 m_setSplit; // _F0 JUTTexture* m_mizuTexture; // _F4 @@ -235,12 +235,12 @@ struct BaseGameSection : public BaseHIOSection { f32 _144; // _144 Delegate1* m_kanteiDelegate; // _148 ZoomCamera* m_treasureZoomCamera; // _14C - u8 _150[4]; // _150 + u32 _150; // _150 JUTTexture* m_xfbImage; // _154 JUTTexture* m_fbTexture; // _158 int m_xfbTexture1; // _15C int m_xfbTexture2; // _160 - u8 _164; // _164 + u8 m_xfbFlags; // _164 JUTTexture* _168; // _168 int m_texData1; // _16C int _170; // _170 diff --git a/include/Game/BaseHIOSection.h b/include/Game/BaseHIO.h similarity index 81% rename from include/Game/BaseHIOSection.h rename to include/Game/BaseHIO.h index 9d3960d91..15521dcb8 100644 --- a/include/Game/BaseHIOSection.h +++ b/include/Game/BaseHIO.h @@ -12,6 +12,15 @@ namespace Game { struct GameMessage; struct HIORootNode; +namespace BaseHIOParms { +extern bool sEntryOpt; +extern bool sEntryOptMapRoom; +extern bool sDrawParticle; +extern bool sMabikiEfx; +extern bool sMapRoomFinal; +extern bool sTekiChappyFlag; +} // namespace BaseHIOParms + struct BaseHIOSection : public Section { BaseHIOSection(JKRHeap*); diff --git a/include/Game/BaseHIOParms.h b/include/Game/BaseHIOParms.h deleted file mode 100644 index 0585c8b86..000000000 --- a/include/Game/BaseHIOParms.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifndef _GAME_BASEHIOPARMS_H -#define _GAME_BASEHIOPARMS_H - -#include "types.h" - -namespace Game { -namespace BaseHIOParms { -extern bool sEntryOpt; -extern bool sEntryOptMapRoom; -extern bool sDrawParticle; -extern bool sMabikiEfx; -extern bool sMapRoomFinal; -extern bool sTekiChappyFlag; -} // namespace BaseHIOParms -} // namespace Game - -#endif diff --git a/include/Game/CameraMgr.h b/include/Game/CameraMgr.h index b1f9417a3..9b8ea42fd 100644 --- a/include/Game/CameraMgr.h +++ b/include/Game/CameraMgr.h @@ -32,7 +32,7 @@ struct CameraData { struct CameraParms : public Parameters { CameraParms(); - Parm m_cnld; + Parm m_cnld; // TODO: offsets? Parm m_cnla; Parm m_cnlf; Parm m_cnlo; diff --git a/include/Game/Creature.h b/include/Game/Creature.h index 418e83a98..9cd981e75 100644 --- a/include/Game/Creature.h +++ b/include/Game/Creature.h @@ -92,6 +92,7 @@ struct CreatureKillArg { int _04; // _04 }; +/// @brief Basic Creature structure struct Creature : public CellObject { struct CheckHellArg { inline CheckHellArg() @@ -327,11 +328,6 @@ struct Creature : public CellObject { static bool usePacketCulling; Matrixf* m_captureMatrix; // _0B8 - // The following bitfield is here for mod usage. - // Vanilla seems to just use the previous 2 representations. - // u32 m_isDebugCollision : 1, : 24, m_isMovieExtra : 1, - // m_isMovieMotion : 1, m_isMovieActor : 1, padding2 : 1, - // m_isCollisionFlick : 1, m_isAlive : 1, m_isAtari : 1; BitFlag m_flags; // _0BC void* m_parms; // _0C0 Generator* m_generator; // _0C4 @@ -342,14 +338,14 @@ struct Creature : public CellObject { Recti m_cellRect; // _0E0 Creature* m_sticked; // _0F0 Creature* m_sticker; // _0F4 - CollPart* _0F8; // _0F8 + CollPart* m_stuckCollPart; // _0F8 Creature* m_captured; // _0FC Creature* m_capture; // _100 Vector3f _104; // _104 short m_hasStick; // _110 CollTree* m_collTree; // _114 float m_mass; // _118 - Vector3f _11C; // _11C + Vector3f m_triangleNormal; // _11C u16 m_objectTypeID; // _128 UpdateContext m_updateContext; // _12C Matrixf m_mainMatrix; // _138 diff --git a/include/Game/EnemyBase.h b/include/Game/EnemyBase.h index f0b2e59df..ba329028d 100644 --- a/include/Game/EnemyBase.h +++ b/include/Game/EnemyBase.h @@ -581,7 +581,7 @@ struct EnemyBase : public Creature, public SysShape::MotionListener, virtual pub Sys::Sphere m_curLodSphere; // _270 WaterBox* m_waterBox; // _280 EnemyEffectNodeHamon* m_effectNodeHamon; // _284 - Sys::Triangle* _288; // _288 + Sys::Triangle* m_curWallTri; // _288 PSM::EnemyBase* m_soundObj; // _28C CNode m_effectNodeHamonRoot; // _290 - treat as EnemyEffectNodeBase with EnemyEffectNodeHamon nodes f32 _2A8; // _2A8 diff --git a/include/Game/MoveInfo.h b/include/Game/MoveInfo.h index 6a217320a..f5c6b926b 100644 --- a/include/Game/MoveInfo.h +++ b/include/Game/MoveInfo.h @@ -18,32 +18,32 @@ struct TDispTriangleArray; struct MoveInfo { inline MoveInfo(Sys::Sphere* sphere, Vector3f* vec, float a) : _00(sphere) - , _04(vec) + , m_velocity(vec) , _08(a) { - _0C = 0.0f; - _10 = nullptr; - _44 = nullptr; - _74 = 0; - _19 = 0; - _18 = 0; - _48 = nullptr; - _14 = nullptr; - _90 = 0; - _94 = nullptr; - _2C = JMath::sincosTable_.m_table[256].first; // pi/2 - _30 = 0.6f; - _98 = -1; - _4C = nullptr; - _1A = 0; + _0C = 0.0f; + _10 = nullptr; + m_curTriangle = nullptr; + _74 = 0; + _19 = 0; + _18 = 0; + m_curWallTri = nullptr; + m_infoOrigin = nullptr; + _90 = 0; + _94 = nullptr; + _2C = JMath::sincosTable_.m_table[256].first; // pi/2 + _30 = 0.6f; + _98 = -1; + _4C = nullptr; + _1A = 0; } Sys::Sphere* _00; // _00 - Vector3f* _04; // _04 + Vector3f* m_velocity; // _04 float _08; // _08 float _0C; // _0C Delegate2* _10; // _10 - BaseItem* _14; // _14 + BaseItem* m_infoOrigin; // _14 u8 _18; // _18 u8 _19; // _19 u8 _1A; // _1A @@ -52,10 +52,10 @@ struct MoveInfo { float _2C; // _2C float _30; // _30 u8 _34[16]; // _34 - Sys::Triangle* _44; // _44 - Sys::Triangle* _48; // _48 + Sys::Triangle* m_curTriangle; // _44 + Sys::Triangle* m_curWallTri; // _48 Sys::Triangle* _4C; // _4C - Vector3f _50; // _50 + Vector3f m_position; // _50 Vector3f _5C; // _5C float _68; // _60 float _6C; // _64 diff --git a/include/Game/cellPyramid.h b/include/Game/cellPyramid.h index 7051d9e0a..30a77c946 100644 --- a/include/Game/cellPyramid.h +++ b/include/Game/cellPyramid.h @@ -42,8 +42,8 @@ struct CollisionBuffer { void insertSort(CellObject*, float); int findIndex(CellObject*); - int m_nodeCount; // _00 /* total node count? */ - int m_usedNodeCount; // _04 /* used node count? */ + int m_nodeCount; // _00/ + int m_usedNodeCount; // _04 CollNode* m_collNodes; // _08 CellObject* m_cellObject; // _0C }; diff --git a/include/Title.h b/include/Title.h index a4a2e0752..6d33e9870 100644 --- a/include/Title.h +++ b/include/Title.h @@ -4,7 +4,7 @@ // Header for entire Demo namespace. #include "DvdThreadCommand.h" -#include "Game/BaseHIOSection.h" +#include "Game/BaseHIO.h" #include "Section.h" #include "ebi/Omake.h" #include "ebi/TMainTitleMgr.h" diff --git a/src/plugProjectKandoU/baseGameSection.cpp b/src/plugProjectKandoU/baseGameSection.cpp index 2c46e7d8f..5eaf98e3f 100644 --- a/src/plugProjectKandoU/baseGameSection.cpp +++ b/src/plugProjectKandoU/baseGameSection.cpp @@ -4,7 +4,7 @@ #include "Dolphin/stl.h" #include "DvdThreadCommand.h" #include "Game/BaseGameSection.h" -#include "Game/BaseHIOSection.h" +#include "Game/BaseHIO.h" #include "Game/CameraMgr.h" #include "Game/TimeMgr.h" #include "Game/gameGenerator.h" @@ -902,7 +902,7 @@ BaseGameSection::BaseGameSection(JKRHeap* heap) : BaseHIOSection(heap) , m_dvdThreadCommand() { - _164 = 0; + m_xfbFlags = 0; setDisplay(JFWDisplay::createManager(nullptr, _1C, JUTXfb::DoubleBuffer, true), 1); m_playerMode = 2; m_draw2DCreature = nullptr; diff --git a/src/plugProjectKandoU/baseGameSectionDraw.cpp b/src/plugProjectKandoU/baseGameSectionDraw.cpp index 9b598952e..f9b1aa36d 100644 --- a/src/plugProjectKandoU/baseGameSectionDraw.cpp +++ b/src/plugProjectKandoU/baseGameSectionDraw.cpp @@ -113,7 +113,7 @@ void BaseGameSection::newdraw_drawAll(Viewport* vp) _12C->get(7)->draw(); _130->get(7)->draw(); - if (!_168 && (_164 & 3) == 0) { + if (!_168 && (m_xfbFlags & 3) == 0) { m_xfbImage->capture(m_xfbTexture1, m_xfbTexture2, GX_TF_RGB565, true, 0); } m_lightMgr->set(gfx); diff --git a/src/plugProjectKandoU/baseHIOSection.cpp b/src/plugProjectKandoU/baseHIOSection.cpp index 6739ae483..3345253d1 100644 --- a/src/plugProjectKandoU/baseHIOSection.cpp +++ b/src/plugProjectKandoU/baseHIOSection.cpp @@ -1,4 +1,4 @@ -#include "Game/BaseHIOSection.h" +#include "Game/BaseHIO.h" #include "CNode.h" #include "Controller.h" #include "Dolphin/os.h" diff --git a/src/plugProjectKandoU/baseHIOparms.cpp b/src/plugProjectKandoU/baseHIOparms.cpp index d49c56547..62bdfd475 100644 --- a/src/plugProjectKandoU/baseHIOparms.cpp +++ b/src/plugProjectKandoU/baseHIOparms.cpp @@ -1,4 +1,4 @@ -#include "Game/BaseHIOParms.h" +#include "Game/BaseHIO.h" #include "types.h" namespace Game { diff --git a/src/plugProjectKandoU/creature.cpp b/src/plugProjectKandoU/creature.cpp index e27e60d30..2641241e4 100644 --- a/src/plugProjectKandoU/creature.cpp +++ b/src/plugProjectKandoU/creature.cpp @@ -431,7 +431,7 @@ void Creature::init(Game::CreatureInitArg* arg) m_flags.typeView |= 7; clearStick(); m_updateContext.init(Game::collisionUpdateMgr); - _11C = Vector3f(0.0f); + m_triangleNormal = Vector3f(0.0f); clearCapture(); m_curTriangle = nullptr; m_collisionPosition = Vector3f(0.0f, 1.0f, 0.0f); diff --git a/src/plugProjectKandoU/pikiState.cpp b/src/plugProjectKandoU/pikiState.cpp index 0ac6e5d76..bf3ad4d63 100644 --- a/src/plugProjectKandoU/pikiState.cpp +++ b/src/plugProjectKandoU/pikiState.cpp @@ -519,7 +519,7 @@ void PikiSwallowedState::init(Piki* piki, StateArg* stateArg) piki->startMotion(animIdx, animIdx, nullptr, nullptr); Creature* creature = piki->m_sticker; - CollPart* collpart = piki->_0F8; + CollPart* collpart = piki->m_stuckCollPart; if (piki->getCurrAction()) { piki->getCurrAction()->cleanup(); diff --git a/src/plugProjectNishimuraU/ImomushiState.cpp b/src/plugProjectNishimuraU/ImomushiState.cpp index 2ac1bbf13..44076ad65 100644 --- a/src/plugProjectNishimuraU/ImomushiState.cpp +++ b/src/plugProjectNishimuraU/ImomushiState.cpp @@ -591,7 +591,7 @@ void StateClimb::exec(EnemyBase* enemy) f32 val = imomushi->_2FC; f32 yval = imomushi->_104.y; if (yval > 1.0f - val) { - CollPart* childPart = static_cast(imomushi->_0F8->m_child); + CollPart* childPart = static_cast(imomushi->m_stuckCollPart->m_child); if (childPart != nullptr && childPart->m_hasCollPart == 2) { imomushi->startClimbPlant(childPart); } else { @@ -599,7 +599,7 @@ void StateClimb::exec(EnemyBase* enemy) imomushi->finishMotion(); } } else if (yval < -val) { - CollPart* parentPart = static_cast(imomushi->_0F8->m_parent); + CollPart* parentPart = static_cast(imomushi->m_stuckCollPart->m_parent); if (parentPart != nullptr && parentPart->m_hasCollPart == 2) { imomushi->startClimbPlant(parentPart); } diff --git a/src/plugProjectYamashitaU/enemyBase.cpp b/src/plugProjectYamashitaU/enemyBase.cpp index 867d5f0fc..e276135ce 100644 --- a/src/plugProjectYamashitaU/enemyBase.cpp +++ b/src/plugProjectYamashitaU/enemyBase.cpp @@ -13,7 +13,7 @@ #include "Game/WaterBox.h" #include "Game/AIConstants.h" #include "Game/BaseItem.h" -#include "Game/BaseHIOParms.h" +#include "Game/BaseHIO.h" #include "Game/Cave/RandMapMgr.h" #include "Game/cellPyramid.h" #include "Game/EnemyAnimatorBase.h" @@ -765,7 +765,7 @@ EnemyBase::EnemyBase() , m_pelletInfo() , m_lodParm() , m_waterBox(nullptr) - , _288(0) + , m_curWallTri(0) , m_soundObj(nullptr) , m_effectNodeHamonRoot() , _2A8(0.0f) @@ -2593,26 +2593,26 @@ void EnemyBase::bounceProcedure(Sys::Triangle* triangle) */ // WIP: https://decomp.me/scratch/YsXWy // LITERALLY MATCHES IF VECTOR3F::LENGTH AND NORMALISE MATCH SMH -void EnemyBase::collisionMapAndPlat(f32 constraint) +void EnemyBase::collisionMapAndPlat(f32 accelRate) { if (!isStickTo()) { if (!(isEvent(0, EB_3))) { - doSimulationGround(constraint); + doSimulationGround(accelRate); } else { - doSimulationFlying(constraint); + doSimulationFlying(accelRate); resetEvent(0, EB_30); } - f32 radius = static_cast(m_parms)->m_general.m_fp01.m_value; + f32 yOffsetFromMap = static_cast(m_parms)->m_general.m_fp01.m_value; Vector3f pos = getPosition(); m_commonEffectOffset = getOffsetForMapCollision(); Sys::Sphere sphere; pos += m_commonEffectOffset; - pos.y += radius; + pos.y += yOffsetFromMap; sphere.m_position = pos; - sphere.m_radius = radius; + sphere.m_radius = yOffsetFromMap; f32 z; if (checkSecondary()) { @@ -2621,57 +2621,57 @@ void EnemyBase::collisionMapAndPlat(f32 constraint) z = static_cast(m_parms)->m_props.m_wallReflection.m_value; } - _11C.y = 0.0f; + m_triangleNormal.y = 0.0f; - Vector3f vec = m_impVelocity + _11C; - MoveInfo moveInfo(&sphere, &vec, z); - moveInfo._14 = (BaseItem*)this; + Vector3f velocityDest = m_impVelocity + m_triangleNormal; + MoveInfo moveInfo(&sphere, &velocityDest, z); + moveInfo.m_infoOrigin = (BaseItem*)this; - mapMgr->traceMove(moveInfo, constraint); + mapMgr->traceMove(moveInfo, accelRate); - m_impVelocity = vec; + m_impVelocity = velocityDest; - f32 velocityNorm = m_impVelocity.normalise(); - f32 _11CNorm = _11C.length(); + f32 velocityNorm = m_impVelocity.normalise(); + f32 collTriNormal = m_triangleNormal.length(); - if ((velocityNorm > _11CNorm)) { - velocityNorm -= _11CNorm; + if ((velocityNorm > collTriNormal)) { + velocityNorm -= collTriNormal; m_impVelocity *= velocityNorm; - _11C = 0.0f; + m_triangleNormal = 0.0f; } else { m_impVelocity *= velocityNorm; - _11C = 0.0f; + m_triangleNormal = 0.0f; } - if (m_curTriangle == nullptr && moveInfo._44) { - bounceProcedure(moveInfo._44); + if (m_curTriangle == nullptr && moveInfo.m_curTriangle) { + bounceProcedure(moveInfo.m_curTriangle); } - m_curTriangle = moveInfo._44; + m_curTriangle = moveInfo.m_curTriangle; - m_collisionPosition = moveInfo._50; + m_collisionPosition = moveInfo.m_position; - if (_288 == nullptr && moveInfo._48) { + if (m_curWallTri == nullptr && moveInfo.m_curWallTri) { wallCallback(moveInfo); } - _288 = moveInfo._48; + m_curWallTri = moveInfo.m_curWallTri; if (platMgr != nullptr && isEvent(0, EB_13)) { - moveInfo._04 = &m_impVelocity; + moveInfo.m_velocity = &m_impVelocity; platMgr->traceMove(moveInfo, constraint); if (m_curTriangle == nullptr) { - if (moveInfo._44) { - bounceProcedure(moveInfo._44); + if (moveInfo.m_curTriangle) { + bounceProcedure(moveInfo.m_curTriangle); } - m_curTriangle = moveInfo._44; + m_curTriangle = moveInfo.m_curTriangle; - m_collisionPosition = moveInfo._50; + m_collisionPosition = moveInfo.m_position; } - if (_288 == nullptr && moveInfo._48) { + if (m_curWallTri == nullptr && moveInfo.m_curWallTri) { wallCallback(moveInfo); } - _288 = moveInfo._48; + m_curWallTri = moveInfo.m_curWallTri; } if (mapMgr->hasHiddenCollision()) { @@ -2679,12 +2679,12 @@ void EnemyBase::collisionMapAndPlat(f32 constraint) } m_position.x = sphere.m_position.x - m_commonEffectOffset.x; - m_position.y = sphere.m_position.y - m_commonEffectOffset.y - radius; + m_position.y = sphere.m_position.y - m_commonEffectOffset.y - yOffsetFromMap; m_position.z = sphere.m_position.z - m_commonEffectOffset.z; updateSpheres(); } else { - _11C = 0.0f; + m_triangleNormal = 0.0f; doSimulationStick(constraint); @@ -3211,7 +3211,7 @@ void EnemyBase::doSimulation(f32 arg) { static_cast void EnemyBase::doSimulationConstraint(f32 arg) { if (!(isEvent(0, EB_HardConstraint))) { - if (_11C.x != 0.0f || _11C.z != 0.0f) { + if (m_triangleNormal.x != 0.0f || m_triangleNormal.z != 0.0f) { setEvent(0, EB_30); } else if (m_curTriangle) { resetEvent(0, EB_30); @@ -4831,10 +4831,10 @@ void EnemyBase::hardConstraintOn() void EnemyBase::hardConstraintOff() { resetEvent(0, EB_HardConstraint); - m_mass = m_friction; - _11C.x = 0.0f; - _11C.y = 0.0f; - _11C.z = 0.0f; + m_mass = m_friction; + m_triangleNormal.x = 0.0f; + m_triangleNormal.y = 0.0f; + m_triangleNormal.z = 0.0f; } /* diff --git a/src/plugProjectYamashitaU/pelplant.cpp b/src/plugProjectYamashitaU/pelplant.cpp index 5d2a17b19..1a33d41c4 100644 --- a/src/plugProjectYamashitaU/pelplant.cpp +++ b/src/plugProjectYamashitaU/pelplant.cpp @@ -525,7 +525,7 @@ bool Obj::farmCallBack(Creature* c, float power) void Obj::onStickStart(Creature* other) { EnemyBase::onStickStart(other); - if (other->_0F8 && other->_0F8->m_specialID.getStrID()[3] == '0') { + if (other->m_stuckCollPart && other->m_stuckCollPart->m_specialID.getStrID()[3] == '0') { addDamage(m_maxHealth, 1.0f); } } diff --git a/src/sysGCU/demoSection.cpp b/src/sysGCU/demoSection.cpp index aa6eefd05..6f1d6c51f 100644 --- a/src/sysGCU/demoSection.cpp +++ b/src/sysGCU/demoSection.cpp @@ -1,5 +1,5 @@ #include "Demo.h" -#include "Game/BaseHIOSection.h" +#include "Game/BaseHIO.h" #include "Game/THPPlayer.h" #include "System.h" #include "types.h" @@ -15,7 +15,7 @@ .skip 1 .asciz "JMANewSinTable" .skip 1 - .4byte 0x54485083 # "THP�Z�N�V����" + .4byte 0x54485083 # "THP?¿½Z?¿½N?¿½V?¿½?¿½?¿½?¿½" .4byte 0x5A834E83 .4byte 0x56838783 .4byte 0x93000000