config: use final names and descriptions, label options to be moved to exports

This commit is contained in:
Hyper 2024-11-21 16:17:17 +00:00
parent 3e0490fcec
commit a8bc4b4956
12 changed files with 78 additions and 50 deletions

View file

@ -14,20 +14,20 @@ public:
CONFIG_DEFINE_LOCALISED("System", bool, ControlTutorial, true); CONFIG_DEFINE_LOCALISED("System", bool, ControlTutorial, true);
CONFIG_DEFINE_LOCALISED("System", bool, SaveScoreAtCheckpoints, false); CONFIG_DEFINE_LOCALISED("System", bool, SaveScoreAtCheckpoints, false);
CONFIG_DEFINE_ENUM_LOCALISED("System", EUnleashGaugeBehaviour, UnleashGaugeBehaviour, EUnleashGaugeBehaviour::Original); CONFIG_DEFINE_ENUM_LOCALISED("System", EUnleashGaugeBehaviour, UnleashGaugeBehaviour, EUnleashGaugeBehaviour::Original);
CONFIG_DEFINE_LOCALISED("System", bool, WerehogHubTransformVideo, true); CONFIG_DEFINE_ENUM_LOCALISED("System", ETimeOfDayTransition, TimeOfDayTransition, ETimeOfDayTransition::Xbox);
CONFIG_DEFINE_LOCALISED("System", bool, LogoSkip, false); CONFIG_DEFINE_LOCALISED("System", bool, SkipIntroLogos, false);
CONFIG_DEFINE_LOCALISED("Input", bool, CameraXInvert, false); CONFIG_DEFINE_LOCALISED("Input", bool, InvertCameraX, false);
CONFIG_DEFINE_LOCALISED("Input", bool, CameraYInvert, false); CONFIG_DEFINE_LOCALISED("Input", bool, InvertCameraY, false);
CONFIG_DEFINE_LOCALISED("Input", bool, XButtonHoming, true); CONFIG_DEFINE_LOCALISED("Input", bool, XButtonHoming, true);
CONFIG_DEFINE_LOCALISED("Input", bool, UnleashCancel, false); CONFIG_DEFINE_LOCALISED("Input", bool, AllowCancellingUnleash, false);
CONFIG_DEFINE_LOCALISED("Input", bool, BackgroundInput, false); CONFIG_DEFINE_LOCALISED("Input", bool, AllowBackgroundInput, false);
CONFIG_DEFINE_LOCALISED("Audio", float, MusicVolume, 1.0f); CONFIG_DEFINE_LOCALISED("Audio", float, MusicVolume, 1.0f);
CONFIG_DEFINE_LOCALISED("Audio", float, SEVolume, 1.0f); CONFIG_DEFINE_LOCALISED("Audio", float, EffectsVolume, 1.0f);
CONFIG_DEFINE_ENUM_LOCALISED("Audio", EVoiceLanguage, VoiceLanguage, EVoiceLanguage::English); CONFIG_DEFINE_ENUM_LOCALISED("Audio", EVoiceLanguage, VoiceLanguage, EVoiceLanguage::English);
CONFIG_DEFINE_LOCALISED("Audio", bool, Subtitles, true); CONFIG_DEFINE_LOCALISED("Audio", bool, Subtitles, true);
CONFIG_DEFINE_LOCALISED("Audio", bool, WerehogBattleMusic, true); CONFIG_DEFINE_LOCALISED("Audio", bool, BattleTheme, true);
CONFIG_DEFINE_ENUM("Video", EGraphicsAPI, GraphicsAPI, EGraphicsAPI::D3D12); CONFIG_DEFINE_ENUM("Video", EGraphicsAPI, GraphicsAPI, EGraphicsAPI::D3D12);
CONFIG_DEFINE("Video", int32_t, WindowX, WINDOWPOS_CENTRED); CONFIG_DEFINE("Video", int32_t, WindowX, WINDOWPOS_CENTRED);
@ -54,12 +54,12 @@ public:
CONFIG_DEFINE_LOCALISED("Video", int32_t, FPS, 60); CONFIG_DEFINE_LOCALISED("Video", int32_t, FPS, 60);
CONFIG_DEFINE_LOCALISED("Video", float, Brightness, 0.5f); CONFIG_DEFINE_LOCALISED("Video", float, Brightness, 0.5f);
CONFIG_DEFINE_ENUM_LOCALISED("Video", EAntiAliasing, AntiAliasing, EAntiAliasing::MSAA4x); CONFIG_DEFINE_ENUM_LOCALISED("Video", EAntiAliasing, AntiAliasing, EAntiAliasing::MSAA4x);
CONFIG_DEFINE_LOCALISED("Video", bool, AlphaToCoverage, true); CONFIG_DEFINE_LOCALISED("Video", bool, TransparencyAntiAliasing, true);
CONFIG_DEFINE("Video", size_t, AnisotropicFiltering, 16); CONFIG_DEFINE("Video", size_t, AnisotropicFiltering, 16);
CONFIG_DEFINE_ENUM_LOCALISED("Video", EShadowResolution, ShadowResolution, EShadowResolution::x4096); CONFIG_DEFINE_ENUM_LOCALISED("Video", EShadowResolution, ShadowResolution, EShadowResolution::x4096);
CONFIG_DEFINE_ENUM_LOCALISED("Video", EGITextureFiltering, GITextureFiltering, EGITextureFiltering::Bicubic); CONFIG_DEFINE_ENUM_LOCALISED("Video", EGITextureFiltering, GITextureFiltering, EGITextureFiltering::Bicubic);
CONFIG_DEFINE_LOCALISED("Video", bool, MotionBlur, true); CONFIG_DEFINE_LOCALISED("Video", bool, MotionBlur, true);
CONFIG_DEFINE_LOCALISED("Video", bool, Xbox360ColourCorrection, false); CONFIG_DEFINE_LOCALISED("Video", bool, XboxColourCorrection, false);
CONFIG_DEFINE_ENUM_LOCALISED("Video", EMovieScaleMode, MovieScaleMode, EMovieScaleMode::Fit); CONFIG_DEFINE_ENUM_LOCALISED("Video", EMovieScaleMode, MovieScaleMode, EMovieScaleMode::Fit);
CONFIG_DEFINE_ENUM_LOCALISED("Video", EUIScaleMode, UIScaleMode, EUIScaleMode::Centre); CONFIG_DEFINE_ENUM_LOCALISED("Video", EUIScaleMode, UIScaleMode, EUIScaleMode::Centre);

