Browse Source

Merge branch 'nightly' of github.com:diasurgical/devilution into StartPlayerKill

pull/4/head
Anders Jenbo 8 years ago
parent
commit
b5e2f74f65
  1. 19
      .editorconfig
  2. 2
      .travis/are-we-d1-yet.sh
  3. 7
      3rdParty/Storm/Source/storm.cpp
  4. 14
      3rdParty/Storm/Source/storm.def
  5. 8
      3rdParty/Storm/Source/storm.h
  6. 17
      3rdParty/Storm/Source/storm_gcc.def
  7. 285
      DiabloUI/_temp_data.cpp
  8. 370
      DiabloUI/_temp_funcs.h
  9. 88
      DiabloUI/artfont.cpp
  10. 1000
      DiabloUI/connect.cpp
  11. 183
      DiabloUI/copyprot.cpp
  12. 523
      DiabloUI/cr8game.cpp
  13. 401
      DiabloUI/creadung.cpp
  14. 34
      DiabloUI/creastat.cpp
  15. 311
      DiabloUI/credits.cpp
  16. 12
      DiabloUI/diabloui.cpp
  17. 36
      DiabloUI/diabloui.h
  18. 10
      DiabloUI/diabloui_gcc.def
  19. 24
      DiabloUI/doom.cpp
  20. 154
      DiabloUI/entname.cpp
  21. 13
      DiabloUI/local.cpp
  22. 276
      DiabloUI/mainmenu.cpp
  23. 305
      DiabloUI/okcancel.cpp
  24. 299
      DiabloUI/sbar.cpp
  25. 192
      DiabloUI/selclass.cpp
  26. 1079
      DiabloUI/selhero.cpp
  27. 821
      DiabloUI/sellist.cpp
  28. 129
      DiabloUI/selload.cpp
  29. 12
      DiabloUI/selregn.cpp
  30. 260
      DiabloUI/selyesno.cpp
  31. 18
      Source/control.cpp
  32. 6
      Source/control.h
  33. 2
      Source/debug.cpp
  34. 2
      Source/init.cpp
  35. 4
      Source/inv.cpp
  36. 34
      Source/items.cpp
  37. 12
      Source/missiles.cpp
  38. 2
      Source/msg.cpp
  39. 16
      Source/multi.cpp
  40. 6
      Source/objects.cpp
  41. 4
      Source/pack.cpp
  42. 8
      Source/pfile.cpp
  43. 8
      Source/pfile.h
  44. 573
      Source/player.cpp
  45. 6
      Source/player.h
  46. 2
      Source/portal.cpp
  47. 2
      Source/portal.h
  48. 8
      Source/scrollrt.cpp
  49. 10
      Source/spells.cpp
  50. 2
      Source/spells.h
  51. 2
      Source/stores.cpp
  52. 1
      defs.h
  53. 10
      structs.h

19
.editorconfig

@ -1,8 +1,11 @@
root = true root = true
[*] [*]
indent_style = tab indent_style = tab
end_of_line = crlf end_of_line = crlf
charset = utf-8 charset = utf-8
trim_trailing_whitespace = true trim_trailing_whitespace = true
insert_final_newline = true insert_final_newline = true
[*.sh]
end_of_line = lf

2
.travis/are-we-d1-yet.sh

@ -3,7 +3,7 @@
# based on https://github.com/k3rn31p4nic/travis-ci-discord-webhook # based on https://github.com/k3rn31p4nic/travis-ci-discord-webhook
# Only run for commits/builds on master, not for PRs for now # Only run for commits/builds on master, not for PRs for now
if [[ "$TRAVIS_BRANCH" != "master" || $TRAVIS_PULL_REQUEST != "false" ]]; then if [[ "$TRAVIS_BRANCH" != "nightly" || $TRAVIS_PULL_REQUEST != "false" ]]; then
exit exit
fi fi

7
3rdParty/Storm/Source/storm.cpp vendored

@ -7,9 +7,7 @@
BOOL STORMAPI SNetCreateGame(const char *pszGameName, const char *pszGamePassword, const char *pszGameStatString, DWORD dwGameType, char *GameTemplateData, int GameTemplateSize, int playerCount, char *creatorName, char *a11, int *playerID) rBool; BOOL STORMAPI SNetCreateGame(const char *pszGameName, const char *pszGamePassword, const char *pszGameStatString, DWORD dwGameType, char *GameTemplateData, int GameTemplateSize, int playerCount, char *creatorName, char *a11, int *playerID) rBool;
BOOL STORMAPI SNetDestroy() rBool; BOOL STORMAPI SNetDestroy() rBool;
BOOL STORMAPI SNetEnumProviders(int (STORMAPI *callback)(DWORD, DWORD, DWORD, DWORD), int mincaps) rBool;
BOOL STORMAPI SNetEnumGames(int (STORMAPI *callback)(DWORD, DWORD, DWORD), int *hintnextcall) rBool;
BOOL STORMAPI SNetDropPlayer(int playerid, DWORD flags) rBool; BOOL STORMAPI SNetDropPlayer(int playerid, DWORD flags) rBool;
BOOL STORMAPI SNetGetGameInfo(int type, void *dst, size_t length, size_t *byteswritten) rBool; BOOL STORMAPI SNetGetGameInfo(int type, void *dst, size_t length, size_t *byteswritten) rBool;
@ -57,6 +55,7 @@ BOOL STORMAPI SDlgEndDialog(HWND hDlg, HANDLE nResult) rBool;
BOOL STORMAPI SDlgSetControlBitmaps(HWND parentwindow, int *id, int a3, char *buffer2, char *buffer, int flags, int mask) rBool; BOOL STORMAPI SDlgSetControlBitmaps(HWND parentwindow, int *id, int a3, char *buffer2, char *buffer, int flags, int mask) rBool;
BOOL STORMAPI SDlgBltToWindowI(HWND hWnd, HRGN a2, char *a3, int a4, void *buffer, RECT *rct, SIZE *size, int a8, int a9, DWORD rop) rBool;
BOOL STORMAPI SDlgBltToWindowE(HWND hWnd, HRGN a2, char *a3, int a4, void *buffer, RECT *rct, SIZE *size, int a8, int a9, DWORD rop) rBool; BOOL STORMAPI SDlgBltToWindowE(HWND hWnd, HRGN a2, char *a3, int a4, void *buffer, RECT *rct, SIZE *size, int a8, int a9, DWORD rop) rBool;
BOOL STORMAPI SDlgSetBitmapE(HWND hWnd, int a2, char *src, int mask1, int flags, int a6, int a7, int width, int a9, int mask2) rBool; BOOL STORMAPI SDlgSetBitmapE(HWND hWnd, int a2, char *src, int mask1, int flags, int a6, int a7, int width, int a9, int mask2) rBool;
@ -93,6 +92,7 @@ BOOL STORMAPI SFileLoadFileEx(void *hArchive, char *filename, int a3, int a4, in
BOOL STORMAPI SBltROP3(void *lpDstBuffer, void *lpSrcBuffer, int width, int height, int a5, int a6, int a7, DWORD rop) rBool; BOOL STORMAPI SBltROP3(void *lpDstBuffer, void *lpSrcBuffer, int width, int height, int a5, int a6, int a7, DWORD rop) rBool;
BOOL STORMAPI SBltROP3Clipped(void *lpDstBuffer, RECT *lpDstRect, POINT *lpDstPt, int a4, void *lpSrcBuffer, RECT *lpSrcRect, POINT *lpSrcPt, int a8, int a9, DWORD rop) rBool; BOOL STORMAPI SBltROP3Clipped(void *lpDstBuffer, RECT *lpDstRect, POINT *lpDstPt, int a4, void *lpSrcBuffer, RECT *lpSrcRect, POINT *lpSrcPt, int a8, int a9, DWORD rop) rBool;
BOOL STORMAPI SBltROP3Tiled(void *lpDstBuffer, RECT *lpDstRect, POINT *lpDstPt, int a4, void *lpSrcBuffer, RECT *lpSrcRect, POINT *lpSrcPt, int a8, int a9, DWORD rop) rBool;
BOOL STORMAPI SBmpDecodeImage(DWORD dwImgType, void *pSrcBuffer, DWORD dwSrcBuffersize, PALETTEENTRY *pPalette, void *pDstBuffer, DWORD dwDstBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp) rBool; BOOL STORMAPI SBmpDecodeImage(DWORD dwImgType, void *pSrcBuffer, DWORD dwSrcBuffersize, PALETTEENTRY *pPalette, void *pDstBuffer, DWORD dwDstBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp) rBool;
@ -190,7 +190,7 @@ int STORMAPI SMemCmp(void *location1, void *location2, DWORD size) rInt;
int STORMAPI SStrCopy(char *dest, const char *src, int max_length) rInt; int STORMAPI SStrCopy(char *dest, const char *src, int max_length) rInt;
DWORD STORMAPI SStrHash(const char *string, DWORD flags, DWORD Seed) rInt; DWORD STORMAPI SStrHash(const char *string, DWORD flags, DWORD Seed) rInt;
int STORMAPI SStrNCat(char *dest, const char *src, DWORD max_length) rInt; int STORMAPI SStrPack(char *dest, const char *src, DWORD max_length) rInt;
int STORMAPI SStrLen(const char* string) rInt; int STORMAPI SStrLen(const char* string) rInt;
@ -247,3 +247,4 @@ BOOL __stdcall SDlgSetTimer(int a1, int a2, int a3, void (__stdcall *a4)(int, in
BOOL __stdcall SDlgKillTimer(int a1, int a2) rBool; BOOL __stdcall SDlgKillTimer(int a1, int a2) rBool;
BOOL __stdcall SDlgDrawBitmap(HWND hWnd, int a2, int a3, int a4, int a5, int a6, int a7) rBool; BOOL __stdcall SDlgDrawBitmap(HWND hWnd, int a2, int a3, int a4, int a5, int a6, int a7) rBool;
BOOL __stdcall SDlgDialogBoxParam(HINSTANCE hInst, char *szDialog, int a3, WNDPROC func, int a5) rBool; BOOL __stdcall SDlgDialogBoxParam(HINSTANCE hInst, char *szDialog, int a3, WNDPROC func, int a5) rBool;
BOOL __stdcall SGdiTextOut(void *pBuffer, int x, int y, int mask, char *str, int len) rBool;

14
3rdParty/Storm/Source/storm.def vendored

@ -3,9 +3,9 @@ LIBRARY "Storm"
EXPORTS EXPORTS
SNetCreateGame @101 NONAME SNetCreateGame @101 NONAME
SNetDestroy @102 NONAME SNetDestroy @102 NONAME
SNetEnumProviders @103 NONAME ;SNetEnumDevices @103 NONAME
;SNetEnumDevices @104 NONAME ;SNetEnumGames @104 NONAME
SNetEnumGames @105 NONAME ;SNetEnumProviders @105 NONAME
SNetDropPlayer @106 NONAME SNetDropPlayer @106 NONAME
SNetGetGameInfo @107 NONAME SNetGetGameInfo @107 NONAME
;SNetGetNetworkLatency @108 NONAME ;SNetGetNetworkLatency @108 NONAME
@ -52,7 +52,7 @@ EXPORTS
;Ordinal151 @151 NONAME ;Ordinal151 @151 NONAME
SDlgBeginPaint @201 NONAME SDlgBeginPaint @201 NONAME
;SDlgBltToWindowI @202 NONAME SDlgBltToWindowI @202 NONAME
;SDlgCheckTimers @203 NONAME ;SDlgCheckTimers @203 NONAME
;SDlgCreateDialogIndirectParam @204 NONAME ;SDlgCreateDialogIndirectParam @204 NONAME
;SDlgCreateDialogParam @205 NONAME ;SDlgCreateDialogParam @205 NONAME
@ -134,7 +134,7 @@ EXPORTS
;SBltGetSCode @312 NONAME ;SBltGetSCode @312 NONAME
SBltROP3 @313 NONAME SBltROP3 @313 NONAME
SBltROP3Clipped @314 NONAME SBltROP3Clipped @314 NONAME
;SBltROP3Tiled @315 NONAME SBltROP3Tiled @315 NONAME
SBmpDecodeImage @321 NONAME SBmpDecodeImage @321 NONAME
@ -187,7 +187,7 @@ EXPORTS
;SGdiRectangle @388 NONAME ;SGdiRectangle @388 NONAME
SGdiSelectObject @389 NONAME SGdiSelectObject @389 NONAME
SGdiSetPitch @390 NONAME SGdiSetPitch @390 NONAME
;SGdiTextOut @391 NONAME SGdiTextOut @391 NONAME
;SGdi392 @392 NONAME ;SGdi392 @392 NONAME
Ordinal393 @393 NONAME Ordinal393 @393 NONAME
@ -288,7 +288,7 @@ EXPORTS
SStrCopy @501 NONAME SStrCopy @501 NONAME
SStrHash @502 NONAME SStrHash @502 NONAME
SStrNCat @503 NONAME SStrPack @503 NONAME
;SStrTokenize @504 NONAME ;SStrTokenize @504 NONAME
;SStrPack @505 NONAME ;SStrPack @505 NONAME
SStrLen @506 NONAME SStrLen @506 NONAME

8
3rdParty/Storm/Source/storm.h vendored

@ -66,9 +66,6 @@ extern "C" {
BOOL STORMAPI SNetCreateGame(const char *pszGameName, const char *pszGamePassword, const char *pszGameStatString, DWORD dwGameType, char *GameTemplateData, int GameTemplateSize, int playerCount, char *creatorName, char *a11, int *playerID); BOOL STORMAPI SNetCreateGame(const char *pszGameName, const char *pszGamePassword, const char *pszGameStatString, DWORD dwGameType, char *GameTemplateData, int GameTemplateSize, int playerCount, char *creatorName, char *a11, int *playerID);
BOOL STORMAPI SNetDestroy(); BOOL STORMAPI SNetDestroy();
BOOL STORMAPI SNetEnumProviders(int (STORMAPI *callback)(DWORD, DWORD, DWORD, DWORD), int mincaps);
BOOL STORMAPI SNetEnumGames(int (STORMAPI *callback)(DWORD, DWORD, DWORD), int *hintnextcall);
/* SNetDropPlayer @ 106 /* SNetDropPlayer @ 106
* *
@ -464,6 +461,7 @@ BOOL STORMAPI SDlgSetControlBitmaps(HWND parentwindow, int *id, int a3, char *bu
BOOL STORMAPI SDlgSetSystemCursor(void *lpSrcBuffer, void *p_a2, LPSIZE lpSize, LPCSTR lpCursorName); BOOL STORMAPI SDlgSetSystemCursor(void *lpSrcBuffer, void *p_a2, LPSIZE lpSize, LPCSTR lpCursorName);
*/ */
BOOL STORMAPI SDlgBltToWindowI(HWND hWnd, HRGN a2, char *a3, int a4, void *buffer, RECT *rct, SIZE *size, int a8, int a9, DWORD rop);
BOOL STORMAPI SDlgBltToWindowE(HWND hWnd, HRGN a2, char *a3, int a4, void *buffer, RECT *rct, SIZE *size, int a8, int a9, DWORD rop); BOOL STORMAPI SDlgBltToWindowE(HWND hWnd, HRGN a2, char *a3, int a4, void *buffer, RECT *rct, SIZE *size, int a8, int a9, DWORD rop);
BOOL STORMAPI SDlgSetBitmapE(HWND hWnd, int a2, char *src, int mask1, int flags, int a6, int a7, int width, int a9, int mask2); BOOL STORMAPI SDlgSetBitmapE(HWND hWnd, int a2, char *src, int mask1, int flags, int a6, int a7, int width, int a9, int mask2);
@ -538,6 +536,7 @@ BOOL STORMAPI SFileLoadFileEx(void *hArchive, char *filename, int a3, int a4, in
BOOL STORMAPI SBltROP3(void *lpDstBuffer, void *lpSrcBuffer, int srcDrawWidth, int srcDrawHeight, int dstWidth, int srcWidth, int a7, DWORD rop); BOOL STORMAPI SBltROP3(void *lpDstBuffer, void *lpSrcBuffer, int srcDrawWidth, int srcDrawHeight, int dstWidth, int srcWidth, int a7, DWORD rop);
BOOL STORMAPI SBltROP3Clipped(void *lpDstBuffer, RECT *lpDstRect, POINT *lpDstPt, int a4, void *lpSrcBuffer, RECT *lpSrcRect, POINT *lpSrcPt, int a8, int a9, DWORD rop); BOOL STORMAPI SBltROP3Clipped(void *lpDstBuffer, RECT *lpDstRect, POINT *lpDstPt, int a4, void *lpSrcBuffer, RECT *lpSrcRect, POINT *lpSrcPt, int a8, int a9, DWORD rop);
BOOL STORMAPI SBltROP3Tiled(void *lpDstBuffer, RECT *lpDstRect, POINT *lpDstPt, int a4, void *lpSrcBuffer, RECT *lpSrcRect, POINT *lpSrcPt, int a8, int a9, DWORD rop);
#define SBMP_DEFAULT 0 #define SBMP_DEFAULT 0
#define SBMP_BMP 1 #define SBMP_BMP 1
@ -1127,7 +1126,7 @@ SStrHash(
DWORD flags = 0, DWORD flags = 0,
DWORD Seed = 0); DWORD Seed = 0);
int STORMAPI SStrNCat(char *dest, const char *src, DWORD max_length); int STORMAPI SStrPack(char *dest, const char *src, DWORD max_length);
/* SStrLen @ 506 /* SStrLen @ 506
* *
@ -1310,6 +1309,7 @@ BOOL __stdcall SDlgSetTimer(int a1, int a2, int a3, void (__stdcall *a4)(int, in
BOOL __stdcall SDlgKillTimer(int a1, int a2); BOOL __stdcall SDlgKillTimer(int a1, int a2);
BOOL __stdcall SDlgDrawBitmap(HWND hWnd, int a2, int a3, int a4, int a5, int a6, int a7); BOOL __stdcall SDlgDrawBitmap(HWND hWnd, int a2, int a3, int a4, int a5, int a6, int a7);
BOOL __stdcall SDlgDialogBoxParam(HINSTANCE hInst, char *szDialog, int a3, WNDPROC func, int a5); BOOL __stdcall SDlgDialogBoxParam(HINSTANCE hInst, char *szDialog, int a3, WNDPROC func, int a5);
BOOL __stdcall SGdiTextOut(void *pBuffer, int x, int y, int mask, char *str, int len);
#ifdef __GNUC__ #ifdef __GNUC__
} }

17
3rdParty/Storm/Source/storm_gcc.def vendored

@ -5,9 +5,9 @@ EXPORTS
SNetCreateGame@40 @101 NONAME SNetCreateGame@40 @101 NONAME
SNetDestroy @102 NONAME SNetDestroy @102 NONAME
SNetDestroy@0 @102 NONAME SNetDestroy@0 @102 NONAME
SNetEnumProviders @103 NONAME ;SNetEnumDevices @103 NONAME
;SNetEnumDevices @104 NONAME ;SNetEnumGames @104 NONAME
SNetEnumGames @105 NONAME ;SNetEnumProviders @105 NONAME
SNetDropPlayer @106 NONAME SNetDropPlayer @106 NONAME
SNetDropPlayer@8 @106 NONAME SNetDropPlayer@8 @106 NONAME
SNetGetGameInfo @107 NONAME SNetGetGameInfo @107 NONAME
@ -71,7 +71,8 @@ EXPORTS
SDlgBeginPaint @201 NONAME SDlgBeginPaint @201 NONAME
SDlgBeginPaint@8 @201 NONAME SDlgBeginPaint@8 @201 NONAME
;SDlgBltToWindowI @202 NONAME SDlgBltToWindowI @202 NONAME
SDlgBltToWindowI@28 @202 NONAME
;SDlgCheckTimers @203 NONAME ;SDlgCheckTimers @203 NONAME
;SDlgCreateDialogIndirectParam @204 NONAME ;SDlgCreateDialogIndirectParam @204 NONAME
;SDlgCreateDialogParam @205 NONAME ;SDlgCreateDialogParam @205 NONAME
@ -177,7 +178,8 @@ EXPORTS
;SBltGetSCode @312 NONAME ;SBltGetSCode @312 NONAME
SBltROP3 @313 NONAME SBltROP3 @313 NONAME
SBltROP3Clipped @314 NONAME SBltROP3Clipped @314 NONAME
;SBltROP3Tiled @315 NONAME SBltROP3Tiled @315 NONAME
SBltROP3Tiled@40 @315 NONAME
SBmpDecodeImage @321 NONAME SBmpDecodeImage @321 NONAME
@ -235,7 +237,8 @@ EXPORTS
;SGdiRectangle @388 NONAME ;SGdiRectangle @388 NONAME
SGdiSelectObject @389 NONAME SGdiSelectObject @389 NONAME
SGdiSetPitch @390 NONAME SGdiSetPitch @390 NONAME
;SGdiTextOut @391 NONAME SGdiTextOut @391 NONAME
SGdiTextOut@24 @391 NONAME
;SGdi392 @392 NONAME ;SGdi392 @392 NONAME
Ordinal393 @393 NONAME Ordinal393 @393 NONAME
@ -353,7 +356,7 @@ EXPORTS
SStrCopy @501 NONAME SStrCopy @501 NONAME
SStrCopy@12 @501 NONAME SStrCopy@12 @501 NONAME
SStrHash @502 NONAME SStrHash @502 NONAME
SStrNCat @503 NONAME SStrPack @503 NONAME
;SStrTokenize @504 NONAME ;SStrTokenize @504 NONAME
;SStrPack @505 NONAME ;SStrPack @505 NONAME
SStrLen @506 NONAME SStrLen @506 NONAME

285
DiabloUI/_temp_data.cpp

@ -8,12 +8,28 @@ ProfileStruct bnprofiles[4] =
}; };
int profilemsg1[6] = { 1125, 1127, 1129, 1131, 1133, 0 }; int profilemsg1[6] = { 1125, 1127, 1129, 1131, 1133, 0 };
int profilemsg2[6] = { 1126, 1128, 1130, 1132, 1134, 0 }; int profilemsg2[6] = { 1126, 1128, 1130, 1132, 1134, 0 };
int Connect_cpp_float_value = 2139095040; // weak
int CopyProt_cpp_float_value = 2139095040; // weak
int cr8game_cpp_float_value = 2139095040; // weak
int CreaDung_cpp_float_value = 2139095040; // weak
int CreaStat_cpp_float_value = 2139095040; // weak
int credits_cpp_float_value = 2139095040; // weak
int DiabEdit_cpp_float_value = 2139095040; // weak int DiabEdit_cpp_float_value = 2139095040; // weak
int DiabloUI_cpp_float_value = 2139095040; // weak int DiabloUI_cpp_float_value = 2139095040; // weak
int doom_cpp_float_value = 2139095040; // weak int doom_cpp_float_value = 2139095040; // weak
int EntName_cpp_float_value = 2139095040; // weak
int fade_cpp_float_value = 2139095040; // weak int fade_cpp_float_value = 2139095040; // weak
int focus_cpp_float_value = 2139095040; // weak int focus_cpp_float_value = 2139095040; // weak
int local_cpp_float_value = 2139095040; // weak int local_cpp_float_value = 2139095040; // weak
int mainmenu_cpp_float_value = 2139095040; // weak
int OkCancel_cpp_float_value = 2139095040; // weak
int Sbar_cpp_float_value = 2139095040; // weak
int Sbar_cpp_float_value2 = 2139095040; // weak
int SelClass_cpp_float_value = 2139095040; // weak
int SelHero_cpp_float_value = 2139095040; // weak
int SelList_cpp_float_value = 2139095040; // weak
int SelLoad_cpp_float_value = 2139095040; // weak
int SelYesNo_cpp_float_value = 2139095040; // weak
int Title_cpp_float_value = 2139095040; // weak int Title_cpp_float_value = 2139095040; // weak
int titlesnd_cpp_float_value = 2139095040; // weak int titlesnd_cpp_float_value = 2139095040; // weak
int dword_10022258 = 4; // weak int dword_10022258 = 4; // weak
@ -24,11 +40,18 @@ ProfFntStruct proffnts[4] =
{ 10, "Arial", 700 }, { 10, "Arial", 700 },
{ 13, "Time New Roman", 400 } { 13, "Time New Roman", 400 }
}; };
int dword_100228DC[3] = { 1038, 1080, 0 }; unsigned char connect_subnet_ip[4][4] =
int dword_100228E8[2] = { 1097, 0 }; {
int dword_100228F0[2] = { 1099, 0 }; { 13, 0, 0, 0 }, // 13.0.0.0
int dword_100228F8[3] = { 1056, 1054, 0 }; { 128, 128, 128, 0 }, // 128.128.128.0
int dword_10022904[4] = { 1094, 1095, 1096, 0 }; { 14, 0, 0, 0 }, // 14.0.0.0
{ 255, 255, 255, 0 } // 255.255.255.0
};
int creadung_msgtbl1[3] = { 1038, 1080, 0 };
int creadung_msgtbl2[2] = { 1097, 0 };
int creadung_msgtbl3[2] = { 1099, 0 };
int creadung_msgtbl4[3] = { 1056, 1054, 0 };
int creadung_msgtbl5[4] = { 1094, 1095, 1096, 0 };
short defstats[3][4] = { { 30, 15, 20, 30 }, { 25, 20, 30, 20 }, { 15, 35, 25, 20 } }; short defstats[3][4] = { { 30, 15, 20, 30 }, { 25, 20, 30, 20 }, { 15, 35, 25, 20 } };
int dword_10022A2C[3] = { 1038, 1080, 0 }; int dword_10022A2C[3] = { 1038, 1080, 0 };
int dword_10022A38[2] = { 1097, 0 }; int dword_10022A38[2] = { 1097, 0 };
@ -40,19 +63,19 @@ int dword_10022AA4[4] = { 1084, 1085, 1086, 0 };
int dword_10022AFC[2] = { 1038, 0 }; int dword_10022AFC[2] = { 1038, 0 };
int dword_10022B04[3] = { 1056, 1054, 0 }; int dword_10022B04[3] = { 1056, 1054, 0 };
int dword_10022B10[2] = { 1116, 0 }; int dword_10022B10[2] = { 1116, 0 };
int dword_10022B34[2] = { 1038, 0 }; int entname_msgtbl1[2] = { 1038, 0 };
int dword_10022B3C[3] = { 1056, 1054, 0 }; int entname_msgtbl2[3] = { 1056, 1054, 0 };
int dword_10022B48[2] = { 1065, 0 }; int entname_msgtbl3[2] = { 1065, 0 };
int dword_10022BE0[2] = { 1042, 0 }; int menumsgs_1option[2] = { 1042, 0 };
int dword_10022BE8[6] = { 1044, 1001, 1002, 1003, 2, 0 }; int menumsgs_5options[6] = { 1044, 1001, 1002, 1003, 2, 0 };
int dword_10022C4C[2] = { 1038, 0 }; int dword_10022C4C[2] = { 1038, 0 };
int dword_10022C54[2] = { 1080, 0 }; int dword_10022C54[2] = { 1080, 0 };
int dword_10022C5C[2] = { 1108, 0 }; int dword_10022C5C[2] = { 1108, 0 };
int dword_10022CAC[2] = { 1026, 0 }; int dword_10022CAC[2] = { 1026, 0 };
int dword_10022CB4[2] = { 2, 0 }; int dword_10022CB4[2] = { 2, 0 };
int dword_10022EB4[2] = { 1038, 0 }; int selclass_msgtbl1[2] = { 1038, 0 };
int dword_10022EBC[3] = { 1056, 1054, 0 }; int selclass_msgtbl2[3] = { 1056, 1054, 0 };
int dword_10022EC8[4] = { 1062, 1063, 1064, 0 }; int selclass_msgtbl3[4] = { 1062, 1063, 1064, 0 };
int dword_10022ED8[3] = { 1038, 1080, 0 }; int dword_10022ED8[3] = { 1038, 1080, 0 };
int dword_10022EE4[3] = { 1143, 1147, 0 }; int dword_10022EE4[3] = { 1143, 1147, 0 };
int dword_10022EF0[4] = { 1081, 1076, 1144, 0 }; int dword_10022EF0[4] = { 1081, 1076, 1144, 0 };
@ -63,21 +86,21 @@ char *off_10022F8C[4] = { "Entry1", "Entry2", "Entry3", "Entry4" };
int dword_10022F9C[2] = { 1038, 0 }; int dword_10022F9C[2] = { 1038, 0 };
int dword_10022FA4[3] = { 1056, 1054, 0 }; int dword_10022FA4[3] = { 1056, 1054, 0 };
int dword_10022FB0[7] = { 1117, 1118, 1119, 1120, 1121, 1122, 0 }; int dword_10022FB0[7] = { 1117, 1118, 1119, 1120, 1121, 1122, 0 };
int dword_10023000[2] = { 1038, 0 }; int selhero_msgtbl_string[2] = { 1038, 0 };
int dword_10023008[6] = { 1057, 1058, 1059, 1060, 1061, 0 }; int selhero_msgtbl_3[6] = { 1057, 1058, 1059, 1060, 1061, 0 };
int dword_10023020[6] = { 1014, 1018, 1017, 1016, 1015, 0 }; int selhero_msgtbl_info[6] = { 1014, 1018, 1017, 1016, 1015, 0 };
int dword_100230F0[3] = { 1038, 1080, 0 }; int dword_100230F0[3] = { 1038, 1080, 0 };
int dword_100230FC[2] = { 1097, 0 }; int dword_100230FC[2] = { 1097, 0 };
int dword_10023104[2] = { 1098, 0 }; int dword_10023104[2] = { 1098, 0 };
int dword_1002310C[3] = { 1056, 1054, 0 }; int dword_1002310C[3] = { 1056, 1054, 0 };
int dword_10023118[7] = { 1088, 1089, 1090, 1091, 1092, 1093, 0 }; int dword_10023118[7] = { 1088, 1089, 1090, 1091, 1092, 1093, 0 };
int dword_10023174[2] = { 1038, 0 }; int sellist_msgtbl1[2] = { 1038, 0 };
int dword_1002317C[3] = { 1056, 1054, 0 }; int sellist_msgtbl2[3] = { 1056, 1054, 0 };
int dword_10023188[2] = { 1006, 0 }; int sellist_msgtbl3[2] = { 1006, 0 };
int dword_10023190[7] = { 1047, 1048, 1049, 1050, 1051, 1052, 0 }; int sellist_msgtbl4[7] = { 1047, 1048, 1049, 1050, 1051, 1052, 0 };
int dword_100231AC[2] = { 1038, 0 }; int selload_msgtbl1[2] = { 1038, 0 };
int dword_100231B4[3] = { 1056, 1054, 0 }; int selload_msgtbl2[3] = { 1056, 1054, 0 };
int dword_100231C0[3] = { 1106, 1107, 0 }; int selload_msgtbl3[3] = { 1106, 1107, 0 };
int dword_100231CC[2] = { 1038, 0 }; int dword_100231CC[2] = { 1038, 0 };
int dword_100231D4[3] = { 1080, 1097, 0 }; int dword_100231D4[3] = { 1080, 1097, 0 };
int dword_100231E0[2] = { 1123, 0 }; int dword_100231E0[2] = { 1123, 0 };
@ -88,8 +111,8 @@ int dword_10023250[2] = { 1142, 0 };
int dword_10023258[2] = { 1146, 0 }; int dword_10023258[2] = { 1146, 0 };
int dword_10023260[3] = { 1056, 1054, 0 }; int dword_10023260[3] = { 1056, 1054, 0 };
int dword_1002326C[7] = { 1135, 1136, 1137, 1138, 1139, 1140, 0 }; int dword_1002326C[7] = { 1135, 1136, 1137, 1138, 1139, 1140, 0 };
int dword_100232D4[2] = { 1026, 0 }; int yesno_msgtbl2[2] = { 1026, 0 };
int dword_100232DC[3] = { 1109, 2, 0 }; int yesno_msgtbl1[3] = { 1109, 2, 0 };
int titlemsgtbl[2] = { 1067, 0 }; int titlemsgtbl[2] = { 1067, 0 };
//data+bss //data+bss
@ -129,73 +152,70 @@ int dword_10029478; // weak
int dword_10029480; // weak int dword_10029480; // weak
int dword_10029488; // weak int dword_10029488; // weak
int dword_1002948C; // weak int dword_1002948C; // weak
int dword_100294A0; // weak int Connect_cpp_float; // weak
int dword_100294A4; // weak int special_frames; // weak
DWORD dword_100294A8; // idb DWORD heroport_data[2];
char byte_100294B0[128]; // idb char connect_categorystr[128];
char byte_10029530[128]; // weak char connect_plrinfostr[128];
int dword_100295B0; // weak int heronum_frames2; // weak
DWORD dword_100295B8; // idb DWORD special_data[2];
int dword_100295BC; // weak int heroport_frames; // weak
int dword_100295C0; // weak DWORD heronum_data[2];
DWORD dword_100295C8; // idb int heronum_frames; // idb
int dword_100295CC; // weak int connect_draw_height; // idb
int dword_100295D0; // weak BYTE *connect_data1; // idb
int dword_100295D4; // weak BYTE *connect_data2; // idb
BYTE *dword_100295D8; // idb BYTE *connect_data3; // idb
BYTE *dword_100295DC; // idb void *connect_data4; // idb
BYTE *dword_100295E0; // idb HANDLE connect_trans[10];
void *dword_100295E4; // idb char *connect_charname;
int dword_100295E8[10]; // idb int connect_color_text; // weak
int dword_10029610; // weak HGLOBAL copyprot_popupart; // idb
int dword_10029614; // weak HGLOBAL copyprot_artpal; // idb
HGLOBAL dword_10029618; // idb int CopyProt_cpp_float; // weak
HGLOBAL dword_1002961C; // idb HGLOBAL copyprot_btnart; // idb
int dword_10029620; // weak HGDIOBJ cr8game_hobject; // idb
HGLOBAL dword_10029624; // idb int cr8game_cpp_float; // weak
HGDIOBJ dword_10029628; // idb int cr8_playercount; // weak
int dword_1002962C; // weak DWORD *cr8_somegamestruct;
int dword_10029630; // weak int cr8_dword_10029638; // weak
int dword_10029634; // weak int cr8_dword_1002963C; // weak
int dword_10029638; // weak int cr8_dword_10029640; // weak
int dword_1002963C; // weak int *cr8game_playerID; // idb
int dword_10029640; // weak _gamedata cr8_gamedata;
int dword_10029644; // weak HWND cr8_sendmsg1; // idb
char byte_10029648; // weak HWND cr8_sendmsg2; // idb
char byte_1002964C; // weak int cr8_dword_10029658; // weak
HWND dword_10029650; // idb DWORD cr8diffbtns_size[2];
HWND dword_10029654; // idb int cr8_dword_10029668; // weak
int dword_10029658; // weak int cr8_dword_1002966C; // idb
DWORD dword_10029660; // idb char cr8_gamename[32];
int dword_10029668; // weak char cr8_gamepassword[32];
int dword_1002966C; // weak BYTE *cr8_creat_bg_ptr;
char byte_10029670; // idb BYTE *cr8_but_xsm_ptr; // idb
char byte_10029690[32]; // weak BYTE *cr8_diffbtns_ptr; // idb
BYTE *dword_100296B0; int creadung_playername; // weak
BYTE *dword_100296B4; // idb int *creadung_playerID; // idb
BYTE *dword_100296B8; // idb int CreaDung_cpp_float; // weak
int dword_100296BC; // weak int creadung_dword_100296C8; // weak
int dword_100296C0; // weak int creadung_delspinners; // weak
int dword_100296C4; // weak DWORD *crea_somegamestruct;
int dword_100296C8; // weak int creadung_lasterror; // weak
int dword_100296CC; // weak int creadung_dword_100296D8; // weak
int dword_100296D0; // weak char *creadung_gamename;
int dword_100296D4; // weak int CreaStat_cpp_float; // weak
int dword_100296D8; // weak int credittext_size; // weak
int dword_100296DC; // weak int credits_cpp_float; // weak
int dword_100296E0; // weak HGLOBAL credittext_rsrc; // idb
int dword_100296E8; // weak int credit_vertical_pos2; // idb
int dword_100296EC; // weak int credit_horz_pos; // idb
HGLOBAL dword_100296F0; // idb int credit_vertical_pos1; // weak
int dword_100296F4; // weak int credit_line_count; // weak
int dword_100296F8; // weak void *credit_back_img; // idb
int dword_100296FC; // weak HANDLE creditsobj; // idb
int dword_10029700; // weak
void *dword_10029704; // idb
int dword_10029708; // weak
int DiabEdit_cpp_float; // weak int DiabEdit_cpp_float; // weak
int DiabloUI_cpp_float; // weak int DiabloUI_cpp_float; // weak
int dword_10029714; // weak int sgbUiIsInitialized; // weak
HINSTANCE ghUiInst; // idb HINSTANCE ghUiInst; // idb
int backbmp_flag1; // weak int backbmp_flag1; // weak
int backbmp_flag2; // weak int backbmp_flag2; // weak
@ -215,8 +235,8 @@ int dword_10029850; // weak
int doom_cpp_float; // weak int doom_cpp_float; // weak
LPSTR dword_10029858; // idb LPSTR dword_10029858; // idb
int dword_1002985C; // weak int dword_1002985C; // weak
int dword_10029860; // weak int EntName_cpp_float; // weak
LPSTR dword_10029864; // idb char *entname_charname;
int fade_cpp_float; // weak int fade_cpp_float; // weak
int sgbFadeRange; // idb int sgbFadeRange; // idb
tagPALETTEENTRY fadepal[256]; tagPALETTEENTRY fadepal[256];
@ -230,15 +250,14 @@ int dword_10029CA8; // weak
int dword_10029CAC; // weak int dword_10029CAC; // weak
int sgnSpinnerFrame; // weak int sgnSpinnerFrame; // weak
int local_cpp_float; // weak int local_cpp_float; // weak
int gdwCursWidth; // weak DWORD gdwCursData[2]; // weak
int gdwCursHeight; // weak
tagPALETTEENTRY artpal[256]; tagPALETTEENTRY artpal[256];
HGDIOBJ objPalette; // idb HGDIOBJ objPalette; // idb
BYTE *gpCursorArt; BYTE *gpCursorArt;
BYTE *gpCursorArt2; BYTE *gpCursorArt2;
int dword_1002A0D4; // weak int mainmenu_cpp_float; // weak
char byte_1002A0D8; // idb char menu_version_str[64];
int dword_1002A118; // weak int menu_item_timer; // weak
int dword_1002A120; // weak int dword_1002A120; // weak
int dword_1002A124; // weak int dword_1002A124; // weak
int dword_1002A128; // weak int dword_1002A128; // weak
@ -259,7 +278,7 @@ int dword_1002A258; // weak
int dword_1002A25C; // weak int dword_1002A25C; // weak
int (*dword_1002A260)(void); // weak int (*dword_1002A260)(void); // weak
char byte_1002A264; // idb char byte_1002A264; // idb
int dword_1002A2E4; // weak int OkCancel_cpp_float; // weak
int dword_1002A2E8; // weak int dword_1002A2E8; // weak
int dword_1002A2EC; // weak int dword_1002A2EC; // weak
int dword_1002A2F0; // weak int dword_1002A2F0; // weak
@ -275,9 +294,9 @@ BYTE *dword_1002A31C; // idb
BYTE *dword_1002A320; // idb BYTE *dword_1002A320; // idb
BYTE *dword_1002A324; // idb BYTE *dword_1002A324; // idb
void *dword_1002A328; // idb void *dword_1002A328; // idb
int dword_1002A338; // weak int Sbar_cpp_float; // weak
int dword_1002A344; // weak int Sbar_cpp_float2; // weak
int dword_1002A348; // weak int SelClass_cpp_float; // weak
int dword_1002A34C; // idb int dword_1002A34C; // idb
int dword_1002A350; // weak int dword_1002A350; // weak
int dword_1002A354; // weak int dword_1002A354; // weak
@ -295,30 +314,26 @@ char byte_1002A380[128]; // weak
int dword_1002A400; // weak int dword_1002A400; // weak
int dword_1002A404; // weak int dword_1002A404; // weak
int dword_1002A408; // weak int dword_1002A408; // weak
int (__stdcall *dword_1002A410)(_DWORD, _DWORD); // weak BOOL (__stdcall *selhero_fnstats)(int, _uidefaultstats *);
int dword_1002A414; // weak int SelHero_cpp_float; // weak
DWORD dword_1002A418; // idb DWORD selhero_sizedata[2]; // idb
int dword_1002A41C; // idb int selhero_difficulty; // weak
int dword_1002A420; // weak int selhero_hero_hassaved; // weak
int dword_1002A424; // weak int selhero_numheroesleft; // weak
int dword_1002A428; // weak char selhero_herolevel[4];
CHAR byte_1002A42C[8]; // idb BOOL (__stdcall *selhero_fnremove)(_uiheroinfo *);
int (__stdcall *dword_1002A434)(_DWORD); // weak BOOL (__stdcall *selhero_fninfo)(BOOL (__stdcall *fninfo)(_uiheroinfo *));
int (__stdcall *dword_1002A438)(_DWORD); // weak char selhero_heromag[4];
CHAR byte_1002A43C[4]; // idb char selhero_heronamestr[16];
char byte_1002A440; // idb BOOL (__stdcall *selhero_fncreate)(_uiheroinfo *);
int (UNKCALL *dword_1002A450)(_DWORD, _DWORD); // weak char selhero_herodex[4];
CHAR byte_1002A454[4]; // idb _uiheroinfo *sgpHeroInfo;
int dword_1002A458; // weak int selhero_is_created; // weak
int dword_1002A45C; // weak _uiheroinfo heroinfo_create;
char byte_1002A460; // weak int selhero_is_good; // idb
char byte_1002A464[18]; // idb char selhero_herostr[4];
char byte_1002A476; // weak char selhero_herovit[4];
int dword_1002A484; // weak BYTE *selhero_buffer;
int dword_1002A48C; // weak
CHAR byte_1002A490[4]; // idb
CHAR byte_1002A494[4]; // idb
BYTE *dword_1002A498; // idb
int dword_1002A49C; // weak int dword_1002A49C; // weak
void *dword_1002A4A0; // idb void *dword_1002A4A0; // idb
int dword_1002A4A4; // weak int dword_1002A4A4; // weak
@ -328,9 +343,9 @@ int dword_1002A4B0; // weak
int dword_1002A4B4; // weak int dword_1002A4B4; // weak
int dword_1002A4B8; // idb int dword_1002A4B8; // idb
int dword_1002A4BC; // weak int dword_1002A4BC; // weak
int dword_1002A4C0; // weak int SelList_cpp_float; // weak
int dword_1002A4C4; // weak _uiheroinfo *sellist_pheroinfo;
int dword_1002A4C8; // weak int SelLoad_cpp_float; // weak
int dword_1002A4CC; // weak int dword_1002A4CC; // weak
int dword_1002A4D0; // weak int dword_1002A4D0; // weak
void *dword_1002A4D4; // idb void *dword_1002A4D4; // idb
@ -339,15 +354,15 @@ int dword_1002A4DC; // weak
int dword_1002A4E0; // weak int dword_1002A4E0; // weak
int dword_1002A4E4; // weak int dword_1002A4E4; // weak
int dword_1002A4E8; // weak int dword_1002A4E8; // weak
int dword_1002A4EC; // weak _uiheroinfo *dword_1002A4EC; // idb
int dword_1002A4F0; // weak int dword_1002A4F0; // weak
int dword_1002A4F4; // idb int dword_1002A4F4; // idb
LPCSTR dword_1002A4F8; // idb char *yesno_dialog_string;
int dword_1002A4FC; // weak int SelYesNo_cpp_float; // weak
int dword_1002A500; // weak int yesno_remove_focus; // weak
int dword_1002A504; // weak char *yesno_hero_name;
int (*dword_1002A508)(void); // weak int (*YesNoFunc)(void); // weak
int dword_1002A50C; // weak int yesno_is_popup; // weak
HANDLE titlePHTrans[30]; HANDLE titlePHTrans[30];
int Title_cpp_float; // weak int Title_cpp_float; // weak
int titleTransIdx; // weak int titleTransIdx; // weak

370
DiabloUI/_temp_funcs.h

@ -71,76 +71,82 @@ char *__stdcall BNetGW_10002DEB(char *a1, unsigned int a2);
char *__stdcall BNetGW_10002E0B(char *a1, unsigned int a2); char *__stdcall BNetGW_10002E0B(char *a1, unsigned int a2);
void *Connect_10002E2B(); void __cdecl Connect_FreeConnectData();
signed int Connect_10002EC4(); BOOL __cdecl Connect_LoadGFXAndStuff();
//BOOL __stdcall UiArtCallback(int a1, unsigned int a2, PALETTEENTRY *pPalette, void *pBuffer, DWORD dwBuffersize, DWORD *pdwWidth, DWORD *dwHeight, DWORD *pdwBpp); BOOL __stdcall UiArtCallback(int game_type, unsigned int art_code, PALETTEENTRY *pPalette, void *pBuffer, DWORD dwBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp);
signed int Connect_100033D1(); void __cdecl j_Connect_cpp_init();
//BOOL __stdcall UiGetDataCallback(int a1, int a2, void *a3, int a4, int a5); void __cdecl Connect_cpp_init();
//int __stdcall UiSoundCallback(int a1, int a2, int a3); BOOL __stdcall UiGetDataCallback(int game_type, int data_code, void *a3, int a4, int a5);
//int __stdcall UiAuthCallback(int, int, char *, char, char *, LPSTR lpBuffer, int cchBufferMax); // idb BOOL __stdcall UiSoundCallback(int a1, int type, int a3);
//int __stdcall UiDrawDescCallback(int, COLORREF color, LPCSTR lpString, char *, int, UINT align, time_t, int); // idb BOOL __stdcall UiAuthCallback(int a1, char *a2, char *a3, char a4, char *a5, LPSTR lpBuffer, int cchBufferMax);
//signed int __stdcall UiCategoryCallback(int a1, int a2, int a3, int a4, int a5, _DWORD *a6, _DWORD *a7); BOOL __stdcall UiDrawDescCallback(int arg0, COLORREF color, LPCSTR lpString, char *a4, int a5, UINT align, time_t a7, HDC *a8);
int UNKCALL Connect_10003D04(char *); // idb BOOL __stdcall UiCategoryCallback(int a1, int a2, int a3, int a4, int a5, _DWORD *a6, _DWORD *a7);
int __fastcall Connect_10003DAF(char *a1, int a2, int a3, int a4); int __fastcall Connect_GetRankFromLevel(char *str);
char *__fastcall Connect_10003E0C(int a1, const char *a2, char *a3, char *a4, int a5); BOOL __fastcall Connect_DiffFromString(char *str, _gamedata *gamedata, int a3, int a4);
signed int __fastcall Connect_10003E61(const char *a1, _BYTE *a2); void __fastcall Connect_SetDiffString(_gamedata *gamedata, const char *str1, char *str2, char *str3, int size);
int __fastcall Connect_10003F6F(int a1, int a2, size_t a3); BOOL __fastcall Connect_GetHeroInfoConc(const char *a1, _uiheroinfo *pInfo);
//int __stdcall UiCreateGameCriteria(int, char *); // idb void __fastcall Connect_MakeDescString(_uiheroinfo *a1, char *name, size_t size);
//signed int __stdcall UiCreatePlayerDescription(int a1, int a2, int a3); void __stdcall UiCreateGameCriteria(_uiheroinfo *pInfo, char *str);
//int __stdcall UiSetupPlayerInfo(int a1, int a2, int a3); BOOL __stdcall UiCreatePlayerDescription(_uiheroinfo *info, int mode, char *desc);
int __fastcall Connect_10004028(int a1, int a2, int a3, int a4); void __stdcall UiSetupPlayerInfo(char *infostr, _uiheroinfo *pInfo, int type);
void __fastcall Connect_CopyPlrDescStrings(char *str1, int size1, char *str2, int size2);
//signed int __stdcall UiCopyProtError(int *a1);
int __stdcall CopyProt_100040AF(int, UINT Msg, WPARAM wParam, LPARAM lParam); // idb BOOL __stdcall UiCopyProtError(int *pdwResult);
HGLOBAL CopyProt_10004173(); LRESULT __stdcall CopyProt_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
signed int __fastcall CopyProt_100041B5(HWND a1, const CHAR *edx0); void __cdecl CopyProt_FreeCopyResrcs();
int __fastcall CopyProt_1000430C(int a1, int a2); BOOL __fastcall CopyProt_LoadCopyStuff(HWND hWnd, int a2);
signed int CopyProt_10004329(); void __fastcall CopyProt_EndCopyDlg(HWND hWnd, int a2);
void __cdecl j_CopyProt_cpp_init();
void __cdecl CopyProt_cpp_init();
signed int cr8game_10004339();
int UNKCALL cr8game_10004344(HWND arg);
//int __stdcall UiCreateGameCallback(int a1, int a2, int a3, int a4, int a5, int a6); void __cdecl j_cr8game_cpp_init();
HGDIOBJ __stdcall cr8game_10004506(HWND hDlg, UINT Msg, WPARAM wParam, HWND hWnd); void __cdecl cr8game_cpp_init();
BYTE *cr8game_10004828(); BOOL __fastcall cr8game_GetSnetCreaGame(HWND hWnd);
BOOL __fastcall cr8game_1000487F(HWND hWnd); BOOL __stdcall UiCreateGameCallback(int a1, int a2, int a3, int a4, int a5, int a6);
void **UNKCALL cr8game_10004914(HWND hDlg); LRESULT __stdcall cr8game_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
_DWORD *UNKCALL cr8game_1000497F(HWND arg); void __cdecl cr8game_FreeCreaStuff();
_DWORD *__fastcall cr8game_10004A34(HWND hWnd, int a2, int a3); BOOL __fastcall cr8game_LoadCreaGFX(HWND hWnd);
LRESULT UNKCALL cr8game_10004A93(HWND hDlg); void __fastcall cr8game_FreeMainMem(HWND hWnd);
_DWORD *__fastcall cr8game_10004ABA(HWND hDlg, int a2); void __fastcall cr8game_AllocMainMem(HWND hWnd);
BOOL __fastcall cr8game_10004B02(HWND hWnd, int a2, int a3); void __fastcall cr8game_DoAROP3Blit(HWND hWnd, int frame, int size);
int UNKCALL cr8game_10004B3F(char *); // idb void __fastcall cr8game_SendMessageF5(HWND hWnd);
HFONT UNKCALL cr8game_10004BA8(HWND hWnd); void __fastcall cr8game_BlitCr8Dialog(HWND hWnd, int a2);
void __fastcall cr8game_SetWindowStr(HWND hWnd, int dlgitem, int a3);
int __fastcall cr8game_CheckValidGameName(char *name);
void UNKCALL CreaDung_10004C33(void *arg); HFONT __fastcall cr8game_GetCr8Object(HWND hWnd);
signed int CreaDung_10004C3F();
int __stdcall CreaDung_10004C4A(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); // idb
int __fastcall CreaDung_10004D75(HWND a1, int a2); void __fastcall CreaDung_SetDelSpin(int a1);
void UNKCALL CreaDung_10004E2E(HWND hDlg); void __cdecl j_CreaDung_cpp_init();
int UNKCALL CreaDung_10004E8B(HWND hWnd); // idb void __cdecl CreaDung_cpp_init();
int __fastcall CreaDung_10004F40(int a1, int a2); LRESULT __stdcall CreaDung_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
HWND USERCALL CreaDung_10004F5D(HWND a1, int a2); void __fastcall CreaDung_ParseDungProcs(HWND hWnd, int dlg);
HWND UNKCALL CreaDung_10005037(HWND arg); void __fastcall CreaDung_FreeDungProcs(HWND hWnd);
HWND USERPURGE CreaDung_1000517E(HWND hWnd, int a2, int a3, int height); void __fastcall CreaDung_LoadDungGFX(HWND hWnd);
int __fastcall CreaDung_100051D8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8); void __fastcall CreaDung_PlaySndAndKill(HWND hWnd, int a2);
void __fastcall CreaDung_DoAllPlaySnd(HWND hWnd);
void __fastcall CreaDung_DoSnetCreaGame(HWND hWnd);
//signed int __stdcall UiGetDefaultStats(int a1, _WORD *a2); void __fastcall CreaDung_CheckDlgForSnd(HWND hWnd, int a2, int a3);
signed int CreaStat_10005287(); BOOL __fastcall CreaDung_SelDungDiff(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8);
signed int credits_10005297(); BOOL __stdcall UiGetDefaultStats(int pclass, _uidefaultstats *pStats);
//signed int __stdcall UiCreditsDialog(int a1); void __cdecl j_CreaStat_cpp_init();
int __fastcall credits_100052C7(int a1, int a2, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); void __cdecl CreaStat_cpp_init();
HGLOBAL __fastcall credits_100053D9(HWND hWnd, int a2);
int __fastcall credits_1000543A(HWND a1, int a2);
BOOL UNKCALL credits_100055C0(HWND hWnd); void __cdecl j_credits_cpp_init();
signed int UNKCALL credits_10005660(void *arg); void __cdecl credits_cpp_init();
signed int __fastcall credits_10005736(_BYTE *a1); BOOL __stdcall UiCreditsDialog(int a1);
int __fastcall credits_10005755(int a1, int a2); LRESULT __stdcall credits_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
void __fastcall credits_FreeCreditResrc(HWND hWnd);
void __fastcall credits_LoadImgCreditTxt(HWND hWnd, LPARAM lParam);
void __fastcall credits_CalcPosROP3(HWND hWnd);
void __fastcall credits_PrintCredLines(HWND hWnd);
int __fastcall credits_GetCredLineBreak(char *str);
char *__fastcall credits_GetAdjustText(char *str, int len);
void __fastcall DiabEdit_DoPaintBMP(HWND hWnd); void __fastcall DiabEdit_DoPaintBMP(HWND hWnd);
@ -198,7 +204,7 @@ void __cdecl Doom_cpp_init();
void __fastcall Doom_ParseWndProcs(HWND hWnd, int *msgtbl, int a3, int a4); void __fastcall Doom_ParseWndProcs(HWND hWnd, int *msgtbl, int a3, int a4);
void __fastcall Doom_GetSetWndText(HWND hWnd, int msg, int nFont, int a4); void __fastcall Doom_GetSetWndText(HWND hWnd, int msg, int nFont, int a4);
void __fastcall Doom_PrintStrWithSpin(HWND hWnd, BOOL a2); void __fastcall Doom_PrintStrWithSpin(HWND hWnd, BOOL a2);
void __fastcall Doom_AllocAndSetBMP(HWND hWnd, int bmp_flags); void __fastcall Doom_AllocAndSetBMP(HWND hWnd, int a2, int bmp_flags); /* check args, __stdcall? */
void __fastcall Doom_GetWindowROP3(HWND hWnd1, HWND hWnd2); void __fastcall Doom_GetWindowROP3(HWND hWnd1, HWND hWnd2);
void __fastcall Doom_ParseWndProc2(HWND hWnd, int *msgtbl, int a3, int a4); void __fastcall Doom_ParseWndProc2(HWND hWnd, int *msgtbl, int a3, int a4);
void __fastcall Doom_GetSetWndTxt2(HWND hWnd, int msg, int nFont, int a4); void __fastcall Doom_GetSetWndTxt2(HWND hWnd, int msg, int nFont, int a4);
@ -224,12 +230,13 @@ int __fastcall EntDial_10006F16(HWND hDlg, int, int); // idb
signed int EntDial_10006F71(); signed int EntDial_10006F71();
int __stdcall EntName_10006F7C(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam); // idb LRESULT __stdcall EntName_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
HWND UNKCALL EntName_1000709E(HWND hDlg); void __fastcall EntName_DelEntNameMsgs(HWND hWnd);
int UNKCALL EntName_100070DB(HWND hWnd); // idb void __fastcall EntName_LoadFocusChkName(HWND hWnd);
int __fastcall EntName_100071AC(HWND hDlg, int a2); void __fastcall EntName_SetCharName(HWND hWnd, int a2);
void __fastcall EntName_100071ED(HWND hWnd, unsigned int a2, int a3); void __fastcall EntName_GetMessageName(HWND hWnd, unsigned int a2, int a3);
signed int EntName_10007220(); void __cdecl j_EntName_cpp_init();
void __cdecl EntName_cpp_init();
void __fastcall Fade_ApplyPaletteRange(int range1, int range2); void __fastcall Fade_ApplyPaletteRange(int range1, int range2);
@ -292,15 +299,16 @@ void __cdecl local_SetCursorDefault();
void __fastcall local_SetDiabloCursor(HWND hWnd); void __fastcall local_SetDiabloCursor(HWND hWnd);
signed int MainMenu_10008164(); void __cdecl j_MainMenu_cpp_init();
//int __stdcall UiMainMenuDialog(char *, int, int, int); // idb void __cdecl MainMenu_cpp_init();
int __fastcall MainMenu_100081E3(int a1, int a2, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); BOOL __stdcall UiMainMenuDialog(char *name, int *pdwResult, void (__stdcall *fnSound)(char *file), int a4);
void UNKCALL MainMenu_10008354(HWND hDlg); LRESULT __stdcall MainMenu_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
int __fastcall MainMenu_10008391(int a1, int a2); void __fastcall MainMenu_KillAndFreeMenu(HWND hWnd);
void UNKCALL MainMenu_100083A8(HWND hWnd); void __fastcall MainMenu_SetMenuTimer(HWND hWnd);
int __fastcall MainMenu_1000845A(int a1, int a2, int a3); void __fastcall MainMenu_LoadMenuGFX(HWND hWnd);
BOOL MainMenu_100084D5(); void __fastcall MainMenu_DoOptions(HWND hWnd, int option, int PlaySelect);
LRESULT __fastcall MainMenu_100084FA(HWND hWnd, int a2); BOOL __cdecl MainMenu_CheckEnoughMemory();
void __fastcall MainMenu_CheckWParamFocus(HWND hWnd, WPARAM wParam);
int Modem_1000855D(); int Modem_1000855D();
@ -335,14 +343,15 @@ void UNKCALL ModmStat_10008EBF(HWND hDlg);
signed int ModmStat_10008F26(); signed int ModmStat_10008F26();
int __fastcall OkCancel_10008F31(HWND hWnd, const CHAR *a2); BOOL __fastcall OkCancel_DrawString(HWND hWnd, char *str);
signed int OkCancel_10008FEC(); void __cdecl j_OkCancel_cpp_init();
HGDIOBJ __stdcall OkCancel_10008FF7(HWND a1, UINT Msg, WPARAM wParam, HWND hWnd); void __cdecl OkCancel_cpp_init();
void **UNKCALL OkCancel_10009117(HWND hWnd); LRESULT __stdcall OkCancel_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
signed int __fastcall OkCancel_10009161(HWND a1, int a2); void __fastcall OkCancel_FreeDlgBmp(HWND hWnd);
int __fastcall OkCancel_100092F5(int a1, int a2); BOOL __fastcall OkCancel_LoadOkCancGFX(HWND hWnd, DWORD *lParam);
int __fastcall OkCancel_1000930A(int a1, int a2, int a3); void __fastcall OkCancel_PlaySndEndDlg(HWND hWnd, int a2);
//LPCSTR __stdcall UiMessageBoxCallback(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType); void __fastcall OkCancel_DoOkDialog(HWND hWnd, char *str, int a3);
void __stdcall UiMessageBoxCallback(HWND hWnd, char *lpText, LPCSTR lpCaption, UINT uType);
signed int Progress_10009480(); signed int Progress_10009480();
@ -356,21 +365,24 @@ void UNKCALL Progress_100098C5(HWND hWnd);
BOOL UNKCALL Progress_1000991C(HWND hWnd); BOOL UNKCALL Progress_1000991C(HWND hWnd);
signed int Sbar_100099B5(); void __cdecl j_Sbar_cpp_init();
int UNKCALL Sbar_100099C0(HWND hWnd); // idb void __cdecl Sbar_cpp_init();
int __fastcall Sbar_100099DC(HWND hWnd, LONG a2, int a3); BOOL __fastcall Sbar_CheckIfNextHero(HWND hWnd);
HWND __fastcall Sbar_10009A99(HWND hDlg, int nIDDlgItem, int a3, int a4); int __fastcall Sbar_NumScrollLines(HWND hWnd, int width, int height);
HWND __fastcall Sbar_10009BF1(HWND hDlg, int nIDDlgItem); void __fastcall Sbar_DrawScrollBar(HWND hWnd, int nIDDlgItem, int width, int height);
signed int Sbar_10009CC7(); void __fastcall Sbar_LoadScrBarGFX(HWND hWnd, int nIDDlgItem);
HWND __fastcall Sbar_10009CD2(HWND hDlg, int nIDDlgItem); void __cdecl j_Sbar_cpp_init2();
void __cdecl Sbar_cpp_init2();
void __fastcall Sbar_FreeScrollBar(HWND hWnd, int nIDDlgItem);
int __stdcall SelClass_10009D66(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam); // idb LRESULT __stdcall SelClass_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
HWND UNKCALL SelClass_10009EC0(HWND hDlg); void __fastcall SelClass_FreeClassMsgTbl(HWND hWnd);
int UNKCALL SelClass_10009EFD(HWND hWnd); // idb void __fastcall SelClass_LoadClassFocus(HWND hWnd);
int __fastcall SelClass_10009FA2(HWND hWnd, int a2); void __fastcall SelClass_SetDefaultStats(HWND hWnd, int a2);
int __fastcall SelClass_1000A00D(int a1, LONG a2); void __fastcall SelClass_CheckClassSpawn(HWND hWnd, int a2);
signed int SelClass_1000A077(); void __cdecl j_SelClass_cpp_init();
void __cdecl SelClass_cpp_init();
void *SelConn_1000A082(); void *SelConn_1000A082();
@ -427,40 +439,41 @@ int SelGame_1000B67E();
signed int SelGame_1000B795(); signed int SelGame_1000B795();
int SelHero_1000B7A0(); _uiheroinfo *__cdecl SelHero_GetCurrentHeroInfo();
int SelHero_1000B7A6(); int __cdecl SelHero_GetNumHeroesLeft();
void UNKCALL SelHero_1000B7AC(void *arg); void __fastcall SelHero_SetHeroDifficulty(int diff);
char *SelHero_1000B7B3(); char *__cdecl SelHero_GetHeroNameStr();
void *SelHero_1000B7B9(); _uiheroinfo *__cdecl SelHero_AllocHeroInfo();
int SelHero_1000B7CA(); int __cdecl SelHero_GetHeroIsGood();
int __fastcall SelHero_1000B7D0(int a1, int a2); int __fastcall SelHero_SetClassStats(int heroclass, _uidefaultstats *pStats);
signed int SelHero_1000B7DE(); void __cdecl j_SelHero_cpp_init();
BOOL __fastcall SelHero_1000B899(HWND hDlg, int a2); void __cdecl SelHero_cpp_init();
int __fastcall SelHero_1000B905(HWND hDlg, int a2); void __fastcall SelHero_SetStaticBMP(HWND hWnd, int adjust_size);
HWND __fastcall SelHero_1000BA7B(HWND hDlg, const char *a2); void __fastcall SelHero_PrintHeroInfo(HWND hWnd, _uiheroinfo *pInfo);
char *UNKCALL SelHero_1000BAB4(char *arg); void __fastcall SelHero_SetStringWithMsg(HWND hWnd, const char *str);
char __fastcall SelHero_1000BB26(char *a1); BOOL __fastcall SelHero_IsNameReserved(char *name);
int __fastcall SelHero_1000BB34(char *, char *); // idb void __fastcall SelHero_SetLastNamePos(char *name);
//int UNKCALL UiValidPlayerName(char *); // idb BOOL __fastcall SelHero_NameHasChar(char *name, char *illegalchrs);
//int __stdcall UiSelHeroMultDialog(int, int, int, int, int, int, char *); // idb BOOL __fastcall UiValidPlayerName(char *name);
int __stdcall SelHero_1000BC46(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); // idb BOOL __stdcall UiSelHeroMultDialog(BOOL (__stdcall *fninfo)(BOOL (__stdcall *fninfofunc)(_uiheroinfo *)), BOOL (__stdcall *fncreate)(_uiheroinfo *), BOOL (__stdcall *fnremove)(_uiheroinfo *), BOOL (__stdcall *fnstats)(int, _uidefaultstats *), int *dlgresult, int *a6, char *name);
BOOL UNKCALL SelHero_1000BDAD(HWND arg); LRESULT __stdcall SelHero_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
int *__fastcall SelHero_1000BEDB(int *a1, char *a2); void __fastcall SelHero_DoStuffWithStrings(HWND hWnd);
BOOL UNKCALL SelHero_1000BF33(void *location); _uiheroinfo *__fastcall SelHero_GetNextHeroFromStr(_uiheroinfo *pInfo, char *name);
const char *__fastcall SelHero_1000BF4A(const char *a1, const char *a2); void __fastcall SelHero_FreeSomeMemory(void *ptr);
int UNKCALL SelHero_1000BF6D(HWND hWnd); // idb _uiheroinfo *__fastcall SelHero_GetHeroSlotFromName(_uiheroinfo *pInfo, const char *name);
int UNKCALL SelHero_1000BFF9(HWND hWnd); // idb void __fastcall SelHero_DoHeroSelList(HWND hWnd);
int UNKCALL SelHero_1000C09B(HWND hWnd); // idb void __fastcall SelHero_DoHeroSelClass(HWND hWnd);
signed int __fastcall SelHero_1000C0F9(int a1, char *a2); void __fastcall SelHero_DoEnterName(HWND hWnd);
BOOL UNKCALL SelHero_1000C21A(HWND hWnd); BOOL __fastcall SelHero_CreateHero(HWND hWnd, char *name);
int UNKCALL SelHero_1000C269(HWND hWnd); // idb void __fastcall SelHero_DoSelLoad(HWND hWnd);
void UNKCALL SelHero_1000C364(HWND hDlg); void __fastcall SelHero_DoSelDiff(HWND hWnd);
BOOL __fastcall SelHero_1000C3CE(_DWORD *a1); void __fastcall SelHero_DeleteAndFree(HWND hWnd);
int __fastcall SelHero_1000C3E2(int a1, int a2); void __fastcall SelHero_FreeAllHeroes(_uiheroinfo *pInfo);
int UNKCALL SelHero_1000C3FF(HWND hWnd); // idb void __fastcall SelHero_DoHeroEndFade(HWND hWnd, int a2);
BOOL UNKCALL SelHero_1000C49F(HWND hWnd, void *a2); void __fastcall SelHero_LoadHeroGFX(HWND hWnd);
signed int __stdcall SelHero_1000C541(void *a1); void __fastcall SelHero_SelectHeroRegion(HWND hWnd);
//int __stdcall UiSelHeroSingDialog(int, int, int, int, int, char *, int); // idb BOOL __stdcall SelHero_GetHeroInfo(_uiheroinfo *pInfo);
BOOL __stdcall UiSelHeroSingDialog(BOOL (__stdcall *fninfo)(BOOL (__stdcall *fninfofunc)(_uiheroinfo *)), BOOL (__stdcall *fncreate)(_uiheroinfo *), BOOL (__stdcall *fnremove)(_uiheroinfo *), BOOL (__stdcall *fnstats)(int, _uidefaultstats *), int *dlgresult, char *name, int *difficulty);
void *SelIPX_1000C610(); void *SelIPX_1000C610();
@ -500,33 +513,35 @@ int __fastcall SelIPX_1000D5B0(int a1, int a2);
HWND __fastcall SelIPX_1000D696(HWND hDlg, int a2, int height); HWND __fastcall SelIPX_1000D696(HWND hDlg, int a2, int height);
signed int SelList_1000D769(); void __cdecl j_SelList_cpp_init();
int __stdcall SelList_1000D774(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam); // idb void __cdecl SelList_cpp_init();
HWND UNKCALL SelList_1000D916(HWND hDlg); LRESULT __stdcall SelList_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
HWND __fastcall SelList_1000D964(HWND hDlg, int nIDDlgItem); void __fastcall SelList_DeleteFreeProcs(HWND hWnd);
HWND UNKCALL SelList_1000D9CF(HWND hDlg); void __fastcall SelList_GetHeroStats(HWND hWnd, int nIDDlgItem);
int UNKCALL SelList_1000D9F4(HWND hWnd); // idb void __fastcall SelList_CountHeroList(HWND hWnd);
int UNKCALL SelList_1000DA2D(void *arg); int __fastcall SelList_GetNextHeroLong(HWND hWnd);
int UNKCALL SelList_1000DA48(void *arg); void __fastcall SelList_LoadFocus16(HWND hWnd);
int UNKCALL SelList_1000DA55(HWND hWnd); // idb void __fastcall SelList_KillFocus16(HWND hWnd);
int __fastcall SelList_1000DB2C(HWND a1, const char *a2); void __fastcall SelList_ShowListWindow(HWND hWnd);
void UNKCALL SelList_1000DBAC(HWND hDlg); void __fastcall SelList_SetHeroDlgLong(HWND hWnd, _uiheroinfo *pInfo);
LRESULT __stdcall SelList_1000DBFE(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); void __fastcall SelList_DoListOldProc(HWND hWnd);
HWND UNKCALL SelList_1000DD36(HWND hWnd); LRESULT __stdcall SelList_OldListWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
HWND UNKCALL SelList_1000DDA7(HWND hWnd); void __fastcall SelList_ShiftHeroDlgItems(HWND hWnd);
HWND UNKCALL SelList_1000DE18(HWND hWnd); void __fastcall SelList_ShiftHeroDlgItm2(HWND hWnd);
_DWORD *UNKCALL SelList_1000DEDD(char *arg); void __fastcall SelList_HeroesWithBigDialogs(HWND hWnd);
HWND UNKCALL SelList_1000DEF4(HWND hWnd); _uiheroinfo *__fastcall SelList_GetHeroFromNum(int heronum);
HWND UNKCALL SelList_1000DFAB(HWND hWnd); void __fastcall SelList_HeroesWithHugeDlg(HWND hWnd);
HWND UNKCALL SelList_1000E043(HWND hWnd); void __fastcall SelList_HeroDlgWithSound(HWND hWnd);
int __fastcall SelList_1000E0CA(HWND hWnd, int, int); // idb void __fastcall SelList_HeroDlgWithSnd2(HWND hWnd);
void __fastcall SelList_ChooseDlgFromSize(HWND hWnd, int width, int height);
int __stdcall SelLoad_1000E1C2(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam); // idb
HWND UNKCALL SelLoad_1000E30E(HWND hDlg); LRESULT __stdcall SelLoad_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
int UNKCALL SelLoad_1000E34B(HWND hWnd); // idb void __fastcall SelLoad_DeleteProcsAndSpin(HWND hWnd);
int __fastcall SelLoad_1000E3E2(int a1, LONG a2); void __fastcall SelLoad_LoadFocusAndMsg(HWND hWnd);
signed int SelLoad_1000E41A(); void __fastcall SelLoad_SelectSndLoad(HWND hWnd, int a2);
void __cdecl j_SelLoad_cpp_init();
void __cdecl SelLoad_cpp_init();
signed int SelModem_1000E42A(); signed int SelModem_1000E42A();
@ -560,7 +575,7 @@ HWND __fastcall SelModem_1000EE78(HWND hWnd, int a2, int height);
void *SelRegn_1000EF42(); void *SelRegn_1000EF42();
_DWORD *__fastcall SelRegn_1000EF56(int a1, _DWORD *a2); _uiheroinfo *__fastcall SelRegn_SetNextHero(_uiheroinfo *pNext, _uiheroinfo *pCurrent);
signed int SelRegn_1000EF60(); signed int SelRegn_1000EF60();
int __stdcall SelRegn_1000EF6B(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); // idb int __stdcall SelRegn_1000EF6B(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); // idb
HWND __fastcall SelRegn_1000F0D7(HWND hDlg, int nIDDlgItem); HWND __fastcall SelRegn_1000F0D7(HWND hDlg, int nIDDlgItem);
@ -588,14 +603,15 @@ HWND __fastcall SelRegn_1000F929(HWND hWnd, int a2, int height);
//signed int __stdcall UiSelectRegion(_DWORD *a1); //signed int __stdcall UiSelectRegion(_DWORD *a1);
int __fastcall SelYesNo_1000FA49(int a1, const CHAR *a2, int a3, int a4); int __fastcall SelYesNo_YesNoDialog(HWND hWnd, char *dialogstr, char *hero, int nofocus); /* void */
int __stdcall SelYesNo_1000FA87(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam); // idb LRESULT __stdcall SelYesNo_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
HWND UNKCALL SelYesNo_1000FBC7(HWND hDlg); void __fastcall SelYesNo_RemoveYNDialog(HWND hWnd);
void UNKCALL SelYesNo_1000FC1C(HWND hWnd); void __fastcall SelYesNo_LoadSelYN_GFX(HWND hWnd);
int __fastcall SelYesNo_1000FCF6(int a1, LONG a2); void __fastcall SelYesNo_DoSelectYesNo(HWND hWnd, int option);
int __fastcall SelYesNo_1000FD39(int a1, const CHAR *a2, int a3, int a4); int __fastcall SelYesNo_SelOkDialog(HWND hWnd, char *dialogstr, char *hero, int nofocus); /* void */
int __fastcall SelYesNo_1000FD77(int a1, UINT a2, int a3); int __fastcall SelYesNo_SpawnErrDialog(HWND hWnd, int string_rsrc, int is_popup); /* void */
signed int SelYesNo_1000FDE3(); void __cdecl j_SelYesNo_cpp_init();
void __cdecl SelYesNo_cpp_init();
void __fastcall Title_BlitTitleBuffer(HWND hWnd); void __fastcall Title_BlitTitleBuffer(HWND hWnd);

88
DiabloUI/artfont.cpp

@ -1,62 +1,32 @@
// ref: 0x10001058 // ref: 0x10001058
void __fastcall artfont_SetArtFont(int nFont) void __fastcall artfont_SetArtFont(int nFont)
{ {
int v1; // ecx switch ( nFont )
int v2; // ecx
int v3; // ecx
int v4; // ecx
int v5; // ecx
if ( nFont )
{ {
v1 = nFont - 2; case 0:
if ( v1 ) sgpCurrFont = &font16g;
{ break;
v2 = v1 - 1; case 2:
if ( v2 )
{
v3 = v2 - 1;
if ( v3 )
{
v4 = v3 - 1;
if ( v4 )
{
v5 = v4 - 1;
if ( v5 )
{
if ( v5 == 1 )
sgpCurrFont = &font42y;
else
sgpCurrFont = &font16s;
}
else
{
sgpCurrFont = &font42g;
}
}
else
{
sgpCurrFont = &font30s;
}
}
else
{
sgpCurrFont = &font30g;
}
}
else
{
sgpCurrFont = &font24s;
}
}
else
{
sgpCurrFont = &font24g; sgpCurrFont = &font24g;
} break;
} case 3:
else sgpCurrFont = &font24s;
{ break;
sgpCurrFont = &font16g; case 4:
sgpCurrFont = &font30g;
break;
case 5:
sgpCurrFont = &font30s;
break;
case 6:
sgpCurrFont = &font42g;
break;
case 7:
sgpCurrFont = &font42y;
break;
default:
sgpCurrFont = &font16s;
break;
} }
} }
@ -96,7 +66,7 @@ void __fastcall artfont_FreeArtFont(FontStruct *pFont)
if ( pFont->active ) if ( pFont->active )
{ {
v2 = (HANDLE *)pFont->fontpal; v2 = pFont->fonttrans;
v3 = 256; v3 = 256;
do do
{ {
@ -147,11 +117,11 @@ void __fastcall artfont_LoadArtFont(FontStruct *pFont, const char *pszBinFile, c
{ {
SFileCloseFile(phFile); SFileCloseFile(phFile);
local_LoadArtImage(pszFileName, &pBuffer, size); local_LoadArtImage(pszFileName, &pBuffer, size);
memset(pFont->fontpal, 0, 0x400u); memset(pFont->fonttrans, 0, 0x400u);
if ( pBuffer ) if ( pBuffer )
{ {
v5 = 0; v5 = 0;
a1a = (HANDLE *)pFont->fontpal; a1a = pFont->fonttrans;
do do
{ {
v6 = pFont->fontbin[v5 + 2]; v6 = pFont->fontbin[v5 + 2];
@ -320,8 +290,8 @@ void __fastcall artfont_PrintFontStr(char *str, DWORD **pSurface, int sx, int sy
} }
goto LABEL_23; goto LABEL_23;
} }
hTransa = (HANDLE)&v5->fontpal[v6]; hTransa = v5->fonttrans[v6];
if ( hTransa ) /* check */ if ( v5->fonttrans[v6] )
{ {
v10 = pSurface[1]; v10 = pSurface[1];
if ( sx + v8 <= (signed int)v10 ) if ( sx + v8 <= (signed int)v10 )

1000
DiabloUI/connect.cpp

File diff suppressed because it is too large Load Diff

183
DiabloUI/copyprot.cpp

@ -1,28 +1,26 @@
// ref: 0x10004054 // ref: 0x10004054
void __stdcall UiCopyProtError(int a1) { return; } BOOL __stdcall UiCopyProtError(int *pdwResult)
//signed int __stdcall UiCopyProtError(int *a1) { return 0; } {
/* {
int v1; // eax int v1; // eax
int v2; // eax int v2; // eax
CHAR Buffer; // [esp+0h] [ebp-80h] char Buffer[128]; // [esp+0h] [ebp-80h]
if ( DiabloUI_10005C2A() ) if ( DiabloUI_GetSpawned() )
LoadStringA(hInstance, 0x3Fu, &Buffer, 127); LoadStringA(ghUiInst, 0x3Fu, Buffer, 127);
else else
LoadStringA(hInstance, 0x1Bu, &Buffer, 127); LoadStringA(ghUiInst, 0x1Bu, Buffer, 127);
v1 = SDrawGetFrameWindow(); v1 = (int)SDrawGetFrameWindow();
v2 = SDlgDialogBoxParam(hInstance, "OKCANCEL_DIALOG", v1, CopyProt_100040AF, &Buffer); v2 = SDlgDialogBoxParam(ghUiInst, "OKCANCEL_DIALOG", v1, CopyProt_WndProc, (int)Buffer);
if ( a1 ) if ( pdwResult )
*a1 = v2; *pdwResult = v2;
return 1; return 1;
} */ }
// 10010370: using guessed type int __stdcall SDlgDialogBoxParam(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow(); // 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow();
// ref: 0x100040AF // ref: 0x100040AF
int __stdcall CopyProt_100040AF(int a1, UINT Msg, WPARAM wParam, LPARAM lParam) { return 0; } LRESULT __stdcall CopyProt_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
/* { {
int v4; // ecx HWND v4; // ecx
int v5; // edx int v5; // edx
HWND v6; // eax HWND v6; // eax
LONG v7; // eax LONG v7; // eax
@ -30,31 +28,31 @@ int __stdcall CopyProt_100040AF(int a1, UINT Msg, WPARAM wParam, LPARAM lParam)
if ( Msg == 2 ) if ( Msg == 2 )
{ {
CopyProt_10004173(); CopyProt_FreeCopyResrcs();
Fade_100072BE(10); Fade_UpdatePaletteRange(10);
return SDlgDefDialogProc(a1, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( Msg <= 0x103 ) if ( Msg <= 0x103 )
return SDlgDefDialogProc(a1, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
if ( Msg <= 0x105 ) if ( Msg <= 0x105 )
{ {
v9 = (HWND)SDrawGetFrameWindow(); v9 = (HWND)SDrawGetFrameWindow();
SendMessageA(v9, Msg, wParam, lParam); SendMessageA(v9, Msg, wParam, lParam);
return SDlgDefDialogProc(a1, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( Msg == 272 ) if ( Msg == 272 )
{ {
CopyProt_100041B5((HWND)a1, (const CHAR *)lParam); CopyProt_LoadCopyStuff(hWnd, lParam);
return 1; return 1;
} }
if ( Msg != 273 ) if ( Msg != 273 )
return SDlgDefDialogProc(a1, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
switch ( (unsigned short)wParam ) switch ( (unsigned short)wParam )
{ {
case 1u: case 1u:
v6 = GetFocus(); v6 = GetFocus();
v7 = GetWindowLongA(v6, -12); v7 = GetWindowLongA(v6, -12);
v4 = a1; v4 = hWnd;
if ( v7 == 1109 ) if ( v7 == 1109 )
{ {
v5 = 1; v5 = 1;
@ -62,119 +60,98 @@ int __stdcall CopyProt_100040AF(int a1, UINT Msg, WPARAM wParam, LPARAM lParam)
} }
goto LABEL_12; goto LABEL_12;
case 2u: case 2u:
v4 = a1; v4 = hWnd;
LABEL_12: LABEL_12:
v5 = 2; v5 = 2;
goto LABEL_13; goto LABEL_13;
case 0x455u: case 0x455u:
v4 = a1; v4 = hWnd;
v5 = 1; v5 = 1;
LABEL_13: LABEL_13:
CopyProt_1000430C(v4, v5); CopyProt_EndCopyDlg(v4, v5);
break; break;
} }
return SDlgDefDialogProc(a1, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} */ }
// 1001037C: using guessed type int __stdcall SDlgDefDialogProc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow(); // 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow();
// ref: 0x10004173 // ref: 0x10004173
HGLOBAL CopyProt_10004173() { return 0; } void __cdecl CopyProt_FreeCopyResrcs()
/* { {
HGLOBAL result; // eax if ( copyprot_artpal )
if ( hResData )
{ {
FreeResource(hResData); FreeResource(copyprot_artpal);
hResData = 0; copyprot_artpal = 0;
} }
if ( dword_10029624 ) if ( copyprot_btnart )
{ {
FreeResource(dword_10029624); FreeResource(copyprot_btnart);
dword_10029624 = 0; copyprot_btnart = 0;
} }
result = dword_10029618; if ( copyprot_popupart )
if ( dword_10029618 )
{ {
result = (HGLOBAL)FreeResource(dword_10029618); FreeResource(copyprot_popupart);
dword_10029618 = 0; copyprot_popupart = 0;
} }
return result; }
} */
// ref: 0x100041B5 // ref: 0x100041B5
signed int __fastcall CopyProt_100041B5(HWND a1, const CHAR *a2) { return 0; } BOOL __fastcall CopyProt_LoadCopyStuff(HWND hWnd, int a2)
/* { {
HRSRC v2; // eax HRSRC v2; // eax
HRSRC v3; // eax HRSRC v3; // eax
HRSRC v4; // eax HRSRC v4; // eax
LPVOID v5; // edi void *v5; // edi
LPVOID v6; // ebx void *v6; // ebx
HWND v7; // eax HWND v7; // eax
char v9; // [esp+Ch] [ebp-420h] PALETTEENTRY pPalEntries[256]; // [esp+Ch] [ebp-420h]
int v10; // [esp+40Ch] [ebp-20h] int msgs[3]; // [esp+40Ch] [ebp-20h]
int v11; // [esp+410h] [ebp-1Ch] DWORD data[2]; // [esp+418h] [ebp-14h]
int v12; // [esp+414h] [ebp-18h]
int v13; // [esp+418h] [ebp-14h]
int v14; // [esp+41Ch] [ebp-10h]
LPCSTR lpString; // [esp+420h] [ebp-Ch] LPCSTR lpString; // [esp+420h] [ebp-Ch]
void *v16; // [esp+424h] [ebp-8h] void *v13; // [esp+424h] [ebp-8h]
HWND hDlg; // [esp+428h] [ebp-4h]
v12 = 0; msgs[2] = 0;
lpString = a2; lpString = (LPCSTR)a2;
hDlg = a1; data[0] = 112;
v13 = 112; data[1] = 140;
v14 = 140; msgs[0] = 1109;
v10 = 1109; msgs[1] = 2;
v11 = 2; v2 = FindResourceA(ghUiInst, "IDR_POPUPART", "ART_FILES");
v2 = FindResourceA(hInstance, "IDR_POPUPART", "ART_FILES"); copyprot_popupart = LoadResource(ghUiInst, v2);
dword_10029618 = LoadResource(hInstance, v2); v3 = FindResourceA(ghUiInst, "IDR_BTNART", "ART_FILES");
v3 = FindResourceA(hInstance, "IDR_BTNART", "ART_FILES"); copyprot_btnart = LoadResource(ghUiInst, v3);
dword_10029624 = LoadResource(hInstance, v3); v4 = FindResourceA(ghUiInst, "IDR_ARTPAL", "ART_FILES");
v4 = FindResourceA(hInstance, "IDR_ARTPAL", "ART_FILES"); copyprot_artpal = LoadResource(ghUiInst, v4);
hResData = LoadResource(hInstance, v4); v5 = LockResource(copyprot_popupart);
v5 = LockResource(dword_10029618); v6 = LockResource(copyprot_btnart);
v6 = LockResource(dword_10029624); v13 = LockResource(copyprot_artpal);
v16 = LockResource(hResData);
if ( v5 ) if ( v5 )
SDlgSetBitmapI(hDlg, 0, &byte_10029448, -1, 1, v5, 0, 284, 148, -1); SDlgSetBitmapI(hWnd, 0, &nullcharacter, -1, 1, v5, 0, 284, 148, -1);
ShowCursor(1); ShowCursor(1);
Fade_100073EF(hDlg); Fade_SetInputWindow(hWnd);
if ( v6 ) if ( v6 )
local_10007B1B(hDlg, &v10, (int)v6, &v13); local_FitButtonDlg(hWnd, msgs, v6, data);
if ( v16 ) if ( v13 )
{ {
memcpy(&v9, v16, 0x400u); memcpy(pPalEntries, v13, 0x400u);
SDrawUpdatePalette(0, 256, &v9, 1); SDrawUpdatePalette(0, 0x100u, pPalEntries, 1);
} }
v7 = GetDlgItem(hDlg, 1026); v7 = GetDlgItem(hWnd, 1026);
SetWindowTextA(v7, lpString); SetWindowTextA(v7, lpString);
return 1; return 1;
} */ }
// 100103FA: using guessed type int __stdcall SDrawUpdatePalette(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010400: using guessed type int __stdcall SDlgSetBitmapI(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x1000430C // ref: 0x1000430C
int __fastcall CopyProt_1000430C(int a1, int a2) { return 0; } void __fastcall CopyProt_EndCopyDlg(HWND hWnd, int a2)
/* { {
int v2; // esi
int v3; // edi
v2 = a2;
v3 = a1;
ShowCursor(0); ShowCursor(0);
return SDlgEndDialog(v3, v2); SDlgEndDialog(hWnd, (HANDLE)a2);
} */ }
// 10010376: using guessed type int __stdcall SDlgEndDialog(_DWORD, _DWORD);
// ref: 0x10004329 // ref: 0x10004329
signed int CopyProt_10004329() { return 0; } void __cdecl CopyProt_cpp_init()
/* { {
signed int result; // eax CopyProt_cpp_float = CopyProt_cpp_float_value;
}
result = 2139095040; // 1001F3F8: using guessed type int CopyProt_cpp_float_value;
dword_10029620 = 2139095040; // 10029620: using guessed type int CopyProt_cpp_float;
return result;
} */
// 10029620: using guessed type int dword_10029620;

523
DiabloUI/cr8game.cpp

@ -1,122 +1,108 @@
// ref: 0x10004339 // ref: 0x10004339
signed int cr8game_10004339() { return 0; } void __cdecl cr8game_cpp_init()
/* { {
signed int result; // eax cr8game_cpp_float = cr8game_cpp_float_value;
}
result = 2139095040; // 1001F3FC: using guessed type int cr8game_cpp_float_value;
dword_1002962C = 2139095040; // 1002962C: using guessed type int cr8game_cpp_float;
return result;
} */
// 1002962C: using guessed type int dword_1002962C;
// ref: 0x10004344 // ref: 0x10004344
int UNKCALL cr8game_10004344(HWND arg) { return 0; } BOOL __fastcall cr8game_GetSnetCreaGame(HWND hWnd)
/* { {
int result; // eax BOOL result; // eax
int v2; // eax DWORD *v2; // eax
int v3; // ST24_4 int *v3; // ST24_4
int v4; // ST18_4 int v4; // ST18_4
int v5; // ST14_4 int v5; // ST14_4
int v6; // ST10_4 char *v6; // ST10_4
int v7; // eax int v7; // eax
CHAR Buffer; // [esp+Ch] [ebp-308h] char Buffer[128]; // [esp+Ch] [ebp-308h]
CHAR Text; // [esp+8Ch] [ebp-288h] char Text[256]; // [esp+8Ch] [ebp-288h]
char v10; // [esp+18Ch] [ebp-188h] char a4[128]; // [esp+18Ch] [ebp-188h]
int v11; // [esp+20Ch] [ebp-108h] char a2[128]; // [esp+20Ch] [ebp-108h]
char v12; // [esp+28Ch] [ebp-88h] char str[128]; // [esp+28Ch] [ebp-88h]
int v13; // [esp+30Ch] [ebp-8h] BOOL v13; // [esp+30Ch] [ebp-8h]
HWND hWnd; // [esp+310h] [ebp-4h]
hWnd = arg; Connect_CopyPlrDescStrings(a2, 128, str, 128);
Connect_10004028((int)&v11, 128, (int)&v12, 128); Connect_SetDiffString(&cr8_gamedata, a2, str, a4, 128);
Connect_10003E0C((int)&unk_10029648, (const char *)&v11, &v12, &v10, 128); if ( UiAuthCallback(2, a2, str, 0, a4, Text, 256) )
if ( UiAuthCallback(2, (int)&v11, &v12, 0, &v10, &Text, 256) )
{ {
v2 = dword_10029634; v2 = cr8_somegamestruct;
if ( *(_DWORD *)(dword_10029634 + 32) >= 8u ) if ( cr8_somegamestruct[8] >= 8 )
{ {
*(_BYTE *)(*(_DWORD *)(dword_10029634 + 28) + 4) = byte_1002964C; *(_BYTE *)(cr8_somegamestruct[7] + 4) = cr8_gamedata.bDiff;
v2 = dword_10029634; v2 = cr8_somegamestruct;
} }
v3 = dword_10029644; v3 = cr8game_playerID;
v4 = *(_DWORD *)(dword_10029630 + 8); v4 = *(_DWORD *)(cr8_playercount + 8);
v5 = *(_DWORD *)(v2 + 32); v5 = v2[8];
v6 = *(_DWORD *)(v2 + 28); v6 = (char *)v2[7];
v7 = Connect_10003D04(&v12); v7 = Connect_GetRankFromLevel(str);
v13 = SNetCreateGame(&byte_10029670, &byte_10029690, &v10, v7, v6, v5, v4, &v11, 0, v3); v13 = SNetCreateGame(cr8_gamename, cr8_gamepassword, a4, v7, v6, v5, v4, a2, 0, v3);
if ( !v13 ) if ( !v13 )
{ {
if ( SErrGetLastError() == 183 ) if ( SErrGetLastError() == 183 )
{ {
LoadStringA(hInstance, 0x40Fu, &Buffer, 128); LoadStringA(ghUiInst, 0x40Fu, Buffer, 128);
sprintf(&Text, &Buffer, &byte_10029670); sprintf(Text, Buffer, cr8_gamename);
} }
else else
{ {
LoadStringA(hInstance, 0x410u, &Text, 256); LoadStringA(ghUiInst, 0x410u, Text, 256);
} }
UiMessageBoxCallback(hWnd, &Text, 0, 0x30u); UiMessageBoxCallback(hWnd, Text, 0, 0x30u);
} }
result = v13; result = v13;
} }
else else
{ {
UiMessageBoxCallback(hWnd, &Text, 0, 0x30u); UiMessageBoxCallback(hWnd, Text, 0, 0x30u);
result = 0; result = 0;
} }
return result; return result;
} */ }
// 10010406: using guessed type _DWORD __stdcall SErrGetLastError(); // 10010406: using guessed type _DWORD __stdcall SErrGetLastError();
// 1001040C: using guessed type int __stdcall SNetCreateGame(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD); // 10029630: using guessed type int cr8_playercount;
// 10029630: using guessed type int dword_10029630;
// 10029634: using guessed type int dword_10029634;
// 10029644: using guessed type int dword_10029644;
// 1002964C: using guessed type char byte_1002964C;
// 10029690: using guessed type char byte_10029690;
// ref: 0x100044AA // ref: 0x100044AA
void __cdecl UiCreateGameCallback() { return; } BOOL __stdcall UiCreateGameCallback(int a1, int a2, int a3, int a4, int a5, int a6)
//int __stdcall UiCreateGameCallback(int a1, int a2, int a3, int a4, int a5, int a6) { return 0; } {
/* { BOOL v6; // eax
int v6; // eax
dword_10029630 = a1; cr8_playercount = a1;
dword_10029634 = a2; cr8_somegamestruct = (DWORD *)a2;
dword_10029638 = a3; cr8_dword_10029638 = a3;
dword_10029640 = a5; cr8_dword_10029640 = a5;
dword_1002963C = a4; cr8_dword_1002963C = a4;
dword_10029644 = a6; cr8game_playerID = (int *)a6;
v6 = SDlgDialogBoxParam(hInstance, "DIALOG_CREATE_GAME", *(_DWORD *)(a4 + 8), cr8game_10004506, 0); v6 = SDlgDialogBoxParam(ghUiInst, "DIALOG_CREATE_GAME", *(_DWORD *)(a4 + 8), cr8game_WndProc, 0);
return v6 != -1 ? v6 : 0; return v6 != -1 ? v6 : 0;
} */ }
// 10010370: using guessed type int __stdcall SDlgDialogBoxParam(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD); // 10029630: using guessed type int cr8_playercount;
// 10029630: using guessed type int dword_10029630; // 10029638: using guessed type int cr8_dword_10029638;
// 10029634: using guessed type int dword_10029634; // 1002963C: using guessed type int cr8_dword_1002963C;
// 10029638: using guessed type int dword_10029638; // 10029640: using guessed type int cr8_dword_10029640;
// 1002963C: using guessed type int dword_1002963C;
// 10029640: using guessed type int dword_10029640;
// 10029644: using guessed type int dword_10029644;
// ref: 0x10004506 // ref: 0x10004506
HGDIOBJ __stdcall cr8game_10004506(HWND hDlg, UINT Msg, WPARAM wParam, HWND hWnd) { return 0; } LRESULT __stdcall cr8game_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
/* { {
UINT v4; // ebx signed int v4; // ebx
HWND v6; // eax HWND v6; // eax
HWND v7; // eax HWND v7; // eax
HWND v8; // eax HWND v8; // eax
CHAR Buffer; // [esp+Ch] [ebp-104h] char Buffer[256]; // [esp+Ch] [ebp-104h]
int v10; // [esp+10Ch] [ebp-4h] int a2; // [esp+10Ch] [ebp-4h]
v4 = Msg; v4 = Msg;
if ( Msg == 2 ) if ( Msg == 2 )
{ {
cr8game_10004828(); cr8game_FreeCreaStuff();
cr8game_10004914(hDlg); cr8game_FreeMainMem(hWnd);
if ( dword_10029628 ) if ( cr8game_hobject )
DeleteObject(dword_10029628); DeleteObject(cr8game_hobject);
dword_10029650 = 0; cr8_sendmsg1 = 0;
::hWnd = 0; cr8_sendmsg2 = 0;
return (HGDIOBJ)SDlgDefDialogProc(hDlg, v4, wParam, hWnd); return (LRESULT)SDlgDefDialogProc(hWnd, v4, (HDC)wParam, (HWND)lParam);
} }
if ( Msg > 0x103 ) if ( Msg > 0x103 )
{ {
@ -124,53 +110,53 @@ HGDIOBJ __stdcall cr8game_10004506(HWND hDlg, UINT Msg, WPARAM wParam, HWND hWnd
{ {
if ( Msg == 272 ) if ( Msg == 272 )
{ {
::hWnd = GetDlgItem(hDlg, 1010); cr8_sendmsg2 = GetDlgItem(hWnd, 1010);
dword_10029650 = GetDlgItem(hDlg, 1011); cr8_sendmsg1 = GetDlgItem(hWnd, 1011);
cr8game_1000487F(hDlg); cr8game_LoadCreaGFX(hWnd);
cr8game_1000497F(hDlg); cr8game_AllocMainMem(hWnd);
cr8game_10004A93(hDlg); cr8game_SendMessageF5(hWnd);
dword_10029628 = cr8game_10004BA8(hDlg); cr8game_hobject = cr8game_GetCr8Object(hWnd);
SendMessageA(::hWnd, 0xC5u, 0x1Fu, 0); SendMessageA(cr8_sendmsg2, 0xC5u, 0x1Fu, 0);
SendMessageA(dword_10029650, 0xC5u, 0x1Fu, 0); SendMessageA(cr8_sendmsg1, 0xC5u, 0x1Fu, 0);
return (HGDIOBJ)1; return 1;
} }
if ( Msg != 273 ) if ( Msg != 273 )
{ {
if ( Msg == 312 && GetWindowLongA(hWnd, -12) == 1030 ) if ( Msg == 312 && GetWindowLongA((HWND)lParam, -12) == 1030 )
{ {
local_10007C2E((HDC)wParam); local_SetWhiteText((HDC)wParam);
return GetStockObject(5); return (LRESULT)GetStockObject(5);
} }
return (HGDIOBJ)SDlgDefDialogProc(hDlg, v4, wParam, hWnd); return (LRESULT)SDlgDefDialogProc(hWnd, v4, (HDC)wParam, (HWND)lParam);
} }
if ( (unsigned short)wParam == 1 ) if ( (unsigned short)wParam == 1 )
{ {
if ( SendMessageA(::hWnd, 0xEu, 0, 0) ) if ( SendMessageA(cr8_sendmsg2, 0xEu, 0, 0) )
{ {
SendMessageA(::hWnd, 0xDu, 0x20u, (LPARAM)&byte_10029670); SendMessageA(cr8_sendmsg2, 0xDu, 0x20u, (LPARAM)cr8_gamename);
if ( SelHero_1000BAB4(&byte_10029670) if ( SelHero_IsNameReserved(cr8_gamename)
|| SelHero_1000BB34(&byte_10029670, (char *)&byte_10029448) || SelHero_NameHasChar(cr8_gamename, &nullcharacter)
|| !cr8game_10004B3F(&byte_10029670) ) || !cr8game_CheckValidGameName(cr8_gamename) )
{ {
LoadStringA(hInstance, 0x404u, &Buffer, 256); LoadStringA(ghUiInst, 0x404u, Buffer, 256);
OkCancel_1000930A((int)hDlg, (int)&Buffer, 1); OkCancel_DoOkDialog(hWnd, Buffer, 1);
byte_10029670 = 0; cr8_gamename[0] = 0;
} }
else else
{ {
byte_10029690 = 0; cr8_gamepassword[0] = 0;
if ( SendMessageA(dword_10029650, 0xEu, 0, 0) ) if ( SendMessageA(cr8_sendmsg1, 0xEu, 0, 0) )
SendMessageA(dword_10029650, 0xDu, 0x20u, (LPARAM)&byte_10029690); SendMessageA(cr8_sendmsg1, 0xDu, 0x20u, (LPARAM)cr8_gamepassword);
byte_1002964C = dword_1002966C; cr8_gamedata.bDiff = cr8_dword_1002966C;
TitleSnd_1001031F(); TitleSnd_PlaySelectSound();
if ( cr8game_10004344(hDlg) ) if ( cr8game_GetSnetCreaGame(hWnd) )
SDlgEndDialog(hDlg, 1); SDlgEndDialog(hWnd, (void *)HANDLE_FLAG_INHERIT);
} }
} }
else else
{ {
LoadStringA(hInstance, 0x3F0u, &Buffer, 256); LoadStringA(ghUiInst, 0x3F0u, Buffer, 256);
OkCancel_1000930A((int)hDlg, (int)&Buffer, 1); OkCancel_DoOkDialog(hWnd, Buffer, 1);
} }
} }
else else
@ -179,260 +165,209 @@ HGDIOBJ __stdcall cr8game_10004506(HWND hDlg, UINT Msg, WPARAM wParam, HWND hWnd
{ {
if ( (signed int)(unsigned short)wParam > 1031 && (signed int)(unsigned short)wParam <= 1034 ) if ( (signed int)(unsigned short)wParam > 1031 && (signed int)(unsigned short)wParam <= 1034 )
{ {
v10 = (unsigned short)wParam - 1032; a2 = (unsigned short)wParam - 1032;
if ( HIWORD(wParam) == 6 ) if ( HIWORD(wParam) == 6 )
SetFocus(::hWnd); SetFocus(cr8_sendmsg2);
if ( dword_1002966C != (unsigned short)wParam - 1032 ) if ( cr8_dword_1002966C != (unsigned short)wParam - 1032 )
{ {
if ( dword_1002966C != -1 ) if ( cr8_dword_1002966C != -1 )
{ {
v6 = GetDlgItem(hDlg, dword_1002966C + 1032); v6 = GetDlgItem(hWnd, cr8_dword_1002966C + 1032);
SendMessageA(v6, 0xF3u, 0, 0); SendMessageA(v6, 0xF3u, 0, 0);
TitleSnd_10010315(); TitleSnd_PlayMoveSound();
} }
cr8game_10004ABA(hDlg, v10); cr8game_BlitCr8Dialog(hWnd, a2);
v7 = GetDlgItem(hDlg, 1040); v7 = GetDlgItem(hWnd, 1040);
cr8game_10004B02(v7, 1029, v10); cr8game_SetWindowStr(v7, 1029, a2);
v4 = 273; v4 = 273;
dword_1002966C = v10; cr8_dword_1002966C = a2;
} }
SendMessageA(hWnd, 0xF3u, 1u, 0); SendMessageA((HWND)lParam, 0xF3u, 1u, 0);
} }
return (HGDIOBJ)SDlgDefDialogProc(hDlg, v4, wParam, hWnd); return (LRESULT)SDlgDefDialogProc(hWnd, v4, (HDC)wParam, (HWND)lParam);
} }
TitleSnd_1001031F(); TitleSnd_PlaySelectSound();
SDlgEndDialog(hDlg, 0); SDlgEndDialog(hWnd, 0);
} }
return 0; return 0;
} }
v8 = (HWND)SDrawGetFrameWindow(); v8 = (HWND)SDrawGetFrameWindow();
SendMessageA(v8, Msg, wParam, (LPARAM)hWnd); SendMessageA(v8, Msg, wParam, lParam);
} }
return (HGDIOBJ)SDlgDefDialogProc(hDlg, v4, wParam, hWnd); return (LRESULT)SDlgDefDialogProc(hWnd, v4, (HDC)wParam, (HWND)lParam);
} */ }
// 10010376: using guessed type int __stdcall SDlgEndDialog(_DWORD, _DWORD);
// 1001037C: using guessed type int __stdcall SDlgDefDialogProc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow(); // 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow();
// 1002964C: using guessed type char byte_1002964C;
// 1002966C: using guessed type int dword_1002966C;
// 10029690: using guessed type char byte_10029690;
// ref: 0x10004828 // ref: 0x10004828
BYTE *cr8game_10004828() { return 0; } void __cdecl cr8game_FreeCreaStuff()
/* { {
int result; // eax if ( cr8_creat_bg_ptr )
if ( dword_100296B0 )
{ {
SMemFree(dword_100296B0, "C:\\Src\\Diablo\\DiabloUI\\cr8game.cpp", 55, 0); SMemFree(cr8_creat_bg_ptr, "C:\\Src\\Diablo\\DiabloUI\\cr8game.cpp", 55, 0);
dword_100296B0 = 0; cr8_creat_bg_ptr = 0;
} }
if ( dword_100296B4 ) if ( cr8_but_xsm_ptr )
{ {
SMemFree(dword_100296B4, "C:\\Src\\Diablo\\DiabloUI\\cr8game.cpp", 60, 0); SMemFree(cr8_but_xsm_ptr, "C:\\Src\\Diablo\\DiabloUI\\cr8game.cpp", 60, 0);
dword_100296B4 = 0; cr8_but_xsm_ptr = 0;
} }
result = dword_100296B8; if ( cr8_diffbtns_ptr )
if ( dword_100296B8 )
{ {
result = SMemFree(dword_100296B8, "C:\\Src\\Diablo\\DiabloUI\\cr8game.cpp", 65, 0); SMemFree(cr8_diffbtns_ptr, "C:\\Src\\Diablo\\DiabloUI\\cr8game.cpp", 65, 0);
dword_100296B8 = 0; cr8_diffbtns_ptr = 0;
} }
return result; }
} */
// 10010340: using guessed type int __stdcall SMemFree(_DWORD, _DWORD, _DWORD, _DWORD);
// 100296B4: using guessed type int dword_100296B4;
// 100296B8: using guessed type int dword_100296B8;
// ref: 0x1000487F // ref: 0x1000487F
int UNKCALL cr8game_1000487F(HWND hWnd) { return 0; } BOOL __fastcall cr8game_LoadCreaGFX(HWND hWnd)
/* { {
HWND v1; // edi int id[3]; // [esp+8h] [ebp-1Ch]
int v3; // [esp+8h] [ebp-1Ch] DWORD a8[2]; // [esp+14h] [ebp-10h]
int v4; // [esp+Ch] [ebp-18h] DWORD a3[2]; // [esp+1Ch] [ebp-8h]
int v5; // [esp+10h] [ebp-14h]
int v6; // [esp+14h] [ebp-10h]
char v7; // [esp+1Ch] [ebp-8h]
v5 = 0; id[0] = 0;
v1 = hWnd; id[0] = 1;
v3 = 1; id[1] = 2;
v4 = 2; local_LoadArtWithPal(hWnd, 0, "Dialog", -1, 1, "ui_art\\creat_bg.pcx", &cr8_creat_bg_ptr, a8, 1);
local_10007944((int)hWnd, 0, "Dialog", -1, 1, (int)"ui_art\\creat_bg.pcx", &dword_100296B0, &v6, 1); local_LoadArtImage("ui_art\\but_xsm.pcx", &cr8_but_xsm_ptr, a3);
local_100078BE((int)"ui_art\\but_xsm.pcx", &dword_100296B4, &v7); SDlgSetControlBitmaps(hWnd, id, 0, (char *)cr8_but_xsm_ptr, (char *)a3, 1, -1);
SDlgSetControlBitmaps(v1, &v3, 0, dword_100296B4, &v7, 1, -1); local_LoadArtImage("ui_art\\diffbtns.pcx", &cr8_diffbtns_ptr, cr8diffbtns_size);
local_100078BE((int)"ui_art\\diffbtns.pcx", &dword_100296B8, &dword_10029660); local_SetStaticBmp(hWnd, 1040, cr8_creat_bg_ptr, a8);
local_10007A85(v1, 1040, dword_100296B0, (int)&v6);
return 1; return 1;
} */ }
// 10010388: using guessed type int __stdcall SDlgSetControlBitmaps(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 10029660: using guessed type int dword_10029660;
// 100296B4: using guessed type int dword_100296B4;
// 100296B8: using guessed type int dword_100296B8;
// ref: 0x10004914 // ref: 0x10004914
void **UNKCALL cr8game_10004914(HWND hDlg) { return 0; } void __fastcall cr8game_FreeMainMem(HWND hWnd)
/* { {
HWND v1; // ebp
signed int v2; // edi signed int v2; // edi
HWND v3; // esi HWND v3; // esi
_DWORD *result; // eax void **v4; // eax MAPDST
_DWORD *v5; // esi void *v6; // eax
int v6; // eax
struct tagRECT Rect; // [esp+10h] [ebp-10h] struct tagRECT Rect; // [esp+10h] [ebp-10h]
v1 = hDlg;
v2 = 0; v2 = 0;
do do
{ {
v3 = GetDlgItem(v1, v2 + 1032); v3 = GetDlgItem(hWnd, v2 + 1032);
GetClientRect(v3, &Rect); GetClientRect(v3, &Rect);
result = (_DWORD *)GetWindowLongA(v3, -21); v4 = (void **)GetWindowLongA(v3, -21);
v5 = result; if ( v4 )
if ( result )
{ {
v6 = *result; v6 = *v4;
if ( *v5 ) if ( *v4 )
SMemFree(v6, "C:\\Src\\Diablo\\DiabloUI\\cr8game.cpp", 160, 0); SMemFree(v6, "C:\\Src\\Diablo\\DiabloUI\\cr8game.cpp", 160, 0);
result = (_DWORD *)SMemFree(v5, "C:\\Src\\Diablo\\DiabloUI\\cr8game.cpp", 162, 0); SMemFree(v4, "C:\\Src\\Diablo\\DiabloUI\\cr8game.cpp", 162, 0);
} }
++v2; ++v2;
} }
while ( v2 < 3 ); while ( v2 < 3 );
return result; }
} */
// 10010340: using guessed type int __stdcall SMemFree(_DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x1000497F // ref: 0x1000497F
_DWORD *UNKCALL cr8game_1000497F(HWND arg) { return 0; } void __fastcall cr8game_AllocMainMem(HWND hWnd)
/* { {
int v1; // ebx int v1; // ebx
_DWORD *v2; // esi void **v2; // esi
HWND v3; // ST1C_4 HWND v3; // ST1C_4
LONG v4; // eax LONG v4; // eax
_DWORD *result; // eax
struct tagRECT Rect; // [esp+Ch] [ebp-18h] struct tagRECT Rect; // [esp+Ch] [ebp-18h]
HWND hDlg; // [esp+1Ch] [ebp-8h] HWND hWnda; // [esp+20h] [ebp-4h]
HWND hWnd; // [esp+20h] [ebp-4h]
hDlg = arg;
v1 = 0; v1 = 0;
do do
{ {
hWnd = GetDlgItem(hDlg, v1 + 1032); hWnda = GetDlgItem(hWnd, v1 + 1032);
GetClientRect(hWnd, &Rect); GetClientRect(hWnda, &Rect);
v2 = (_DWORD *)SMemAlloc(272, "C:\\Src\\Diablo\\DiabloUI\\cr8game.cpp", 177, 0); v2 = (void **)SMemAlloc(0x110u, "C:\\Src\\Diablo\\DiabloUI\\cr8game.cpp", 177, 0);
*v2 = SMemAlloc(Rect.right * Rect.bottom, "C:\\Src\\Diablo\\DiabloUI\\cr8game.cpp", 178, 0); *v2 = SMemAlloc(Rect.right * Rect.bottom, "C:\\Src\\Diablo\\DiabloUI\\cr8game.cpp", 178, 0);
v3 = hWnd; v3 = hWnda;
v2[1] = Rect.right; v2[1] = (void *)Rect.right;
v4 = Rect.bottom; v4 = Rect.bottom;
v2[3] = 0; v2[3] = 0;
v2[2] = v4; v2[2] = (void *)v4;
SetWindowLongA(v3, -21, (LONG)v2); SetWindowLongA(v3, -21, (LONG)v2);
SDlgSetBitmapI(hWnd, 0, &byte_10029448, -1, 241, *v2, 0, v2[1], v2[2], -1); SDlgSetBitmapI(hWnda, 0, &nullcharacter, -1, 241, *v2, 0, (int)v2[1], (int)v2[2], -1);
result = cr8game_10004A34(hWnd, v1++, 0); cr8game_DoAROP3Blit(hWnda, v1++, 0);
} }
while ( v1 < 3 ); while ( v1 < 3 );
return result; }
} */
// 10010364: using guessed type int __stdcall SMemAlloc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010400: using guessed type int __stdcall SDlgSetBitmapI(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x10004A34 // ref: 0x10004A34
_DWORD *__fastcall cr8game_10004A34(HWND hWnd, int a2, int a3) { return 0; } void __fastcall cr8game_DoAROP3Blit(HWND hWnd, int frame, int size)
/* { {
HWND v3; // ebp DWORD *v5; // eax
int v4; // ebx
_DWORD *result; // eax
v3 = hWnd; v5 = (DWORD *)GetWindowLongA(hWnd, -21);
v4 = a2; if ( v5 )
result = (_DWORD *)GetWindowLongA(hWnd, -21);
if ( result )
{ {
if ( dword_100296B8 ) if ( cr8_diffbtns_ptr )
{ {
SBltROP3( SBltROP3(
*result, (void *)*v5,
dword_100296B8 + dword_10029660 * result[2] * (a3 + 2 * v4), &cr8_diffbtns_ptr[cr8diffbtns_size[0] * v5[2] * (size + 2 * frame)],
result[1], v5[1],
result[2], v5[2],
result[1], v5[1],
dword_10029660, cr8diffbtns_size[0],
0, 0,
13369376); 0xCC0020u);
result = (_DWORD *)InvalidateRect(v3, 0, 0); InvalidateRect(hWnd, 0, 0);
} }
} }
return result; }
} */
// 100103F4: using guessed type int __stdcall SBltROP3(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 10029660: using guessed type int dword_10029660;
// 100296B8: using guessed type int dword_100296B8;
// ref: 0x10004A93 // ref: 0x10004A93
LRESULT UNKCALL cr8game_10004A93(HWND hDlg) { return 0; } void __fastcall cr8game_SendMessageF5(HWND hWnd)
/* { {
dword_1002966C = -1; cr8_dword_1002966C = -1;
dword_10029658 = 0; cr8_dword_10029658 = 0;
dword_10029668 = 0; cr8_dword_10029668 = 0;
return SendDlgItemMessageA(hDlg, 1032, 0xF5u, 0, 0); SendDlgItemMessageA(hWnd, 1032, 0xF5u, 0, 0);
} */ }
// 10029658: using guessed type int dword_10029658; // 10029658: using guessed type int cr8_dword_10029658;
// 10029668: using guessed type int dword_10029668; // 10029668: using guessed type int cr8_dword_10029668;
// 1002966C: using guessed type int dword_1002966C;
// ref: 0x10004ABA // ref: 0x10004ABA
_DWORD *__fastcall cr8game_10004ABA(HWND hDlg, int a2) { return 0; } void __fastcall cr8game_BlitCr8Dialog(HWND hWnd, int a2)
/* { {
int v2; // edi
HWND v3; // ebx
HWND v4; // eax HWND v4; // eax
HWND v5; // eax HWND v5; // eax
v2 = a2; if ( cr8_dword_1002966C != -1 )
v3 = hDlg;
if ( dword_1002966C != -1 )
{ {
v4 = GetDlgItem(hDlg, dword_1002966C + 1032); v4 = GetDlgItem(hWnd, cr8_dword_1002966C + 1032);
cr8game_10004A34(v4, dword_1002966C, 0); cr8game_DoAROP3Blit(v4, cr8_dword_1002966C, 0);
} }
v5 = GetDlgItem(v3, v2 + 1032); v5 = GetDlgItem(hWnd, a2 + 1032);
return cr8game_10004A34(v5, v2, 1); cr8game_DoAROP3Blit(v5, a2, 1);
} */ }
// 1002966C: using guessed type int dword_1002966C;
// ref: 0x10004B02 // ref: 0x10004B02
BOOL __fastcall cr8game_10004B02(HWND hWnd, int a2, int a3) { return 0; } void __fastcall cr8game_SetWindowStr(HWND hWnd, int dlgitem, int a3)
/* { {
HWND v3; // esi char Buffer[256]; // [esp+4h] [ebp-100h]
CHAR Buffer; // [esp+4h] [ebp-100h]
v3 = hWnd; LoadStringA(ghUiInst, a3 + dlgitem, Buffer, 256);
LoadStringA(hInstance, a3 + a2, &Buffer, 256); SetWindowTextA(hWnd, Buffer);
return SetWindowTextA(v3, &Buffer); }
} */
// ref: 0x10004B3F // ref: 0x10004B3F
int UNKCALL cr8game_10004B3F(char *arg) { return 0; } int __fastcall cr8game_CheckValidGameName(char *name)
/* { {
signed int v1; // edi signed int v1; // edi
char v2; // al char v2; // al
signed int v3; // esi signed int v3; // esi
int result; // eax int result; // eax
char v5; // [esp+8h] [ebp-24h] char v5[32]; // [esp+8h] [ebp-24h]
char v6[31]; // [esp+9h] [ebp-23h]
char *v7; // [esp+28h] [ebp-4h]
v7 = arg; strcpy(v5, name);
strcpy(&v5, arg);
v1 = 0; v1 = 0;
if ( v5 == 32 ) if ( v5[0] == 32 )
{ {
v2 = 32; v2 = 32;
while ( v2 ) while ( v2 )
{ {
v2 = v6[v1++]; v2 = v5[v1++ + 1];
if ( v2 != 32 ) if ( v2 != 32 )
goto LABEL_5; goto LABEL_5;
} }
@ -442,46 +377,40 @@ LABEL_9:
else else
{ {
LABEL_5: LABEL_5:
v3 = strlen(&v5); v3 = strlen(v5);
while ( *(&v5 + --v3) == 32 ) while ( v5[--v3] == 32 )
{ {
if ( v3 <= v1 ) if ( v3 <= v1 )
goto LABEL_9; goto LABEL_9;
} }
v6[v3] = 0; v5[v3 + 1] = 0;
strcpy(v7, &v5 + v1); strcpy(name, &v5[v1]);
result = v3 + 1 - v1; result = v3 + 1 - v1;
} }
return result; return result;
} */ }
// 10004B3F: using guessed type char var_23[31];
// ref: 0x10004BA8 // ref: 0x10004BA8
HFONT UNKCALL cr8game_10004BA8(HWND hWnd) { return 0; } HFONT __fastcall cr8game_GetCr8Object(HWND hWnd)
/* { {
HFONT v1; // edi HFONT v2; // eax MAPDST
HFONT v2; // eax int pv[15]; // [esp+8h] [ebp-40h]
int pv; // [esp+8h] [ebp-40h]
int v5; // [esp+Ch] [ebp-3Ch]
HWND hDlg; // [esp+44h] [ebp-4h]
hDlg = hWnd; v2 = (HFONT)SendMessageA(hWnd, 0x31u, 0, 0);
v1 = (HFONT)SendMessageA(hWnd, 0x31u, 0, 0); if ( v2 )
if ( v1 )
{ {
if ( GetObjectA(v1, 60, &pv) ) if ( GetObjectA(v2, 60, pv) )
{ {
pv = -MulDiv(12, 96, 72); pv[0] = -MulDiv(12, 96, 72);
v5 = 0; pv[1] = 0;
v2 = CreateFontIndirectA((const LOGFONTA *)&pv); v2 = CreateFontIndirectA((const LOGFONTA *)pv);
v1 = v2;
if ( v2 ) if ( v2 )
{ {
SendDlgItemMessageA(hDlg, 1032, 0x30u, (WPARAM)v2, 0); SendDlgItemMessageA(hWnd, 1032, 0x30u, (WPARAM)v2, 0);
SendDlgItemMessageA(hDlg, 1033, 0x30u, (WPARAM)v1, 0); SendDlgItemMessageA(hWnd, 1033, 0x30u, (WPARAM)v2, 0);
SendDlgItemMessageA(hDlg, 1034, 0x30u, (WPARAM)v1, 0); SendDlgItemMessageA(hWnd, 1034, 0x30u, (WPARAM)v2, 0);
} }
} }
} }
return v1; return v2;
} */ }

401
DiabloUI/creadung.cpp

@ -1,31 +1,27 @@
// ref: 0x10004C33 // ref: 0x10004C33
void UNKCALL CreaDung_10004C33(void *arg) { return; } void __fastcall CreaDung_SetDelSpin(int a1)
/* { {
dword_100296CC = (int)arg; creadung_delspinners = a1;
} */ }
// 100296CC: using guessed type int dword_100296CC; // 100296CC: using guessed type int creadung_delspinners;
// ref: 0x10004C3F // ref: 0x10004C3F
signed int CreaDung_10004C3F() { return 0; } void __cdecl CreaDung_cpp_init()
/* { {
signed int result; // eax CreaDung_cpp_float = CreaDung_cpp_float_value;
}
result = 2139095040; // 1001F400: using guessed type int CreaDung_cpp_float_value;
dword_100296C4 = 2139095040; // 100296C4: using guessed type int CreaDung_cpp_float;
return result;
} */
// 100296C4: using guessed type int dword_100296C4;
// ref: 0x10004C4A // ref: 0x10004C4A
int __stdcall CreaDung_10004C4A(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { return 0; } LRESULT __stdcall CreaDung_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
/* { {
HWND v4; // eax HWND v4; // eax
HWND v6; // eax HWND v6; // eax
int savedregs; // [esp+Ch] [ebp+0h]
if ( Msg == 2 ) if ( Msg == 2 )
{ {
CreaDung_10004E2E(hWnd); CreaDung_FreeDungProcs(hWnd);
} }
else if ( Msg > 0x103 ) else if ( Msg > 0x103 )
{ {
@ -33,8 +29,8 @@ int __stdcall CreaDung_10004C4A(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPara
{ {
if ( Msg == 272 ) if ( Msg == 272 )
{ {
dword_100296D8 = lParam; creadung_dword_100296D8 = lParam;
CreaDung_10004E8B(hWnd); CreaDung_LoadDungGFX(hWnd);
} }
else else
{ {
@ -42,34 +38,34 @@ int __stdcall CreaDung_10004C4A(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPara
{ {
if ( HIWORD(wParam) == 7 ) if ( HIWORD(wParam) == 7 )
{ {
Focus_100075B7(hWnd, (HWND)lParam); Focus_GetAndBlitSpin(hWnd, lParam);
} }
else if ( HIWORD(wParam) == 6 ) else if ( HIWORD(wParam) == 6 )
{ {
Focus_10007458((void *)lParam); Focus_CheckPlayMove(lParam);
Focus_100075DC(hWnd, (HWND)lParam); Focus_DoBlitSpinIncFrame(hWnd, (HWND)lParam);
CreaDung_10004D75(hWnd, (unsigned short)wParam); CreaDung_ParseDungProcs(hWnd, (unsigned short)wParam);
} }
else if ( wParam == 327681 ) else if ( HIWORD(wParam) == 5 || (_WORD)wParam == 1 )
{ {
CreaDung_10004F5D(hWnd, (int)&savedregs); CreaDung_DoAllPlaySnd(hWnd);
} }
else if ( (_WORD)wParam == 2 ) else if ( (_WORD)wParam == 2 )
{ {
CreaDung_10004F40((int)hWnd, 2); CreaDung_PlaySndAndKill(hWnd, 2);
} }
return SDlgDefDialogProc(hWnd, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( Msg != 275 ) if ( Msg != 275 )
{ {
if ( Msg == 513 ) if ( Msg == 513 )
CreaDung_1000517E(hWnd, (unsigned short)lParam, (int)&savedregs, (unsigned int)lParam >> 16); CreaDung_CheckDlgForSnd(hWnd, (unsigned short)lParam, (unsigned int)lParam >> 16);
return SDlgDefDialogProc(hWnd, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( wParam == 1 ) if ( wParam == 1 )
{ {
v4 = GetFocus(); v4 = GetFocus();
Focus_100075DC(hWnd, v4); Focus_DoBlitSpinIncFrame(hWnd, v4);
} }
} }
return 0; return 0;
@ -77,272 +73,233 @@ int __stdcall CreaDung_10004C4A(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPara
v6 = (HWND)SDrawGetFrameWindow(); v6 = (HWND)SDrawGetFrameWindow();
SendMessageA(v6, Msg, wParam, lParam); SendMessageA(v6, Msg, wParam, lParam);
} }
return SDlgDefDialogProc(hWnd, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} */ }
// 1001037C: using guessed type int __stdcall SDlgDefDialogProc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow(); // 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow();
// 100296D8: using guessed type int dword_100296D8; // 100296D8: using guessed type int creadung_dword_100296D8;
// ref: 0x10004D75 // ref: 0x10004D75
int __fastcall CreaDung_10004D75(HWND a1, int a2) { return 0; } void __fastcall CreaDung_ParseDungProcs(HWND hWnd, int dlg)
/* { {
int v2; // esi
HWND v3; // eax HWND v3; // eax
int v4; // eax int v4; // eax
HWND v5; // eax HWND v5; // eax
int v6; // eax int v6; // eax
HWND hDlg; // [esp+0h] [ebp-104h] char Buffer[256]; // [esp+4h] [ebp-100h]
CHAR Buffer; // [esp+4h] [ebp-100h]
v2 = a2; LoadStringA(ghUiInst, dlg - 1055, Buffer, 255);
hDlg = a1; v3 = GetDlgItem(hWnd, 1097);
LoadStringA(hInstance, a2 - 1055, &Buffer, 255);
v3 = GetDlgItem(hDlg, 1097);
if ( v3 ) if ( v3 )
{ {
v4 = GetWindowLongA(v3, -21); v4 = GetWindowLongA(v3, -21);
local_10007FA4(v4, &Buffer); local_SetWndLongStr(v4, Buffer);
} }
Doom_10006A13(hDlg, (int *)&unk_100228E8, 5); Doom_ParseWndProc4(hWnd, creadung_msgtbl2, 5);
LoadStringA(hInstance, v2 - 65, &Buffer, 255); LoadStringA(ghUiInst, dlg - 65, Buffer, 255);
v5 = GetDlgItem(hDlg, 1099); v5 = GetDlgItem(hWnd, 1099);
if ( v5 ) if ( v5 )
{ {
v6 = GetWindowLongA(v5, -21); v6 = GetWindowLongA(v5, -21);
local_10007FA4(v6, &Buffer); local_SetWndLongStr(v6, Buffer);
} }
return Doom_10006A13(hDlg, (int *)&unk_100228F0, 1); Doom_ParseWndProc4(hWnd, creadung_msgtbl3, 1);
} */ }
// ref: 0x10004E2E // ref: 0x10004E2E
void UNKCALL CreaDung_10004E2E(HWND hDlg) { return; } void __fastcall CreaDung_FreeDungProcs(HWND hWnd)
/* { {
HWND v1; // esi void **v2; // eax
_DWORD *v2; // eax
v1 = hDlg; Doom_DeleteFreeProcs(hWnd, creadung_msgtbl5);
Doom_10006C53(hDlg, (int *)&unk_10022904); Doom_DeleteFreeProcs(hWnd, creadung_msgtbl4);
Doom_10006C53(v1, (int *)&unk_100228F8); Doom_DeleteFreeProcs(hWnd, creadung_msgtbl3);
Doom_10006C53(v1, (int *)&unk_100228F0); Doom_DeleteFreeProcs(hWnd, creadung_msgtbl2);
Doom_10006C53(v1, (int *)&unk_100228E8); Doom_DeleteFreeProcs(hWnd, creadung_msgtbl1);
Doom_10006C53(v1, (int *)&unk_100228DC); v2 = (void **)GetWindowLongA(hWnd, -21);
v2 = (_DWORD *)GetWindowLongA(v1, -21); local_FreeMemPtr(v2);
local_10007F72(v2); if ( creadung_delspinners )
if ( dword_100296CC ) Focus_DeleteSpinners();
Focus_100076C3(); }
} */ // 100296CC: using guessed type int creadung_delspinners;
// 100296CC: using guessed type int dword_100296CC;
// ref: 0x10004E8B // ref: 0x10004E8B
int UNKCALL CreaDung_10004E8B(HWND hWnd) { return 0; } void __fastcall CreaDung_LoadDungGFX(HWND hWnd)
/* { {
HWND v1; // esi DWORD *v2; // eax MAPDST
int v2; // eax
int *v3; // edi
v1 = hWnd; if ( creadung_delspinners )
if ( dword_100296CC ) Focus_LoadSpinner("ui_art\\focus16.pcx");
Focus_10007719("ui_art\\focus16.pcx");
else else
Focus_100076FA(); Focus_ResetSpinToZero();
SDlgSetTimer(v1, 1, 55, 0); SDlgSetTimer((int)hWnd, 1, 55, 0);
v2 = local_10007F46(); v2 = local_AllocWndLongData();
v3 = (int *)v2;
if ( v2 ) if ( v2 )
{ {
SetWindowLongA(v1, -21, v2); SetWindowLongA(hWnd, -21, (LONG)v2);
local_10007944((int)v1, 0, "popup", -1, 1, (int)"ui_art\\seldiff.pcx", v3, v3 + 1, 0); local_LoadArtWithPal(hWnd, 0, "popup", -1, 1, "ui_art\\seldiff.pcx", (BYTE **)v2, v2 + 1, 0);
} }
local_10007CB5(v1, (int *)&unk_10022904); local_DoUiWndProc(hWnd, (DWORD *)creadung_msgtbl5);
Doom_100068AB(v1, (int *)&unk_100228DC, 5); Doom_ParseWndProc3(hWnd, creadung_msgtbl1, 5);
Doom_100068AB(v1, (int *)&unk_100228E8, 5); Doom_ParseWndProc3(hWnd, creadung_msgtbl2, 5);
Doom_100068AB(v1, (int *)&unk_100228F0, 1); Doom_ParseWndProc3(hWnd, creadung_msgtbl3, 1);
Doom_1000658C(v1, (int *)&unk_100228F8, 4, 0); Doom_ParseWndProcs(hWnd, creadung_msgtbl4, 4, 0);
return Doom_1000658C(v1, (int *)&unk_10022904, 2, 1); Doom_ParseWndProcs(hWnd, creadung_msgtbl5, 2, 1);
} */ }
// 10010412: using guessed type int __stdcall SDlgSetTimer(_DWORD, _DWORD, _DWORD, _DWORD); // 100296CC: using guessed type int creadung_delspinners;
// 100296CC: using guessed type int dword_100296CC;
// ref: 0x10004F40 // ref: 0x10004F40
int __fastcall CreaDung_10004F40(int a1, int a2) { return 0; } void __fastcall CreaDung_PlaySndAndKill(HWND hWnd, int a2)
/* { {
int v2; // edi TitleSnd_PlaySelectSound();
int v3; // esi SDlgKillTimer((int)hWnd, 1);
SDlgEndDialog(hWnd, (HANDLE)a2);
v2 = a2; }
v3 = a1;
TitleSnd_1001031F();
SDlgKillTimer(v3, 1);
return SDlgEndDialog(v3, v2);
} */
// 10010376: using guessed type int __stdcall SDlgEndDialog(_DWORD, _DWORD);
// 10010418: using guessed type int __stdcall SDlgKillTimer(_DWORD, _DWORD);
// ref: 0x10004F5D // ref: 0x10004F5D
HWND USERCALL CreaDung_10004F5D(HWND a1, int a2) { return 0; } void __fastcall CreaDung_DoAllPlaySnd(HWND hWnd)
/* { {
int v2; // esi //int v1; // ebp
HWND v2; // esi
HWND v3; // eax HWND v3; // eax
LONG v4; // eax LONG v4; // eax
HWND result; // eax HWND v5; // edi
HWND v6; // edi HWND v6; // eax
HWND v7; // eax int v7; // [esp-288h] [ebp-28Ch]
int v8; // [esp-288h] [ebp-28Ch] int v8; // [esp-188h] [ebp-18Ch]
int v9; // [esp-188h] [ebp-18Ch] char *v9; // [esp-108h] [ebp-10Ch]
int v10; // [esp-108h] [ebp-10Ch] char *v10; // [esp-88h] [ebp-8Ch]
int v11; // [esp-88h] [ebp-8Ch] int v11; // [esp-8h] [ebp-Ch]
int v12; // [esp-8h] [ebp-Ch] char v12; // [esp-4h] [ebp-8h]
char v13; // [esp-4h] [ebp-8h] //int v13; // [esp+0h] [ebp-4h]
int v14; // [esp+0h] [ebp-4h]
v2 = (int)a1; /* note: stack is hosed, fix me */
if ( dword_100296D8 == 1 ) v2 = hWnd;
if ( creadung_dword_100296D8 == 1 )
{ {
v14 = a2; //v13 = v1;
v6 = a1; v5 = hWnd;
Connect_10004028((int)&v11, 128, (int)&v10, 128); Connect_CopyPlrDescStrings((char *)&v10, 128, (char *)&v9, 128);
v7 = GetFocus(); v6 = GetFocus();
v13 = GetWindowLongA(v7, -12) - 70; v12 = GetWindowLongA(v6, -12) - 70;
Connect_10003E0C((int)&v12, (const char *)&v11, (char *)&v10, (char *)&v9, 128); Connect_SetDiffString((_gamedata *)&v11, (const char *)&v10, (char *)&v9, (char *)&v8, 128);
if ( UiAuthCallback(2, (int)&v11, (char *)&v10, 0, (char *)&v9, (LPSTR)&v8, 256) ) if ( UiAuthCallback(2, (char *)&v10, (char *)&v9, 0, (char *)&v8, (LPSTR)&v7, 256) )
result = CreaDung_10005037(v6); CreaDung_DoSnetCreaGame(v5);
else else
result = (HWND)SelYesNo_1000FD39((int)v6, (const CHAR *)&v8, 0, 0); SelYesNo_SelOkDialog(v5, (char *)&v7, 0, 0);
} }
else else
{ {
v3 = GetFocus(); v3 = GetFocus();
v4 = GetWindowLongA(v3, -12); v4 = GetWindowLongA(v3, -12);
SelHero_1000B7AC((void *)(v4 - 1094)); SelHero_SetHeroDifficulty(v4 - 1094);
result = (HWND)CreaDung_10004F40(v2, 1); CreaDung_PlaySndAndKill(v2, 1);
} }
return result; }
} */
// 10004F5D: could not find valid save-restore pair for ebp // 10004F5D: could not find valid save-restore pair for ebp
// 100296D8: using guessed type int dword_100296D8; // 100296D8: using guessed type int creadung_dword_100296D8;
// ref: 0x10005037 // ref: 0x10005037
HWND UNKCALL CreaDung_10005037(HWND arg) { return 0; } void __fastcall CreaDung_DoSnetCreaGame(HWND hWnd)
/* { {
HWND v1; // eax HWND v1; // ebx
HWND v2; // ebx DWORD *v2; // eax
HWND result; // eax DWORD v3; // edi
int v4; // eax char a4[256]; // [esp+8h] [ebp-34Ch]
int v5; // edi char v5[128]; // [esp+108h] [ebp-24Ch]
char v6; // [esp+8h] [ebp-34Ch] char Buffer[192]; // [esp+188h] [ebp-1CCh]
CHAR v7; // [esp+108h] [ebp-24Ch] char a3[128]; // [esp+248h] [ebp-10Ch]
CHAR Buffer; // [esp+188h] [ebp-1CCh] char a2[128]; // [esp+2C8h] [ebp-8Ch]
char v9; // [esp+248h] [ebp-10Ch] _gamedata a1; // [esp+348h] [ebp-Ch]
char v10; // [esp+2C8h] [ebp-8Ch]
char v11; // [esp+348h] [ebp-Ch]
char v12; // [esp+34Ch] [ebp-8h]
HWND v13; // [esp+350h] [ebp-4h]
v13 = arg;
v1 = GetFocus(); v1 = GetFocus();
v2 = v1; if ( hWnd == GetParent(v1) )
result = GetParent(v1);
if ( v13 == result )
{ {
Connect_10004028((int)&v10, 128, (int)&v9, 128); Connect_CopyPlrDescStrings(a2, 128, a3, 128);
v12 = GetWindowLongA(v2, -12) - 70; a1.bDiff = GetWindowLongA(v1, -12) - 70;
Connect_10003E0C((int)&v11, &v10, &v9, &v6, 256); Connect_SetDiffString(&a1, a2, a3, a4, 256);
v4 = dword_100296D0; v2 = crea_somegamestruct;
if ( *(_DWORD *)(dword_100296D0 + 32) >= 8u ) if ( crea_somegamestruct[8] >= 8 )
{ {
v5 = *(_DWORD *)(dword_100296D0 + 28); v3 = crea_somegamestruct[7];
*(_BYTE *)(v5 + 4) = GetWindowLongA(v2, -12) - 70; *(_BYTE *)(v3 + 4) = GetWindowLongA(v1, -12) - 70;
v4 = dword_100296D0; v2 = crea_somegamestruct;
} }
if ( SNetCreateGame( if ( SNetCreateGame(
dword_100296DC, creadung_gamename,
0, 0,
&v6, a4,
0, 0,
*(_DWORD *)(v4 + 28), (char *)v2[7],
*(_DWORD *)(v4 + 32), v2[8],
*(_DWORD *)(dword_100296BC + 8), *(_DWORD *)(creadung_playername + 8),
&v10, a2,
0, 0,
dword_100296C0) ) creadung_playerID) )
{ {
result = (HWND)CreaDung_10004F40((int)v13, 1); CreaDung_PlaySndAndKill(hWnd, 1);
} }
else else
{ {
dword_100296D4 = SErrGetLastError(); creadung_lasterror = SErrGetLastError();
if ( dword_100296D4 == 183 ) if ( creadung_lasterror == 183 )
{ {
LoadStringA(hInstance, 0x49u, &v7, 127); LoadStringA(ghUiInst, 0x49u, v5, 127);
wsprintfA(&Buffer, &v7, dword_100296DC); wsprintfA(Buffer, v5, creadung_gamename);
} }
else else
{ {
LoadStringA(hInstance, 0x26u, &Buffer, 191); LoadStringA(ghUiInst, 0x26u, Buffer, 191);
} }
result = (HWND)SelYesNo_1000FD39((int)v13, &Buffer, 0, 0); SelYesNo_SelOkDialog(hWnd, Buffer, 0, 0);
} }
} }
return result; }
} */
// 10010406: using guessed type _DWORD __stdcall SErrGetLastError(); // 10010406: using guessed type _DWORD __stdcall SErrGetLastError();
// 1001040C: using guessed type int __stdcall SNetCreateGame(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD); // 100296BC: using guessed type int creadung_playername;
// 100296BC: using guessed type int dword_100296BC; // 100296D4: using guessed type int creadung_lasterror;
// 100296C0: using guessed type int dword_100296C0;
// 100296D0: using guessed type int dword_100296D0;
// 100296D4: using guessed type int dword_100296D4;
// 100296DC: using guessed type int dword_100296DC;
// ref: 0x1000517E // ref: 0x1000517E
HWND USERPURGE CreaDung_1000517E(HWND hWnd, int a2, int a3, int a4) { return 0; } void __fastcall CreaDung_CheckDlgForSnd(HWND hWnd, int a2, int a3)
/* { {
int v4; // ebx HWND v6; // eax
HWND v5; // esi
int v6; // ST08_4
HWND v7; // eax HWND v7; // eax
HWND result; // eax
HWND v9; // eax
v4 = a2; v6 = GetDlgItem(hWnd, 1056);
v5 = hWnd; if ( local_GetBottomRect(hWnd, v6, a2, a3) )
v6 = a2; {
v7 = GetDlgItem(hWnd, 1056); CreaDung_DoAllPlaySnd(hWnd);
if ( local_10007C3B(v5, v7, v6, a4) ) }
return CreaDung_10004F5D(v5, a3); else
v9 = GetDlgItem(v5, 1054); {
result = (HWND)local_10007C3B(v5, v9, v4, a4); v7 = GetDlgItem(hWnd, 1054);
if ( result ) if ( local_GetBottomRect(hWnd, v7, a2, a3) )
result = (HWND)CreaDung_10004F40((int)v5, 2); CreaDung_PlaySndAndKill(hWnd, 2);
return result; }
} */ }
// ref: 0x100051D8 // ref: 0x100051D8
int __fastcall CreaDung_100051D8(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8) { return 0; } BOOL __fastcall CreaDung_SelDungDiff(int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8)
/* { {
int v8; // eax int v8; // ST10_4
int result; // eax BOOL result; // eax
dword_100296BC = a1; creadung_playername = a1;
dword_100296C8 = a3; creadung_dword_100296C8 = a3;
dword_100296C0 = a6; creadung_playerID = (int *)a6;
dword_100296CC = a7; creadung_delspinners = a7;
dword_100296D0 = a2; crea_somegamestruct = (DWORD *)a2;
dword_100296DC = a8; creadung_gamename = (char *)a8;
v8 = SelHero_1000B7CA(); v8 = SelHero_GetHeroIsGood();
result = SDlgDialogBoxParam(hInstance, "SELDIFF_DIALOG", *(_DWORD *)(a4 + 8), CreaDung_10004C4A, v8); result = SDlgDialogBoxParam(ghUiInst, "SELDIFF_DIALOG", *(_DWORD *)(a4 + 8), CreaDung_WndProc, v8);
if ( result != 1 ) if ( result != 1 )
{ {
SErrSetLastError(dword_100296D4); SErrSetLastError(creadung_lasterror);
result = 0; result = 0;
} }
return result; return result;
} */ }
// 10010370: using guessed type int __stdcall SDlgDialogBoxParam(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 1001041E: using guessed type int __stdcall SErrSetLastError(_DWORD); // 1001041E: using guessed type int __stdcall SErrSetLastError(_DWORD);
// 100296BC: using guessed type int dword_100296BC; // 100296BC: using guessed type int creadung_playername;
// 100296C0: using guessed type int dword_100296C0; // 100296C8: using guessed type int creadung_dword_100296C8;
// 100296C8: using guessed type int dword_100296C8; // 100296CC: using guessed type int creadung_delspinners;
// 100296CC: using guessed type int dword_100296CC; // 100296D4: using guessed type int creadung_lasterror;
// 100296D0: using guessed type int dword_100296D0;
// 100296D4: using guessed type int dword_100296D4;
// 100296DC: using guessed type int dword_100296DC;

34
DiabloUI/creastat.cpp

@ -1,25 +1,19 @@
// ref: 0x1000523E // ref: 0x1000523E
signed int __stdcall UiGetDefaultStats(int a1, _WORD *a2) { return 0; } BOOL __stdcall UiGetDefaultStats(int pclass, _uidefaultstats *pStats)
/* { {
if ( !a2 ) if ( !pStats )
return 0; return 0;
*a2 = word_10022958[4 * a1]; pStats->strength = defstats[pclass][0];
a2[1] = word_1002295A[4 * a1]; pStats->magic = defstats[pclass][1];
a2[2] = word_1002295C[4 * a1]; pStats->dexterity = defstats[pclass][2];
a2[3] = word_1002295E[4 * a1]; pStats->vitality = defstats[pclass][3];
return 1; return 1;
} */ }
// 10022958: using guessed type short word_10022958[];
// 1002295A: using guessed type short word_1002295A[];
// 1002295C: using guessed type short word_1002295C[];
// ref: 0x10005287 // ref: 0x10005287
signed int CreaStat_10005287() { return 0; } void __cdecl CreaStat_cpp_init()
/* { {
signed int result; // eax CreaStat_cpp_float = CreaStat_cpp_float_value;
}
result = 2139095040; // 1001F404: using guessed type int CreaStat_cpp_float_value;
dword_100296E0 = 2139095040; // 100296E0: using guessed type int CreaStat_cpp_float;
return result;
} */
// 100296E0: using guessed type int dword_100296E0;

311
DiabloUI/credits.cpp

@ -1,38 +1,33 @@
// ref: 0x10005297 // ref: 0x10005297
signed int credits_10005297() { return 0; } void __cdecl credits_cpp_init()
/* { {
signed int result; // eax credits_cpp_float = credits_cpp_float_value;
}
result = 2139095040; // 1001F408: using guessed type int credits_cpp_float_value;
dword_100296EC = 2139095040; // 100296EC: using guessed type int credits_cpp_float;
return result;
} */
// 100296EC: using guessed type int dword_100296EC;
// ref: 0x100052A2 // ref: 0x100052A2
void __stdcall UiCreditsDialog(int a1) { return; } BOOL __stdcall UiCreditsDialog(int a1)
/* { {
int v1; // eax int v1; // eax
v1 = SDrawGetFrameWindow(); v1 = (int)SDrawGetFrameWindow();
SDlgDialogBoxParam(hInstance, "CREDITS_DIALOG", v1, credits_100052C7, 25); SDlgDialogBoxParam(ghUiInst, "CREDITS_DIALOG", v1, credits_WndProc, 25);
return 1; return 1;
} */ }
// 10010370: using guessed type int __stdcall SDlgDialogBoxParam(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow(); // 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow();
// ref: 0x100052C7 // ref: 0x100052C7
int __fastcall credits_100052C7(int a1, int a2, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { return 0; } LRESULT __stdcall credits_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
/* { {
HWND v7; // eax HWND v5; // eax
int v8; // [esp+0h] [ebp-Ch]
if ( Msg > 0x111 ) if ( Msg > 0x111 )
{ {
if ( Msg == 275 ) if ( Msg == 275 )
{ {
credits_100055C0(hWnd); credits_CalcPosROP3(hWnd);
return SDlgDefDialogProc(hWnd, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( Msg == 513 || Msg == 516 ) if ( Msg == 513 || Msg == 516 )
goto LABEL_12; goto LABEL_12;
@ -40,17 +35,17 @@ int __fastcall credits_100052C7(int a1, int a2, HWND hWnd, UINT Msg, WPARAM wPar
{ {
if ( Msg == 2024 ) if ( Msg == 2024 )
{ {
if ( !Fade_1000739F() ) if ( !Fade_CheckRange5() )
Fade_100073FD(hWnd, v8); Fade_SetFadeTimer((int)hWnd);
return 0; return 0;
} }
return SDlgDefDialogProc(hWnd, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( (_WORD)wParam != 513 && (_WORD)wParam != 516 ) if ( (_WORD)wParam != 513 && (_WORD)wParam != 516 )
return SDlgDefDialogProc(hWnd, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
LABEL_25: LABEL_25:
Title_100102D7(hWnd); Title_KillAndFadeDlg(hWnd);
return SDlgDefDialogProc(hWnd, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( Msg == 273 ) if ( Msg == 273 )
goto LABEL_25; goto LABEL_25;
@ -64,238 +59,196 @@ LABEL_25:
{ {
if ( Msg <= 0x105 ) if ( Msg <= 0x105 )
{ {
v7 = (HWND)SDrawGetFrameWindow(); v5 = (HWND)SDrawGetFrameWindow();
SendMessageA(v7, Msg, wParam, lParam); SendMessageA(v5, Msg, wParam, lParam);
} }
else if ( Msg == 272 ) else if ( Msg == 272 )
{ {
credits_1000543A(hWnd, lParam); credits_LoadImgCreditTxt(hWnd, lParam);
PostMessageA(hWnd, 0x7E8u, 0, 0); PostMessageA(hWnd, 0x7E8u, 0, 0);
return 1; return 1;
} }
} }
return SDlgDefDialogProc(hWnd, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( wParam != 32 ) if ( wParam != 32 )
return 0; return 0;
LABEL_12: LABEL_12:
Title_100102D7(hWnd); Title_KillAndFadeDlg(hWnd);
return 0; return 0;
} }
credits_100053D9(hWnd, a2); credits_FreeCreditResrc(hWnd);
return SDlgDefDialogProc(hWnd, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} */ }
// 1001037C: using guessed type int __stdcall SDlgDefDialogProc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow(); // 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow();
// ref: 0x100053D9 // ref: 0x100053D9
HGLOBAL __fastcall credits_100053D9(HWND hWnd, int a2) { return 0; } void __fastcall credits_FreeCreditResrc(HWND hWnd)
/* { {
HWND v2; // edi void **v2; // eax
_DWORD *v3; // eax
HGLOBAL result; // eax
v2 = hWnd; if ( creditsobj )
if ( dword_10029708 )
{ {
SGdiDeleteObject(hWnd, a2, dword_10029708); SGdiDeleteObject(creditsobj);
dword_10029708 = 0; creditsobj = 0;
} }
if ( dword_10029704 ) if ( credit_back_img )
{ {
SMemFree(dword_10029704, "C:\\Src\\Diablo\\DiabloUI\\credits.cpp", 46, 0); SMemFree(credit_back_img, "C:\\Src\\Diablo\\DiabloUI\\credits.cpp", 46, 0);
dword_10029704 = 0; credit_back_img = 0;
} }
v3 = (_DWORD *)GetWindowLongA(v2, -21); v2 = (void **)GetWindowLongA(hWnd, -21);
local_10007F72(v3); local_FreeMemPtr(v2);
result = dword_100296F0; if ( credittext_rsrc )
if ( dword_100296F0 )
{ {
result = (HGLOBAL)FreeResource(dword_100296F0); FreeResource(credittext_rsrc);
dword_100296F0 = 0; credittext_rsrc = 0;
} }
return result; }
} */
// 10010340: using guessed type int __stdcall SMemFree(_DWORD, _DWORD, _DWORD, _DWORD);
// 1001038E: using guessed type int __fastcall SGdiDeleteObject(_DWORD, _DWORD, _DWORD);
// 10029704: using guessed type int dword_10029704;
// 10029708: using guessed type int dword_10029708;
// ref: 0x1000543A // ref: 0x1000543A
int __fastcall credits_1000543A(HWND a1, int a2) { return 0; } void __fastcall credits_LoadImgCreditTxt(HWND hWnd, LPARAM lParam)
/* { {
int v2; // eax signed int v2; // eax
HRSRC v3; // eax HRSRC v3; // eax
HRSRC v4; // eax HRSRC v4; // eax
int v5; // eax DWORD *v5; // eax
int *v6; // esi DWORD *v6; // esi
int v7; // ebx int v7; // ebx
int v8; // esi int v8; // esi
HFONT v9; // eax HFONT v9; // eax MAPDST
HFONT v10; // esi BOOL v11; // ebx
int v11; // ebx
int result; // eax
struct tagRECT Rect; // [esp+Ch] [ebp-18h] struct tagRECT Rect; // [esp+Ch] [ebp-18h]
HWND v14; // [esp+1Ch] [ebp-8h] HWND v13; // [esp+1Ch] [ebp-8h]
HWND hWnd; // [esp+20h] [ebp-4h]
hWnd = a1; if ( lParam )
if ( a2 ) v2 = 1000 / lParam;
v2 = 1000 / a2;
else else
v2 = 50; v2 = 50;
SDlgSetTimer(a1, 1, v2, 0); SDlgSetTimer((int)hWnd, 1, v2, 0);
v3 = FindResourceA(hInstance, "IDR_CREDITS", "TEXT_FILES"); v3 = FindResourceA(ghUiInst, "IDR_CREDITS", "TEXT_FILES");
dword_100296F0 = LoadResource(hInstance, v3); credittext_rsrc = LoadResource(ghUiInst, v3);
v4 = FindResourceA(hInstance, "IDR_CREDITS", "TEXT_FILES"); v4 = FindResourceA(ghUiInst, "IDR_CREDITS", "TEXT_FILES");
dword_100296E8 = SizeofResource(hInstance, v4); credittext_size = SizeofResource(ghUiInst, v4);
v5 = local_10007F46(); v5 = local_AllocWndLongData();
v6 = (int *)v5; v6 = v5;
if ( v5 ) if ( v5 )
{ {
SetWindowLongA(hWnd, -21, v5); SetWindowLongA(hWnd, -21, (LONG)v5);
local_10007944((int)hWnd, 0, &byte_10029448, -1, 1, (int)"ui_art\\credits.pcx", v6, v6 + 1, 0); local_LoadArtWithPal(hWnd, 0, &nullcharacter, -1, 1, "ui_art\\credits.pcx", (BYTE **)v6, v6 + 1, 0);
Fade_100073C5(hWnd, 0); Fade_NoInputAndArt(hWnd, 0);
} }
v14 = GetDlgItem(hWnd, 1000); v13 = GetDlgItem(hWnd, 1000);
GetWindowRect(v14, &Rect); GetWindowRect(v13, &Rect);
v7 = Rect.right - Rect.left; v7 = Rect.right - Rect.left;
v8 = Rect.bottom - Rect.top + 60; v8 = Rect.bottom - Rect.top + 60;
dword_10029704 = SMemAlloc((Rect.right - Rect.left) * v8, "C:\\Src\\Diablo\\DiabloUI\\credits.cpp", 122, 0); credit_back_img = SMemAlloc((Rect.right - Rect.left) * v8, "C:\\Src\\Diablo\\DiabloUI\\credits.cpp", 122, 0);
dword_100296F8 = v7; credit_horz_pos = v7;
dword_100296FC = v8; credit_vertical_pos1 = v8;
local_10007A68(&Rect, 0, 30); local_AdjustRectSize(&Rect, 0, 30);
SDlgSetBitmapI(v14, 0, 0, -1, 1, dword_10029704, &Rect, v7, v8, -1); SDlgSetBitmapI(v13, 0, 0, -1, 1, credit_back_img, (int)&Rect, v7, v8, -1);
dword_100296F4 = v8 - 30; credit_vertical_pos2 = v8 - 30;
credits_100055C0(hWnd); credits_CalcPosROP3(hWnd);
v9 = CreateFontA(-17, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 0x12u, "Times New Roman"); v9 = CreateFontA(-17, 0, 0, 0, 700, 0, 0, 0, 0, 0, 0, 0, 0x12u, "Times New Roman");
v10 = v9; if ( !v9 || (v11 = SGdiImportFont(v9, (int)&creditsobj), DeleteObject(v9), !v11) )
if ( !v9 || (v11 = SGdiImportFont(v9, &dword_10029708), result = DeleteObject(v10), !v11) ) Title_KillAndFadeDlg(hWnd);
result = Title_100102D7(hWnd); }
return result; // 100296E8: using guessed type int credittext_size;
} */ // 100296FC: using guessed type int credit_vertical_pos1;
// 10010364: using guessed type int __stdcall SMemAlloc(_DWORD, _DWORD, _DWORD, _DWORD);
// 100103B2: using guessed type int __stdcall SGdiImportFont(_DWORD, _DWORD);
// 10010400: using guessed type int __stdcall SDlgSetBitmapI(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 10010412: using guessed type int __stdcall SDlgSetTimer(_DWORD, _DWORD, _DWORD, _DWORD);
// 100296E8: using guessed type int dword_100296E8;
// 100296F4: using guessed type int dword_100296F4;
// 100296F8: using guessed type int dword_100296F8;
// 100296FC: using guessed type int dword_100296FC;
// 10029704: using guessed type int dword_10029704;
// 10029708: using guessed type int dword_10029708;
// ref: 0x100055C0 // ref: 0x100055C0
BOOL UNKCALL credits_100055C0(HWND hWnd) { return 0; } void __fastcall credits_CalcPosROP3(HWND hWnd)
/* { {
HWND v1; // ebx
_DWORD *v2; // edi _DWORD *v2; // edi
struct tagRECT Rect; // [esp+Ch] [ebp-14h] struct tagRECT Rect; // [esp+Ch] [ebp-14h]
HWND hWnda; // [esp+1Ch] [ebp-4h] HWND hWnda; // [esp+1Ch] [ebp-4h]
v1 = hWnd;
hWnda = GetDlgItem(hWnd, 1000); hWnda = GetDlgItem(hWnd, 1000);
v2 = (_DWORD *)GetWindowLongA(v1, -21); v2 = (_DWORD *)GetWindowLongA(hWnd, -21);
GetWindowRect(hWnda, &Rect); GetWindowRect(hWnda, &Rect);
ScreenToClient(v1, (LPPOINT)&Rect); ScreenToClient(hWnd, (LPPOINT)&Rect);
ScreenToClient(v1, (LPPOINT)&Rect.right); ScreenToClient(hWnd, (LPPOINT)&Rect.right);
SBltROP3( SBltROP3(
dword_10029704 + 30 * dword_100296F8, (char *)credit_back_img + 30 * credit_horz_pos,
Rect.left + *v2 + Rect.top * v2[1], (void *)(Rect.left + *v2 + Rect.top * v2[1]),
dword_100296F8, credit_horz_pos,
Rect.bottom - Rect.top, Rect.bottom - Rect.top,
dword_100296F8, credit_horz_pos,
v2[1], v2[1],
0, 0,
13369376); 0xCC0020u);
--dword_100296F4; --credit_vertical_pos2;
credits_10005660(v1); credits_PrintCredLines(hWnd);
InvalidateRect(hWnda, 0, 0); InvalidateRect(hWnda, 0, 0);
return UpdateWindow(hWnda); UpdateWindow(hWnda);
} */ }
// 100103F4: using guessed type int __stdcall SBltROP3(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 100296F4: using guessed type int dword_100296F4;
// 100296F8: using guessed type int dword_100296F8;
// 10029704: using guessed type int dword_10029704;
// ref: 0x10005660 // ref: 0x10005660
signed int UNKCALL credits_10005660(void *arg) { return 0; } void __fastcall credits_PrintCredLines(HWND hWnd)
/* { {
_BYTE *v1; // esi char *v1; // esi
signed int result; // eax
int i; // edi int i; // edi
int v4; // ebp int v3; // ebp
int v5; // ebx int v4; // ebx
void *v6; // [esp+38h] [ebp-4h]
v1 = (char *)LockResource(credittext_rsrc);
v6 = arg; credit_line_count = credittext_size;
v1 = LockResource(dword_100296F0); SGdiSelectObject((int)creditsobj);
dword_10029700 = dword_100296E8; SGdiSetPitch(credit_horz_pos);
SGdiSelectObject(dword_10029708); for ( i = credit_vertical_pos2; credit_line_count > 0; v1 = credits_GetAdjustText(v1, v4) )
result = SGdiSetPitch(dword_100296F8);
for ( i = dword_100296F4; dword_10029700 > 0; v1 = (_BYTE *)result )
{ {
v4 = 0; v3 = 0;
while ( *v1 == 9 ) while ( *v1 == 9 )
{ {
v4 += 40; v3 += 40;
++v1; ++v1;
--dword_10029700; --credit_line_count;
} }
result = credits_10005736(v1); v4 = credits_GetCredLineBreak(v1);
v5 = result; if ( v4 == -1 )
if ( result == -1 )
break; break;
if ( i >= 0 ) if ( i >= 0 )
{ {
result = dword_100296FC - 30; if ( i > credit_vertical_pos1 - 30 )
if ( i > dword_100296FC - 30 )
break; break;
if ( v5 ) if ( v4 )
{ {
SGdiTextOut(dword_10029704, v4 + 2, i + 2, 0x1000000, v1, v5); SGdiTextOut(credit_back_img, v3 + 2, i + 2, 0x1000000, v1, v4);
SGdiTextOut(dword_10029704, v4, i, 16777440, v1, v5); SGdiTextOut(credit_back_img, v3, i, 16777440, v1, v4);
} }
} }
i += 22; i += 22;
result = credits_10005755((int)v1, v5);
} }
if ( i < 0 ) if ( i < 0 )
result = Title_100102D7(v6); Title_KillAndFadeDlg(hWnd);
return result; }
} */
// 100103A6: using guessed type int __stdcall SGdiSetPitch(_DWORD); // 100103A6: using guessed type int __stdcall SGdiSetPitch(_DWORD);
// 100103AC: using guessed type int __stdcall SGdiSelectObject(_DWORD); // 100103AC: using guessed type int __stdcall SGdiSelectObject(_DWORD);
// 10010424: using guessed type int __stdcall SGdiTextOut(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD); // 100296E8: using guessed type int credittext_size;
// 100296E8: using guessed type int dword_100296E8; // 100296FC: using guessed type int credit_vertical_pos1;
// 100296F4: using guessed type int dword_100296F4; // 10029700: using guessed type int credit_line_count;
// 100296F8: using guessed type int dword_100296F8;
// 100296FC: using guessed type int dword_100296FC;
// 10029700: using guessed type int dword_10029700;
// 10029704: using guessed type int dword_10029704;
// 10029708: using guessed type int dword_10029708;
// ref: 0x10005736 // ref: 0x10005736
signed int __fastcall credits_10005736(_BYTE *a1) { return 0; } int __fastcall credits_GetCredLineBreak(char *str)
/* { {
signed int result; // eax int result; // eax
result = 0; result = 0;
while ( *a1 != 13 && *a1 != 10 ) while ( *str != 13 && *str != 10 )
{ {
++result; ++result;
++a1; ++str;
if ( result > dword_10029700 ) if ( result > credit_line_count )
return -1; return -1;
} }
return result; return result;
} */ }
// 10029700: using guessed type int dword_10029700; // 10029700: using guessed type int credit_line_count;
// ref: 0x10005755 // ref: 0x10005755
int __fastcall credits_10005755(int a1, int a2) { return 0; } char *__fastcall credits_GetAdjustText(char *str, int len)
/* { {
dword_10029700 += -2 - a2; credit_line_count += -2 - len;
return a1 + a2 + 2; return &str[len + 2];
} */ }
// 10029700: using guessed type int dword_10029700; // 10029700: using guessed type int credit_line_count;

12
DiabloUI/diabloui.cpp

@ -100,24 +100,24 @@ void __stdcall UiSetSpawned(BOOL bSpawned)
// ref: 0x10005C73 // ref: 0x10005C73
void __cdecl UiInitialize() void __cdecl UiInitialize()
{ {
dword_10029714 = 1; sgbUiIsInitialized = 1;
TitleSnd_InitSoundFunc(); TitleSnd_InitSoundFunc();
artfont_InitAllFonts(); artfont_InitAllFonts();
Connect_10002EC4(); Connect_LoadGFXAndStuff();
local_LoadArtCursor(); local_LoadArtCursor();
bn_prof_100021C4(); bn_prof_100021C4();
} }
// 10029714: using guessed type int dword_10029714; // 10029714: using guessed type int sgbUiIsInitialized;
// ref: 0x10005C96 // ref: 0x10005C96
void __cdecl UiDestroy() void __cdecl UiDestroy()
{ {
bn_prof_10002247(); bn_prof_10002247();
local_FreeArtCursor(); local_FreeArtCursor();
Connect_10002E2B(); Connect_FreeConnectData();
dword_10029714 = 0; sgbUiIsInitialized = 0;
} }
// 10029714: using guessed type int dword_10029714; // 10029714: using guessed type int sgbUiIsInitialized;
// ref: 0x10005CAD // ref: 0x10005CAD
void __stdcall UiAppActivate(BOOL bActive) void __stdcall UiAppActivate(BOOL bActive)

36
DiabloUI/diabloui.h

@ -9,7 +9,7 @@ extern "C" {
struct FontStruct struct FontStruct
{ {
unsigned char fontbin[258]; unsigned char fontbin[258];
PALETTEENTRY fontpal[256]; HANDLE fonttrans[256];
BOOL active; BOOL active;
}; };
@ -31,29 +31,31 @@ struct ProfFntStruct
void __cdecl UiDestroy(); void __cdecl UiDestroy();
BOOL __stdcall UiTitleDialog(int a1); BOOL __stdcall UiTitleDialog(int a1);
void __cdecl UiInitialize(); void __cdecl UiInitialize();
void __stdcall UiCopyProtError(int a1); BOOL __stdcall UiCopyProtError(int *pdwResult);
void __stdcall UiAppActivate(BOOL bActive); void __stdcall UiAppActivate(BOOL bActive);
int __stdcall UiValidPlayerName(char *a1); BOOL __fastcall UiValidPlayerName(char *name); /* check __stdcall */
int __stdcall UiSelHeroMultDialog(void *fninfo, void *fncreate, void *fnremove, void *fnstats, int *a5, int *a6, char *name); BOOL __stdcall UiSelHeroMultDialog(BOOL (__stdcall *fninfo)(BOOL (__stdcall *fninfofunc)(_uiheroinfo *)), BOOL (__stdcall *fncreate)(_uiheroinfo *), BOOL (__stdcall *fnremove)(_uiheroinfo *), BOOL (__stdcall *fnstats)(int, _uidefaultstats *), int *dlgresult, int *a6, char *name);
int __stdcall UiSelHeroSingDialog(void *fninfo, void *fncreate, void *fnremove, void *fnstats, int *a5, char *name, int *difficulty); BOOL __stdcall UiSelHeroSingDialog(BOOL (__stdcall *fninfo)(BOOL (__stdcall *fninfofunc)(_uiheroinfo *)), BOOL (__stdcall *fncreate)(_uiheroinfo *), BOOL (__stdcall *fnremove)(_uiheroinfo *), BOOL (__stdcall *fnstats)(int, _uidefaultstats *), int *dlgresult, char *name, int *difficulty);
void __stdcall UiCreditsDialog(int a1); BOOL __stdcall UiCreditsDialog(int a1);
int __stdcall UiMainMenuDialog(char *name, int *a2, void *fnSound, int a4); 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); int __stdcall UiProgressDialog(HWND window, char *msg, int a3, void *fnfunc, int a5);
int __cdecl UiProfileGetString(); int __cdecl UiProfileGetString();
void __cdecl UiProfileCallback(); void __cdecl UiProfileCallback();
void __cdecl UiProfileDraw(); void __cdecl UiProfileDraw();
void __cdecl UiCategoryCallback(); BOOL __stdcall UiCategoryCallback(int a1, int a2, int a3, int a4, int a5, _DWORD *a6, _DWORD *a7);
void __cdecl UiGetDataCallback(); BOOL __stdcall UiGetDataCallback(int game_type, int data_code, void *a3, int a4, int a5);
void __cdecl UiAuthCallback(); BOOL __stdcall UiAuthCallback(int a1, char *a2, char *a3, char a4, char *a5, LPSTR lpBuffer, int cchBufferMax);
void __cdecl UiSoundCallback(); BOOL __stdcall UiSoundCallback(int a1, int type, int a3);
void __cdecl UiMessageBoxCallback(); void __stdcall UiMessageBoxCallback(HWND hWnd, char *lpText, LPCSTR lpCaption, UINT uType);
void __cdecl UiDrawDescCallback(); BOOL __stdcall UiDrawDescCallback(int arg0, COLORREF color, LPCSTR lpString, char *a4, int a5, UINT align, time_t a7, HDC *a8);
void __cdecl UiCreateGameCallback(); BOOL __stdcall UiCreateGameCallback(int a1, int a2, int a3, int a4, int a5, int a6);
void __cdecl UiArtCallback(); BOOL __stdcall UiArtCallback(int game_type, unsigned int art_code, PALETTEENTRY *pPalette, void *pBuffer, DWORD dwBuffersize, DWORD *pdwWidth, DWORD *pdwHeight, DWORD *pdwBpp);
int __stdcall UiSelectGame(int a1, _SNETPROGRAMDATA *client_info, _SNETPLAYERDATA *user_info, _SNETUIDATA *ui_info, _SNETVERSIONDATA *file_info, int *a6); int __stdcall UiSelectGame(int a1, _SNETPROGRAMDATA *client_info, _SNETPLAYERDATA *user_info, _SNETUIDATA *ui_info, _SNETVERSIONDATA *file_info, int *a6);
int __stdcall UiSelectProvider(int a1, _SNETPROGRAMDATA *client_info, _SNETPLAYERDATA *user_info, _SNETUIDATA *ui_info, _SNETVERSIONDATA *file_info, int *type); int __stdcall UiSelectProvider(int a1, _SNETPROGRAMDATA *client_info, _SNETPLAYERDATA *user_info, _SNETUIDATA *ui_info, _SNETVERSIONDATA *file_info, int *type);
int __stdcall UiCreatePlayerDescription(_uiheroinfo *info, int mode, char *desc); BOOL __stdcall UiCreatePlayerDescription(_uiheroinfo *info, int mode, char *desc);
int __stdcall UiSetupPlayerInfo(char *str, _uiheroinfo *info, int mode); void __stdcall UiSetupPlayerInfo(char *infostr, _uiheroinfo *pInfo, int type);
void __stdcall UiCreateGameCriteria(_uiheroinfo *pInfo, char *str);
BOOL __stdcall UiGetDefaultStats(int pclass, _uidefaultstats *pStats);
#ifdef __GNUC__ #ifdef __GNUC__
} }

10
DiabloUI/diabloui_gcc.def

@ -2,15 +2,19 @@ LIBRARY "DiabloUI"
EXPORTS EXPORTS
UiValidPlayerName @1 UiValidPlayerName @1
UiValidPlayerName@4 @1 @UiValidPlayerName@4 @1
UiAppActivate @2 UiAppActivate @2
UiAppActivate@4 @2 UiAppActivate@4 @2
UiArtCallback @3 UiArtCallback @3
UiArtCallback@32 @3
UiAuthCallback @4 UiAuthCallback @4
UiAuthCallback@28 @4
UiBetaDisclaimer @5 UiBetaDisclaimer @5
UiCategoryCallback @6 UiCategoryCallback @6
UiCategoryCallback@28 @6
UiCopyProtError @7 UiCopyProtError @7
UiCreateGameCallback @8 UiCreateGameCallback @8
UiCreateGameCallback@24 @8
UiCreateGameCriteria @9 UiCreateGameCriteria @9
UiCreatePlayerDescription @10 UiCreatePlayerDescription @10
UiCreatePlayerDescription@12 @10 UiCreatePlayerDescription@12 @10
@ -18,12 +22,15 @@ EXPORTS
UiCreditsDialog@4 @11 UiCreditsDialog@4 @11
UiDestroy @12 UiDestroy @12
UiDrawDescCallback @13 UiDrawDescCallback @13
UiDrawDescCallback@32 @13
UiGetDataCallback @14 UiGetDataCallback @14
UiGetDataCallback@20 @14
UiGetDefaultStats @15 UiGetDefaultStats @15
UiInitialize @16 UiInitialize @16
UiMainMenuDialog @17 UiMainMenuDialog @17
UiMainMenuDialog@16 @17 UiMainMenuDialog@16 @17
UiMessageBoxCallback @18 UiMessageBoxCallback @18
UiMessageBoxCallback@16 @18
UiOnPaint @19 UiOnPaint @19
UiProfileCallback @20 UiProfileCallback @20
UiProfileDraw @21 UiProfileDraw @21
@ -44,5 +51,6 @@ EXPORTS
UiSetupPlayerInfo @31 UiSetupPlayerInfo @31
UiSetupPlayerInfo@12 @31 UiSetupPlayerInfo@12 @31
UiSoundCallback @32 UiSoundCallback @32
UiSoundCallback@12 @32
UiTitleDialog @33 UiTitleDialog @33
UiTitleDialog@4 @33 UiTitleDialog@4 @33

24
DiabloUI/doom.cpp

@ -31,7 +31,7 @@ void __fastcall Doom_GetSetWndText(HWND hWnd, int msg, int nFont, int a4)
v5 = hWnd; v5 = hWnd;
if ( msg ) if ( msg )
{ {
Doom_AllocAndSetBMP(hWnd, 1521); Doom_AllocAndSetBMP(hWnd, msg, 1521);
Doom_GetWindowROP3(v5, v4); Doom_GetWindowROP3(v5, v4);
artfont_SetArtFont(nFont); artfont_SetArtFont(nFont);
Doom_PrintStrWithSpin(v4, a4); Doom_PrintStrWithSpin(v4, a4);
@ -93,18 +93,18 @@ void __fastcall Doom_PrintStrWithSpin(HWND hWnd, BOOL a2)
} }
// ref: 0x10006719 // ref: 0x10006719
void __fastcall Doom_AllocAndSetBMP(HWND hWnd, int bmp_flags) void __fastcall Doom_AllocAndSetBMP(HWND hWnd, int a2, int bmp_flags)
{ {
DWORD *v3; // esi DWORD *v4; // esi
struct tagRECT Rect; // [esp+8h] [ebp-10h] struct tagRECT Rect; // [esp+8h] [ebp-10h]
GetClientRect(hWnd, &Rect); GetClientRect((HWND)a2, &Rect);
v3 = local_AllocWndLongData(); v4 = local_AllocWndLongData();
v3[1] = Rect.right; v4[1] = Rect.right;
v3[2] = Rect.bottom; v4[2] = Rect.bottom;
*v3 = (DWORD)SMemAlloc(Rect.right * Rect.bottom, "C:\\Src\\Diablo\\DiabloUI\\Doom.cpp", 139, 0); *v4 = (DWORD)SMemAlloc(Rect.right * Rect.bottom, "C:\\Src\\Diablo\\DiabloUI\\Doom.cpp", 139, 0);
SetWindowLongA(hWnd, -21, (LONG)v3); SetWindowLongA((HWND)a2, -21, (LONG)v4);
SDlgSetBitmapI(hWnd, 0, &nullcharacter, -1, bmp_flags, (void *)*v3, 0, v3[1], v3[2], -1); SDlgSetBitmapI((HWND)a2, 0, &nullcharacter, -1, bmp_flags, (void *)*v4, 0, v4[1], v4[2], -1);
} }
// ref: 0x1000678A // ref: 0x1000678A
@ -198,7 +198,7 @@ void __fastcall Doom_GetSetWndTxt3(HWND hWnd, int msg, int nFont)
v4 = hWnd; v4 = hWnd;
if ( msg ) if ( msg )
{ {
Doom_AllocAndSetBMP(hWnd, 1); Doom_AllocAndSetBMP(hWnd, msg, 1);
Doom_GetWindowROP3(v4, v3); Doom_GetWindowROP3(v4, v3);
artfont_SetArtFont(nFont); artfont_SetArtFont(nFont);
v5 = GetWindowLongA(v3, -16); v5 = GetWindowLongA(v3, -16);
@ -306,7 +306,7 @@ void __fastcall Doom_GetSetWndTxt5(HWND hWnd, int msg, int nFont)
v3 = (HWND)msg; v3 = (HWND)msg;
if ( msg ) if ( msg )
{ {
Doom_AllocAndSetBMP(hWnd, 1); Doom_AllocAndSetBMP(hWnd, msg, 1);
Doom_GetWindowROP3(hWnd, v3); Doom_GetWindowROP3(hWnd, v3);
artfont_SetArtFont(nFont); artfont_SetArtFont(nFont);
Doom_PrintTextMsg403(v3); Doom_PrintTextMsg403(v3);

154
DiabloUI/entname.cpp

@ -1,6 +1,6 @@
// ref: 0x10006F7C // ref: 0x10006F7C
int __stdcall EntName_10006F7C(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) { return 0; } LRESULT __stdcall EntName_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
/* { {
int v4; // edx int v4; // edx
HWND v5; // eax HWND v5; // eax
HWND v6; // eax HWND v6; // eax
@ -10,22 +10,22 @@ int __stdcall EntName_10006F7C(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam
v4 = 2; v4 = 2;
if ( Msg == 2 ) if ( Msg == 2 )
{ {
EntName_1000709E(hDlg); EntName_DelEntNameMsgs(hWnd);
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( Msg <= 0x103 ) if ( Msg <= 0x103 )
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
if ( Msg <= 0x105 ) if ( Msg <= 0x105 )
{ {
v9 = (HWND)SDrawGetFrameWindow(); v9 = (HWND)SDrawGetFrameWindow();
SendMessageA(v9, Msg, wParam, lParam); SendMessageA(v9, Msg, wParam, lParam);
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
switch ( Msg ) switch ( Msg )
{ {
case 0x110u: case 0x110u:
dword_10029864 = (LPSTR)lParam; entname_charname = (char *)lParam;
EntName_100070DB(hDlg); EntName_LoadFocusChkName(hWnd);
return 0; return 0;
case 0x111u: case 0x111u:
if ( (unsigned short)wParam != 1 ) if ( (unsigned short)wParam != 1 )
@ -33,135 +33,115 @@ int __stdcall EntName_10006F7C(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam
if ( (unsigned short)wParam != 2 ) if ( (unsigned short)wParam != 2 )
{ {
if ( (unsigned short)wParam == 1065 ) if ( (unsigned short)wParam == 1065 )
EntName_100071ED(hDlg, wParam, lParam); EntName_GetMessageName(hWnd, wParam, lParam);
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
goto LABEL_11; goto LABEL_11;
} }
goto LABEL_18; goto LABEL_18;
case 0x113u: case 0x113u:
v7 = GetFocus(); v7 = GetFocus();
Focus_100075DC(hDlg, v7); Focus_DoBlitSpinIncFrame(hWnd, v7);
return 0; return 0;
} }
if ( Msg != 513 ) if ( Msg != 513 )
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
v5 = GetDlgItem(hDlg, 1056); v5 = GetDlgItem(hWnd, 1056);
if ( local_10007C3B(hDlg, v5, (unsigned short)lParam, (unsigned int)lParam >> 16) ) if ( local_GetBottomRect(hWnd, v5, (unsigned short)lParam, (unsigned int)lParam >> 16) )
{ {
LABEL_18: LABEL_18:
v4 = 1; v4 = 1;
goto LABEL_11; goto LABEL_11;
} }
v6 = GetDlgItem(hDlg, 1054); v6 = GetDlgItem(hWnd, 1054);
if ( local_10007C3B(hDlg, v6, (unsigned short)lParam, (unsigned int)lParam >> 16) ) if ( local_GetBottomRect(hWnd, v6, (unsigned short)lParam, (unsigned int)lParam >> 16) )
{ {
v4 = 2; v4 = 2;
LABEL_11: LABEL_11:
EntName_100071AC(hDlg, v4); EntName_SetCharName(hWnd, v4);
} }
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} */ }
// 1001037C: using guessed type int __stdcall SDlgDefDialogProc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow(); // 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow();
// ref: 0x1000709E // ref: 0x1000709E
HWND UNKCALL EntName_1000709E(HWND hDlg) { return 0; } void __fastcall EntName_DelEntNameMsgs(HWND hWnd)
/* { {
HWND v1; // esi
HWND v2; // eax HWND v2; // eax
v1 = hDlg; Focus_DeleteSpinners();
Focus_100076C3(); Doom_DeleteFreeProcs(hWnd, entname_msgtbl3);
Doom_10006C53(v1, (int *)&unk_10022B48); Doom_DeleteFreeProcs(hWnd, entname_msgtbl2);
Doom_10006C53(v1, (int *)&unk_10022B3C); Doom_DeleteFreeProcs(hWnd, entname_msgtbl1);
Doom_10006C53(v1, (int *)&unk_10022B34); v2 = GetParent(hWnd);
v2 = GetParent(v1); SelHero_SetStringWithMsg(v2, 0);
return SelHero_1000BA7B(v2, 0); }
} */
// ref: 0x100070DB // ref: 0x100070DB
int UNKCALL EntName_100070DB(HWND hWnd) { return 0; } void __fastcall EntName_LoadFocusChkName(HWND hWnd)
/* { {
HWND v1; // esi
HWND v2; // edi HWND v2; // edi
LONG v3; // eax LONG v3; // eax
HWND v4; // ebx HWND v4; // ebx
int result; // eax char Buffer[32]; // [esp+Ch] [ebp-20h]
CHAR Buffer; // [esp+Ch] [ebp-20h]
v1 = hWnd;
v2 = GetParent(hWnd); v2 = GetParent(hWnd);
if ( SelHero_1000B7CA() == 1 ) if ( SelHero_GetHeroIsGood() == 1 )
LoadStringA(hInstance, 0x20u, &Buffer, 31); LoadStringA(ghUiInst, 0x20u, Buffer, 31);
else else
LoadStringA(hInstance, 0x1Fu, &Buffer, 31); LoadStringA(ghUiInst, 0x1Fu, Buffer, 31);
SelHero_1000BA7B(v2, &Buffer); SelHero_SetStringWithMsg(v2, Buffer);
v3 = GetWindowLongA(v2, -21); v3 = GetWindowLongA(v2, -21);
SetWindowLongA(v1, -21, v3); SetWindowLongA(hWnd, -21, v3);
Doom_100068AB(v1, (int *)&unk_10022B34, 5); Doom_ParseWndProc3(hWnd, entname_msgtbl1, 5);
Doom_1000658C(v1, (int *)&unk_10022B3C, 4, 0); Doom_ParseWndProcs(hWnd, entname_msgtbl2, 4, 0);
Doom_10006AB8(v1, (int *)&unk_10022B48, 2); Doom_ParseWndProc5(hWnd, entname_msgtbl3, 2);
Focus_10007719("ui_art\\focus.pcx"); Focus_LoadSpinner("ui_art\\focus.pcx");
SDlgSetTimer(v1, 1, 55, 0); SDlgSetTimer((int)hWnd, 1, 55, 0);
v4 = GetDlgItem(v1, 1065); v4 = GetDlgItem(hWnd, 1065);
SendMessageA(v4, 0x401u, 0xFu, 0); SendMessageA(v4, 0x401u, 0xFu, 0);
result = SelHero_1000B7CA(); if ( SelHero_GetHeroIsGood() == 1 )
if ( result == 1 ) SendMessageA(v4, 0x404u, 0, (LPARAM)" ,<>%&\\\"?*#/");
result = SendMessageA(v4, 0x404u, 0, (LPARAM)" ,<>%&\\\"?*#/"); }
return result;
} */
// 10010412: using guessed type int __stdcall SDlgSetTimer(_DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x100071AC // ref: 0x100071AC
int __fastcall EntName_100071AC(HWND hDlg, int a2) { return 0; } void __fastcall EntName_SetCharName(HWND hWnd, int a2)
/* { {
int v2; // edi char *v4; // ST08_4
HWND v3; // esi
CHAR *v4; // ST08_4
HWND v5; // eax HWND v5; // eax
v2 = a2; TitleSnd_PlaySelectSound();
v3 = hDlg; SDlgKillTimer((int)hWnd, 1);
TitleSnd_1001031F(); v4 = entname_charname;
SDlgKillTimer(v3, 1); v5 = GetDlgItem(hWnd, 1065);
v4 = dword_10029864;
v5 = GetDlgItem(v3, 1065);
GetWindowTextA(v5, v4, 16); GetWindowTextA(v5, v4, 16);
dword_10029864[15] = 0; entname_charname[15] = 0;
return SDlgEndDialog(v3, v2); SDlgEndDialog(hWnd, (HANDLE)a2);
} */ }
// 10010376: using guessed type int __stdcall SDlgEndDialog(_DWORD, _DWORD);
// 10010418: using guessed type int __stdcall SDlgKillTimer(_DWORD, _DWORD);
// ref: 0x100071ED // ref: 0x100071ED
void __fastcall EntName_100071ED(HWND hWnd, unsigned int a2, int a3) { return; } void __fastcall EntName_GetMessageName(HWND hWnd, unsigned int a2, int a3)
/* { {
int v3; // edx unsigned int v3; // edx
HWND v4; // esi
HWND v5; // eax HWND v5; // eax
v3 = (a2 >> 16) - 1; v3 = (a2 >> 16) - 1;
v4 = hWnd;
if ( v3 ) if ( v3 )
{ {
if ( v3 == 2 ) if ( v3 == 2 )
Doom_10006C08(hWnd, (int *)&unk_10022B48, 2); Doom_ParseWndProc6(hWnd, entname_msgtbl3, 2);
} }
else else
{ {
v5 = GetFocus(); v5 = GetFocus();
Focus_100075DC(v4, v5); Focus_DoBlitSpinIncFrame(hWnd, v5);
} }
} */ }
// ref: 0x10007220 // ref: 0x10007220
signed int EntName_10007220() { return 0; } void __cdecl EntName_cpp_init()
/* { {
signed int result; // eax EntName_cpp_float = EntName_cpp_float_value;
}
result = 2139095040; // 1001F424: using guessed type int EntName_cpp_float_value;
dword_10029860 = 2139095040; // 10029860: using guessed type int EntName_cpp_float;
return result;
} */
// 10029860: using guessed type int dword_10029860;

13
DiabloUI/local.cpp

@ -492,14 +492,12 @@ void __cdecl local_LoadArtCursor()
gpCursorArt2 = (BYTE *)SMemAlloc(dwHeight * dwWidth, "C:\\Src\\Diablo\\DiabloUI\\local.cpp", 554, 0); gpCursorArt2 = (BYTE *)SMemAlloc(dwHeight * dwWidth, "C:\\Src\\Diablo\\DiabloUI\\local.cpp", 554, 0);
if ( SBmpLoadImage("ui_art\\cursor.pcx", 0, gpCursorArt, dwHeight * dwWidth, 0, 0, 0) ) if ( SBmpLoadImage("ui_art\\cursor.pcx", 0, gpCursorArt, dwHeight * dwWidth, 0, 0, 0) )
{ {
gdwCursWidth = dwWidth; gdwCursData[0] = dwWidth;
gdwCursHeight = dwHeight; gdwCursData[1] = dwHeight;
local_InitArtCursor(); local_InitArtCursor();
} }
} }
} }
// 10029CC0: using guessed type int gdwCursWidth;
// 10029CC4: using guessed type int gdwCursHeight;
// ref: 0x10008062 // ref: 0x10008062
void __cdecl local_InitArtCursor() void __cdecl local_InitArtCursor()
@ -515,7 +513,7 @@ void __cdecl local_InitArtCursor()
{ {
if ( gpCursorArt ) if ( gpCursorArt )
{ {
for ( i = 0; i < gdwCursWidth * gdwCursHeight; ++i ) for ( i = 0; i < gdwCursData[0] * gdwCursData[1]; ++i )
{ {
v3 = *v1++; v3 = *v1++;
if ( v3 ) if ( v3 )
@ -527,8 +525,6 @@ void __cdecl local_InitArtCursor()
} }
} }
} }
// 10029CC0: using guessed type int gdwCursWidth;
// 10029CC4: using guessed type int gdwCursHeight;
// ref: 0x100080AD // ref: 0x100080AD
void __cdecl local_FreeArtCursor() void __cdecl local_FreeArtCursor()
@ -550,10 +546,9 @@ void __cdecl local_SetCursorArt()
{ {
if ( !gpCursorArt ) if ( !gpCursorArt )
local_LoadArtCursor(); local_LoadArtCursor();
SDlgSetSystemCursor(gpCursorArt2, gpCursorArt, &gdwCursWidth, 32512); SDlgSetSystemCursor(gpCursorArt2, gpCursorArt, (int *)gdwCursData, 32512);
} }
// 1001044E: using guessed type int __stdcall SDlgSetSystemCursor(_DWORD, _DWORD, _DWORD, _DWORD); // 1001044E: using guessed type int __stdcall SDlgSetSystemCursor(_DWORD, _DWORD, _DWORD, _DWORD);
// 10029CC0: using guessed type int gdwCursWidth;
// ref: 0x1000811B // ref: 0x1000811B
void __cdecl local_SetCursorDefault() void __cdecl local_SetCursorDefault()

276
DiabloUI/mainmenu.cpp

@ -1,43 +1,38 @@
// ref: 0x10008164 // ref: 0x10008164
signed int MainMenu_10008164() { return 0; } void __cdecl MainMenu_cpp_init()
/* { {
signed int result; // eax mainmenu_cpp_float = mainmenu_cpp_float_value;
}
result = 2139095040; // 1001F434: using guessed type int mainmenu_cpp_float_value;
dword_1002A0D4 = 2139095040; // 1002A0D4: using guessed type int mainmenu_cpp_float;
return result;
} */
// 1002A0D4: using guessed type int dword_1002A0D4;
// ref: 0x1000816F // ref: 0x1000816F
int __stdcall UiMainMenuDialog(char *name, int *a2, void *fnSound, int a4) { return 0; } BOOL __stdcall UiMainMenuDialog(char *name, int *pdwResult, void (__stdcall *fnSound)(char *file), int a4)
/* { {
int v4; // eax int v4; // eax
int v5; // esi int v5; // esi
dword_1002A118 = a4; menu_item_timer = a4;
TitleSnd_10010306((void *)a3); TitleSnd_SetSoundFunction(fnSound);
artfont_10001159(); artfont_LoadAllFonts();
byte_1002A0D8 = 0; menu_version_str[0] = 0;
if ( a1 ) if ( name )
strncpy((char *)&byte_1002A0D8, a1, 0x40u); strncpy(menu_version_str, name, 0x40u);
v4 = SDrawGetFrameWindow(); v4 = (int)SDrawGetFrameWindow();
v5 = SDlgDialogBoxParam(hInstance, "MAINMENU_DIALOG", v4, MainMenu_100081E3, 0); v5 = SDlgDialogBoxParam(ghUiInst, "MAINMENU_DIALOG", v4, MainMenu_WndProc, 0);
if ( v5 == 5 ) if ( v5 == 5 )
artfont_100010C8(); artfont_FreeAllFonts();
if ( a2 ) if ( pdwResult )
*(_DWORD *)a2 = v5; *pdwResult = v5;
return 1; return 1;
} */ }
// 10010370: using guessed type int __stdcall SDlgDialogBoxParam(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow(); // 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow();
// 1002A118: using guessed type int dword_1002A118; // 1002A118: using guessed type int menu_item_timer;
// ref: 0x100081E3 // ref: 0x100081E3
int __stdcall MainMenu_100081E3(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) { return 0; } LRESULT __stdcall MainMenu_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
/* { {
HWND v5; // eax HWND v5; // eax
int v6; // [esp+0h] [ebp-Ch]
if ( Msg <= 0x113 ) if ( Msg <= 0x113 )
{ {
@ -45,7 +40,7 @@ int __stdcall MainMenu_100081E3(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPara
{ {
if ( Msg == 2 ) if ( Msg == 2 )
{ {
MainMenu_10008354(hWnd); MainMenu_KillAndFreeMenu(hWnd);
} }
else if ( Msg > 0x103 ) else if ( Msg > 0x103 )
{ {
@ -58,37 +53,37 @@ int __stdcall MainMenu_100081E3(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPara
{ {
if ( Msg == 272 ) if ( Msg == 272 )
{ {
MainMenu_100083A8(hWnd); MainMenu_LoadMenuGFX(hWnd);
PostMessageA(hWnd, 0x7E8u, 0, 0); PostMessageA(hWnd, 0x7E8u, 0, 0);
return 1; return 1;
} }
if ( Msg == 273 ) if ( Msg == 273 )
{ {
MainMenu_10008391(hWnd); MainMenu_SetMenuTimer(hWnd);
switch ( HIWORD(wParam) ) switch ( HIWORD(wParam) )
{ {
case 7: case 7:
Focus_100075B7(hWnd, (HWND)lParam); Focus_GetAndBlitSpin(hWnd, lParam);
break; break;
case 6: case 6:
Focus_10007458((void *)lParam); Focus_CheckPlayMove(lParam);
Focus_100075DC(hWnd, (HWND)lParam); Focus_DoBlitSpinIncFrame(hWnd, (HWND)lParam);
break; break;
case 0: case 0:
MainMenu_100084FA(hWnd, (unsigned short)wParam); MainMenu_CheckWParamFocus(hWnd, (unsigned short)wParam);
break; break;
} }
} }
} }
} }
return SDlgDefDialogProc(hWnd, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( wParam == 3 && !DiabloUI_10005C2A() ) if ( wParam == 3 && !DiabloUI_GetSpawned() )
{ {
if ( dword_10029728 ) if ( app_is_active )
MainMenu_1000845A((int)hWnd, 6, 0); MainMenu_DoOptions(hWnd, 6, 0);
else else
MainMenu_10008391(hWnd); MainMenu_SetMenuTimer(hWnd);
} }
return 0; return 0;
} }
@ -97,156 +92,139 @@ int __stdcall MainMenu_100081E3(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lPara
if ( Msg <= 0x202 ) if ( Msg <= 0x202 )
goto LABEL_34; goto LABEL_34;
if ( Msg <= 0x203 ) if ( Msg <= 0x203 )
return SDlgDefDialogProc(hWnd, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
if ( Msg <= 0x205 ) if ( Msg <= 0x205 )
{ {
LABEL_34: LABEL_34:
MainMenu_10008391(hWnd); MainMenu_SetMenuTimer(hWnd);
return SDlgDefDialogProc(hWnd, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( Msg == 2024 ) if ( Msg == 2024 )
{ {
if ( !Fade_1000739F() ) if ( !Fade_CheckRange5() )
Fade_100073FD(hWnd, v6); Fade_SetFadeTimer((int)hWnd);
return 0; return 0;
} }
} }
return SDlgDefDialogProc(hWnd, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} */ }
// 1001037C: using guessed type int __stdcall SDlgDefDialogProc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow(); // 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow();
// 10029728: using guessed type int dword_10029728; // 10029728: using guessed type int app_is_active;
// ref: 0x10008354 // ref: 0x10008354
void UNKCALL MainMenu_10008354(HWND hDlg) { return; } void __fastcall MainMenu_KillAndFreeMenu(HWND hWnd)
/* { {
HWND v1; // esi void **v2; // eax
_DWORD *v2; // eax
Title_KillTitleTimer(hWnd);
v1 = hDlg; Focus_KillFocusTimer(hWnd);
Title_100100E7(hDlg); Doom_DeleteFreeProcs(hWnd, menumsgs_5options);
Focus_10007818(v1); Doom_DeleteFreeProcs(hWnd, menumsgs_1option);
Doom_10006C53(v1, (int *)&unk_10022BE8); v2 = (void **)GetWindowLongA(hWnd, -21);
Doom_10006C53(v1, (int *)&unk_10022BE0); local_FreeMemPtr(v2);
v2 = (_DWORD *)GetWindowLongA(v1, -21); local_SetCursorDefault();
local_10007F72(v2); }
return local_1000811B();
} */
// ref: 0x10008391 // ref: 0x10008391
int UNKCALL MainMenu_10008391(void *arg) { return 0; } void __fastcall MainMenu_SetMenuTimer(HWND hWnd)
/* { {
return SDlgSetTimer(arg, 3, 1000 * dword_1002A118, 0); SDlgSetTimer((int)hWnd, 3, 1000 * menu_item_timer, 0);
} */ }
// 10010412: using guessed type int __stdcall SDlgSetTimer(_DWORD, _DWORD, _DWORD, _DWORD); // 1002A118: using guessed type int menu_item_timer;
// 1002A118: using guessed type int dword_1002A118;
// ref: 0x100083A8 // ref: 0x100083A8
void UNKCALL MainMenu_100083A8(HWND hWnd) { return; } void __fastcall MainMenu_LoadMenuGFX(HWND hWnd)
/* { {
HWND v1; // esi DWORD *v2; // eax MAPDST
int v2; // eax
int *v3; // edi
bool v4; // zf bool v4; // zf
const char *v5; // eax const char *v5; // eax
HWND v6; // eax HWND v6; // eax
HWND v7; // ST1C_4
HWND v9; // [esp+0h] [ebp-8h]
v1 = hWnd; v2 = local_AllocWndLongData();
v2 = local_10007F46();
v3 = (int *)v2;
if ( v2 ) if ( v2 )
{ {
SetWindowLongA(v1, -21, v2); SetWindowLongA(hWnd, -21, (LONG)v2);
v4 = DiabloUI_10005C2A() == 0; v4 = DiabloUI_GetSpawned() == 0;
v5 = "ui_art\\swmmenu.pcx"; v5 = "ui_art\\swmmenu.pcx";
if ( v4 ) if ( v4 )
v5 = "ui_art\\mainmenu.pcx"; v5 = "ui_art\\mainmenu.pcx";
local_10007944((int)v1, 0, &byte_10029448, -1, 1, (int)v5, v3, v3 + 1, 0); local_LoadArtWithPal(hWnd, 0, &nullcharacter, -1, 1, v5, (BYTE **)v2, v2 + 1, 0);
Fade_100073C5(v1, 1); Fade_NoInputAndArt(hWnd, 1);
} }
v6 = GetDlgItem(v1, 1042); v6 = GetDlgItem(hWnd, 1042);
SetWindowTextA(v6, &byte_1002A0D8); SetWindowTextA(v6, menu_version_str);
Doom_100068AB(v1, (int *)&unk_10022BE0, 1); Doom_ParseWndProc3(hWnd, menumsgs_1option, 1);
Doom_1000658C(v1, (int *)&unk_10022BE8, 6, 1); Doom_ParseWndProcs(hWnd, menumsgs_5options, 6, 1);
Focus_100077E9((int)v1, "ui_art\\focus42.pcx", v9); Focus_SetFocusTimer(hWnd, "ui_art\\focus42.pcx");
Title_1001009E(v1, (int)"ui_art\\smlogo.pcx", v7); Title_LoadImgSetTimer(hWnd, "ui_art\\smlogo.pcx");
MainMenu_10008391(v1); MainMenu_SetMenuTimer(hWnd);
return local_10007DE9(v1, (int *)&unk_10022BE8); local_DoUiWndProc2(hWnd, (DWORD *)menumsgs_5options);
} */ }
// ref: 0x1000845A // ref: 0x1000845A
int __fastcall MainMenu_1000845A(int a1, int a2, int a3) { return 0; } void __fastcall MainMenu_DoOptions(HWND hWnd, int option, int PlaySelect)
/* { {
int v3; // esi SDlgKillTimer((int)hWnd, 3);
int v4; // edi if ( DiabloUI_GetSpawned() && option == 3 )
v3 = a1;
v4 = a2;
SDlgKillTimer(a1, 3);
if ( DiabloUI_10005C2A() && v4 == 3 )
{ {
SelYesNo_1000FD77(v3, 0x46u, 1); SelYesNo_SpawnErrDialog(hWnd, 70, 1);
return SDlgSetTimer(v3, 3, 1000 * dword_1002A118, 0); LABEL_7:
SDlgSetTimer((int)hWnd, 3, 1000 * menu_item_timer, 0);
return;
} }
if ( v4 == 2 && !MainMenu_100084D5() ) if ( option == 2 && !MainMenu_CheckEnoughMemory() )
{ {
SelYesNo_1000FD77(v3, 0x4Eu, 1); SelYesNo_SpawnErrDialog(hWnd, 78, 1);
return SDlgSetTimer(v3, 3, 1000 * dword_1002A118, 0); goto LABEL_7;
} }
Fade_100073B4(); Fade_Range5SetZero();
if ( a3 ) if ( PlaySelect )
TitleSnd_1001031F(); TitleSnd_PlaySelectSound();
Fade_100072BE(10); Fade_UpdatePaletteRange(10);
return SDlgEndDialog(v3, v4); SDlgEndDialog(hWnd, (HANDLE)option);
} */ }
// 10010376: using guessed type int __stdcall SDlgEndDialog(_DWORD, _DWORD); // 1002A118: using guessed type int menu_item_timer;
// 10010412: using guessed type int __stdcall SDlgSetTimer(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010418: using guessed type int __stdcall SDlgKillTimer(_DWORD, _DWORD);
// 1002A118: using guessed type int dword_1002A118;
// ref: 0x100084D5 // ref: 0x100084D5
BOOL MainMenu_100084D5() { return 0; } BOOL __cdecl MainMenu_CheckEnoughMemory()
/* { {
struct _MEMORYSTATUS Buffer; // [esp+0h] [ebp-20h] struct _MEMORYSTATUS Buffer; // [esp+0h] [ebp-20h]
Buffer.dwLength = 32; Buffer.dwLength = 32;
GlobalMemoryStatus(&Buffer); GlobalMemoryStatus(&Buffer);
return Buffer.dwTotalPhys > 0xDAC000; return Buffer.dwTotalPhys > 0xDAC000;
} */ }
// ref: 0x100084FA // ref: 0x100084FA
LRESULT __fastcall MainMenu_100084FA(HWND hWnd, int a2) { return 0; } void __fastcall MainMenu_CheckWParamFocus(HWND hWnd, WPARAM wParam)
/* { {
HWND v2; // esi HWND v3; // eax
LRESULT result; // eax LONG v4; // eax
HWND v4; // eax int v5; // [esp-8h] [ebp-Ch]
LONG v5; // eax
int v6; // [esp-8h] [ebp-Ch]
v2 = hWnd; switch ( wParam )
switch ( a2 )
{ {
case 1: case 1u:
v4 = GetFocus(); v3 = GetFocus();
v5 = GetWindowLongA(v4, -12); v4 = GetWindowLongA(v3, -12);
return SendMessageA(v2, 0x111u, v5, 0); SendMessageA(hWnd, 0x111u, v4, 0);
case 2: return;
v6 = 5; case 2u:
return MainMenu_1000845A((int)hWnd, v6, 1); v5 = 5;
case 1001: goto LABEL_12;
v6 = 2; case 0x3E9u:
return MainMenu_1000845A((int)hWnd, v6, 1); v5 = 2;
case 1002: goto LABEL_12;
v6 = 3; case 0x3EAu:
return MainMenu_1000845A((int)hWnd, v6, 1); v5 = 3;
case 1003: goto LABEL_12;
v6 = 4; case 0x3EBu:
return MainMenu_1000845A((int)hWnd, v6, 1); v5 = 4;
LABEL_12:
MainMenu_DoOptions(hWnd, v5, 1);
return;
case 0x414u:
MainMenu_DoOptions(hWnd, 1, 1);
break;
} }
result = a2 - 1044; }
if ( a2 == 1044 )
result = MainMenu_1000845A((int)hWnd, 1, 1);
return result;
} */

305
DiabloUI/okcancel.cpp

@ -1,20 +1,16 @@
// ref: 0x10008F31 // ref: 0x10008F31
int __fastcall OkCancel_10008F31(HWND hWnd, const CHAR *a2) { return 0; } BOOL __fastcall OkCancel_DrawString(HWND hWnd, char *str)
/* { {
HWND v2; // ebx
HDC v3; // edi HDC v3; // edi
void *v4; // eax void *v4; // eax
int v5; // eax int v5; // eax
int result; // eax BOOL result; // eax
LONG v7; // [esp+14h] [ebp-20h] LONG v7; // [esp+14h] [ebp-20h]
LONG v8; // [esp+18h] [ebp-1Ch] LONG v8; // [esp+18h] [ebp-1Ch]
struct tagRECT Rect; // [esp+1Ch] [ebp-18h] struct tagRECT Rect; // [esp+1Ch] [ebp-18h]
HGDIOBJ h; // [esp+2Ch] [ebp-8h] HGDIOBJ h; // [esp+2Ch] [ebp-8h]
LPCSTR lpchText; // [esp+30h] [ebp-4h]
lpchText = a2; if ( !str || !*str )
v2 = hWnd;
if ( !a2 || !*a2 )
goto LABEL_13; goto LABEL_13;
if ( !hWnd ) if ( !hWnd )
goto LABEL_14; goto LABEL_14;
@ -23,16 +19,16 @@ int __fastcall OkCancel_10008F31(HWND hWnd, const CHAR *a2) { return 0; }
--Rect.bottom; --Rect.bottom;
v7 = Rect.right; v7 = Rect.right;
v8 = Rect.bottom; v8 = Rect.bottom;
v3 = GetDC(v2); v3 = GetDC(hWnd);
v4 = (void *)SendMessageA(v2, 0x31u, 0, 0); v4 = (void *)SendMessageA(hWnd, 0x31u, 0, 0);
h = SelectObject(v3, v4); h = SelectObject(v3, v4);
if ( !v3 ) if ( !v3 )
goto LABEL_13; goto LABEL_13;
v5 = strlen(lpchText); v5 = strlen(str);
DrawTextA(v3, lpchText, v5, &Rect, 0x410u); DrawTextA(v3, str, v5, &Rect, 0x410u);
if ( h ) if ( h )
SelectObject(v3, h); SelectObject(v3, h);
ReleaseDC(v2, v3); ReleaseDC(hWnd, v3);
if ( Rect.bottom > v8 || Rect.right > v7 ) if ( Rect.bottom > v8 || Rect.right > v7 )
LABEL_14: LABEL_14:
result = 1; result = 1;
@ -40,22 +36,19 @@ LABEL_14:
LABEL_13: LABEL_13:
result = 0; result = 0;
return result; return result;
} */ }
// ref: 0x10008FEC // ref: 0x10008FEC
signed int OkCancel_10008FEC() { return 0; } void __cdecl OkCancel_cpp_init()
/* { {
signed int result; // eax OkCancel_cpp_float = OkCancel_cpp_float_value;
}
result = 2139095040; // 1001F440: using guessed type int OkCancel_cpp_float_value;
dword_1002A2E4 = 2139095040; // 1002A2E4: using guessed type int OkCancel_cpp_float;
return result;
} */
// 1002A2E4: using guessed type int dword_1002A2E4;
// ref: 0x10008FF7 // ref: 0x10008FF7
HGDIOBJ __stdcall OkCancel_10008FF7(HWND a1, UINT Msg, WPARAM wParam, HWND hWnd) { return 0; } LRESULT __stdcall OkCancel_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
/* { {
HWND v5; // ecx HWND v5; // ecx
int v6; // edx int v6; // edx
HWND v7; // eax HWND v7; // eax
@ -65,33 +58,33 @@ HGDIOBJ __stdcall OkCancel_10008FF7(HWND a1, UINT Msg, WPARAM wParam, HWND hWnd)
if ( Msg == 2 ) if ( Msg == 2 )
{ {
ShowCursor(0); ShowCursor(0);
OkCancel_10009117(a1); OkCancel_FreeDlgBmp(hWnd);
return (HGDIOBJ)SDlgDefDialogProc(a1, Msg, wParam, hWnd); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( Msg <= 0x103 ) if ( Msg <= 0x103 )
return (HGDIOBJ)SDlgDefDialogProc(a1, Msg, wParam, hWnd); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
if ( Msg <= 0x105 ) if ( Msg <= 0x105 )
{ {
v9 = (HWND)SDrawGetFrameWindow(); v9 = (HWND)SDrawGetFrameWindow();
SendMessageA(v9, Msg, wParam, (LPARAM)hWnd); SendMessageA(v9, Msg, wParam, lParam);
return (HGDIOBJ)SDlgDefDialogProc(a1, Msg, wParam, hWnd); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( Msg != 272 ) if ( Msg != 272 )
{ {
if ( Msg != 273 ) if ( Msg != 273 )
{ {
if ( Msg == 312 && GetWindowLongA(hWnd, -12) == 1038 ) if ( Msg == 312 && GetWindowLongA((HWND)lParam, -12) == 1038 )
{ {
local_10007C2E((HDC)wParam); local_SetWhiteText((HDC)wParam);
return GetStockObject(5); return (LRESULT)GetStockObject(5);
} }
return (HGDIOBJ)SDlgDefDialogProc(a1, Msg, wParam, hWnd); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( (unsigned short)wParam == 1 ) if ( (unsigned short)wParam == 1 )
{ {
v7 = GetFocus(); v7 = GetFocus();
v8 = GetWindowLongA(v7, -12); v8 = GetWindowLongA(v7, -12);
v5 = a1; v5 = hWnd;
if ( v8 == 1109 ) if ( v8 == 1109 )
{ {
v6 = 1; v6 = 1;
@ -104,238 +97,206 @@ HGDIOBJ __stdcall OkCancel_10008FF7(HWND a1, UINT Msg, WPARAM wParam, HWND hWnd)
{ {
if ( (unsigned short)wParam == 1109 ) if ( (unsigned short)wParam == 1109 )
{ {
v5 = a1; v5 = hWnd;
v6 = 1; v6 = 1;
LABEL_16: LABEL_16:
OkCancel_100092F5((int)v5, v6); OkCancel_PlaySndEndDlg(v5, v6);
} }
return (HGDIOBJ)SDlgDefDialogProc(a1, Msg, wParam, hWnd); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
v5 = a1; v5 = hWnd;
} }
v6 = 2; v6 = 2;
goto LABEL_16; goto LABEL_16;
} }
ShowCursor(1); ShowCursor(1);
if ( !OkCancel_10009161(a1, (int)hWnd) ) if ( !OkCancel_LoadOkCancGFX(hWnd, (DWORD *)lParam) )
SDlgEndDialog(a1, -16777216); SDlgEndDialog(hWnd, (HANDLE)0xFF000000);
return (HGDIOBJ)1; return 1;
} */ }
// 10010376: using guessed type int __stdcall SDlgEndDialog(_DWORD, _DWORD);
// 1001037C: using guessed type int __stdcall SDlgDefDialogProc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow(); // 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow();
// ref: 0x10009117 // ref: 0x10009117
void **UNKCALL OkCancel_10009117(HWND hWnd) { return 0; } void __fastcall OkCancel_FreeDlgBmp(HWND hWnd)
/* { {
_DWORD *result; // eax void **v1; // eax MAPDST
_DWORD *v2; // esi void *v3; // eax
int v3; // eax void *v4; // eax
int v4; // eax
result = RemovePropA(hWnd, "DLGBMP"); v1 = (void **)RemovePropA(hWnd, "DLGBMP");
v2 = result; if ( v1 )
if ( result )
{ {
v3 = *result; v3 = *v1;
if ( v3 ) if ( v3 )
SMemFree(v3, "C:\\Src\\Diablo\\DiabloUI\\OkCancel.cpp", 48, 0); SMemFree(v3, "C:\\Src\\Diablo\\DiabloUI\\OkCancel.cpp", 48, 0);
v4 = v2[1]; v4 = v1[1];
if ( v4 ) if ( v4 )
SMemFree(v4, "C:\\Src\\Diablo\\DiabloUI\\OkCancel.cpp", 50, 0); SMemFree(v4, "C:\\Src\\Diablo\\DiabloUI\\OkCancel.cpp", 50, 0);
result = (_DWORD *)SMemFree(v2, "C:\\Src\\Diablo\\DiabloUI\\OkCancel.cpp", 51, 0); SMemFree(v1, "C:\\Src\\Diablo\\DiabloUI\\OkCancel.cpp", 51, 0);
} }
return result; }
} */
// 10010340: using guessed type int __stdcall SMemFree(_DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x10009161 // ref: 0x10009161
signed int __fastcall OkCancel_10009161(HWND a1, int a2) { return 0; } BOOL __fastcall OkCancel_LoadOkCancGFX(HWND hWnd, DWORD *lParam)
/* { {
int v2; // esi
bool v3; // zf bool v3; // zf
HWND v4; // edi HWND v4; // edi
char *v5; // edi tagPALETTEENTRY *v5; // edi
HWND v6; // eax HWND v6; // eax
HWND v7; // edi HWND v7; // edi
HWND v8; // edi BYTE **v8; // edi
HWND v9; // eax HWND v9; // eax
const CHAR *v10; // ST1C_4 const CHAR *v10; // ST1C_4
HWND v11; // eax HWND v11; // eax
HWND v12; // edi HWND v12; // edi
int v14; // [esp+Ch] [ebp-20h] int a2a; // [esp+Ch] [ebp-20h]
int v15; // [esp+10h] [ebp-1Ch] int v15; // [esp+10h] [ebp-1Ch]
int v16; // [esp+14h] [ebp-18h] int v16; // [esp+14h] [ebp-18h]
char v17; // [esp+18h] [ebp-14h] DWORD data[2]; // [esp+18h] [ebp-14h]
HWND v18; // [esp+20h] [ebp-Ch] BYTE **pBuffer; // [esp+20h] [ebp-Ch]
const char *v19; // [esp+24h] [ebp-8h] char *pszFileName; // [esp+24h] [ebp-8h]
HWND hWnd; // [esp+28h] [ebp-4h]
v2 = a2; a2a = 1109;
hWnd = a1;
v14 = 1109;
v15 = 2; v15 = 2;
v16 = 0; v16 = 0;
v18 = (HWND)SMemAlloc(8, "C:\\Src\\Diablo\\DiabloUI\\OkCancel.cpp", 110, 0); pBuffer = (BYTE **)SMemAlloc(8u, "C:\\Src\\Diablo\\DiabloUI\\OkCancel.cpp", 110, 0);
SetPropA(hWnd, "DLGBMP", v18); SetPropA(hWnd, "DLGBMP", pBuffer);
if ( *(_DWORD *)(v2 + 8) ) if ( lParam[2] )
{ {
v3 = *(_DWORD *)(v2 + 12) == 0; v3 = lParam[3] == 0;
v19 = "ui_art\\lrpopup.pcx"; pszFileName = "ui_art\\lrpopup.pcx";
if ( v3 ) if ( v3 )
v19 = "ui_art\\lpopup.pcx"; pszFileName = "ui_art\\lpopup.pcx";
} }
else if ( *(_DWORD *)(v2 + 12) ) else if ( lParam[3] )
{ {
v19 = "ui_art\\srpopup.pcx"; pszFileName = "ui_art\\srpopup.pcx";
} }
else else
{ {
v19 = "ui_art\\spopup.pcx"; pszFileName = "ui_art\\spopup.pcx";
} }
v4 = GetParent(hWnd); v4 = GetParent(hWnd);
if ( (HWND)SDrawGetFrameWindow() == v4 ) if ( (HWND)SDrawGetFrameWindow() == v4 )
{ {
local_10007944((int)hWnd, 0, &byte_10029448, -1, 1, (int)v19, (int *)v18, 0, 1); local_LoadArtWithPal(hWnd, 0, &nullcharacter, -1, 1, pszFileName, pBuffer, 0, 1);
v5 = local_10007895(0); v5 = local_GetArtPalEntry(0);
SDrawUpdatePalette(0, 10, v5, 0); SDrawUpdatePalette(0, 0xAu, v5, 0);
SDrawUpdatePalette(112, 144, v5 + 448, 1); SDrawUpdatePalette(0x70u, 0x90u, v5 + 112, 1);
} }
else else
{ {
v6 = GetParent(hWnd); v6 = GetParent(hWnd);
local_10007944((int)hWnd, (int)v6, "Popup", -1, 1, (int)v19, (int *)v18, 0, 1); local_LoadArtWithPal(hWnd, (int)v6, "Popup", -1, 1, pszFileName, pBuffer, 0, 1);
} }
v7 = GetParent(hWnd); v7 = GetParent(hWnd);
if ( (HWND)SDrawGetFrameWindow() == v7 ) if ( (HWND)SDrawGetFrameWindow() == v7 )
Fade_100073EF(hWnd); Fade_SetInputWindow(hWnd);
v8 = v18 + 1; v8 = pBuffer + 1;
local_100078BE((int)"ui_art\\but_sml.pcx", (int *)v18 + 1, &v17); local_LoadArtImage("ui_art\\but_sml.pcx", pBuffer + 1, data);
local_10007B1B(hWnd, &v14, *(_DWORD *)v8, &v17); local_FitButtonDlg(hWnd, &a2a, *v8, data);
v9 = GetDlgItem(hWnd, 1026); v9 = GetDlgItem(hWnd, 1026);
v10 = *(const CHAR **)(v2 + 4); v10 = (const CHAR *)lParam[1];
v18 = v9; pBuffer = (BYTE **)v9;
SetWindowTextA(v9, v10); SetWindowTextA(v9, v10);
if ( *(_DWORD *)(v2 + 16) && OkCancel_10008F31(v18, *(const CHAR **)(v2 + 4)) ) if ( lParam[4] && OkCancel_DrawString((HWND)pBuffer, (char *)lParam[1]) )
return 0; return 0;
if ( *(_DWORD *)v2 ) if ( *lParam )
{ {
v11 = GetDlgItem(hWnd, 1038); v11 = GetDlgItem(hWnd, 1038);
v12 = v11; v12 = v11;
if ( *(_DWORD *)(v2 + 16) && OkCancel_10008F31(v11, *(const CHAR **)v2) ) if ( lParam[4] && OkCancel_DrawString(v11, (char *)*lParam) )
return 0; return 0;
if ( v12 ) if ( v12 )
SetWindowTextA(v12, *(LPCSTR *)v2); SetWindowTextA(v12, (LPCSTR)*lParam);
} }
return 1; return 1;
} */ }
// 10010364: using guessed type int __stdcall SMemAlloc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow(); // 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow();
// 100103FA: using guessed type int __stdcall SDrawUpdatePalette(_DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x100092F5 // ref: 0x100092F5
int __fastcall OkCancel_100092F5(int a1, int a2) { return 0; } void __fastcall OkCancel_PlaySndEndDlg(HWND hWnd, int a2)
/* { {
int v2; // esi TitleSnd_PlaySelectSound();
int v3; // edi SDlgEndDialog(hWnd, (HANDLE)a2);
}
v2 = a2;
v3 = a1;
TitleSnd_1001031F();
return SDlgEndDialog(v3, v2);
} */
// 10010376: using guessed type int __stdcall SDlgEndDialog(_DWORD, _DWORD);
// ref: 0x1000930A // ref: 0x1000930A
int __fastcall OkCancel_1000930A(int a1, int a2, int a3) { return 0; } void __fastcall OkCancel_DoOkDialog(HWND hWnd, char *str, int a3)
/* { {
int v4; // [esp+0h] [ebp-14h] int a5[5]; // [esp+0h] [ebp-14h]
int v5; // [esp+4h] [ebp-10h]
int v6; // [esp+8h] [ebp-Ch]
int v7; // [esp+Ch] [ebp-8h]
int v8; // [esp+10h] [ebp-4h]
v5 = a2; a5[1] = (int)str;
v6 = 0; a5[2] = 0;
v4 = 0; a5[0] = 0;
v8 = 0; a5[4] = 0;
v7 = a3; a5[3] = a3;
return SDlgDialogBoxParam(hInstance, "OK_DIALOG", a1, OkCancel_10008FF7, &v4); SDlgDialogBoxParam(ghUiInst, "OK_DIALOG", (int)hWnd, OkCancel_WndProc, (int)a5);
} */ }
// 10010370: using guessed type int __stdcall SDlgDialogBoxParam(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x10009342 // ref: 0x10009342
void __cdecl UiMessageBoxCallback() { return; } void __stdcall UiMessageBoxCallback(HWND hWnd, char *lpText, LPCSTR lpCaption, UINT uType)
//LPCSTR __stdcall UiMessageBoxCallback(HWND hWnd, LPCSTR lpText, LPCSTR lpCaption, UINT uType) { return 0; } {
/* {
int v4; // eax int v4; // eax
bool v5; // sf unsigned char v5; // sf
unsigned char v6; // of unsigned char v6; // of
size_t v7; // eax size_t v7; // eax
CHAR *v8; // eax char *v8; // eax
int v9; // ecx int v9; // ecx
LPCSTR v11; // [esp+0h] [ebp-24h] int a5[5]; // [esp+0h] [ebp-24h]
LPCSTR v12; // [esp+4h] [ebp-20h] int v11; // [esp+14h] [ebp-10h]
int v13; // [esp+8h] [ebp-1Ch] void *location; // [esp+18h] [ebp-Ch]
BOOL v14; // [esp+Ch] [ebp-18h] char *szDialog; // [esp+1Ch] [ebp-8h]
int v15; // [esp+10h] [ebp-14h] char *v14; // [esp+20h] [ebp-4h]
int v16; // [esp+14h] [ebp-10h]
LPCSTR v17; // [esp+18h] [ebp-Ch]
const char *v18; // [esp+1Ch] [ebp-8h]
LPCSTR v19; // [esp+20h] [ebp-4h]
v11 = lpCaption; a5[0] = (int)lpCaption;
v12 = lpText; a5[1] = (int)lpText;
v18 = "OK_DIALOG"; szDialog = "OK_DIALOG";
v15 = 1; a5[4] = 1;
if ( uType & 0xF ) if ( uType & 0xF )
v18 = "OKCANCEL_DIALOG"; szDialog = "OKCANCEL_DIALOG";
v14 = (uType & 0xF0) == 16 || (uType & 0xF0) == 48; a5[3] = (uType & 0xF0) == 16 || (uType & 0xF0) == 48;
v4 = 0; v4 = 0;
v13 = 0; a5[2] = 0;
while ( 1 ) while ( 1 )
{ {
v19 = (LPCSTR)SDlgDialogBoxParam(hInstance, &v18[32 * v4], hWnd, OkCancel_10008FF7, &v11); v14 = (char *)SDlgDialogBoxParam(ghUiInst, &szDialog[32 * v4], (int)hWnd, OkCancel_WndProc, (int)a5);
if ( v19 != (LPCSTR)-16777216 ) if ( v14 != (char *)0xFF000000 )
break; break;
v4 = v13 + 1; v4 = a5[2] + 1;
v6 = __OFSUB__(v13 + 1, 2); v6 = __OFSUB__(a5[2] + 1, 2);
v5 = v13++ - 1 < 0; v5 = a5[2]++ - 1 < 0;
if ( !(v5 ^ v6) ) if ( !(v5 ^ v6) )
{ {
v7 = strlen(lpText); v7 = strlen(lpText);
v8 = (CHAR *)SMemAlloc(v7 + 256, "C:\\Src\\Diablo\\DiabloUI\\OkCancel.cpp", 392, 0); v8 = (char *)SMemAlloc(v7 + 256, "C:\\Src\\Diablo\\DiabloUI\\OkCancel.cpp", 392, 0);
v16 = 0; v11 = 0; /* check */
v17 = v8; location = v8;
v19 = lpText; v14 = lpText;
if ( *lpText ) if ( *lpText )
{ {
v9 = v16; v9 = v11;
do do
{ {
if ( *v19 <= 32 ) if ( *v14 <= 32 )
v9 = 0; v9 = 0;
*v8++ = *v19; *v8++ = *v14;
if ( ++v9 > 18 ) if ( ++v9 > 18 )
{ {
*v8++ = 10; *v8++ = 10;
v9 = 0; v9 = 0;
} }
++v19; ++v14;
} }
while ( *v19 ); while ( *v14 );
} }
*v8 = 0; *v8 = 0;
v12 = v17; a5[1] = (int)location;
v19 = (LPCSTR)SDlgDialogBoxParam(hInstance, v18, hWnd, OkCancel_10008FF7, &v11); v14 = (char *)SDlgDialogBoxParam(ghUiInst, szDialog, (int)hWnd, OkCancel_WndProc, (int)a5);
SMemFree(v17, "C:\\Src\\Diablo\\DiabloUI\\OkCancel.cpp", 416, 0); SMemFree(location, "C:\\Src\\Diablo\\DiabloUI\\OkCancel.cpp", 416, 0);
if ( v19 == (LPCSTR)-16777216 ) if ( v14 == (char *)0xFF000000 )
return (LPCSTR)MessageBoxA(hWnd, lpText, lpCaption, uType); MessageBoxA(hWnd, lpText, lpCaption, uType);
return v19; return;
} }
} }
return v19; }
} */
// 10010340: using guessed type int __stdcall SMemFree(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010364: using guessed type int __stdcall SMemAlloc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010370: using guessed type int __stdcall SDlgDialogBoxParam(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD);

299
DiabloUI/sbar.cpp

@ -1,49 +1,42 @@
// ref: 0x100099B5 // ref: 0x100099B5
signed int Sbar_100099B5() { return 0; } void __cdecl Sbar_cpp_init()
/* { {
signed int result; // eax Sbar_cpp_float = Sbar_cpp_float_value;
}
result = 2139095040; // 1001F448: using guessed type int Sbar_cpp_float_value;
dword_1002A338 = 2139095040; // 1002A338: using guessed type int Sbar_cpp_float;
return result;
} */
// 1002A338: using guessed type int dword_1002A338;
// ref: 0x100099C0 // ref: 0x100099C0
int UNKCALL Sbar_100099C0(HWND hWnd) { return 0; } BOOL __fastcall Sbar_CheckIfNextHero(HWND hWnd)
/* { {
_DWORD *v1; // eax _uiheroinfo *v1; // eax
v1 = (_DWORD *)GetWindowLongA(hWnd, -21); v1 = (_uiheroinfo *)GetWindowLongA(hWnd, -21);
if ( !v1 || !*v1 ) if ( !v1 || !v1->next )
return 0; return 0;
*v1 = 0; v1->next = 0;
return 1; return 1;
} */ }
// ref: 0x100099DC // ref: 0x100099DC
int __fastcall Sbar_100099DC(HWND hWnd, LONG a2, int a3) { return 0; } int __fastcall Sbar_NumScrollLines(HWND hWnd, int width, int height)
/* { {
HWND v3; // esi
_DWORD *v4; // eax _DWORD *v4; // eax
_DWORD *v5; // esi _DWORD *v5; // esi
int result; // eax int result; // eax
signed int v7; // ecx signed int v7; // ecx
LONG v8; // ebx LONG v8; // ebx
LONG v9; // edi LONG v9; // edi
signed int v10; // [esp-4h] [ebp-1Ch] int v10; // [esp-4h] [ebp-1Ch]
struct tagPOINT Point; // [esp+Ch] [ebp-Ch] struct tagPOINT Point; // [esp+Ch] [ebp-Ch]
HWND hWnda; // [esp+14h] [ebp-4h]
v3 = hWnd; Point.x = width;
hWnda = hWnd; Point.y = height;
Point.x = a2;
Point.y = a3;
if ( !hWnd ) if ( !hWnd )
return 0; return 0;
if ( !IsWindowVisible(hWnd) ) if ( !IsWindowVisible(hWnd) )
return 0; return 0;
v4 = (_DWORD *)GetWindowLongA(v3, -21); v4 = (_DWORD *)GetWindowLongA(hWnd, -21);
v5 = v4; v5 = v4;
if ( !v4 ) if ( !v4 )
return 0; return 0;
@ -53,7 +46,7 @@ int __fastcall Sbar_100099DC(HWND hWnd, LONG a2, int a3) { return 0; }
else else
v8 = v4[14] * (v4[3] - v4[9] - 44) / (v7 - 1) + 22; v8 = v4[14] * (v4[3] - v4[9] - 44) / (v7 - 1) + 22;
v9 = v8 + v4[9]; v9 = v8 + v4[9];
ScreenToClient(hWnda, &Point); ScreenToClient(hWnd, &Point);
if ( Point.y >= 22 ) if ( Point.y >= 22 )
{ {
if ( Point.y >= v8 ) if ( Point.y >= v8 )
@ -90,187 +83,163 @@ int __fastcall Sbar_100099DC(HWND hWnd, LONG a2, int a3) { return 0; }
*v5 = 1; *v5 = 1;
} }
return result; return result;
} */ }
// ref: 0x10009A99 // ref: 0x10009A99
HWND __fastcall Sbar_10009A99(HWND hDlg, int nIDDlgItem, int a3, int a4) { return 0; } void __fastcall Sbar_DrawScrollBar(HWND hWnd, int nIDDlgItem, int width, int height)
/* { {
HWND result; // eax HWND v4; // eax
HWND v5; // esi LONG v5; // eax MAPDST
bool v6; // zf bool v7; // zf
int v7; // eax int v8; // eax
int v8; // [esp+Ch] [ebp-24h] tagRECT DstRect; // [esp+Ch] [ebp-24h]
int v9; // [esp+10h] [ebp-20h] tagRECT SrcBuffer; // [esp+1Ch] [ebp-14h]
int v10; // [esp+14h] [ebp-1Ch] HWND hWnda; // [esp+2Ch] [ebp-4h]
int v11; // [esp+18h] [ebp-18h]
int v12; // [esp+1Ch] [ebp-14h]
int v13; // [esp+20h] [ebp-10h]
int v14; // [esp+24h] [ebp-Ch]
int v15; // [esp+28h] [ebp-8h]
HWND hWnd; // [esp+2Ch] [ebp-4h]
result = GetDlgItem(hDlg, nIDDlgItem); v4 = GetDlgItem(hWnd, nIDDlgItem);
hWnd = result; hWnda = v4;
if ( result ) if ( v4 )
{ {
result = (HWND)GetWindowLongA(result, -21); v5 = GetWindowLongA(v4, -21);
v5 = result; if ( v5 )
if ( result )
{ {
if ( *((_DWORD *)result + 1) ) if ( *(_DWORD *)(v5 + 4) )
{ {
v6 = *((_DWORD *)result + 4) == 0; v7 = *(_DWORD *)(v5 + 16) == 0;
*((_DWORD *)result + 13) = a3; *(_DWORD *)(v5 + 52) = width;
result = (HWND)a4; *(_DWORD *)(v5 + 56) = height;
*((_DWORD *)v5 + 14) = a4; if ( !v7 )
if ( !v6 )
{ {
v12 = 0; SrcBuffer.left = 0;
v8 = 0; DstRect.left = 0;
v13 = 0; SrcBuffer.top = 0;
v9 = 0; DstRect.top = 0;
v10 = *((_DWORD *)v5 + 2) - 1; DstRect.right = *(_DWORD *)(v5 + 8) - 1;
v11 = *((_DWORD *)v5 + 3) - 1; DstRect.bottom = *(_DWORD *)(v5 + 12) - 1;
v14 = *((_DWORD *)v5 + 2) - 1; SrcBuffer.right = *(_DWORD *)(v5 + 8) - 1;
v15 = *((_DWORD *)v5 + 6) - 1; SrcBuffer.bottom = *(_DWORD *)(v5 + 24) - 1;
result = (HWND)SBltROP3Tiled( SBltROP3Tiled(
*((_DWORD *)v5 + 1), *(void **)(v5 + 4),
&v8, &DstRect,
*((_DWORD *)v5 + 2), *(POINT **)(v5 + 8),
*((_DWORD *)v5 + 4), *(_DWORD *)(v5 + 16),
&v12, &SrcBuffer,
*((_DWORD *)v5 + 5), *(RECT **)(v5 + 20),
0, 0,
0, 0,
0, 0,
13369376); 0xCC0020u);
if ( *((_DWORD *)v5 + 7) ) if ( *(_DWORD *)(v5 + 28) )
{ {
if ( a3 <= 1 ) if ( width <= 1 )
v7 = 22; v8 = 22;
else else
v7 = a4 * (*((_DWORD *)v5 + 3) - *((_DWORD *)v5 + 9) - 44) / (a3 - 1) + 22; v8 = height * (*(_DWORD *)(v5 + 12) - *(_DWORD *)(v5 + 36) - 44) / (width - 1) + 22;
SBltROP3( SBltROP3(
v7 * *((_DWORD *)v5 + 2) + *((_DWORD *)v5 + 1) + 3, (void *)(v8 * *(_DWORD *)(v5 + 8) + *(_DWORD *)(v5 + 4) + 3),
*((_DWORD *)v5 + 7), *(void **)(v5 + 28),
18, 18,
*((_DWORD *)v5 + 9), *(_DWORD *)(v5 + 36),
*((_DWORD *)v5 + 2), *(_DWORD *)(v5 + 8),
*((_DWORD *)v5 + 8), *(_DWORD *)(v5 + 32),
0, 0,
13369376); 0xCC0020u);
SBltROP3( SBltROP3(
*((_DWORD *)v5 + 1), *(void **)(v5 + 4),
*((_DWORD *)v5 + 10) + 22 * (~*(_BYTE *)v5 & 1) * *((_DWORD *)v5 + 11), (void *)(*(_DWORD *)(v5 + 40) + 22 * (~*(_BYTE *)v5 & 1) * *(_DWORD *)(v5 + 44)),
*((_DWORD *)v5 + 2), *(_DWORD *)(v5 + 8),
22, 22,
*((_DWORD *)v5 + 2), *(_DWORD *)(v5 + 8),
*((_DWORD *)v5 + 11), *(_DWORD *)(v5 + 44),
0, 0,
13369376); 0xCC0020u);
SBltROP3( SBltROP3(
*((_DWORD *)v5 + 1) + *((_DWORD *)v5 + 2) * (*((_DWORD *)v5 + 3) - 22), (void *)(*(_DWORD *)(v5 + 4) + *(_DWORD *)(v5 + 8) * (*(_DWORD *)(v5 + 12) - 22)),
*((_DWORD *)v5 + 10) + 22 * ((~*(_BYTE *)v5 & 4 | 8u) >> 2) * *((_DWORD *)v5 + 11), (void *)(*(_DWORD *)(v5 + 40) + 22 * ((~*(_BYTE *)v5 & 4 | 8u) >> 2) * *(_DWORD *)(v5 + 44)),
*((_DWORD *)v5 + 2), *(_DWORD *)(v5 + 8),
22, 22,
*((_DWORD *)v5 + 2), *(_DWORD *)(v5 + 8),
*((_DWORD *)v5 + 11), *(_DWORD *)(v5 + 44),
0, 0,
13369376); 0xCC0020u);
result = (HWND)InvalidateRect(hWnd, 0, 0); InvalidateRect(hWnda, 0, 0);
} }
} }
} }
} }
} }
return result; }
} */
// 100103F4: using guessed type int __stdcall SBltROP3(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// 1001046C: using guessed type int __stdcall SBltROP3Tiled(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x10009BF1 // ref: 0x10009BF1
HWND __fastcall Sbar_10009BF1(HWND hDlg, int nIDDlgItem) { return 0; } void __fastcall Sbar_LoadScrBarGFX(HWND hWnd, int nIDDlgItem)
/* { {
HWND result; // eax DWORD *v2; // eax MAPDST
HWND v3; // esi void *v4; // eax
struct tagRECT Rect; // [esp+Ch] [ebp-14h] struct tagRECT Rect; // [esp+Ch] [ebp-14h]
HWND hWnd; // [esp+1Ch] [ebp-4h] HWND hWnda; // [esp+1Ch] [ebp-4h]
result = GetDlgItem(hDlg, nIDDlgItem); hWnda = GetDlgItem(hWnd, nIDDlgItem);
hWnd = result; if ( hWnda )
if ( result )
{ {
result = (HWND)SMemAlloc(60, "C:\\Src\\Diablo\\DiabloUI\\Sbar.cpp", 221, 0); v2 = (DWORD *)SMemAlloc(0x3Cu, "C:\\Src\\Diablo\\DiabloUI\\Sbar.cpp", 221, 0);
v3 = result; if ( v2 )
if ( result )
{ {
SetWindowLongA(hWnd, -21, (LONG)result); SetWindowLongA(hWnda, -21, (LONG)v2);
*(_DWORD *)v3 = 0; *v2 = 0;
GetClientRect(hWnd, &Rect); GetClientRect(hWnda, &Rect);
*(_DWORD *)(v3 + 2) = Rect.right; v2[2] = Rect.right;
*(_DWORD *)(v3 + 3) = Rect.bottom; v2[3] = Rect.bottom;
result = (HWND)SMemAlloc(Rect.right * Rect.bottom, "C:\\Src\\Diablo\\DiabloUI\\Sbar.cpp", 230, 0); v4 = SMemAlloc(Rect.right * Rect.bottom, "C:\\Src\\Diablo\\DiabloUI\\Sbar.cpp", 230, 0);
*((_DWORD *)v3 + 1) = result; v2[1] = (DWORD)v4;
if ( result ) if ( v4 )
{ {
SDlgSetBitmapI(hWnd, 0, &byte_10029448, -1, 1, result, 0, *((_DWORD *)v3 + 2), *((_DWORD *)v3 + 3), -1); SDlgSetBitmapI(hWnda, 0, &nullcharacter, -1, 1, v4, 0, v2[2], v2[3], -1);
local_100078BE((int)"ui_art\\sb_bg.pcx", (int *)v3 + 4, (_DWORD *)v3 + 5); local_LoadArtImage("ui_art\\sb_bg.pcx", (BYTE **)v2 + 4, v2 + 5);
local_100078BE((int)"ui_art\\sb_thumb.pcx", (int *)v3 + 7, (_DWORD *)v3 + 8); local_LoadArtImage("ui_art\\sb_thumb.pcx", (BYTE **)v2 + 7, v2 + 8);
result = (HWND)local_100078BE((int)"ui_art\\sb_arrow.pcx", (int *)v3 + 10, (_DWORD *)v3 + 11); local_LoadArtImage("ui_art\\sb_arrow.pcx", (BYTE **)v2 + 10, v2 + 11);
} }
} }
} }
return result; }
} */
// 10010364: using guessed type int __stdcall SMemAlloc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010400: using guessed type int __stdcall SDlgSetBitmapI(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x10009CC7 // ref: 0x10009CC7
signed int Sbar_10009CC7() { return 0; } void __cdecl Sbar_cpp_init2()
/* { {
signed int result; // eax Sbar_cpp_float2 = Sbar_cpp_float_value2;
}
result = 2139095040; // 1001F44C: using guessed type int Sbar_cpp_float_value2;
dword_1002A344 = 2139095040; // 1002A344: using guessed type int Sbar_cpp_float2;
return result;
} */
// 1002A344: using guessed type int dword_1002A344;
// ref: 0x10009CD2 // ref: 0x10009CD2
HWND __fastcall Sbar_10009CD2(HWND hDlg, int nIDDlgItem) { return 0; } void __fastcall Sbar_FreeScrollBar(HWND hWnd, int nIDDlgItem)
/* { {
HWND result; // eax HWND v2; // eax MAPDST
HWND v3; // ebp _DWORD *v4; // eax MAPDST
HWND v4; // esi void *v6; // eax
int v5; // eax void *v7; // eax
int v6; // eax void *v8; // eax
int v7; // eax void *v9; // eax
int v8; // eax
result = GetDlgItem(hDlg, nIDDlgItem); v2 = GetDlgItem(hWnd, nIDDlgItem);
v3 = result; if ( v2 )
if ( result )
{ {
result = (HWND)GetWindowLongA(result, -21); v4 = (_DWORD *)GetWindowLongA(v2, -21);
v4 = result; if ( v4 )
if ( result )
{ {
v5 = *((_DWORD *)result + 1); v6 = (void *)v4[1];
if ( v5 )
SMemFree(v5, "C:\\Src\\Diablo\\DiabloUI\\Sbar.cpp", 267, 0);
v6 = *((_DWORD *)v4 + 4);
if ( v6 ) if ( v6 )
SMemFree(v6, "C:\\Src\\Diablo\\DiabloUI\\Sbar.cpp", 269, 0); SMemFree(v6, "C:\\Src\\Diablo\\DiabloUI\\Sbar.cpp", 267, 0);
v7 = *((_DWORD *)v4 + 7); v7 = (void *)v4[4];
if ( v7 ) if ( v7 )
SMemFree(v7, "C:\\Src\\Diablo\\DiabloUI\\Sbar.cpp", 271, 0); SMemFree(v7, "C:\\Src\\Diablo\\DiabloUI\\Sbar.cpp", 269, 0);
v8 = *((_DWORD *)v4 + 10); v8 = (void *)v4[7];
if ( v8 ) if ( v8 )
SMemFree(v8, "C:\\Src\\Diablo\\DiabloUI\\Sbar.cpp", 273, 0); SMemFree(v8, "C:\\Src\\Diablo\\DiabloUI\\Sbar.cpp", 271, 0);
v9 = (void *)v4[10];
if ( v9 )
SMemFree(v9, "C:\\Src\\Diablo\\DiabloUI\\Sbar.cpp", 273, 0);
SMemFree(v4, "C:\\Src\\Diablo\\DiabloUI\\Sbar.cpp", 275, 0); SMemFree(v4, "C:\\Src\\Diablo\\DiabloUI\\Sbar.cpp", 275, 0);
result = (HWND)SetWindowLongA(v3, -21, 0); SetWindowLongA(v2, -21, 0);
} }
} }
return result; }
} */
// 10010340: using guessed type int __stdcall SMemFree(_DWORD, _DWORD, _DWORD, _DWORD);

192
DiabloUI/selclass.cpp

@ -1,28 +1,28 @@
// ref: 0x10009D66 // ref: 0x10009D66
int __stdcall SelClass_10009D66(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) { return 0; } LRESULT __stdcall SelClass_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
/* { {
HWND v4; // eax HWND v4; // eax
LONG v5; // edx int v5; // edx
HWND v6; // eax HWND v6; // eax
HWND v7; // eax HWND v7; // eax
HWND v9; // eax HWND v9; // eax
if ( Msg == 2 ) if ( Msg == 2 )
{ {
SelClass_10009EC0(hDlg); SelClass_FreeClassMsgTbl(hWnd);
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( Msg <= 0x103 ) if ( Msg <= 0x103 )
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
if ( Msg <= 0x105 ) if ( Msg <= 0x105 )
{ {
v9 = (HWND)SDrawGetFrameWindow(); v9 = (HWND)SDrawGetFrameWindow();
SendMessageA(v9, Msg, wParam, lParam); SendMessageA(v9, Msg, wParam, lParam);
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( Msg == 272 ) if ( Msg == 272 )
{ {
SelClass_10009EFD(hDlg); SelClass_LoadClassFocus(hWnd);
return 0; return 0;
} }
if ( Msg != 273 ) if ( Msg != 273 )
@ -31,163 +31,137 @@ int __stdcall SelClass_10009D66(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lPara
{ {
if ( Msg == 513 ) if ( Msg == 513 )
{ {
v4 = GetDlgItem(hDlg, 1056); v4 = GetDlgItem(hWnd, 1056);
if ( local_10007C3B(hDlg, v4, (unsigned short)lParam, (unsigned int)lParam >> 16) ) if ( local_GetBottomRect(hWnd, v4, (unsigned short)lParam, (unsigned int)lParam >> 16) )
{ {
v5 = 1; v5 = 1;
LABEL_19: LABEL_19:
SelClass_1000A00D((int)hDlg, v5); SelClass_CheckClassSpawn(hWnd, v5);
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
v6 = GetDlgItem(hDlg, 1054); v6 = GetDlgItem(hWnd, 1054);
if ( local_10007C3B(hDlg, v6, (unsigned short)lParam, (unsigned int)lParam >> 16) ) if ( local_GetBottomRect(hWnd, v6, (unsigned short)lParam, (unsigned int)lParam >> 16) )
{ {
LABEL_21: LABEL_21:
v5 = 2; v5 = 2;
goto LABEL_19; goto LABEL_19;
} }
} }
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
v7 = GetFocus(); v7 = GetFocus();
Focus_100075DC(hDlg, v7); Focus_DoBlitSpinIncFrame(hWnd, v7);
return 0; return 0;
} }
if ( HIWORD(wParam) == 7 ) if ( HIWORD(wParam) == 7 )
{ {
Focus_100075B7(hDlg, (HWND)lParam); Focus_GetAndBlitSpin(hWnd, lParam);
} }
else else
{ {
if ( HIWORD(wParam) != 6 ) if ( HIWORD(wParam) != 6 )
{ {
v5 = 1; v5 = 1;
if ( wParam == 327681 ) if ( HIWORD(wParam) == 5 || (_WORD)wParam == 1 )
goto LABEL_19; goto LABEL_19;
if ( (_WORD)wParam != 2 ) if ( (_WORD)wParam != 2 )
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
goto LABEL_21; goto LABEL_21;
} }
Focus_10007458((void *)lParam); Focus_CheckPlayMove(lParam);
Focus_100075DC(hDlg, (HWND)lParam); Focus_DoBlitSpinIncFrame(hWnd, (HWND)lParam);
SelClass_10009FA2(hDlg, (unsigned short)wParam); SelClass_SetDefaultStats(hWnd, (unsigned short)wParam);
} }
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} */ }
// 1001037C: using guessed type int __stdcall SDlgDefDialogProc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow(); // 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow();
// ref: 0x10009EC0 // ref: 0x10009EC0
HWND UNKCALL SelClass_10009EC0(HWND hDlg) { return 0; } void __fastcall SelClass_FreeClassMsgTbl(HWND hWnd)
/* { {
HWND v1; // esi
HWND v2; // eax HWND v2; // eax
v1 = hDlg; Focus_DeleteSpinners();
Focus_100076C3(); Doom_DeleteFreeProcs(hWnd, selclass_msgtbl3);
Doom_10006C53(v1, (int *)&unk_10022EC8); Doom_DeleteFreeProcs(hWnd, selclass_msgtbl2);
Doom_10006C53(v1, (int *)&unk_10022EBC); Doom_DeleteFreeProcs(hWnd, selclass_msgtbl1);
Doom_10006C53(v1, (int *)&unk_10022EB4); v2 = GetParent(hWnd);
v2 = GetParent(v1); SelHero_SetStringWithMsg(v2, 0);
return SelHero_1000BA7B(v2, 0); }
} */
// ref: 0x10009EFD // ref: 0x10009EFD
int UNKCALL SelClass_10009EFD(HWND hWnd) { return 0; } void __fastcall SelClass_LoadClassFocus(HWND hWnd)
/* { {
HWND v1; // edi HWND v1; // edi
HWND v2; // esi HWND v2; // esi
LONG v3; // eax LONG v3; // eax
CHAR Buffer; // [esp+8h] [ebp-20h] char Buffer[32]; // [esp+8h] [ebp-20h]
v1 = hWnd; v1 = hWnd;
v2 = GetParent(hWnd); v2 = GetParent(hWnd);
if ( SelHero_1000B7CA() == 1 ) if ( SelHero_GetHeroIsGood() == 1 )
LoadStringA(hInstance, 0x20u, &Buffer, 31); LoadStringA(ghUiInst, 0x20u, Buffer, 31);
else else
LoadStringA(hInstance, 0x1Fu, &Buffer, 31); LoadStringA(ghUiInst, 0x1Fu, Buffer, 31);
SelHero_1000BA7B(v2, &Buffer); SelHero_SetStringWithMsg(v2, Buffer);
v3 = GetWindowLongA(v2, -21); v3 = GetWindowLongA(v2, -21);
SetWindowLongA(v1, -21, v3); SetWindowLongA(v1, -21, v3);
local_10007CB5(v1, (int *)&unk_10022EC8); local_DoUiWndProc(v1, (DWORD *)selclass_msgtbl3);
Doom_100068AB(v1, (int *)&unk_10022EB4, 5); Doom_ParseWndProc3(v1, selclass_msgtbl1, 5);
Doom_1000658C(v1, (int *)&unk_10022EBC, 4, 0); Doom_ParseWndProcs(v1, selclass_msgtbl2, 4, 0);
Doom_1000658C(v1, (int *)&unk_10022EC8, 2, 1); Doom_ParseWndProcs(v1, selclass_msgtbl3, 2, 1);
Focus_10007719("ui_art\\focus.pcx"); Focus_LoadSpinner("ui_art\\focus.pcx");
return SDlgSetTimer(v1, 1, 55, 0); SDlgSetTimer((int)v1, 1, 55, 0);
} */ }
// 10010412: using guessed type int __stdcall SDlgSetTimer(_DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x10009FA2 // ref: 0x10009FA2
int __fastcall SelClass_10009FA2(HWND hWnd, int a2) { return 0; } void __fastcall SelClass_SetDefaultStats(HWND hWnd, int a2)
/* { {
char v2; // bl char v2; // bl
HWND v3; // esi
HWND v4; // eax HWND v4; // eax
char v6; // [esp+8h] [ebp-34h] _uiheroinfo pInfo; // [esp+8h] [ebp-34h]
short v7; // [esp+1Ch] [ebp-20h] _uidefaultstats a2a; // [esp+34h] [ebp-8h]
char v8; // [esp+1Eh] [ebp-1Eh]
short v9; // [esp+20h] [ebp-1Ch]
short v10; // [esp+22h] [ebp-1Ah]
short v11; // [esp+24h] [ebp-18h]
short v12; // [esp+26h] [ebp-16h]
short v13; // [esp+34h] [ebp-8h]
short v14; // [esp+36h] [ebp-6h]
short v15; // [esp+38h] [ebp-4h]
short v16; // [esp+3Ah] [ebp-2h]
v2 = a2; v2 = a2;
v3 = hWnd; SelHero_SetClassStats(a2 - 1062, &a2a);
SelHero_1000B7D0(a2 - 1062, (int)&v13); memset(&pInfo, 0, 0x2Cu);
memset(&v6, 0, 0x2Cu); pInfo.strength = a2a.strength;
v9 = v13; pInfo.magic = a2a.magic;
v10 = v14; pInfo.dexterity = a2a.dexterity;
v11 = v15; pInfo.vitality = a2a.vitality;
v7 = 1; pInfo.level = 1;
v8 = v2 - 38; pInfo.heroclass = v2 - 38;
v12 = v16; v4 = GetParent(hWnd);
v4 = GetParent(v3); SelHero_PrintHeroInfo(v4, &pInfo);
return SelHero_1000B905(v4, (int)&v6); }
} */
// ref: 0x1000A00D // ref: 0x1000A00D
int __fastcall SelClass_1000A00D(int a1, LONG a2) { return 0; } void __fastcall SelClass_CheckClassSpawn(HWND hWnd, int a2)
/* { {
LONG v2; // esi
int v3; // ebp
HWND v4; // eax HWND v4; // eax
HWND v6; // eax HWND v5; // eax
v2 = a2; if ( DiabloUI_GetSpawned() && a2 == 1 && (v4 = GetFocus(), GetWindowLongA(v4, -12) != 1062) )
v3 = a1;
if ( DiabloUI_10005C2A() )
{ {
if ( v2 == 1 ) SelYesNo_SpawnErrDialog(hWnd, 69, 0);
{
v4 = GetFocus();
if ( GetWindowLongA(v4, -12) != 1062 )
return SelYesNo_1000FD77(v3, 0x45u, 0);
}
} }
TitleSnd_1001031F(); else
SDlgKillTimer(v3, 1);
if ( v2 == 1 )
{ {
v6 = GetFocus(); TitleSnd_PlaySelectSound();
v2 = GetWindowLongA(v6, -12); SDlgKillTimer((int)hWnd, 1);
if ( a2 == 1 )
{
v5 = GetFocus();
a2 = GetWindowLongA(v5, -12);
}
SDlgEndDialog(hWnd, (HANDLE)a2);
} }
return SDlgEndDialog(v3, v2); }
} */
// 10010376: using guessed type int __stdcall SDlgEndDialog(_DWORD, _DWORD);
// 10010418: using guessed type int __stdcall SDlgKillTimer(_DWORD, _DWORD);
// ref: 0x1000A077 // ref: 0x1000A077
signed int SelClass_1000A077() { return 0; } void __cdecl SelClass_cpp_init()
/* { {
signed int result; // eax SelClass_cpp_float = SelClass_cpp_float_value;
}
result = 2139095040; // 1001F450: using guessed type int SelClass_cpp_float_value;
dword_1002A348 = 2139095040; // 1002A348: using guessed type int SelClass_cpp_float;
return result;
} */
// 1002A348: using guessed type int dword_1002A348;

1079
DiabloUI/selhero.cpp

File diff suppressed because it is too large Load Diff

821
DiabloUI/sellist.cpp

File diff suppressed because it is too large Load Diff

129
DiabloUI/selload.cpp

@ -1,28 +1,28 @@
// ref: 0x1000E1C2 // ref: 0x1000E1C2
int __stdcall SelLoad_1000E1C2(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) { return 0; } LRESULT __stdcall SelLoad_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
/* { {
HWND v4; // eax HWND v4; // eax
LONG v5; // edx int v5; // edx
HWND v6; // eax HWND v6; // eax
HWND v7; // eax HWND v7; // eax
HWND v9; // eax HWND v9; // eax
if ( Msg == 2 ) if ( Msg == 2 )
{ {
SelLoad_1000E30E(hDlg); SelLoad_DeleteProcsAndSpin(hWnd);
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( Msg <= 0x103 ) if ( Msg <= 0x103 )
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
if ( Msg <= 0x105 ) if ( Msg <= 0x105 )
{ {
v9 = (HWND)SDrawGetFrameWindow(); v9 = (HWND)SDrawGetFrameWindow();
SendMessageA(v9, Msg, wParam, lParam); SendMessageA(v9, Msg, wParam, lParam);
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( Msg == 272 ) if ( Msg == 272 )
{ {
SelLoad_1000E34B(hDlg); SelLoad_LoadFocusAndMsg(hWnd);
return 0; return 0;
} }
if ( Msg != 273 ) if ( Msg != 273 )
@ -31,117 +31,104 @@ int __stdcall SelLoad_1000E1C2(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam
{ {
if ( Msg == 513 ) if ( Msg == 513 )
{ {
v4 = GetDlgItem(hDlg, 1056); v4 = GetDlgItem(hWnd, 1056);
if ( local_10007C3B(hDlg, v4, (unsigned short)lParam, (unsigned int)lParam >> 16) ) if ( local_GetBottomRect(hWnd, v4, (unsigned short)lParam, (unsigned int)lParam >> 16) )
{ {
v5 = 1; v5 = 1;
LABEL_19: LABEL_19:
SelLoad_1000E3E2((int)hDlg, v5); SelLoad_SelectSndLoad(hWnd, v5);
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
v6 = GetDlgItem(hDlg, 1054); v6 = GetDlgItem(hWnd, 1054);
if ( local_10007C3B(hDlg, v6, (unsigned short)lParam, (unsigned int)lParam >> 16) ) if ( local_GetBottomRect(hWnd, v6, (unsigned short)lParam, (unsigned int)lParam >> 16) )
{ {
LABEL_21: LABEL_21:
v5 = 2; v5 = 2;
goto LABEL_19; goto LABEL_19;
} }
} }
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
v7 = GetFocus(); v7 = GetFocus();
Focus_100075DC(hDlg, v7); Focus_DoBlitSpinIncFrame(hWnd, v7);
return 0; return 0;
} }
if ( HIWORD(wParam) == 7 ) if ( HIWORD(wParam) == 7 )
{ {
Focus_100075B7(hDlg, (HWND)lParam); Focus_GetAndBlitSpin(hWnd, lParam);
} }
else else
{ {
if ( HIWORD(wParam) != 6 ) if ( HIWORD(wParam) != 6 )
{ {
v5 = 1; v5 = 1;
if ( wParam == 327681 ) if ( HIWORD(wParam) == 5 || (_WORD)wParam == 1 )
goto LABEL_19; goto LABEL_19;
if ( (_WORD)wParam != 2 ) if ( (_WORD)wParam != 2 )
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
goto LABEL_21; goto LABEL_21;
} }
Focus_10007458((void *)lParam); Focus_CheckPlayMove(lParam);
Focus_100075DC(hDlg, (HWND)lParam); Focus_DoBlitSpinIncFrame(hWnd, (HWND)lParam);
} }
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} */ }
// 1001037C: using guessed type int __stdcall SDlgDefDialogProc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow(); // 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow();
// ref: 0x1000E30E // ref: 0x1000E30E
HWND UNKCALL SelLoad_1000E30E(HWND hDlg) { return 0; } void __fastcall SelLoad_DeleteProcsAndSpin(HWND hWnd)
/* { {
HWND v1; // esi
HWND v2; // eax HWND v2; // eax
v1 = hDlg; Focus_DeleteSpinners();
Focus_100076C3(); Doom_DeleteFreeProcs(hWnd, selload_msgtbl3);
Doom_10006C53(v1, (int *)&unk_100231C0); Doom_DeleteFreeProcs(hWnd, selload_msgtbl2);
Doom_10006C53(v1, (int *)&unk_100231B4); Doom_DeleteFreeProcs(hWnd, selload_msgtbl1);
Doom_10006C53(v1, (int *)&unk_100231AC); v2 = GetParent(hWnd);
v2 = GetParent(v1); SelHero_SetStringWithMsg(v2, 0);
return SelHero_1000BA7B(v2, 0); }
} */
// ref: 0x1000E34B // ref: 0x1000E34B
int UNKCALL SelLoad_1000E34B(HWND hWnd) { return 0; } void __fastcall SelLoad_LoadFocusAndMsg(HWND hWnd)
/* { {
HWND v1; // esi
HWND v2; // edi HWND v2; // edi
LONG v3; // eax LONG v3; // eax
CHAR Buffer; // [esp+8h] [ebp-20h] char Buffer[32]; // [esp+8h] [ebp-20h]
v1 = hWnd;
v2 = GetParent(hWnd); v2 = GetParent(hWnd);
LoadStringA(hInstance, 0x1Du, &Buffer, 31); LoadStringA(ghUiInst, 0x1Du, Buffer, 31);
SelHero_1000BA7B(v2, &Buffer); SelHero_SetStringWithMsg(v2, Buffer);
v3 = GetWindowLongA(v2, -21); v3 = GetWindowLongA(v2, -21);
SetWindowLongA(v1, -21, v3); SetWindowLongA(hWnd, -21, v3);
local_10007CB5(v1, (int *)&unk_100231C0); local_DoUiWndProc(hWnd, (DWORD *)selload_msgtbl3);
Doom_100068AB(v1, (int *)&unk_100231AC, 5); Doom_ParseWndProc3(hWnd, selload_msgtbl1, 5);
Doom_1000658C(v1, (int *)&unk_100231B4, 4, 0); Doom_ParseWndProcs(hWnd, selload_msgtbl2, 4, 0);
Doom_1000658C(v1, (int *)&unk_100231C0, 2, 1); Doom_ParseWndProcs(hWnd, selload_msgtbl3, 2, 1);
Focus_10007719("ui_art\\focus16.pcx"); Focus_LoadSpinner("ui_art\\focus16.pcx");
return SDlgSetTimer(v1, 1, 55, 0); SDlgSetTimer((int)hWnd, 1, 55, 0);
} */ }
// 10010412: using guessed type int __stdcall SDlgSetTimer(_DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x1000E3E2 // ref: 0x1000E3E2
int __fastcall SelLoad_1000E3E2(int a1, LONG a2) { return 0; } void __fastcall SelLoad_SelectSndLoad(HWND hWnd, int a2)
/* { {
LONG v2; // esi int v2; // esi
int v3; // edi
HWND v4; // eax HWND v4; // eax
v2 = a2; v2 = a2;
v3 = a1; TitleSnd_PlaySelectSound();
TitleSnd_1001031F(); SDlgKillTimer((int)hWnd, 1);
SDlgKillTimer(v3, 1);
if ( v2 == 1 ) if ( v2 == 1 )
{ {
v4 = GetFocus(); v4 = GetFocus();
v2 = GetWindowLongA(v4, -12); v2 = GetWindowLongA(v4, -12);
} }
return SDlgEndDialog(v3, v2); SDlgEndDialog(hWnd, (HANDLE)v2);
} */ }
// 10010376: using guessed type int __stdcall SDlgEndDialog(_DWORD, _DWORD);
// 10010418: using guessed type int __stdcall SDlgKillTimer(_DWORD, _DWORD);
// ref: 0x1000E41A // ref: 0x1000E41A
signed int SelLoad_1000E41A() { return 0; } void __cdecl SelLoad_cpp_init()
/* { {
signed int result; // eax SelLoad_cpp_float = SelLoad_cpp_float_value;
}
result = 2139095040; // 1001F46C: using guessed type int SelLoad_cpp_float_value;
dword_1002A4C8 = 2139095040; // 1002A4C8: using guessed type int SelLoad_cpp_float;
return result;
} */
// 1002A4C8: using guessed type int dword_1002A4C8;

12
DiabloUI/selregn.cpp

@ -6,14 +6,14 @@ void *SelRegn_1000EF42() { return 0; }
// 10010364: using guessed type int __stdcall SMemAlloc(_DWORD, _DWORD, _DWORD, _DWORD); // 10010364: using guessed type int __stdcall SMemAlloc(_DWORD, _DWORD, _DWORD, _DWORD);
// ref: 0x1000EF56 // ref: 0x1000EF56
_DWORD *__fastcall SelRegn_1000EF56(int a1, _DWORD *a2) { return 0; } _uiheroinfo *__fastcall SelRegn_SetNextHero(_uiheroinfo *pNext, _uiheroinfo *pCurrent)
/* { {
_DWORD *result; // eax _uiheroinfo *result; // eax
result = a2; result = pCurrent;
*a2 = a1; pCurrent->next = pNext;
return result; return result;
} */ }
// ref: 0x1000EF60 // ref: 0x1000EF60
signed int SelRegn_1000EF60() { return 0; } signed int SelRegn_1000EF60() { return 0; }

260
DiabloUI/selyesno.cpp

@ -1,25 +1,23 @@
// ref: 0x1000FA49 // ref: 0x1000FA49
int __fastcall SelYesNo_1000FA49(int a1, const CHAR *a2, int a3, int a4) { return 0; } int __fastcall SelYesNo_YesNoDialog(HWND hWnd, char *dialogstr, char *hero, int nofocus)
/* { {
dword_1002A4F8 = a2; yesno_dialog_string = dialogstr;
dword_1002A504 = a3; yesno_hero_name = hero;
dword_1002A500 = a4; yesno_remove_focus = nofocus;
dword_1002A50C = 0; yesno_is_popup = 0;
dword_1002A508 = 0; YesNoFunc = 0;
return SDlgDialogBoxParam(hInstance, "SELYESNO_DIALOG", a1, SelYesNo_1000FA87, 0); return SDlgDialogBoxParam(ghUiInst, "SELYESNO_DIALOG", (int)hWnd, SelYesNo_WndProc, 0);
} */ }
// 10010370: using guessed type int __stdcall SDlgDialogBoxParam(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD); // 1002A500: using guessed type int yesno_remove_focus;
// 1002A500: using guessed type int dword_1002A500; // 1002A508: using guessed type int (*YesNoFunc)(void);
// 1002A504: using guessed type int dword_1002A504; // 1002A50C: using guessed type int yesno_is_popup;
// 1002A508: using guessed type int (*dword_1002A508)(void);
// 1002A50C: using guessed type int dword_1002A50C;
// ref: 0x1000FA87 // ref: 0x1000FA87
int __stdcall SelYesNo_1000FA87(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lParam) { return 0; } LRESULT __stdcall SelYesNo_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
/* { {
HWND v4; // eax HWND v4; // eax
HWND v5; // eax HWND v5; // eax
LONG v7; // edx int v7; // edx
HWND v8; // eax HWND v8; // eax
LONG v9; // eax LONG v9; // eax
HWND v10; // ecx HWND v10; // ecx
@ -27,8 +25,8 @@ int __stdcall SelYesNo_1000FA87(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lPara
if ( Msg == 2 ) if ( Msg == 2 )
{ {
SelYesNo_1000FBC7(hDlg); SelYesNo_RemoveYNDialog(hWnd);
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
if ( Msg > 0x103 ) if ( Msg > 0x103 )
{ {
@ -36,22 +34,22 @@ int __stdcall SelYesNo_1000FA87(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lPara
{ {
v11 = (HWND)SDrawGetFrameWindow(); v11 = (HWND)SDrawGetFrameWindow();
SendMessageA(v11, Msg, wParam, lParam); SendMessageA(v11, Msg, wParam, lParam);
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
switch ( Msg ) switch ( Msg )
{ {
case 0x110u: case 0x110u:
SelYesNo_1000FC1C(hDlg); SelYesNo_LoadSelYN_GFX(hWnd);
return 0; return 0;
case 0x111u: case 0x111u:
if ( HIWORD(wParam) == 7 ) if ( HIWORD(wParam) == 7 )
{ {
Focus_100075B7(hDlg, (HWND)lParam); Focus_GetAndBlitSpin(hWnd, lParam);
} }
else if ( HIWORD(wParam) == 6 ) else if ( HIWORD(wParam) == 6 )
{ {
Focus_10007458((void *)lParam); Focus_CheckPlayMove(lParam);
Focus_100075DC(hDlg, (HWND)lParam); Focus_DoBlitSpinIncFrame(hWnd, (HWND)lParam);
} }
else else
{ {
@ -60,7 +58,7 @@ int __stdcall SelYesNo_1000FA87(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lPara
{ {
v8 = GetFocus(); v8 = GetFocus();
v9 = GetWindowLongA(v8, -12); v9 = GetWindowLongA(v8, -12);
v10 = hDlg; v10 = hWnd;
if ( v9 == 1109 ) if ( v9 == 1109 )
v7 = 1; v7 = 1;
else else
@ -74,78 +72,72 @@ int __stdcall SelYesNo_1000FA87(HWND hDlg, UINT Msg, WPARAM wParam, LPARAM lPara
} }
else if ( (_WORD)wParam != 1109 ) else if ( (_WORD)wParam != 1109 )
{ {
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} }
v10 = hDlg; v10 = hWnd;
} }
SelYesNo_1000FCF6((int)v10, v7); SelYesNo_DoSelectYesNo(v10, v7);
} }
break; break;
case 0x113u: case 0x113u:
v4 = GetFocus(); v4 = GetFocus();
if ( !Focus_100075DC(hDlg, v4) ) if ( !Focus_DoBlitSpinIncFrame(hWnd, v4) )
{ {
v5 = GetDlgItem(hDlg, 1109); v5 = GetDlgItem(hWnd, 1109);
if ( !v5 ) if ( !v5 )
v5 = GetDlgItem(hDlg, 2); v5 = GetDlgItem(hWnd, 2);
SetFocus(v5); SetFocus(v5);
} }
return 0; return 0;
} }
} }
return SDlgDefDialogProc(hDlg, Msg, wParam, lParam); return (LRESULT)SDlgDefDialogProc(hWnd, Msg, (HDC)wParam, (HWND)lParam);
} */ }
// 1001037C: using guessed type int __stdcall SDlgDefDialogProc(_DWORD, _DWORD, _DWORD, _DWORD);
// 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow(); // 10010382: using guessed type _DWORD __stdcall SDrawGetFrameWindow();
// ref: 0x1000FBC7 // ref: 0x1000FBC7
HWND UNKCALL SelYesNo_1000FBC7(HWND hDlg) { return 0; } void __fastcall SelYesNo_RemoveYNDialog(HWND hWnd)
/* { {
HWND v1; // esi HWND v1; // esi
_DWORD *v2; // eax void **v2; // eax
HWND result; // eax HWND v3; // eax
HWND v4; // eax
v1 = hDlg; v1 = hWnd;
v2 = (_DWORD *)GetWindowLongA(hDlg, -21); v2 = (void **)GetWindowLongA(hWnd, -21);
local_10007F72(v2); local_FreeMemPtr(v2);
if ( dword_1002A500 ) if ( yesno_remove_focus )
Focus_100076C3(); Focus_DeleteSpinners();
Doom_10006C53(v1, (int *)&unk_100232DC); Doom_DeleteFreeProcs(v1, yesno_msgtbl1);
result = (HWND)Doom_10006C53(v1, (int *)&unk_100232D4); Doom_DeleteFreeProcs(v1, yesno_msgtbl2);
if ( dword_1002A504 ) if ( yesno_hero_name )
{ {
v4 = GetParent(v1); v3 = GetParent(v1);
result = SelHero_1000BA7B(v4, 0); SelHero_SetStringWithMsg(v3, 0);
} }
return result; }
} */ // 1002A500: using guessed type int yesno_remove_focus;
// 1002A500: using guessed type int dword_1002A500;
// 1002A504: using guessed type int dword_1002A504;
// ref: 0x1000FC1C // ref: 0x1000FC1C
void UNKCALL SelYesNo_1000FC1C(HWND hWnd) { return; } void __fastcall SelYesNo_LoadSelYN_GFX(HWND hWnd)
/* { {
HWND v1; // esi
HWND v2; // eax HWND v2; // eax
int v3; // eax DWORD *v3; // eax
int *v4; // edi DWORD *v4; // edi
const char *v5; // eax const char *v5; // eax
const CHAR *v6; // ST18_4 char *v6; // ST18_4
HWND v7; // eax HWND v7; // eax
v1 = hWnd;
v2 = GetParent(hWnd); v2 = GetParent(hWnd);
if ( dword_1002A504 ) if ( yesno_hero_name )
SelHero_1000BA7B(v2, (const char *)dword_1002A504); SelHero_SetStringWithMsg(v2, yesno_hero_name);
v3 = local_10007F46(); v3 = local_AllocWndLongData();
v4 = (int *)v3; v4 = v3;
if ( v3 ) if ( v3 )
{ {
SetWindowLongA(v1, -21, v3); SetWindowLongA(hWnd, -21, (LONG)v3);
if ( dword_1002A50C ) if ( yesno_is_popup )
{ {
if ( DiabloUI_10005C2A() ) if ( DiabloUI_GetSpawned() )
v5 = "ui_art\\swmmpop.pcx"; v5 = "ui_art\\swmmpop.pcx";
else else
v5 = "ui_art\\mmpopup.pcx"; v5 = "ui_art\\mmpopup.pcx";
@ -154,97 +146,81 @@ void UNKCALL SelYesNo_1000FC1C(HWND hWnd) { return; }
{ {
v5 = "ui_art\\black.pcx"; v5 = "ui_art\\black.pcx";
} }
local_10007944((int)v1, 0, "Popup", -1, 1, (int)v5, v4, v4 + 1, 1); local_LoadArtWithPal(hWnd, 0, "Popup", -1, 1, v5, (BYTE **)v4, v4 + 1, 1);
} }
v6 = dword_1002A4F8; v6 = yesno_dialog_string;
v7 = GetDlgItem(v1, 1026); v7 = GetDlgItem(hWnd, 1026);
SetWindowTextA(v7, v6); SetWindowTextA(v7, v6);
Doom_100068AB(v1, (int *)&unk_100232D4, 3); Doom_ParseWndProc3(hWnd, yesno_msgtbl2, 3);
Doom_1000658C(v1, (int *)&unk_100232DC, 4, 1); Doom_ParseWndProcs(hWnd, yesno_msgtbl1, 4, 1);
if ( dword_1002A500 ) if ( yesno_remove_focus )
Focus_10007719("ui_art\\focus.pcx"); Focus_LoadSpinner("ui_art\\focus.pcx");
else else
Focus_100076FA(); Focus_ResetSpinToZero();
SDlgSetTimer(v1, 1, 55, 0); SDlgSetTimer((int)hWnd, 1, 55, 0);
return local_10007DE9(v1, (int *)&unk_100232DC); local_DoUiWndProc2(hWnd, (DWORD *)yesno_msgtbl1);
} */ }
// 10010412: using guessed type int __stdcall SDlgSetTimer(_DWORD, _DWORD, _DWORD, _DWORD); // 1002A500: using guessed type int yesno_remove_focus;
// 1002A500: using guessed type int dword_1002A500; // 1002A50C: using guessed type int yesno_is_popup;
// 1002A504: using guessed type int dword_1002A504;
// 1002A50C: using guessed type int dword_1002A50C;
// ref: 0x1000FCF6 // ref: 0x1000FCF6
int __fastcall SelYesNo_1000FCF6(int a1, LONG a2) { return 0; } void __fastcall SelYesNo_DoSelectYesNo(HWND hWnd, int option)
/* { {
LONG v2; // esi
int v3; // edi
HWND v4; // eax HWND v4; // eax
v2 = a2; TitleSnd_PlaySelectSound();
v3 = a1; SDlgKillTimer((int)hWnd, 1);
TitleSnd_1001031F(); if ( option == 2 )
SDlgKillTimer(v3, 1);
if ( v2 == 2 )
{ {
if ( !dword_1002A508 ) if ( !YesNoFunc )
return SDlgEndDialog(v3, v2); goto LABEL_6;
dword_1002A508(); YesNoFunc();
} }
if ( v2 == 1 ) if ( option == 1 )
{ {
v4 = GetFocus(); v4 = GetFocus();
v2 = GetWindowLongA(v4, -12); option = GetWindowLongA(v4, -12);
} }
return SDlgEndDialog(v3, v2); LABEL_6:
} */ SDlgEndDialog(hWnd, (HANDLE)option);
// 10010376: using guessed type int __stdcall SDlgEndDialog(_DWORD, _DWORD); }
// 10010418: using guessed type int __stdcall SDlgKillTimer(_DWORD, _DWORD); // 1002A508: using guessed type int (*YesNoFunc)(void);
// 1002A508: using guessed type int (*dword_1002A508)(void);
// ref: 0x1000FD39 // ref: 0x1000FD39
int __fastcall SelYesNo_1000FD39(int a1, const CHAR *a2, int a3, int a4) { return 0; } int __fastcall SelYesNo_SelOkDialog(HWND hWnd, char *dialogstr, char *hero, int nofocus)
/* { {
dword_1002A4F8 = a2; yesno_dialog_string = dialogstr;
dword_1002A504 = a3; yesno_hero_name = hero;
dword_1002A500 = a4; yesno_remove_focus = nofocus;
dword_1002A50C = 0; yesno_is_popup = 0;
dword_1002A508 = 0; YesNoFunc = 0;
return SDlgDialogBoxParam(hInstance, "SELOK_DIALOG", a1, SelYesNo_1000FA87, 0); return SDlgDialogBoxParam(ghUiInst, "SELOK_DIALOG", (int)hWnd, SelYesNo_WndProc, 0);
} */ }
// 10010370: using guessed type int __stdcall SDlgDialogBoxParam(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD); // 1002A500: using guessed type int yesno_remove_focus;
// 1002A500: using guessed type int dword_1002A500; // 1002A508: using guessed type int (*YesNoFunc)(void);
// 1002A504: using guessed type int dword_1002A504; // 1002A50C: using guessed type int yesno_is_popup;
// 1002A508: using guessed type int (*dword_1002A508)(void);
// 1002A50C: using guessed type int dword_1002A50C;
// ref: 0x1000FD77 // ref: 0x1000FD77
int __fastcall SelYesNo_1000FD77(int a1, UINT a2, int a3) { return 0; } int __fastcall SelYesNo_SpawnErrDialog(HWND hWnd, int string_rsrc, int is_popup)
/* { {
int v3; // esi char Buffer[256]; // [esp+4h] [ebp-100h]
CHAR Buffer; // [esp+4h] [ebp-100h]
v3 = a1; LoadStringA(ghUiInst, string_rsrc, Buffer, 255);
LoadStringA(hInstance, a2, &Buffer, 255); yesno_is_popup = is_popup;
dword_1002A50C = a3; yesno_remove_focus = 0;
dword_1002A500 = 0; yesno_hero_name = 0;
dword_1002A504 = 0; yesno_dialog_string = Buffer;
dword_1002A4F8 = &Buffer; YesNoFunc = 0;
dword_1002A508 = 0; return SDlgDialogBoxParam(ghUiInst, "SPAWNERR_DIALOG", (int)hWnd, SelYesNo_WndProc, 0);
return SDlgDialogBoxParam(hInstance, "SPAWNERR_DIALOG", v3, SelYesNo_1000FA87, 0); }
} */ // 1002A500: using guessed type int yesno_remove_focus;
// 10010370: using guessed type int __stdcall SDlgDialogBoxParam(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD); // 1002A508: using guessed type int (*YesNoFunc)(void);
// 1002A500: using guessed type int dword_1002A500; // 1002A50C: using guessed type int yesno_is_popup;
// 1002A504: using guessed type int dword_1002A504;
// 1002A508: using guessed type int (*dword_1002A508)(void);
// 1002A50C: using guessed type int dword_1002A50C;
// ref: 0x1000FDE3 // ref: 0x1000FDE3
signed int SelYesNo_1000FDE3() { return 0; } void __cdecl SelYesNo_cpp_init()
/* { {
signed int result; // eax SelYesNo_cpp_float = SelYesNo_cpp_float_value;
}
result = 2139095040; // 1001F478: using guessed type int SelYesNo_cpp_float_value;
dword_1002A4FC = 2139095040; // 1002A4FC: using guessed type int SelYesNo_cpp_float;
return result;
} */
// 1002A4FC: using guessed type int dword_1002A4FC;

18
Source/control.cpp

@ -6,7 +6,7 @@ char sgbNextTalkSave; // weak
char sgbTalkSavePos; // weak char sgbTalkSavePos; // weak
void *pDurIcons; void *pDurIcons;
void *pChrButtons; void *pChrButtons;
int drawhpflag; // idb BOOL drawhpflag; // idb
int dropGoldFlag; // weak int dropGoldFlag; // weak
int panbtn[8]; int panbtn[8];
int chrbtn[4]; int chrbtn[4];
@ -16,7 +16,7 @@ void *pChrPanel;
int lvlbtndown; // weak int lvlbtndown; // weak
char sgszTalkSave[8][80]; char sgszTalkSave[8][80];
int dropGoldValue; // idb int dropGoldValue; // idb
int drawmanaflag; // idb BOOL drawmanaflag; // idb
int chrbtnactive; // weak int chrbtnactive; // weak
char sgszTalkMsg[80]; char sgszTalkMsg[80];
void *pPanelText; void *pPanelText;
@ -143,7 +143,7 @@ const unsigned char fontidx[256] =
/* data */ /* data */
unsigned char SpellITbl[37] = unsigned char SpellITbl[MAX_SPELLS] =
{ {
1, 1, 2, 3, 4, 5, 6, 7, 8, 9, 1, 1, 2, 3, 4, 5, 6, 7, 8, 9,
28, 13, 12, 18, 16, 14, 18, 19, 11, 20, 28, 13, 12, 18, 16, 14, 18, 19, 11, 20,
@ -611,7 +611,7 @@ LABEL_68:
v26 *= (__int64)2; v26 *= (__int64)2;
v23 = v4; v23 = v4;
} }
while ( (signed int)v20 < (signed int)&spelldata[37].sTownSpell ); while ( (signed int)v20 < (signed int)&spelldata[MAX_SPELLS].sTownSpell );
if ( v25 && v17 != 636 ) if ( v25 && v17 != 636 )
v17 -= 56; v17 -= 56;
if ( v17 == 20 ) if ( v17 == 20 )
@ -1218,8 +1218,8 @@ void __cdecl InitControlPan()
pDurIcons = LoadFileInMem("Items\\DurIcons.CEL", 0); pDurIcons = LoadFileInMem("Items\\DurIcons.CEL", 0);
strcpy(infostr, &empty_string); strcpy(infostr, &empty_string);
ClearPanel(); ClearPanel();
drawhpflag = 1; drawhpflag = TRUE;
drawmanaflag = 1; drawmanaflag = TRUE;
chrflag = 0; chrflag = 0;
spselflag = 0; spselflag = 0;
pSpellBkCel = LoadFileInMem("Data\\SpellBk.CEL", 0); pSpellBkCel = LoadFileInMem("Data\\SpellBk.CEL", 0);
@ -1382,7 +1382,7 @@ void __cdecl DoSpeedBook()
++v10; ++v10;
v7 = v4; v7 = v4;
} }
while ( v10 < 37 ); while ( v10 < MAX_SPELLS );
if ( v3 && v13 != 636 ) if ( v3 && v13 != 636 )
v13 -= 56; v13 -= 56;
if ( v13 == 20 ) if ( v13 == 20 )
@ -2748,11 +2748,11 @@ void __cdecl DrawSpellBook()
{ {
v7 = GetSBookTrans(v2, 1u); v7 = GetSBookTrans(v2, 1u);
SetSpellTrans(v7); SetSpellTrans(v7);
DrawSpellCel(395, v8 + 1, (char *)pSBkIconCels, (char)SpellITbl[v2], 37); DrawSpellCel(395, v8 + 1, (char *)pSBkIconCels, (char)SpellITbl[v2], MAX_SPELLS);
if ( v2 == plr[myplr]._pRSpell && v7 == _LOBYTE(plr[myplr]._pRSplType) ) if ( v2 == plr[myplr]._pRSpell && v7 == _LOBYTE(plr[myplr]._pRSplType) )
{ {
SetSpellTrans(0); SetSpellTrans(0);
DrawSpellCel(395, v8 + 1, (char *)pSBkIconCels, 43, 37); DrawSpellCel(395, v8 + 1, (char *)pSBkIconCels, 43, MAX_SPELLS);
} }
PrintSBookStr(10, v8 - 22, 0, spelldata[v2].sNameText, 0); PrintSBookStr(10, v8 - 22, 0, spelldata[v2].sNameText, 0);
v3 = GetSBookTrans(v2, 0); v3 = GetSBookTrans(v2, 0);

6
Source/control.h

@ -6,7 +6,7 @@ extern char sgbNextTalkSave; // weak
extern char sgbTalkSavePos; // weak extern char sgbTalkSavePos; // weak
extern void *pDurIcons; extern void *pDurIcons;
extern void *pChrButtons; extern void *pChrButtons;
extern int drawhpflag; // idb extern BOOL drawhpflag; // idb
extern int dropGoldFlag; // weak extern int dropGoldFlag; // weak
extern int panbtn[8]; extern int panbtn[8];
extern int chrbtn[4]; extern int chrbtn[4];
@ -16,7 +16,7 @@ extern void *pChrPanel;
extern int lvlbtndown; // weak extern int lvlbtndown; // weak
extern char sgszTalkSave[8][80]; extern char sgszTalkSave[8][80];
extern int dropGoldValue; // idb extern int dropGoldValue; // idb
extern int drawmanaflag; // idb extern BOOL drawmanaflag; // idb
extern int chrbtnactive; // weak extern int chrbtnactive; // weak
extern char sgszTalkMsg[80]; extern char sgszTalkMsg[80];
extern void *pPanelText; extern void *pPanelText;
@ -131,7 +131,7 @@ extern const unsigned char fontidx[256];
/* data */ /* data */
extern unsigned char SpellITbl[37]; extern unsigned char SpellITbl[MAX_SPELLS];
extern int PanBtnPos[8][5]; extern int PanBtnPos[8][5];
extern char *PanBtnHotKey[8]; extern char *PanBtnHotKey[8];
extern char *PanBtnStr[8]; extern char *PanBtnStr[8];

2
Source/debug.cpp

@ -105,7 +105,7 @@ void __cdecl MaxSpellsCheat()
{ {
int i; // ebp int i; // ebp
for(i = 1; i < 37; i++) for(i = 1; i < MAX_SPELLS; i++)
{ {
if ( spelldata[i].sBookLvl != -1 ) if ( spelldata[i].sBookLvl != -1 )
{ {

2
Source/init.cpp

@ -280,7 +280,7 @@ void __cdecl init_archives()
#ifdef COPYPROT #ifdef COPYPROT
if ( diabdat_mpq ) if ( diabdat_mpq )
break; break;
UiCopyProtError((int)&v1); UiCopyProtError(&v1);
if ( v1 == COPYPROT_CANCEL ) if ( v1 == COPYPROT_CANCEL )
FileErrDlg("diabdat.mpq"); FileErrDlg("diabdat.mpq");
} }

4
Source/inv.cpp

@ -1861,7 +1861,7 @@ void __fastcall RemoveInvItem(int pnum, int iv)
{ {
if ( plr[pnum]._pRSpell != SPL_INVALID ) if ( plr[pnum]._pRSpell != SPL_INVALID )
{ {
// BUGFIX: Cast the literal `1` to `UINT64` to make that bitshift 64bit // BUGFIX: Cast the literal `1` to `unsigned __int64` to make that bitshift 64bit
// this causes the last 4 skills to not reset correctly after use // this causes the last 4 skills to not reset correctly after use
if ( !( if ( !(
plr[pnum]._pScrlSpells64 plr[pnum]._pScrlSpells64
@ -1885,7 +1885,7 @@ void __fastcall RemoveSpdBarItem(int pnum, int iv)
{ {
if ( plr[pnum]._pRSpell != SPL_INVALID ) if ( plr[pnum]._pRSpell != SPL_INVALID )
{ {
// BUGFIX: Cast the literal `1` to `UINT64` to make that bitshift 64bit // BUGFIX: Cast the literal `1` to `unsigned __int64` to make that bitshift 64bit
// this causes the last 4 skills to not reset correctly after use // this causes the last 4 skills to not reset correctly after use
if ( !( if ( !(
plr[pnum]._pScrlSpells64 plr[pnum]._pScrlSpells64

34
Source/items.cpp

@ -775,7 +775,7 @@ void __fastcall CalcPlrItemVals(int p, BOOL Loadgfx)
int dadd = 0; // added dexterity int dadd = 0; // added dexterity
int vadd = 0; // added vitality int vadd = 0; // added vitality
UINT64 spl = 0; // bitarray for all enabled/active spells unsigned __int64 spl = 0; // bitarray for all enabled/active spells
signed int fr = 0; // fire resistance signed int fr = 0; // fire resistance
signed int lr = 0; // lightning resistance signed int lr = 0; // lightning resistance
@ -938,7 +938,7 @@ void __fastcall CalcPlrItemVals(int p, BOOL Loadgfx)
// check if the current RSplType is a valid/allowed spell // check if the current RSplType is a valid/allowed spell
if ( plr[p]._pRSplType == RSPLTYPE_CHARGES if ( plr[p]._pRSplType == RSPLTYPE_CHARGES
&& !(spl & ((UINT64)1 << (plr[p]._pRSpell - 1))) ) && !(spl & ((unsigned __int64)1 << (plr[p]._pRSpell - 1))) )
{ {
plr[p]._pRSpell = SPL_INVALID; plr[p]._pRSpell = SPL_INVALID;
plr[p]._pRSplType = RSPLTYPE_INVALID; plr[p]._pRSplType = RSPLTYPE_INVALID;
@ -1115,8 +1115,8 @@ void __fastcall CalcPlrItemVals(int p, BOOL Loadgfx)
} }
} }
drawmanaflag = 1; drawmanaflag = TRUE;
drawhpflag = 1; drawhpflag = TRUE;
} }
void __fastcall CalcPlrScrolls(int p) void __fastcall CalcPlrScrolls(int p)
@ -1883,7 +1883,7 @@ void __fastcall GetBookSpell(int i, int lvl)
v3 = i; v3 = i;
if ( !lvl ) if ( !lvl )
v2 = lvl + 1; v2 = lvl + 1;
v4 = random(14, 37) + 1; v4 = random(14, MAX_SPELLS) + 1;
LABEL_13: LABEL_13:
v6 = 1; v6 = 1;
while ( v4 > 0 ) while ( v4 > 0 )
@ -1902,7 +1902,7 @@ LABEL_13:
if ( v6 == SPL_HEALOTHER ) if ( v6 == SPL_HEALOTHER )
v6 = SPL_FLARE; v6 = SPL_FLARE;
} }
if ( v6 == 37 ) if ( v6 == MAX_SPELLS )
goto LABEL_13; goto LABEL_13;
} }
v7 = v3; v7 = v3;
@ -2017,7 +2017,7 @@ void __fastcall GetStaffSpell(int i, int lvl, unsigned char onlygood)
l = lvl >> 1; l = lvl >> 1;
if ( !l ) if ( !l )
l = 1; l = 1;
rv = random(18, 37) + 1; rv = random(18, MAX_SPELLS) + 1;
LABEL_15: LABEL_15:
s = 1; s = 1;
while ( rv > 0 ) while ( rv > 0 )
@ -2035,7 +2035,7 @@ LABEL_15:
if ( s == SPL_HEALOTHER ) if ( s == SPL_HEALOTHER )
s = SPL_FLARE; s = SPL_FLARE;
} }
if ( s == 37 ) if ( s == MAX_SPELLS )
goto LABEL_15; goto LABEL_15;
} }
sprintf(istr, "%s of %s", item[i]._iName, spelldata[bs].sNameText); sprintf(istr, "%s of %s", item[i]._iName, spelldata[bs].sNameText);
@ -2434,14 +2434,14 @@ LABEL_79:
if ( param1 == 5 ) if ( param1 == 5 )
BYTE1(item[v8]._iFlags) |= 0x40u; BYTE1(item[v8]._iFlags) |= 0x40u;
LABEL_92: LABEL_92:
drawmanaflag = 1; drawmanaflag = TRUE;
break; break;
case IPL_STEALLIFE: case IPL_STEALLIFE:
if ( param1 == 3 ) if ( param1 == 3 )
BYTE1(item[v8]._iFlags) |= 0x80u; BYTE1(item[v8]._iFlags) |= 0x80u;
if ( param1 == 5 ) if ( param1 == 5 )
BYTE2(item[v8]._iFlags) |= 1u; BYTE2(item[v8]._iFlags) |= 1u;
drawhpflag = 1; drawhpflag = TRUE;
break; break;
case IPL_TARGAC: case IPL_TARGAC:
v11 = &item[v8]._iPLEnAc; v11 = &item[v8]._iPLEnAc;
@ -4489,7 +4489,7 @@ void __fastcall UseItem(int p, int Mid, int spl)
{ {
plr[p]._pHitPoints = plr[p]._pMaxHP; plr[p]._pHitPoints = plr[p]._pMaxHP;
plr[p]._pHPBase = plr[p]._pMaxHPBase; plr[p]._pHPBase = plr[p]._pMaxHPBase;
drawhpflag = 1; drawhpflag = TRUE;
return; return;
} }
v5 = Mid - 3; v5 = Mid - 3;
@ -4519,7 +4519,7 @@ void __fastcall UseItem(int p, int Mid, int spl)
plr[v9]._pMana = plr[v9]._pMaxMana; plr[v9]._pMana = plr[v9]._pMaxMana;
plr[v9]._pManaBase = plr[v9]._pMaxManaBase; plr[v9]._pManaBase = plr[v9]._pMaxManaBase;
LABEL_41: LABEL_41:
drawmanaflag = 1; drawmanaflag = TRUE;
return; return;
} }
v10 = p; v10 = p;
@ -4567,7 +4567,7 @@ LABEL_71:
*v68 += v65; *v68 += v65;
if ( *v68 > v69 ) if ( *v68 > v69 )
*v68 = v69; *v68 = v69;
drawhpflag = 1; drawhpflag = TRUE;
return; return;
} }
if ( Mid == IMISC_ELIXVIT ) if ( Mid == IMISC_ELIXVIT )
@ -4657,11 +4657,11 @@ LABEL_71:
plr[v40]._pHitPoints = plr[p]._pMaxHP; plr[v40]._pHitPoints = plr[p]._pMaxHP;
plr[v40]._pHPBase = plr[p]._pMaxHPBase; plr[v40]._pHPBase = plr[p]._pMaxHPBase;
v36 = (plr[p]._pIFlags & 0x8000000) == 0; v36 = (plr[p]._pIFlags & 0x8000000) == 0;
drawhpflag = 1; drawhpflag = TRUE;
if ( v36 ) if ( v36 )
{ {
v41 = plr[v40]._pMaxMana; v41 = plr[v40]._pMaxMana;
drawmanaflag = 1; drawmanaflag = TRUE;
plr[v40]._pMana = v41; plr[v40]._pMana = v41;
plr[v40]._pManaBase = plr[v40]._pMaxManaBase; plr[v40]._pManaBase = plr[v40]._pMaxManaBase;
} }
@ -4689,7 +4689,7 @@ LABEL_71:
*v50 = v49; *v50 = v49;
v51 = plr[v42]._pMaxMana >> 8; v51 = plr[v42]._pMaxMana >> 8;
v52 = plr[v42]._pMaxMana >> 8; v52 = plr[v42]._pMaxMana >> 8;
drawhpflag = 1; drawhpflag = TRUE;
v53 = (v51 & 0xFFFFFFFE) + 2 * random(40, v52); v53 = (v51 & 0xFFFFFFFE) + 2 * random(40, v52);
v54 = plr[v42]._pClass; v54 = plr[v42]._pClass;
v55 = 32 * v53; v55 = 32 * v53;
@ -4709,7 +4709,7 @@ LABEL_71:
*v58 += v55; *v58 += v55;
if ( *v58 > v59 ) if ( *v58 > v59 )
*v58 = v59; *v58 = v59;
drawmanaflag = 1; drawmanaflag = TRUE;
} }
} }
} }

12
Source/missiles.cpp

@ -1718,7 +1718,7 @@ LABEL_70:
if ( v27 != 2 ) if ( v27 != 2 )
{ {
LABEL_78: LABEL_78:
drawhpflag = 1; drawhpflag = TRUE;
return 1; return 1;
} }
v28 = PS_MAGE69; v28 = PS_MAGE69;
@ -3563,7 +3563,7 @@ void __fastcall AddFlare(int mi, int sx, int sy, int dx, int dy, int midir, int
{ {
UseMana(id, 35); UseMana(id, 35);
v14 = id; v14 = id;
drawhpflag = 1; drawhpflag = TRUE;
plr[v14]._pHPBase -= 320; plr[v14]._pHPBase -= 320;
plr[v14]._pHitPoints -= 320; plr[v14]._pHitPoints -= 320;
if ( plr[id]._pHitPoints <= 0 ) if ( plr[id]._pHitPoints <= 0 )
@ -3898,7 +3898,7 @@ void __fastcall AddHeal(int mi, int sx, int sy, int dx, int dy, int midir, int m
*v17 = v18; *v17 = v18;
UseMana(id, 2); UseMana(id, 2);
missile[i]._miDelFlag = 1; missile[i]._miDelFlag = 1;
drawhpflag = 1; drawhpflag = TRUE;
} }
void __fastcall AddHealOther(int mi, int sx, int sy, int dx, int dy, int midir, int mienemy, int id, int dam) void __fastcall AddHealOther(int mi, int sx, int sy, int dx, int dy, int midir, int mienemy, int id, int dam)
@ -4452,7 +4452,7 @@ void __fastcall AddBoneSpirit(int mi, int sx, int sy, int dx, int dy, int midir,
{ {
UseMana(id, 36); UseMana(id, 36);
v13 = id; v13 = id;
drawhpflag = 1; drawhpflag = TRUE;
plr[v13]._pHPBase -= 384; plr[v13]._pHPBase -= 384;
plr[v13]._pHitPoints -= 384; plr[v13]._pHitPoints -= 384;
if ( plr[id]._pHitPoints <= 0 ) if ( plr[id]._pHitPoints <= 0 )
@ -5716,8 +5716,8 @@ void __fastcall MI_Manashield(int i)
} }
if ( v10 < 0 ) if ( v10 < 0 )
v10 = 0; v10 = 0;
drawmanaflag = 1; drawmanaflag = TRUE;
drawhpflag = 1; drawhpflag = TRUE;
if ( v8 >= v10 ) if ( v8 >= v10 )
{ {
plr[v2]._pHitPoints = v9; plr[v2]._pHitPoints = v9;

2
Source/msg.cpp

@ -3202,7 +3202,7 @@ int __fastcall On_PLRDAMAGE(struct TCmdDamage *pCmd, int pnum)
v4 = plr[myplr]._pHitPoints; v4 = plr[myplr]._pHitPoints;
if ( (signed int)(v4 & 0xFFFFFFC0) > 0 ) if ( (signed int)(v4 & 0xFFFFFFC0) > 0 )
{ {
drawhpflag = 1; drawhpflag = TRUE;
plr[v3]._pHitPoints = v4 - pCmd->dwDam; plr[v3]._pHitPoints = v4 - pCmd->dwDam;
v5 = &plr[v3]._pHPBase; v5 = &plr[v3]._pHPBase;
*v5 -= pCmd->dwDam; *v5 -= pCmd->dwDam;

16
Source/multi.cpp

@ -826,14 +826,14 @@ int __fastcall NetInit(int bSinglePlayer, int *pfExitProgram)
memset(&UiData, 0, 0x50u); memset(&UiData, 0, 0x50u);
UiData.size = 80; UiData.size = 80;
UiData.parentwindow = SDrawGetFrameWindow(0); UiData.parentwindow = SDrawGetFrameWindow(0);
UiData.artcallback = UiArtCallback; UiData.artcallback = (void (__cdecl *)())UiArtCallback;
UiData.createcallback = UiCreateGameCallback; UiData.createcallback = (void (__cdecl *)())UiCreateGameCallback;
UiData.drawdesccallback = UiDrawDescCallback; UiData.drawdesccallback = (void (__cdecl *)())UiDrawDescCallback;
UiData.messageboxcallback = UiMessageBoxCallback; UiData.messageboxcallback = (void (__cdecl *)())UiMessageBoxCallback;
UiData.soundcallback = UiSoundCallback; UiData.soundcallback = (void (__cdecl *)())UiSoundCallback;
UiData.authcallback = UiAuthCallback; UiData.authcallback = (void (__cdecl *)())UiAuthCallback;
UiData.getdatacallback = UiGetDataCallback; UiData.getdatacallback = (void (__cdecl *)())UiGetDataCallback;
UiData.categorycallback = UiCategoryCallback; UiData.categorycallback = (void (__cdecl *)())UiCategoryCallback;
UiData.selectnamecallback = (void (__cdecl *)())mainmenu_select_hero_dialog; UiData.selectnamecallback = (void (__cdecl *)())mainmenu_select_hero_dialog;
UiData.changenamecallback = (void (__cdecl *)())mainmenu_create_hero; UiData.changenamecallback = (void (__cdecl *)())mainmenu_create_hero;
UiData.profilebitmapcallback = UiProfileDraw; UiData.profilebitmapcallback = UiProfileDraw;

6
Source/objects.cpp

@ -2862,7 +2862,7 @@ void __fastcall Obj_BCrossDamage(int i)
{ {
SyncPlrKill(myplr, 0); SyncPlrKill(myplr, 0);
LABEL_15: LABEL_15:
drawhpflag = 1; drawhpflag = TRUE;
return; return;
} }
v5 = plr[v1]._pClass; v5 = plr[v1]._pClass;
@ -5275,10 +5275,10 @@ LABEL_47:
v57 *= 2; v57 *= 2;
++v59; ++v59;
} }
while ( v59 <= 37 ); while ( v59 <= MAX_SPELLS );
do do
{ {
v60 = random(0, 37); v60 = random(0, MAX_SPELLS);
v7 = v60; v7 = v60;
} }
while ( !(plr[v53]._pMemSpells[1] & ((unsigned __int64)((__int64)1 << v60) >> 32) | plr[v53]._pMemSpells[0] & (unsigned int)((__int64)1 << v60)) ); while ( !(plr[v53]._pMemSpells[1] & ((unsigned __int64)((__int64)1 << v60) >> 32) | plr[v53]._pMemSpells[0] & (unsigned int)((__int64)1 << v60)) );

4
Source/pack.cpp

@ -50,7 +50,7 @@ void __fastcall PackPlayer(PkPlayerStruct *pPack, int pnum, bool manashield)
pPack->pMemSpells = pPlayer->_pMemSpells[0]; pPack->pMemSpells = pPlayer->_pMemSpells[0];
pPack->pMemSpells2 = pPlayer->_pMemSpells[1]; pPack->pMemSpells2 = pPlayer->_pMemSpells[1];
for(i = 0; i < 37; i++) for(i = 0; i < MAX_SPELLS; i++)
pPack->pSplLvl[i] = pPlayer->_pSplLvl[i]; pPack->pSplLvl[i] = pPlayer->_pSplLvl[i];
pki = pPack->InvBody; pki = pPack->InvBody;
@ -199,7 +199,7 @@ void __fastcall UnPackPlayer(PkPlayerStruct *pPack, int pnum, bool killok)
pPlayer->_pMemSpells[0] = pPack->pMemSpells; pPlayer->_pMemSpells[0] = pPack->pMemSpells;
pPlayer->_pMemSpells[1] = pPack->pMemSpells2; pPlayer->_pMemSpells[1] = pPack->pMemSpells2;
for(i = 0; i < 37; i++) for(i = 0; i < MAX_SPELLS; i++)
pPlayer->_pSplLvl[i] = pPack->pSplLvl[i]; pPlayer->_pSplLvl[i] = pPack->pSplLvl[i];
pki = pPack->InvBody; pki = pPack->InvBody;

8
Source/pfile.cpp

@ -288,7 +288,7 @@ char __fastcall game_2_ui_class(PlayerStruct *p)
return result; return result;
} }
bool __stdcall pfile_ui_set_hero_infos(void (__stdcall *ui_add_hero_info)(_uiheroinfo *)) BOOL __stdcall pfile_ui_set_hero_infos(BOOL (__stdcall *ui_add_hero_info)(_uiheroinfo *))
{ {
char *v1; // esi char *v1; // esi
//int v2; // eax //int v2; // eax
@ -507,7 +507,7 @@ bool __fastcall pfile_archive_contains_game(void *hsArchive)
} }
// 679660: using guessed type char gbMaxPlayers; // 679660: using guessed type char gbMaxPlayers;
bool __stdcall pfile_ui_set_class_stats(int player_class_nr, _uidefaultstats *class_stats) BOOL __stdcall pfile_ui_set_class_stats(int player_class_nr, _uidefaultstats *class_stats)
{ {
int v2; // eax int v2; // eax
@ -530,7 +530,7 @@ int __fastcall pfile_get_player_class(int player_class_nr)
return result; return result;
} }
bool __stdcall pfile_ui_save_create(_uiheroinfo *heroinfo) BOOL __stdcall pfile_ui_save_create(_uiheroinfo *heroinfo)
{ {
unsigned int v1; // edi unsigned int v1; // edi
//int v3; // eax //int v3; // eax
@ -609,7 +609,7 @@ LABEL_10:
} }
// 679660: using guessed type char gbMaxPlayers; // 679660: using guessed type char gbMaxPlayers;
bool __stdcall pfile_delete_save(_uiheroinfo *hero_info) BOOL __stdcall pfile_delete_save(_uiheroinfo *hero_info)
{ {
unsigned int v1; // eax unsigned int v1; // eax
char FileName[260]; // [esp+0h] [ebp-104h] char FileName[260]; // [esp+0h] [ebp-104h]

8
Source/pfile.h

@ -21,17 +21,17 @@ int __fastcall pfile_create_save_file(char *name_1, char *name_2);
void __cdecl pfile_flush_W(); void __cdecl pfile_flush_W();
void __fastcall game_2_ui_player(PlayerStruct *p, _uiheroinfo *heroinfo, bool bHasSaveFile); void __fastcall game_2_ui_player(PlayerStruct *p, _uiheroinfo *heroinfo, bool bHasSaveFile);
char __fastcall game_2_ui_class(PlayerStruct *p); char __fastcall game_2_ui_class(PlayerStruct *p);
bool __stdcall pfile_ui_set_hero_infos(void (__stdcall *ui_add_hero_info)(_uiheroinfo *)); BOOL __stdcall pfile_ui_set_hero_infos(BOOL (__stdcall *ui_add_hero_info)(_uiheroinfo *));
char *__fastcall GetSaveDirectory(char *dst, int dst_size, int save_num); char *__fastcall GetSaveDirectory(char *dst, int dst_size, int save_num);
bool __fastcall pfile_read_hero(void *archive, PkPlayerStruct *pPack); bool __fastcall pfile_read_hero(void *archive, PkPlayerStruct *pPack);
void *__fastcall pfile_open_save_archive(int *unused, int save_num); void *__fastcall pfile_open_save_archive(int *unused, int save_num);
void __fastcall pfile_SFileCloseArchive(void *hsArchive); void __fastcall pfile_SFileCloseArchive(void *hsArchive);
bool __fastcall pfile_archive_contains_game(void *hsArchive); bool __fastcall pfile_archive_contains_game(void *hsArchive);
bool __stdcall pfile_ui_set_class_stats(int player_class_nr, _uidefaultstats *class_stats); BOOL __stdcall pfile_ui_set_class_stats(int player_class_nr, _uidefaultstats *class_stats);
int __fastcall pfile_get_player_class(int player_class_nr); int __fastcall pfile_get_player_class(int player_class_nr);
bool __stdcall pfile_ui_save_create(_uiheroinfo *heroinfo); BOOL __stdcall pfile_ui_save_create(_uiheroinfo *heroinfo);
bool __stdcall pfile_get_file_name(int lvl, char *dst); bool __stdcall pfile_get_file_name(int lvl, char *dst);
bool __stdcall pfile_delete_save(_uiheroinfo *hero_info); BOOL __stdcall pfile_delete_save(_uiheroinfo *hero_info);
void __cdecl pfile_read_player_from_save(); void __cdecl pfile_read_player_from_save();
void __fastcall GetTempLevelNames(char *szTemp); void __fastcall GetTempLevelNames(char *szTemp);
void __fastcall GetPermLevelNames(char *szPerm); void __fastcall GetPermLevelNames(char *szPerm);

573
Source/player.cpp

@ -711,7 +711,7 @@ void __fastcall NextPlrLevel(int pnum)
plr[pnum]._pHPBase = plr[pnum]._pMaxHPBase; plr[pnum]._pHPBase = plr[pnum]._pMaxHPBase;
if ( pnum == myplr ) { if ( pnum == myplr ) {
drawhpflag = 1; drawhpflag = TRUE;
} }
int mana = c != PC_WARRIOR ? 128 : 64; int mana = c != PC_WARRIOR ? 128 : 64;
@ -727,7 +727,7 @@ void __fastcall NextPlrLevel(int pnum)
} }
if ( pnum == myplr ) { if ( pnum == myplr ) {
drawmanaflag = 1; drawmanaflag = TRUE;
} }
} }
// 679660: using guessed type char gbMaxPlayers; // 679660: using guessed type char gbMaxPlayers;
@ -1489,7 +1489,7 @@ void __fastcall StartPlrBlock(int pnum, int dir)
void __fastcall StartSpell(int pnum, int d, int cx, int cy) void __fastcall StartSpell(int pnum, int d, int cx, int cy)
{ {
if ( (unsigned int)pnum >= MAX_PLRS ) if ( (DWORD)pnum >= MAX_PLRS )
TermMsg("StartSpell: illegal player %d", pnum); TermMsg("StartSpell: illegal player %d", pnum);
if ( plr[pnum]._pInvincible && !plr[pnum]._pHitPoints && pnum == myplr ) { if ( plr[pnum]._pInvincible && !plr[pnum]._pHitPoints && pnum == myplr ) {
@ -1632,7 +1632,7 @@ void __fastcall StartPlrHit(int pnum, int dam, BOOL forcehit)
PlaySfxLoc(PS_MAGE69, plr[pnum].WorldX, plr[pnum].WorldY); PlaySfxLoc(PS_MAGE69, plr[pnum].WorldX, plr[pnum].WorldY);
} }
drawhpflag = 1; drawhpflag = TRUE;
if ( dam >> 6 >= plr[pnum]._pLevel || forcehit ) { if ( dam >> 6 >= plr[pnum]._pLevel || forcehit ) {
int dir = plr[pnum]._pdir; int dir = plr[pnum]._pdir;
@ -1739,7 +1739,7 @@ void __fastcall StartPlayerKill(int pnum, int earflag)
SetPlayerOld(pnum); SetPlayerOld(pnum);
if ( pnum == myplr ) { if ( pnum == myplr ) {
drawhpflag = 1; drawhpflag = TRUE;
deathdelay = 30; deathdelay = 30;
if ( pcurs >= CURSOR_FIRSTITEM ) { if ( pcurs >= CURSOR_FIRSTITEM ) {
@ -2366,7 +2366,7 @@ BOOL __fastcall PM_DoWalk3(int pnum)
if ( plr[pnum]._pVar8 == vel ) { if ( plr[pnum]._pVar8 == vel ) {
dPlayer[plr[pnum].WorldX][plr[pnum].WorldY] = 0; dPlayer[plr[pnum].WorldX][plr[pnum].WorldY] = 0;
dFlags[plr[pnum]._pVar4][plr[pnum]._pVar5] &= 0xDFu; dFlags[plr[pnum]._pVar4][plr[pnum]._pVar5] &= 0xDF;
plr[pnum].WorldX = plr[pnum]._pVar1; plr[pnum].WorldX = plr[pnum]._pVar1;
plr[pnum].WorldY = plr[pnum]._pVar2; plr[pnum].WorldY = plr[pnum]._pVar2;
dPlayer[plr[pnum]._pVar1][plr[pnum]._pVar2] = pnum + 1; dPlayer[plr[pnum]._pVar1][plr[pnum]._pVar2] = pnum + 1;
@ -2421,7 +2421,7 @@ BOOL __fastcall WeaponDur(int pnum, int durrnd)
} }
plr[pnum].InvBody[INVLOC_HAND_LEFT]._iDurability--; plr[pnum].InvBody[INVLOC_HAND_LEFT]._iDurability--;
if ( plr[pnum].InvBody[INVLOC_HAND_LEFT]._iDurability != 0) { if ( plr[pnum].InvBody[INVLOC_HAND_LEFT]._iDurability == 0) {
NetSendCmdDelItem(TRUE, INVLOC_HAND_LEFT); NetSendCmdDelItem(TRUE, INVLOC_HAND_LEFT);
plr[pnum].InvBody[INVLOC_HAND_LEFT]._itype = ITYPE_NONE; plr[pnum].InvBody[INVLOC_HAND_LEFT]._itype = ITYPE_NONE;
CalcPlrInv(pnum, TRUE); CalcPlrInv(pnum, TRUE);
@ -2435,7 +2435,7 @@ BOOL __fastcall WeaponDur(int pnum, int durrnd)
} }
plr[pnum].InvBody[INVLOC_HAND_RIGHT]._iDurability--; plr[pnum].InvBody[INVLOC_HAND_RIGHT]._iDurability--;
if ( plr[pnum].InvBody[INVLOC_HAND_RIGHT]._iDurability != 0 ) { if ( plr[pnum].InvBody[INVLOC_HAND_RIGHT]._iDurability == 0 ) {
NetSendCmdDelItem(TRUE, INVLOC_HAND_RIGHT); NetSendCmdDelItem(TRUE, INVLOC_HAND_RIGHT);
plr[pnum].InvBody[INVLOC_HAND_RIGHT]._itype = ITYPE_NONE; plr[pnum].InvBody[INVLOC_HAND_RIGHT]._itype = ITYPE_NONE;
CalcPlrInv(pnum, TRUE); CalcPlrInv(pnum, TRUE);
@ -2449,7 +2449,7 @@ BOOL __fastcall WeaponDur(int pnum, int durrnd)
} }
plr[pnum].InvBody[INVLOC_HAND_RIGHT]._iDurability--; plr[pnum].InvBody[INVLOC_HAND_RIGHT]._iDurability--;
if ( plr[pnum].InvBody[INVLOC_HAND_RIGHT]._iDurability != 0 ) { if ( plr[pnum].InvBody[INVLOC_HAND_RIGHT]._iDurability == 0 ) {
NetSendCmdDelItem(TRUE, INVLOC_HAND_RIGHT); NetSendCmdDelItem(TRUE, INVLOC_HAND_RIGHT);
plr[pnum].InvBody[INVLOC_HAND_RIGHT]._itype = ITYPE_NONE; plr[pnum].InvBody[INVLOC_HAND_RIGHT]._itype = ITYPE_NONE;
CalcPlrInv(pnum, TRUE); CalcPlrInv(pnum, TRUE);
@ -2458,14 +2458,16 @@ BOOL __fastcall WeaponDur(int pnum, int durrnd)
} }
if ( plr[pnum].InvBody[INVLOC_HAND_RIGHT]._itype == ITYPE_NONE && plr[pnum].InvBody[INVLOC_HAND_LEFT]._itype == ITYPE_SHIELD ) { if ( plr[pnum].InvBody[INVLOC_HAND_RIGHT]._itype == ITYPE_NONE && plr[pnum].InvBody[INVLOC_HAND_LEFT]._itype == ITYPE_SHIELD ) {
if ( plr[pnum].InvBody[INVLOC_HAND_LEFT]._iDurability != 255 ) { if ( plr[pnum].InvBody[INVLOC_HAND_LEFT]._iDurability == 255 ) {
plr[pnum].InvBody[INVLOC_HAND_LEFT]._iDurability--; return FALSE;
if ( plr[pnum].InvBody[INVLOC_HAND_LEFT]._iDurability != 0 ) { }
NetSendCmdDelItem(TRUE, INVLOC_HAND_LEFT);
plr[pnum].InvBody[INVLOC_HAND_LEFT]._itype = ITYPE_NONE; plr[pnum].InvBody[INVLOC_HAND_LEFT]._iDurability--;
CalcPlrInv(pnum, TRUE); if ( plr[pnum].InvBody[INVLOC_HAND_LEFT]._iDurability == 0 ) {
return TRUE; NetSendCmdDelItem(TRUE, INVLOC_HAND_LEFT);
} plr[pnum].InvBody[INVLOC_HAND_LEFT]._itype = ITYPE_NONE;
CalcPlrInv(pnum, TRUE);
return TRUE;
} }
} }
@ -2623,7 +2625,7 @@ LABEL_40:
if ( plr[v9]._pHPBase > v30 ) if ( plr[v9]._pHPBase > v30 )
*v31 = v30; *v31 = v30;
v5 = v43; v5 = v43;
drawhpflag = 1; drawhpflag = TRUE;
} }
else else
{ {
@ -2649,7 +2651,7 @@ LABEL_40:
*v36 = v35; *v36 = v35;
v5 = v43; v5 = v43;
v32 = v46; v32 = v46;
drawmanaflag = 1; drawmanaflag = TRUE;
} }
if ( v32 & 0x18000 ) if ( v32 & 0x18000 )
{ {
@ -2669,7 +2671,7 @@ LABEL_40:
*v39 = v40; *v39 = v40;
BYTE1(v32) = BYTE1(v46); BYTE1(v32) = BYTE1(v46);
v5 = v43; v5 = v43;
drawhpflag = 1; drawhpflag = TRUE;
} }
if ( v32 & 0x100 ) if ( v32 & 0x100 )
*(int *)((char *)&monster[0]._mFlags + v5) |= 8u; *(int *)((char *)&monster[0]._mFlags + v5) |= 8u;
@ -2781,7 +2783,7 @@ BOOL __fastcall PlrHitPlr(int pnum, char p)
if ( plr[pnum]._pHPBase > plr[pnum]._pMaxHPBase ) { if ( plr[pnum]._pHPBase > plr[pnum]._pMaxHPBase ) {
plr[pnum]._pHPBase = plr[pnum]._pMaxHPBase; plr[pnum]._pHPBase = plr[pnum]._pMaxHPBase;
} }
drawhpflag = 1; drawhpflag = TRUE;
} }
if ( pnum == myplr ) { if ( pnum == myplr ) {
NetSendCmdDamage(TRUE, p, skdam); NetSendCmdDamage(TRUE, p, skdam);
@ -2813,7 +2815,7 @@ BOOL __fastcall PlrHitObj(int pnum, int mx, int my)
return FALSE; return FALSE;
} }
int __fastcall PM_DoAttack(int pnum) BOOL __fastcall PM_DoAttack(int pnum)
{ {
int v1; // esi int v1; // esi
int v2; // esi int v2; // esi
@ -3062,7 +3064,7 @@ BOOL __fastcall PM_DoSpell(int pnum)
if ( !plr[pnum]._pSplFrom ) { if ( !plr[pnum]._pSplFrom ) {
if ( plr[pnum]._pRSplType == RSPLTYPE_SCROLL) { if ( plr[pnum]._pRSplType == RSPLTYPE_SCROLL) {
if ( !(plr[pnum]._pScrlSpells64 if ( !(plr[pnum]._pScrlSpells64
& (UINT64)1 << (plr[pnum]._pRSpell - 1)) & (unsigned __int64)1 << (plr[pnum]._pRSpell - 1))
) { ) {
plr[pnum]._pRSpell = SPL_INVALID; plr[pnum]._pRSpell = SPL_INVALID;
plr[pnum]._pRSplType = RSPLTYPE_INVALID; plr[pnum]._pRSplType = RSPLTYPE_INVALID;
@ -3072,7 +3074,7 @@ BOOL __fastcall PM_DoSpell(int pnum)
if ( plr[pnum]._pRSplType == RSPLTYPE_CHARGES) { if ( plr[pnum]._pRSplType == RSPLTYPE_CHARGES) {
if ( !(plr[pnum]._pISpells64 if ( !(plr[pnum]._pISpells64
& (UINT64)1 << (plr[pnum]._pRSpell - 1)) & (unsigned __int64)1 << (plr[pnum]._pRSpell - 1))
) { ) {
plr[pnum]._pRSpell = SPL_INVALID; plr[pnum]._pRSpell = SPL_INVALID;
plr[pnum]._pRSplType = RSPLTYPE_INVALID; plr[pnum]._pRSplType = RSPLTYPE_INVALID;
@ -3101,7 +3103,7 @@ BOOL __fastcall PM_DoSpell(int pnum)
// 52571C: using guessed type int drawpanflag; // 52571C: using guessed type int drawpanflag;
// 5BB1ED: using guessed type char leveltype; // 5BB1ED: using guessed type char leveltype;
int __fastcall PM_DoGotHit(int pnum) BOOL __fastcall PM_DoGotHit(int pnum)
{ {
int v1; // esi int v1; // esi
int v2; // eax int v2; // eax
@ -3188,7 +3190,7 @@ LABEL_23:
} }
} }
int __fastcall PM_DoDeath(int pnum) BOOL __fastcall PM_DoDeath(int pnum)
{ {
int v1; // edi int v1; // edi
int v2; // esi int v2; // esi
@ -3765,210 +3767,149 @@ BOOL __fastcall PlrDeathModeOK(int pnum)
void __cdecl ValidatePlayer() void __cdecl ValidatePlayer()
{ {
int v0; // edi __int64 msk = 0;
int v1; // esi
char *v2; // eax
int v3; // ecx
int v4; // ecx
int *v5; // eax
int v6; // eax
int v7; // edx
int v8; // edx
int v9; // edx
int v10; // eax
int *v11; // ebx
signed int v12; // edi
char *v13; // eax
__int64 v14; // [esp+Ch] [ebp-8h]
v0 = 0; if ( (DWORD)myplr >= MAX_PLRS ) {
v14 = (__int64)0;
if ( (unsigned int)myplr >= 4 )
TermMsg("ValidatePlayer: illegal player %d", myplr); TermMsg("ValidatePlayer: illegal player %d", myplr);
v1 = myplr; }
v2 = &plr[myplr]._pLevel; if ( plr[myplr]._pLevel > 50 )
if ( *v2 > 50 ) plr[myplr]._pLevel = 50;
*v2 = 50; if ( plr[myplr]._pExperience > plr[myplr]._pNextExper )
v3 = plr[v1]._pNextExper; plr[myplr]._pExperience = plr[myplr]._pNextExper;
if ( plr[v1]._pExperience > v3 )
plr[v1]._pExperience = v3; int gt = 0;
v4 = 0; for ( int i = 0; i < plr[myplr]._pNumInv; i++ ) {
if ( plr[v1]._pNumInv > 0 ) if ( plr[myplr].InvList[i]._itype == ITYPE_GOLD ) {
{ if ( plr[myplr].InvList[i]._ivalue > 5000 ) {
v5 = &plr[v1].InvList[0]._ivalue; plr[myplr].InvList[i]._ivalue = 5000;
do
{
if ( *(v5 - 47) == 11 )
{
if ( *v5 > 5000 )
*v5 = 5000;
v4 += *v5;
} }
++v0; gt += plr[myplr].InvList[i]._ivalue;
v5 += 92;
} }
while ( v0 < plr[v1]._pNumInv ); }
} if ( gt != plr[myplr]._pGold )
if ( v4 != plr[v1]._pGold ) plr[myplr]._pGold = gt;
plr[v1]._pGold = v4;
v6 = SLOBYTE(plr[v1]._pClass); int pc = plr[myplr]._pClass;
v7 = MaxStats[v6][0]; if ( plr[myplr]._pBaseStr > MaxStats[pc][ATTRIB_STR] ) {
if ( plr[v1]._pBaseStr > v7 ) plr[myplr]._pBaseStr = MaxStats[pc][ATTRIB_STR];
plr[v1]._pBaseStr = v7; }
v8 = MaxStats[v6][1]; if ( plr[myplr]._pBaseMag > MaxStats[pc][ATTRIB_MAG] ) {
if ( plr[v1]._pBaseMag > v8 ) plr[myplr]._pBaseMag = MaxStats[pc][ATTRIB_MAG];
plr[v1]._pBaseMag = v8; }
v9 = MaxStats[v6][2]; if ( plr[myplr]._pBaseDex > MaxStats[pc][ATTRIB_DEX] ) {
if ( plr[v1]._pBaseDex > v9 ) plr[myplr]._pBaseDex = MaxStats[pc][ATTRIB_DEX];
plr[v1]._pBaseDex = v9; }
v10 = MaxStats[v6][3]; if ( plr[myplr]._pBaseVit > MaxStats[pc][ATTRIB_VIT] ) {
if ( plr[v1]._pBaseVit > v10 ) plr[myplr]._pBaseVit = MaxStats[pc][ATTRIB_VIT];
plr[v1]._pBaseVit = v10; }
v11 = &spelldata[1].sBookLvl;
v12 = 1; for ( int b = 1; b < MAX_SPELLS; b++) {
do if ( spelldata[b].sBookLvl != -1 ) {
{ msk |= (__int64)1 << (b - 1);
if ( *v11 != -1 ) if ( plr[myplr]._pSplLvl[b] > 15 )
{ plr[myplr]._pSplLvl[b] = 15;
v14 |= (__int64)1 << ((unsigned char)v12 - 1);
v13 = &plr[v1]._pSplLvl[v12];
if ( *v13 > 15 )
*v13 = 15;
} }
v11 += 14;
++v12;
} }
while ( (signed int)v11 < (signed int)&spelldata[37].sBookLvl );
*(_QWORD *)plr[v1]._pMemSpells &= v14; plr[myplr]._pMemSpells64 &= msk;
} }
void __cdecl ProcessPlayers() void __cdecl ProcessPlayers()
{ {
int v0; // eax if ( (DWORD)myplr >= MAX_PLRS ) {
int v1; // eax
unsigned char *v2; // ecx
char v3; // al
int v4; // ebp
int *v5; // esi
int v6; // eax
//int v7; // eax
int v8; // eax
int v9; // eax
int v10; // eax
int v11; // edi
int v12; // eax
char *v13; // eax
char *v14; // eax
v0 = myplr;
if ( (unsigned int)myplr >= 4 )
{
TermMsg("ProcessPlayers: illegal player %d", myplr); TermMsg("ProcessPlayers: illegal player %d", myplr);
v0 = myplr;
} }
v1 = v0;
v2 = &plr[v1].pLvlLoad; if ( plr[myplr].pLvlLoad ) {
v3 = plr[v1].pLvlLoad; plr[myplr].pLvlLoad--;
if ( v3 ) }
*v2 = v3 - 1;
v4 = 0; if ( sfxdelay > 0 ) {
if ( sfxdelay > 0 && !--sfxdelay ) sfxdelay--;
PlaySFX(sfxdnum); if ( sfxdelay == 0 ) {
PlaySFX(sfxdnum);
}
}
ValidatePlayer(); ValidatePlayer();
v5 = &plr[0]._pHitPoints;
do for ( int pnum = 0; pnum < MAX_PLRS; pnum++ ) {
{ if ( plr[pnum].plractive && currlevel == plr[pnum].plrlevel && (pnum == myplr || !plr[pnum]._pLvlChanging) ) {
v6 = (int)(v5 - 89); CheckCheatStats(pnum);
if ( *((_BYTE *)v5 - 379) && currlevel == *(_DWORD *)v6 && (v4 == myplr || !*(_BYTE *)(v6 + 267)) )
{ if ( !PlrDeathModeOK(pnum) && (plr[pnum]._pHitPoints >> 6) <= 0 ) {
CheckCheatStats(v4); SyncPlrKill(pnum, -1);
//_LOBYTE(v7) = PlrDeathModeOK(v4); }
if ( !PlrDeathModeOK(v4) && (signed int)(*v5 & 0xFFFFFFC0) <= 0 )
SyncPlrKill(v4, -1); if ( pnum == myplr ) {
if ( v4 == myplr ) if ( plr[pnum]._pIFlags & ISPL_DRAINLIFE ) {
{ plr[pnum]._pHitPoints -= 4;
if ( v5[5294] & 0x40 && currlevel ) plr[pnum]._pHPBase -= 4;
{ if ( (plr[pnum]._pHitPoints >> 6) <= 0 ) {
*v5 -= 4; SyncPlrKill(pnum, 0);
v8 = *v5;
*(v5 - 2) -= 4;
if ( (signed int)(v8 & 0xFFFFFFC0) <= 0 )
SyncPlrKill(v4, 0);
drawhpflag = 1;
}
if ( *((_BYTE *)v5 + 21179) & 8 )
{
v9 = v5[3];
if ( v9 > 0 )
{
v10 = v9 - v5[5];
v5[5] = 0;
drawmanaflag = 1;
v5[3] = v10;
} }
drawhpflag = TRUE;
}
if ( plr[pnum]._pIFlags & ISPL_NOMANA && plr[pnum]._pManaBase > 0 ) {
plr[pnum]._pManaBase -= plr[pnum]._pMana;
plr[pnum]._pMana = 0;
drawmanaflag = TRUE;
} }
} }
v11 = 0;
do BOOL tplayer = FALSE;
{ do {
switch ( *(v5 - 102) ) switch ( plr[pnum]._pmode )
{ {
case PM_STAND: case PM_STAND:
v12 = PM_DoStand(v4); tplayer = PM_DoStand(pnum);
goto LABEL_38; break;
case PM_WALK: case PM_WALK:
v12 = PM_DoWalk(v4); tplayer = PM_DoWalk(pnum);
goto LABEL_38; break;
case PM_WALK2: case PM_WALK2:
v12 = PM_DoWalk2(v4); tplayer = PM_DoWalk2(pnum);
goto LABEL_38; break;
case PM_WALK3: case PM_WALK3:
v12 = PM_DoWalk3(v4); tplayer = PM_DoWalk3(pnum);
goto LABEL_38; break;
case PM_ATTACK: case PM_ATTACK:
v12 = PM_DoAttack(v4); tplayer = PM_DoAttack(pnum);
goto LABEL_38; break;
case PM_RATTACK: case PM_RATTACK:
v12 = PM_DoRangeAttack(v4); tplayer = PM_DoRangeAttack(pnum);
goto LABEL_38; break;
case PM_BLOCK: case PM_BLOCK:
v12 = PM_DoBlock(v4); tplayer = PM_DoBlock(pnum);
goto LABEL_38; break;
case PM_GOTHIT: case PM_GOTHIT:
v12 = PM_DoGotHit(v4); tplayer = PM_DoGotHit(pnum);
goto LABEL_38; break;
case PM_DEATH: case PM_DEATH:
v12 = PM_DoDeath(v4); tplayer = PM_DoDeath(pnum);
goto LABEL_38; break;
case PM_SPELL: case PM_SPELL:
v12 = PM_DoSpell(v4); tplayer = PM_DoSpell(pnum);
goto LABEL_38; break;
case PM_NEWLVL: case PM_NEWLVL:
v12 = PM_DoStand(v4); tplayer = PM_DoStand(pnum);
LABEL_38:
v11 = v12;
break; break;
default: default:
break; break;
} }
CheckNewPath(v4); CheckNewPath(pnum);
} } while ( tplayer );
while ( v11 );
v13 = (char *)(v5 - 69); plr[pnum]._pAnimCnt++;
++*(_DWORD *)v13; if ( plr[pnum]._pAnimDelay < plr[pnum]._pAnimCnt ) {
if ( *(v5 - 69) > *(v5 - 70) ) plr[pnum]._pAnimCnt = 0;
{ plr[pnum]._pAnimFrame++;
*(_DWORD *)v13 = 0; if ( plr[pnum]._pAnimLen < plr[pnum]._pAnimFrame ) {
v14 = (char *)(v5 - 67); plr[pnum]._pAnimFrame = 1;
++*(_DWORD *)v14; }
if ( *(v5 - 67) > *(v5 - 68) )
*(_DWORD *)v14 = 1;
} }
} }
v5 += 5430;
++v4;
} }
while ( (signed int)v5 < (signed int)&plr[MAX_PLRS]._pHitPoints );
} }
// 52A554: using guessed type int sfxdelay; // 52A554: using guessed type int sfxdelay;
@ -4318,84 +4259,52 @@ LABEL_19:
void __fastcall SyncInitPlrPos(int pnum) void __fastcall SyncInitPlrPos(int pnum)
{ {
int v1; // esi plr[pnum]._ptargx = plr[pnum].WorldX;
bool v2; // zf plr[pnum]._ptargy = plr[pnum].WorldY;
unsigned int v3; // eax
int v4; // ebx
int v5; // edi
int v6; // eax
signed int v7; // [esp+Ch] [ebp-18h]
int p; // [esp+10h] [ebp-14h]
int v9; // [esp+14h] [ebp-10h]
signed int v10; // [esp+18h] [ebp-Ch]
signed int v11; // [esp+1Ch] [ebp-8h]
unsigned int i; // [esp+20h] [ebp-4h]
signed int v13; // [esp+20h] [ebp-4h]
p = pnum; if ( gbMaxPlayers == 1 || plr[pnum].plrlevel != currlevel ) {
v1 = pnum; return;
v2 = gbMaxPlayers == 1; }
plr[v1]._ptargx = plr[pnum].WorldX;
plr[v1]._ptargy = plr[pnum].WorldY; int x;
if ( !v2 && plr[v1].plrlevel == currlevel ) int y;
{ for ( DWORD i = 0; i < 8; i++ ) {
v3 = 0; x = plr[pnum].WorldX + plrxoff2[i];
for ( i = 0; ; v3 = i ) y = plr[pnum].WorldY + plryoff2[i];
{ if ( PosOkPlayer(pnum, x, y) ) {
v4 = plr[v1].WorldX + *(int *)((char *)plrxoff2 + v3); break;
v5 = plr[v1].WorldY + *(int *)((char *)plryoff2 + v3);
if ( PosOkPlayer(p, v4, v5) )
break;
i += 4;
if ( i >= 0x20 )
break;
} }
if ( !PosOkPlayer(p, v4, v5) ) }
{
v11 = 0; if ( !PosOkPlayer(pnum, x, y) ) {
v6 = -1; BOOL posOk = FALSE;
v13 = 1; int xx;
v7 = -1; int yy;
do for ( int range = 1; range < 50 && !posOk; range++ ) {
{ for ( yy = -range; yy <= range && !posOk; yy++ ) {
if ( v11 ) y = yy + plr[pnum].WorldY;
break; for ( xx = -range; xx <= range && !posOk; xx++ ) {
v9 = v6; x = xx + plr[pnum].WorldX;
while ( v6 <= v13 && !v11 ) if ( PosOkPlayer(pnum, x, y) && !PosOkPortal(currlevel, x, y) ) {
{ posOk = TRUE;
v5 = v9 + plr[v1].WorldY;
v10 = v7;
do
{
if ( v11 )
break;
v4 = v10 + plr[v1].WorldX;
if ( PosOkPlayer(p, v10 + plr[v1].WorldX, v5) && !PosOkPortal(currlevel, v4, v5) )
v11 = 1;
++v10;
} }
while ( v10 <= v13 );
v6 = ++v9;
} }
++v13;
v6 = v7-- - 1;
} }
while ( v7 > -50 );
}
plr[v1].WorldX = v4;
v2 = p == myplr;
plr[v1].WorldY = v5;
dPlayer[v4][v5] = p + 1;
if ( v2 )
{
plr[v1]._px = v4;
plr[v1]._py = v5;
plr[v1]._ptargx = v4;
plr[v1]._ptargy = v5;
ViewX = v4;
ViewY = v5;
} }
} }
plr[pnum].WorldX = x;
plr[pnum].WorldY = y;
dPlayer[x][y] = pnum + 1;
if ( pnum == myplr ) {
plr[pnum]._px = x;
plr[pnum]._py = y;
plr[pnum]._ptargx = x;
plr[pnum]._ptargy = y;
ViewX = x;
ViewY = y;
}
} }
// 679660: using guessed type char gbMaxPlayers; // 679660: using guessed type char gbMaxPlayers;
@ -4519,86 +4428,62 @@ void __fastcall CheckStats(int pnum)
void __fastcall ModifyPlrStr(int pnum, int l) void __fastcall ModifyPlrStr(int pnum, int l)
{ {
int v2; // esi if ( (DWORD)pnum >= MAX_PLRS ) {
int v3; // edi
int v4; // esi
char v5; // dl
int v6; // ecx
int v7; // eax
int v8; // ebx
int v9; // eax
signed int v10; // ecx
int p; // [esp+8h] [ebp-4h]
v2 = pnum;
v3 = l;
p = pnum;
if ( (unsigned int)pnum >= MAX_PLRS )
TermMsg("ModifyPlrStr: illegal player %d", pnum); TermMsg("ModifyPlrStr: illegal player %d", pnum);
v4 = v2;
v5 = plr[v4]._pClass;
v6 = plr[v4]._pBaseStr;
v7 = MaxStats[v5][0];
if ( v6 + v3 > v7 )
v3 = v7 - v6;
plr[v4]._pBaseStr = v3 + v6;
plr[v4]._pStrength += v3;
v8 = plr[v4]._pStrength;
if ( v5 == 1 )
{
v9 = plr[v4]._pLevel * (v8 + plr[v4]._pDexterity);
v10 = 200;
} }
else
{ int max = MaxStats[plr[pnum]._pClass][ATTRIB_STR];
v9 = v8 * plr[v4]._pLevel; if ( plr[pnum]._pBaseStr + l > max ) {
v10 = 100; l = max - plr[pnum]._pBaseStr;
}
plr[pnum]._pStrength += l;
plr[pnum]._pBaseStr += l;
if ( plr[pnum]._pClass == PC_ROGUE ) {
plr[pnum]._pDamageMod = plr[pnum]._pLevel * (plr[pnum]._pStrength + plr[pnum]._pDexterity) / 200;
} else {
plr[pnum]._pDamageMod = plr[pnum]._pLevel * plr[pnum]._pStrength / 100;
}
CalcPlrInv(pnum, TRUE);
if ( pnum == myplr ) {
NetSendCmdParam1(FALSE, CMD_SETSTR, plr[pnum]._pBaseStr); //60
} }
plr[v4]._pDamageMod = v9 / v10;
CalcPlrInv(p, 1u);
if ( p == myplr )
NetSendCmdParam1(0, CMD_SETSTR, plr[v4]._pBaseStr);
} }
void __fastcall ModifyPlrMag(int pnum, int l) void __fastcall ModifyPlrMag(int pnum, int l)
{ {
int v2; // esi if ( (DWORD)pnum >= MAX_PLRS ) {
int v3; // edi
int v4; // esi
char v5; // dl
int v6; // ecx
int v7; // eax
int v8; // eax
int v9; // edi
int p; // [esp+8h] [ebp-4h]
v2 = pnum;
v3 = l;
p = pnum;
if ( (unsigned int)pnum >= MAX_PLRS )
TermMsg("ModifyPlrMag: illegal player %d", pnum); TermMsg("ModifyPlrMag: illegal player %d", pnum);
v4 = v2;
v5 = plr[v4]._pClass;
v6 = MaxStats[v5][1];
v7 = plr[v4]._pBaseMag;
if ( v7 + v3 > v6 )
v3 = v6 - v7;
plr[v4]._pMagic += v3;
v8 = v3 + v7;
v9 = v3 << 6;
plr[v4]._pBaseMag = v8;
if ( v5 == 2 )
v9 *= 2;
plr[v4]._pMaxManaBase += v9;
plr[v4]._pMaxMana += v9;
if ( !(plr[v4]._pIFlags & 0x8000000) )
{
plr[v4]._pManaBase += v9;
plr[v4]._pMana += v9;
} }
CalcPlrInv(p, 1u);
if ( p == myplr ) int max = MaxStats[plr[pnum]._pClass][ATTRIB_MAG];
NetSendCmdParam1(0, CMD_SETMAG, plr[v4]._pBaseMag); if ( plr[pnum]._pBaseMag + l > max ) {
l = max - plr[pnum]._pBaseMag;
}
plr[pnum]._pMagic += l;
plr[pnum]._pBaseMag += l;
int ms = l << 6;
if ( plr[pnum]._pClass == PC_SORCERER ) {
ms *= 2;
}
plr[pnum]._pMaxManaBase += ms;
plr[pnum]._pMaxMana += ms;
if ( !(plr[pnum]._pIFlags & ISPL_NOMANA) ) {
plr[pnum]._pManaBase += ms;
plr[pnum]._pMana += ms;
}
CalcPlrInv(pnum, TRUE);
if ( pnum == myplr ) {
NetSendCmdParam1(FALSE, CMD_SETMAG, plr[pnum]._pBaseMag);
}
} }
void __fastcall ModifyPlrDex(int pnum, int l) void __fastcall ModifyPlrDex(int pnum, int l)
@ -4608,21 +4493,20 @@ void __fastcall ModifyPlrDex(int pnum, int l)
} }
int max = MaxStats[plr[pnum]._pClass][ATTRIB_DEX]; int max = MaxStats[plr[pnum]._pClass][ATTRIB_DEX];
if ( plr[pnum]._pBaseDex + l > max ) if ( plr[pnum]._pBaseDex + l > max ) {
{
l = max - plr[pnum]._pBaseDex; l = max - plr[pnum]._pBaseDex;
} }
plr[pnum]._pDexterity += l; plr[pnum]._pDexterity += l;
plr[pnum]._pBaseDex += l; plr[pnum]._pBaseDex += l;
CalcPlrInv(pnum, 1); CalcPlrInv(pnum, TRUE);
if ( plr[pnum]._pClass == PC_ROGUE ) { if ( plr[pnum]._pClass == PC_ROGUE ) {
plr[pnum]._pDamageMod = plr[pnum]._pLevel * (plr[pnum]._pDexterity + plr[pnum]._pStrength) / 200; plr[pnum]._pDamageMod = plr[pnum]._pLevel * (plr[pnum]._pDexterity + plr[pnum]._pStrength) / 200;
} }
if ( pnum == myplr ) { if ( pnum == myplr ) {
NetSendCmdParam1(0, CMD_SETDEX, plr[pnum]._pBaseDex); NetSendCmdParam1(FALSE, CMD_SETDEX, plr[pnum]._pBaseDex);
} }
} }
@ -4633,8 +4517,7 @@ void __fastcall ModifyPlrVit(int pnum, int l)
} }
int max = MaxStats[plr[pnum]._pClass][ATTRIB_VIT]; int max = MaxStats[plr[pnum]._pClass][ATTRIB_VIT];
if ( plr[pnum]._pBaseVit + l > max ) if ( plr[pnum]._pBaseVit + l > max ) {
{
l = max - plr[pnum]._pBaseVit; l = max - plr[pnum]._pBaseVit;
} }
@ -4668,7 +4551,7 @@ void __fastcall SetPlayerHitPoints(int pnum, int newhp)
plr[pnum]._pHPBase = newhp + plr[pnum]._pMaxHPBase - plr[pnum]._pMaxHP; plr[pnum]._pHPBase = newhp + plr[pnum]._pMaxHPBase - plr[pnum]._pMaxHP;
if ( pnum == myplr ) { if ( pnum == myplr ) {
drawhpflag = 1; drawhpflag = TRUE;
} }
} }
@ -4737,7 +4620,7 @@ void __fastcall SetPlrVit(int pnum, int v)
plr[pnum]._pBaseVit = v; plr[pnum]._pBaseVit = v;
int hp = v << 6; int hp = v << 6;
if ( !_LOBYTE(plr[pnum]._pClass) ) { if ( plr[pnum]._pClass == PC_WARRIOR ) {
hp *= 2; hp *= 2;
} }

6
Source/player.h

@ -77,14 +77,14 @@ BOOL __fastcall WeaponDur(int pnum, int durrnd);
bool __fastcall PlrHitMonst(int pnum, int m); bool __fastcall PlrHitMonst(int pnum, int m);
BOOL __fastcall PlrHitPlr(int pnum, char p); BOOL __fastcall PlrHitPlr(int pnum, char p);
BOOL __fastcall PlrHitObj(int pnum, int mx, int my); BOOL __fastcall PlrHitObj(int pnum, int mx, int my);
int __fastcall PM_DoAttack(int pnum); BOOL __fastcall PM_DoAttack(int pnum);
BOOL __fastcall PM_DoRangeAttack(int pnum); BOOL __fastcall PM_DoRangeAttack(int pnum);
void __fastcall ShieldDur(int pnum); void __fastcall ShieldDur(int pnum);
BOOL __fastcall PM_DoBlock(int pnum); BOOL __fastcall PM_DoBlock(int pnum);
BOOL __fastcall PM_DoSpell(int pnum); BOOL __fastcall PM_DoSpell(int pnum);
int __fastcall PM_DoGotHit(int pnum); BOOL __fastcall PM_DoGotHit(int pnum);
void __fastcall ArmorDur(int pnum); void __fastcall ArmorDur(int pnum);
int __fastcall PM_DoDeath(int pnum); BOOL __fastcall PM_DoDeath(int pnum);
void __fastcall CheckNewPath(int pnum); void __fastcall CheckNewPath(int pnum);
BOOL __fastcall PlrDeathModeOK(int pnum); BOOL __fastcall PlrDeathModeOK(int pnum);
void __cdecl ValidatePlayer(); void __cdecl ValidatePlayer();

2
Source/portal.cpp

@ -196,7 +196,7 @@ void __cdecl GetPortalLvlPos()
} }
} }
bool __fastcall PosOkPortal(int lvl, int x, int y) BOOL __fastcall PosOkPortal(int lvl, int x, int y)
{ {
int *v3; // eax int *v3; // eax

2
Source/portal.h

@ -18,7 +18,7 @@ void __fastcall RemovePortalMissile(int id);
void __fastcall SetCurrentPortal(int p); void __fastcall SetCurrentPortal(int p);
void __cdecl GetPortalLevel(); void __cdecl GetPortalLevel();
void __cdecl GetPortalLvlPos(); void __cdecl GetPortalLvlPos();
bool __fastcall PosOkPortal(int lvl, int x, int y); BOOL __fastcall PosOkPortal(int lvl, int x, int y);
/* rdata */ /* rdata */
extern int WarpDropX[MAXPORTAL]; extern int WarpDropX[MAXPORTAL];

8
Source/scrollrt.cpp

@ -3338,8 +3338,8 @@ void __cdecl DrawAndBlit()
{ {
if ( drawpanflag == 255 ) if ( drawpanflag == 255 )
{ {
drawhpflag = 1; drawhpflag = TRUE;
drawmanaflag = 1; drawmanaflag = TRUE;
drawbtnflag = 1; drawbtnflag = 1;
drawsbarflag = 1; drawsbarflag = 1;
ddsdesc = 0; ddsdesc = 0;
@ -3381,8 +3381,8 @@ void __cdecl DrawAndBlit()
lock_buf_priv(); lock_buf_priv();
scrollrt_draw_cursor_back_buffer(); scrollrt_draw_cursor_back_buffer();
unlock_buf_priv(); unlock_buf_priv();
drawhpflag = 0; drawhpflag = FALSE;
drawmanaflag = 0; drawmanaflag = FALSE;
drawbtnflag = 0; drawbtnflag = 0;
drawsbarflag = 0; drawsbarflag = 0;
} }

10
Source/spells.cpp

@ -2,7 +2,7 @@
#include "../types.h" #include "../types.h"
SpellData spelldata[37] = SpellData spelldata[MAX_SPELLS] =
{ {
{ 0, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, { 0, 0, 0 }, 0, 0, 40, 80, 0, 0 }, { 0, 0, 0, NULL, NULL, 0, 0, 0, 0, 0, 0, { 0, 0, 0 }, 0, 0, 40, 80, 0, 0 },
{ SPL_FIREBOLT, 6, STYPE_FIRE, "Firebolt", "Firebolt", 1, 1, 1, 0, 15, IS_CAST2, { MIS_FIREBOLT, 0, 0 }, 1, 3, 40, 80, 1000, 50 }, { SPL_FIREBOLT, 6, STYPE_FIRE, "Firebolt", "Firebolt", 1, 1, 1, 0, 15, IS_CAST2, { MIS_FIREBOLT, 0, 0 }, 1, 3, 40, 80, 1000, 50 },
@ -121,7 +121,7 @@ void __fastcall UseMana(int id, int sn)
ma = GetManaAmount(id, sn); ma = GetManaAmount(id, sn);
plr[id]._pMana -= ma; plr[id]._pMana -= ma;
plr[id]._pManaBase -= ma; plr[id]._pManaBase -= ma;
drawmanaflag = 1; drawmanaflag = TRUE;
#ifdef _DEBUG #ifdef _DEBUG
} }
#endif #endif
@ -230,8 +230,8 @@ void __fastcall DoResurrect(int pnum, int rid)
{ {
deathflag = 0; deathflag = 0;
gamemenu_off(); gamemenu_off();
drawhpflag = 1; drawhpflag = TRUE;
drawmanaflag = 1; drawmanaflag = TRUE;
} }
ClrPlrPath(rid); ClrPlrPath(rid);
@ -362,6 +362,6 @@ void __fastcall DoHealOther(int pnum, int rid)
plr[rid]._pHPBase = plr[rid]._pMaxHPBase; plr[rid]._pHPBase = plr[rid]._pMaxHPBase;
} }
drawhpflag = 1; drawhpflag = TRUE;
} }
} }

2
Source/spells.h

@ -12,6 +12,6 @@ void __fastcall DoHealOther(int pnum, int rid);
/* rdata */ /* rdata */
extern SpellData spelldata[37]; extern SpellData spelldata[MAX_SPELLS];
#endif /* __SPELLS_H__ */ #endif /* __SPELLS_H__ */

2
Source/stores.cpp

@ -3744,7 +3744,7 @@ LABEL_12:
} }
if ( plr[myplr]._pHitPoints != plr[myplr]._pMaxHP ) if ( plr[myplr]._pHitPoints != plr[myplr]._pMaxHP )
PlaySFX(IS_CAST8); PlaySFX(IS_CAST8);
drawhpflag = 1; drawhpflag = TRUE;
v1 = myplr; v1 = myplr;
plr[v1]._pHitPoints = plr[myplr]._pMaxHP; plr[v1]._pHitPoints = plr[myplr]._pMaxHP;
plr[v1]._pHPBase = plr[v1]._pMaxHPBase; plr[v1]._pHPBase = plr[v1]._pMaxHPBase;

1
defs.h

@ -12,6 +12,7 @@
#define MAX_LVLMTYPES 16 #define MAX_LVLMTYPES 16
// #define MAX_PATH 260 // #define MAX_PATH 260
#define MAX_SEND_STR_LEN 80 #define MAX_SEND_STR_LEN 80
#define MAX_SPELLS 37
#define MAXDEAD 31 #define MAXDEAD 31
#define MAXDUNX 112 #define MAXDUNX 112

10
structs.h

@ -213,15 +213,15 @@ struct PlayerStruct
char _pSBkSplType; char _pSBkSplType;
char _pSplLvl[64]; char _pSplLvl[64];
union { union {
__int64 _pMemSpells64; unsigned __int64 _pMemSpells64;
int _pMemSpells[2]; int _pMemSpells[2];
}; };
union { union {
__int64 _pAblSpells64; unsigned __int64 _pAblSpells64;
int _pAblSpells[2]; int _pAblSpells[2];
}; };
union { union {
__int64 _pScrlSpells64; unsigned __int64 _pScrlSpells64;
int _pScrlSpells[2]; int _pScrlSpells[2];
}; };
int _pSpellFlags; int _pSpellFlags;
@ -322,7 +322,7 @@ struct PlayerStruct
int _pIBonusAC; int _pIBonusAC;
int _pIBonusDamMod; int _pIBonusDamMod;
union { union {
__int64 _pISpells64; unsigned __int64 _pISpells64;
int _pISpells[2]; int _pISpells[2];
}; };
int _pIFlags; int _pIFlags;
@ -1471,7 +1471,7 @@ struct PkPlayerStruct
int pMaxHPBase; int pMaxHPBase;
int pManaBase; int pManaBase;
int pMaxManaBase; int pMaxManaBase;
char pSplLvl[37]; char pSplLvl[MAX_SPELLS];
int pMemSpells; /* __int64 */ int pMemSpells; /* __int64 */
int pMemSpells2; int pMemSpells2;
PkItemStruct InvBody[7]; PkItemStruct InvBody[7];

Loading…
Cancel
Save