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 */
}
static float BrightnessCopyFilter = 0.f;
void CGameOptions::SetScreenBrightness(s32 val, bool apply) {
x48_screenBrightness = zeus::clamp(0, val, 8);
void CGameOptions::SetScreenBrightness(s32 value, bool apply) {
x48_screenBrightness = zeus::clamp(0, value, 8);
if (apply)
BrightnessCopyFilter = TuneScreenBrightness();
if (!apply) {
return;
}
BrightnessCopyFilter = TuneScreenBrightness();
}
void CGameOptions::ApplyGamma() {
@ -287,51 +290,60 @@ void CGameOptions::ApplyGamma() {
CGraphics::g_BooFactory->setDisplayGamma(gammaT);
}
void CGameOptions::SetGamma(s32 val, bool apply) {
m_gamma = zeus::clamp(-100, val, 100);
void CGameOptions::SetGamma(s32 value, bool apply) {
m_gamma = zeus::clamp(-100, value, 100);
if (apply)
ApplyGamma();
if (!apply) {
return;
}
ApplyGamma();
}
void CGameOptions::SetScreenPositionX(s32 pos, bool apply) {
x4c_screenXOffset = zeus::clamp(-30, pos, 30);
void CGameOptions::SetScreenPositionX(s32 position, bool apply) {
x4c_screenXOffset = zeus::clamp(-30, position, 30);
if (apply) {
/* TOOD: CGraphics related funcs */
}
}
void CGameOptions::SetScreenPositionY(s32 pos, bool apply) {
x50_screenYOffset = zeus::clamp(-30, pos, 30);
void CGameOptions::SetScreenPositionY(s32 position, bool apply) {
x50_screenYOffset = zeus::clamp(-30, position, 30);
if (apply) {
/* TOOD: CGraphics related funcs */
}
}
void CGameOptions::SetScreenStretch(s32 st, bool apply) {
x54_screenStretch = zeus::clamp(-10, st, 10);
void CGameOptions::SetScreenStretch(s32 stretch, bool apply) {
x54_screenStretch = zeus::clamp(-10, stretch, 10);
if (apply) {
/* TOOD: CGraphics related funcs */
}
}
void CGameOptions::SetSfxVolume(s32 vol, bool apply) {
x58_sfxVol = zeus::clamp(0, vol, 0x7f);
void CGameOptions::SetSfxVolume(s32 volume, bool apply) {
x58_sfxVol = zeus::clamp(0, volume, 0x7f);
if (apply) {
CAudioSys::SysSetSfxVolume(x58_sfxVol, 1, true, true);
CStreamAudioManager::SetSfxVolume(x58_sfxVol);
CMoviePlayer::SetSfxVolume(x58_sfxVol);
if (!apply) {
return;
}
CAudioSys::SysSetSfxVolume(x58_sfxVol, 1, true, true);
CStreamAudioManager::SetSfxVolume(x58_sfxVol);
CMoviePlayer::SetSfxVolume(x58_sfxVol);
}
void CGameOptions::SetMusicVolume(s32 vol, bool apply) {
x5c_musicVol = zeus::clamp(0, vol, 0x7f);
if (apply)
CStreamAudioManager::SetMusicVolume(x5c_musicVol);
void CGameOptions::SetMusicVolume(s32 volume, bool apply) {
x5c_musicVol = zeus::clamp(0, volume, 0x7f);
if (!apply) {
return;
}
CStreamAudioManager::SetMusicVolume(x5c_musicVol);
}
void CGameOptions::SetHUDAlpha(u32 alpha) { x60_hudAlpha = alpha; }

View File

@ -77,21 +77,21 @@ public:
bool GetCinematicState(CAssetId mlvlId, TEditorId cineId) const;
void SetCinematicState(CAssetId mlvlId, TEditorId cineId, bool state);
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; }
void SetPlayerLinkedFusion(bool v) { xd0_24_fusionLinked = v; }
void SetPlayerLinkedFusion(bool fusionLinked) { xd0_24_fusionLinked = fusionLinked; }
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; }
void SetPlayerBeatHardMode(bool v) { xd0_26_hardModeBeat = v; }
void SetPlayerBeatHardMode(bool hardModeBeat) { xd0_26_hardModeBeat = hardModeBeat; }
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; }
void SetPlayerFusionSuitActive(bool v) { xd0_28_fusionSuitActive = v; }
void SetPlayerFusionSuitActive(bool fusionSuitActive) { xd0_28_fusionSuitActive = fusionSuitActive; }
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; }
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); }
bool GetShowFrozenFpsMessage() const { return xc0_frozenFpsCount != 3; }
void IncrementFrozenBallCount() { xc4_frozenBallCount = std::min(int(xc4_frozenBallCount + 1), 3); }
@ -135,36 +135,36 @@ public:
void PutTo(CBitStreamWriter& writer) const;
float TuneScreenBrightness() const;
void SetScreenBrightness(s32, bool);
void SetScreenBrightness(s32 value, bool apply);
s32 GetScreenBrightness() const { return x48_screenBrightness; }
void ApplyGamma();
void SetGamma(s32, bool);
void SetGamma(s32 value, bool apply);
s32 GetGamma() const { return m_gamma; }
void SetScreenPositionX(s32, bool);
void SetScreenPositionX(s32 position, bool apply);
s32 GetScreenPositionX() const { return x4c_screenXOffset; }
void SetScreenPositionY(s32, bool);
void SetScreenPositionY(s32 position, bool apply);
s32 GetScreenPositionY() const { return x50_screenYOffset; }
void SetScreenStretch(s32, bool);
void SetScreenStretch(s32 stretch, bool apply);
s32 GetScreenStretch() const { return x54_screenStretch; }
void SetSfxVolume(s32, bool);
void SetSfxVolume(s32 volume, bool apply);
s32 GetSfxVolume() const { return x58_sfxVol; }
void SetMusicVolume(s32, bool);
void SetMusicVolume(s32 volume, bool apply);
s32 GetMusicVolume() const { return x5c_musicVol; }
void SetHUDAlpha(u32);
void SetHUDAlpha(u32 alpha);
u32 GetHUDAlpha() const { return x60_hudAlpha; }
void SetHelmetAlpha(u32);
void SetHelmetAlpha(u32 alpha);
u32 GetHelmetAlpha() const { return x64_helmetAlpha; }
void SetHUDLag(bool);
void SetHUDLag(bool lag);
bool GetHUDLag() const { return x68_24_hudLag; }
void SetSurroundMode(int mode, bool apply);
CAudioSys::ESurroundModes GetSurroundMode() const;
void SetInvertYAxis(bool);
void SetInvertYAxis(bool invert);
bool GetInvertYAxis() const { return x68_25_invertY; }
void SetIsRumbleEnabled(bool);
void SetIsRumbleEnabled(bool rumble);
bool GetIsRumbleEnabled() const { return x68_26_rumble; }
void SetSwapBeamControls(bool);
void SetSwapBeamControls(bool swap);
bool GetSwapBeamControls() const { return x68_27_swapBeamsControls; }
void SetIsHintSystemEnabled(bool);
void SetIsHintSystemEnabled(bool hints);
bool GetIsHintSystemEnabled() const { return x68_28_hintSystem; }
void SetControls(int controls);
void ResetControllerAssets(int controls);