diff --git a/d3d9ex/AutoFix.cpp b/d3d9ex/AutoFix.cpp index 6478e4d..60629ff 100644 --- a/d3d9ex/AutoFix.cpp +++ b/d3d9ex/AutoFix.cpp @@ -42,7 +42,7 @@ void MainContext::FF13_2_CreateSetFrameRateCodeBlock() ChangeMemoryProtectionToReadWriteExecute(FF13_2_SET_FRAME_RATE_INJECTED_CODE, blockSize); - float frameRateConfigValue = context.config.GetFFXIIIIngameFrameRateLimit(); + float frameRateConfigValue = (float)context.config.GetFFXIIIIngameFrameRateLimit(); if (AreAlmostTheSame(frameRateConfigValue, -1.0F) || frameRateConfigValue > FF13_2_MAX_FRAME_CAP) { ff13_2_targetFrameRate = FF13_2_MAX_FRAME_CAP; } @@ -283,7 +283,7 @@ void MainContext::FF13_2_RemoveContinuousControllerScan() { } void MainContext::FF13_2_AddHookIngameFrameRateLimitSetter() { - if (context.AreAlmostTheSame(context.config.GetFFXIIIIngameFrameRateLimit(), 0.0F)) { + if (context.AreAlmostTheSame((float)context.config.GetFFXIIIIngameFrameRateLimit(), 0.0F)) { PrintLog("Frame rate should not be changed (config = 0)"); return; } @@ -302,6 +302,10 @@ void MainContext::ChangeMemoryProtectionToReadWriteExecute(void* address, const VirtualProtect(address, size, PAGE_EXECUTE_READWRITE, &oldProtection); } +void MainContext::PrintVersionInfo() { + PrintLog("FF13Fix 1.3 https://github.com/rebtd7/FF13Fix"); +} + bool MainContext::AreAlmostTheSame(float a, float b) { return fabs(a - b) < 0.01f; } \ No newline at end of file diff --git a/d3d9ex/AutoFix.h b/d3d9ex/AutoFix.h index ff4f770..e1f742f 100644 --- a/d3d9ex/AutoFix.h +++ b/d3d9ex/AutoFix.h @@ -1,3 +1,3 @@ -#pragma once - -bool CheckFix(DWORD* flags); +#pragma once + +bool CheckFix(DWORD* flags); diff --git a/d3d9ex/Context.cpp b/d3d9ex/Context.cpp index a6dac39..10d7ad2 100644 --- a/d3d9ex/Context.cpp +++ b/d3d9ex/Context.cpp @@ -41,6 +41,7 @@ Config::Config() MainContext::MainContext() : oldWndProc(nullptr) { LogFile("FF13Fix.log"); + PrintVersionInfo(); if (config.GetAutoFix()) EnableAutoFix(); diff --git a/d3d9ex/Context.h b/d3d9ex/Context.h index 957dcb1..464ed3a 100644 --- a/d3d9ex/Context.h +++ b/d3d9ex/Context.h @@ -98,7 +98,9 @@ private: static LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); WNDPROC oldWndProc; - void ChangeMemoryProtectionToReadWriteExecute(void* address, const int size); + void ChangeMemoryProtectionToReadWriteExecute(void* address, const int size); + bool AreAlmostTheSame(float a, float b); + void PrintVersionInfo(); void FF13_OneTimeFixes(); void FF13_AddHookIngameFrameRateLimitSetter(); @@ -109,7 +111,6 @@ private: void FF13_2_RemoveContinuousControllerScan(); void FF13_2_AddHookIngameFrameRateLimitSetter(); void FF13_2_OneTimeFixes(); - bool AreAlmostTheSame(float a, float b); }; extern MainContext context; \ No newline at end of file