commit
e463304365
7
.gitmodules
vendored
7
.gitmodules
vendored
|
@ -1,3 +1,6 @@
|
||||||
[submodule "MinHook"]
|
[submodule "Deps/MinHook"]
|
||||||
path = MinHook
|
path = Deps/MinHook
|
||||||
url = https://github.com/TsudaKageyu/minhook.git
|
url = https://github.com/TsudaKageyu/minhook.git
|
||||||
|
[submodule "Deps/spdlog"]
|
||||||
|
path = Deps/spdlog
|
||||||
|
url = https://github.com/gabime/spdlog.git
|
||||||
|
|
148
Common/Logger.h
148
Common/Logger.h
|
@ -1,148 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <io.h>
|
|
||||||
#include <fcntl.h>
|
|
||||||
|
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
|
||||||
#include <mutex>
|
|
||||||
|
|
||||||
#include "StringUtil.h"
|
|
||||||
#include "WinUtil.h"
|
|
||||||
|
|
||||||
#define LOGGER_DISABLE_MUTEX
|
|
||||||
|
|
||||||
#ifndef LOGGER_DISABLE
|
|
||||||
class Logger
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
Logger(const Logger&) = delete;
|
|
||||||
const Logger& operator=(Logger& other) = delete;
|
|
||||||
|
|
||||||
Logger() : m_systime(), m_console(INVALID_HANDLE_VALUE), m_file(INVALID_HANDLE_VALUE) {}
|
|
||||||
|
|
||||||
virtual ~Logger()
|
|
||||||
{
|
|
||||||
if (m_console)
|
|
||||||
FreeConsole();
|
|
||||||
|
|
||||||
if (m_file)
|
|
||||||
CloseHandle(m_file);
|
|
||||||
}
|
|
||||||
|
|
||||||
#ifndef LOGGER_DISABLE_MUTEX
|
|
||||||
std::mutex& writeMutex() const { return m_writeMutex; }
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static Logger& Get()
|
|
||||||
{
|
|
||||||
static Logger instance;
|
|
||||||
return instance;
|
|
||||||
};
|
|
||||||
|
|
||||||
bool File(const std::string& filename)
|
|
||||||
{
|
|
||||||
std::string logpath = FullPathFromPath(filename);
|
|
||||||
m_file = CreateFileA(logpath.c_str(), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, CREATE_ALWAYS, FILE_FLAG_WRITE_THROUGH, NULL);
|
|
||||||
OutputDebugStringA(logpath.c_str());
|
|
||||||
|
|
||||||
if (m_file != INVALID_HANDLE_VALUE)
|
|
||||||
PrintStamp(false);
|
|
||||||
|
|
||||||
return m_file != INVALID_HANDLE_VALUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Console(const char* title)
|
|
||||||
{
|
|
||||||
AllocConsole();
|
|
||||||
|
|
||||||
m_console = GetStdHandle(STD_OUTPUT_HANDLE);
|
|
||||||
if (m_console != INVALID_HANDLE_VALUE)
|
|
||||||
{
|
|
||||||
ShowWindow(GetConsoleWindow(), SW_MAXIMIZE);
|
|
||||||
if (title) SetConsoleTitleA(title);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_console != INVALID_HANDLE_VALUE)
|
|
||||||
PrintStamp(true);
|
|
||||||
|
|
||||||
return m_console != INVALID_HANDLE_VALUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
void Print(const char* format, va_list args)
|
|
||||||
{
|
|
||||||
bool to_console = m_console != INVALID_HANDLE_VALUE;
|
|
||||||
bool to_file = m_file != INVALID_HANDLE_VALUE;
|
|
||||||
|
|
||||||
if ((to_console || to_file) && format)
|
|
||||||
{
|
|
||||||
int outsize = _vscprintf(format, args) + 1;
|
|
||||||
std::unique_ptr<char[]> buffer(new char[outsize]);
|
|
||||||
CharArrayFromFormatV(buffer.get(), outsize, format, args);
|
|
||||||
|
|
||||||
#ifdef LOGGER_DISABLE_TIME
|
|
||||||
std::string to_print(buffer.get(), outsize - 1);
|
|
||||||
#else
|
|
||||||
std::string to_print;
|
|
||||||
GetTime(&to_print);
|
|
||||||
to_print.append(buffer.get(), outsize - 1);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
to_print.append("\r\n");
|
|
||||||
|
|
||||||
DWORD lenout = 0;
|
|
||||||
if (to_console) WriteConsoleA(m_console, to_print.c_str(), (DWORD)to_print.size(), &lenout, NULL);
|
|
||||||
if (to_file) WriteFile(m_file, to_print.c_str(), (DWORD)to_print.size(), &lenout, NULL);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
void PrintStamp(bool console)
|
|
||||||
{
|
|
||||||
static char stamp[] = "[TIME]\t\t[THREAD]\t[LOG]\r\n";
|
|
||||||
DWORD lenout = 0;
|
|
||||||
|
|
||||||
if (console) WriteConsoleA(m_console, stamp, _countof(stamp) - 1, &lenout, NULL);
|
|
||||||
else WriteFile(m_file, stamp, _countof(stamp) - 1, &lenout, NULL);
|
|
||||||
}
|
|
||||||
|
|
||||||
void GetTime(std::string* out)
|
|
||||||
{
|
|
||||||
GetLocalTime(&m_systime);
|
|
||||||
*out = StringFromFormat("%02u:%02u:%02u.%03u\t%08u\t", m_systime.wHour, m_systime.wMinute,
|
|
||||||
m_systime.wSecond, m_systime.wMilliseconds, GetCurrentThreadId());
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
SYSTEMTIME m_systime;
|
|
||||||
HANDLE m_console;
|
|
||||||
HANDLE m_file;
|
|
||||||
mutable std::mutex m_writeMutex;
|
|
||||||
};
|
|
||||||
|
|
||||||
inline void LogFile(const std::string& logname)
|
|
||||||
{
|
|
||||||
Logger::Get().File(logname);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void LogConsole(const char* title = nullptr)
|
|
||||||
{
|
|
||||||
Logger::Get().Console(title);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void PrintLog(const char* format, ...)
|
|
||||||
{
|
|
||||||
#ifndef LOGGER_DISABLE_MUTEX
|
|
||||||
const std::lock_guard<std::mutex> lock(Logger::Get().writeMutex());
|
|
||||||
#endif
|
|
||||||
va_list args;
|
|
||||||
va_start(args, format);
|
|
||||||
Logger::Get().Print(format, args);
|
|
||||||
va_end(args);
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
|
||||||
#define LogFile(logname) (logname)
|
|
||||||
#define LogConsole(title, notice) (title)
|
|
||||||
#define PrintLog(format, ...) (format)
|
|
||||||
#endif
|
|
|
@ -149,13 +149,15 @@ inline std::string CP1252ToUTF8(const std::string& input)
|
||||||
|
|
||||||
// trim from start
|
// trim from start
|
||||||
static inline std::string <rim(std::string &s) {
|
static inline std::string <rim(std::string &s) {
|
||||||
s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not_fn(std::isspace)));
|
//workaround for template deduction after including <locale>
|
||||||
|
s.erase(s.begin(), std::find_if(s.begin(), s.end(), std::not_fn([&](int i) { return std::isspace(i); })));
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
// trim from end
|
// trim from end
|
||||||
static inline std::string &rtrim(std::string &s) {
|
static inline std::string &rtrim(std::string &s) {
|
||||||
s.erase(std::find_if(s.rbegin(), s.rend(), std::not_fn(std::isspace)).base(), s.end());
|
//workaround for template deduction after including <locale>
|
||||||
|
s.erase(std::find_if(s.rbegin(), s.rend(), std::not_fn([&](int i) { return std::isspace(i); })).base(), s.end());
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
1
Deps/spdlog
Submodule
1
Deps/spdlog
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 100f30043f33277122e0991c83845a2617172ffd
|
|
@ -8,7 +8,6 @@ EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{5DB3A8C9-CF87-4AB6-A7C2-07B81A0DA625}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{5DB3A8C9-CF87-4AB6-A7C2-07B81A0DA625}"
|
||||||
ProjectSection(SolutionItems) = preProject
|
ProjectSection(SolutionItems) = preProject
|
||||||
Common\Defines.h = Common\Defines.h
|
Common\Defines.h = Common\Defines.h
|
||||||
Common\Logger.h = Common\Logger.h
|
|
||||||
Common\MemPatch.h = Common\MemPatch.h
|
Common\MemPatch.h = Common\MemPatch.h
|
||||||
Common\SimpleIni.h = Common\SimpleIni.h
|
Common\SimpleIni.h = Common\SimpleIni.h
|
||||||
Common\StringUtil.h = Common\StringUtil.h
|
Common\StringUtil.h = Common\StringUtil.h
|
||||||
|
@ -18,7 +17,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{5DB3A8
|
||||||
Common\WinVer.h = Common\WinVer.h
|
Common\WinVer.h = Common\WinVer.h
|
||||||
EndProjectSection
|
EndProjectSection
|
||||||
EndProject
|
EndProject
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "MinHook\build\VC16\libMinHook.vcxproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Deps", "Deps", "{908757C5-6B19-44A6-9C35-1F913D016F6F}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libMinHook", "Deps\MinHook\build\VC16\libMinHook.vcxproj", "{F142A341-5EE0-442D-A15F-98AE9B48DBAE}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
@ -49,7 +50,7 @@ Global
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {CC332D21-3B2D-4534-AD8E-2525081AECA5}
|
|
||||||
VisualSVNWorkingCopyRoot = .
|
VisualSVNWorkingCopyRoot = .
|
||||||
|
SolutionGuid = {CC332D21-3B2D-4534-AD8E-2525081AECA5}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
EndGlobal
|
EndGlobal
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
|
||||||
#include "Logger.h"
|
|
||||||
#include "MemPatch.h"
|
#include "MemPatch.h"
|
||||||
|
|
||||||
#include "Context.h"
|
#include "Context.h"
|
||||||
|
@ -9,12 +8,13 @@
|
||||||
void MainContext::EnableAutoFix()
|
void MainContext::EnableAutoFix()
|
||||||
{
|
{
|
||||||
std::string exe_name = ModuleNameA(NULL);
|
std::string exe_name = ModuleNameA(NULL);
|
||||||
std::transform(exe_name.begin(), exe_name.end(), exe_name.begin(), std::tolower);
|
//workaround for template deduction after including <locale>
|
||||||
|
std::transform(exe_name.begin(), exe_name.end(), exe_name.begin(), [&](int i) { return std::tolower(i); });
|
||||||
|
|
||||||
if (exe_name == "ffxiiiimg.exe")
|
if (exe_name == "ffxiiiimg.exe")
|
||||||
{
|
{
|
||||||
autofix = AutoFixes::FINAL_FANTASY_XIII;
|
autofix = AutoFixes::FINAL_FANTASY_XIII;
|
||||||
PrintLog("AutoFix for \"Final Fantasy XIII\" enabled");
|
spdlog::info("AutoFix for \"Final Fantasy XIII\" enabled");
|
||||||
FF13_InitializeGameAddresses();
|
FF13_InitializeGameAddresses();
|
||||||
FF13_HandleLargeAddressAwarePatch();
|
FF13_HandleLargeAddressAwarePatch();
|
||||||
}
|
}
|
||||||
|
@ -22,7 +22,7 @@ void MainContext::EnableAutoFix()
|
||||||
if (exe_name == "ffxiii2img.exe")
|
if (exe_name == "ffxiii2img.exe")
|
||||||
{
|
{
|
||||||
autofix = AutoFixes::FINAL_FANTASY_XIII2;
|
autofix = AutoFixes::FINAL_FANTASY_XIII2;
|
||||||
PrintLog("AutoFix for \"Final Fantasy XIII-2\" enabled");
|
spdlog::info("AutoFix for \"Final Fantasy XIII-2\" enabled");
|
||||||
FF13_2_InitializeGameAddresses();
|
FF13_2_InitializeGameAddresses();
|
||||||
FF13_2_CreateSetFrameRateCodeBlock();
|
FF13_2_CreateSetFrameRateCodeBlock();
|
||||||
}
|
}
|
||||||
|
@ -43,7 +43,7 @@ const std::map<const MainContext::AutoFixes, const uint32_t> MainContext::behavi
|
||||||
HANDLE WINAPI MainContext::HookCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) {
|
HANDLE WINAPI MainContext::HookCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile) {
|
||||||
const char* ffxiiiimgPrt = strstr(lpFileName, "ffxiiiimg.exe");
|
const char* ffxiiiimgPrt = strstr(lpFileName, "ffxiiiimg.exe");
|
||||||
if (ffxiiiimgPrt) {
|
if (ffxiiiimgPrt) {
|
||||||
PrintLog("HookCreateFileA Before Replacement: %s", lpFileName);
|
spdlog::info("HookCreateFileA Before Replacement: {}", lpFileName);
|
||||||
|
|
||||||
int arrayPosition = ffxiiiimgPrt - lpFileName;
|
int arrayPosition = ffxiiiimgPrt - lpFileName;
|
||||||
int len = strlen(lpFileName);
|
int len = strlen(lpFileName);
|
||||||
|
@ -52,17 +52,17 @@ HANDLE WINAPI MainContext::HookCreateFileA(LPCSTR lpFileName, DWORD dwDesiredAcc
|
||||||
const char* untouched = "untouched"; // needs to have the size of "ffxiiiimg"
|
const char* untouched = "untouched"; // needs to have the size of "ffxiiiimg"
|
||||||
|
|
||||||
memcpy(newFileName + arrayPosition, untouched, strlen(untouched));
|
memcpy(newFileName + arrayPosition, untouched, strlen(untouched));
|
||||||
PrintLog("HookCreateFileA After Replacement: %s", newFileName);
|
spdlog::info("HookCreateFileA After Replacement: {}", newFileName);
|
||||||
MH_STATUS disableHookCreateFileA = MH_DisableHook(CreateFileA);
|
MH_STATUS disableHookCreateFileA = MH_DisableHook(CreateFileA);
|
||||||
PrintLog("disableHookCreateFileA = %d", disableHookCreateFileA);
|
spdlog::info("disableHookCreateFileA = {}", disableHookCreateFileA);
|
||||||
MH_STATUS disableHookCreateFileW = MH_DisableHook(CreateFileW);
|
MH_STATUS disableHookCreateFileW = MH_DisableHook(CreateFileW);
|
||||||
PrintLog("disableHookCreateFileW = %d", disableHookCreateFileW);
|
spdlog::info("disableHookCreateFileW = {}", disableHookCreateFileW);
|
||||||
if (GetFileAttributesA(newFileName) == INVALID_FILE_ATTRIBUTES) {
|
if (GetFileAttributesA(newFileName) == INVALID_FILE_ATTRIBUTES) {
|
||||||
PrintLog("ERROR: Unable to get attributes of %s. Does the file exist? Using the regular ffxiiiimg.exe", newFileName);
|
spdlog::info("ERROR: Unable to get attributes of {}. Does the file exist? Using the regular ffxiiiimg.exe", newFileName);
|
||||||
strcpy_s(newFileName, len + 1, lpFileName);
|
strcpy_s(newFileName, len + 1, lpFileName);
|
||||||
}
|
}
|
||||||
HANDLE fileHandle = context.TrueCreateFileA(newFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);;
|
HANDLE fileHandle = context.TrueCreateFileA(newFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);;
|
||||||
PrintLog("Returning File Handle for %s", newFileName);
|
spdlog::info("Returning File Handle for {}", newFileName);
|
||||||
delete[] newFileName;
|
delete[] newFileName;
|
||||||
return fileHandle;
|
return fileHandle;
|
||||||
}
|
}
|
||||||
|
@ -75,7 +75,7 @@ HANDLE WINAPI MainContext::HookCreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAc
|
||||||
const wchar_t* ffxiiiimgPrt = wcsstr(lpFileName, L"ffxiiiimg.exe");;
|
const wchar_t* ffxiiiimgPrt = wcsstr(lpFileName, L"ffxiiiimg.exe");;
|
||||||
|
|
||||||
if (ffxiiiimgPrt) {
|
if (ffxiiiimgPrt) {
|
||||||
PrintLog("HookCreateFileW Before Replacement: %s", lpFileName);
|
spdlog::info(L"HookCreateFileW Before Replacement: {}", lpFileName);
|
||||||
|
|
||||||
int arrayPosition = ffxiiiimgPrt - lpFileName;
|
int arrayPosition = ffxiiiimgPrt - lpFileName;
|
||||||
int len = wcslen(lpFileName);
|
int len = wcslen(lpFileName);
|
||||||
|
@ -83,17 +83,17 @@ HANDLE WINAPI MainContext::HookCreateFileW(LPCWSTR lpFileName, DWORD dwDesiredAc
|
||||||
wcscpy_s(newFileName, len + 1, lpFileName);
|
wcscpy_s(newFileName, len + 1, lpFileName);
|
||||||
const wchar_t* untouched = L"untouched"; //needs to have the size of L"ffxiiiimg"
|
const wchar_t* untouched = L"untouched"; //needs to have the size of L"ffxiiiimg"
|
||||||
wmemcpy(newFileName + arrayPosition, untouched, wcslen(untouched));
|
wmemcpy(newFileName + arrayPosition, untouched, wcslen(untouched));
|
||||||
PrintLog("HookCreateFileW After Replacement: %s", newFileName);
|
spdlog::info(L"HookCreateFileW After Replacement: {}", newFileName);
|
||||||
MH_STATUS disableHookCreateFileA = MH_DisableHook(CreateFileA);
|
MH_STATUS disableHookCreateFileA = MH_DisableHook(CreateFileA);
|
||||||
PrintLog("disableHookCreateFileA = %d", disableHookCreateFileA);
|
spdlog::info("disableHookCreateFileA = {}", disableHookCreateFileA);
|
||||||
MH_STATUS disableHookCreateFileW = MH_DisableHook(CreateFileW);
|
MH_STATUS disableHookCreateFileW = MH_DisableHook(CreateFileW);
|
||||||
PrintLog("disableHookCreateFileW = %d", disableHookCreateFileW);
|
spdlog::info("disableHookCreateFileW = {}", disableHookCreateFileW);
|
||||||
if (GetFileAttributesW(newFileName) == INVALID_FILE_ATTRIBUTES) {
|
if (GetFileAttributesW(newFileName) == INVALID_FILE_ATTRIBUTES) {
|
||||||
PrintLog("ERROR: Unable to get attributes of %s. Does the file exist?", newFileName);
|
spdlog::info(L"ERROR: Unable to get attributes of {}. Does the file exist?", newFileName);
|
||||||
wcscpy_s(newFileName, len + 1, lpFileName);
|
wcscpy_s(newFileName, len + 1, lpFileName);
|
||||||
}
|
}
|
||||||
HANDLE fileHandle = context.TrueCreateFileW(newFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);;
|
HANDLE fileHandle = context.TrueCreateFileW(newFileName, dwDesiredAccess, dwShareMode, lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes, hTemplateFile);;
|
||||||
PrintLog("Returning File Handle %s", newFileName);
|
spdlog::info(L"Returning File Handle {}", newFileName);
|
||||||
delete[] newFileName;
|
delete[] newFileName;
|
||||||
return fileHandle;
|
return fileHandle;
|
||||||
}
|
}
|
||||||
|
@ -223,15 +223,15 @@ void MainContext::Fix_Thread()
|
||||||
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
|
std::this_thread::sleep_for(std::chrono::milliseconds(2000));
|
||||||
auto end = std::chrono::high_resolution_clock::now();
|
auto end = std::chrono::high_resolution_clock::now();
|
||||||
std::chrono::duration<double, std::milli> elapsed = end - start;
|
std::chrono::duration<double, std::milli> elapsed = end - start;
|
||||||
PrintLog("Waited %f ms", elapsed.count());
|
spdlog::info("Waited {} ms", elapsed.count());
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(context.fix_mutex);
|
std::lock_guard<std::mutex> lock(context.fix_mutex);
|
||||||
if (context.autofix == AutoFixes::FINAL_FANTASY_XIII) {
|
if (context.autofix == AutoFixes::FINAL_FANTASY_XIII) {
|
||||||
PrintLog("Starting FFXIII one time RAM patches.");
|
spdlog::info("Starting FFXIII one time RAM patches.");
|
||||||
context.FF13_OneTimeFixes();
|
context.FF13_OneTimeFixes();
|
||||||
}
|
}
|
||||||
else if (context.autofix == AutoFixes::FINAL_FANTASY_XIII2) {
|
else if (context.autofix == AutoFixes::FINAL_FANTASY_XIII2) {
|
||||||
PrintLog("Starting FFXIII-2 one time RAM patches.");
|
spdlog::info("Starting FFXIII-2 one time RAM patches.");
|
||||||
context.FF13_2_OneTimeFixes();
|
context.FF13_2_OneTimeFixes();
|
||||||
}
|
}
|
||||||
MessageBeep(MB_ICONASTERISK);
|
MessageBeep(MB_ICONASTERISK);
|
||||||
|
@ -241,7 +241,7 @@ void MainContext::FF13_InitializeGameAddresses()
|
||||||
{
|
{
|
||||||
// FF13 always seem to use the same addresses (even if you force ASLR on the OS), but we are calculating the addresses just in case...
|
// FF13 always seem to use the same addresses (even if you force ASLR on the OS), but we are calculating the addresses just in case...
|
||||||
uint8_t* baseAddr = (uint8_t*)GetModuleHandle(NULL); // Should be 400000
|
uint8_t* baseAddr = (uint8_t*)GetModuleHandle(NULL); // Should be 400000
|
||||||
PrintLog("Base Addr = %x", baseAddr);
|
spdlog::info("Base Addr = {}", (void*)baseAddr);
|
||||||
|
|
||||||
ff13_frame_pacer_ptr = (float**)(baseAddr + 0x243E34C);
|
ff13_frame_pacer_ptr = (float**)(baseAddr + 0x243E34C);
|
||||||
ff13_set_framerate_ingame_instruction_address = baseAddr + 0xA8D65F;
|
ff13_set_framerate_ingame_instruction_address = baseAddr + 0xA8D65F;
|
||||||
|
@ -270,30 +270,30 @@ void MainContext::FF13_InitializeGameAddresses()
|
||||||
void MainContext::FF13_HandleLargeAddressAwarePatch() {
|
void MainContext::FF13_HandleLargeAddressAwarePatch() {
|
||||||
const uint8_t laaMask = 0x20;
|
const uint8_t laaMask = 0x20;
|
||||||
if (*ff13_exe_large_address_aware_flag_address & laaMask) {
|
if (*ff13_exe_large_address_aware_flag_address & laaMask) {
|
||||||
PrintLog("LargeAddressAwarePatch found. ff13_exe_large_address_aware_flag = 0x%02x; ff13_exe_checksum = 0x%08x", *ff13_exe_large_address_aware_flag_address, *ff13_exe_checksum_address);
|
spdlog::info("LargeAddressAwarePatch found. ff13_exe_large_address_aware_flag = {:X}; ff13_exe_checksum = {:X}", *ff13_exe_large_address_aware_flag_address, *ff13_exe_checksum_address);
|
||||||
|
|
||||||
const MH_STATUS createHookCreateFileA = MH_CreateHook(CreateFileA, HookCreateFileA, reinterpret_cast<void**>(&TrueCreateFileA));
|
const MH_STATUS createHookCreateFileA = MH_CreateHook(CreateFileA, HookCreateFileA, reinterpret_cast<void**>(&TrueCreateFileA));
|
||||||
PrintLog("createHookCreateFileA = %d", createHookCreateFileA);
|
spdlog::info("createHookCreateFileA = {}", createHookCreateFileA);
|
||||||
const MH_STATUS enableHookCreateFileA = MH_EnableHook(CreateFileA);
|
const MH_STATUS enableHookCreateFileA = MH_EnableHook(CreateFileA);
|
||||||
PrintLog("enableHookCreateFileA = %d", enableHookCreateFileA);
|
spdlog::info("enableHookCreateFileA = {}", enableHookCreateFileA);
|
||||||
|
|
||||||
const MH_STATUS createHookCreateFileW = MH_CreateHook(CreateFileW, HookCreateFileW, reinterpret_cast<void**>(&TrueCreateFileW));
|
const MH_STATUS createHookCreateFileW = MH_CreateHook(CreateFileW, HookCreateFileW, reinterpret_cast<void**>(&TrueCreateFileW));
|
||||||
PrintLog("createHookCreateFileW = %d", createHookCreateFileW);
|
spdlog::info("createHookCreateFileW = {}", createHookCreateFileW);
|
||||||
const MH_STATUS enableHookCreateFileW = MH_EnableHook(CreateFileW);
|
const MH_STATUS enableHookCreateFileW = MH_EnableHook(CreateFileW);
|
||||||
PrintLog("enableHookCreateFileW = %d", enableHookCreateFileW);
|
spdlog::info("enableHookCreateFileW = {}", enableHookCreateFileW);
|
||||||
|
|
||||||
uint8_t new_ff13_exe_large_address_aware_flag = *ff13_exe_large_address_aware_flag_address & ~laaMask;
|
uint8_t new_ff13_exe_large_address_aware_flag = *ff13_exe_large_address_aware_flag_address & ~laaMask;
|
||||||
MemPatch::Patch(ff13_exe_large_address_aware_flag_address, &new_ff13_exe_large_address_aware_flag, 1);
|
MemPatch::Patch(ff13_exe_large_address_aware_flag_address, &new_ff13_exe_large_address_aware_flag, 1);
|
||||||
PrintLog("LargeAddressAware patched back. ff13_exe_large_address_aware_flag = 0x%02x;", *ff13_exe_large_address_aware_flag_address);
|
spdlog::info("LargeAddressAware patched back. ff13_exe_large_address_aware_flag = {:X};", *ff13_exe_large_address_aware_flag_address);
|
||||||
|
|
||||||
uint32_t new_ff13_exe_checksum = 0;
|
uint32_t new_ff13_exe_checksum = 0;
|
||||||
MemPatch::Patch(ff13_exe_checksum_address, &new_ff13_exe_checksum, sizeof(uint32_t));
|
MemPatch::Patch(ff13_exe_checksum_address, &new_ff13_exe_checksum, sizeof(uint32_t));
|
||||||
PrintLog("Checksum patched back. ff13_exe_checksum = 0x%08x", *ff13_exe_checksum_address);
|
spdlog::info("Checksum patched back. ff13_exe_checksum = {:X}", *ff13_exe_checksum_address);
|
||||||
|
|
||||||
PrintLog("LargeAddressAwarePatch handled");
|
spdlog::info("LargeAddressAwarePatch handled");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PrintLog("LargeAddressAwarePatch not found.");
|
spdlog::info("LargeAddressAwarePatch not found.");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -319,12 +319,12 @@ void MainContext::FF13_OneTimeFixes() {
|
||||||
FF13_SetFrameRateVariables();
|
FF13_SetFrameRateVariables();
|
||||||
AdjustVertexData(*ff13_internal_res_w, *ff13_internal_res_h);
|
AdjustVertexData(*ff13_internal_res_w, *ff13_internal_res_h);
|
||||||
|
|
||||||
PrintLog("Finished FF13 One Time Fixes");
|
spdlog::info("Finished FF13 One Time Fixes");
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainContext::FF13_PatchMessageBox()
|
void MainContext::FF13_PatchMessageBox()
|
||||||
{
|
{
|
||||||
PrintLog("Removing 'Quit game' textbox");
|
spdlog::info("Removing 'Quit game' textbox");
|
||||||
|
|
||||||
MemPatch::Nop(ff13_message_box_stack_push_address, 1);
|
MemPatch::Nop(ff13_message_box_stack_push_address, 1);
|
||||||
MemPatch::Nop(ff13_message_box_stack_push_address + 1 * 4, 1);
|
MemPatch::Nop(ff13_message_box_stack_push_address + 1 * 4, 1);
|
||||||
|
@ -336,14 +336,14 @@ void MainContext::FF13_PatchMessageBox()
|
||||||
void MainContext::FF13_EnableControllerVibration()
|
void MainContext::FF13_EnableControllerVibration()
|
||||||
{
|
{
|
||||||
if (!config.GetFFXIIIEnableControllerVibration()) {
|
if (!config.GetFFXIIIEnableControllerVibration()) {
|
||||||
PrintLog("Vibration should not be enabled (config file)");
|
spdlog::info("Vibration should not be enabled (config file)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!config.GetFFXIIIDisableIngameControllerHotSwapping()) {
|
if (!config.GetFFXIIIDisableIngameControllerHotSwapping()) {
|
||||||
PrintLog("Vibration disabled because FFXIIIDisableIngameControllerHotSwapping is set to false (config file)");
|
spdlog::info("Vibration disabled because FFXIIIDisableIngameControllerHotSwapping is set to false (config file)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PrintLog("Enabling controller vibration...");
|
spdlog::info("Enabling controller vibration...");
|
||||||
MemPatch::Nop(ff13_vibration_low_set_zero_address, 5);
|
MemPatch::Nop(ff13_vibration_low_set_zero_address, 5);
|
||||||
MemPatch::Nop(ff13_vibration_high_set_zero_address, 5);
|
MemPatch::Nop(ff13_vibration_high_set_zero_address, 5);
|
||||||
|
|
||||||
|
@ -353,19 +353,19 @@ void MainContext::FF13_EnableControllerVibration()
|
||||||
void MainContext::FF13_RemoveContinuousControllerScan()
|
void MainContext::FF13_RemoveContinuousControllerScan()
|
||||||
{
|
{
|
||||||
if (!config.GetFFXIIIDisableIngameControllerHotSwapping()) {
|
if (!config.GetFFXIIIDisableIngameControllerHotSwapping()) {
|
||||||
PrintLog("Continuous controller scanning not disabled (config)");
|
spdlog::info("Continuous controller scanning not disabled (config)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Disable continuous controller scanning.
|
// Disable continuous controller scanning.
|
||||||
|
|
||||||
PrintLog("Removing game slow and synchronous controller continuous controller scanning...");
|
spdlog::info("Removing game slow and synchronous controller continuous controller scanning...");
|
||||||
// change a jne to jmp
|
// change a jne to jmp
|
||||||
MemPatch::Fill(ff13_continuous_scan_instruction_address, 0xEB, 1);
|
MemPatch::Fill(ff13_continuous_scan_instruction_address, 0xEB, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainContext::FF13_FixScissorRect()
|
void MainContext::FF13_FixScissorRect()
|
||||||
{
|
{
|
||||||
PrintLog("Fixing ScissorRect...");
|
spdlog::info("Fixing ScissorRect...");
|
||||||
const float originalWidth = 1280.0F;
|
const float originalWidth = 1280.0F;
|
||||||
const float resolutionFactorW = (float)*ff13_internal_res_w / originalWidth;
|
const float resolutionFactorW = (float)*ff13_internal_res_w / originalWidth;
|
||||||
scissor_scaling_factor_w = resolutionFactorW;
|
scissor_scaling_factor_w = resolutionFactorW;
|
||||||
|
@ -390,7 +390,7 @@ void MainContext::FF13_FixScissorRect()
|
||||||
|
|
||||||
void MainContext::FF13_NOPIngameFrameRateLimitSetter()
|
void MainContext::FF13_NOPIngameFrameRateLimitSetter()
|
||||||
{
|
{
|
||||||
PrintLog("NOPing the in-game instruction that sets the frame rate.");
|
spdlog::info("NOPing the in-game instruction that sets the frame rate.");
|
||||||
MemPatch::Nop(ff13_set_framerate_ingame_instruction_address, 5);
|
MemPatch::Nop(ff13_set_framerate_ingame_instruction_address, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -398,11 +398,11 @@ void MainContext::FF13_SetFrameRateVariables()
|
||||||
{
|
{
|
||||||
float* framePacerTargetPtr = *ff13_frame_pacer_ptr;
|
float* framePacerTargetPtr = *ff13_frame_pacer_ptr;
|
||||||
if (framePacerTargetPtr) {
|
if (framePacerTargetPtr) {
|
||||||
PrintLog("Frame pacer target frame rate is at address %x", framePacerTargetPtr);
|
spdlog::info("Frame pacer target frame rate is at address {}", (void*)framePacerTargetPtr);
|
||||||
|
|
||||||
float* ingameFrameRateFramePacerTarget = framePacerTargetPtr;
|
float* ingameFrameRateFramePacerTarget = framePacerTargetPtr;
|
||||||
*ingameFrameRateFramePacerTarget = MAX_FRAME_RATE_LIMIT;
|
*ingameFrameRateFramePacerTarget = MAX_FRAME_RATE_LIMIT;
|
||||||
PrintLog("Frame pacer disabled.");
|
spdlog::info("Frame pacer disabled.");
|
||||||
|
|
||||||
if (config.GetFFXIIIIngameFrameRateLimit() != 0)
|
if (config.GetFFXIIIIngameFrameRateLimit() != 0)
|
||||||
{
|
{
|
||||||
|
@ -418,11 +418,10 @@ void MainContext::FF13_SetFrameRateVariables()
|
||||||
|
|
||||||
float* ingameFrameRateLimitPtr = framePacerTargetPtr + 1;
|
float* ingameFrameRateLimitPtr = framePacerTargetPtr + 1;
|
||||||
*ingameFrameRateLimitPtr = frameRateLimit;
|
*ingameFrameRateLimitPtr = frameRateLimit;
|
||||||
PrintLog("Target frame rate set to %f", frameRateLimit);
|
spdlog::info("Target frame rate set to {}", frameRateLimit); }
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PrintLog("Unable to find frame pacer / frame rate address. This shouldn't happen! Report this.");
|
spdlog::info("Unable to find frame pacer / frame rate address. This shouldn't happen! Report this.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,22 +434,22 @@ void MainContext::FF13_2_OneTimeFixes()
|
||||||
|
|
||||||
if (*ff13_2_frame_pacer_ptr_address) {
|
if (*ff13_2_frame_pacer_ptr_address) {
|
||||||
**ff13_2_frame_pacer_ptr_address = MAX_FRAME_RATE_LIMIT;
|
**ff13_2_frame_pacer_ptr_address = MAX_FRAME_RATE_LIMIT;
|
||||||
PrintLog("Frame pacer disabled");
|
spdlog::info("Frame pacer disabled");
|
||||||
|
|
||||||
FF13_2_AddHookIngameFrameRateLimitSetter();
|
FF13_2_AddHookIngameFrameRateLimitSetter();
|
||||||
FF13_2_RemoveContinuousControllerScan();
|
FF13_2_RemoveContinuousControllerScan();
|
||||||
FF13_2_EnableControllerVibration();
|
FF13_2_EnableControllerVibration();
|
||||||
AdjustVertexData(*ff13_2_internal_res_w, *ff13_2_internal_res_h);
|
AdjustVertexData(*ff13_2_internal_res_w, *ff13_2_internal_res_h);
|
||||||
PrintLog("Finished FF13-2 One Time Fixes");
|
spdlog::info("Finished FF13-2 One Time Fixes");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
PrintLog("Unable to apply FF13-2 One Time Fixes. Report this!");
|
spdlog::info("Unable to apply FF13-2 One Time Fixes. Report this!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainContext::FF13_2_PatchMessageBox()
|
void MainContext::FF13_2_PatchMessageBox()
|
||||||
{
|
{
|
||||||
PrintLog("Removing 'Quit game' textbox");
|
spdlog::info("Removing 'Quit game' textbox");
|
||||||
|
|
||||||
// NOP push of registers to call MessageBox
|
// NOP push of registers to call MessageBox
|
||||||
MemPatch::Nop(ff13_2_message_box_stack_push_address, 5);
|
MemPatch::Nop(ff13_2_message_box_stack_push_address, 5);
|
||||||
|
@ -475,10 +474,10 @@ void MainContext::PatchMessageBoxCall(uint8_t* callInstructionAddress)
|
||||||
void MainContext::FF13_2_EnableControllerVibration()
|
void MainContext::FF13_2_EnableControllerVibration()
|
||||||
{
|
{
|
||||||
if (!config.GetFFXIIIEnableControllerVibration()) {
|
if (!config.GetFFXIIIEnableControllerVibration()) {
|
||||||
PrintLog("Vibration should not be enabled (config file)");
|
spdlog::info("Vibration should not be enabled (config file)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
PrintLog("Enabling controller vibration...");
|
spdlog::info("Enabling controller vibration...");
|
||||||
|
|
||||||
MemPatch::Nop(ff13_2_vibration_low_set_zero_address, 5);
|
MemPatch::Nop(ff13_2_vibration_low_set_zero_address, 5);
|
||||||
MemPatch::Nop(ff13_2_vibration_high_set_zero_address, 5);
|
MemPatch::Nop(ff13_2_vibration_high_set_zero_address, 5);
|
||||||
|
@ -501,7 +500,7 @@ void MainContext::FF13_2_InitializeGameAddresses()
|
||||||
{
|
{
|
||||||
// FF13-2 uses address space layout randomization (ASLR) so we can't rely on fixed addresses without considering the base address
|
// FF13-2 uses address space layout randomization (ASLR) so we can't rely on fixed addresses without considering the base address
|
||||||
uint8_t* baseAddr = (uint8_t*)GetModuleHandle(NULL);
|
uint8_t* baseAddr = (uint8_t*)GetModuleHandle(NULL);
|
||||||
PrintLog("Base Addr = %x", baseAddr);
|
spdlog::info("Base Addr = {}", (void*)baseAddr);
|
||||||
|
|
||||||
ff13_2_continuous_scan_instruction_address = baseAddr + 0x2A6E7F;
|
ff13_2_continuous_scan_instruction_address = baseAddr + 0x2A6E7F;
|
||||||
ff13_2_set_frame_rate_address = baseAddr + 0x802616;
|
ff13_2_set_frame_rate_address = baseAddr + 0x802616;
|
||||||
|
@ -518,12 +517,12 @@ void MainContext::FF13_2_InitializeGameAddresses()
|
||||||
void MainContext::FF13_2_RemoveContinuousControllerScan()
|
void MainContext::FF13_2_RemoveContinuousControllerScan()
|
||||||
{
|
{
|
||||||
if (!config.GetFFXIIIDisableIngameControllerHotSwapping()) {
|
if (!config.GetFFXIIIDisableIngameControllerHotSwapping()) {
|
||||||
PrintLog("Continuous controller scanning not disabled (config)");
|
spdlog::info("Continuous controller scanning not disabled (config)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// Disable continuous controller scanning.
|
// Disable continuous controller scanning.
|
||||||
|
|
||||||
PrintLog("Removing game slow and synchronous controller continuous controller scanning...");
|
spdlog::info("Removing game slow and synchronous controller continuous controller scanning...");
|
||||||
// change a jne to jmp
|
// change a jne to jmp
|
||||||
MemPatch::Fill(ff13_2_continuous_scan_instruction_address, 0xEB, 1);
|
MemPatch::Fill(ff13_2_continuous_scan_instruction_address, 0xEB, 1);
|
||||||
}
|
}
|
||||||
|
@ -531,11 +530,11 @@ void MainContext::FF13_2_RemoveContinuousControllerScan()
|
||||||
void MainContext::FF13_2_AddHookIngameFrameRateLimitSetter()
|
void MainContext::FF13_2_AddHookIngameFrameRateLimitSetter()
|
||||||
{
|
{
|
||||||
if (config.GetFFXIIIIngameFrameRateLimit() == 0) {
|
if (config.GetFFXIIIIngameFrameRateLimit() == 0) {
|
||||||
PrintLog("Frame rate should not be changed (config = 0)");
|
spdlog::info("Frame rate should not be changed (config = 0)");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintLog("Hooking the instruction that sets the frame rate...");
|
spdlog::info("Hooking the instruction that sets the frame rate...");
|
||||||
|
|
||||||
MemPatch::CUnprotect unp(ff13_2_set_frame_rate_address, 5);
|
MemPatch::CUnprotect unp(ff13_2_set_frame_rate_address, 5);
|
||||||
|
|
||||||
|
@ -549,7 +548,7 @@ void MainContext::FF13_2_CreateSetFrameRateCodeBlock()
|
||||||
const int blockSize = 31;
|
const int blockSize = 31;
|
||||||
FF13_2_SET_FRAME_RATE_INJECTED_CODE = new(std::nothrow) uint8_t[blockSize];
|
FF13_2_SET_FRAME_RATE_INJECTED_CODE = new(std::nothrow) uint8_t[blockSize];
|
||||||
if (!FF13_2_SET_FRAME_RATE_INJECTED_CODE) {
|
if (!FF13_2_SET_FRAME_RATE_INJECTED_CODE) {
|
||||||
PrintLog("Failed to initialize FFXIII-2 code block");
|
spdlog::info("Failed to initialize FFXIII-2 code block");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DWORD oldProtect;
|
DWORD oldProtect;
|
||||||
|
@ -566,7 +565,7 @@ void MainContext::FF13_2_CreateSetFrameRateCodeBlock()
|
||||||
ff13_2_targetFrameRate = (float)std::min(frameRateConfig, (s32)FF13_2_MAX_FRAME_CAP);
|
ff13_2_targetFrameRate = (float)std::min(frameRateConfig, (s32)FF13_2_MAX_FRAME_CAP);
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintLog("Target frame rate set to %f", ff13_2_targetFrameRate);
|
spdlog::info("Target frame rate set to {}", ff13_2_targetFrameRate);
|
||||||
}
|
}
|
||||||
|
|
||||||
// movss xmm1,[&FF13_2_30_FPS]
|
// movss xmm1,[&FF13_2_30_FPS]
|
||||||
|
@ -606,5 +605,5 @@ void MainContext::FF13_2_CreateSetFrameRateCodeBlock()
|
||||||
}
|
}
|
||||||
|
|
||||||
void MainContext::PrintVersionInfo() {
|
void MainContext::PrintVersionInfo() {
|
||||||
PrintLog("FF13Fix 1.6.4 https://github.com/rebtd7/FF13Fix");
|
spdlog::info("FF13Fix 1.6.5 https://github.com/rebtd7/FF13Fix");
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,9 +3,6 @@
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include <array>
|
#include <array>
|
||||||
|
|
||||||
|
|
||||||
#include "Logger.h"
|
|
||||||
|
|
||||||
#include "MinHook.h"
|
#include "MinHook.h"
|
||||||
#include "SimpleIni.h"
|
#include "SimpleIni.h"
|
||||||
|
|
||||||
|
@ -48,42 +45,53 @@ Config::Config()
|
||||||
|
|
||||||
MainContext::MainContext()
|
MainContext::MainContext()
|
||||||
{
|
{
|
||||||
LogFile("FF13Fix.log");
|
std::string logfilename = FullPathFromPath("FF13Fix.log");
|
||||||
|
auto file_logger = spdlog::basic_logger_mt("file_logger", logfilename, true);
|
||||||
|
spdlog::set_default_logger(file_logger);
|
||||||
|
|
||||||
|
//[2014-10-31 23:46:59.678] [thread] [level] Some message
|
||||||
|
spdlog::set_pattern("[%Y-%m-%d %T.%e] [%6t] [%l] %v");
|
||||||
|
spdlog::set_level(static_cast<spdlog::level::level_enum>(config.GetLogLogLevel()));
|
||||||
|
spdlog::flush_on(spdlog::level::err); // trigger flush whenever errors or more severe messages are logged
|
||||||
|
|
||||||
|
if(config.GetLogLogFlush())
|
||||||
|
spdlog::flush_on(spdlog::level::trace); // trigger flush whenever trace or more severe messages are logged => always
|
||||||
|
|
||||||
context.PrintVersionInfo();
|
context.PrintVersionInfo();
|
||||||
|
|
||||||
PrintLog("Enabling hooks:");
|
spdlog::info("Enabling hooks:");
|
||||||
const MH_STATUS initializeHooks = MH_Initialize();
|
const MH_STATUS initializeHooks = MH_Initialize();
|
||||||
PrintLog("initializeHooks = %d", initializeHooks);
|
spdlog::info("initializeHooks = {}", initializeHooks);
|
||||||
|
|
||||||
const MH_STATUS createHookDirect3DCreate9 = MH_CreateHook(D3D9DLL::Get().Direct3DCreate9, HookDirect3DCreate9, reinterpret_cast<void**>(&TrueDirect3DCreate9));
|
const MH_STATUS createHookDirect3DCreate9 = MH_CreateHook(D3D9DLL::Get().Direct3DCreate9, HookDirect3DCreate9, reinterpret_cast<void**>(&TrueDirect3DCreate9));
|
||||||
PrintLog("createHookDirect3DCreate9 = %d", createHookDirect3DCreate9);
|
spdlog::info("createHookDirect3DCreate9 = {}", createHookDirect3DCreate9);
|
||||||
const MH_STATUS enableHookDirect3DCreate9 = MH_EnableHook(D3D9DLL::Get().Direct3DCreate9);
|
const MH_STATUS enableHookDirect3DCreate9 = MH_EnableHook(D3D9DLL::Get().Direct3DCreate9);
|
||||||
PrintLog("enableHookDirect3DCreate9 = %d", enableHookDirect3DCreate9);
|
spdlog::info("enableHookDirect3DCreate9 = {}", enableHookDirect3DCreate9);
|
||||||
|
|
||||||
const MH_STATUS createHookDirect3DCreate9Ex = MH_CreateHook(D3D9DLL::Get().Direct3DCreate9Ex, HookDirect3DCreate9Ex, reinterpret_cast<void**>(&TrueDirect3DCreate9Ex));
|
const MH_STATUS createHookDirect3DCreate9Ex = MH_CreateHook(D3D9DLL::Get().Direct3DCreate9Ex, HookDirect3DCreate9Ex, reinterpret_cast<void**>(&TrueDirect3DCreate9Ex));
|
||||||
PrintLog("createHookDirect3DCreate9Ex = %d", createHookDirect3DCreate9Ex);
|
spdlog::info("createHookDirect3DCreate9Ex = {}", createHookDirect3DCreate9Ex);
|
||||||
const MH_STATUS enableHookDirect3DCreate9Ex = MH_EnableHook(D3D9DLL::Get().Direct3DCreate9Ex);
|
const MH_STATUS enableHookDirect3DCreate9Ex = MH_EnableHook(D3D9DLL::Get().Direct3DCreate9Ex);
|
||||||
PrintLog("enableHookDirect3DCreate9Ex = %d", enableHookDirect3DCreate9Ex);
|
spdlog::info("enableHookDirect3DCreate9Ex = {}", enableHookDirect3DCreate9Ex);
|
||||||
|
|
||||||
const MH_STATUS createHookCreateWindowExA = MH_CreateHook(CreateWindowExA, HookCreateWindowExA, reinterpret_cast<void**>(&TrueCreateWindowExA));
|
const MH_STATUS createHookCreateWindowExA = MH_CreateHook(CreateWindowExA, HookCreateWindowExA, reinterpret_cast<void**>(&TrueCreateWindowExA));
|
||||||
PrintLog("createHookCreateWindowExA = %d", createHookCreateWindowExA);
|
spdlog::info("createHookCreateWindowExA = {}", createHookCreateWindowExA);
|
||||||
const MH_STATUS enableHookCreateWindowExA = MH_EnableHook(CreateWindowExA);
|
const MH_STATUS enableHookCreateWindowExA = MH_EnableHook(CreateWindowExA);
|
||||||
PrintLog("enableHookCreateWindowExA = %d", enableHookCreateWindowExA);
|
spdlog::info("enableHookCreateWindowExA = {}", enableHookCreateWindowExA);
|
||||||
|
|
||||||
const MH_STATUS createHookCreateWindowExW = MH_CreateHook(CreateWindowExW, HookCreateWindowExW, reinterpret_cast<void**>(&TrueCreateWindowExW));
|
const MH_STATUS createHookCreateWindowExW = MH_CreateHook(CreateWindowExW, HookCreateWindowExW, reinterpret_cast<void**>(&TrueCreateWindowExW));
|
||||||
PrintLog("createHookCreateWindowExW = %d", createHookCreateWindowExW);
|
spdlog::info("createHookCreateWindowExW = {}", createHookCreateWindowExW);
|
||||||
const MH_STATUS enableHookCreateWindowExW = MH_EnableHook(CreateWindowExW);
|
const MH_STATUS enableHookCreateWindowExW = MH_EnableHook(CreateWindowExW);
|
||||||
PrintLog("enableHookCreateWindowExW = %d", enableHookCreateWindowExW);
|
spdlog::info("enableHookCreateWindowExW = {}", enableHookCreateWindowExW);
|
||||||
|
|
||||||
const MH_STATUS createHookSetWindowLongA = MH_CreateHook(SetWindowLongA, HookSetWindowLongA, reinterpret_cast<void**>(&TrueSetWindowLongA));
|
const MH_STATUS createHookSetWindowLongA = MH_CreateHook(SetWindowLongA, HookSetWindowLongA, reinterpret_cast<void**>(&TrueSetWindowLongA));
|
||||||
PrintLog("createHookSetWindowLongA = %d", createHookSetWindowLongA);
|
spdlog::info("createHookSetWindowLongA = {}", createHookSetWindowLongA);
|
||||||
const MH_STATUS enableHookSetWindowLongA = MH_EnableHook(SetWindowLongA);
|
const MH_STATUS enableHookSetWindowLongA = MH_EnableHook(SetWindowLongA);
|
||||||
PrintLog("enableHookSetWindowLongA = %d", enableHookSetWindowLongA);
|
spdlog::info("enableHookSetWindowLongA = {}", enableHookSetWindowLongA);
|
||||||
|
|
||||||
const MH_STATUS createHookSetWindowLongW = MH_CreateHook(SetWindowLongW, HookSetWindowLongW, reinterpret_cast<void**>(&TrueSetWindowLongW));
|
const MH_STATUS createHookSetWindowLongW = MH_CreateHook(SetWindowLongW, HookSetWindowLongW, reinterpret_cast<void**>(&TrueSetWindowLongW));
|
||||||
PrintLog("createHookSetWindowLongW = %d", createHookSetWindowLongW);
|
spdlog::info("createHookSetWindowLongW = {}", createHookSetWindowLongW);
|
||||||
const MH_STATUS enableHookSetWindowLongW = MH_EnableHook(SetWindowLongW);
|
const MH_STATUS enableHookSetWindowLongW = MH_EnableHook(SetWindowLongW);
|
||||||
PrintLog("enableHookSetWindowLongW = %d", enableHookSetWindowLongW);
|
spdlog::info("enableHookSetWindowLongW = {}", enableHookSetWindowLongW);
|
||||||
|
|
||||||
if (config.GetOptionsAutoFix()) EnableAutoFix();
|
if (config.GetOptionsAutoFix()) EnableAutoFix();
|
||||||
}
|
}
|
||||||
|
@ -95,7 +103,7 @@ MainContext::~MainContext()
|
||||||
|
|
||||||
IDirect3D9* WINAPI MainContext::HookDirect3DCreate9(UINT SDKVersion)
|
IDirect3D9* WINAPI MainContext::HookDirect3DCreate9(UINT SDKVersion)
|
||||||
{
|
{
|
||||||
PrintLog(__FUNCTION__);
|
spdlog::info(__FUNCTION__);
|
||||||
IDirect3D9* d3d9 = context.TrueDirect3DCreate9(SDKVersion);
|
IDirect3D9* d3d9 = context.TrueDirect3DCreate9(SDKVersion);
|
||||||
if (d3d9) {
|
if (d3d9) {
|
||||||
return new hkIDirect3D9(static_cast<IDirect3D9Ex*>(d3d9));
|
return new hkIDirect3D9(static_cast<IDirect3D9Ex*>(d3d9));
|
||||||
|
@ -106,7 +114,7 @@ IDirect3D9* WINAPI MainContext::HookDirect3DCreate9(UINT SDKVersion)
|
||||||
|
|
||||||
HRESULT WINAPI MainContext::HookDirect3DCreate9Ex(UINT SDKVersion, IDirect3D9Ex** ppIDirect3D9Ex)
|
HRESULT WINAPI MainContext::HookDirect3DCreate9Ex(UINT SDKVersion, IDirect3D9Ex** ppIDirect3D9Ex)
|
||||||
{
|
{
|
||||||
PrintLog(__FUNCTION__);
|
spdlog::info(__FUNCTION__);
|
||||||
HRESULT hr = context.TrueDirect3DCreate9Ex(SDKVersion, ppIDirect3D9Ex);
|
HRESULT hr = context.TrueDirect3DCreate9Ex(SDKVersion, ppIDirect3D9Ex);
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
hkIDirect3D9* pIDirect3D9Ex = new hkIDirect3D9(*ppIDirect3D9Ex);
|
hkIDirect3D9* pIDirect3D9Ex = new hkIDirect3D9(*ppIDirect3D9Ex);
|
||||||
|
@ -151,12 +159,12 @@ bool MainContext::ApplyPresentationParameters(D3DPRESENT_PARAMETERS* pPresentati
|
||||||
if (config.GetOptionsTripleBuffering() == 1 || (config.GetOptionsTripleBuffering() == -1 && !IsDXVK()))
|
if (config.GetOptionsTripleBuffering() == 1 || (config.GetOptionsTripleBuffering() == -1 && !IsDXVK()))
|
||||||
{
|
{
|
||||||
pPresentationParameters->BackBufferCount = 3;
|
pPresentationParameters->BackBufferCount = 3;
|
||||||
PrintLog("BackBufferCount: BackBufferCount set to %u", pPresentationParameters->BackBufferCount);
|
spdlog::info("BackBufferCount: BackBufferCount set to {}", pPresentationParameters->BackBufferCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((s32)config.GetOptionsFullScreenRefreshRate() >= 0 && pPresentationParameters->FullScreen_RefreshRateInHz != 0)
|
if ((s32)config.GetOptionsFullScreenRefreshRate() >= 0 && pPresentationParameters->FullScreen_RefreshRateInHz != 0)
|
||||||
{
|
{
|
||||||
PrintLog("Changing refresh rate from %u to %u", pPresentationParameters->FullScreen_RefreshRateInHz, config.GetOptionsFullScreenRefreshRate());
|
spdlog::info("Changing refresh rate from {} to {}", pPresentationParameters->FullScreen_RefreshRateInHz, config.GetOptionsFullScreenRefreshRate());
|
||||||
pPresentationParameters->FullScreen_RefreshRateInHz = config.GetOptionsFullScreenRefreshRate();
|
pPresentationParameters->FullScreen_RefreshRateInHz = config.GetOptionsFullScreenRefreshRate();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,7 +174,7 @@ bool MainContext::ApplyPresentationParameters(D3DPRESENT_PARAMETERS* pPresentati
|
||||||
pPresentationParameters->MultiSampleType = (D3DMULTISAMPLE_TYPE)config.GetOptionsMultisample();
|
pPresentationParameters->MultiSampleType = (D3DMULTISAMPLE_TYPE)config.GetOptionsMultisample();
|
||||||
pPresentationParameters->MultiSampleQuality = 0;
|
pPresentationParameters->MultiSampleQuality = 0;
|
||||||
|
|
||||||
PrintLog("MultiSampleType %u, MultiSampleQuality %u", pPresentationParameters->MultiSampleType, pPresentationParameters->MultiSampleQuality);
|
spdlog::info("MultiSampleType {}, MultiSampleQuality {}", pPresentationParameters->MultiSampleType, pPresentationParameters->MultiSampleQuality);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.GetOptionsPresentationInterval() != 0)
|
if (config.GetOptionsPresentationInterval() != 0)
|
||||||
|
@ -176,13 +184,13 @@ bool MainContext::ApplyPresentationParameters(D3DPRESENT_PARAMETERS* pPresentati
|
||||||
else if (config.GetOptionsPresentationInterval() > 0)
|
else if (config.GetOptionsPresentationInterval() > 0)
|
||||||
pPresentationParameters->PresentationInterval = D3DPRESENT_INTERVAL_ONE;
|
pPresentationParameters->PresentationInterval = D3DPRESENT_INTERVAL_ONE;
|
||||||
|
|
||||||
PrintLog("PresentationInterval: PresentationInterval set to 0x%x", pPresentationParameters->PresentationInterval);
|
spdlog::info("PresentationInterval: PresentationInterval set to {:X}", pPresentationParameters->PresentationInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.GetOptionsSwapEffect() != -1)
|
if (config.GetOptionsSwapEffect() != -1)
|
||||||
{
|
{
|
||||||
pPresentationParameters->SwapEffect = (D3DSWAPEFFECT)config.GetOptionsSwapEffect();
|
pPresentationParameters->SwapEffect = (D3DSWAPEFFECT)config.GetOptionsSwapEffect();
|
||||||
PrintLog("SwapEffect: SwapEffect set to %u", pPresentationParameters->SwapEffect);
|
spdlog::info("SwapEffect: SwapEffect set to {}", pPresentationParameters->SwapEffect);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (config.GetBorderlessBorderless())
|
if (config.GetBorderlessBorderless())
|
||||||
|
@ -198,7 +206,7 @@ bool MainContext::ApplyPresentationParameters(D3DPRESENT_PARAMETERS* pPresentati
|
||||||
pPresentationParameters->Windowed = TRUE;
|
pPresentationParameters->Windowed = TRUE;
|
||||||
pPresentationParameters->FullScreen_RefreshRateInHz = 0;
|
pPresentationParameters->FullScreen_RefreshRateInHz = 0;
|
||||||
|
|
||||||
PrintLog("ForceWindowedMode");
|
spdlog::info("ForceWindowedMode");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -217,7 +225,7 @@ bool MainContext::CheckWindow(HWND hWnd)
|
||||||
GetClassNameW(hWnd, className.get(), MAX_PATH);
|
GetClassNameW(hWnd, className.get(), MAX_PATH);
|
||||||
GetWindowTextW(hWnd, windowName.get(), MAX_PATH);
|
GetWindowTextW(hWnd, windowName.get(), MAX_PATH);
|
||||||
|
|
||||||
PrintLog("HWND 0x%p: ClassName \"%ls\", WindowName: \"%ls\"", hWnd, className.get(), windowName.get());
|
spdlog::info(L"HWND {}: ClassName \"{}\", WindowName: \"{}\"", (void*)hWnd, className.get(), windowName.get());
|
||||||
|
|
||||||
bool class_found = config.GetWindowWindowClass().compare(className.get()) == 0;
|
bool class_found = config.GetWindowWindowClass().compare(className.get()) == 0;
|
||||||
bool window_found = config.GetWindowWindowName().compare(windowName.get()) == 0;
|
bool window_found = config.GetWindowWindowName().compare(windowName.get()) == 0;
|
||||||
|
@ -259,8 +267,8 @@ void MainContext::ApplyBorderless(HWND hWnd)
|
||||||
SetWindowPos(hWnd, insertAfter, 0, 0, cx, cy, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOSENDCHANGING);
|
SetWindowPos(hWnd, insertAfter, 0, 0, cx, cy, SWP_SHOWWINDOW | SWP_NOCOPYBITS | SWP_NOSENDCHANGING);
|
||||||
SetFocus(hWnd);
|
SetFocus(hWnd);
|
||||||
|
|
||||||
PrintLog("HWND 0x%p: Borderless dwStyle: %lX->%lX", hWnd, dwStyle, new_dwStyle);
|
spdlog::info("HWND {:X}: Borderless dwStyle: {:X}->{:X}", (void*)hWnd, dwStyle, new_dwStyle);
|
||||||
PrintLog("HWND 0x%p: Borderless dwExStyle: %lX->%lX", hWnd, dwExStyle, new_dwExStyle);
|
spdlog::info("HWND {:X}: Borderless dwExStyle: {:X}->{:X}", (void*)hWnd, dwExStyle, new_dwExStyle);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -305,13 +313,13 @@ LONG WINAPI MainContext::HookSetWindowLongA(HWND hWnd, int nIndex, LONG dwNewLon
|
||||||
if (nIndex == GWL_STYLE)
|
if (nIndex == GWL_STYLE)
|
||||||
{
|
{
|
||||||
dwNewLong &= ~WS_OVERLAPPEDWINDOW;
|
dwNewLong &= ~WS_OVERLAPPEDWINDOW;
|
||||||
PrintLog("SetWindowLongA dwStyle: %lX->%lX", olddwNewLong, dwNewLong);
|
spdlog::info("SetWindowLongA dwStyle: {:X}->{:X}", olddwNewLong, dwNewLong);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nIndex == GWL_EXSTYLE)
|
if (nIndex == GWL_EXSTYLE)
|
||||||
{
|
{
|
||||||
dwNewLong &= ~(WS_EX_OVERLAPPEDWINDOW);
|
dwNewLong &= ~(WS_EX_OVERLAPPEDWINDOW);
|
||||||
PrintLog("SetWindowLongA dwExStyle: %lX->%lX", olddwNewLong, dwNewLong);
|
spdlog::info("SetWindowLongA dwExStyle: {:X}->{:X}", olddwNewLong, dwNewLong);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return context.TrueSetWindowLongA(hWnd, nIndex, dwNewLong);
|
return context.TrueSetWindowLongA(hWnd, nIndex, dwNewLong);
|
||||||
|
@ -325,13 +333,13 @@ LONG WINAPI MainContext::HookSetWindowLongW(HWND hWnd, int nIndex, LONG dwNewLon
|
||||||
if (nIndex == GWL_STYLE)
|
if (nIndex == GWL_STYLE)
|
||||||
{
|
{
|
||||||
dwNewLong &= ~WS_OVERLAPPEDWINDOW;
|
dwNewLong &= ~WS_OVERLAPPEDWINDOW;
|
||||||
PrintLog("SetWindowLongW dwStyle: %lX->%lX", olddwNewLong, dwNewLong);
|
spdlog::info("SetWindowLongW dwStyle: {:X}->{:X}", olddwNewLong, dwNewLong);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nIndex == GWL_EXSTYLE)
|
if (nIndex == GWL_EXSTYLE)
|
||||||
{
|
{
|
||||||
dwNewLong &= ~(WS_EX_OVERLAPPEDWINDOW);
|
dwNewLong &= ~(WS_EX_OVERLAPPEDWINDOW);
|
||||||
PrintLog("SetWindowLongW dwExStyle: %lX->%lX", olddwNewLong, dwNewLong);
|
spdlog::info("SetWindowLongW dwExStyle: {:X}->{:X}", olddwNewLong, dwNewLong);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return context.TrueSetWindowLongW(hWnd, nIndex, dwNewLong);
|
return context.TrueSetWindowLongW(hWnd, nIndex, dwNewLong);
|
||||||
|
@ -342,7 +350,7 @@ HWND WINAPI MainContext::HookCreateWindowExA(DWORD dwExStyle, LPCSTR lpClassName
|
||||||
HWND hWnd = context.TrueCreateWindowExA(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
HWND hWnd = context.TrueCreateWindowExA(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||||
if (!hWnd)
|
if (!hWnd)
|
||||||
{
|
{
|
||||||
PrintLog("CreateWindowExA failed");
|
spdlog::info("CreateWindowExA failed");
|
||||||
return hWnd;
|
return hWnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -360,7 +368,7 @@ HWND WINAPI MainContext::HookCreateWindowExW(DWORD dwExStyle, LPCWSTR lpClassNam
|
||||||
HWND hWnd = context.TrueCreateWindowExW(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
HWND hWnd = context.TrueCreateWindowExW(dwExStyle, lpClassName, lpWindowName, dwStyle, X, Y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam);
|
||||||
if (!hWnd)
|
if (!hWnd)
|
||||||
{
|
{
|
||||||
PrintLog("CreateWindowExW failed");
|
spdlog::info("CreateWindowExW failed");
|
||||||
return hWnd;
|
return hWnd;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3,11 +3,16 @@
|
||||||
#include <atomic>
|
#include <atomic>
|
||||||
#include <d3d9.h>
|
#include <d3d9.h>
|
||||||
|
|
||||||
|
#include "spdlog/spdlog.h"
|
||||||
|
#include "spdlog/sinks/basic_file_sink.h"
|
||||||
|
|
||||||
|
#include "WinUtil.h"
|
||||||
|
|
||||||
#include "Types.h"
|
#include "Types.h"
|
||||||
#include "XInputManager.h"
|
#include "XInputManager.h"
|
||||||
|
|
||||||
static const char* inifilename = "FF13Fix.ini";
|
static const char* inifilename = "FF13Fix.ini";
|
||||||
#define CONFIG_VERSION 6
|
#define CONFIG_VERSION 7
|
||||||
|
|
||||||
class Config
|
class Config
|
||||||
{
|
{
|
||||||
|
@ -61,6 +66,7 @@ public:
|
||||||
void ApplyBorderless(HWND hWnd);
|
void ApplyBorderless(HWND hWnd);
|
||||||
|
|
||||||
Config config;
|
Config config;
|
||||||
|
|
||||||
void OneTimeFix();
|
void OneTimeFix();
|
||||||
bool IsDXVK();
|
bool IsDXVK();
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,12 @@
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
|
||||||
#include "Logger.h"
|
|
||||||
#include "Context.h"
|
#include "Context.h"
|
||||||
|
|
||||||
#include "IDirect3D9.h"
|
#include "IDirect3D9.h"
|
||||||
#include "IDirect3DDevice9.h"
|
#include "IDirect3DDevice9.h"
|
||||||
|
|
||||||
#define IDirect3D9_PrintLog(format, ...) //PrintLog(format, __VA_ARGS__);
|
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3D9::QueryInterface(REFIID riid, void** ppvObj) {
|
HRESULT APIENTRY hkIDirect3D9::QueryInterface(REFIID riid, void** ppvObj) {
|
||||||
PrintLog(__FUNCTION__);
|
spdlog::info(__FUNCTION__);
|
||||||
if (ppvObj == nullptr)
|
if (ppvObj == nullptr)
|
||||||
return E_POINTER;
|
return E_POINTER;
|
||||||
|
|
||||||
|
@ -58,23 +55,23 @@ ULONG STDMETHODCALLTYPE hkIDirect3D9::Release() {
|
||||||
|
|
||||||
const ULONG ref_last = pWrapped->Release();
|
const ULONG ref_last = pWrapped->Release();
|
||||||
if (ref_last != 0)
|
if (ref_last != 0)
|
||||||
PrintLog("WARNING: Reference count for IDirect3D9 is wrong: %p %u %u", this, ref, ref_last);
|
spdlog::error("Reference count for IDirect3D9 is wrong: {} {} {}", (void*)this, ref, ref_last);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3D9::RegisterSoftwareDevice(void* pInitializeFunction) {
|
HRESULT APIENTRY hkIDirect3D9::RegisterSoftwareDevice(void* pInitializeFunction) {
|
||||||
IDirect3D9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->RegisterSoftwareDevice(pInitializeFunction);
|
return m_pWrapped->RegisterSoftwareDevice(pInitializeFunction);
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT APIENTRY hkIDirect3D9::GetAdapterCount() {
|
UINT APIENTRY hkIDirect3D9::GetAdapterCount() {
|
||||||
IDirect3D9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetAdapterCount();
|
return m_pWrapped->GetAdapterCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3D9::GetAdapterIdentifier(UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier) {
|
HRESULT APIENTRY hkIDirect3D9::GetAdapterIdentifier(UINT Adapter, DWORD Flags, D3DADAPTER_IDENTIFIER9* pIdentifier) {
|
||||||
PrintLog(__FUNCTION__);
|
spdlog::info(__FUNCTION__);
|
||||||
HRESULT rt = m_pWrapped->GetAdapterIdentifier(Adapter, Flags, pIdentifier);
|
HRESULT rt = m_pWrapped->GetAdapterIdentifier(Adapter, Flags, pIdentifier);
|
||||||
if (context.config.GetAdapterAdapter() && SUCCEEDED(rt) && pIdentifier)
|
if (context.config.GetAdapterAdapter() && SUCCEEDED(rt) && pIdentifier)
|
||||||
{
|
{
|
||||||
|
@ -85,84 +82,84 @@ HRESULT APIENTRY hkIDirect3D9::GetAdapterIdentifier(UINT Adapter, DWORD Flags, D
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT APIENTRY hkIDirect3D9::GetAdapterModeCount(UINT Adapter, D3DFORMAT Format) {
|
UINT APIENTRY hkIDirect3D9::GetAdapterModeCount(UINT Adapter, D3DFORMAT Format) {
|
||||||
IDirect3D9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetAdapterModeCount(Adapter, Format);
|
return m_pWrapped->GetAdapterModeCount(Adapter, Format);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3D9::EnumAdapterModes(UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode) {
|
HRESULT APIENTRY hkIDirect3D9::EnumAdapterModes(UINT Adapter, D3DFORMAT Format, UINT Mode, D3DDISPLAYMODE* pMode) {
|
||||||
IDirect3D9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->EnumAdapterModes(Adapter, Format, Mode, pMode);
|
return m_pWrapped->EnumAdapterModes(Adapter, Format, Mode, pMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3D9::GetAdapterDisplayMode(UINT Adapter, D3DDISPLAYMODE* pMode) {
|
HRESULT APIENTRY hkIDirect3D9::GetAdapterDisplayMode(UINT Adapter, D3DDISPLAYMODE* pMode) {
|
||||||
IDirect3D9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetAdapterDisplayMode(Adapter, pMode);
|
return m_pWrapped->GetAdapterDisplayMode(Adapter, pMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3D9::CheckDeviceType(UINT Adapter, D3DDEVTYPE DevType, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed) {
|
HRESULT APIENTRY hkIDirect3D9::CheckDeviceType(UINT Adapter, D3DDEVTYPE DevType, D3DFORMAT AdapterFormat, D3DFORMAT BackBufferFormat, BOOL bWindowed) {
|
||||||
IDirect3D9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
if (context.config.GetBorderlessForceWindowedMode()) bWindowed = TRUE;
|
if (context.config.GetBorderlessForceWindowedMode()) bWindowed = TRUE;
|
||||||
return m_pWrapped->CheckDeviceType(Adapter, DevType, AdapterFormat, BackBufferFormat, bWindowed);
|
return m_pWrapped->CheckDeviceType(Adapter, DevType, AdapterFormat, BackBufferFormat, bWindowed);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3D9::CheckDeviceFormat(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) {
|
HRESULT APIENTRY hkIDirect3D9::CheckDeviceFormat(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, DWORD Usage, D3DRESOURCETYPE RType, D3DFORMAT CheckFormat) {
|
||||||
IDirect3D9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CheckDeviceFormat(Adapter, DeviceType, AdapterFormat, Usage, RType, CheckFormat);
|
return m_pWrapped->CheckDeviceFormat(Adapter, DeviceType, AdapterFormat, Usage, RType, CheckFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3D9::CheckDeviceMultiSampleType(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) {
|
HRESULT APIENTRY hkIDirect3D9::CheckDeviceMultiSampleType(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SurfaceFormat, BOOL Windowed, D3DMULTISAMPLE_TYPE MultiSampleType, DWORD* pQualityLevels) {
|
||||||
IDirect3D9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CheckDeviceMultiSampleType(Adapter, DeviceType, SurfaceFormat, Windowed, MultiSampleType, pQualityLevels);
|
return m_pWrapped->CheckDeviceMultiSampleType(Adapter, DeviceType, SurfaceFormat, Windowed, MultiSampleType, pQualityLevels);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3D9::CheckDepthStencilMatch(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) {
|
HRESULT APIENTRY hkIDirect3D9::CheckDepthStencilMatch(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT AdapterFormat, D3DFORMAT RenderTargetFormat, D3DFORMAT DepthStencilFormat) {
|
||||||
IDirect3D9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CheckDepthStencilMatch(Adapter, DeviceType, AdapterFormat, RenderTargetFormat, DepthStencilFormat);
|
return m_pWrapped->CheckDepthStencilMatch(Adapter, DeviceType, AdapterFormat, RenderTargetFormat, DepthStencilFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3D9::CheckDeviceFormatConversion(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat) {
|
HRESULT APIENTRY hkIDirect3D9::CheckDeviceFormatConversion(UINT Adapter, D3DDEVTYPE DeviceType, D3DFORMAT SourceFormat, D3DFORMAT TargetFormat) {
|
||||||
IDirect3D9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CheckDeviceFormatConversion(Adapter, DeviceType, SourceFormat, TargetFormat);
|
return m_pWrapped->CheckDeviceFormatConversion(Adapter, DeviceType, SourceFormat, TargetFormat);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3D9::GetDeviceCaps(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) {
|
HRESULT APIENTRY hkIDirect3D9::GetDeviceCaps(UINT Adapter, D3DDEVTYPE DeviceType, D3DCAPS9* pCaps) {
|
||||||
IDirect3D9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetDeviceCaps(Adapter, DeviceType, pCaps);
|
return m_pWrapped->GetDeviceCaps(Adapter, DeviceType, pCaps);
|
||||||
}
|
}
|
||||||
|
|
||||||
HMONITOR APIENTRY hkIDirect3D9::GetAdapterMonitor(UINT Adapter) {
|
HMONITOR APIENTRY hkIDirect3D9::GetAdapterMonitor(UINT Adapter) {
|
||||||
IDirect3D9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetAdapterMonitor(Adapter);
|
return m_pWrapped->GetAdapterMonitor(Adapter);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3D9::CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface) {
|
HRESULT APIENTRY hkIDirect3D9::CreateDevice(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DDevice9** ppReturnedDeviceInterface) {
|
||||||
PrintLog(__FUNCTION__);
|
spdlog::info(__FUNCTION__);
|
||||||
return ApplyCreateDeviceFix<IDirect3DDevice9, false>(Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, nullptr, ppReturnedDeviceInterface);
|
return ApplyCreateDeviceFix<IDirect3DDevice9, false>(Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, nullptr, ppReturnedDeviceInterface);
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT STDMETHODCALLTYPE hkIDirect3D9::GetAdapterModeCountEx(UINT Adapter, CONST D3DDISPLAYMODEFILTER* pFilter) {
|
UINT STDMETHODCALLTYPE hkIDirect3D9::GetAdapterModeCountEx(UINT Adapter, CONST D3DDISPLAYMODEFILTER* pFilter) {
|
||||||
IDirect3D9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
|
|
||||||
return static_cast<IDirect3D9Ex*>(m_pWrapped)->GetAdapterModeCountEx(Adapter, pFilter);
|
return static_cast<IDirect3D9Ex*>(m_pWrapped)->GetAdapterModeCountEx(Adapter, pFilter);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3D9::EnumAdapterModesEx(UINT Adapter, CONST D3DDISPLAYMODEFILTER* pFilter, UINT Mode, D3DDISPLAYMODEEX* pMode) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3D9::EnumAdapterModesEx(UINT Adapter, CONST D3DDISPLAYMODEFILTER* pFilter, UINT Mode, D3DDISPLAYMODEEX* pMode) {
|
||||||
IDirect3D9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return static_cast<IDirect3D9Ex*>(m_pWrapped)->EnumAdapterModesEx(Adapter, pFilter, Mode, pMode);
|
return static_cast<IDirect3D9Ex*>(m_pWrapped)->EnumAdapterModesEx(Adapter, pFilter, Mode, pMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3D9::GetAdapterDisplayModeEx(UINT Adapter, D3DDISPLAYMODEEX* pMode, D3DDISPLAYROTATION* pRotation) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3D9::GetAdapterDisplayModeEx(UINT Adapter, D3DDISPLAYMODEEX* pMode, D3DDISPLAYROTATION* pRotation) {
|
||||||
IDirect3D9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return static_cast<IDirect3D9Ex*>(m_pWrapped)->GetAdapterDisplayModeEx(Adapter, pMode, pRotation);
|
return static_cast<IDirect3D9Ex*>(m_pWrapped)->GetAdapterDisplayModeEx(Adapter, pMode, pRotation);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3D9::CreateDeviceEx(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode, IDirect3DDevice9Ex** ppReturnedDeviceInterface) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3D9::CreateDeviceEx(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode, IDirect3DDevice9Ex** ppReturnedDeviceInterface) {
|
||||||
PrintLog(__FUNCTION__);
|
spdlog::info(__FUNCTION__);
|
||||||
return ApplyCreateDeviceFix<IDirect3DDevice9Ex, true>(Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, pFullscreenDisplayMode, ppReturnedDeviceInterface);
|
return ApplyCreateDeviceFix<IDirect3DDevice9Ex, true>(Adapter, DeviceType, hFocusWindow, BehaviorFlags, pPresentationParameters, pFullscreenDisplayMode, ppReturnedDeviceInterface);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3D9::GetAdapterLUID(UINT Adapter, LUID* pLUID) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3D9::GetAdapterLUID(UINT Adapter, LUID* pLUID) {
|
||||||
IDirect3D9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return static_cast<IDirect3D9Ex*>(m_pWrapped)->GetAdapterLUID(Adapter, pLUID);
|
return static_cast<IDirect3D9Ex*>(m_pWrapped)->GetAdapterLUID(Adapter, pLUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,17 +167,17 @@ HRESULT STDMETHODCALLTYPE hkIDirect3D9::GetAdapterLUID(UINT Adapter, LUID* pLUID
|
||||||
template <typename T, bool ex>
|
template <typename T, bool ex>
|
||||||
HRESULT hkIDirect3D9::ApplyCreateDeviceFix(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode, T** ppReturnedDeviceInterface)
|
HRESULT hkIDirect3D9::ApplyCreateDeviceFix(UINT Adapter, D3DDEVTYPE DeviceType, HWND hFocusWindow, DWORD BehaviorFlags, D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode, T** ppReturnedDeviceInterface)
|
||||||
{
|
{
|
||||||
PrintLog(__FUNCTION__);
|
spdlog::info(__FUNCTION__);
|
||||||
|
|
||||||
DWORD OriginalBehaviorFlags = BehaviorFlags;
|
DWORD OriginalBehaviorFlags = BehaviorFlags;
|
||||||
std::string BehaviorFlagsString;
|
std::string BehaviorFlagsString;
|
||||||
context.BehaviorFlagsToString(BehaviorFlags, &BehaviorFlagsString);
|
context.BehaviorFlagsToString(BehaviorFlags, &BehaviorFlagsString);
|
||||||
|
|
||||||
PrintLog("BehaviorFlags: %08X %s", BehaviorFlags, BehaviorFlagsString.c_str());
|
spdlog::info("BehaviorFlags: {:#08x} {}", BehaviorFlags, BehaviorFlagsString);
|
||||||
|
|
||||||
if (context.config.GetOptionsBehaviorFlags() > 0) {
|
if (context.config.GetOptionsBehaviorFlags() > 0) {
|
||||||
BehaviorFlags = context.config.GetOptionsBehaviorFlags();
|
BehaviorFlags = context.config.GetOptionsBehaviorFlags();
|
||||||
PrintLog("Advanced Mode: BehaviorFlags set");
|
spdlog::info("Advanced Mode: BehaviorFlags set");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
context.ApplyBehaviorFlagsFix(&BehaviorFlags);
|
context.ApplyBehaviorFlagsFix(&BehaviorFlags);
|
||||||
|
@ -194,7 +191,7 @@ HRESULT hkIDirect3D9::ApplyCreateDeviceFix(UINT Adapter, D3DDEVTYPE DeviceType,
|
||||||
if (OriginalBehaviorFlags != BehaviorFlags) {
|
if (OriginalBehaviorFlags != BehaviorFlags) {
|
||||||
std::string BehaviorFlagsString;
|
std::string BehaviorFlagsString;
|
||||||
context.BehaviorFlagsToString(BehaviorFlags, &BehaviorFlagsString);
|
context.BehaviorFlagsToString(BehaviorFlags, &BehaviorFlagsString);
|
||||||
PrintLog("BehaviorFlags changed: %08X %s", BehaviorFlags, BehaviorFlagsString.c_str());
|
spdlog::info("BehaviorFlags changed: {:#08x} {}", BehaviorFlags, BehaviorFlagsString);
|
||||||
}
|
}
|
||||||
|
|
||||||
T* device = nullptr;
|
T* device = nullptr;
|
||||||
|
@ -211,7 +208,7 @@ HRESULT hkIDirect3D9::ApplyCreateDeviceFix(UINT Adapter, D3DDEVTYPE DeviceType,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
PrintLog("CreateDevice fail with HRESULT: %08X", hr);
|
spdlog::info("CreateDevice fail with HRESULT: {:X}", hr);
|
||||||
*ppReturnedDeviceInterface = nullptr;
|
*ppReturnedDeviceInterface = nullptr;
|
||||||
return hr;
|
return hr;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,17 +1,14 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
#include "stdafx.h"
|
#include "stdafx.h"
|
||||||
|
|
||||||
#include "Logger.h"
|
|
||||||
#include "Context.h"
|
#include "Context.h"
|
||||||
|
|
||||||
#include "IDirect3DDevice9.h"
|
#include "IDirect3DDevice9.h"
|
||||||
|
|
||||||
#include <intrin.h>
|
#include <intrin.h>
|
||||||
|
|
||||||
#define IDirect3DDevice9_PrintLog(...) //PrintLog("%s", __VA_ARGS__);
|
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::QueryInterface(REFIID riid, void** ppvObj) {
|
HRESULT APIENTRY hkIDirect3DDevice9::QueryInterface(REFIID riid, void** ppvObj) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
if (ppvObj == nullptr) return E_POINTER;
|
if (ppvObj == nullptr) return E_POINTER;
|
||||||
|
|
||||||
if (riid == __uuidof(this) ||
|
if (riid == __uuidof(this) ||
|
||||||
|
@ -59,70 +56,70 @@ ULONG STDMETHODCALLTYPE hkIDirect3DDevice9::Release() {
|
||||||
|
|
||||||
const ULONG ref_last = pWrapped->Release();
|
const ULONG ref_last = pWrapped->Release();
|
||||||
if (ref_last != 0) {
|
if (ref_last != 0) {
|
||||||
PrintLog("WARNING: Reference count for IDirect3DDevice9 is wrong: %p %u %u", this, ref, ref_last);
|
spdlog::error("Reference count for IDirect3DDevice9 is wrong: {} {} {}", (void*)this, ref, ref_last);
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::TestCooperativeLevel() {
|
HRESULT APIENTRY hkIDirect3DDevice9::TestCooperativeLevel() {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->TestCooperativeLevel();
|
return m_pWrapped->TestCooperativeLevel();
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT APIENTRY hkIDirect3DDevice9::GetAvailableTextureMem() {
|
UINT APIENTRY hkIDirect3DDevice9::GetAvailableTextureMem() {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetAvailableTextureMem();
|
return m_pWrapped->GetAvailableTextureMem();
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::EvictManagedResources() {
|
HRESULT APIENTRY hkIDirect3DDevice9::EvictManagedResources() {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->EvictManagedResources();
|
return m_pWrapped->EvictManagedResources();
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetDirect3D(IDirect3D9** ppD3D9) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetDirect3D(IDirect3D9** ppD3D9) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetDirect3D(ppD3D9);
|
return m_pWrapped->GetDirect3D(ppD3D9);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetDeviceCaps(D3DCAPS9* pCaps) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetDeviceCaps(D3DCAPS9* pCaps) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetDeviceCaps(pCaps);
|
return m_pWrapped->GetDeviceCaps(pCaps);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetDisplayMode(UINT iSwapChain, D3DDISPLAYMODE* pMode) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetDisplayMode(UINT iSwapChain, D3DDISPLAYMODE* pMode) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetDisplayMode(iSwapChain, pMode);
|
return m_pWrapped->GetDisplayMode(iSwapChain, pMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS* pParameters) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetCreationParameters(D3DDEVICE_CREATION_PARAMETERS* pParameters) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetCreationParameters(pParameters);
|
return m_pWrapped->GetCreationParameters(pParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetCursorProperties(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetCursorProperties(UINT XHotSpot, UINT YHotSpot, IDirect3DSurface9* pCursorBitmap) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetCursorProperties(XHotSpot, YHotSpot, pCursorBitmap);
|
return m_pWrapped->SetCursorProperties(XHotSpot, YHotSpot, pCursorBitmap);
|
||||||
}
|
}
|
||||||
|
|
||||||
void APIENTRY hkIDirect3DDevice9::SetCursorPosition(int X, int Y, DWORD Flags) {
|
void APIENTRY hkIDirect3DDevice9::SetCursorPosition(int X, int Y, DWORD Flags) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetCursorPosition(X, Y, Flags);
|
return m_pWrapped->SetCursorPosition(X, Y, Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL APIENTRY hkIDirect3DDevice9::ShowCursor(BOOL bShow) {
|
BOOL APIENTRY hkIDirect3DDevice9::ShowCursor(BOOL bShow) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->ShowCursor(bShow);
|
return m_pWrapped->ShowCursor(bShow);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain) {
|
HRESULT APIENTRY hkIDirect3DDevice9::CreateAdditionalSwapChain(D3DPRESENT_PARAMETERS* pPresentationParameters, IDirect3DSwapChain9** pSwapChain) {
|
||||||
PrintLog(__FUNCTION__);
|
spdlog::info(__FUNCTION__);
|
||||||
context.ApplyPresentationParameters(pPresentationParameters);
|
context.ApplyPresentationParameters(pPresentationParameters);
|
||||||
return m_pWrapped->CreateAdditionalSwapChain(pPresentationParameters, pSwapChain);
|
return m_pWrapped->CreateAdditionalSwapChain(pPresentationParameters, pSwapChain);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetSwapChain(UINT iSwapChain, IDirect3DSwapChain9** pSwapChain) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetSwapChain(UINT iSwapChain, IDirect3DSwapChain9** pSwapChain) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
|
|
||||||
// Steam Overlay crash fix
|
// Steam Overlay crash fix
|
||||||
// Add some space, 16bytes should be more than enough
|
// Add some space, 16bytes should be more than enough
|
||||||
|
@ -135,598 +132,597 @@ HRESULT APIENTRY hkIDirect3DDevice9::GetSwapChain(UINT iSwapChain, IDirect3DSwap
|
||||||
}
|
}
|
||||||
|
|
||||||
UINT APIENTRY hkIDirect3DDevice9::GetNumberOfSwapChains() {
|
UINT APIENTRY hkIDirect3DDevice9::GetNumberOfSwapChains() {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetNumberOfSwapChains();
|
return m_pWrapped->GetNumberOfSwapChains();
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::Reset(D3DPRESENT_PARAMETERS* pPresentationParameters) {
|
HRESULT APIENTRY hkIDirect3DDevice9::Reset(D3DPRESENT_PARAMETERS* pPresentationParameters) {
|
||||||
PrintLog("hkIDirect3DDevice9::Reset");
|
spdlog::debug("hkIDirect3DDevice9::Reset");
|
||||||
|
|
||||||
context.ApplyPresentationParameters(pPresentationParameters);
|
context.ApplyPresentationParameters(pPresentationParameters);
|
||||||
return m_pWrapped->Reset(pPresentationParameters);
|
return m_pWrapped->Reset(pPresentationParameters);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::Present(CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion) {
|
HRESULT APIENTRY hkIDirect3DDevice9::Present(CONST RECT* pSourceRect, CONST RECT* pDestRect, HWND hDestWindowOverride, CONST RGNDATA* pDirtyRegion) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->Present(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
|
return m_pWrapped->Present(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetBackBuffer(UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetBackBuffer(UINT iSwapChain, UINT iBackBuffer, D3DBACKBUFFER_TYPE Type, IDirect3DSurface9** ppBackBuffer) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetBackBuffer(iSwapChain, iBackBuffer, Type, ppBackBuffer);
|
return m_pWrapped->GetBackBuffer(iSwapChain, iBackBuffer, Type, ppBackBuffer);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetRasterStatus(UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetRasterStatus(UINT iSwapChain, D3DRASTER_STATUS* pRasterStatus) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetRasterStatus(iSwapChain, pRasterStatus);
|
return m_pWrapped->GetRasterStatus(iSwapChain, pRasterStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetDialogBoxMode(BOOL bEnableDialogs) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetDialogBoxMode(BOOL bEnableDialogs) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetDialogBoxMode(bEnableDialogs);
|
return m_pWrapped->SetDialogBoxMode(bEnableDialogs);
|
||||||
}
|
}
|
||||||
|
|
||||||
void APIENTRY hkIDirect3DDevice9::SetGammaRamp(UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp) {
|
void APIENTRY hkIDirect3DDevice9::SetGammaRamp(UINT iSwapChain, DWORD Flags, CONST D3DGAMMARAMP* pRamp) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetGammaRamp(iSwapChain, Flags, pRamp);
|
return m_pWrapped->SetGammaRamp(iSwapChain, Flags, pRamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void APIENTRY hkIDirect3DDevice9::GetGammaRamp(UINT iSwapChain, D3DGAMMARAMP* pRamp) {
|
void APIENTRY hkIDirect3DDevice9::GetGammaRamp(UINT iSwapChain, D3DGAMMARAMP* pRamp) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetGammaRamp(iSwapChain, pRamp);
|
return m_pWrapped->GetGammaRamp(iSwapChain, pRamp);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateTexture(UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle) {
|
HRESULT APIENTRY hkIDirect3DDevice9::CreateTexture(UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CreateTexture(Width, Height, Levels, Usage, Format, Pool, ppTexture, pSharedHandle);
|
return m_pWrapped->CreateTexture(Width, Height, Levels, Usage, Format, Pool, ppTexture, pSharedHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateVolumeTexture(UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle) {
|
HRESULT APIENTRY hkIDirect3DDevice9::CreateVolumeTexture(UINT Width, UINT Height, UINT Depth, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DVolumeTexture9** ppVolumeTexture, HANDLE* pSharedHandle) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CreateVolumeTexture(Width, Height, Depth, Levels, Usage, Format, Pool, ppVolumeTexture, pSharedHandle);
|
return m_pWrapped->CreateVolumeTexture(Width, Height, Depth, Levels, Usage, Format, Pool, ppVolumeTexture, pSharedHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateCubeTexture(UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle) {
|
HRESULT APIENTRY hkIDirect3DDevice9::CreateCubeTexture(UINT EdgeLength, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DCubeTexture9** ppCubeTexture, HANDLE* pSharedHandle) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CreateCubeTexture(EdgeLength, Levels, Usage, Format, Pool, ppCubeTexture, pSharedHandle);
|
return m_pWrapped->CreateCubeTexture(EdgeLength, Levels, Usage, Format, Pool, ppCubeTexture, pSharedHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexBuffer(UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle) {
|
HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexBuffer(UINT Length, DWORD Usage, DWORD FVF, D3DPOOL Pool, IDirect3DVertexBuffer9** ppVertexBuffer, HANDLE* pSharedHandle) {
|
||||||
//PrintLog("hkIDirect3DDevice9::CreateVertexBuffer %08u %x %x %x %p %p", Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
|
spdlog::trace(__FUNCTION__" {} {} {} {} {} {}", Length, Usage, FVF, Pool, (void*)ppVertexBuffer, (void*)pSharedHandle);
|
||||||
return context.CreateVertexBuffer(m_pWrapped, Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
|
return context.CreateVertexBuffer(m_pWrapped, Length, Usage, FVF, Pool, ppVertexBuffer, pSharedHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateIndexBuffer(UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle) {
|
HRESULT APIENTRY hkIDirect3DDevice9::CreateIndexBuffer(UINT Length, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DIndexBuffer9** ppIndexBuffer, HANDLE* pSharedHandle) {
|
||||||
//PrintLog("hkIDirect3DDevice9::CreateIndexBuffer %u %x %x %x %p %p", Length, Usage, Format, Pool, ppIndexBuffer, pSharedHandle);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CreateIndexBuffer(Length, Usage, Format, Pool, ppIndexBuffer, pSharedHandle);
|
return m_pWrapped->CreateIndexBuffer(Length, Usage, Format, Pool, ppIndexBuffer, pSharedHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateRenderTarget(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
|
HRESULT APIENTRY hkIDirect3DDevice9::CreateRenderTarget(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CreateRenderTarget(Width, Height, Format, MultiSample, MultisampleQuality, Lockable, ppSurface, pSharedHandle);
|
return m_pWrapped->CreateRenderTarget(Width, Height, Format, MultiSample, MultisampleQuality, Lockable, ppSurface, pSharedHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateDepthStencilSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
|
HRESULT APIENTRY hkIDirect3DDevice9::CreateDepthStencilSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CreateDepthStencilSurface(Width, Height, Format, MultiSample, MultisampleQuality, Discard, ppSurface, pSharedHandle);
|
return m_pWrapped->CreateDepthStencilSurface(Width, Height, Format, MultiSample, MultisampleQuality, Discard, ppSurface, pSharedHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::UpdateSurface(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint) {
|
HRESULT APIENTRY hkIDirect3DDevice9::UpdateSurface(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestinationSurface, CONST POINT* pDestPoint) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->UpdateSurface(pSourceSurface, pSourceRect, pDestinationSurface, pDestPoint);
|
return m_pWrapped->UpdateSurface(pSourceSurface, pSourceRect, pDestinationSurface, pDestPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture) {
|
HRESULT APIENTRY hkIDirect3DDevice9::UpdateTexture(IDirect3DBaseTexture9* pSourceTexture, IDirect3DBaseTexture9* pDestinationTexture) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->UpdateTexture(pSourceTexture, pDestinationTexture);
|
return m_pWrapped->UpdateTexture(pSourceTexture, pDestinationTexture);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetRenderTargetData(IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetRenderTargetData(IDirect3DSurface9* pRenderTarget, IDirect3DSurface9* pDestSurface) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetRenderTargetData(pRenderTarget, pDestSurface);
|
return m_pWrapped->GetRenderTargetData(pRenderTarget, pDestSurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetFrontBufferData(UINT iSwapChain, IDirect3DSurface9* pDestSurface) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetFrontBufferData(UINT iSwapChain, IDirect3DSurface9* pDestSurface) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetFrontBufferData(iSwapChain, pDestSurface);
|
return m_pWrapped->GetFrontBufferData(iSwapChain, pDestSurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::StretchRect(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter) {
|
HRESULT APIENTRY hkIDirect3DDevice9::StretchRect(IDirect3DSurface9* pSourceSurface, CONST RECT* pSourceRect, IDirect3DSurface9* pDestSurface, CONST RECT* pDestRect, D3DTEXTUREFILTERTYPE Filter) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->StretchRect(pSourceSurface, pSourceRect, pDestSurface, pDestRect, Filter);
|
return m_pWrapped->StretchRect(pSourceSurface, pSourceRect, pDestSurface, pDestRect, Filter);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::ColorFill(IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color) {
|
HRESULT APIENTRY hkIDirect3DDevice9::ColorFill(IDirect3DSurface9* pSurface, CONST RECT* pRect, D3DCOLOR color) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->ColorFill(pSurface, pRect, color);
|
return m_pWrapped->ColorFill(pSurface, pRect, color);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateOffscreenPlainSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
|
HRESULT APIENTRY hkIDirect3DDevice9::CreateOffscreenPlainSurface(UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CreateOffscreenPlainSurface(Width, Height, Format, Pool, ppSurface, pSharedHandle);
|
return m_pWrapped->CreateOffscreenPlainSurface(Width, Height, Format, Pool, ppSurface, pSharedHandle);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9* pRenderTarget) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetRenderTarget(RenderTargetIndex, pRenderTarget);
|
return m_pWrapped->SetRenderTarget(RenderTargetIndex, pRenderTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetRenderTarget(DWORD RenderTargetIndex, IDirect3DSurface9** ppRenderTarget) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetRenderTarget(RenderTargetIndex, ppRenderTarget);
|
return m_pWrapped->GetRenderTarget(RenderTargetIndex, ppRenderTarget);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetDepthStencilSurface(IDirect3DSurface9* pNewZStencil) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetDepthStencilSurface(pNewZStencil);
|
return m_pWrapped->SetDepthStencilSurface(pNewZStencil);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetDepthStencilSurface(IDirect3DSurface9** ppZStencilSurface) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetDepthStencilSurface(IDirect3DSurface9** ppZStencilSurface) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetDepthStencilSurface(ppZStencilSurface);
|
return m_pWrapped->GetDepthStencilSurface(ppZStencilSurface);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::BeginScene() {
|
HRESULT APIENTRY hkIDirect3DDevice9::BeginScene() {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->BeginScene();
|
return m_pWrapped->BeginScene();
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::EndScene() {
|
HRESULT APIENTRY hkIDirect3DDevice9::EndScene() {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->EndScene();
|
return m_pWrapped->EndScene();
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::Clear(DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) {
|
HRESULT APIENTRY hkIDirect3DDevice9::Clear(DWORD Count, CONST D3DRECT* pRects, DWORD Flags, D3DCOLOR Color, float Z, DWORD Stencil) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->Clear(Count, pRects, Flags, Color, Z, Stencil);
|
return m_pWrapped->Clear(Count, pRects, Flags, Color, Z, Stencil);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetTransform(State, pMatrix);
|
return m_pWrapped->SetTransform(State, pMatrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetTransform(D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetTransform(D3DTRANSFORMSTATETYPE State, D3DMATRIX* pMatrix) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetTransform(State, pMatrix);
|
return m_pWrapped->GetTransform(State, pMatrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::MultiplyTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) {
|
HRESULT APIENTRY hkIDirect3DDevice9::MultiplyTransform(D3DTRANSFORMSTATETYPE State, CONST D3DMATRIX* pMatrix) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->MultiplyTransform(State, pMatrix);
|
return m_pWrapped->MultiplyTransform(State, pMatrix);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetViewport(CONST D3DVIEWPORT9* pViewport) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetViewport(CONST D3DVIEWPORT9* pViewport) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetViewport(pViewport);
|
return m_pWrapped->SetViewport(pViewport);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetViewport(D3DVIEWPORT9* pViewport) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetViewport(D3DVIEWPORT9* pViewport) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetViewport(pViewport);
|
return m_pWrapped->GetViewport(pViewport);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetMaterial(CONST D3DMATERIAL9* pMaterial) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetMaterial(CONST D3DMATERIAL9* pMaterial) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetMaterial(pMaterial);
|
return m_pWrapped->SetMaterial(pMaterial);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetMaterial(D3DMATERIAL9* pMaterial) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetMaterial(D3DMATERIAL9* pMaterial) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetMaterial(pMaterial);
|
return m_pWrapped->GetMaterial(pMaterial);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetLight(DWORD Index, CONST D3DLIGHT9* pLight) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetLight(DWORD Index, CONST D3DLIGHT9* pLight) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetLight(Index, pLight);
|
return m_pWrapped->SetLight(Index, pLight);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetLight(DWORD Index, D3DLIGHT9* pLight) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetLight(DWORD Index, D3DLIGHT9* pLight) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetLight(Index, pLight);
|
return m_pWrapped->GetLight(Index, pLight);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::LightEnable(DWORD Index, BOOL Enable) {
|
HRESULT APIENTRY hkIDirect3DDevice9::LightEnable(DWORD Index, BOOL Enable) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->LightEnable(Index, Enable);
|
return m_pWrapped->LightEnable(Index, Enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetLightEnable(DWORD Index, BOOL* pEnable) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetLightEnable(DWORD Index, BOOL* pEnable) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetLightEnable(Index, pEnable);
|
return m_pWrapped->GetLightEnable(Index, pEnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetClipPlane(DWORD Index, CONST float* pPlane) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetClipPlane(DWORD Index, CONST float* pPlane) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetClipPlane(Index, pPlane);
|
return m_pWrapped->SetClipPlane(Index, pPlane);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetClipPlane(DWORD Index, float* pPlane) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetClipPlane(DWORD Index, float* pPlane) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetClipPlane(Index, pPlane);
|
return m_pWrapped->GetClipPlane(Index, pPlane);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetRenderState(D3DRENDERSTATETYPE State, DWORD Value) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetRenderState(D3DRENDERSTATETYPE State, DWORD Value) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetRenderState(State, Value);
|
return m_pWrapped->SetRenderState(State, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetRenderState(D3DRENDERSTATETYPE State, DWORD* pValue) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetRenderState(D3DRENDERSTATETYPE State, DWORD* pValue) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetRenderState(State, pValue);
|
return m_pWrapped->GetRenderState(State, pValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateStateBlock(D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB) {
|
HRESULT APIENTRY hkIDirect3DDevice9::CreateStateBlock(D3DSTATEBLOCKTYPE Type, IDirect3DStateBlock9** ppSB) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CreateStateBlock(Type, ppSB);
|
return m_pWrapped->CreateStateBlock(Type, ppSB);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::BeginStateBlock() {
|
HRESULT APIENTRY hkIDirect3DDevice9::BeginStateBlock() {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->BeginStateBlock();
|
return m_pWrapped->BeginStateBlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::EndStateBlock(IDirect3DStateBlock9** ppSB) {
|
HRESULT APIENTRY hkIDirect3DDevice9::EndStateBlock(IDirect3DStateBlock9** ppSB) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->EndStateBlock(ppSB);
|
return m_pWrapped->EndStateBlock(ppSB);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetClipStatus(CONST D3DCLIPSTATUS9* pClipStatus) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetClipStatus(CONST D3DCLIPSTATUS9* pClipStatus) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetClipStatus(pClipStatus);
|
return m_pWrapped->SetClipStatus(pClipStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetClipStatus(D3DCLIPSTATUS9* pClipStatus) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetClipStatus(D3DCLIPSTATUS9* pClipStatus) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetClipStatus(pClipStatus);
|
return m_pWrapped->GetClipStatus(pClipStatus);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetTexture(DWORD Stage, IDirect3DBaseTexture9** ppTexture) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetTexture(DWORD Stage, IDirect3DBaseTexture9** ppTexture) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetTexture(Stage, ppTexture);
|
return m_pWrapped->GetTexture(Stage, ppTexture);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetTexture(DWORD Stage, IDirect3DBaseTexture9* pTexture) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetTexture(DWORD Stage, IDirect3DBaseTexture9* pTexture) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetTexture(Stage, pTexture);
|
return m_pWrapped->SetTexture(Stage, pTexture);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD* pValue) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetTextureStageState(Stage, Type, pValue);
|
return m_pWrapped->GetTextureStageState(Stage, Type, pValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetTextureStageState(DWORD Stage, D3DTEXTURESTAGESTATETYPE Type, DWORD Value) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetTextureStageState(Stage, Type, Value);
|
return m_pWrapped->SetTextureStageState(Stage, Type, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD* pValue) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetSamplerState(Sampler, Type, pValue);
|
return m_pWrapped->GetSamplerState(Sampler, Type, pValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetSamplerState(DWORD Sampler, D3DSAMPLERSTATETYPE Type, DWORD Value) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetSamplerState(Sampler, Type, Value);
|
return m_pWrapped->SetSamplerState(Sampler, Type, Value);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::ValidateDevice(DWORD* pNumPasses) {
|
HRESULT APIENTRY hkIDirect3DDevice9::ValidateDevice(DWORD* pNumPasses) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->ValidateDevice(pNumPasses);
|
return m_pWrapped->ValidateDevice(pNumPasses);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetPaletteEntries(UINT PaletteNumber, CONST PALETTEENTRY* pEntries) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetPaletteEntries(UINT PaletteNumber, CONST PALETTEENTRY* pEntries) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetPaletteEntries(PaletteNumber, pEntries);
|
return m_pWrapped->SetPaletteEntries(PaletteNumber, pEntries);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetPaletteEntries(UINT PaletteNumber, PALETTEENTRY* pEntries) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetPaletteEntries(UINT PaletteNumber, PALETTEENTRY* pEntries) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetPaletteEntries(PaletteNumber, pEntries);
|
return m_pWrapped->GetPaletteEntries(PaletteNumber, pEntries);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetCurrentTexturePalette(UINT PaletteNumber) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetCurrentTexturePalette(UINT PaletteNumber) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetCurrentTexturePalette(PaletteNumber);
|
return m_pWrapped->SetCurrentTexturePalette(PaletteNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetCurrentTexturePalette(UINT* PaletteNumber) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetCurrentTexturePalette(UINT* PaletteNumber) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetCurrentTexturePalette(PaletteNumber);
|
return m_pWrapped->GetCurrentTexturePalette(PaletteNumber);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetScissorRect(CONST RECT* pRect) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetScissorRect(CONST RECT* pRect) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return context.SetScissorRect(m_pWrapped, pRect);
|
return context.SetScissorRect(m_pWrapped, pRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetScissorRect(RECT* pRect) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetScissorRect(RECT* pRect) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetScissorRect(pRect);
|
return m_pWrapped->GetScissorRect(pRect);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetSoftwareVertexProcessing(BOOL bSoftware) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetSoftwareVertexProcessing(BOOL bSoftware) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetSoftwareVertexProcessing(bSoftware);
|
return m_pWrapped->SetSoftwareVertexProcessing(bSoftware);
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL APIENTRY hkIDirect3DDevice9::GetSoftwareVertexProcessing() {
|
BOOL APIENTRY hkIDirect3DDevice9::GetSoftwareVertexProcessing() {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetSoftwareVertexProcessing();
|
return m_pWrapped->GetSoftwareVertexProcessing();
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetNPatchMode(float nSegments) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetNPatchMode(float nSegments) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetNPatchMode(nSegments);
|
return m_pWrapped->SetNPatchMode(nSegments);
|
||||||
}
|
}
|
||||||
|
|
||||||
float APIENTRY hkIDirect3DDevice9::GetNPatchMode() {
|
float APIENTRY hkIDirect3DDevice9::GetNPatchMode() {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetNPatchMode();
|
return m_pWrapped->GetNPatchMode();
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) {
|
HRESULT APIENTRY hkIDirect3DDevice9::DrawPrimitive(D3DPRIMITIVETYPE PrimitiveType, UINT StartVertex, UINT PrimitiveCount) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->DrawPrimitive(PrimitiveType, StartVertex, PrimitiveCount);
|
return m_pWrapped->DrawPrimitive(PrimitiveType, StartVertex, PrimitiveCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount) {
|
HRESULT APIENTRY hkIDirect3DDevice9::DrawIndexedPrimitive(D3DPRIMITIVETYPE PrimitiveType, INT BaseVertexIndex, UINT MinVertexIndex, UINT NumVertices, UINT startIndex, UINT primCount) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->DrawIndexedPrimitive(PrimitiveType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
|
return m_pWrapped->DrawIndexedPrimitive(PrimitiveType, BaseVertexIndex, MinVertexIndex, NumVertices, startIndex, primCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) {
|
HRESULT APIENTRY hkIDirect3DDevice9::DrawPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT PrimitiveCount, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return context.DrawPrimitiveUP(m_pWrapped, PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride);
|
return context.DrawPrimitiveUP(m_pWrapped, PrimitiveType, PrimitiveCount, pVertexStreamZeroData, VertexStreamZeroStride);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) {
|
HRESULT APIENTRY hkIDirect3DDevice9::DrawIndexedPrimitiveUP(D3DPRIMITIVETYPE PrimitiveType, UINT MinVertexIndex, UINT NumVertices, UINT PrimitiveCount, CONST void* pIndexData, D3DFORMAT IndexDataFormat, CONST void* pVertexStreamZeroData, UINT VertexStreamZeroStride) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->DrawIndexedPrimitiveUP(PrimitiveType, MinVertexIndex, NumVertices, PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride);
|
return m_pWrapped->DrawIndexedPrimitiveUP(PrimitiveType, MinVertexIndex, NumVertices, PrimitiveCount, pIndexData, IndexDataFormat, pVertexStreamZeroData, VertexStreamZeroStride);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::ProcessVertices(UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags) {
|
HRESULT APIENTRY hkIDirect3DDevice9::ProcessVertices(UINT SrcStartIndex, UINT DestIndex, UINT VertexCount, IDirect3DVertexBuffer9* pDestBuffer, IDirect3DVertexDeclaration9* pVertexDecl, DWORD Flags) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->ProcessVertices(SrcStartIndex, DestIndex, VertexCount, pDestBuffer, pVertexDecl, Flags);
|
return m_pWrapped->ProcessVertices(SrcStartIndex, DestIndex, VertexCount, pDestBuffer, pVertexDecl, Flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl) {
|
HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexDeclaration(CONST D3DVERTEXELEMENT9* pVertexElements, IDirect3DVertexDeclaration9** ppDecl) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CreateVertexDeclaration(pVertexElements, ppDecl);
|
return m_pWrapped->CreateVertexDeclaration(pVertexElements, ppDecl);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetVertexDeclaration(IDirect3DVertexDeclaration9* pDecl) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetVertexDeclaration(pDecl);
|
return m_pWrapped->SetVertexDeclaration(pDecl);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetVertexDeclaration(IDirect3DVertexDeclaration9** ppDecl) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetVertexDeclaration(ppDecl);
|
return m_pWrapped->GetVertexDeclaration(ppDecl);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetFVF(DWORD FVF) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetFVF(DWORD FVF) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetFVF(FVF);
|
return m_pWrapped->SetFVF(FVF);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetFVF(DWORD* pFVF) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetFVF(DWORD* pFVF) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetFVF(pFVF);
|
return m_pWrapped->GetFVF(pFVF);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexShader(CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader) {
|
HRESULT APIENTRY hkIDirect3DDevice9::CreateVertexShader(CONST DWORD* pFunction, IDirect3DVertexShader9** ppShader) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CreateVertexShader(pFunction, ppShader);
|
return m_pWrapped->CreateVertexShader(pFunction, ppShader);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShader(IDirect3DVertexShader9* pShader) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShader(IDirect3DVertexShader9* pShader) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetVertexShader(pShader);
|
return m_pWrapped->SetVertexShader(pShader);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShader(IDirect3DVertexShader9** ppShader) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShader(IDirect3DVertexShader9** ppShader) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetVertexShader(ppShader);
|
return m_pWrapped->GetVertexShader(ppShader);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetVertexShaderConstantF(StartRegister, pConstantData, Vector4fCount);
|
return m_pWrapped->SetVertexShaderConstantF(StartRegister, pConstantData, Vector4fCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetVertexShaderConstantF(StartRegister, pConstantData, Vector4fCount);
|
return m_pWrapped->GetVertexShaderConstantF(StartRegister, pConstantData, Vector4fCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetVertexShaderConstantI(StartRegister, pConstantData, Vector4iCount);
|
return m_pWrapped->SetVertexShaderConstantI(StartRegister, pConstantData, Vector4iCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetVertexShaderConstantI(StartRegister, pConstantData, Vector4iCount);
|
return m_pWrapped->GetVertexShaderConstantI(StartRegister, pConstantData, Vector4iCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetVertexShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetVertexShaderConstantB(StartRegister, pConstantData, BoolCount);
|
return m_pWrapped->SetVertexShaderConstantB(StartRegister, pConstantData, BoolCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetVertexShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetVertexShaderConstantB(StartRegister, pConstantData, BoolCount);
|
return m_pWrapped->GetVertexShaderConstantB(StartRegister, pConstantData, BoolCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9* pStreamData, UINT OffsetInBytes, UINT Stride) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetStreamSource(StreamNumber, pStreamData, OffsetInBytes, Stride);
|
return m_pWrapped->SetStreamSource(StreamNumber, pStreamData, OffsetInBytes, Stride);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* pOffsetInBytes, UINT* pStride) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetStreamSource(UINT StreamNumber, IDirect3DVertexBuffer9** ppStreamData, UINT* pOffsetInBytes, UINT* pStride) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetStreamSource(StreamNumber, ppStreamData, pOffsetInBytes, pStride);
|
return m_pWrapped->GetStreamSource(StreamNumber, ppStreamData, pOffsetInBytes, pStride);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetStreamSourceFreq(UINT StreamNumber, UINT Setting) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetStreamSourceFreq(UINT StreamNumber, UINT Setting) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetStreamSourceFreq(StreamNumber, Setting);
|
return m_pWrapped->SetStreamSourceFreq(StreamNumber, Setting);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetStreamSourceFreq(UINT StreamNumber, UINT* pSetting) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetStreamSourceFreq(UINT StreamNumber, UINT* pSetting) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetStreamSourceFreq(StreamNumber, pSetting);
|
return m_pWrapped->GetStreamSourceFreq(StreamNumber, pSetting);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetIndices(IDirect3DIndexBuffer9* pIndexData) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetIndices(IDirect3DIndexBuffer9* pIndexData) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetIndices(pIndexData);
|
return m_pWrapped->SetIndices(pIndexData);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetIndices(IDirect3DIndexBuffer9** ppIndexData) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetIndices(IDirect3DIndexBuffer9** ppIndexData) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetIndices(ppIndexData);
|
return m_pWrapped->GetIndices(ppIndexData);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::CreatePixelShader(CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader) {
|
HRESULT APIENTRY hkIDirect3DDevice9::CreatePixelShader(CONST DWORD* pFunction, IDirect3DPixelShader9** ppShader) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CreatePixelShader(pFunction, ppShader);
|
return m_pWrapped->CreatePixelShader(pFunction, ppShader);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShader(IDirect3DPixelShader9* pShader) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShader(IDirect3DPixelShader9* pShader) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetPixelShader(pShader);
|
return m_pWrapped->SetPixelShader(pShader);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShader(IDirect3DPixelShader9** ppShader) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShader(IDirect3DPixelShader9** ppShader) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetPixelShader(ppShader);
|
return m_pWrapped->GetPixelShader(ppShader);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantF(UINT StartRegister, CONST float* pConstantData, UINT Vector4fCount) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetPixelShaderConstantF(StartRegister, pConstantData, Vector4fCount);
|
return m_pWrapped->SetPixelShaderConstantF(StartRegister, pConstantData, Vector4fCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantF(UINT StartRegister, float* pConstantData, UINT Vector4fCount) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetPixelShaderConstantF(StartRegister, pConstantData, Vector4fCount);
|
return m_pWrapped->GetPixelShaderConstantF(StartRegister, pConstantData, Vector4fCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantI(UINT StartRegister, CONST int* pConstantData, UINT Vector4iCount) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetPixelShaderConstantI(StartRegister, pConstantData, Vector4iCount);
|
return m_pWrapped->SetPixelShaderConstantI(StartRegister, pConstantData, Vector4iCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantI(UINT StartRegister, int* pConstantData, UINT Vector4iCount) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetPixelShaderConstantI(StartRegister, pConstantData, Vector4iCount);
|
return m_pWrapped->GetPixelShaderConstantI(StartRegister, pConstantData, Vector4iCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) {
|
HRESULT APIENTRY hkIDirect3DDevice9::SetPixelShaderConstantB(UINT StartRegister, CONST BOOL* pConstantData, UINT BoolCount) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetPixelShaderConstantB(StartRegister, pConstantData, BoolCount);
|
return m_pWrapped->SetPixelShaderConstantB(StartRegister, pConstantData, BoolCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount) {
|
HRESULT APIENTRY hkIDirect3DDevice9::GetPixelShaderConstantB(UINT StartRegister, BOOL* pConstantData, UINT BoolCount) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetPixelShaderConstantB(StartRegister, pConstantData, BoolCount);
|
return m_pWrapped->GetPixelShaderConstantB(StartRegister, pConstantData, BoolCount);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::DrawRectPatch(UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo) {
|
HRESULT APIENTRY hkIDirect3DDevice9::DrawRectPatch(UINT Handle, CONST float* pNumSegs, CONST D3DRECTPATCH_INFO* pRectPatchInfo) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->DrawRectPatch(Handle, pNumSegs, pRectPatchInfo);
|
return m_pWrapped->DrawRectPatch(Handle, pNumSegs, pRectPatchInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::DrawTriPatch(UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo) {
|
HRESULT APIENTRY hkIDirect3DDevice9::DrawTriPatch(UINT Handle, CONST float* pNumSegs, CONST D3DTRIPATCH_INFO* pTriPatchInfo) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->DrawTriPatch(Handle, pNumSegs, pTriPatchInfo);
|
return m_pWrapped->DrawTriPatch(Handle, pNumSegs, pTriPatchInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::DeletePatch(UINT Handle) {
|
HRESULT APIENTRY hkIDirect3DDevice9::DeletePatch(UINT Handle) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->DeletePatch(Handle);
|
return m_pWrapped->DeletePatch(Handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT APIENTRY hkIDirect3DDevice9::CreateQuery(D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery) {
|
HRESULT APIENTRY hkIDirect3DDevice9::CreateQuery(D3DQUERYTYPE Type, IDirect3DQuery9** ppQuery) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CreateQuery(Type, ppQuery);
|
return m_pWrapped->CreateQuery(Type, ppQuery);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::SetConvolutionMonoKernel(UINT width, UINT height, float* rows, float* columns) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::SetConvolutionMonoKernel(UINT width, UINT height, float* rows, float* columns) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetConvolutionMonoKernel(width, height, rows, columns);
|
return m_pWrapped->SetConvolutionMonoKernel(width, height, rows, columns);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::ComposeRects(IDirect3DSurface9* pSrc, IDirect3DSurface9* pDst, IDirect3DVertexBuffer9* pSrcRectDescs, UINT NumRects, IDirect3DVertexBuffer9* pDstRectDescs, D3DCOMPOSERECTSOP Operation, int Xoffset, int Yoffset) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::ComposeRects(IDirect3DSurface9* pSrc, IDirect3DSurface9* pDst, IDirect3DVertexBuffer9* pSrcRectDescs, UINT NumRects, IDirect3DVertexBuffer9* pDstRectDescs, D3DCOMPOSERECTSOP Operation, int Xoffset, int Yoffset) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->ComposeRects(pSrc, pDst, pSrcRectDescs, NumRects, pDstRectDescs, Operation, Xoffset, Yoffset);
|
return m_pWrapped->ComposeRects(pSrc, pDst, pSrcRectDescs, NumRects, pDstRectDescs, Operation, Xoffset, Yoffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::PresentEx(const RECT* pSourceRect, const RECT* pDestRect, HWND hDestWindowOverride, const RGNDATA* pDirtyRegion, DWORD dwFlags) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::PresentEx(const RECT* pSourceRect, const RECT* pDestRect, HWND hDestWindowOverride, const RGNDATA* pDirtyRegion, DWORD dwFlags) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->PresentEx(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion, dwFlags);
|
return m_pWrapped->PresentEx(pSourceRect, pDestRect, hDestWindowOverride, pDirtyRegion, dwFlags);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::GetGPUThreadPriority(INT* pPriority) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::GetGPUThreadPriority(INT* pPriority) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetGPUThreadPriority(pPriority);
|
return m_pWrapped->GetGPUThreadPriority(pPriority);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::SetGPUThreadPriority(INT Priority) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::SetGPUThreadPriority(INT Priority) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetGPUThreadPriority(Priority);
|
return m_pWrapped->SetGPUThreadPriority(Priority);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::WaitForVBlank(UINT iSwapChain) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::WaitForVBlank(UINT iSwapChain) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->WaitForVBlank(iSwapChain);
|
return m_pWrapped->WaitForVBlank(iSwapChain);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::CheckResourceResidency(IDirect3DResource9** pResourceArray, UINT32 NumResources) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::CheckResourceResidency(IDirect3DResource9** pResourceArray, UINT32 NumResources) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CheckResourceResidency(pResourceArray, NumResources);
|
return m_pWrapped->CheckResourceResidency(pResourceArray, NumResources);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::SetMaximumFrameLatency(UINT MaxLatency) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::SetMaximumFrameLatency(UINT MaxLatency) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->SetMaximumFrameLatency(MaxLatency);
|
return m_pWrapped->SetMaximumFrameLatency(MaxLatency);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::GetMaximumFrameLatency(UINT* pMaxLatency) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::GetMaximumFrameLatency(UINT* pMaxLatency) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetMaximumFrameLatency(pMaxLatency);
|
return m_pWrapped->GetMaximumFrameLatency(pMaxLatency);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::CheckDeviceState(HWND hDestinationWindow) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::CheckDeviceState(HWND hDestinationWindow) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CheckDeviceState(hDestinationWindow);
|
return m_pWrapped->CheckDeviceState(hDestinationWindow);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::CreateRenderTargetEx(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle, DWORD Usage) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::CreateRenderTargetEx(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Lockable, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle, DWORD Usage) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CreateRenderTargetEx(Width, Height, Format, MultiSample, MultisampleQuality, Lockable, ppSurface, pSharedHandle, Usage);
|
return m_pWrapped->CreateRenderTargetEx(Width, Height, Format, MultiSample, MultisampleQuality, Lockable, ppSurface, pSharedHandle, Usage);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::CreateOffscreenPlainSurfaceEx(UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle, DWORD Usage) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::CreateOffscreenPlainSurfaceEx(UINT Width, UINT Height, D3DFORMAT Format, D3DPOOL Pool, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle, DWORD Usage) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CreateOffscreenPlainSurfaceEx(Width, Height, Format, Pool, ppSurface, pSharedHandle, Usage);
|
return m_pWrapped->CreateOffscreenPlainSurfaceEx(Width, Height, Format, Pool, ppSurface, pSharedHandle, Usage);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::CreateDepthStencilSurfaceEx(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle, DWORD Usage) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::CreateDepthStencilSurfaceEx(UINT Width, UINT Height, D3DFORMAT Format, D3DMULTISAMPLE_TYPE MultiSample, DWORD MultisampleQuality, BOOL Discard, IDirect3DSurface9** ppSurface, HANDLE* pSharedHandle, DWORD Usage) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->CreateDepthStencilSurfaceEx(Width, Height, Format, MultiSample, MultisampleQuality, Discard, ppSurface, pSharedHandle, Usage);
|
return m_pWrapped->CreateDepthStencilSurfaceEx(Width, Height, Format, MultiSample, MultisampleQuality, Discard, ppSurface, pSharedHandle, Usage);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::ResetEx(D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::ResetEx(D3DPRESENT_PARAMETERS* pPresentationParameters, D3DDISPLAYMODEEX* pFullscreenDisplayMode) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->ResetEx(pPresentationParameters, pFullscreenDisplayMode);
|
return m_pWrapped->ResetEx(pPresentationParameters, pFullscreenDisplayMode);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::GetDisplayModeEx(UINT iSwapChain, D3DDISPLAYMODEEX* pMode, D3DDISPLAYROTATION* pRotation) {
|
HRESULT STDMETHODCALLTYPE hkIDirect3DDevice9::GetDisplayModeEx(UINT iSwapChain, D3DDISPLAYMODEEX* pMode, D3DDISPLAYROTATION* pRotation) {
|
||||||
IDirect3DDevice9_PrintLog(__FUNCTION__);
|
spdlog::trace(__FUNCTION__);
|
||||||
return m_pWrapped->GetDisplayModeEx(iSwapChain, pMode, pRotation);
|
return m_pWrapped->GetDisplayModeEx(iSwapChain, pMode, pRotation);
|
||||||
}
|
}
|
|
@ -4,14 +4,14 @@ SETTING(s32, LongValue, PresentationInterval, Options, 0,
|
||||||
L"# PresentationInterval (V-Sync)\n"
|
L"# PresentationInterval (V-Sync)\n"
|
||||||
L"#\n"
|
L"#\n"
|
||||||
L"# -1 = V-Sync forced off\n"
|
L"# -1 = V-Sync forced off\n"
|
||||||
L"# 0 = V-Sync not changed\n"
|
L"# 0 = V-Sync not changed (default)\n"
|
||||||
L"# 1 = V-Sync forced on"
|
L"# 1 = V-Sync forced on"
|
||||||
);
|
);
|
||||||
|
|
||||||
SETTING(s32, LongValue, TripleBuffering, Options, -1,
|
SETTING(s32, LongValue, TripleBuffering, Options, -1,
|
||||||
L"# TripleBuffering\n"
|
L"# TripleBuffering\n"
|
||||||
L"#\n"
|
L"#\n"
|
||||||
L"# -1 = Auto (Disabled for dxvk.dll; else, enabled)\n"
|
L"# -1 = Auto (Disabled for dxvk.dll; else, enabled) (default)\n"
|
||||||
L"# 0 = Off\n"
|
L"# 0 = Off\n"
|
||||||
L"# 1 = On"
|
L"# 1 = On"
|
||||||
);
|
);
|
||||||
|
@ -87,5 +87,23 @@ SETTING(bool, BoolValue, Borderless, Borderless, false, 0);
|
||||||
SETTING(bool, BoolValue, ForceWindowedMode, Borderless, false, 0);
|
SETTING(bool, BoolValue, ForceWindowedMode, Borderless, false, 0);
|
||||||
SETTING(bool, BoolValue, AllWindows, Borderless, false, 0);
|
SETTING(bool, BoolValue, AllWindows, Borderless, false, 0);
|
||||||
|
|
||||||
|
SETTING(s32, LongValue, LogLevel, Log, 2,
|
||||||
|
L"# LogLevel\n"
|
||||||
|
L"#\n"
|
||||||
|
L"# 0 = trace\n"
|
||||||
|
L"# 1 = debug\n"
|
||||||
|
L"# 2 = info (default)\n"
|
||||||
|
L"# 3 = warning\n"
|
||||||
|
L"# 4 = error\n"
|
||||||
|
L"# 5 = critical"
|
||||||
|
);
|
||||||
|
|
||||||
|
SETTING(bool, BoolValue, LogFlush, Log, false,
|
||||||
|
L"# LogFlush\n"
|
||||||
|
L"#\n"
|
||||||
|
L"# true = flush log file every line (very slow!)\n"
|
||||||
|
L"# false = flush log file only when error level message is logged (default)"
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#define CINTERFACE
|
#define CINTERFACE
|
||||||
#include <d3d9.h>
|
#include <d3d9.h>
|
||||||
|
|
||||||
#include "Logger.h"
|
#include "spdlog/spdlog.h"
|
||||||
#include "MinHook.h"
|
#include "MinHook.h"
|
||||||
|
|
||||||
namespace cinterface
|
namespace cinterface
|
||||||
|
@ -10,7 +10,7 @@ namespace cinterface
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE HookLock(IDirect3DVertexBuffer9* This, UINT OffsetToLock, UINT SizeToLock, void** ppbData, DWORD Flags)
|
HRESULT STDMETHODCALLTYPE HookLock(IDirect3DVertexBuffer9* This, UINT OffsetToLock, UINT SizeToLock, void** ppbData, DWORD Flags)
|
||||||
{
|
{
|
||||||
//PrintLog(__FUNCTION__" %u", SizeToLock);
|
spdlog::trace(__FUNCTION__" {}", SizeToLock);
|
||||||
if (SizeToLock == 358400)
|
if (SizeToLock == 358400)
|
||||||
Flags = D3DLOCK_DISCARD;
|
Flags = D3DLOCK_DISCARD;
|
||||||
return TrueLock(This, OffsetToLock, SizeToLock, ppbData, Flags);
|
return TrueLock(This, OffsetToLock, SizeToLock, ppbData, Flags);
|
||||||
|
@ -20,11 +20,11 @@ namespace cinterface
|
||||||
{
|
{
|
||||||
if (pVertexBuffer->lpVtbl->Lock && TrueLock == nullptr)
|
if (pVertexBuffer->lpVtbl->Lock && TrueLock == nullptr)
|
||||||
{
|
{
|
||||||
PrintLog("WARNING: Experimental DiscardUIVertexBuffer enabled!");
|
spdlog::warn("Experimental DiscardUIVertexBuffer enabled!");
|
||||||
const MH_STATUS createHookLock = MH_CreateHook(pVertexBuffer->lpVtbl->Lock, HookLock, reinterpret_cast<void**>(&TrueLock));
|
const MH_STATUS createHookLock = MH_CreateHook(pVertexBuffer->lpVtbl->Lock, HookLock, reinterpret_cast<void**>(&TrueLock));
|
||||||
PrintLog("CreateHookLock = %d", createHookLock);
|
spdlog::info("CreateHookLock = {}", createHookLock);
|
||||||
const MH_STATUS enableHookLock = MH_EnableHook(pVertexBuffer->lpVtbl->Lock);
|
const MH_STATUS enableHookLock = MH_EnableHook(pVertexBuffer->lpVtbl->Lock);
|
||||||
PrintLog("EnableHookLock = %d", enableHookLock);
|
spdlog::info("EnableHookLock = {}", enableHookLock);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,8 +1,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "comdef.h"
|
#include <comdef.h>
|
||||||
#include <d3d9.h>
|
#include <d3d9.h>
|
||||||
|
|
||||||
|
#include "StringUtil.h"
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class WrapperBase
|
class WrapperBase
|
||||||
{
|
{
|
||||||
|
@ -17,7 +19,7 @@ public:
|
||||||
if (m_module)
|
if (m_module)
|
||||||
{
|
{
|
||||||
FreeLibrary(m_module);
|
FreeLibrary(m_module);
|
||||||
PrintLog("Unloaded %s", module_path.c_str());
|
spdlog::info("Unloaded {}", module_path);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,16 +36,16 @@ protected:
|
||||||
m_module = LoadLibraryA(module_path.c_str());
|
m_module = LoadLibraryA(module_path.c_str());
|
||||||
|
|
||||||
if (m_module) {
|
if (m_module) {
|
||||||
PrintLog("Loaded %s", module_path.c_str());
|
spdlog::info("Loaded {}", module_path);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
else if(fail_is_critical) {
|
else if(fail_is_critical) {
|
||||||
HRESULT hr = HRESULT_FROM_WIN32(GetLastError());
|
HRESULT hr = HRESULT_FROM_WIN32(GetLastError());
|
||||||
_com_error err(hr);
|
_com_error err(hr);
|
||||||
|
|
||||||
std::string msg = StringFromFormat("Cannot load %s\nHRESULT 0x%08X: \"%s\"", module_path.c_str(), err.Error(), err.ErrorMessage());
|
std::string msg = StringFromFormat("Cannot load %s\nHRESULT 0x{:X} \"{}\"", module_path.c_str(), err.Error(), err.ErrorMessage());
|
||||||
|
|
||||||
PrintLog(msg.c_str());
|
spdlog::critical(msg);
|
||||||
MessageBoxA(NULL, msg.c_str(), "Error", MB_ICONERROR);
|
MessageBoxA(NULL, msg.c_str(), "Error", MB_ICONERROR);
|
||||||
ExitProcess(hr);
|
ExitProcess(hr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
<TargetName>d3d9</TargetName>
|
<TargetName>d3d9</TargetName>
|
||||||
<IncludePath>$(SolutionDir)\Common;$(SolutionDir)\MinHook\include;$(DXSDK_DIR)\Include;$(IncludePath)</IncludePath>
|
<IncludePath>$(SolutionDir)\Common;$(SolutionDir)\Deps\MinHook\include;$(SolutionDir)\Deps\spdlog\include;$(IncludePath)</IncludePath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<LinkIncremental>true</LinkIncremental>
|
<LinkIncremental>true</LinkIncremental>
|
||||||
|
@ -84,7 +84,7 @@
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
<TargetName>d3d9</TargetName>
|
<TargetName>d3d9</TargetName>
|
||||||
<IncludePath>$(SolutionDir)\Common;$(SolutionDir)\MinHook\include;$(DXSDK_DIR)\Include;$(IncludePath)</IncludePath>
|
<IncludePath>$(SolutionDir)\Common;$(SolutionDir)\Deps\MinHook\include;$(SolutionDir)\Deps\spdlog\include;$(IncludePath)</IncludePath>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
<LinkIncremental>false</LinkIncremental>
|
<LinkIncremental>false</LinkIncremental>
|
||||||
|
@ -96,10 +96,11 @@
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<Optimization>Disabled</Optimization>
|
<Optimization>Disabled</Optimization>
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;D3D9EX_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;SPDLOG_DISABLE_DEFAULT_LOGGER;SPDLOG_WCHAR_TO_UTF8_SUPPORT;_DEBUG;_WINDOWS;_USRDLL;D3D9EX_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
|
||||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||||
|
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
@ -128,13 +129,14 @@
|
||||||
<WarningLevel>Level3</WarningLevel>
|
<WarningLevel>Level3</WarningLevel>
|
||||||
<PrecompiledHeader>Use</PrecompiledHeader>
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;D3D9EX_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
<PreprocessorDefinitions>WIN32;SPDLOG_DISABLE_DEFAULT_LOGGER;SPDLOG_WCHAR_TO_UTF8_SUPPORT;NDEBUG;_WINDOWS;_USRDLL;D3D9EX_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
<SDLCheck>true</SDLCheck>
|
<SDLCheck>true</SDLCheck>
|
||||||
<Optimization>MaxSpeed</Optimization>
|
<Optimization>MaxSpeed</Optimization>
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
<RuntimeLibrary>MultiThreaded</RuntimeLibrary>
|
||||||
<LanguageStandard>stdcpplatest</LanguageStandard>
|
<LanguageStandard>stdcpplatest</LanguageStandard>
|
||||||
<CreateHotpatchableImage>true</CreateHotpatchableImage>
|
<CreateHotpatchableImage>true</CreateHotpatchableImage>
|
||||||
|
<AdditionalOptions>/Zc:__cplusplus %(AdditionalOptions)</AdditionalOptions>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<Link>
|
<Link>
|
||||||
<SubSystem>Windows</SubSystem>
|
<SubSystem>Windows</SubSystem>
|
||||||
|
@ -212,7 +214,7 @@
|
||||||
<None Include="exports.def" />
|
<None Include="exports.def" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\MinHook\build\VC16\libMinHook.vcxproj">
|
<ProjectReference Include="..\Deps\MinHook\build\VC16\libMinHook.vcxproj">
|
||||||
<Project>{f142a341-5ee0-442d-a15f-98ae9b48dbae}</Project>
|
<Project>{f142a341-5ee0-442d-a15f-98ae9b48dbae}</Project>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
|
@ -25,3 +25,5 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
|
#include "Context.h"
|
Loading…
Reference in a new issue