mirror of
https://github.com/sfall-team/sfall.git
synced 2026-07-27 16:52:34 -07:00
Fixed unnecessary path searching for loading external wrapper
(ref. https://github.com/sfall-team/sfall/issues/504#issuecomment-1962314458)
This commit is contained in:
@@ -1263,7 +1263,7 @@ void Graphics::init() {
|
||||
if (!h) {
|
||||
dlogr(" Failed", DL_INIT);
|
||||
MessageBoxA(0, "You have selected DirectX graphics mode, but " _DLL_NAME " is missing.\n"
|
||||
"Switch back to DirectDraw (Mode=0), or install an up to date version of DirectX 9.0c.", 0, MB_TASKMODAL | MB_ICONERROR);
|
||||
"Switch back to DirectDraw (Mode=0), or install an up-to-date version of DirectX 9.0c.", 0, MB_TASKMODAL | MB_ICONERROR);
|
||||
#undef _DLL_NAME
|
||||
ExitProcess(-1);
|
||||
}
|
||||
|
||||
+3
-2
@@ -313,11 +313,12 @@ defaultIni:
|
||||
static void LoadOriginalDll(DWORD fdwReason) {
|
||||
switch (fdwReason) {
|
||||
case DLL_PROCESS_ATTACH:
|
||||
ddraw.dll = LoadLibraryA("wrapper\\ddraw.dll"); // external DirectDraw wrapper
|
||||
char path[MAX_PATH];
|
||||
GetFullPathNameA("wrapper\\ddraw.dll", MAX_PATH, path, NULL);
|
||||
ddraw.dll = LoadLibraryA(path); // external DirectDraw wrapper
|
||||
if (ddraw.dll) {
|
||||
sfall::extWrapper = true;
|
||||
} else {
|
||||
char path[MAX_PATH];
|
||||
CopyMemory(path + GetSystemDirectoryA(path, MAX_PATH - 10), "\\ddraw.dll", 11); // path to original dll
|
||||
ddraw.dll = LoadLibraryA(path);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user