mirror of
https://github.com/hedge-dev/UnleashedRecomp.git
synced 2025-10-30 07:11:05 +00:00
config: override type operator
This commit is contained in:
parent
cf8bba788b
commit
231a78a118
6 changed files with 24 additions and 49 deletions
|
|
@ -96,40 +96,15 @@ public:
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
operator T() const
|
||||||
|
{
|
||||||
|
return Value;
|
||||||
|
}
|
||||||
|
|
||||||
void operator=(const T& other)
|
void operator=(const T& other)
|
||||||
{
|
{
|
||||||
Value = other;
|
Value = other;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool operator==(const T& other) const
|
|
||||||
{
|
|
||||||
return Value == other;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator!=(const T& other) const
|
|
||||||
{
|
|
||||||
return Value != other;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator<(const T& other) const
|
|
||||||
{
|
|
||||||
return Value < other;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator>(const T& other) const
|
|
||||||
{
|
|
||||||
return Value > other;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator<=(const T& other) const
|
|
||||||
{
|
|
||||||
return Value <= other;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool operator>=(const T& other) const
|
|
||||||
{
|
|
||||||
return Value >= other;
|
|
||||||
}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ELanguage
|
enum ELanguage
|
||||||
|
|
|
||||||
|
|
@ -119,7 +119,7 @@ PPC_FUNC(sub_824DCF38)
|
||||||
{
|
{
|
||||||
/* Force the Werehog transition ID
|
/* Force the Werehog transition ID
|
||||||
to use a different transition. */
|
to use a different transition. */
|
||||||
if (!Config::WerehogHubTransformVideo.Value)
|
if (!Config::WerehogHubTransformVideo)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
0 - Tails Electric NOW LOADING
|
0 - Tails Electric NOW LOADING
|
||||||
|
|
@ -160,12 +160,12 @@ PPC_FUNC(sub_823AF7A8)
|
||||||
m_lastDarkGaiaEnergy = pEvilSonicContext->m_DarkGaiaEnergy;
|
m_lastDarkGaiaEnergy = pEvilSonicContext->m_DarkGaiaEnergy;
|
||||||
|
|
||||||
// Don't drain energy if out of control.
|
// Don't drain energy if out of control.
|
||||||
if (!Config::UnleashOutOfControlDrain.Value && pEvilSonicContext->m_OutOfControlCount && ctx.f1.f64 < 0.0)
|
if (!Config::UnleashOutOfControlDrain && pEvilSonicContext->m_OutOfControlCount && ctx.f1.f64 < 0.0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
__imp__sub_823AF7A8(ctx, base);
|
__imp__sub_823AF7A8(ctx, base);
|
||||||
|
|
||||||
if (!Config::UnleashCancel.Value)
|
if (!Config::UnleashCancel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto pInputState = SWA::CInputState::GetInstance();
|
auto pInputState = SWA::CInputState::GetInstance();
|
||||||
|
|
@ -198,12 +198,12 @@ void PostUnleashMidAsmHook(PPCRegister& r30)
|
||||||
|
|
||||||
bool DisableHintsMidAsmHook()
|
bool DisableHintsMidAsmHook()
|
||||||
{
|
{
|
||||||
return !Config::Hints.Value;
|
return !Config::Hints;
|
||||||
}
|
}
|
||||||
|
|
||||||
void SetXButtonHomingMidAsmHook(PPCRegister& r30)
|
void SetXButtonHomingMidAsmHook(PPCRegister& r30)
|
||||||
{
|
{
|
||||||
r30.u32 = Config::XButtonHoming.Value;
|
r30.u32 = Config::XButtonHoming;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Hook function that gets the game region
|
/* Hook function that gets the game region
|
||||||
|
|
@ -240,7 +240,7 @@ void GetStageIDMidAsmHook(PPCRegister& r5)
|
||||||
PPC_FUNC_IMPL(__imp__sub_82547DF0);
|
PPC_FUNC_IMPL(__imp__sub_82547DF0);
|
||||||
PPC_FUNC(sub_82547DF0)
|
PPC_FUNC(sub_82547DF0)
|
||||||
{
|
{
|
||||||
if (Config::LogoSkip.Value)
|
if (Config::LogoSkip)
|
||||||
{
|
{
|
||||||
ctx.r4.u64 = 0;
|
ctx.r4.u64 = 0;
|
||||||
ctx.r5.u64 = 0;
|
ctx.r5.u64 = 0;
|
||||||
|
|
|
||||||
|
|
@ -1171,7 +1171,7 @@ static GuestSurface* CreateSurface(uint32_t width, uint32_t height, uint32_t for
|
||||||
desc.depth = 1;
|
desc.depth = 1;
|
||||||
desc.mipLevels = 1;
|
desc.mipLevels = 1;
|
||||||
desc.arraySize = 1;
|
desc.arraySize = 1;
|
||||||
desc.multisampling.sampleCount = multiSample != 0 && Config::MSAA > 1 ? Config::MSAA.Value : RenderSampleCount::COUNT_1;
|
desc.multisampling.sampleCount = multiSample != 0 && Config::MSAA > 1 ? Config::MSAA : RenderSampleCount::COUNT_1;
|
||||||
desc.format = ConvertFormat(format);
|
desc.format = ConvertFormat(format);
|
||||||
desc.flags = desc.format == RenderFormat::D32_FLOAT ? RenderTextureFlag::DEPTH_TARGET : RenderTextureFlag::RENDER_TARGET;
|
desc.flags = desc.format == RenderFormat::D32_FLOAT ? RenderTextureFlag::DEPTH_TARGET : RenderTextureFlag::RENDER_TARGET;
|
||||||
|
|
||||||
|
|
@ -2614,7 +2614,7 @@ void IndexBufferLengthMidAsmHook(PPCRegister& r3)
|
||||||
void SetShadowResolutionMidAsmHook(PPCRegister& r11)
|
void SetShadowResolutionMidAsmHook(PPCRegister& r11)
|
||||||
{
|
{
|
||||||
if (Config::ShadowResolution > 0)
|
if (Config::ShadowResolution > 0)
|
||||||
r11.u64 = Config::ShadowResolution.Value;
|
r11.u64 = Config::ShadowResolution;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Primitive2DHalfPixelOffsetMidAsmHook(PPCRegister& f13)
|
void Primitive2DHalfPixelOffsetMidAsmHook(PPCRegister& f13)
|
||||||
|
|
@ -2624,8 +2624,8 @@ void Primitive2DHalfPixelOffsetMidAsmHook(PPCRegister& f13)
|
||||||
|
|
||||||
static void SetResolution(be<uint32_t>* device)
|
static void SetResolution(be<uint32_t>* device)
|
||||||
{
|
{
|
||||||
uint32_t width = uint32_t(g_swapChain->getWidth() * Config::ResolutionScale.Value);
|
uint32_t width = uint32_t(g_swapChain->getWidth() * Config::ResolutionScale);
|
||||||
uint32_t height = uint32_t(g_swapChain->getHeight() * Config::ResolutionScale.Value);
|
uint32_t height = uint32_t(g_swapChain->getHeight() * Config::ResolutionScale);
|
||||||
device[46] = width == 0 ? 880 : width;
|
device[46] = width == 0 ? 880 : width;
|
||||||
device[47] = height == 0 ? 720 : height;
|
device[47] = height == 0 ? 720 : height;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -191,7 +191,7 @@ void XamShowMessageBoxUIEx()
|
||||||
uint32_t XGetLanguage()
|
uint32_t XGetLanguage()
|
||||||
{
|
{
|
||||||
// printf("!!! STUB !!! XGetLanguage\n");
|
// printf("!!! STUB !!! XGetLanguage\n");
|
||||||
return Config::Language.Value;
|
return Config::Language;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t XGetAVPack()
|
uint32_t XGetAVPack()
|
||||||
|
|
@ -336,7 +336,7 @@ uint32_t ExGetXConfigSetting(uint16_t Category, uint16_t Setting, void* Buffer,
|
||||||
|
|
||||||
// XCONFIG_USER_LANGUAGE
|
// XCONFIG_USER_LANGUAGE
|
||||||
case 0x0009:
|
case 0x0009:
|
||||||
data[0] = std::byteswap((uint32_t)Config::Language.Value);
|
data[0] = std::byteswap((uint32_t)Config::Language);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
// XCONFIG_USER_VIDEO_FLAGS
|
// XCONFIG_USER_VIDEO_FLAGS
|
||||||
|
|
|
||||||
|
|
@ -92,8 +92,8 @@ void Window::Init()
|
||||||
s_window = SDL_CreateWindow(title,
|
s_window = SDL_CreateWindow(title,
|
||||||
SDL_WINDOWPOS_CENTERED,
|
SDL_WINDOWPOS_CENTERED,
|
||||||
SDL_WINDOWPOS_CENTERED,
|
SDL_WINDOWPOS_CENTERED,
|
||||||
Config::WindowWidth.Value,
|
Config::WindowWidth,
|
||||||
Config::WindowHeight.Value,
|
Config::WindowHeight,
|
||||||
SDL_WINDOW_RESIZABLE);
|
SDL_WINDOW_RESIZABLE);
|
||||||
|
|
||||||
if (auto icon = GetIconSurface())
|
if (auto icon = GetIconSurface())
|
||||||
|
|
@ -103,7 +103,7 @@ void Window::Init()
|
||||||
}
|
}
|
||||||
|
|
||||||
SetWindowDimensions();
|
SetWindowDimensions();
|
||||||
SetFullscreen(Config::Fullscreen.Value);
|
SetFullscreen(Config::Fullscreen);
|
||||||
|
|
||||||
SDL_SysWMinfo info;
|
SDL_SysWMinfo info;
|
||||||
SDL_VERSION(&info.version);
|
SDL_VERSION(&info.version);
|
||||||
|
|
|
||||||
|
|
@ -29,8 +29,8 @@ public:
|
||||||
|
|
||||||
static bool IsDisplayResolution(int w, int h, bool isExact = true)
|
static bool IsDisplayResolution(int w, int h, bool isExact = true)
|
||||||
{
|
{
|
||||||
auto width = w <= 0 ? Config::WindowWidth.Value : w;
|
auto width = w <= 0 ? Config::WindowWidth : w;
|
||||||
auto height = h <= 0 ? Config::WindowHeight.Value : h;
|
auto height = h <= 0 ? Config::WindowHeight : h;
|
||||||
|
|
||||||
SDL_Rect displayRect;
|
SDL_Rect displayRect;
|
||||||
if (SDL_GetDisplayBounds(SDL_GetWindowDisplayIndex(s_window), &displayRect) == ERROR_SUCCESS)
|
if (SDL_GetDisplayBounds(SDL_GetWindowDisplayIndex(s_window), &displayRect) == ERROR_SUCCESS)
|
||||||
|
|
@ -83,8 +83,8 @@ public:
|
||||||
|
|
||||||
static void SetWindowDimensions(int w = -1, int h = -1)
|
static void SetWindowDimensions(int w = -1, int h = -1)
|
||||||
{
|
{
|
||||||
auto width = w <= 0 ? Config::WindowWidth.Value : w;
|
auto width = w <= 0 ? Config::WindowWidth : w;
|
||||||
auto height = h <= 0 ? Config::WindowHeight.Value : h;
|
auto height = h <= 0 ? Config::WindowHeight : h;
|
||||||
auto isPendingMaximise = false;
|
auto isPendingMaximise = false;
|
||||||
|
|
||||||
if (IsDisplayResolution(width, height))
|
if (IsDisplayResolution(width, height))
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue