From 42045790412b34af69b539ee07f6a9c480eaf0bb Mon Sep 17 00:00:00 2001 From: "v.vorobev" Date: Mon, 6 Nov 2023 23:13:53 +0300 Subject: [PATCH] support for dxvk --- M2TWEOP Code/d3d9/initDX.h | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/M2TWEOP Code/d3d9/initDX.h b/M2TWEOP Code/d3d9/initDX.h index cbd1340a2..850b891c7 100644 --- a/M2TWEOP Code/d3d9/initDX.h +++ b/M2TWEOP Code/d3d9/initDX.h @@ -29,18 +29,28 @@ void initDX9() // Load dll wchar_t path[MAX_PATH]; - GetSystemDirectoryW(path, MAX_PATH); + GetCurrentDirectoryW(MAX_PATH, path); std::wstring libPath = path; - libPath += L"\\d3d9.dll"; - //GetCurrentDirectoryA(MAX_PATH,path); - - + libPath += L"\\d3d9_vk.dll"; d3d9dll = LoadLibraryW(libPath.c_str()); if (d3d9dll == NULL) { - MessageBoxA(NULL, "Cannot find d3d9.dll in system directory!", "ATTENTION!", NULL); - exit(0); + GetSystemDirectoryW(path, MAX_PATH); + libPath = path; + libPath += L"\\d3d9.dll"; + + d3d9dll = LoadLibraryW(libPath.c_str()); + if (d3d9dll == NULL) + { + MessageBoxA(NULL, "Cannot find d3d9.dll in system directory!", "ATTENTION!", NULL); + exit(0); + } } + + //GetCurrentDirectoryA(MAX_PATH,path); + + + /*DWORD err = GetLastError(); if (err) {