mirror of
https://github.com/CookiePLMonster/SilentPatch.git
synced 2025-01-01 16:53:01 +05:00
Thin templates for margin fixes for III/VC
This commit is contained in:
parent
1e9d526c7c
commit
344d70800f
2 changed files with 40 additions and 28 deletions
|
@ -187,34 +187,40 @@ void __stdcall Recalculate(signed int nShadow)
|
||||||
fShadowYSize = nShadow * GetHeightMult() * RsGlobal->MaximumHeight;
|
fShadowYSize = nShadow * GetHeightMult() * RsGlobal->MaximumHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int pFltX, int pFltY>
|
static void AlteredPrintString_Internal(float fX, float fY, float fMarginX, float fMarginY, const wchar_t* pText)
|
||||||
void AlteredPrintString(float fX, float fY, const wchar_t* pText)
|
|
||||||
{
|
{
|
||||||
float fMarginX = **reinterpret_cast<float**>(pFltX);
|
|
||||||
float fMarginY = **reinterpret_cast<float**>(pFltY);
|
|
||||||
PrintString(fX - fMarginX + (fMarginX * GetWidthMult() * RsGlobal->MaximumWidth), fY - fMarginY + (fMarginY * GetHeightMult() * RsGlobal->MaximumHeight), pText);
|
PrintString(fX - fMarginX + (fMarginX * GetWidthMult() * RsGlobal->MaximumWidth), fY - fMarginY + (fMarginY * GetHeightMult() * RsGlobal->MaximumHeight), pText);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int pFltX, int pFltY>
|
template<uintptr_t pFltX, uintptr_t pFltY>
|
||||||
|
void AlteredPrintString(float fX, float fY, const wchar_t* pText)
|
||||||
|
{
|
||||||
|
const float fMarginX = **reinterpret_cast<float**>(pFltX);
|
||||||
|
const float fMarginY = **reinterpret_cast<float**>(pFltY);
|
||||||
|
AlteredPrintString_Internal(fX, fY, fMarginX, fMarginY, pText);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<uintptr_t pFltX, uintptr_t pFltY>
|
||||||
void AlteredPrintStringMinus(float fX, float fY, const wchar_t* pText)
|
void AlteredPrintStringMinus(float fX, float fY, const wchar_t* pText)
|
||||||
{
|
{
|
||||||
float fMarginX = **reinterpret_cast<float**>(pFltX);
|
const float fMarginX = **reinterpret_cast<float**>(pFltX);
|
||||||
float fMarginY = **reinterpret_cast<float**>(pFltY);
|
const float fMarginY = **reinterpret_cast<float**>(pFltY);
|
||||||
PrintString(fX + fMarginX - (fMarginX * GetWidthMult() * RsGlobal->MaximumWidth), fY + fMarginY - (fMarginY * GetHeightMult() * RsGlobal->MaximumHeight), pText);
|
AlteredPrintString_Internal(fX, fY, -fMarginX, -fMarginY, pText);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int pFltX>
|
template<uintptr_t pFltX>
|
||||||
void AlteredPrintStringXOnly(float fX, float fY, const wchar_t* pText)
|
void AlteredPrintStringXOnly(float fX, float fY, const wchar_t* pText)
|
||||||
{
|
{
|
||||||
float fMarginX = **reinterpret_cast<float**>(pFltX);
|
const float fMarginX = **reinterpret_cast<float**>(pFltX);
|
||||||
PrintString(fX - fMarginX + (fMarginX * GetWidthMult() * RsGlobal->MaximumWidth), fY, pText);
|
AlteredPrintString_Internal(fX, fY, fMarginX, 0.0f, pText);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int pFltY>
|
template<uintptr_t pFltY>
|
||||||
void AlteredPrintStringYOnly(float fX, float fY, const wchar_t* pText)
|
void AlteredPrintStringYOnly(float fX, float fY, const wchar_t* pText)
|
||||||
{
|
{
|
||||||
float fMarginY = **reinterpret_cast<float**>(pFltY);
|
const float fMarginY = **reinterpret_cast<float**>(pFltY);
|
||||||
PrintString(fX, fY - fMarginY + (fMarginY * GetHeightMult() * RsGlobal->MaximumHeight), pText);
|
AlteredPrintString_Internal(fX, fY, 0.0f, fMarginY, pText);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float FixedRefValue()
|
float FixedRefValue()
|
||||||
|
|
|
@ -95,34 +95,40 @@ void __stdcall Recalculate(float& fX, float& fY, signed int nShadow)
|
||||||
fY = nShadow * GetHeightMult() * RsGlobal->MaximumHeight;
|
fY = nShadow * GetHeightMult() * RsGlobal->MaximumHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int pFltX, int pFltY>
|
static void AlteredPrintString_Internal(float fX, float fY, float fMarginX, float fMarginY, const wchar_t* pText)
|
||||||
void AlteredPrintString(float fX, float fY, const wchar_t* pText)
|
|
||||||
{
|
{
|
||||||
float fMarginX = **reinterpret_cast<float**>(pFltX);
|
|
||||||
float fMarginY = **reinterpret_cast<float**>(pFltY);
|
|
||||||
PrintString(fX - fMarginX + (fMarginX * GetWidthMult() * RsGlobal->MaximumWidth), fY - fMarginY + (fMarginY * GetHeightMult() * RsGlobal->MaximumHeight), pText);
|
PrintString(fX - fMarginX + (fMarginX * GetWidthMult() * RsGlobal->MaximumWidth), fY - fMarginY + (fMarginY * GetHeightMult() * RsGlobal->MaximumHeight), pText);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int pFltX, int pFltY>
|
template<uintptr_t pFltX, uintptr_t pFltY>
|
||||||
|
void AlteredPrintString(float fX, float fY, const wchar_t* pText)
|
||||||
|
{
|
||||||
|
const float fMarginX = **reinterpret_cast<float**>(pFltX);
|
||||||
|
const float fMarginY = **reinterpret_cast<float**>(pFltY);
|
||||||
|
AlteredPrintString_Internal(fX, fY, fMarginX, fMarginY, pText);
|
||||||
|
}
|
||||||
|
|
||||||
|
template<uintptr_t pFltX, uintptr_t pFltY>
|
||||||
void AlteredPrintStringMinus(float fX, float fY, const wchar_t* pText)
|
void AlteredPrintStringMinus(float fX, float fY, const wchar_t* pText)
|
||||||
{
|
{
|
||||||
float fMarginX = **reinterpret_cast<float**>(pFltX);
|
const float fMarginX = **reinterpret_cast<float**>(pFltX);
|
||||||
float fMarginY = **reinterpret_cast<float**>(pFltY);
|
const float fMarginY = **reinterpret_cast<float**>(pFltY);
|
||||||
PrintString(fX + fMarginX - (fMarginX * GetWidthMult() * RsGlobal->MaximumWidth), fY + fMarginY - (fMarginY * GetHeightMult() * RsGlobal->MaximumHeight), pText);
|
AlteredPrintString_Internal(fX, fY, -fMarginX, -fMarginY, pText);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int pFltX>
|
template<uintptr_t pFltX>
|
||||||
void AlteredPrintStringXOnly(float fX, float fY, const wchar_t* pText)
|
void AlteredPrintStringXOnly(float fX, float fY, const wchar_t* pText)
|
||||||
{
|
{
|
||||||
float fMarginX = **reinterpret_cast<float**>(pFltX);
|
const float fMarginX = **reinterpret_cast<float**>(pFltX);
|
||||||
PrintString(fX - fMarginX + (fMarginX * GetWidthMult() * RsGlobal->MaximumWidth), fY, pText);
|
AlteredPrintString_Internal(fX, fY, fMarginX, 0.0f, pText);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<int pFltY>
|
template<uintptr_t pFltY>
|
||||||
void AlteredPrintStringYOnly(float fX, float fY, const wchar_t* pText)
|
void AlteredPrintStringYOnly(float fX, float fY, const wchar_t* pText)
|
||||||
{
|
{
|
||||||
float fMarginY = **reinterpret_cast<float**>(pFltY);
|
const float fMarginY = **reinterpret_cast<float**>(pFltY);
|
||||||
PrintString(fX, fY - fMarginY + (fMarginY * GetHeightMult() * RsGlobal->MaximumHeight), pText);
|
AlteredPrintString_Internal(fX, fY, 0.0f, fMarginY, pText);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float FixedRefValue()
|
float FixedRefValue()
|
||||||
|
|
Loading…
Reference in a new issue