View file

@ -59,6 +59,18 @@ CONFIG_DEFINE_ENUM_TEMPLATE(EUnleashGaugeBehaviour)
{ "Revised", EUnleashGaugeBehaviour::Revised } { "Revised", EUnleashGaugeBehaviour::Revised }
}; };
enum class ETimeOfDayTransition : uint32_t
{
Xbox,
PlayStation
};
CONFIG_DEFINE_ENUM_TEMPLATE(ETimeOfDayTransition)
{
{ "Xbox", ETimeOfDayTransition::Xbox },
{ "PlayStation", ETimeOfDayTransition::PlayStation }
};
enum class EVoiceLanguage : uint32_t enum class EVoiceLanguage : uint32_t
{ {
English, English,

View file

@ -718,7 +718,7 @@ static void SetAlphaTestMode(bool enable)
if (enable) if (enable)
{ {
if (Config::AlphaToCoverage && g_renderTarget != nullptr && g_renderTarget->sampleCount != RenderSampleCount::COUNT_1) if (Config::TransparencyAntiAliasing && g_renderTarget != nullptr && g_renderTarget->sampleCount != RenderSampleCount::COUNT_1)
alphaTestMode = AlphaTestMode::AlphaToCoverage; alphaTestMode = AlphaTestMode::AlphaToCoverage;
else else
alphaTestMode = AlphaTestMode::AlphaThreshold; alphaTestMode = AlphaTestMode::AlphaThreshold;

View file

@ -42,7 +42,7 @@ public:
bool CanPoll() bool CanPoll()
{ {
return controller && (Window::s_isFocused || Config::BackgroundInput); return controller && (Window::s_isFocused || Config::AllowBackgroundInput);
} }
void PollAxis() void PollAxis()

View file

@ -91,12 +91,12 @@ CONFIG_DEFINE_LOCALE(ControlTutorial)
CONFIG_DEFINE_LOCALE(SaveScoreAtCheckpoints) CONFIG_DEFINE_LOCALE(SaveScoreAtCheckpoints)
{ {
{ ELanguage::English, { "Save Score at Checkpoints", "Keep your score from the last checkpoint upon respawning." } } { ELanguage::English, { "Save Score at Checkpoints", "Keep your score from the last checkpoint upon respawning.\n\n[TO BE REMOVED]" } }
}; };
CONFIG_DEFINE_LOCALE(UnleashGaugeBehaviour) CONFIG_DEFINE_LOCALE(UnleashGaugeBehaviour)
{ {
{ ELanguage::English, { "Unleash Gauge Behavior", "Change how the Unleash gauge behaves." } } { ELanguage::English, { "Unleash Gauge Behavior", "Change how the Unleash gauge behaves.\n\n[TO BE REMOVED]" } }
}; };
CONFIG_DEFINE_ENUM_LOCALE(EUnleashGaugeBehaviour) CONFIG_DEFINE_ENUM_LOCALE(EUnleashGaugeBehaviour)
@ -110,37 +110,48 @@ CONFIG_DEFINE_ENUM_LOCALE(EUnleashGaugeBehaviour)
} }
}; };
CONFIG_DEFINE_LOCALE(WerehogHubTransformVideo) CONFIG_DEFINE_LOCALE(TimeOfDayTransition)
{ {
{ ELanguage::English, { "Transformation Cutscene", "Play the Werehog transformation cutscene when changing the time of day in the hub areas." } } { ELanguage::English, { "Time of Day Transition", "Change how the loading screen appears when switching time of day in the hub areas." } }
}; };
CONFIG_DEFINE_LOCALE(LogoSkip) CONFIG_DEFINE_ENUM_LOCALE(ETimeOfDayTransition)
{ {
{ ELanguage::English, { "Skip Intro Logos", "Skip the logos during the game's boot sequence." } } {
ELanguage::English,
{
{ ETimeOfDayTransition::Xbox, { "XBOX", "Xbox: the transformation cutscene will play with artificial loading times." } },
{ ETimeOfDayTransition::PlayStation, { "PLAYSTATION", "PlayStation: a spinning medal loading screen will be used instead." } }
}
}
}; };
CONFIG_DEFINE_LOCALE(CameraXInvert) CONFIG_DEFINE_LOCALE(SkipIntroLogos)
{
{ ELanguage::English, { "Skip Intro Logos", "Skip the logos during the game's boot sequence.\n\n[TO BE REMOVED]" } }
};
CONFIG_DEFINE_LOCALE(InvertCameraX)
{ {
{ ELanguage::English, { "Invert Camera X", "Toggle between inverted left and right camera movement." } } { ELanguage::English, { "Invert Camera X", "Toggle between inverted left and right camera movement." } }
}; };
CONFIG_DEFINE_LOCALE(CameraYInvert) CONFIG_DEFINE_LOCALE(InvertCameraY)
{ {
{ ELanguage::English, { "Invert Camera Y", "Toggle between inverted up and down camera movement." } } { ELanguage::English, { "Invert Camera Y", "Toggle between inverted up and down camera movement." } }
}; };
CONFIG_DEFINE_LOCALE(XButtonHoming) CONFIG_DEFINE_LOCALE(XButtonHoming)
{ {
{ ELanguage::English, { "Homing Attack on Boost", "Toggle between using the boost button or the jump button for homing attack." } } { ELanguage::English, { "Homing Attack on Boost", "Toggle between using the boost button or the jump button for the homing attack.\n\n[TO BE REMOVED]" } }
}; };
CONFIG_DEFINE_LOCALE(UnleashCancel) CONFIG_DEFINE_LOCALE(AllowCancellingUnleash)
{ {
{ ELanguage::English, { "Allow Cancelling Unleash", "Allow Unleash to be cancelled at the cost of some energy by pressing the input again." } } { ELanguage::English, { "Allow Cancelling Unleash", "Allow Unleash to be cancelled at the cost of some energy by pressing the input again.\n\n[TO BE REMOVED]" } }
}; };
CONFIG_DEFINE_LOCALE(BackgroundInput) CONFIG_DEFINE_LOCALE(AllowBackgroundInput)
{ {
{ ELanguage::English, { "Allow Background Input", "Accept controller input whilst the game window is unfocused." } } { ELanguage::English, { "Allow Background Input", "Accept controller input whilst the game window is unfocused." } }
}; };
@ -150,7 +161,7 @@ CONFIG_DEFINE_LOCALE(MusicVolume)
{ ELanguage::English, { "Music Volume", "Adjust the volume for the music." } } { ELanguage::English, { "Music Volume", "Adjust the volume for the music." } }
}; };
CONFIG_DEFINE_LOCALE(SEVolume) CONFIG_DEFINE_LOCALE(EffectsVolume)
{ {
{ ELanguage::English, { "Effects Volume", "Adjust the volume for sound effects." } } { ELanguage::English, { "Effects Volume", "Adjust the volume for sound effects." } }
}; };
@ -176,7 +187,7 @@ CONFIG_DEFINE_LOCALE(Subtitles)
{ ELanguage::English, { "Subtitles", "Show subtitles during dialogue." } } { ELanguage::English, { "Subtitles", "Show subtitles during dialogue." } }
}; };
CONFIG_DEFINE_LOCALE(WerehogBattleMusic) CONFIG_DEFINE_LOCALE(BattleTheme)
{ {
{ ELanguage::English, { "Battle Theme", "Play the Werehog battle theme during combat.\n\nThis option will apply the next time you're in combat." } } { ELanguage::English, { "Battle Theme", "Play the Werehog battle theme during combat.\n\nThis option will apply the next time you're in combat." } }
}; };
@ -231,7 +242,7 @@ CONFIG_DEFINE_ENUM_LOCALE(EAntiAliasing)
} }
}; };
CONFIG_DEFINE_LOCALE(AlphaToCoverage) CONFIG_DEFINE_LOCALE(TransparencyAntiAliasing)
{ {
{ ELanguage::English, { "Transparency Anti-Aliasing", "Apply anti-aliasing to alpha transparent textures." } } { ELanguage::English, { "Transparency Anti-Aliasing", "Apply anti-aliasing to alpha transparent textures." } }
}; };
@ -272,9 +283,9 @@ CONFIG_DEFINE_LOCALE(MotionBlur)
{ ELanguage::English, { "Motion Blur", "Use per-object motion blur and radial blur." } } { ELanguage::English, { "Motion Blur", "Use per-object motion blur and radial blur." } }
}; };
CONFIG_DEFINE_LOCALE(Xbox360ColourCorrection) CONFIG_DEFINE_LOCALE(XboxColourCorrection)
{ {
{ ELanguage::English, { "Xbox 360 Color Correction", "Use the warm tint from the Xbox 360 version of the game." } } { ELanguage::English, { "Xbox Color Correction", "Use the warm tint from the Xbox version of the game." } }
}; };
CONFIG_DEFINE_LOCALE(MovieScaleMode) CONFIG_DEFINE_LOCALE(MovieScaleMode)

