2
0
mirror of https://github.com/AxioDL/metaforce.git synced 2025-07-14 05:25:52 +00:00

CGameOptions: Give all function prototype parameters a name

Makes the interface more self-documenting and also allows better IDE
introspection.
This commit is contained in:
Lioncash 2020-04-16 19:49:33 -04:00
parent e7ef1e0b5e
commit f844f2028b
2 changed files with 58 additions and 46 deletions

View File

@ -271,11 +271,14 @@ float CGameOptions::TuneScreenBrightness() const { return (0.375f * 1.f) + (floa
void CGameOptions::InitSoundMode() { /* If system is mono, force x44 to mono, otherwise honor user preference */ void CGameOptions::InitSoundMode() { /* If system is mono, force x44 to mono, otherwise honor user preference */
} }
static float BrightnessCopyFilter = 0.f; static float BrightnessCopyFilter = 0.f;
void CGameOptions::SetScreenBrightness(s32 val, bool apply) { void CGameOptions::SetScreenBrightness(s32 value, bool apply) {
x48_screenBrightness = zeus::clamp(0, val, 8); x48_screenBrightness = zeus::clamp(0, value, 8);
if (apply) if (!apply) {
BrightnessCopyFilter = TuneScreenBrightness(); return;
}
BrightnessCopyFilter = TuneScreenBrightness();
} }
void CGameOptions::ApplyGamma() { void CGameOptions::ApplyGamma() {
@ -287,51 +290,60 @@ void CGameOptions::ApplyGamma() {
CGraphics::g_BooFactory->setDisplayGamma(gammaT); CGraphics::g_BooFactory->setDisplayGamma(gammaT);
} }
void CGameOptions::SetGamma(s32 val, bool apply) { void CGameOptions::SetGamma(s32 value, bool apply) {
m_gamma = zeus::clamp(-100, val, 100); m_gamma = zeus::clamp(-100, value, 100);
if (apply) if (!apply) {
ApplyGamma(); return;
}
ApplyGamma();
} }
void CGameOptions::SetScreenPositionX(s32 pos, bool apply) { void CGameOptions::SetScreenPositionX(s32 position, bool apply) {
x4c_screenXOffset = zeus::clamp(-30, pos, 30); x4c_screenXOffset = zeus::clamp(-30, position, 30);
if (apply) { if (apply) {
/* TOOD: CGraphics related funcs */ /* TOOD: CGraphics related funcs */
} }
} }
void CGameOptions::SetScreenPositionY(s32 pos, bool apply) { void CGameOptions::SetScreenPositionY(s32 position, bool apply) {
x50_screenYOffset = zeus::clamp(-30, pos, 30); x50_screenYOffset = zeus::clamp(-30, position, 30);
if (apply) { if (apply) {
/* TOOD: CGraphics related funcs */ /* TOOD: CGraphics related funcs */
} }
} }
void CGameOptions::SetScreenStretch(s32 st, bool apply) { void CGameOptions::SetScreenStretch(s32 stretch, bool apply) {
x54_screenStretch = zeus::clamp(-10, st, 10); x54_screenStretch = zeus::clamp(-10, stretch, 10);
if (apply) { if (apply) {
/* TOOD: CGraphics related funcs */ /* TOOD: CGraphics related funcs */
} }
} }
void CGameOptions::SetSfxVolume(s32 vol, bool apply) { void CGameOptions::SetSfxVolume(s32 volume, bool apply) {
x58_sfxVol = zeus::clamp(0, vol, 0x7f); x58_sfxVol = zeus::clamp(0, volume, 0x7f);
if (apply) { if (!apply) {
CAudioSys::SysSetSfxVolume(x58_sfxVol, 1, true, true); return;
CStreamAudioManager::SetSfxVolume(x58_sfxVol);
CMoviePlayer::SetSfxVolume(x58_sfxVol);
} }
CAudioSys::SysSetSfxVolume(x58_sfxVol, 1, true, true);
CStreamAudioManager::SetSfxVolume(x58_sfxVol);
CMoviePlayer::SetSfxVolume(x58_sfxVol);
} }
void CGameOptions::SetMusicVolume(s32 vol, bool apply) { void CGameOptions::SetMusicVolume(s32 volume, bool apply) {
x5c_musicVol = zeus::clamp(0, vol, 0x7f); x5c_musicVol = zeus::clamp(0, volume, 0x7f);
if (apply)
CStreamAudioManager::SetMusicVolume(x5c_musicVol); if (!apply) {
return;
}
CStreamAudioManager::SetMusicVolume(x5c_musicVol);
} }
void CGameOptions::SetHUDAlpha(u32 alpha) { x60_hudAlpha = alpha; } void CGameOptions::SetHUDAlpha(u32 alpha) { x60_hudAlpha = alpha; }

View File

@ -77,21 +77,21 @@ public:
bool GetCinematicState(CAssetId mlvlId, TEditorId cineId) const; bool GetCinematicState(CAssetId mlvlId, TEditorId cineId) const;
void SetCinematicState(CAssetId mlvlId, TEditorId cineId, bool state); void SetCinematicState(CAssetId mlvlId, TEditorId cineId, bool state);
u32 GetAutoMapperKeyState() const { return xbc_autoMapperKeyState; } u32 GetAutoMapperKeyState() const { return xbc_autoMapperKeyState; }
void SetAutoMapperKeyState(u32 s) { xbc_autoMapperKeyState = s; } void SetAutoMapperKeyState(u32 state) { xbc_autoMapperKeyState = state; }
bool GetPlayerLinkedFusion() const { return xd0_24_fusionLinked; } bool GetPlayerLinkedFusion() const { return xd0_24_fusionLinked; }
void SetPlayerLinkedFusion(bool v) { xd0_24_fusionLinked = v; } void SetPlayerLinkedFusion(bool fusionLinked) { xd0_24_fusionLinked = fusionLinked; }
bool GetPlayerBeatNormalMode() const { return xd0_25_normalModeBeat; } bool GetPlayerBeatNormalMode() const { return xd0_25_normalModeBeat; }
void SetPlayerBeatNormalMode(bool v) { xd0_25_normalModeBeat = v; } void SetPlayerBeatNormalMode(bool normalModeBeat) { xd0_25_normalModeBeat = normalModeBeat; }
bool GetPlayerBeatHardMode() const { return xd0_26_hardModeBeat; } bool GetPlayerBeatHardMode() const { return xd0_26_hardModeBeat; }
void SetPlayerBeatHardMode(bool v) { xd0_26_hardModeBeat = v; } void SetPlayerBeatHardMode(bool hardModeBeat) { xd0_26_hardModeBeat = hardModeBeat; }
bool GetPlayerBeatFusion() const { return xd0_27_fusionBeat; } bool GetPlayerBeatFusion() const { return xd0_27_fusionBeat; }
void SetPlayerBeatFusion(bool v) { xd0_27_fusionBeat = v; } void SetPlayerBeatFusion(bool fusionBeat) { xd0_27_fusionBeat = fusionBeat; }
bool GetPlayerFusionSuitActive() const { return xd0_28_fusionSuitActive; } bool GetPlayerFusionSuitActive() const { return xd0_28_fusionSuitActive; }
void SetPlayerFusionSuitActive(bool v) { xd0_28_fusionSuitActive = v; } void SetPlayerFusionSuitActive(bool fusionSuitActive) { xd0_28_fusionSuitActive = fusionSuitActive; }
bool GetAllItemsCollected() const { return xd0_29_allItemsCollected; } bool GetAllItemsCollected() const { return xd0_29_allItemsCollected; }
void SetAllItemsCollected(bool v) { xd0_29_allItemsCollected = v; } void SetAllItemsCollected(bool allItemsCollected) { xd0_29_allItemsCollected = allItemsCollected; }
u32 GetLogScanPercent() const { return xcc_logScanPercent; } u32 GetLogScanPercent() const { return xcc_logScanPercent; }
void SetLogScanPercent(u32 v) { xcc_logScanPercent = v; } void SetLogScanPercent(u32 percent) { xcc_logScanPercent = percent; }
void IncrementFrozenFpsCount() { xc0_frozenFpsCount = std::min(int(xc0_frozenFpsCount + 1), 3); } void IncrementFrozenFpsCount() { xc0_frozenFpsCount = std::min(int(xc0_frozenFpsCount + 1), 3); }
bool GetShowFrozenFpsMessage() const { return xc0_frozenFpsCount != 3; } bool GetShowFrozenFpsMessage() const { return xc0_frozenFpsCount != 3; }
void IncrementFrozenBallCount() { xc4_frozenBallCount = std::min(int(xc4_frozenBallCount + 1), 3); } void IncrementFrozenBallCount() { xc4_frozenBallCount = std::min(int(xc4_frozenBallCount + 1), 3); }
@ -135,36 +135,36 @@ public:
void PutTo(CBitStreamWriter& writer) const; void PutTo(CBitStreamWriter& writer) const;
float TuneScreenBrightness() const; float TuneScreenBrightness() const;
void SetScreenBrightness(s32, bool); void SetScreenBrightness(s32 value, bool apply);
s32 GetScreenBrightness() const { return x48_screenBrightness; } s32 GetScreenBrightness() const { return x48_screenBrightness; }
void ApplyGamma(); void ApplyGamma();
void SetGamma(s32, bool); void SetGamma(s32 value, bool apply);
s32 GetGamma() const { return m_gamma; } s32 GetGamma() const { return m_gamma; }
void SetScreenPositionX(s32, bool); void SetScreenPositionX(s32 position, bool apply);
s32 GetScreenPositionX() const { return x4c_screenXOffset; } s32 GetScreenPositionX() const { return x4c_screenXOffset; }
void SetScreenPositionY(s32, bool); void SetScreenPositionY(s32 position, bool apply);
s32 GetScreenPositionY() const { return x50_screenYOffset; } s32 GetScreenPositionY() const { return x50_screenYOffset; }
void SetScreenStretch(s32, bool); void SetScreenStretch(s32 stretch, bool apply);
s32 GetScreenStretch() const { return x54_screenStretch; } s32 GetScreenStretch() const { return x54_screenStretch; }
void SetSfxVolume(s32, bool); void SetSfxVolume(s32 volume, bool apply);
s32 GetSfxVolume() const { return x58_sfxVol; } s32 GetSfxVolume() const { return x58_sfxVol; }
void SetMusicVolume(s32, bool); void SetMusicVolume(s32 volume, bool apply);
s32 GetMusicVolume() const { return x5c_musicVol; } s32 GetMusicVolume() const { return x5c_musicVol; }
void SetHUDAlpha(u32); void SetHUDAlpha(u32 alpha);
u32 GetHUDAlpha() const { return x60_hudAlpha; } u32 GetHUDAlpha() const { return x60_hudAlpha; }
void SetHelmetAlpha(u32); void SetHelmetAlpha(u32 alpha);
u32 GetHelmetAlpha() const { return x64_helmetAlpha; } u32 GetHelmetAlpha() const { return x64_helmetAlpha; }
void SetHUDLag(bool); void SetHUDLag(bool lag);
bool GetHUDLag() const { return x68_24_hudLag; } bool GetHUDLag() const { return x68_24_hudLag; }
void SetSurroundMode(int mode, bool apply); void SetSurroundMode(int mode, bool apply);
CAudioSys::ESurroundModes GetSurroundMode() const; CAudioSys::ESurroundModes GetSurroundMode() const;
void SetInvertYAxis(bool); void SetInvertYAxis(bool invert);
bool GetInvertYAxis() const { return x68_25_invertY; } bool GetInvertYAxis() const { return x68_25_invertY; }
void SetIsRumbleEnabled(bool); void SetIsRumbleEnabled(bool rumble);
bool GetIsRumbleEnabled() const { return x68_26_rumble; } bool GetIsRumbleEnabled() const { return x68_26_rumble; }
void SetSwapBeamControls(bool); void SetSwapBeamControls(bool swap);
bool GetSwapBeamControls() const { return x68_27_swapBeamsControls; } bool GetSwapBeamControls() const { return x68_27_swapBeamsControls; }
void SetIsHintSystemEnabled(bool); void SetIsHintSystemEnabled(bool hints);
bool GetIsHintSystemEnabled() const { return x68_28_hintSystem; } bool GetIsHintSystemEnabled() const { return x68_28_hintSystem; }
void SetControls(int controls); void SetControls(int controls);
void ResetControllerAssets(int controls); void ResetControllerAssets(int controls);