From e17ad5d11b5796532998f523dfb2ae61d3b1c708 Mon Sep 17 00:00:00 2001 From: NovaRain Date: Wed, 19 Jan 2022 09:41:37 +0800 Subject: [PATCH] Minor code edits --- artifacts/ddraw.ini | 2 +- sfall/HRP/Init.cpp | 2 +- sfall/InputFuncs.cpp | 1 + sfall/Modules/Graphics.cpp | 5 ++--- sfall/Modules/Sound.cpp | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/artifacts/ddraw.ini b/artifacts/ddraw.ini index 550cf868..34843ba7 100644 --- a/artifacts/ddraw.ini +++ b/artifacts/ddraw.ini @@ -6,7 +6,7 @@ ;The required settings will be read from f2_res.ini configuration file from the original hi-res patch HiResMode=1 -;Set to 1 if you want to use command line args to tell sfall to use another ini file +;Set to 1 if you want to use command line arguments to tell sfall to use another ini file ;This option is always enabled in 4.3.3/3.8.33 or later. The information is left for reference only UseCommandLine=0 diff --git a/sfall/HRP/Init.cpp b/sfall/HRP/Init.cpp index dccf1331..483d6500 100644 --- a/sfall/HRP/Init.cpp +++ b/sfall/HRP/Init.cpp @@ -188,7 +188,7 @@ void Setting::init(const char* exeFileName, std::string &cmdline) { sf::Translate::Get("sfall", "HiResInfo", "This version of sfall has its own integrated High Resolution Patch mode, which is compatible with the settings of the High Resolution Patch by Mash.\n\n" "If you want to continue using the Hi-Res Patch by Mash without seeing this message, disable the 'HiResMode' option in ddraw.ini.\n" - "Or you can disable the external Hi-Res Patch to get new graphic improvements from sfall.\n\n" + "Or you can disable the external Hi-Res Patch to get new graphics improvements from sfall.\n\n" "Do you want to disable the High Resolution Patch by Mash?", infoMsg, 512); // replace \n for translated message diff --git a/sfall/InputFuncs.cpp b/sfall/InputFuncs.cpp index e59b7be2..ff69e263 100644 --- a/sfall/InputFuncs.cpp +++ b/sfall/InputFuncs.cpp @@ -465,6 +465,7 @@ typedef HRESULT (__stdcall *DInputCreateProc)(HINSTANCE a,DWORD b,IDirectInputA* HRESULT __stdcall FakeDirectInputCreate(HINSTANCE a, DWORD b, IDirectInputA** c, IUnknown* d) { HMODULE dinput = LoadLibraryA("dinput.dll"); if (!dinput || dinput == INVALID_HANDLE_VALUE) return -1; + DInputCreateProc proc = (DInputCreateProc)GetProcAddress(dinput, "DirectInputCreateA"); if (!proc) return -1; diff --git a/sfall/Modules/Graphics.cpp b/sfall/Modules/Graphics.cpp index 863d4c18..4e7d07fb 100644 --- a/sfall/Modules/Graphics.cpp +++ b/sfall/Modules/Graphics.cpp @@ -658,12 +658,11 @@ public: int pitch = dRect.Pitch / 4; DWORD* pBits = (DWORD*)dRect.pBits; - BYTE* target = mveSurface; while (height--) { int x = width; - while (x--) pBits[x] = palette[target[x]].xRGB; - target += width; + while (x--) pBits[x] = palette[mveSurface[x]].xRGB; + mveSurface += width; pBits += pitch; } } diff --git a/sfall/Modules/Sound.cpp b/sfall/Modules/Sound.cpp index 8ed37873..d41db0e3 100644 --- a/sfall/Modules/Sound.cpp +++ b/sfall/Modules/Sound.cpp @@ -1094,7 +1094,7 @@ void Sound::init() { MakeCall(0x4450C5, gdialogFreeSpeech_hack, 2); // Prepare - LoadLibraryA("quartz.dll"); + //LoadLibraryA("quartz.dll"); CreateSndWnd(); }