View file

@ -41,6 +41,12 @@ inline static std::unordered_map<std::string, std::unordered_map<ELanguage, std:
{ {
{ ELanguage::English, "This option is not available at this location." } { ELanguage::English, "This option is not available at this location." }
} }
},
{
"Options_Desc_NotAvailableMSAA",
{
{ ELanguage::English, "This option is not available without MSAA." }
}
} }
}; };

View file

@ -17,13 +17,13 @@ be<float>* GetVolume(bool isMusic = true)
void AudioPatches::Update(float deltaTime) void AudioPatches::Update(float deltaTime)
{ {
auto pMusicVolume = GetVolume(); auto pMusicVolume = GetVolume();
auto pSEVolume = GetVolume(false); auto pEffectsVolume = GetVolume(false);
if (!pMusicVolume || !pSEVolume) if (!pMusicVolume || !pEffectsVolume)
return; return;
*pSEVolume = Config::SEVolume;
*pMusicVolume = Config::MusicVolume; *pMusicVolume = Config::MusicVolume;
*pEffectsVolume = Config::EffectsVolume;
} }
// Stub volume setter. // Stub volume setter.

View file

@ -44,8 +44,8 @@ PPC_FUNC(sub_824697B0)
{ {
auto pCamera = (SWA::CCamera*)g_memory.Translate(ctx.r3.u32); auto pCamera = (SWA::CCamera*)g_memory.Translate(ctx.r3.u32);
pCamera->m_InvertX = Config::CameraXInvert; pCamera->m_InvertX = Config::InvertCameraX;
pCamera->m_InvertY = Config::CameraYInvert; pCamera->m_InvertY = Config::InvertCameraY;
__imp__sub_824697B0(ctx, base); __imp__sub_824697B0(ctx, base);
} }

