Browse Source

Implement "credits.cpp" in DiabloUI (#298)

pull/4/head
galaxyhaxz 8 years ago committed by GitHub
parent
commit
91554056bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 1
      3rdParty/Storm/Source/storm.cpp
  2. 2
      3rdParty/Storm/Source/storm.def
  3. 1
      3rdParty/Storm/Source/storm.h
  4. 3
      3rdParty/Storm/Source/storm_gcc.def
  5. 21
      DiabloUI/_temp_data.cpp
  6. 19
      DiabloUI/_temp_funcs.h
  7. 311
      DiabloUI/credits.cpp
  8. 8
      DiabloUI/diabloui.cpp
  9. 2
      DiabloUI/diabloui.h

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

@ -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;

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

@ -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

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

@ -1310,6 +1310,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__
} }

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

@ -235,7 +235,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

21
DiabloUI/_temp_data.cpp

@ -8,6 +8,7 @@ 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 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
@ -185,18 +186,18 @@ int dword_100296D4; // weak
int dword_100296D8; // weak int dword_100296D8; // weak
int dword_100296DC; // weak int dword_100296DC; // weak
int dword_100296E0; // weak int dword_100296E0; // weak
int dword_100296E8; // weak int credittext_size; // weak
int dword_100296EC; // weak int credits_cpp_float; // weak
HGLOBAL dword_100296F0; // idb HGLOBAL credittext_rsrc; // idb
int dword_100296F4; // weak int credit_vertical_pos2; // idb
int dword_100296F8; // weak int credit_horz_pos; // idb
int dword_100296FC; // weak int credit_vertical_pos1; // weak
int dword_10029700; // weak int credit_line_count; // weak
void *dword_10029704; // idb void *credit_back_img; // idb
int dword_10029708; // weak HANDLE creditsobj; // idb
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

19
DiabloUI/_temp_funcs.h

@ -132,15 +132,16 @@ int __fastcall CreaDung_100051D8(int a1, int a2, int a3, int a4, int a5, int a6,
signed int CreaStat_10005287(); signed int CreaStat_10005287();
signed int credits_10005297(); void __cdecl j_credits_cpp_init();
//signed int __stdcall UiCreditsDialog(int a1); void __cdecl credits_cpp_init();
int __fastcall credits_100052C7(int a1, int a2, HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); BOOL __stdcall UiCreditsDialog(int a1);
HGLOBAL __fastcall credits_100053D9(HWND hWnd, int a2); LRESULT __stdcall credits_WndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
int __fastcall credits_1000543A(HWND a1, int a2); void __fastcall credits_FreeCreditResrc(HWND hWnd);
BOOL UNKCALL credits_100055C0(HWND hWnd); void __fastcall credits_LoadImgCreditTxt(HWND hWnd, LPARAM lParam);
signed int UNKCALL credits_10005660(void *arg); void __fastcall credits_CalcPosROP3(HWND hWnd);
signed int __fastcall credits_10005736(_BYTE *a1); void __fastcall credits_PrintCredLines(HWND hWnd);
int __fastcall credits_10005755(int a1, int a2); 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);

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;

8
DiabloUI/diabloui.cpp

@ -100,14 +100,14 @@ 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_10002EC4();
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()
@ -115,9 +115,9 @@ void __cdecl UiDestroy()
bn_prof_10002247(); bn_prof_10002247();
local_FreeArtCursor(); local_FreeArtCursor();
Connect_10002E2B(); Connect_10002E2B();
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)

2
DiabloUI/diabloui.h

@ -36,7 +36,7 @@ void __stdcall UiAppActivate(BOOL bActive);
int __stdcall UiValidPlayerName(char *a1); int __stdcall UiValidPlayerName(char *a1);
int __stdcall UiSelHeroMultDialog(void *fninfo, void *fncreate, void *fnremove, void *fnstats, int *a5, int *a6, char *name); int __stdcall UiSelHeroMultDialog(void *fninfo, void *fncreate, void *fnremove, void *fnstats, int *a5, int *a6, char *name);
int __stdcall UiSelHeroSingDialog(void *fninfo, void *fncreate, void *fnremove, void *fnstats, int *a5, char *name, int *difficulty); int __stdcall UiSelHeroSingDialog(void *fninfo, void *fncreate, void *fnremove, void *fnstats, int *a5, char *name, int *difficulty);
void __stdcall UiCreditsDialog(int a1); BOOL __stdcall UiCreditsDialog(int a1);
BOOL __stdcall UiMainMenuDialog(char *name, int *pdwResult, void (__stdcall *fnSound)(char *file), 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();

Loading…
Cancel
Save