mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2024-11-24 22:32:29 +01:00
III/VC: Two more minor scaling fixes
III: The position of the dialog question text in the main menu now scales to resolution correctly. VC: The vertical offset of the weapon name text in Ammu-Nation now scales to resolution correctly.
This commit is contained in:
parent
fd67cb4064
commit
7d055f9264
@ -49,6 +49,7 @@ All the remaining, non-critical fixes.
|
||||
* Credits now scale to resolution correctly, and they don't cut to an empty screen at the very end anymore.
|
||||
* Mission title and 'Mission Passed' texts now stay on screen for the same duration, regardless of screen resolution.
|
||||
* The inner padding of the text boxes with a background now scales to resolution correctly.
|
||||
* The position of the dialog question text in the main menu now scales to resolution correctly.
|
||||
* `FILE_FLAG_NO_BUFFERING` flag has been removed from IMG reading functions - speeding up streaming.
|
||||
* Free resprays will not carry on a New Game now.
|
||||
* Fixed ambulance and firetruck dispatch timers - they reset on New Game now.
|
||||
|
@ -45,6 +45,7 @@ All the remaining, non-critical fixes.
|
||||
* Credits now scale to resolution correctly.
|
||||
* Mission title and 'Mission Passed' texts now stay on screen for the same duration, regardless of screen resolution.
|
||||
* The inner padding of the text boxes with a background now scales to resolution correctly.
|
||||
* The vertical offset of the weapon name text in Ammu-Nation now scales to resolution correctly.
|
||||
* `FILE_FLAG_NO_BUFFERING` flag has been removed from IMG reading functions - speeding up streaming.
|
||||
* Free resprays will not carry on a New Game now.
|
||||
* Fixed ambulance and firetruck dispatch timers - they reset on New Game now.
|
||||
|
@ -1165,6 +1165,18 @@ namespace TextRectPaddingScalingFixes
|
||||
HOOK_EACH_INIT(WrapX, orgWrapX, WrapX_Recalculated);
|
||||
}
|
||||
|
||||
|
||||
// ============= Fix menu texts not scaling to resolution =============
|
||||
namespace MenuManagerScalingFixes
|
||||
{
|
||||
static void (*orgPrintString)(float,float,const wchar_t*);
|
||||
static void PrintString_Scale(float fX, float fY, const wchar_t* pText)
|
||||
{
|
||||
orgPrintString(fX * GetWidthMult() * RsGlobal->MaximumWidth, fY * GetHeightMult() * RsGlobal->MaximumHeight, pText);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
namespace ModelIndicesReadyHook
|
||||
{
|
||||
static void (*orgInitialiseObjectData)(const char*);
|
||||
@ -1607,6 +1619,17 @@ void InjectDelayedPatches_III_Common( bool bHasDebugMenu, const wchar_t* wcModul
|
||||
}
|
||||
TXN_CATCH();
|
||||
|
||||
|
||||
// ============= Fix menu texts not scaling to resolution =============
|
||||
try
|
||||
{
|
||||
using namespace MenuManagerScalingFixes;
|
||||
|
||||
auto printStringMenuText = get_pattern("E8 ? ? ? ? 83 C4 0C DB 05 ? ? ? ? 50");
|
||||
InterceptCall(printStringMenuText, orgPrintString, PrintString_Scale);
|
||||
}
|
||||
TXN_CATCH();
|
||||
|
||||
FLAUtils::Init(moduleList);
|
||||
}
|
||||
|
||||
|
@ -619,6 +619,35 @@ namespace TextRectPaddingScalingFixes
|
||||
}
|
||||
|
||||
|
||||
// ============= Fix ammunation text (big message type 3) Y position offset not scaling to resolution =============
|
||||
namespace BigMessage3ScalingFixes
|
||||
{
|
||||
template<std::size_t Index>
|
||||
static const float* orgOffsetY;
|
||||
|
||||
template<std::size_t Index>
|
||||
static float OffsetY_Recalculated;
|
||||
|
||||
template<std::size_t... I>
|
||||
static void RecalculateYOffset(std::index_sequence<I...>)
|
||||
{
|
||||
const float multiplier = GetHeightMult() * RsGlobal->MaximumHeight;
|
||||
((OffsetY_Recalculated<I> = *orgOffsetY<I> * multiplier), ...);
|
||||
}
|
||||
|
||||
static void (*orgSetDropColor)(const CRGBA&);
|
||||
|
||||
template<std::size_t NumXOffsets>
|
||||
static void SetDropColor_Scale(const CRGBA& color)
|
||||
{
|
||||
RecalculateYOffset(std::make_index_sequence<NumXOffsets>{});
|
||||
orgSetDropColor(color);
|
||||
}
|
||||
|
||||
HOOK_EACH_INIT(MessageYOffset, orgOffsetY, OffsetY_Recalculated);
|
||||
}
|
||||
|
||||
|
||||
float FixedRefValue()
|
||||
{
|
||||
return 1.0f;
|
||||
@ -2022,6 +2051,22 @@ void InjectDelayedPatches_VC_Common( bool bHasDebugMenu, const wchar_t* wcModule
|
||||
}
|
||||
TXN_CATCH();
|
||||
|
||||
|
||||
// Fix ammunation text (big message type 3) Y position offset not scaling to resolution
|
||||
try
|
||||
{
|
||||
using namespace BigMessage3ScalingFixes;
|
||||
|
||||
auto setDropColor = get_pattern("E8 ? ? ? ? 59 8D 4C 24 40");
|
||||
std::array<float**, 1> YOffset = {
|
||||
get_pattern<float*>("D8 25 ? ? ? ? D9 1C 24 A1", 2),
|
||||
};
|
||||
|
||||
HookEach_MessageYOffset(YOffset, PatchFloat);
|
||||
InterceptCall(setDropColor, orgSetDropColor, SetDropColor_Scale<YOffset.size()>);
|
||||
}
|
||||
TXN_CATCH();
|
||||
|
||||
FLAUtils::Init(moduleList);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user