View file

@ -24,7 +24,7 @@ bool DisableEvilControlTutorialMidAsmHook(PPCRegister& r4, PPCRegister& r5)
void WerehogBattleMusicMidAsmHook(PPCRegister& r11) void WerehogBattleMusicMidAsmHook(PPCRegister& r11)
{ {
if (Config::WerehogBattleMusic) if (Config::BattleTheme)
return; return;
// Swap CStateBattle for CStateNormal. // Swap CStateBattle for CStateNormal.
@ -51,7 +51,7 @@ PPC_FUNC(sub_825197C0)
PPC_FUNC_IMPL(__imp__sub_82547DF0); PPC_FUNC_IMPL(__imp__sub_82547DF0);
PPC_FUNC(sub_82547DF0) PPC_FUNC(sub_82547DF0)
{ {
if (Config::LogoSkip) if (Config::SkipIntroLogos)
{ {
ctx.r4.u64 = 0; ctx.r4.u64 = 0;
ctx.r5.u64 = 0; ctx.r5.u64 = 0;

View file

@ -67,7 +67,7 @@ PPC_FUNC(sub_823AF7A8)
__imp__sub_823AF7A8(ctx, base); __imp__sub_823AF7A8(ctx, base);
if (!Config::UnleashCancel) if (!Config::AllowCancellingUnleash)
return; return;
auto pInputState = SWA::CInputState::GetInstance(); auto pInputState = SWA::CInputState::GetInstance();

View file

@ -12,9 +12,8 @@ void GetStageIDMidAsmHook(PPCRegister& r5)
PPC_FUNC_IMPL(__imp__sub_824DCF38); PPC_FUNC_IMPL(__imp__sub_824DCF38);
PPC_FUNC(sub_824DCF38) PPC_FUNC(sub_824DCF38)
{ {
/* Force the Werehog transition ID // TODO: use the actual PS3 loading screen.
to use a different transition. */ if (Config::TimeOfDayTransition == ETimeOfDayTransition::PlayStation)
if (!Config::WerehogHubTransformVideo)
{ {
/* /*
0 - Tails Electric NOW LOADING 0 - Tails Electric NOW LOADING

View file

@ -854,22 +854,22 @@ static void DrawConfigOptions()
DrawConfigOption(rowCount++, yOffset, &Config::ControlTutorial, !isStage, cmnReason); DrawConfigOption(rowCount++, yOffset, &Config::ControlTutorial, !isStage, cmnReason);
DrawConfigOption(rowCount++, yOffset, &Config::SaveScoreAtCheckpoints, true); DrawConfigOption(rowCount++, yOffset, &Config::SaveScoreAtCheckpoints, true);
DrawConfigOption(rowCount++, yOffset, &Config::UnleashGaugeBehaviour, true); DrawConfigOption(rowCount++, yOffset, &Config::UnleashGaugeBehaviour, true);
DrawConfigOption(rowCount++, yOffset, &Config::WerehogHubTransformVideo, true); DrawConfigOption(rowCount++, yOffset, &Config::TimeOfDayTransition, true);
DrawConfigOption(rowCount++, yOffset, &Config::LogoSkip, true); DrawConfigOption(rowCount++, yOffset, &Config::SkipIntroLogos, true);
break; break;
case 1: // INPUT case 1: // INPUT
DrawConfigOption(rowCount++, yOffset, &Config::CameraXInvert, true); DrawConfigOption(rowCount++, yOffset, &Config::InvertCameraX, true);
DrawConfigOption(rowCount++, yOffset, &Config::CameraYInvert, true); DrawConfigOption(rowCount++, yOffset, &Config::InvertCameraY, true);
DrawConfigOption(rowCount++, yOffset, &Config::XButtonHoming, OptionsMenu::s_pauseMenuType == SWA::eMenuType_WorldMap, cmnReason); // TODO: make this editable in stages? DrawConfigOption(rowCount++, yOffset, &Config::XButtonHoming, OptionsMenu::s_pauseMenuType == SWA::eMenuType_WorldMap, cmnReason); // TODO: make this editable in stages?
DrawConfigOption(rowCount++, yOffset, &Config::UnleashCancel, true); DrawConfigOption(rowCount++, yOffset, &Config::AllowCancellingUnleash, true);
DrawConfigOption(rowCount++, yOffset, &Config::BackgroundInput, true); DrawConfigOption(rowCount++, yOffset, &Config::AllowBackgroundInput, true);
break; break;
case 2: // AUDIO case 2: // AUDIO
DrawConfigOption(rowCount++, yOffset, &Config::MusicVolume, true); DrawConfigOption(rowCount++, yOffset, &Config::MusicVolume, true);
DrawConfigOption(rowCount++, yOffset, &Config::SEVolume, true); DrawConfigOption(rowCount++, yOffset, &Config::EffectsVolume, true);
DrawConfigOption(rowCount++, yOffset, &Config::VoiceLanguage, true); DrawConfigOption(rowCount++, yOffset, &Config::VoiceLanguage, true);
DrawConfigOption(rowCount++, yOffset, &Config::Subtitles, true); DrawConfigOption(rowCount++, yOffset, &Config::Subtitles, true);
DrawConfigOption(rowCount++, yOffset, &Config::WerehogBattleMusic, true); DrawConfigOption(rowCount++, yOffset, &Config::BattleTheme, true);
break; break;
case 3: // VIDEO case 3: // VIDEO
// TODO: expose WindowWidth/WindowHeight as WindowSize. // TODO: expose WindowWidth/WindowHeight as WindowSize.
@ -880,11 +880,11 @@ static void DrawConfigOptions()
DrawConfigOption(rowCount++, yOffset, &Config::FPS, true, nullptr, 15, 120, 240); DrawConfigOption(rowCount++, yOffset, &Config::FPS, true, nullptr, 15, 120, 240);
DrawConfigOption(rowCount++, yOffset, &Config::Brightness, true); DrawConfigOption(rowCount++, yOffset, &Config::Brightness, true);
DrawConfigOption(rowCount++, yOffset, &Config::AntiAliasing, true); DrawConfigOption(rowCount++, yOffset, &Config::AntiAliasing, true);
DrawConfigOption(rowCount++, yOffset, &Config::AlphaToCoverage, true); DrawConfigOption(rowCount++, yOffset, &Config::TransparencyAntiAliasing, Config::AntiAliasing != EAntiAliasing::None, &Localise("Options_Desc_NotAvailableMSAA"));
DrawConfigOption(rowCount++, yOffset, &Config::ShadowResolution, true); DrawConfigOption(rowCount++, yOffset, &Config::ShadowResolution, true);
DrawConfigOption(rowCount++, yOffset, &Config::GITextureFiltering, true); DrawConfigOption(rowCount++, yOffset, &Config::GITextureFiltering, true);
DrawConfigOption(rowCount++, yOffset, &Config::MotionBlur, true); DrawConfigOption(rowCount++, yOffset, &Config::MotionBlur, true);
DrawConfigOption(rowCount++, yOffset, &Config::Xbox360ColourCorrection, true); DrawConfigOption(rowCount++, yOffset, &Config::XboxColourCorrection, true);
DrawConfigOption(rowCount++, yOffset, &Config::MovieScaleMode, true); DrawConfigOption(rowCount++, yOffset, &Config::MovieScaleMode, true);
DrawConfigOption(rowCount++, yOffset, &Config::UIScaleMode, true); DrawConfigOption(rowCount++, yOffset, &Config::UIScaleMode, true);
break; break;