From 4b07797d5f60d9718a89fd9d84cc9da8080fb2cb Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Thu, 25 Apr 2019 03:07:42 +0200 Subject: [PATCH 1/2] Correct UiProgressDialog based on DevilutionX --- DiabloUI/diabloui.h | 2 +- DiabloUI/progress.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/DiabloUI/diabloui.h b/DiabloUI/diabloui.h index 349307aec..be52d82de 100644 --- a/DiabloUI/diabloui.h +++ b/DiabloUI/diabloui.h @@ -35,7 +35,7 @@ BOOL __stdcall UiSelHeroMultDialog(BOOL(__stdcall *fninfo)(BOOL(__stdcall *fninf BOOL __stdcall UiSelHeroSingDialog(BOOL(__stdcall *fninfo)(BOOL(__stdcall *fninfofunc)(_uiheroinfo *)), BOOL(__stdcall *fncreate)(_uiheroinfo *), BOOL(__stdcall *fnremove)(_uiheroinfo *), BOOL(__stdcall *fnstats)(unsigned int, _uidefaultstats *), int *dlgresult, char *name, int *difficulty); BOOL __stdcall UiCreditsDialog(int a1); BOOL __stdcall UiMainMenuDialog(char *name, int *pdwResult, void(__stdcall *fnSound)(char *file), int a4); -int __stdcall UiProgressDialog(HWND window, char *msg, int a3, void *fnfunc, int a5); +BOOL __stdcall UiProgressDialog(HWND window, char *msg, int enable, int(*fnfunc)(), int rate); int __stdcall UiProfileGetString(); void __cdecl UiProfileCallback(); void __cdecl UiProfileDraw(); diff --git a/DiabloUI/progress.cpp b/DiabloUI/progress.cpp index 7edaeb52f..dccfcf8b2 100644 --- a/DiabloUI/progress.cpp +++ b/DiabloUI/progress.cpp @@ -10,7 +10,7 @@ signed int Progress_10009480() { return 0; } // 1002A2EC: using guessed type int dword_1002A2EC; // ref: 0x1000948B -int __stdcall UiProgressDialog(HWND window, char *msg, int a3, void *fnfunc, int a5) { return 0; } +BOOL __stdcall UiProgressDialog(HWND window, char *msg, int enable, int(*fnfunc)(), int rate) { return 0; } /* { HWND v5; // eax BOOL result; // eax From 228dbf4897a4805351bb712e1acf0803b14a0264 Mon Sep 17 00:00:00 2001 From: Anders Jenbo Date: Tue, 30 Apr 2019 15:36:32 +0200 Subject: [PATCH 2/2] Cast pointer to a CPU appropriate size --- Source/dx.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/dx.cpp b/Source/dx.cpp index fea1fdff3..c656f21e9 100644 --- a/Source/dx.cpp +++ b/Source/dx.cpp @@ -241,7 +241,7 @@ void lock_buf_priv() if (error_code != DD_OK) DDErrMsg(error_code, 235, "C:\\Src\\Diablo\\Source\\dx.cpp"); - gpBufEnd += (int)ddsd.lpSurface; + gpBufEnd += (size_t)ddsd.lpSurface; gpBuffer = (BYTE *)ddsd.lpSurface; sgdwLockCount++; } @@ -267,7 +267,7 @@ void unlock_buf_priv() sgdwLockCount--; if (sgdwLockCount == 0) { - gpBufEnd -= (int)gpBuffer; + gpBufEnd -= (size_t)gpBuffer; gpBuffer = NULL; if (sgpBackBuf == NULL) { #ifdef __cplusplus