Skip to content

Commit

Permalink
Member variable naming
Browse files Browse the repository at this point in the history
  • Loading branch information
intns committed Jan 13, 2025
1 parent e26da26 commit 9a5ea3c
Show file tree
Hide file tree
Showing 14 changed files with 132 additions and 130 deletions.
4 changes: 2 additions & 2 deletions include/GameCoreSection.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ struct GameCoreSection : public Node {
u8 _31; // _31
u32 _34; // _34, unknown
u8 _38[0x4]; // _38, unknown
Menu* _3C; // _3C, unknown
Menu* mAiPerfDebugMenu; // _3C, unknown
u8 _40[0x50 - 0x40]; // _40, unknown
u32 _50; // _50, unknown
SearchSystem* _54; // _54
Navi* mNavi; // _58
u8 _5C[0x64 - 0x5C]; // _5C, unknown
MapMgr* mMapMgr; // _64
Texture* _68; // _68
Texture* mShadowTexture; // _68
Font* mBigFont; // _6C
Light _70; // _70
zen::DrawGameInfo* mDrawGameInfo; // _344
Expand Down
2 changes: 0 additions & 2 deletions include/GameStat.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ struct GameStat {
static int minPikis;
static int maxPikis;
static bool orimaDead;

// TODO: members
};

#endif
12 changes: 6 additions & 6 deletions include/Geometry.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,20 @@ struct Sphere {
* @brief TODO
*/
struct Tube {
void getYRatio(f32);
f32 getYRatio(f32 heightToCheck);
bool collide(const Sphere&, Vector3f&, f32&);
void getPosRatio(const Vector3f&);
f32 getPosRatio(const Vector3f&);
void getPosGradient(Vector3f&, f32, Vector3f&, Vector3f&);
void setPos(f32);

// unused/inlined:
void getRatioRadius(f32);

// TODO: members
Vector3f _00; // _00
Vector3f _0C; // _0C
f32 _18; // _18
f32 _1C; // _1C
Vector3f mStartPoint; // _00
Vector3f mEndPoint; // _0C
f32 _18; // _18
f32 _1C; // _1C
};

#endif
10 changes: 5 additions & 5 deletions include/NaviState.h
Original file line number Diff line number Diff line change
Expand Up @@ -864,11 +864,11 @@ struct NaviUfoState : public NaviState {

// _00 = VTBL
// _00-_10 = NaviState
u16 _10; // _10
u16 _12; // _12
Vector3f _14; // _14
s8 _20; // _20
u8 _21; // _21
u16 mState; // _10
u16 mRecoveryTimer; // _12
Vector3f mLastPosition; // _14
s8 _20; // _20
u8 _21; // _21
};

/**
Expand Down
2 changes: 1 addition & 1 deletion include/NinLogoSetupSection.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ struct NinLogoSetupSection : public Node {
progresWindow->draw(gfx);
}

gameflow.drawLoadLogo(gfx, false, gameflow._310, gameflow._314);
gameflow.drawLoadLogo(gfx, false, gameflow.mLevelBannerTexture, gameflow.mLevelBannerFadeValue);

// either this is a lot of inlines or there's a lot of debug stuff here.
u32 badCompiler[64];
Expand Down
4 changes: 2 additions & 2 deletions include/WorldClock.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ struct WorldClock {
void age(f32);

f32 mTimeScale; // _00
f32 _04; // _04
f32 _08; // _08
f32 mHoursInDay; // _04
f32 mTicksPerHour; // _08
u8 _0C[0x4]; // _0C, unknown
f32 mLastRecordedTime; // _10
f32 mFractionalTime; // _14
Expand Down
18 changes: 9 additions & 9 deletions include/gameflow.h
Original file line number Diff line number Diff line change
Expand Up @@ -377,12 +377,12 @@ struct GameFlow : public Node {
// _00-_20 = Node
GamePrms* mParameters; // _20
MemoryCard mMemoryCard; // _24
u8 _6C[0x94 - 0x6C]; // _6C, unknown
u8 _6C[0x94 - 0x6C]; // _6C
GamePrefs mGamePrefs; // _94
u32 mSaveGameCrc; // _1A0, unknown
u32 mSaveGameCrc; // _1A0
PlayState mPlayState; // _1A4
int _1CC; // _1CC, maybe u32
u32 _1D0; // _1D0, most recently opened stage?
int _1CC; // _1CC
u32 mLastUnlockedStageId; // _1D0
u32 _1D4; // _1D4, unknown
u32 _1D8; // _1D8, bitflag of some description
MoviePlayer* mMoviePlayer; // _1DC
Expand All @@ -397,24 +397,24 @@ struct GameFlow : public Node {
Section* mGameSection; // _204
char* mLangFilePaths[2][LANGFILE_COUNT]; // _208
u8 _230[0x2A8 - 0x230]; // _230, unknown
int _2A8; // _2A8, related to language?
int mLanguageIndex; // _2A8, related to language?
u32 _2AC; // _2AC, unknown
u32 _2B0; // _2B0, could be int
int mIsChallengeMode; // _2B4
u8 _2B8[0x4]; // _2B8, unknown
u32 _2BC; // _2BC, unknown
u32 mUpdateTickCount; // _2BC, unknown
u8 _2C0[0x4]; // _2C0, unknown
f32 _2C4; // _2C4
f32 _2C8; // _2C8
f32 _2CC; // _2CC
int _2D0; // _2D0
int _2D4; // _2D4
WorldClock mWorldClock; // _2D8
f32 _304; // _304
f32 mTimeMultiplier; // _304
AnimFrameCacher* mFrameCacher; // _308
GameGenFlow* mGenFlow; // _30C
Texture* _310; // _310
f32 _314; // _314
Texture* mLevelBannerTexture; // _310
f32 mLevelBannerFadeValue; // _314
Texture* mLoadBannerTexture; // _318
GameLoadIdler mGameLoadIdler; // _31C
u8 _330[0x338 - 0x330]; // _330, unknown
Expand Down
4 changes: 2 additions & 2 deletions src/plugPikiColin/cardSelect.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,8 @@ struct CardSelectSetupSection : public Node {
gameflow.mNextOnePlayerSectionID = ONEPLAYER_MapSelect;
}

gameflow._1CC = -1;
gameflow._1D0 = -1;
gameflow._1CC = -1;
gameflow.mLastUnlockedStageId = -1;
}

#ifdef __MWERKS__
Expand Down
63 changes: 33 additions & 30 deletions src/plugPikiColin/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -450,36 +450,38 @@ static char* levNames[] = {
void OnePlayerSection::init()
{
Node::init("<OnePlayerSection>");
u32 print = gsys->mTogglePrint;
Section* section = nullptr;
while (!section) {
int sectionID = gameflow.mNextOnePlayerSectionID;
switch (sectionID) {
u32 displayState = gsys->mTogglePrint;
Section* currentSection = nullptr;

while (!currentSection) {
int nextSectionType = gameflow.mNextOnePlayerSectionID;
switch (nextSectionType) {
case ONEPLAYER_GameSetup:
gsys->startLoading(&gameflow.mGameLoadIdler, true, 60);
if (gameflow._1FC >= 2 && gameflow._1FC <= 4) {
gameflow._310 = gameflow.setLoadBanner(levNames[gameflow._1FC]);
gameflow._314 = 0.0f;
gameflow.mLevelBannerTexture = gameflow.setLoadBanner(levNames[gameflow._1FC]);
gameflow.mLevelBannerFadeValue = 0.0f;
} else {
gameflow._310 = nullptr;
gameflow.mLevelBannerTexture = nullptr;
}

section = new GameSetupSection();
currentSection = new GameSetupSection();
gsys->endLoading();
break;

case ONEPLAYER_CardSelect:
section = new CardSelectSection();
currentSection = new CardSelectSection();
break;

case ONEPLAYER_MapSelect:
section = new MapSelectSection();
currentSection = new MapSelectSection();
break;

case ONEPLAYER_Unk2:
if (!gameflow._310) {
gameflow._310 = gameflow.setLoadBanner(levNames[sectionID]);
if (!gameflow.mLevelBannerTexture) {
gameflow.mLevelBannerTexture = gameflow.setLoadBanner(levNames[nextSectionType]);
}

gsys->startLoading(&gameflow.mGameLoadIdler, true, 60);
FOREACH_NODE(StageInfo, flowCont.mRootInfo.mChild, stage)
{
Expand All @@ -498,8 +500,8 @@ void OnePlayerSection::init()
break;

case ONEPLAYER_Unk3:
if (!gameflow._310) {
gameflow._310 = gameflow.setLoadBanner(levNames[sectionID]);
if (!gameflow.mLevelBannerTexture) {
gameflow.mLevelBannerTexture = gameflow.setLoadBanner(levNames[nextSectionType]);
}
gsys->startLoading(&gameflow.mGameLoadIdler, true, 60);
FOREACH_NODE(StageInfo, flowCont.mRootInfo.mChild, stage)
Expand All @@ -519,9 +521,10 @@ void OnePlayerSection::init()
break;

case ONEPLAYER_Unk4:
if (!gameflow._310) {
gameflow._310 = gameflow.setLoadBanner(levNames[sectionID]);
if (!gameflow.mLevelBannerTexture) {
gameflow.mLevelBannerTexture = gameflow.setLoadBanner(levNames[nextSectionType]);
}

gsys->startLoading(&gameflow.mGameLoadIdler, true, 60);
FOREACH_NODE(StageInfo, flowCont.mRootInfo.mChild, stage)
{
Expand All @@ -540,7 +543,7 @@ void OnePlayerSection::init()
break;

case ONEPLAYER_IntroGame:
section = new IntroGameSection();
currentSection = new IntroGameSection();
break;

case ONEPLAYER_NewPikiGame:
Expand All @@ -550,41 +553,41 @@ void OnePlayerSection::init()

Texture* tex = nullptr;
if (flowCont.mCurrentStage->mStageID <= STAGE_LASTVALID) {
gameflow._310 = gameflow.setLoadBanner(levNames[flowCont.mCurrentStage->mStageID]);
gameflow._314 = 0.0f;
gameflow.mLevelBannerTexture = gameflow.setLoadBanner(levNames[flowCont.mCurrentStage->mStageID]);
gameflow.mLevelBannerFadeValue = 0.0f;
} else {
gameflow._310 = tex;
gameflow.mLevelBannerTexture = tex;
}

section = new NewPikiGameSection();
currentSection = new NewPikiGameSection();
break;

case ONEPLAYER_GameCourseClear:
section = new GameCourseClearSection();
currentSection = new GameCourseClearSection();
break;

case ONEPLAYER_GameStageClear:
section = new GameStageClearSection();
currentSection = new GameStageClearSection();
break;

case ONEPLAYER_GameCredits:
gsys->startLoading(nullptr, true, 60);
section = new GameCreditsSection();
currentSection = new GameCreditsSection();
gsys->endLoading();
break;

case ONEPLAYER_GameExit:
section = new GameExitSection();
currentSection = new GameExitSection();
break;
}

if (gameflow.mNextOnePlayerSectionID != sectionID) {
section = nullptr;
if (gameflow.mNextOnePlayerSectionID != nextSectionType) {
currentSection = nullptr;
}
}

add(section);
gsys->mTogglePrint = print;
add(currentSection);
gsys->mTogglePrint = displayState;
/*
.loc_0x0:
mflr r0
Expand Down
12 changes: 6 additions & 6 deletions src/plugPikiColin/gamePrefs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,21 +27,21 @@ static void _Print(char*, ...)
* Address: 80053C5C
* Size: 000040
*/
void PlayState::openStage(int stageID)
void PlayState::openStage(int stageId)
{
if (stageID < STAGE_START) {
if (stageId < STAGE_START) {
return;
}

if (stageID > STAGE_END) {
if (stageId > STAGE_END) {
return;
}

if (!(mCourseOpenFlags & (1 << stageID))) {
gameflow._1D0 = stageID;
if (!(mCourseOpenFlags & (1 << stageId))) {
gameflow.mLastUnlockedStageId = stageId;
}

mCourseOpenFlags |= (1 << stageID);
mCourseOpenFlags |= (1 << stageId);
}

/*
Expand Down
40 changes: 21 additions & 19 deletions src/plugPikiColin/gameflow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ void GameLoadIdler::draw(Graphics& gfx)
gfx.setClearColour(Colour(0, 0, 0, 0));
gfx.clearBuffer(3, false);

Texture** tex = &flow->_310;
if (!flow->_310) {
Texture** tex = &flow->mLevelBannerTexture;
if (!flow->mLevelBannerTexture) {
return;
}
f32* f = &flow->_314;
flow->_314 += (1.0f / 300.0f);
if (flow->_314 > 1.0f) {
f32* f = &flow->mLevelBannerFadeValue;
flow->mLevelBannerFadeValue += (1.0f / 300.0f);
if (flow->mLevelBannerFadeValue > 1.0f) {
*f = 1.0f;
}

Expand Down Expand Up @@ -632,9 +632,11 @@ void preloadLanguage()
// gsys->_31C;
gsys->_200.initCore("");
gsys->mLightFlareInfoList = (LFInfo*)&gsys->_200;
gsys->parseArchiveDirectory(gameflow.mLangFilePaths[gameflow._2A8][LANGFILE_Dir], gameflow.mLangFilePaths[gameflow._2A8][LANGFILE_Arc]);
gsys->loadBundle(gameflow.mLangFilePaths[gameflow._2A8][LANGFILE_Bun], true);
gsys->setTextureDirectories(gameflow.mLangFilePaths[gameflow._2A8][LANGFILE_Blo], gameflow.mLangFilePaths[gameflow._2A8][LANGFILE_Tex]);
gsys->parseArchiveDirectory(gameflow.mLangFilePaths[gameflow.mLanguageIndex][LANGFILE_Dir],
gameflow.mLangFilePaths[gameflow.mLanguageIndex][LANGFILE_Arc]);
gsys->loadBundle(gameflow.mLangFilePaths[gameflow.mLanguageIndex][LANGFILE_Bun], true);
gsys->setTextureDirectories(gameflow.mLangFilePaths[gameflow.mLanguageIndex][LANGFILE_Blo],
gameflow.mLangFilePaths[gameflow.mLanguageIndex][LANGFILE_Tex]);
gsys->getHeap(gsys->mActiveHeapIdx);
gsys->setHeap(heapIdx);
/*
Expand Down Expand Up @@ -766,7 +768,7 @@ void GameFlow::hardReset(BaseApp* baseApp)
mNextOnePlayerSectionID = ONEPLAYER_GameSetup;
_200 = 0;
_2AC = 0;
_2A8 = 0;
mLanguageIndex = 0;

mLangFilePaths[0][LANGFILE_Dir] = "archives/blo_eng.dir";
mLangFilePaths[0][LANGFILE_Arc] = "dataDir/archives/blo_eng.arc";
Expand All @@ -792,11 +794,11 @@ void GameFlow::hardReset(BaseApp* baseApp)
mWorldClock.mCurrentTime = 0;
mWorldClock.mMinutes = 0;

mWorldClock._04 = 24.0f;
mWorldClock._08 = 60.0f * factor;
mWorldClock.mTimeScale = mWorldClock._08 / mWorldClock._04;
_304 = 1.0f;
_2BC = 0;
mWorldClock.mHoursInDay = 24.0f;
mWorldClock.mTicksPerHour = 60.0f * factor;
mWorldClock.mTimeScale = mWorldClock.mTicksPerHour / mWorldClock.mHoursInDay;
mTimeMultiplier = 1.0f;
mUpdateTickCount = 0;

mMemoryCard.init();

Expand All @@ -811,8 +813,8 @@ void GameFlow::hardReset(BaseApp* baseApp)
gameflow.mLoadBannerTexture->attach();
}
gsys->setHeap(heapIdx);
_310 = gameflow.mLoadBannerTexture;
_314 = 1.0f;
mLevelBannerTexture = gameflow.mLoadBannerTexture;
mLevelBannerFadeValue = 1.0f;
Jac_SceneSetup(0, 0);
_2D4 = 1;

Expand Down Expand Up @@ -1716,9 +1718,9 @@ void GameFlow::addGenNode(char* name, CoreNode* node)
*/
void GameGenFlow::update()
{
gameflow._2BC++;
gameflow.mWorldClock._08 = 60.0f * (gameflow._304 * gameflow.mParameters->mDaySpeedFactor());
gameflow.mWorldClock.mTimeScale = gameflow.mWorldClock._08 / gameflow.mWorldClock._04;
gameflow.mUpdateTickCount++;
gameflow.mWorldClock.mTicksPerHour = 60.0f * (gameflow.mTimeMultiplier * gameflow.mParameters->mDaySpeedFactor());
gameflow.mWorldClock.mTimeScale = gameflow.mWorldClock.mTicksPerHour / gameflow.mWorldClock.mHoursInDay;
Node::update();
}

Expand Down
Loading

0 comments on commit 9a5ea3c

Please sign in to comment.