From 20fdbf8aa2d7fc31cffefcbef17b75f4ba8bf29e Mon Sep 17 00:00:00 2001 From: mewmew Date: Thu, 7 Jun 2018 22:44:03 +0200 Subject: [PATCH 1/2] Fix compile errors on Linux MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Source/../types.h:35:10: fatal error: DiabloUI/_diabloui.h: No such file or directory #include "DiabloUI/_diabloui.h" --- Source/../Source/init.h:43:109: error: fastcall and stdcall attributes are not compatible LRESULT (__stdcall *__fastcall SetWindowProc(void *func))(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); --- Source/missiles.cpp:915:27: error: unable to find numeric literal operator ‘operator""i64’ *(_QWORD *)&Dirs[0][2] = 0i64; --- Source/world.cpp:38:1: error: narrowing conversion of ‘3937053354’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing] --- Source/lighting.cpp:429:1: error: narrowing conversion of ‘-1’ from ‘int’ to ‘unsigned char’ inside { } [-Wnarrowing] --- Source/objects.cpp:5459:62: error: unable to find numeric literal operator ‘operator""i64’ while ( !(plr[v53]._pMemSpells[1] & ((unsigned __int64)(1i64 << v60) >> 32) | plr[v53]._pMemSpells[0] & (unsigned int)(1i64 << v60)) ); --- Source/control.cpp:488:9: error: unable to find numeric literal operator ‘operator""i64’ v26 = 1i64; --- Source/objects.cpp:243:1: error: narrowing conversion of ‘255’ from ‘int’ to ‘char’ inside { } [-Wnarrowing] --- Source/gamemenu.cpp:22:1: error: narrowing conversion of ‘2147483648’ from ‘unsigned int’ to ‘int’ inside { } [-Wnarrowing] --- Source/sound.cpp:41:88: error: narrowing conversion of ‘240’ from ‘unsigned int’ to ‘char’ inside { } [-Wnarrowing] --- Source/quests.cpp:46:1: error: narrowing conversion of ‘255’ from ‘int’ to ‘char’ inside { } [-Wnarrowing] --- Source/player.cpp:4666:8: error: unable to find numeric literal operator ‘operator""i64’ v14 = 0i64; --- Source/init.cpp:546:109: error: fastcall and stdcall attributes are not compatible LRESULT (__stdcall *__fastcall SetWindowProc(void *func))(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) --- Source/items.cpp:114:1: error: narrowing conversion of ‘(item_effect_type)255’ from ‘unsigned int’ to ‘char’ inside { } [-Wnarrowing] --- Source/items.cpp:307:1: error: narrowing conversion of ‘(unique_base_item)255’ from ‘unsigned int’ to ‘char’ inside { } [-Wnarrowing] --- Source/items.cpp:854:8: error: unable to find numeric literal operator ‘operator""i64’ v37 = 0i64; --- Source/items.cpp:471:1: error: narrowing conversion of ‘(item_equip_type)255’ from ‘unsigned int’ to ‘char’ inside { } [-Wnarrowing] --- Source/control.cpp | 12 +-- Source/init.cpp | 2 +- Source/init.h | 4 +- Source/items.cpp | 14 ++-- Source/missiles.cpp | 124 ++++++++++++++--------------- Source/objects.cpp | 188 ++++++++++++++++++++++---------------------- Source/player.cpp | 8 +- Source/quests.cpp | 26 +++--- Source/sound.cpp | 2 +- Source/world.cpp | 2 +- Source/world.h | 2 +- enums.h | 6 +- structs.h | 10 +-- types.h | 2 +- 14 files changed, 201 insertions(+), 201 deletions(-) diff --git a/Source/control.cpp b/Source/control.cpp index 6fe39f5..b5227cf 100644 --- a/Source/control.cpp +++ b/Source/control.cpp @@ -485,7 +485,7 @@ LABEL_10: } v20 = &spelldata[1].sTownSpell; v4 = 1; - v26 = 1i64; + v26 = 1; v23 = 1; v22 = xp - 216; do @@ -621,7 +621,7 @@ LABEL_66: LABEL_68: v20 += 56; ++v4; - v26 *= 2i64; + v26 *= 2; v23 = v4; } while ( (signed int)v20 < (signed int)&spelldata[37].sTownSpell ); @@ -753,7 +753,7 @@ void __fastcall ToggleSpell(int slot) v8 = plr[v3]._pAblSpells[0]; v9 = plr[v3]._pAblSpells[1]; } - if ( v9 & ((unsigned __int64)(1i64 << ((unsigned char)v2 - 1)) >> 32) | v8 & (unsigned int)(1i64 << ((unsigned char)v2 - 1)) ) + if ( v9 & ((unsigned __int64)(1 << ((unsigned char)v2 - 1)) >> 32) | v8 & (unsigned int)(1 << ((unsigned char)v2 - 1)) ) { drawpanflag = 255; plr[v3]._pRSpell = v12; @@ -2754,7 +2754,7 @@ int __fastcall GetSBookTrans(int ii, unsigned char townok) v7 = townok; v6 = 1; v3 = myplr; - if ( ((unsigned __int64)(1i64 << ((unsigned char)ii - 1)) >> 32) & plr[v3]._pISpells[1] | (unsigned int)(1i64 << ((unsigned char)ii - 1)) & plr[v3]._pISpells[0] ) + if ( ((unsigned __int64)(1 << ((unsigned char)ii - 1)) >> 32) & plr[v3]._pISpells[1] | (unsigned int)(1 << ((unsigned char)ii - 1)) & plr[v3]._pISpells[0] ) v6 = 3; result = plr[v3]._pAblSpells[1] & (1 << (ii - 1) >> 31) | plr[v3]._pAblSpells[0] & (1 << (ii - 1)); if ( result ) @@ -2800,7 +2800,7 @@ void __cdecl DrawSpellBook() { v2 = *(&attribute_inc_rects[3].h + v9 + 7 * sbooktab); if ( v2 != -1 - && v1 & ((unsigned __int64)(1i64 << ((unsigned char)v2 - 1)) >> 32) | v0 & (unsigned int)(1i64 << ((unsigned char)v2 - 1)) ) + && v1 & ((unsigned __int64)(1 << ((unsigned char)v2 - 1)) >> 32) | v0 & (unsigned int)(1 << ((unsigned char)v2 - 1)) ) { v7 = GetSBookTrans(v2, 1u); SetSpellTrans(v7); @@ -2929,7 +2929,7 @@ void __cdecl CheckSBook() v3 = myplr; LODWORD(v6) = plr[myplr]._pAblSpells[0]; HIDWORD(v6) = plr[myplr]._pAblSpells[1]; - v4 = 1i64 << ((unsigned char)v2 - 1); + v4 = 1 << ((unsigned char)v2 - 1); if ( HIDWORD(v4) & (HIDWORD(v6) | plr[myplr]._pISpells[1] | plr[myplr]._pMemSpells[1]) | (unsigned int)v4 & ((unsigned int)v6 | plr[myplr]._pISpells[0] | plr[myplr]._pMemSpells[0]) ) { v5 = 3; diff --git a/Source/init.cpp b/Source/init.cpp index dd12b73..31832ff 100644 --- a/Source/init.cpp +++ b/Source/init.cpp @@ -543,7 +543,7 @@ LRESULT __stdcall init_redraw_window(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM } //----- (0041B184) -------------------------------------------------------- -LRESULT (__stdcall *__fastcall SetWindowProc(void *func))(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) +LRESULT (__stdcall *SetWindowProc(void *func))(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) { LRESULT (__stdcall *result)(HWND, UINT, WPARAM, LPARAM); // eax diff --git a/Source/init.h b/Source/init.h index 3f65b42..11a652d 100644 --- a/Source/init.h +++ b/Source/init.h @@ -40,7 +40,7 @@ void __cdecl init_get_file_info(); LRESULT __stdcall init_palette(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); void __fastcall init_activate_window(HWND hWnd, bool activated); LRESULT __stdcall init_redraw_window(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam); -LRESULT (__stdcall *__fastcall SetWindowProc(void *func))(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); +LRESULT (__stdcall *SetWindowProc(void *func))(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); /* data */ extern int init_inf; // weak @@ -48,4 +48,4 @@ extern int init_inf; // weak /* rdata */ extern char gszVersionNumber[260]; -extern char gszProductName[260]; \ No newline at end of file +extern char gszProductName[260]; diff --git a/Source/items.cpp b/Source/items.cpp index b565ed3..d07d4d7 100644 --- a/Source/items.cpp +++ b/Source/items.cpp @@ -851,7 +851,7 @@ void __fastcall CalcPlrItemVals(int p, bool Loadgfx) v60 = 0; v52 = 0; v61 = 0; - v37 = 0i64; + v37 = 0; v49 = 0; v48 = 0; v47 = 0; @@ -878,7 +878,7 @@ void __fastcall CalcPlrItemVals(int p, bool Loadgfx) v40 = v3; v41 = v2; if ( v7 ) - v37 |= 1i64 << ((unsigned char)v7 - 1); + v37 |= 1 << ((unsigned char)v7 - 1); if ( !*((_BYTE *)v6 - 296) || *(v6 - 75) ) { v57 += *(v6 - 28); @@ -979,7 +979,7 @@ void __fastcall CalcPlrItemVals(int p, bool Loadgfx) plr[v5]._pISpells[0] = v37; plr[v5]._pISpells[1] = HIDWORD(v37); plr[v5]._pDamageMod = v15 / v16; - if ( v17 && !(v37 & (1i64 << (_LOBYTE(plr[v5]._pRSpell) - 1))) ) + if ( v17 && !(v37 & (1 << (_LOBYTE(plr[v5]._pRSpell) - 1))) ) { plr[v5]._pRSpell = -1; _LOBYTE(plr[v5]._pRSplType) = 4; @@ -1143,7 +1143,7 @@ void __fastcall CalcPlrScrolls(int p) { if ( *(v3 - 53) != -1 && (*v3 == IMISC_SCROLL || *v3 == IMISC_SCROLLT) && v3[34] ) { - v5 = 1i64 << (*((_BYTE *)v3 + 4) - 1); + v5 = 1 << (*((_BYTE *)v3 + 4) - 1); plr[v1]._pScrlSpells[0] |= v5; plr[v1]._pScrlSpells[1] |= HIDWORD(v5); } @@ -1158,7 +1158,7 @@ void __fastcall CalcPlrScrolls(int p) { if ( *(v6 - 53) != -1 && (*v6 == IMISC_SCROLL || *v6 == IMISC_SCROLLT) && v6[34] ) { - v8 = 1i64 << (*((_BYTE *)v6 + 4) - 1); + v8 = 1 << (*((_BYTE *)v6 + 4) - 1); plr[v1]._pScrlSpells[0] |= v8; plr[v1]._pScrlSpells[1] |= HIDWORD(v8); } @@ -1192,7 +1192,7 @@ void __fastcall CalcPlrStaff(int pnum) plr[v1]._pISpells[1] = 0; if ( !v2 && plr[v1].InvBody[4]._iStatFlag && plr[v1].InvBody[4]._iCharges > 0 ) { - v3 = 1i64 << (_LOBYTE(plr[v1].InvBody[4]._iSpell) - 1); + v3 = 1 << (_LOBYTE(plr[v1].InvBody[4]._iSpell) - 1); plr[v1]._pISpells[0] = v3; plr[v1]._pISpells[1] = HIDWORD(v3); } @@ -4668,7 +4668,7 @@ LABEL_71: if ( v24 != 2 ) return; v25 = p; - *(_QWORD *)plr[p]._pMemSpells |= 1i64 << ((unsigned char)spl - 1); + *(_QWORD *)plr[p]._pMemSpells |= 1 << ((unsigned char)spl - 1); v26 = &plr[p]._pSplLvl[spl]; if ( *v26 < 15 ) ++*v26; diff --git a/Source/missiles.cpp b/Source/missiles.cpp index 9369ed0..93b0874 100644 --- a/Source/missiles.cpp +++ b/Source/missiles.cpp @@ -912,40 +912,40 @@ int __fastcall GetDirection8(int x1, int y1, int x2, int y2) v9 = y1; v4 = x1; strcpy((char *)Dirs, "c"); - *(_QWORD *)&Dirs[0][2] = 0i64; + *(_QWORD *)&Dirs[0][2] = 0; *(_DWORD *)&Dirs[0][10] = 0; *(_WORD *)&Dirs[0][14] = 0; - *(_QWORD *)&Dirs[1][0] = 0x1010102i64; - *(_QWORD *)&Dirs[1][8] = 0i64; - *(_QWORD *)&Dirs[2][0] = 0x1010101010102i64; - *(_QWORD *)&Dirs[2][8] = 0i64; - *(_QWORD *)&Dirs[3][0] = 0x101010101010102i64; - *(_QWORD *)&Dirs[3][8] = 1i64; - *(_QWORD *)&Dirs[4][0] = 0x101010101010202i64; - *(_QWORD *)&Dirs[4][8] = 0x1010101i64; - *(_QWORD *)&Dirs[5][0] = 0x101010101010202i64; - *(_QWORD *)&Dirs[5][8] = 0x10101010101i64; - *(_QWORD *)&Dirs[6][0] = 0x101010101010202i64; - *(_QWORD *)&Dirs[6][8] = 0x101010101010101i64; - *(_QWORD *)&Dirs[7][0] = 0x101010101020202i64; - *(_QWORD *)&Dirs[7][8] = 0x101010101010101i64; - *(_QWORD *)&Dirs[8][0] = 0x101010101020202i64; - *(_QWORD *)&Dirs[8][8] = 0x101010101010101i64; - *(_QWORD *)&Dirs[9][0] = 0x101010102020202i64; - *(_QWORD *)&Dirs[9][8] = 0x101010101010101i64; - *(_QWORD *)&Dirs[10][0] = 0x101010102020202i64; - *(_QWORD *)&Dirs[10][8] = 0x101010101010101i64; - *(_QWORD *)&Dirs[11][0] = 0x101010102020202i64; - *(_QWORD *)&Dirs[11][8] = 0x101010101010101i64; - *(_QWORD *)&Dirs[12][0] = 0x101010202020202i64; - *(_QWORD *)&Dirs[12][8] = 0x101010101010101i64; - *(_QWORD *)&Dirs[13][0] = 0x101010202020202i64; - *(_QWORD *)&Dirs[13][8] = 0x101010101010101i64; - *(_QWORD *)&Dirs[14][0] = 0x101020202020202i64; - *(_QWORD *)&Dirs[14][8] = 0x101010101010101i64; + *(_QWORD *)&Dirs[1][0] = 0x1010102; + *(_QWORD *)&Dirs[1][8] = 0; + *(_QWORD *)&Dirs[2][0] = 0x1010101010102; + *(_QWORD *)&Dirs[2][8] = 0; + *(_QWORD *)&Dirs[3][0] = 0x101010101010102; + *(_QWORD *)&Dirs[3][8] = 1; + *(_QWORD *)&Dirs[4][0] = 0x101010101010202; + *(_QWORD *)&Dirs[4][8] = 0x1010101; + *(_QWORD *)&Dirs[5][0] = 0x101010101010202; + *(_QWORD *)&Dirs[5][8] = 0x10101010101; + *(_QWORD *)&Dirs[6][0] = 0x101010101010202; + *(_QWORD *)&Dirs[6][8] = 0x101010101010101; + *(_QWORD *)&Dirs[7][0] = 0x101010101020202; + *(_QWORD *)&Dirs[7][8] = 0x101010101010101; + *(_QWORD *)&Dirs[8][0] = 0x101010101020202; + *(_QWORD *)&Dirs[8][8] = 0x101010101010101; + *(_QWORD *)&Dirs[9][0] = 0x101010102020202; + *(_QWORD *)&Dirs[9][8] = 0x101010101010101; + *(_QWORD *)&Dirs[10][0] = 0x101010102020202; + *(_QWORD *)&Dirs[10][8] = 0x101010101010101; + *(_QWORD *)&Dirs[11][0] = 0x101010102020202; + *(_QWORD *)&Dirs[11][8] = 0x101010101010101; + *(_QWORD *)&Dirs[12][0] = 0x101010202020202; + *(_QWORD *)&Dirs[12][8] = 0x101010101010101; + *(_QWORD *)&Dirs[13][0] = 0x101010202020202; + *(_QWORD *)&Dirs[13][8] = 0x101010101010101; + *(_QWORD *)&Dirs[14][0] = 0x101020202020202; + *(_QWORD *)&Dirs[14][8] = 0x101010101010101; lltour[1] = 0; - *(_QWORD *)&Dirs[15][0] = 0x101020202020202i64; - *(_QWORD *)&Dirs[15][8] = 0x101010101010101i64; + *(_QWORD *)&Dirs[15][0] = 0x101020202020202; + *(_QWORD *)&Dirs[15][8] = 0x101010101010101; lrtoul[0] = 3; lrtoul[1] = 4; lrtoul[2] = 5; @@ -1000,40 +1000,40 @@ int __fastcall GetDirection16(int x1, int y1, int x2, int y2) v9 = y1; v4 = x1; strcpy((char *)Dirs, "c"); - *(_QWORD *)&Dirs[0][2] = 0i64; + *(_QWORD *)&Dirs[0][2] = 0; *(_DWORD *)&Dirs[0][10] = 0; *(_WORD *)&Dirs[0][14] = 0; - *(_QWORD *)&Dirs[1][0] = 0x1010204i64; - *(_QWORD *)&Dirs[1][8] = 0i64; - *(_QWORD *)&Dirs[2][0] = 0x101010101020304i64; - *(_QWORD *)&Dirs[2][8] = 0i64; - *(_QWORD *)&Dirs[3][0] = 0x101010202030304i64; - *(_QWORD *)&Dirs[3][8] = 0x1010101i64; - *(_QWORD *)&Dirs[4][0] = 0x101010202030404i64; - *(_QWORD *)&Dirs[4][8] = 0x101010101010101i64; - *(_QWORD *)&Dirs[5][0] = 0x102020203030404i64; - *(_QWORD *)&Dirs[5][8] = 0x101010101010101i64; - *(_QWORD *)&Dirs[6][0] = 0x202020203030404i64; - *(_QWORD *)&Dirs[6][8] = 0x101010101010102i64; - *(_QWORD *)&Dirs[7][0] = 0x202030303030404i64; - *(_QWORD *)&Dirs[7][8] = 0x101010101010202i64; - *(_QWORD *)&Dirs[8][0] = 0x202030303040404i64; - *(_QWORD *)&Dirs[8][8] = 0x101010101020202i64; - *(_QWORD *)&Dirs[9][0] = 0x203030303040404i64; - *(_QWORD *)&Dirs[9][8] = 0x101010102020202i64; - *(_QWORD *)&Dirs[10][0] = 0x303030303040404i64; - *(_QWORD *)&Dirs[10][8] = 0x101020202020202i64; - *(_QWORD *)&Dirs[11][0] = 0x303030303040404i64; - *(_QWORD *)&Dirs[11][8] = 0x102020202020203i64; - *(_QWORD *)&Dirs[12][0] = 0x303030304040404i64; - *(_QWORD *)&Dirs[12][8] = 0x202020202020303i64; - *(_QWORD *)&Dirs[13][0] = 0x303030304040404i64; - *(_QWORD *)&Dirs[13][8] = 0x202020202020303i64; - *(_QWORD *)&Dirs[14][0] = 0x303030304040404i64; - *(_QWORD *)&Dirs[14][8] = 0x202020202030303i64; + *(_QWORD *)&Dirs[1][0] = 0x1010204; + *(_QWORD *)&Dirs[1][8] = 0; + *(_QWORD *)&Dirs[2][0] = 0x101010101020304; + *(_QWORD *)&Dirs[2][8] = 0; + *(_QWORD *)&Dirs[3][0] = 0x101010202030304; + *(_QWORD *)&Dirs[3][8] = 0x1010101; + *(_QWORD *)&Dirs[4][0] = 0x101010202030404; + *(_QWORD *)&Dirs[4][8] = 0x101010101010101; + *(_QWORD *)&Dirs[5][0] = 0x102020203030404; + *(_QWORD *)&Dirs[5][8] = 0x101010101010101; + *(_QWORD *)&Dirs[6][0] = 0x202020203030404; + *(_QWORD *)&Dirs[6][8] = 0x101010101010102; + *(_QWORD *)&Dirs[7][0] = 0x202030303030404; + *(_QWORD *)&Dirs[7][8] = 0x101010101010202; + *(_QWORD *)&Dirs[8][0] = 0x202030303040404; + *(_QWORD *)&Dirs[8][8] = 0x101010101020202; + *(_QWORD *)&Dirs[9][0] = 0x203030303040404; + *(_QWORD *)&Dirs[9][8] = 0x101010102020202; + *(_QWORD *)&Dirs[10][0] = 0x303030303040404; + *(_QWORD *)&Dirs[10][8] = 0x101020202020202; + *(_QWORD *)&Dirs[11][0] = 0x303030303040404; + *(_QWORD *)&Dirs[11][8] = 0x102020202020203; + *(_QWORD *)&Dirs[12][0] = 0x303030304040404; + *(_QWORD *)&Dirs[12][8] = 0x202020202020303; + *(_QWORD *)&Dirs[13][0] = 0x303030304040404; + *(_QWORD *)&Dirs[13][8] = 0x202020202020303; + *(_QWORD *)&Dirs[14][0] = 0x303030304040404; + *(_QWORD *)&Dirs[14][8] = 0x202020202030303; lrtoul[2] = 0; - *(_QWORD *)&Dirs[15][0] = 0x303030304040404i64; - *(_QWORD *)&Dirs[15][8] = 0x202020203030303i64; + *(_QWORD *)&Dirs[15][0] = 0x303030304040404; + *(_QWORD *)&Dirs[15][8] = 0x202020203030303; urtoll[0] = 6; urtoll[1] = 7; urtoll[2] = 8; diff --git a/Source/objects.cpp b/Source/objects.cpp index 26c0bec..850dbee 100644 --- a/Source/objects.cpp +++ b/Source/objects.cpp @@ -141,105 +141,105 @@ int ObjTypeConv[113] = }; ObjDataStruct AllObjects[99] = { - { 1, OFILE_L1BRAZ, 1, 4, 1, 255, 255, 1, 1, 26, 64, 1, 1, 0, 0, 0, 0 }, - { 1, OFILE_L1DOORS, 1, 4, 1, 255, 255, 0, 1, 0, 64, 0, 0, 1, 0, 3, 1 }, - { 1, OFILE_L1DOORS, 1, 4, 1, 255, 255, 0, 2, 0, 64, 0, 0, 1, 0, 3, 1 }, - { 3, OFILE_SKULFIRE, 0, 0, 0, 3, 255, 1, 2, 11, 96, 1, 1, 0, 0, 0, 0 }, - { 1, OFILE_LEVER, 1, 4, 1, 255, 255, 0, 1, 1, 96, 1, 1, 1, 0, 1, 1 }, - { 1, OFILE_CHEST1, 1, 16, 0, 255, 255, 0, 1, 0, 96, 1, 1, 1, 0, 1, 1 }, - { 1, OFILE_CHEST2, 1, 16, 0, 255, 255, 0, 1, 0, 96, 1, 1, 1, 0, 1, 1 }, - { 1, OFILE_CHEST3, 1, 16, 0, 255, 255, 0, 1, 0, 96, 1, 1, 1, 0, 1, 1 }, - { 2, OFILE_L1BRAZ, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 3, OFILE_CANDLE2, 0, 0, 0, 1, 255, 1, 2, 4, 96, 1, 1, 1, 0, 0, 0 }, - { 2, OFILE_L1BRAZ, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 3, OFILE_BANNER, 0, 0, 0, 3, 255, 0, 2, 0, 96, 1, 1, 1, 0, 0, 0 }, - { 3, OFILE_BANNER, 0, 0, 0, 3, 255, 0, 1, 0, 96, 1, 1, 1, 0, 0, 0 }, - { 3, OFILE_BANNER, 0, 0, 0, 3, 255, 0, 3, 0, 96, 1, 1, 1, 0, 0, 0 }, - { 2, OFILE_SKULPILE, 1, 4, 0, 255, 255, 0, 0, 1, 96, 1, 1, 1, 0, 0, 0 }, - { 2, OFILE_L1BRAZ, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, OFILE_L1BRAZ, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, OFILE_L1BRAZ, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, OFILE_L1BRAZ, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, OFILE_L1BRAZ, 0, 0, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, - { 2, OFILE_CRUXSK1, 0, 0, 0, 255, 255, 0, 1, 15, 96, 1, 0, 1, 1, 3, 0 }, - { 2, OFILE_CRUXSK2, 0, 0, 0, 255, 255, 0, 1, 15, 96, 1, 0, 1, 1, 3, 0 }, - { 2, OFILE_CRUXSK3, 0, 0, 0, 255, 255, 0, 1, 15, 96, 1, 0, 1, 1, 3, 0 }, - { 1, OFILE_ROCKSTAN, 5, 5, 0, 255, 255, 0, 1, 0, 96, 1, 1, 1, 0, 0, 0 }, - { 2, OFILE_ANGEL, 0, 0, 0, 255, 255, 0, 1, 0, 96, 1, 0, 1, 0, 0, 0 }, - { 2, OFILE_BOOK2, 0, 0, 0, 255, 255, 0, 1, 0, 96, 1, 1, 1, 0, 3, 0 }, - { 2, OFILE_BURNCROS, 0, 0, 0, 255, 255, 1, 0, 10, 160, 1, 0, 0, 0, 0, 0 }, - { 2, OFILE_NUDE2, 0, 0, 0, 255, 255, 1, 3, 6, 128, 1, 0, 1, 0, 0, 0 }, - { 1, OFILE_SWITCH4, 16, 16, 0, 255, 255, 0, 1, 0, 96, 1, 1, 1, 0, 1, 1 }, - { 1, OFILE_TNUDEM, 13, 16, 0, 255, 6, 0, 1, 0, 128, 1, 0, 1, 0, 0, 0 }, + { 1, OFILE_L1BRAZ, 1, 4, 1, -1, -1, 1, 1, 26, 64, 1, 1, 0, 0, 0, 0 }, + { 1, OFILE_L1DOORS, 1, 4, 1, -1, -1, 0, 1, 0, 64, 0, 0, 1, 0, 3, 1 }, + { 1, OFILE_L1DOORS, 1, 4, 1, -1, -1, 0, 2, 0, 64, 0, 0, 1, 0, 3, 1 }, + { 3, OFILE_SKULFIRE, 0, 0, 0, 3, -1, 1, 2, 11, 96, 1, 1, 0, 0, 0, 0 }, + { 1, OFILE_LEVER, 1, 4, 1, -1, -1, 0, 1, 1, 96, 1, 1, 1, 0, 1, 1 }, + { 1, OFILE_CHEST1, 1, 16, 0, -1, -1, 0, 1, 0, 96, 1, 1, 1, 0, 1, 1 }, + { 1, OFILE_CHEST2, 1, 16, 0, -1, -1, 0, 1, 0, 96, 1, 1, 1, 0, 1, 1 }, + { 1, OFILE_CHEST3, 1, 16, 0, -1, -1, 0, 1, 0, 96, 1, 1, 1, 0, 1, 1 }, + { 2, OFILE_L1BRAZ, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, OFILE_CANDLE2, 0, 0, 0, 1, -1, 1, 2, 4, 96, 1, 1, 1, 0, 0, 0 }, + { 2, OFILE_L1BRAZ, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 3, OFILE_BANNER, 0, 0, 0, 3, -1, 0, 2, 0, 96, 1, 1, 1, 0, 0, 0 }, + { 3, OFILE_BANNER, 0, 0, 0, 3, -1, 0, 1, 0, 96, 1, 1, 1, 0, 0, 0 }, + { 3, OFILE_BANNER, 0, 0, 0, 3, -1, 0, 3, 0, 96, 1, 1, 1, 0, 0, 0 }, + { 2, OFILE_SKULPILE, 1, 4, 0, -1, -1, 0, 0, 1, 96, 1, 1, 1, 0, 0, 0 }, + { 2, OFILE_L1BRAZ, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 2, OFILE_L1BRAZ, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 2, OFILE_L1BRAZ, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 2, OFILE_L1BRAZ, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 2, OFILE_L1BRAZ, 0, 0, 0, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + { 2, OFILE_CRUXSK1, 0, 0, 0, -1, -1, 0, 1, 15, 96, 1, 0, 1, 1, 3, 0 }, + { 2, OFILE_CRUXSK2, 0, 0, 0, -1, -1, 0, 1, 15, 96, 1, 0, 1, 1, 3, 0 }, + { 2, OFILE_CRUXSK3, 0, 0, 0, -1, -1, 0, 1, 15, 96, 1, 0, 1, 1, 3, 0 }, + { 1, OFILE_ROCKSTAN, 5, 5, 0, -1, -1, 0, 1, 0, 96, 1, 1, 1, 0, 0, 0 }, + { 2, OFILE_ANGEL, 0, 0, 0, -1, -1, 0, 1, 0, 96, 1, 0, 1, 0, 0, 0 }, + { 2, OFILE_BOOK2, 0, 0, 0, -1, -1, 0, 1, 0, 96, 1, 1, 1, 0, 3, 0 }, + { 2, OFILE_BURNCROS, 0, 0, 0, -1, -1, 1, 0, 10, 160, 1, 0, 0, 0, 0, 0 }, + { 2, OFILE_NUDE2, 0, 0, 0, -1, -1, 1, 3, 6, 128, 1, 0, 1, 0, 0, 0 }, + { 1, OFILE_SWITCH4, 16, 16, 0, -1, -1, 0, 1, 0, 96, 1, 1, 1, 0, 1, 1 }, + { 1, OFILE_TNUDEM, 13, 16, 0, -1, 6, 0, 1, 0, 128, 1, 0, 1, 0, 0, 0 }, { 1, OFILE_TNUDEM, 13, 16, 0, 6, 6, 0, 2, 0, 128, 1, 0, 1, 0, 0, 0 }, { 1, OFILE_TNUDEM, 13, 16, 0, 6, 6, 0, 3, 0, 128, 1, 0, 1, 0, 0, 0 }, { 1, OFILE_TNUDEM, 13, 16, 0, 6, 6, 0, 4, 0, 128, 1, 0, 1, 0, 0, 0 }, { 1, OFILE_TNUDEW, 13, 16, 0, 6, 6, 0, 1, 0, 128, 1, 0, 1, 0, 0, 0 }, { 1, OFILE_TNUDEW, 13, 16, 0, 6, 6, 0, 2, 0, 128, 1, 0, 1, 0, 0, 0 }, { 1, OFILE_TNUDEW, 13, 16, 0, 6, 6, 0, 3, 0, 128, 1, 0, 1, 0, 0, 0 }, - { 1, OFILE_TSOUL, 13, 16, 0, 255, 6, 0, 1, 0, 128, 1, 0, 1, 0, 0, 0 }, - { 1, OFILE_TSOUL, 13, 16, 0, 255, 6, 0, 2, 0, 128, 1, 0, 1, 0, 0, 0 }, - { 1, OFILE_TSOUL, 13, 16, 0, 255, 6, 0, 3, 0, 128, 1, 0, 1, 0, 0, 0 }, - { 1, OFILE_TSOUL, 13, 16, 0, 255, 6, 0, 4, 0, 128, 1, 0, 1, 0, 0, 0 }, - { 1, OFILE_TSOUL, 13, 16, 0, 255, 6, 0, 5, 0, 128, 1, 0, 1, 0, 0, 0 }, - { 1, OFILE_BOOK2, 6, 6, 0, 255, 255, 0, 4, 0, 96, 1, 1, 1, 0, 3, 0 }, - { 1, OFILE_L2DOORS, 5, 8, 2, 255, 255, 0, 1, 0, 64, 0, 0, 1, 0, 3, 1 }, - { 1, OFILE_L2DOORS, 5, 8, 2, 255, 255, 0, 2, 0, 64, 0, 0, 1, 0, 3, 1 }, - { 1, OFILE_WTORCH4, 5, 8, 2, 255, 255, 1, 1, 9, 96, 0, 1, 0, 0, 0, 0 }, - { 1, OFILE_WTORCH3, 5, 8, 2, 255, 255, 1, 1, 9, 96, 0, 1, 0, 0, 0, 0 }, - { 1, OFILE_WTORCH1, 5, 8, 2, 255, 255, 1, 1, 9, 96, 0, 1, 0, 0, 0, 0 }, - { 1, OFILE_WTORCH2, 5, 8, 2, 255, 255, 1, 1, 9, 96, 0, 1, 0, 0, 0, 0 }, - { 1, OFILE_SARC, 1, 4, 1, 255, 255, 0, 1, 5, 128, 1, 1, 1, 0, 3, 1 }, - { 2, OFILE_FLAME1, 1, 4, 1, 255, 255, 0, 1, 20, 96, 0, 1, 1, 0, 0, 0 }, - { 2, OFILE_LEVER, 1, 4, 1, 255, 255, 0, 1, 2, 96, 1, 1, 1, 0, 1, 1 }, - { 2, OFILE_MINIWATR, 1, 4, 1, 255, 255, 1, 1, 10, 64, 1, 0, 1, 0, 0, 0 }, - { 1, OFILE_BOOK1, 3, 4, 1, 255, 255, 0, 1, 0, 96, 1, 1, 1, 0, 3, 0 }, - { 1, OFILE_TRAPHOLE, 1, 16, 0, 255, 255, 0, 1, 0, 64, 0, 1, 1, 0, 0, 0 }, - { 1, OFILE_TRAPHOLE, 1, 16, 0, 255, 255, 0, 2, 0, 64, 0, 1, 1, 0, 0, 0 }, - { 2, OFILE_BCASE, 0, 0, 0, 255, 255, 0, 1, 0, 96, 1, 0, 1, 0, 0, 0 }, - { 2, OFILE_WEAPSTND, 0, 0, 0, 255, 255, 0, 1, 0, 96, 1, 0, 1, 0, 0, 0 }, - { 1, OFILE_BARREL, 1, 16, 0, 255, 255, 0, 1, 9, 96, 1, 1, 1, 1, 3, 0 }, - { 1, OFILE_BARRELEX, 1, 16, 0, 255, 255, 0, 1, 10, 96, 1, 1, 1, 1, 3, 0 }, - { 3, OFILE_LSHRINEG, 0, 0, 0, 1, 255, 0, 1, 11, 128, 0, 0, 1, 0, 3, 0 }, - { 3, OFILE_RSHRINEG, 0, 0, 0, 1, 255, 0, 1, 11, 128, 0, 0, 1, 0, 3, 0 }, - { 3, OFILE_BOOK2, 0, 0, 0, 3, 255, 0, 4, 0, 96, 1, 1, 1, 0, 3, 0 }, - { 3, OFILE_BCASE, 0, 0, 0, 5, 255, 0, 3, 0, 96, 0, 0, 1, 0, 3, 0 }, - { 3, OFILE_BCASE, 0, 0, 0, 5, 255, 0, 4, 0, 96, 0, 0, 1, 0, 3, 0 }, - { 3, OFILE_BOOK2, 0, 0, 0, 5, 255, 0, 1, 0, 96, 1, 1, 1, 0, 3, 0 }, - { 3, OFILE_CANDLE2, 0, 0, 0, 5, 255, 1, 2, 4, 96, 1, 1, 1, 0, 0, 0 }, - { 3, OFILE_BLOODFNT, 0, 0, 0, 7, 255, 1, 2, 10, 96, 1, 1, 1, 0, 3, 0 }, - { 1, OFILE_DECAP, 13, 16, 0, 8, 255, 0, 1, 0, 96, 1, 1, 1, 0, 1, 0 }, - { 1, OFILE_CHEST1, 1, 16, 0, 255, 255, 0, 1, 0, 96, 1, 1, 1, 0, 1, 1 }, - { 1, OFILE_CHEST2, 1, 16, 0, 255, 255, 0, 1, 0, 96, 1, 1, 1, 0, 1, 1 }, - { 1, OFILE_CHEST3, 1, 16, 0, 255, 255, 0, 1, 0, 96, 1, 1, 1, 0, 1, 1 }, - { 1, OFILE_BOOK1, 7, 7, 2, 255, 8, 0, 1, 0, 96, 1, 1, 1, 0, 3, 0 }, - { 1, OFILE_BOOK1, 5, 5, 2, 255, 9, 0, 4, 0, 96, 1, 1, 1, 0, 3, 0 }, - { 1, OFILE_PEDISTL, 5, 5, 2, 255, 9, 0, 1, 0, 96, 1, 1, 1, 0, 3, 0 }, - { 1, OFILE_L3DOORS, 9, 12, 3, 255, 255, 0, 1, 0, 64, 0, 0, 1, 0, 3, 1 }, - { 1, OFILE_L3DOORS, 9, 12, 3, 255, 255, 0, 2, 0, 64, 0, 0, 1, 0, 3, 1 }, - { 3, OFILE_PFOUNTN, 0, 0, 0, 9, 255, 1, 2, 10, 128, 1, 1, 1, 0, 3, 0 }, - { 3, OFILE_ARMSTAND, 0, 0, 0, 10, 255, 0, 1, 0, 96, 1, 0, 1, 0, 3, 0 }, - { 3, OFILE_ARMSTAND, 0, 0, 0, 10, 255, 0, 2, 0, 96, 1, 0, 1, 0, 0, 0 }, - { 3, OFILE_GOATSHRN, 0, 0, 0, 11, 255, 1, 2, 10, 96, 1, 1, 1, 0, 3, 0 }, - { 1, OFILE_CAULDREN, 13, 16, 0, 255, 255, 0, 1, 0, 96, 1, 0, 1, 0, 3, 0 }, - { 3, OFILE_MFOUNTN, 0, 0, 0, 13, 255, 1, 2, 10, 128, 1, 1, 1, 0, 3, 0 }, - { 3, OFILE_TFOUNTN, 0, 0, 0, 14, 255, 1, 2, 4, 128, 1, 1, 1, 0, 3, 0 }, - { 1, OFILE_ALTBOY, 0, 0, 1, 255, 15, 0, 1, 0, 128, 1, 1, 1, 0, 0, 0 }, - { 1, OFILE_MCIRL, 0, 0, 1, 255, 15, 0, 1, 0, 96, 0, 1, 1, 0, 0, 0 }, - { 1, OFILE_MCIRL, 0, 0, 1, 255, 15, 0, 1, 0, 96, 0, 1, 1, 0, 0, 0 }, - { 1, OFILE_BKSLBRNT, 4, 12, 0, 255, 255, 0, 1, 0, 96, 1, 1, 1, 0, 3, 0 }, - { 1, OFILE_CANDLE2, 2, 12, 0, 255, 15, 1, 2, 4, 96, 1, 1, 1, 0, 0, 0 }, - { 1, OFILE_BOOK1, 13, 13, 4, 255, 11, 0, 4, 0, 96, 1, 1, 1, 0, 3, 0 }, - { 1, OFILE_ARMSTAND, 13, 13, 0, 255, 11, 0, 1, 0, 96, 1, 0, 1, 0, 3, 0 }, - { 2, OFILE_WEAPSTND, 13, 13, 0, 255, 11, 0, 1, 0, 96, 1, 0, 1, 0, 3, 0 }, - { 2, OFILE_BURNCROS, 0, 0, 0, 15, 255, 1, 0, 10, 160, 1, 0, 0, 0, 0, 0 }, - { 2, OFILE_WEAPSTND, 0, 0, 0, 16, 255, 0, 1, 0, 96, 1, 0, 1, 0, 3, 0 }, - { 2, OFILE_WEAPSTND, 0, 0, 0, 16, 255, 0, 2, 0, 96, 1, 0, 1, 0, 0, 0 }, - { 2, OFILE_MUSHPTCH, 0, 0, 0, 255, 1, 0, 1, 0, 96, 1, 1, 1, 0, 3, 1 }, - { 2, OFILE_LZSTAND, 0, 0, 0, 255, 15, 0, 1, 0, 128, 1, 0, 1, 0, 3, 0 }, - { 1, OFILE_DECAP, 9, 9, 3, 255, 255, 0, 2, 0, 96, 1, 1, 1, 0, 1, 0 }, - { 2, OFILE_CHEST3, 0, 0, 0, 255, 255, 0, 1, 0, 96, 1, 1, 1, 0, 1, 1 }, - { -1, 0, 0, 0, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + { 1, OFILE_TSOUL, 13, 16, 0, -1, 6, 0, 1, 0, 128, 1, 0, 1, 0, 0, 0 }, + { 1, OFILE_TSOUL, 13, 16, 0, -1, 6, 0, 2, 0, 128, 1, 0, 1, 0, 0, 0 }, + { 1, OFILE_TSOUL, 13, 16, 0, -1, 6, 0, 3, 0, 128, 1, 0, 1, 0, 0, 0 }, + { 1, OFILE_TSOUL, 13, 16, 0, -1, 6, 0, 4, 0, 128, 1, 0, 1, 0, 0, 0 }, + { 1, OFILE_TSOUL, 13, 16, 0, -1, 6, 0, 5, 0, 128, 1, 0, 1, 0, 0, 0 }, + { 1, OFILE_BOOK2, 6, 6, 0, -1, -1, 0, 4, 0, 96, 1, 1, 1, 0, 3, 0 }, + { 1, OFILE_L2DOORS, 5, 8, 2, -1, -1, 0, 1, 0, 64, 0, 0, 1, 0, 3, 1 }, + { 1, OFILE_L2DOORS, 5, 8, 2, -1, -1, 0, 2, 0, 64, 0, 0, 1, 0, 3, 1 }, + { 1, OFILE_WTORCH4, 5, 8, 2, -1, -1, 1, 1, 9, 96, 0, 1, 0, 0, 0, 0 }, + { 1, OFILE_WTORCH3, 5, 8, 2, -1, -1, 1, 1, 9, 96, 0, 1, 0, 0, 0, 0 }, + { 1, OFILE_WTORCH1, 5, 8, 2, -1, -1, 1, 1, 9, 96, 0, 1, 0, 0, 0, 0 }, + { 1, OFILE_WTORCH2, 5, 8, 2, -1, -1, 1, 1, 9, 96, 0, 1, 0, 0, 0, 0 }, + { 1, OFILE_SARC, 1, 4, 1, -1, -1, 0, 1, 5, 128, 1, 1, 1, 0, 3, 1 }, + { 2, OFILE_FLAME1, 1, 4, 1, -1, -1, 0, 1, 20, 96, 0, 1, 1, 0, 0, 0 }, + { 2, OFILE_LEVER, 1, 4, 1, -1, -1, 0, 1, 2, 96, 1, 1, 1, 0, 1, 1 }, + { 2, OFILE_MINIWATR, 1, 4, 1, -1, -1, 1, 1, 10, 64, 1, 0, 1, 0, 0, 0 }, + { 1, OFILE_BOOK1, 3, 4, 1, -1, -1, 0, 1, 0, 96, 1, 1, 1, 0, 3, 0 }, + { 1, OFILE_TRAPHOLE, 1, 16, 0, -1, -1, 0, 1, 0, 64, 0, 1, 1, 0, 0, 0 }, + { 1, OFILE_TRAPHOLE, 1, 16, 0, -1, -1, 0, 2, 0, 64, 0, 1, 1, 0, 0, 0 }, + { 2, OFILE_BCASE, 0, 0, 0, -1, -1, 0, 1, 0, 96, 1, 0, 1, 0, 0, 0 }, + { 2, OFILE_WEAPSTND, 0, 0, 0, -1, -1, 0, 1, 0, 96, 1, 0, 1, 0, 0, 0 }, + { 1, OFILE_BARREL, 1, 16, 0, -1, -1, 0, 1, 9, 96, 1, 1, 1, 1, 3, 0 }, + { 1, OFILE_BARRELEX, 1, 16, 0, -1, -1, 0, 1, 10, 96, 1, 1, 1, 1, 3, 0 }, + { 3, OFILE_LSHRINEG, 0, 0, 0, 1, -1, 0, 1, 11, 128, 0, 0, 1, 0, 3, 0 }, + { 3, OFILE_RSHRINEG, 0, 0, 0, 1, -1, 0, 1, 11, 128, 0, 0, 1, 0, 3, 0 }, + { 3, OFILE_BOOK2, 0, 0, 0, 3, -1, 0, 4, 0, 96, 1, 1, 1, 0, 3, 0 }, + { 3, OFILE_BCASE, 0, 0, 0, 5, -1, 0, 3, 0, 96, 0, 0, 1, 0, 3, 0 }, + { 3, OFILE_BCASE, 0, 0, 0, 5, -1, 0, 4, 0, 96, 0, 0, 1, 0, 3, 0 }, + { 3, OFILE_BOOK2, 0, 0, 0, 5, -1, 0, 1, 0, 96, 1, 1, 1, 0, 3, 0 }, + { 3, OFILE_CANDLE2, 0, 0, 0, 5, -1, 1, 2, 4, 96, 1, 1, 1, 0, 0, 0 }, + { 3, OFILE_BLOODFNT, 0, 0, 0, 7, -1, 1, 2, 10, 96, 1, 1, 1, 0, 3, 0 }, + { 1, OFILE_DECAP, 13, 16, 0, 8, -1, 0, 1, 0, 96, 1, 1, 1, 0, 1, 0 }, + { 1, OFILE_CHEST1, 1, 16, 0, -1, -1, 0, 1, 0, 96, 1, 1, 1, 0, 1, 1 }, + { 1, OFILE_CHEST2, 1, 16, 0, -1, -1, 0, 1, 0, 96, 1, 1, 1, 0, 1, 1 }, + { 1, OFILE_CHEST3, 1, 16, 0, -1, -1, 0, 1, 0, 96, 1, 1, 1, 0, 1, 1 }, + { 1, OFILE_BOOK1, 7, 7, 2, -1, 8, 0, 1, 0, 96, 1, 1, 1, 0, 3, 0 }, + { 1, OFILE_BOOK1, 5, 5, 2, -1, 9, 0, 4, 0, 96, 1, 1, 1, 0, 3, 0 }, + { 1, OFILE_PEDISTL, 5, 5, 2, -1, 9, 0, 1, 0, 96, 1, 1, 1, 0, 3, 0 }, + { 1, OFILE_L3DOORS, 9, 12, 3, -1, -1, 0, 1, 0, 64, 0, 0, 1, 0, 3, 1 }, + { 1, OFILE_L3DOORS, 9, 12, 3, -1, -1, 0, 2, 0, 64, 0, 0, 1, 0, 3, 1 }, + { 3, OFILE_PFOUNTN, 0, 0, 0, 9, -1, 1, 2, 10, 128, 1, 1, 1, 0, 3, 0 }, + { 3, OFILE_ARMSTAND, 0, 0, 0, 10, -1, 0, 1, 0, 96, 1, 0, 1, 0, 3, 0 }, + { 3, OFILE_ARMSTAND, 0, 0, 0, 10, -1, 0, 2, 0, 96, 1, 0, 1, 0, 0, 0 }, + { 3, OFILE_GOATSHRN, 0, 0, 0, 11, -1, 1, 2, 10, 96, 1, 1, 1, 0, 3, 0 }, + { 1, OFILE_CAULDREN, 13, 16, 0, -1, -1, 0, 1, 0, 96, 1, 0, 1, 0, 3, 0 }, + { 3, OFILE_MFOUNTN, 0, 0, 0, 13, -1, 1, 2, 10, 128, 1, 1, 1, 0, 3, 0 }, + { 3, OFILE_TFOUNTN, 0, 0, 0, 14, -1, 1, 2, 4, 128, 1, 1, 1, 0, 3, 0 }, + { 1, OFILE_ALTBOY, 0, 0, 1, -1, 15, 0, 1, 0, 128, 1, 1, 1, 0, 0, 0 }, + { 1, OFILE_MCIRL, 0, 0, 1, -1, 15, 0, 1, 0, 96, 0, 1, 1, 0, 0, 0 }, + { 1, OFILE_MCIRL, 0, 0, 1, -1, 15, 0, 1, 0, 96, 0, 1, 1, 0, 0, 0 }, + { 1, OFILE_BKSLBRNT, 4, 12, 0, -1, -1, 0, 1, 0, 96, 1, 1, 1, 0, 3, 0 }, + { 1, OFILE_CANDLE2, 2, 12, 0, -1, 15, 1, 2, 4, 96, 1, 1, 1, 0, 0, 0 }, + { 1, OFILE_BOOK1, 13, 13, 4, -1, 11, 0, 4, 0, 96, 1, 1, 1, 0, 3, 0 }, + { 1, OFILE_ARMSTAND, 13, 13, 0, -1, 11, 0, 1, 0, 96, 1, 0, 1, 0, 3, 0 }, + { 2, OFILE_WEAPSTND, 13, 13, 0, -1, 11, 0, 1, 0, 96, 1, 0, 1, 0, 3, 0 }, + { 2, OFILE_BURNCROS, 0, 0, 0, 15, -1, 1, 0, 10, 160, 1, 0, 0, 0, 0, 0 }, + { 2, OFILE_WEAPSTND, 0, 0, 0, 16, -1, 0, 1, 0, 96, 1, 0, 1, 0, 3, 0 }, + { 2, OFILE_WEAPSTND, 0, 0, 0, 16, -1, 0, 2, 0, 96, 1, 0, 1, 0, 0, 0 }, + { 2, OFILE_MUSHPTCH, 0, 0, 0, -1, 1, 0, 1, 0, 96, 1, 1, 1, 0, 3, 1 }, + { 2, OFILE_LZSTAND, 0, 0, 0, -1, 15, 0, 1, 0, 128, 1, 0, 1, 0, 3, 0 }, + { 1, OFILE_DECAP, 9, 9, 3, -1, -1, 0, 2, 0, 96, 1, 1, 1, 0, 1, 0 }, + { 2, OFILE_CHEST3, 0, 0, 0, -1, -1, 0, 1, 0, 96, 1, 1, 1, 0, 1, 1 }, + { -1, 0, 0, 0, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } }; char *ObjMasterLoadList[56] = { @@ -5456,7 +5456,7 @@ LABEL_47: v60 = random(v7, 37); v7 = v60; } - while ( !(plr[v53]._pMemSpells[1] & ((unsigned __int64)(1i64 << v60) >> 32) | plr[v53]._pMemSpells[0] & (unsigned int)(1i64 << v60)) ); + while ( !(plr[v53]._pMemSpells[1] & ((unsigned __int64)(1 << v60) >> 32) | plr[v53]._pMemSpells[0] & (unsigned int)(1 << v60)) ); v61 = &plr[v53]._pSplLvl[v60 + 1]; if ( *v61 < 2 ) *v61 = 0; diff --git a/Source/player.cpp b/Source/player.cpp index 3379ace..edb576a 100644 --- a/Source/player.cpp +++ b/Source/player.cpp @@ -3938,14 +3938,14 @@ int __fastcall PM_DoSpell(int pnum) if ( !plr[v2]._pSplFrom ) { if ( _LOBYTE(plr[v2]._pRSplType) == 2 - && !(plr[v2]._pScrlSpells[1] & ((unsigned __int64)(1i64 << (_LOBYTE(plr[v2]._pRSpell) - 1)) >> 32) | plr[v2]._pScrlSpells[0] & (unsigned int)(1i64 << (_LOBYTE(plr[v2]._pRSpell) - 1))) ) + && !(plr[v2]._pScrlSpells[1] & ((unsigned __int64)(1 << (_LOBYTE(plr[v2]._pRSpell) - 1)) >> 32) | plr[v2]._pScrlSpells[0] & (unsigned int)(1 << (_LOBYTE(plr[v2]._pRSpell) - 1))) ) { plr[v2]._pRSpell = -1; _LOBYTE(plr[v2]._pRSplType) = 4; drawpanflag = 255; } if ( _LOBYTE(plr[v2]._pRSplType) == 3 - && !(plr[v2]._pISpells[1] & ((unsigned __int64)(1i64 << (_LOBYTE(plr[v2]._pRSpell) - 1)) >> 32) | plr[v2]._pISpells[0] & (unsigned int)(1i64 << (_LOBYTE(plr[v2]._pRSpell) - 1))) ) + && !(plr[v2]._pISpells[1] & ((unsigned __int64)(1 << (_LOBYTE(plr[v2]._pRSpell) - 1)) >> 32) | plr[v2]._pISpells[0] & (unsigned int)(1 << (_LOBYTE(plr[v2]._pRSpell) - 1))) ) { plr[v2]._pRSpell = -1; _LOBYTE(plr[v2]._pRSplType) = 4; @@ -4663,7 +4663,7 @@ void __cdecl ValidatePlayer() __int64 v14; // [esp+Ch] [ebp-8h] v0 = 0; - v14 = 0i64; + v14 = 0; if ( (unsigned int)myplr >= 4 ) TermMsg("ValidatePlayer: illegal player %d", myplr); v1 = myplr; @@ -4711,7 +4711,7 @@ void __cdecl ValidatePlayer() { if ( *v11 != -1 ) { - v14 |= 1i64 << ((unsigned char)v12 - 1); + v14 |= 1 << ((unsigned char)v12 - 1); v13 = &plr[v1]._pSplLvl[v12]; if ( *v13 > 15 ) *v13 = 15; diff --git a/Source/quests.cpp b/Source/quests.cpp index 621872b..9e15b39 100644 --- a/Source/quests.cpp +++ b/Source/quests.cpp @@ -27,21 +27,21 @@ int ReturnLvl; // idb QuestData questlist[16] = { - { 5, 255, DTYPE_NONE, 0, 100, 0, 0, QUEST_INFRA5, "The Magic Rock" }, - { 9, 255, DTYPE_NONE, 1, 100, 0, 0, QUEST_MUSH8, "Black Mushroom" }, - { 4, 255, DTYPE_NONE, 2, 100, 0, 0, QUEST_GARBUD1, "Gharbad The Weak" }, - { 8, 255, DTYPE_NONE, 3, 100, 0, 0, QUEST_ZHAR1, "Zhar the Mad" }, - { 14, 255, DTYPE_NONE, 4, 100, 0, 0, QUEST_VEIL9, "Lachdanan" }, - { 15, 255, DTYPE_NONE, 5, 100, 0, 1, QUEST_VILE3, "Diablo" }, + { 5, -1, DTYPE_NONE, 0, 100, 0, 0, QUEST_INFRA5, "The Magic Rock" }, + { 9, -1, DTYPE_NONE, 1, 100, 0, 0, QUEST_MUSH8, "Black Mushroom" }, + { 4, -1, DTYPE_NONE, 2, 100, 0, 0, QUEST_GARBUD1, "Gharbad The Weak" }, + { 8, -1, DTYPE_NONE, 3, 100, 0, 0, QUEST_ZHAR1, "Zhar the Mad" }, + { 14, -1, DTYPE_NONE, 4, 100, 0, 0, QUEST_VEIL9, "Lachdanan" }, + { 15, -1, DTYPE_NONE, 5, 100, 0, 1, QUEST_VILE3, "Diablo" }, { 2, 2, DTYPE_NONE, 6, 100, 0, 1, QUEST_BUTCH9, "The Butcher" }, - { 4, 255, DTYPE_NONE, 7, 100, 0, 0, QUEST_BANNER2, "Ogden's Sign" }, - { 7, 255, DTYPE_NONE, 8, 100, 0, 0, QUEST_BLINDING, "Halls of the Blind" }, - { 5, 255, DTYPE_NONE, 9, 100, 0, 0, QUEST_BLOODY, "Valor" }, - { 10, 255, DTYPE_NONE, 10, 100, 0, 0, QUEST_ANVIL5, "Anvil of Fury" }, - { 13, 255, DTYPE_NONE, 11, 100, 0, 0, QUEST_BLOODWAR, "Warlord of Blood" }, + { 4, -1, DTYPE_NONE, 7, 100, 0, 0, QUEST_BANNER2, "Ogden's Sign" }, + { 7, -1, DTYPE_NONE, 8, 100, 0, 0, QUEST_BLINDING, "Halls of the Blind" }, + { 5, -1, DTYPE_NONE, 9, 100, 0, 0, QUEST_BLOODY, "Valor" }, + { 10, -1, DTYPE_NONE, 10, 100, 0, 0, QUEST_ANVIL5, "Anvil of Fury" }, + { 13, -1, DTYPE_NONE, 11, 100, 0, 0, QUEST_BLOODWAR, "Warlord of Blood" }, { 3, 3, DTYPE_CATHEDRAL, 12, 100, 1, 1, QUEST_KING2, "The Curse of King Leoric" }, - { 2, 255, DTYPE_CAVES, 13, 100, 4, 0, QUEST_POISON3, "Poisoned Water Supply" }, - { 6, 255, DTYPE_CATACOMBS, 14, 100, 2, 0, QUEST_BONER, "The Chamber of Bone" }, + { 2, -1, DTYPE_CAVES, 13, 100, 4, 0, QUEST_POISON3, "Poisoned Water Supply" }, + { 6, -1, DTYPE_CATACOMBS, 14, 100, 2, 0, QUEST_BONER, "The Chamber of Bone" }, { 15, 15, DTYPE_CATHEDRAL, 15, 100, 5, 1, QUEST_VILE1, "Archbishop Lazarus" } }; char questxoff[7] = { 0, -1, 0, -1, -2, -1, -2 }; diff --git a/Source/sound.cpp b/Source/sound.cpp index afebefc..d8d30f1 100644 --- a/Source/sound.cpp +++ b/Source/sound.cpp @@ -38,7 +38,7 @@ char *sgszMusicTracks[6] = "Music\\DLvlD.wav", "Music\\Dintro.wav" }; -RECT8 QSRect[2] = { { { 15u, 240u }, { 15u, 240u } }, { { 30u, 225u }, { 30u, 225u } } }; /* psx version? */ +RECT8 QSRect[2] = { { { 15, -16 }, { 15, -16 } }, { { 30, -31 }, { 30, -31 } } }; /* psx version? */ //----- (00456CC0) -------------------------------------------------------- struct sound_cpp_init diff --git a/Source/world.cpp b/Source/world.cpp index 2fa0413..a8014a0 100644 --- a/Source/world.cpp +++ b/Source/world.cpp @@ -15,7 +15,7 @@ int world_4B325C = 0; // truncated with & 1, some kind of bool?? unsigned char world_4B3260[5] = { 0u, 0u, 0u, 0u, 0u }; // single mask, int nTileMask int world_4B3265 = 0; // speed cel num int world_4B3269[5] = { 0, 0, 0, 0, 0 }; // seems to be a single pointer, void *pTileMask -int tile_draw_masks[3][32] = +unsigned int tile_draw_masks[3][32] = { { 0xEAAAAAAA, 0xF5555555, 0xFEAAAAAA, 0xFF555555, 0xFFEAAAAA, 0xFFF55555, 0xFFFEAAAA, 0xFFFF5555, diff --git a/Source/world.h b/Source/world.h index 0cdfe7a..8b9b450 100644 --- a/Source/world.h +++ b/Source/world.h @@ -23,7 +23,7 @@ extern int world_4B325C; extern unsigned char world_4B3260[5]; extern int world_4B3265; extern int world_4B3269[5]; -extern int tile_draw_masks[3][32]; +extern unsigned int tile_draw_masks[3][32]; extern int world_4B33FD[48]; extern int world_4B34BD[17]; extern int world_4B3501[17]; diff --git a/enums.h b/enums.h index dbf78eb..f27c1ea 100644 --- a/enums.h +++ b/enums.h @@ -69,7 +69,7 @@ enum unique_base_item UITYPE_GRISWOLD = 0x42, UITYPE_LGTFORGE = 0x43, UITYPE_LAZSTAFF = 0x44, - UITYPE_INVALID = 0xFF, + UITYPE_INVALID = -1, }; enum item_effect_type @@ -145,7 +145,7 @@ enum item_effect_type IPL_ADDMANAAC = 0x4D, IPL_FIRERESCLVL = 0x4E, IPL_AC_CURSE = 0x4F, - IPL_INVALID = 0xFF, + IPL_INVALID = -1, }; enum affix_item_type @@ -1031,7 +1031,7 @@ enum item_equip_type ILOC_AMULET = 0x6, ILOC_UNEQUIPABLE = 0x7, ILOC_BELT = 0x8, - ILOC_INVALID = 0xFF, + ILOC_INVALID = -1, }; enum missile_id diff --git a/structs.h b/structs.h index f525609..bacd6ec 100644 --- a/structs.h +++ b/structs.h @@ -76,7 +76,7 @@ struct TSFX struct TMenuItem { - int dwFlags; + unsigned int dwFlags; char *pszStr; void (__cdecl *fnMenu)(); /* fix, should have one arg */ }; @@ -248,8 +248,8 @@ struct SpellData struct Coord { - unsigned char x; - unsigned char y; + char x; + char y; }; struct RECT8 @@ -813,7 +813,7 @@ struct PlayerStruct char _pSBkSplType; char _pSplLvl[64]; int remove_1; - int _pMemSpells[2]; // __declspec(align(8)) + int _pMemSpells[2]; // __declspec(align(8)) int _pAblSpells[2]; int _pScrlSpells[2]; int _pSpellFlags; @@ -909,7 +909,7 @@ struct PlayerStruct int _pIBonusAC; int _pIBonusDamMod; int remove_2; - int _pISpells[2]; //__declspec(align(8)) + int _pISpells[2]; //__declspec(align(8)) int _pIFlags; int _pIGetHit; char _pISplLvlAdd; diff --git a/types.h b/types.h index e9ca419..6608a2a 100644 --- a/types.h +++ b/types.h @@ -32,7 +32,7 @@ #include "enums.h" #include "structs.h" -#include "DiabloUI/_diabloui.h" +#include "DiabloUI/_DiabloUI.h" #include "3rdParty/Storm/Source/_storm.h" #include "3rdParty/PKWare/pkware.h" From 1836399875bbd5cb18075c60f05773241f159551 Mon Sep 17 00:00:00 2001 From: mewmew Date: Fri, 8 Jun 2018 01:28:20 +0200 Subject: [PATCH 2/2] Fix linking against storm.dll and diabloui.dll * add aliases for storm exports to handle __stdcall calling convention on Linux * mark external functions as extern "C" --- .gitignore | 4 + 3rdParty/Storm/Source/_storm.h | 480 +++++++++++++++---------------- 3rdParty/Storm/Source/storm.def | 61 +++- 3rdParty/Storm/Source/storm.h | 485 ++++++++++++++++---------------- DiabloUI/_DiabloUI.h | 52 ++-- Makefile | 24 ++ 6 files changed, 594 insertions(+), 512 deletions(-) create mode 100644 .gitignore create mode 100644 Makefile diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dd68893 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +*.o +*.lib +*.dll +*.exe diff --git a/3rdParty/Storm/Source/_storm.h b/3rdParty/Storm/Source/_storm.h index ea544c9..fe7beec 100644 --- a/3rdParty/Storm/Source/_storm.h +++ b/3rdParty/Storm/Source/_storm.h @@ -61,32 +61,32 @@ typedef struct _WSIZE #define GAMESTATE_REPLAY 0x80 -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 SNetEnumProviders(int (STORMAPI *callback)(DWORD, DWORD, DWORD, DWORD), int mincaps); +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); +extern "C" BOOL STORMAPI SNetDestroy(); +extern "C" BOOL STORMAPI SNetEnumProviders(int (STORMAPI *callback)(DWORD, DWORD, DWORD, DWORD), int mincaps); -BOOL STORMAPI SNetEnumGames(int (STORMAPI *callback)(DWORD, DWORD, DWORD), int *hintnextcall); +extern "C" BOOL STORMAPI SNetEnumGames(int (STORMAPI *callback)(DWORD, DWORD, DWORD), int *hintnextcall); /* SNetDropPlayer @ 106 - * + * * Drops a player from the current game. - * + * * playerid: The player ID for the player to be dropped. - * flags: + * flags: * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetDropPlayer( int playerid, DWORD flags); /* SNetGetGameInfo @ 107 - * + * * Retrieves specific game information from Storm, such as name, password, * stats, mode, game template, and players. - * + * * type: The type of data to retrieve. See GAMEINFO_ flags. * dst: The destination buffer for the data. * length: The maximum size of the destination buffer. @@ -94,7 +94,7 @@ SNetDropPlayer( * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetGetGameInfo( int type, @@ -116,7 +116,7 @@ SNetGetGameInfo( #define GAMEINFO_PLAYERS 6 -BOOL STORMAPI SNetGetNumPlayers(int *firstplayerid, int *lastplayerid, int *activeplayers); +extern "C" BOOL STORMAPI SNetGetNumPlayers(int *firstplayerid, int *lastplayerid, int *activeplayers); typedef struct _CAPS @@ -133,54 +133,54 @@ typedef struct _CAPS } CAPS, *PCAPS; -BOOL STORMAPI SNetGetPlayerCaps(char playerid, PCAPS playerCaps); +extern "C" BOOL STORMAPI SNetGetPlayerCaps(char playerid, PCAPS playerCaps); /* SNetGetPlayerName @ 113 - * + * * Retrieves the name of a player given their player ID. - * + * * playerid: The player's ID. * buffer: The buffer that will receive the name. * buffersize: The maximum size of buffer. * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetGetPlayerName( - int playerid, - char *buffer, + int playerid, + char *buffer, size_t buffersize); /* SNetGetProviderCaps @ 114 - * + * * Retrieves network provider capacity information. - * + * * providerCaps: A pointer to a CAPS structure that will receive the information. * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL -STORMAPI +extern "C" BOOL +STORMAPI SNetGetProviderCaps( _SNETCAPS *providerCaps); /* SNetGetTurnsInTransit @ 115 - * + * * Retrieves the number of turns (buffers) that have been queued * before sending them over the network. - * + * * turns: A pointer to an integer that will receive the value. * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetGetTurnsInTransit( int *turns); -BOOL STORMAPI SNetInitializeDevice(int a1, int a2, int a3, int a4, int *a5); +extern "C" BOOL STORMAPI SNetInitializeDevice(int a1, int a2, int a3, int a4, int *a5); // Network provider structures typedef struct _client_info @@ -285,16 +285,16 @@ typedef struct _storm_head /* SNetInitializeProvider @ 117 - * + * * Initializes a provider by storing the provider callbacks, and calling * spiInitialize() using the parameters passed to this function. * Note: The use of the parameters is determined by the network * module. - * + * * providerName: The provider's identifier. Example: 'TENB' (BNET). - * gameClientInfo: A pointer to a clientInfo structure containing + * gameClientInfo: A pointer to a clientInfo structure containing * information about the game client. - * userData: A pointer to a userInfo structure containing information + * userData: A pointer to a userInfo structure containing information * about the player. * bnCallbacks: A pointer to a battleInfo structure containing callbacks * and other information that is specific to Battle.net. @@ -303,35 +303,35 @@ typedef struct _storm_head * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetInitializeProvider( - DWORD providerName, + DWORD providerName, _SNETPROGRAMDATA *gameClientInfo, _SNETPLAYERDATA *userData, - _SNETUIDATA *bnCallbacks, + _SNETUIDATA *bnCallbacks, _SNETVERSIONDATA *moduleData); -BOOL STORMAPI SNetJoinGame(int id, char *gameName, char *gamePassword, char *playerName, char *userStats, int *playerid); +extern "C" BOOL STORMAPI SNetJoinGame(int id, char *gameName, char *gamePassword, char *playerName, char *userStats, int *playerid); /* SNetLeaveGame @ 119 - * + * * Notifies Storm that the player has left the game. Storm will * notify all connected peers through the network provider. - * + * * type: The leave type. It doesn't appear to be important, no documentation available. * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetLeaveGame( int type); -BOOL STORMAPI SNetPerformUpgrade(DWORD *upgradestatus); -BOOL STORMAPI SNetReceiveMessage(int *senderplayerid, char **data, int *databytes); -BOOL STORMAPI SNetReceiveTurns(int a1, int arraysize, char **arraydata, unsigned int *arraydatabytes, DWORD *arrayplayerstatus); +extern "C" BOOL STORMAPI SNetPerformUpgrade(DWORD *upgradestatus); +extern "C" BOOL STORMAPI SNetReceiveMessage(int *senderplayerid, char **data, int *databytes); +extern "C" BOOL STORMAPI SNetReceiveTurns(int a1, int arraysize, char **arraydata, unsigned int *arraydatabytes, DWORD *arrayplayerstatus); // Values for arrayplayerstatus #define SNET_PS_OK 0 @@ -351,17 +351,17 @@ typedef struct _s_evt // @TODO: "type" is unknown. -HANDLE STORMAPI SNetRegisterEventHandler(int type, void (STORMAPI *sEvent)(_SNETEVENT *)); -HANDLE STORMAPI SNetUnregisterEventHandler(int type, void (STORMAPI *sEvent)(_SNETEVENT *)); +extern "C" HANDLE STORMAPI SNetRegisterEventHandler(int type, void (STORMAPI *sEvent)(_SNETEVENT)); +extern "C" HANDLE STORMAPI SNetUnregisterEventHandler(int type, void (STORMAPI *sEvent)(_SNETEVENT *)); -int STORMAPI SNetSelectGame(int a1, int a2, int a3, int a4, int a5, int *playerid); +extern "C" int STORMAPI SNetSelectGame(int a1, int a2, int a3, int a4, int a5, int *playerid); /* SNetSendMessage @ 127 - * + * * Sends a message to a player given their player ID. Network message * is sent using class 01 and is retrieved by the other client using * SNetReceiveMessage(). - * + * * playerID: The player index of the player to receive the data. * Conversely, this field can be one of the following constants: * SNPLAYER_ALL | Sends the message to all players, including oneself. @@ -371,7 +371,7 @@ int STORMAPI SNetSelectGame(int a1, int a2, int a3, int a4, int a5, int *player * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetSendMessage( int playerID, @@ -385,29 +385,29 @@ SNetSendMessage( /* SNetSendTurn @ 128 - * + * * Sends a turn (data packet) to all players in the game. Network data * is sent using class 02 and is retrieved by the other client using * SNetReceiveTurns(). - * + * * data: A pointer to the data. * databytes: The amount of bytes that the data pointer contains. * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetSendTurn( char *data, size_t databytes); /* SNetSetGameMode @ 130 - * + * * Set's the game's mode flags, notifying the network * provider that the state of the game has changed. * For example: notifies Battle.net when the game is * full. - * + * * You should first call SNetGetGameInfo to retrieve * the existing mode flags. * @@ -421,7 +421,7 @@ SNetSendTurn( * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetSetGameMode( DWORD modeFlags, @@ -429,59 +429,59 @@ SNetSetGameMode( #define SNMakeGamePublic() SNetSetGameMode( (DWORD mode, SNetGetGameInfo(GAMEINFO_MODEFLAGS, &mode, 4), mode), true) -BOOL STORMAPI SNetEnumGamesEx(int a1, int a2, int (__fastcall *callback)(DWORD, DWORD, DWORD), int *hintnextcall); -BOOL STORMAPI SNetSendServerChatCommand(const char *command); +extern "C" BOOL STORMAPI SNetEnumGamesEx(int a1, int a2, int (__fastcall *callback)(DWORD, DWORD, DWORD), int *hintnextcall); +extern "C" BOOL STORMAPI SNetSendServerChatCommand(const char *command); -BOOL STORMAPI SNetDisconnectAll(DWORD flags); -BOOL STORMAPI SNetCreateLadderGame(const char *pszGameName, const char *pszGamePassword, const char *pszGameStatString, DWORD dwGameType, DWORD dwGameLadderType, DWORD dwGameModeFlags, char *GameTemplateData, int GameTemplateSize, int playerCount, char *creatorName, char *a11, int *playerID); +extern "C" BOOL STORMAPI SNetDisconnectAll(DWORD flags); +extern "C" BOOL STORMAPI SNetCreateLadderGame(const char *pszGameName, const char *pszGamePassword, const char *pszGameStatString, DWORD dwGameType, DWORD dwGameLadderType, DWORD dwGameModeFlags, char *GameTemplateData, int GameTemplateSize, int playerCount, char *creatorName, char *a11, int *playerID); #define SNET_GAME_RESULT_WIN 1 #define SNET_GAME_RESULT_LOSS 2 #define SNET_GAME_RESULT_DRAW 3 #define SNET_GAME_RESULT_DISCONNECT 4 -BOOL STORMAPI SNetReportGameResult(unsigned a1, int size, int *results, const char* headerInfo, const char* detailInfo); +extern "C" BOOL STORMAPI SNetReportGameResult(unsigned a1, int size, int *results, const char* headerInfo, const char* detailInfo); -int STORMAPI SNetSendLeagueCommand(char *cmd, char *callback); -int STORMAPI SNetSendReplayPath(int a1, int a2, char *replayPath); -int STORMAPI SNetGetLeagueName(int leagueID); -BOOL STORMAPI SNetGetPlayerNames(char **names); -int STORMAPI SNetLeagueLogout(char *bnetName); -int STORMAPI SNetGetLeaguePlayerName(char *curPlayerLeageName, size_t nameSize); +extern "C" int STORMAPI SNetSendLeagueCommand(char *cmd, char *callback); +extern "C" int STORMAPI SNetSendReplayPath(int a1, int a2, char *replayPath); +extern "C" int STORMAPI SNetGetLeagueName(int leagueID); +extern "C" BOOL STORMAPI SNetGetPlayerNames(char **names); +extern "C" int STORMAPI SNetLeagueLogout(char *bnetName); +extern "C" int STORMAPI SNetGetLeaguePlayerName(char *curPlayerLeageName, size_t nameSize); -HGDIOBJ STORMAPI SDlgDefDialogProc(HWND hDlg, signed int DlgType, HDC textLabel, HWND hWnd); +extern "C" HGDIOBJ STORMAPI SDlgDefDialogProc(HWND hDlg, signed int DlgType, HDC textLabel, HWND hWnd); -HANDLE STORMAPI SDlgDialogBoxIndirectParam(HMODULE hModule, LPCSTR lpName, HWND hWndParent, LPVOID lpParam, LPARAM lParam); +extern "C" HANDLE STORMAPI SDlgDialogBoxIndirectParam(HMODULE hModule, LPCSTR lpName, HWND hWndParent, LPVOID lpParam, LPARAM lParam); -BOOL STORMAPI SDlgEndDialog(HWND hDlg, HANDLE nResult); +extern "C" BOOL STORMAPI SDlgEndDialog(HWND hDlg, HANDLE nResult); -BOOL STORMAPI SDlgSetControlBitmaps(HWND parentwindow, int *id, int a3, char *buffer2, char *buffer, int flags, int mask); +extern "C" BOOL STORMAPI SDlgSetControlBitmaps(HWND parentwindow, int *id, int a3, char *buffer2, char *buffer, int flags, int mask); /* -// lpCursorName can only be IDC_ARROW +// lpCursorName can only be IDC_ARROW BOOL STORMAPI SDlgSetSystemCursor(void *lpSrcBuffer, void *p_a2, LPSIZE lpSize, LPCSTR lpCursorName); */ -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); +extern "C" BOOL STORMAPI SDlgBltToWindowE(HWND hWnd, HRGN a2, char *a3, int a4, void *buffer, RECT *rct, SIZE *size, int a8, int a9, DWORD rop); +extern "C" BOOL STORMAPI SDlgSetBitmapE(HWND hWnd, int a2, char *src, int mask1, int flags, int a6, int a7, int width, int a9, int mask2); -int STORMAPI Ordinal224(int a1); +extern "C" int STORMAPI Ordinal224(int a1); -BOOL STORMAPI SFileCloseArchive(HANDLE hArchive); -BOOL STORMAPI SFileCloseFile(HANDLE hFile); +extern "C" BOOL STORMAPI SFileCloseArchive(HANDLE hArchive); +extern "C" BOOL STORMAPI SFileCloseFile(HANDLE hFile); -BOOL STORMAPI SFileDdaBeginEx(HANDLE directsound, DWORD flags, DWORD mask, unsigned __int32 lDistanceToMove, signed __int32 volume, signed int a6, int a7); -BOOL STORMAPI SFileDdaDestroy(); -BOOL STORMAPI SFileDdaEnd(HANDLE directsound); -BOOL STORMAPI SFileDdaGetPos(HANDLE directsound, int a2, int a3); +extern "C" BOOL STORMAPI SFileDdaBeginEx(HANDLE directsound, DWORD flags, DWORD mask, unsigned __int32 lDistanceToMove, signed __int32 volume, signed int a6, int a7); +extern "C" BOOL STORMAPI SFileDdaDestroy(); +extern "C" BOOL STORMAPI SFileDdaEnd(HANDLE directsound); +extern "C" BOOL STORMAPI SFileDdaGetPos(HANDLE directsound, int a2, int a3); -BOOL STORMAPI SFileDdaInitialize(HANDLE directsound); -BOOL STORMAPI SFileDdaSetVolume(HANDLE directsound, signed int bigvolume, signed int volume); -BOOL STORMAPI SFileDestroy(); +extern "C" BOOL STORMAPI SFileDdaInitialize(HANDLE directsound); +extern "C" BOOL STORMAPI SFileDdaSetVolume(HANDLE directsound, signed int bigvolume, signed int volume); +extern "C" BOOL STORMAPI SFileDestroy(); -BOOL STORMAPI SFileGetFileArchive(HANDLE hFile, HANDLE archive); -LONG STORMAPI SFileGetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh); -BOOL STORMAPI SFileOpenArchive(const char *szMpqName, DWORD dwPriority, DWORD dwFlags, HANDLE *phMpq); +extern "C" BOOL STORMAPI SFileGetFileArchive(HANDLE hFile, HANDLE archive); +extern "C" LONG STORMAPI SFileGetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh); +extern "C" BOOL STORMAPI SFileOpenArchive(const char *szMpqName, DWORD dwPriority, DWORD dwFlags, HANDLE *phMpq); // values for dwFlags enum MPQFlags @@ -493,8 +493,8 @@ enum MPQFlags }; -BOOL STORMAPI SFileOpenFile(const char *filename, HANDLE *phFile); -BOOL STORMAPI SFileOpenFileEx(HANDLE hMpq, const char *szFileName, DWORD dwSearchScope, HANDLE *phFile); +extern "C" BOOL STORMAPI SFileOpenFile(const char *filename, HANDLE *phFile); +extern "C" BOOL STORMAPI SFileOpenFileEx(HANDLE hMpq, const char *szFileName, DWORD dwSearchScope, HANDLE *phFile); // values for dwSearchScope enum SFileFlags @@ -505,22 +505,22 @@ enum SFileFlags SFILE_FROM_DISK = 0x00000004 }; -BOOL STORMAPI SFileReadFile(HANDLE hFile, void *buffer, DWORD nNumberOfBytesToRead, DWORD *read, LONG lpDistanceToMoveHigh); +extern "C" BOOL STORMAPI SFileReadFile(HANDLE hFile, void *buffer, DWORD nNumberOfBytesToRead, DWORD *read, LONG lpDistanceToMoveHigh); -void STORMAPI SFileSetLocale(LCID lcLocale); +extern "C" void STORMAPI SFileSetLocale(LCID lcLocale); // mode: 0 - Silent (callback is NULL) // 1 - Application Defined // 2 - Handled by storm (callback is NULL) // BOOL STORMAPI callback(const char *pszFilename, DWORD dwErrCode, DWORD dwErrCount) -BOOL STORMAPI SFileSetIoErrorMode(DWORD mode, BOOL (STORMAPI *callback)(const char*,DWORD,DWORD) ); +extern "C" BOOL STORMAPI SFileSetIoErrorMode(DWORD mode, BOOL (STORMAPI *callback)(const char*,DWORD,DWORD) ); -BOOL STORMAPI SFileGetArchiveName(HANDLE hArchive, char *name, int length); -BOOL STORMAPI SFileGetFileName(HANDLE hFile, char *buffer, int length); +extern "C" BOOL STORMAPI SFileGetArchiveName(HANDLE hArchive, char *name, int length); +extern "C" BOOL STORMAPI SFileGetFileName(HANDLE hFile, char *buffer, int length); -BOOL STORMAPI SFileLoadFile(char *filename, void *buffer, int buffersize, int a4, int a5); -BOOL STORMAPI SFileUnloadFile(HANDLE hFile); -BOOL STORMAPI SFileLoadFileEx(void *hArchive, char *filename, int a3, int a4, int a5, DWORD searchScope, struct _OVERLAPPED *lpOverlapped); +extern "C" BOOL STORMAPI SFileLoadFile(char *filename, void *buffer, int buffersize, int a4, int a5); +extern "C" BOOL STORMAPI SFileUnloadFile(HANDLE hFile); +extern "C" BOOL STORMAPI SFileLoadFileEx(void *hArchive, char *filename, int a3, int a4, int a5, DWORD searchScope, struct _OVERLAPPED *lpOverlapped); // Options are DWORD except for #6 // 1: [TRUE|FALSE] - If true, reports resource leaks (SErrReportResourceLeak/SErrReportNamedResourceLeak) to the attached debugger instead of a message box. @@ -534,8 +534,8 @@ BOOL STORMAPI SFileLoadFileEx(void *hArchive, char *filename, int a3, int a4, in //BOOL STORMAPI StormGetOption(int type, void *pValue, size_t *pSize); //BOOL STORMAPI StormSetOption(int type, void *pValue, size_t size); -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); +extern "C" BOOL STORMAPI SBltROP3(void *lpDstBuffer, void *lpSrcBuffer, int srcDrawWidth, int srcDrawHeight, int dstWidth, int srcWidth, int a7, DWORD rop); +extern "C" BOOL STORMAPI SBltROP3Clipped(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_BMP 1 @@ -544,15 +544,15 @@ BOOL STORMAPI SBltROP3Clipped(void *lpDstBuffer, RECT *lpDstRect, POINT *lpDstPt /* SBmpDecodeImage @ 321 - * + * * Decodes an image that has already been loaded into a buffer. - * + * * dwImgType: Optional, the image type. See SBMP_ macros. * pSrcBuffer: A pointer to the source buffer. * dwSrcBuffersize: The size of the data in the source buffer. * pPalette: An optional buffer that receives the image palette. * pDstBuffer: A buffer that receives the image data. - * dwDstBuffersize: The size of the specified image buffer. If the size of the + * dwDstBuffersize: The size of the specified image buffer. If the size of the * destination buffer is 0, then the destination buffer is not used. * pdwWidth: An optional variable that receives the image width. * pdwHeight: An optional variable that receives the image height. @@ -560,8 +560,8 @@ BOOL STORMAPI SBltROP3Clipped(void *lpDstBuffer, RECT *lpDstRect, POINT *lpDstPt * * Returns TRUE if the image was supported and decoded correctly, FALSE otherwise. */ -BOOL -STORMAPI +extern "C" BOOL +STORMAPI SBmpDecodeImage( DWORD dwImgType, void *pSrcBuffer, @@ -575,9 +575,9 @@ SBmpDecodeImage( /* SBmpLoadImage @ 323 - * + * * Load an image from an available archive into a buffer. - * + * * pszFileName: The name of the graphic in an active archive. * pPalette: An optional buffer that receives the image palette. * pBuffer: A buffer that receives the image data. @@ -588,7 +588,7 @@ SBmpDecodeImage( * * Returns TRUE if the image was supported and loaded correctly, FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SBmpLoadImage( const char *pszFileName, @@ -600,10 +600,10 @@ SBmpLoadImage( DWORD *pdwBpp = NULL); /* SBmpSaveImage @ 324 - * - * Save an image from a buffer to a file. The image format is determined + * + * Save an image from a buffer to a file. The image format is determined * from the filename and is either .gif, .pcx, .tga, or .bmp being the default. - * + * * pszFileName: The name of the file to create. * pPalette: A pointer to a palette array containing 256 entries. * pBuffer: A buffer containing the image data. @@ -613,7 +613,7 @@ SBmpLoadImage( * * Returns TRUE if the image was saved correctly, FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SBmpSaveImage( const char *pszFileName, @@ -624,27 +624,27 @@ SBmpSaveImage( DWORD dwBpp = 8); -HANDLE STORMAPI SBmpAllocLoadImage(const char *fileName, PALETTEENTRY *palette, void **buffer, int *width, int *height, int unused6, int unused7, void *(STORMAPI *allocFunction)(DWORD)); +extern "C" HANDLE STORMAPI SBmpAllocLoadImage(const char *fileName, PALETTEENTRY *palette, void **buffer, int *width, int *height, int unused6, int unused7, void *(STORMAPI *allocFunction)(DWORD)); -BOOL STORMAPI SCodeCompile(char *directives1, char *directives2, char *loopstring, unsigned int maxiterations, unsigned int flags, HANDLE handle); -BOOL STORMAPI SCodeDelete(HANDLE handle); +extern "C" BOOL STORMAPI SCodeCompile(char *directives1, char *directives2, char *loopstring, unsigned int maxiterations, unsigned int flags, HANDLE handle); +extern "C" BOOL STORMAPI SCodeDelete(HANDLE handle); -int STORMAPI SCodeExecute(HANDLE handle, int a2); +extern "C" int STORMAPI SCodeExecute(HANDLE handle, int a2); -BOOL STORMAPI SDrawAutoInitialize(HINSTANCE hInst, LPCSTR lpClassName, LPCSTR lpWindowName, WNDPROC pfnWndProc, int nMode, int nWidth, int nHeight, int nBits); +extern "C" BOOL STORMAPI SDrawAutoInitialize(HINSTANCE hInst, LPCSTR lpClassName, LPCSTR lpWindowName, WNDPROC pfnWndProc, int nMode, int nWidth, int nHeight, int nBits); /* SDrawCaptureScreen @ 342 - * + * * Saves a screenshot from the primary surface being handled by Storm. - * + * * pszOutput: The name of the output file. The save format is automatically set by the extension. * The extensions supported are .gif, .pcx, .tga, and .bmp. It will write a bitmap by default. * * Returns TRUE if successful and FALSE otherwise. */ -BOOL -STORMAPI +extern "C" BOOL +STORMAPI SDrawCaptureScreen( const char *pszOutput); @@ -653,22 +653,22 @@ SDrawCaptureScreen( * * Retrieves the window handle that was specified in * SDrawManualInitialize or created in SDrawAutoInitialize. - * + * * sdraw_framewindow: Optional variable that receives the returned handle. * * Returns the handle of the window. */ -HWND +extern "C" HWND STORMAPI SDrawGetFrameWindow( HWND *sdraw_framewindow = NULL); /* SDrawGetObjects @ 347 - * + * * Retrieves the object information that was initialized using * SDrawManualInitialize or SDrawAutoInitialize. - * + * * ddInterface: The DirectDraw interface. * primarySurface: The primary DirectDraw surface. * surface2: A second unknown surface. @@ -679,7 +679,7 @@ SDrawGetFrameWindow( * * Returns FALSE if the direct draw interface has not been initialized. */ -BOOL +extern "C" BOOL STORMAPI SDrawGetObjects( LPDIRECTDRAW *ddInterface = NULL, @@ -692,7 +692,7 @@ SDrawGetObjects( /* SDrawGetScreenSize @ 348 - * + * * Obtains information for the current screen resolution. * * pdwWidth: Optional variable that receives the screen width. @@ -701,7 +701,7 @@ SDrawGetObjects( * * Returns FALSE if no variables were specified. */ -BOOL +extern "C" BOOL STORMAPI SDrawGetScreenSize( DWORD *pdwWidth, @@ -710,11 +710,11 @@ SDrawGetScreenSize( // undefined -BOOL STORMAPI SDrawLockSurface(int surfacenumber, RECT *lpDestRect, void **lplpSurface, int *lpPitch, int arg_unused); +extern "C" BOOL STORMAPI SDrawLockSurface(int surfacenumber, RECT *lpDestRect, void **lplpSurface, int *lpPitch, int arg_unused); /* SDrawManualInitialize @ 351 - * + * * Sets the DirectDraw variables to be referenced in Storm. * * hWnd: The handle of the DirectDraw window. @@ -731,7 +731,7 @@ BOOL STORMAPI SDrawLockSurface(int surfacenumber, RECT *lpDestRect, void **lplpS * * Returns FALSE if no variables were specified. */ -BOOL +extern "C" BOOL STORMAPI SDrawManualInitialize( HWND hWnd = NULL, @@ -746,12 +746,12 @@ SDrawManualInitialize( /* SDrawPostClose @ 353 * - * Posts a WM_QUIT message to the active drawing window specified + * Posts a WM_QUIT message to the active drawing window specified * in SDrawManualInitialize or created in SDrawAutoInitialize. * * Returns TRUE if successful and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SDrawPostClose(); @@ -759,27 +759,27 @@ SDrawPostClose(); // undefined //BOOL STORMAPI SDrawRealizePalette(); -BOOL STORMAPI SDrawUnlockSurface(int surfacenumber, void *lpSurface, int a3, RECT *lpRect); -BOOL STORMAPI SDrawUpdatePalette(unsigned int firstentry, unsigned int numentries, PALETTEENTRY *pPalEntries, int a4); +extern "C" BOOL STORMAPI SDrawUnlockSurface(int surfacenumber, void *lpSurface, int a3, RECT *lpRect); +extern "C" BOOL STORMAPI SDrawUpdatePalette(unsigned int firstentry, unsigned int numentries, PALETTEENTRY *pPalEntries, int a4); -BOOL STORMAPI SEvtDispatch(DWORD dwMessageID, DWORD dwFlags, int type, PS_EVT pEvent); +extern "C" BOOL STORMAPI SEvtDispatch(DWORD dwMessageID, DWORD dwFlags, int type, PS_EVT pEvent); -BOOL STORMAPI SGdiDeleteObject(HANDLE handle); +extern "C" BOOL STORMAPI SGdiDeleteObject(HANDLE handle); -BOOL STORMAPI SGdiExtTextOut(int a1, int a2, int a3, int a4, unsigned int a8, signed int a6, signed int a7, const char *pszString, unsigned int arg20); -BOOL STORMAPI SGdiImportFont(HGDIOBJ handle, int windowsfont); +extern "C" BOOL STORMAPI SGdiExtTextOut(int a1, int a2, int a3, int a4, unsigned int a8, signed int a6, signed int a7, const char *pszString, unsigned int arg20); +extern "C" BOOL STORMAPI SGdiImportFont(HGDIOBJ handle, int windowsfont); -BOOL STORMAPI SGdiSelectObject(int handle); -BOOL STORMAPI SGdiSetPitch(int pitch); +extern "C" BOOL STORMAPI SGdiSelectObject(int handle); +extern "C" BOOL STORMAPI SGdiSetPitch(int pitch); -BOOL STORMAPI Ordinal393(char *pszString, int, int); +extern "C" BOOL STORMAPI Ordinal393(char *pszString, int, int); /* SMemAlloc @ 401 - * + * * Allocates a block of memory. This block is different * from the standard malloc by including a header containing - * information about the block. + * information about the block. * * amount: The amount of memory to allocate, in bytes. * logfilename: The name of the file or object that this call belongs to. @@ -789,7 +789,7 @@ BOOL STORMAPI Ordinal393(char *pszString, int, int); * Returns a pointer to the allocated memory. This pointer does NOT include * the additional storm header. */ -void* +extern "C" void* STORMAPI SMemAlloc( size_t amount, @@ -801,18 +801,18 @@ SMemAlloc( /* SMemFree @ 403 - * - * Frees a block of memory that was created using SMemAlloc, + * + * Frees a block of memory that was created using SMemAlloc, * includes the log file and line for debugging purposes. * * location: The memory location to be freed. * logfilename: The name of the file or object that this call belongs to. * logline: The line in the file or one of the SLOG_ macros. - * defaultValue: + * defaultValue: * * Returns TRUE if the call was successful and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SMemFree( void *location, @@ -824,8 +824,8 @@ SMemFree( /* SMemReAlloc @ 405 - * - * Reallocates a block of memory that was created using SMemAlloc, + * + * Reallocates a block of memory that was created using SMemAlloc, * includes the log file and line for debugging purposes. * * location: The memory location to be re-allocated. If this parameter @@ -833,12 +833,12 @@ SMemFree( * amount: The amount of memory to re-allocate. * logfilename: The name of the file or object that this call belongs to. * logline: The line in the file or one of the SLOG_ macros. - * defaultValue: + * defaultValue: * * Returns a pointer to the re-allocated memory. This pointer does NOT include * the additional storm header. */ -void* +extern "C" void* STORMAPI SMemReAlloc( void *location, @@ -858,14 +858,14 @@ SMemReAlloc( #define SLOG_EXCEPTION -5 -BOOL STORMAPI SRegLoadData(const char *keyname, const char *valuename, int size, LPBYTE lpData, BYTE flags, LPDWORD lpcbData); -BOOL STORMAPI SRegLoadString(const char *keyname, const char *valuename, BYTE flags, char *buffer, size_t buffersize); -BOOL STORMAPI SRegLoadValue(const char *keyname, const char *valuename, BYTE flags, int *value); -BOOL STORMAPI SRegSaveData(const char *keyname, const char *valuename, int size, BYTE *lpData, DWORD cbData); -BOOL STORMAPI SRegSaveString(const char *keyname, const char *valuename, BYTE flags, char *string); -BOOL STORMAPI SRegSaveValue(const char *keyname, const char *valuename, BYTE flags, DWORD result); +extern "C" BOOL STORMAPI SRegLoadData(const char *keyname, const char *valuename, int size, LPBYTE lpData, BYTE flags, LPDWORD lpcbData); +extern "C" BOOL STORMAPI SRegLoadString(const char *keyname, const char *valuename, BYTE flags, char *buffer, size_t buffersize); +extern "C" BOOL STORMAPI SRegLoadValue(const char *keyname, const char *valuename, BYTE flags, int *value); +extern "C" BOOL STORMAPI SRegSaveData(const char *keyname, const char *valuename, int size, BYTE *lpData, DWORD cbData); +extern "C" BOOL STORMAPI SRegSaveString(const char *keyname, const char *valuename, BYTE flags, char *string); +extern "C" BOOL STORMAPI SRegSaveValue(const char *keyname, const char *valuename, BYTE flags, DWORD result); -BOOL STORMAPI SRegDeleteValue(const char *keyname, const char *valuename, BYTE flags); +extern "C" BOOL STORMAPI SRegDeleteValue(const char *keyname, const char *valuename, BYTE flags); // Flags for SReg functions @@ -877,29 +877,29 @@ BOOL STORMAPI SRegDeleteValue(const char *keyname, const char *valuename, BYTE f #define SREG_EXCLUDE_CURRENT_USER 0x00000004 // excludes checking the HKEY_CURRENT_USER hive #define SREG_ABSOLUTE 0x00000010 // specifies that the key is not a relative key -BOOL STORMAPI STransBlt(void *lpSurface, int x, int y, int width, HANDLE hTrans); -BOOL STORMAPI STransBltUsingMask(void *lpDest, void *lpSource, int pitch, int width, HANDLE hTrans); +extern "C" BOOL STORMAPI STransBlt(void *lpSurface, int x, int y, int width, HANDLE hTrans); +extern "C" BOOL STORMAPI STransBltUsingMask(void *lpDest, void *lpSource, int pitch, int width, HANDLE hTrans); -BOOL STORMAPI STransDelete(HANDLE hTrans); +extern "C" BOOL STORMAPI STransDelete(HANDLE hTrans); -BOOL STORMAPI STransDuplicate(HANDLE hTransSource, HANDLE hTransDest); -BOOL STORMAPI STransIntersectDirtyArray(HANDLE hTrans, char * dirtyarraymask, unsigned flags, HANDLE * phTransResult); -BOOL STORMAPI STransInvertMask(HANDLE hTrans, HANDLE * phTransResult); +extern "C" BOOL STORMAPI STransDuplicate(HANDLE hTransSource, HANDLE hTransDest); +extern "C" BOOL STORMAPI STransIntersectDirtyArray(HANDLE hTrans, char * dirtyarraymask, unsigned flags, HANDLE * phTransResult); +extern "C" BOOL STORMAPI STransInvertMask(HANDLE hTrans, HANDLE * phTransResult); -BOOL STORMAPI STransSetDirtyArrayInfo(int width, int height, int depth, int bits); +extern "C" BOOL STORMAPI STransSetDirtyArrayInfo(int width, int height, int depth, int bits); -BOOL STORMAPI STransPointInMask(HANDLE hTrans, int x, int y); // Name is a pure guess -BOOL STORMAPI STransCombineMasks(HANDLE hTransA, HANDLE hTransB, int left, int top, int flags, HANDLE * phTransResult); +extern "C" BOOL STORMAPI STransPointInMask(HANDLE hTrans, int x, int y); // Name is a pure guess +extern "C" BOOL STORMAPI STransCombineMasks(HANDLE hTransA, HANDLE hTransB, int left, int top, int flags, HANDLE * phTransResult); -BOOL STORMAPI STransCreateE(void *pBuffer, int width, int height, int bpp, int a5, int bufferSize, HANDLE *phTransOut); +extern "C" BOOL STORMAPI STransCreateE(void *pBuffer, int width, int height, int bpp, int a5, int bufferSize, HANDLE *phTransOut); -BOOL STORMAPI SVidDestroy(); -BOOL STORMAPI SVidGetSize(HANDLE video, int width, int height, int zero); -BOOL STORMAPI SVidInitialize(HANDLE video); -BOOL STORMAPI SVidPlayBegin(char *filename, int arg4, int a3, int a4, int a5, int a6, HANDLE* video); +extern "C" BOOL STORMAPI SVidDestroy(); +extern "C" BOOL STORMAPI SVidGetSize(HANDLE video, int width, int height, int zero); +extern "C" BOOL STORMAPI SVidInitialize(HANDLE video); +extern "C" BOOL STORMAPI SVidPlayBegin(char *filename, int arg4, int a3, int a4, int a5, int a6, HANDLE* video); -BOOL STORMAPI SVidPlayContinueSingle(HANDLE video, int a2, int a3); -BOOL STORMAPI SVidPlayEnd(HANDLE video); +extern "C" BOOL STORMAPI SVidPlayContinueSingle(HANDLE video, int a2, int a3); +extern "C" BOOL STORMAPI SVidPlayEnd(HANDLE video); /* SErrDisplayError @ 461 * @@ -916,7 +916,7 @@ BOOL STORMAPI SVidPlayEnd(HANDLE video); * * Returns TRUE if the user chose to continue execution, FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SErrDisplayError( DWORD dwErrMsg, @@ -931,7 +931,7 @@ SErrDisplayError( #define SEDisplayError(err) SErrDisplayError(e, __FILE__, __LINE__) /* SErrGetErrorStr @ 462 - * + * * Retrieves a string that describes the specified error code for * the system, Storm, DirectDraw, or DirectSound. * @@ -941,7 +941,7 @@ SErrDisplayError( * * Returns TRUE if the call was successful and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SErrGetErrorStr( DWORD dwErrCode, @@ -952,13 +952,13 @@ SErrGetErrorStr( /* SErrGetLastError @ 463 - * + * * Retrieves the last error that was specifically * set for the Storm library. * * Returns the last error set within the Storm library. */ -DWORD +extern "C" DWORD STORMAPI SErrGetLastError(); @@ -969,21 +969,21 @@ SErrGetLastError(); /* SErrSetLastError @ 465 - * + * * Sets the last error for the Storm library and the Kernel32 library. * * dwErrCode: The error code that will be set. */ -void +extern "C" void STORMAPI SErrSetLastError( DWORD dwErrCode = NO_ERROR); -// +// // void STORMAPI SErrReportNamedResourceLeak(const char *pszMsg, const char *pszSubMsg = nullptr) // void STORMAPI SErrReportResourceLeak(const char *pszMsg) -void STORMAPI SErrSuppressErrors(BOOL suppressErrors); +extern "C" void STORMAPI SErrSuppressErrors(BOOL suppressErrors); // Values for dwErrCode #define STORM_ERROR_ASSERTION 0x85100000 @@ -1023,7 +1023,7 @@ void STORMAPI SErrSuppressErrors(BOOL suppressErrors); /* SMemCopy @ 491 - * + * * Copies a block of memory from source to destination. * This function immediately calls memcpy. See online documentation * of memcpy for more details. @@ -1032,17 +1032,17 @@ void STORMAPI SErrSuppressErrors(BOOL suppressErrors); * source: The source buffer. * size: The number of bytes to copy. */ -void +extern "C" void STORMAPI SMemCopy( - void *dest, - const void *source, + void *dest, + const void *source, size_t size); #define SMCopy(d,s) ( SMemCopy(d, s, __STORM_SSIZEMIN(s,d)) ) /* SMemFill @ 492 - * + * * Fills a block of memory with the specified character. * This function immediately calls memset. See online documentation * of memset for more details. @@ -1051,7 +1051,7 @@ SMemCopy( * source: The size of the destination buffer. * size: The format to use. */ -void +extern "C" void STORMAPI SMemFill( void *location, @@ -1061,14 +1061,14 @@ SMemFill( #define SMFill(l,f) (SMemFill(l, sizeof(l), f)) /* SMemZero @ 494 - * + * * Fills a block of memory with the integer 0x00 (Zero). * * location: The location to write at. * length: The amount of bytes to write. */ -void -STORMAPI +extern "C" void +STORMAPI SMemZero( void *location, size_t length); @@ -1076,12 +1076,12 @@ SMemZero( #define SMZero(l) (SMemZero(l, sizeof(l))) -int STORMAPI SMemCmp(void *location1, void *location2, DWORD size); +extern "C" int STORMAPI SMemCmp(void *location1, void *location2, DWORD size); #define SMCmp(l,x) ( SMemCmp(l, x, __STORM_SSIZEMIN(x,l)) ) /* SStrCopy @ 501 - * + * * Copies a string from src to dest (including NULL terminator) * until the max_length is reached. * @@ -1091,10 +1091,10 @@ int STORMAPI SMemCmp(void *location1, void *location2, DWORD size); * * Returns the number of characters copied. */ -int +extern "C" int STORMAPI SStrCopy( - char *dest, + char *dest, const char *src, int max_length = 0x7FFFFFFF); @@ -1103,7 +1103,7 @@ SStrCopy( #define STORM_HASH_ABSOLUTE 1 /* SStrHash @ 502 - * + * * Creates a simple hash for the string. This function * should NOT be used for sensitive information. * @@ -1117,17 +1117,17 @@ SStrCopy( * * Returns the 32-bit hash of the string. */ -DWORD +extern "C" DWORD STORMAPI SStrHash( const char *string, DWORD flags = 0, DWORD Seed = 0); -int STORMAPI SStrNCat(char *dest, const char *src, DWORD max_length); +extern "C" int STORMAPI SStrNCat(char *dest, const char *src, DWORD max_length); /* SStrLen @ 506 - * + * * Retrieves the length of a string. * * string: The input string of which to obtain a @@ -1135,13 +1135,13 @@ int STORMAPI SStrNCat(char *dest, const char *src, DWORD max_length); * * Returns the length of the string. */ -int +extern "C" int STORMAPI SStrLen( const char *string); /* SStrCmp @ 508 - * + * * Compares two strings case sensitive. * * string1: The first string. @@ -1150,17 +1150,17 @@ SStrLen( * * Returns 0 if strings are equal. See strcmp documentation for more details. */ -int +extern "C" int STORMAPI SStrCmp( - const char *string1, - const char *string2, + const char *string1, + const char *string2, size_t size); #define SSCmp(s,x) ( SStrCmp(s,x,__STORM_SSIZEMIN(s,x)) ) /* SStrCmpI @ 509 - * + * * Compares two strings case insensitive. * * string1: The first string. @@ -1169,33 +1169,33 @@ SStrCmp( * * Returns 0 if strings are equal. See strcmpi documentation for more details. */ -int +extern "C" int STORMAPI SStrCmpI( - const char *string1, - const char *string2, + const char *string1, + const char *string2, size_t size); #define SSCmpI(s,x) ( SStrCmpI(s,x,__STORM_SSIZEMIN(s,x)) ) /* SStrUpper @ 510 - * + * * Converts all lower-case alpha characters of a string to upper-case. * * string: The string to convert. - * + * * Returns the same pointer given in the input. */ -char* +extern "C" char* STORMAPI SStrUpper( char* string); -void STORMAPI SRgn523(HANDLE hRgn, RECT *pRect, int a3, int a4); -void STORMAPI SRgnCreateRegion(HANDLE *hRgn, int a2); -void STORMAPI SRgnDeleteRegion(HANDLE hRgn); +extern "C" void STORMAPI SRgn523(HANDLE hRgn, RECT *pRect, int a3, int a4); +extern "C" void STORMAPI SRgnCreateRegion(HANDLE *hRgn, int a2); +extern "C" void STORMAPI SRgnDeleteRegion(HANDLE hRgn); -void STORMAPI SRgn529i(int handle, int a2, int a3); +extern "C" void STORMAPI SRgn529i(int handle, int a2, int a3); /* SErrDisplayErrorFmt @ 562 @@ -1213,7 +1213,7 @@ void STORMAPI SRgn529i(int handle, int a2, int a3); * * Returns TRUE if the user chose to continue execution, FALSE otherwise. */ -BOOL +extern "C" BOOL SErrDisplayErrorFmt( DWORD dwErrMsg, const char *logfilename, @@ -1226,37 +1226,37 @@ SErrDisplayErrorFmt( //#define SEDisplayErrorFmt(err,...) SErrDisplayErrorFmt(err, __FILE__, __LINE__, FALSE, 1, __VA_ARGS__) /* SErrCatchUnhandledExceptions @ 567 - * + * * Registers a top-level exception filter managed entirely by Storm. * The registered filter will display formatted exception information by calling SErrDisplayError. */ -void +extern "C" void STORMAPI SErrCatchUnhandledExceptions(); /* SStrChr @ 571 - * - * Searches a string for the given character. See + * + * Searches a string for the given character. See * strchr documentation for more details. * * string: The string to search. * c: The character to search for. - * + * * Returns a pointer to the first occurance of the character. */ -char* +extern "C" char* STORMAPI SStrChr( - const char *string, + const char *string, char c); -char *STORMAPI SStrChrR(const char *string, char c); +extern "C" char *STORMAPI SStrChrR(const char *string, char c); /* SStrVPrintf @ 578 - * + * * Prints a formatted string to a destination buffer. * This function calls vsnprintf with some extra error handling. * See online documentation of vsnprintf for more details. @@ -1267,32 +1267,32 @@ char *STORMAPI SStrChrR(const char *string, char c); * * Returns the number of characters written. */ -size_t +extern "C" size_t SStrVPrintf( - char *dest, - size_t size, + char *dest, + size_t size, const char *format, ...); -int STORMAPI SBigDel(void *buffer); +extern "C" int STORMAPI SBigDel(void *buffer); -int STORMAPI SBigFromBinary(void *buffer, const void *str, size_t size); +extern "C" int STORMAPI SBigFromBinary(void *buffer, const void *str, size_t size); -int STORMAPI SBigNew(void **buffer); +extern "C" int STORMAPI SBigNew(void **buffer); -int STORMAPI SBigPowMod(void *buffer1, void *buffer2, int a3, int a4); +extern "C" int STORMAPI SBigPowMod(void *buffer1, void *buffer2, int a3, int a4); -int STORMAPI SBigToBinaryBuffer(void *buffer, int length, int a3, int a4); +extern "C" int STORMAPI SBigToBinaryBuffer(void *buffer, int length, int a3, int a4); +extern "C" bool StormDestroy(); +extern "C" void SDrawDestroy(); +extern "C" bool __stdcall SFileSetBasePath(char *base_dir); +extern "C" void SDrawRealizePalette(); +extern "C" bool SVidPlayContinue(); +extern "C" bool __stdcall SNetGetOwnerTurnsWaiting(int *turns); +extern "C" bool __stdcall SNetSetBasePlayer(int base_player_num); +extern "C" int __stdcall SFileSetFilePointer(HANDLE file1, int offset, HANDLE file2, int whence); -bool StormDestroy(); -void SDrawDestroy(); -bool __stdcall SFileSetBasePath(char *base_dir); -void SDrawRealizePalette(); -bool SVidPlayContinue(); -bool __stdcall SNetGetOwnerTurnsWaiting(int *turns); -bool __stdcall SNetSetBasePlayer(int base_player_num); -int __stdcall SFileSetFilePointer(HANDLE file1, int offset, HANDLE file2, int whence); +extern "C" void __stdcall SDrawMessageBox(char *text, char *caption, int type); -void __stdcall SDrawMessageBox(char *text, char *caption, int type); #endif diff --git a/3rdParty/Storm/Source/storm.def b/3rdParty/Storm/Source/storm.def index fde2f7b..769f8a3 100644 --- a/3rdParty/Storm/Source/storm.def +++ b/3rdParty/Storm/Source/storm.def @@ -2,36 +2,53 @@ LIBRARY "Storm" EXPORTS SNetCreateGame @101 NONAME + SNetCreateGame@40 @101 NONAME SNetDestroy @102 NONAME + SNetDestroy@0 @102 NONAME SNetEnumProviders @103 NONAME ;SNetEnumDevices @104 NONAME SNetEnumGames @105 NONAME SNetDropPlayer @106 NONAME + SNetDropPlayer@8 @106 NONAME SNetGetGameInfo @107 NONAME + SNetGetGameInfo@16 @107 NONAME ;SNetGetNetworkLatency @108 NONAME SNetGetNumPlayers @109 NONAME SNetGetOwnerTurnsWaiting @110 NONAME + SNetGetOwnerTurnsWaiting@4 @110 NONAME ;SNetGetPerformanceData @111 NONAME SNetGetPlayerCaps @112 NONAME SNetGetPlayerName @113 NONAME SNetGetProviderCaps @114 NONAME + SNetGetProviderCaps@4 @114 NONAME SNetGetTurnsInTransit @115 NONAME + SNetGetTurnsInTransit@4 @115 NONAME SNetInitializeDevice @116 NONAME SNetInitializeProvider @117 NONAME + SNetInitializeProvider@20 @117 NONAME SNetJoinGame @118 NONAME SNetLeaveGame @119 NONAME + SNetLeaveGame@4 @119 NONAME SNetPerformUpgrade @120 NONAME + SNetPerformUpgrade@4 @120 NONAME SNetReceiveMessage @121 NONAME + SNetReceiveMessage@12 @121 NONAME SNetReceiveTurns @122 NONAME + SNetReceiveTurns@20 @122 NONAME SNetRegisterEventHandler @123 NONAME + SNetRegisterEventHandler@8 @123 NONAME ;SNetResetLatencyMeasurements @124 NONAME SNetSelectGame @125 NONAME ;SNetSelectProvider @126 NONAME SNetSendMessage @127 NONAME + SNetSendMessage@12 @127 NONAME SNetSendTurn @128 NONAME + SNetSendTurn@8 @128 NONAME SNetSetBasePlayer @129 NONAME + SNetSetBasePlayer@4 @129 NONAME SNetSetGameMode @130 NONAME SNetUnregisterEventHandler @131 NONAME + SNetUnregisterEventHandler@8 @131 NONAME SNetEnumGamesEx @133 NONAME SNetSendServerChatCommand @134 NONAME @@ -57,7 +74,7 @@ EXPORTS ;SDlgCreateDialogIndirectParam @204 NONAME ;SDlgCreateDialogParam @205 NONAME SDlgDefDialogProc @206 NONAME - + SDlgDialogBoxIndirectParam @208 NONAME ;SDlgDialogBoxParam @209 NONAME ;SDlgDrawBitmap @210 NONAME @@ -78,25 +95,41 @@ EXPORTS ;SFileAuthenticateArchive @251 NONAME SFileCloseArchive @252 NONAME + SFileCloseArchive@4 @252 NONAME SFileCloseFile @253 NONAME + SFileCloseFile@4 @253 NONAME ;SFileDdaBegin @254 NONAME SFileDdaBeginEx @255 NONAME + SFileDdaBeginEx@28 @255 NONAME SFileDdaDestroy @256 NONAME + SFileDdaDestroy@0 @256 NONAME SFileDdaEnd @257 NONAME + SFileDdaEnd@4 @257 NONAME SFileDdaGetPos @258 NONAME + SFileDdaGetPos@12 @258 NONAME ;SFileDdaGetVolume @259 NONAME SFileDdaInitialize @260 NONAME + SFileDdaInitialize@4 @260 NONAME SFileDdaSetVolume @261 NONAME + SFileDdaSetVolume@12 @261 NONAME SFileDestroy @262 NONAME ;SFileEnableDirectAccess @263 NONAME SFileGetFileArchive @264 NONAME + SFileGetFileArchive@8 @264 NONAME SFileGetFileSize @265 NONAME + SFileGetFileSize@8 @265 NONAME SFileOpenArchive @266 NONAME + SFileOpenArchive@16 @266 NONAME SFileOpenFile @267 NONAME + SFileOpenFile@8 @267 NONAME SFileOpenFileEx @268 NONAME + SFileOpenFileEx@16 @268 NONAME SFileReadFile @269 NONAME + SFileReadFile@20 @269 NONAME SFileSetBasePath @270 NONAME + SFileSetBasePath@4 @270 NONAME SFileSetFilePointer @271 NONAME + SFileSetFilePointer@16 @271 NONAME SFileSetLocale @272 NONAME ;SFileGetBasePath @273 NONAME SFileSetIoErrorMode @274 NONAME @@ -145,7 +178,7 @@ EXPORTS SCodeCompile @331 NONAME SCodeDelete @332 NONAME - + SCodeExecute @334 NONAME ;SCodeGetPseudocode @335 NONAME @@ -155,17 +188,21 @@ EXPORTS SDrawDestroy @344 NONAME ;SDrawFlipPage @345 NONAME SDrawGetFrameWindow @346 NONAME + SDrawGetFrameWindow@4 @346 NONAME SDrawGetObjects @347 NONAME SDrawGetScreenSize @348 NONAME ;SDrawGetServiceLevel @349 NONAME SDrawLockSurface @350 NONAME SDrawManualInitialize @351 NONAME + SDrawManualInitialize@32 @351 NONAME SDrawMessageBox @352 NONAME + SDrawMessageBox@12 @352 NONAME SDrawPostClose @353 NONAME SDrawRealizePalette @354 NONAME ;SDrawSelectGdiSurface @355 NONAME SDrawUnlockSurface @356 NONAME SDrawUpdatePalette @357 NONAME + SDrawUpdatePalette@16 @357 NONAME ;SDrawUpdateScreen @358 NONAME ;SDrawWaitForVerticalBlank @359 NONAME @@ -192,10 +229,12 @@ EXPORTS Ordinal393 @393 NONAME ;SMem399 @399 NONAME - + SMemAlloc @401 NONAME + SMemAlloc@16 @401 NONAME ;SMemDestroy @402 NONAME SMemFree @403 NONAME + SMemFree@16 @403 NONAME ;SMemGetSize @404 NONAME SMemReAlloc @405 NONAME ;Storm406 @406 NONAME @@ -210,11 +249,17 @@ EXPORTS ;SMsgPushRegisterState @419 NONAME ;SMsg420 @420 NONAME SRegLoadData @421 NONAME + SRegLoadData@24 @421 NONAME SRegLoadString @422 NONAME + SRegLoadString@20 @422 NONAME SRegLoadValue @423 NONAME + SRegLoadValue@16 @423 NONAME SRegSaveData @424 NONAME + SRegSaveData@20 @424 NONAME SRegSaveString @425 NONAME + SRegSaveString@16 @425 NONAME SRegSaveValue @426 NONAME + SRegSaveValue@16 @426 NONAME ;SRegGetBaseKey @427 NONAME SRegDeleteValue @428 NONAME ;SReg429 @429 NONAME @@ -223,7 +268,7 @@ EXPORTS STransBltUsingMask @432 NONAME ;STransCreateI @433 NONAME STransDelete @434 NONAME - + STransDuplicate @436 NONAME STransIntersectDirtyArray @437 NONAME STransInvertMask @438 NONAME @@ -238,20 +283,27 @@ EXPORTS ;STransLoadE @447 NONAME SVidDestroy @451 NONAME + SVidDestroy@0 @451 NONAME SVidGetSize @452 NONAME SVidInitialize @453 NONAME + SVidInitialize@4 @453 NONAME SVidPlayBegin @454 NONAME + SVidPlayBegin@28 @454 NONAME ;SVidPlayBeginFromMemory @455 NONAME SVidPlayContinue @456 NONAME SVidPlayContinueSingle @457 NONAME SVidPlayEnd @458 NONAME + SVidPlayEnd@4 @458 NONAME ;SVidSetVolume @459 NONAME ;Storm460 @460 NONAME SErrDisplayError @461 NONAME SErrGetErrorStr @462 NONAME + SErrGetErrorStr@12 @462 NONAME SErrGetLastError @463 NONAME + SErrGetLastError@0 @463 NONAME ;SErrRegisterMessageSource @464 NONAME SErrSetLastError @465 NONAME + SErrSetLastError@4 @465 NONAME ;SErrReportNamedResourceLeak @466 NONAME ;SErrReportResourceLeak @467 NONAME SErrSuppressErrors @468 NONAME @@ -287,6 +339,7 @@ EXPORTS ;Ordinal498 @498 NONAME SStrCopy @501 NONAME + SStrCopy@12 @501 NONAME SStrHash @502 NONAME SStrNCat @503 NONAME ;SStrTokenize @504 NONAME diff --git a/3rdParty/Storm/Source/storm.h b/3rdParty/Storm/Source/storm.h index cdc48d9..01a19b6 100644 --- a/3rdParty/Storm/Source/storm.h +++ b/3rdParty/Storm/Source/storm.h @@ -61,32 +61,32 @@ typedef struct _WSIZE #define GAMESTATE_REPLAY 0x80 -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 SNetEnumProviders(int (STORMAPI *callback)(DWORD, DWORD, DWORD, DWORD), int mincaps); +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); +extern "C" BOOL STORMAPI SNetDestroy(); +extern "C" BOOL STORMAPI SNetEnumProviders(int (STORMAPI *callback)(DWORD, DWORD, DWORD, DWORD), int mincaps); -BOOL STORMAPI SNetEnumGames(int (STORMAPI *callback)(DWORD, DWORD, DWORD), int *hintnextcall); +extern "C" BOOL STORMAPI SNetEnumGames(int (STORMAPI *callback)(DWORD, DWORD, DWORD), int *hintnextcall); /* SNetDropPlayer @ 106 - * + * * Drops a player from the current game. - * + * * playerid: The player ID for the player to be dropped. - * flags: + * flags: * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetDropPlayer( int playerid, DWORD flags); /* SNetGetGameInfo @ 107 - * + * * Retrieves specific game information from Storm, such as name, password, * stats, mode, game template, and players. - * + * * type: The type of data to retrieve. See GAMEINFO_ flags. * dst: The destination buffer for the data. * length: The maximum size of the destination buffer. @@ -94,7 +94,7 @@ SNetDropPlayer( * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetGetGameInfo( int type, @@ -116,7 +116,7 @@ SNetGetGameInfo( #define GAMEINFO_PLAYERS 6 -BOOL STORMAPI SNetGetNumPlayers(int *firstplayerid, int *lastplayerid, int *activeplayers); +extern "C" BOOL STORMAPI SNetGetNumPlayers(int *firstplayerid, int *lastplayerid, int *activeplayers); typedef struct _CAPS @@ -133,54 +133,54 @@ typedef struct _CAPS } CAPS, *PCAPS; -BOOL STORMAPI SNetGetPlayerCaps(char playerid, PCAPS playerCaps); +extern "C" BOOL STORMAPI SNetGetPlayerCaps(char playerid, PCAPS playerCaps); /* SNetGetPlayerName @ 113 - * + * * Retrieves the name of a player given their player ID. - * + * * playerid: The player's ID. * buffer: The buffer that will receive the name. * buffersize: The maximum size of buffer. * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetGetPlayerName( - int playerid, - char *buffer, + int playerid, + char *buffer, size_t buffersize); /* SNetGetProviderCaps @ 114 - * + * * Retrieves network provider capacity information. - * + * * providerCaps: A pointer to a CAPS structure that will receive the information. * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL -STORMAPI +extern "C" BOOL +STORMAPI SNetGetProviderCaps( PCAPS providerCaps); /* SNetGetTurnsInTransit @ 115 - * + * * Retrieves the number of turns (buffers) that have been queued * before sending them over the network. - * + * * turns: A pointer to an integer that will receive the value. * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetGetTurnsInTransit( int *turns); -BOOL STORMAPI SNetInitializeDevice(int a1, int a2, int a3, int a4, int *a5); +extern "C" BOOL STORMAPI SNetInitializeDevice(int a1, int a2, int a3, int a4, int *a5); // Network provider structures typedef struct _client_info @@ -285,16 +285,16 @@ typedef struct _storm_head /* SNetInitializeProvider @ 117 - * + * * Initializes a provider by storing the provider callbacks, and calling * spiInitialize() using the parameters passed to this function. * Note: The use of the parameters is determined by the network * module. - * + * * providerName: The provider's identifier. Example: 'TENB' (BNET). - * gameClientInfo: A pointer to a clientInfo structure containing + * gameClientInfo: A pointer to a clientInfo structure containing * information about the game client. - * userData: A pointer to a userInfo structure containing information + * userData: A pointer to a userInfo structure containing information * about the player. * bnCallbacks: A pointer to a battleInfo structure containing callbacks * and other information that is specific to Battle.net. @@ -303,35 +303,35 @@ typedef struct _storm_head * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetInitializeProvider( - DWORD providerName, + DWORD providerName, client_info *gameClientInfo, user_info *userData, battle_info *bnCallbacks, module_info *moduleData); -BOOL STORMAPI SNetJoinGame(int id, char *gameName, char *gamePassword, char *playerName, char *userStats, int *playerid); +extern "C" BOOL STORMAPI SNetJoinGame(int id, char *gameName, char *gamePassword, char *playerName, char *userStats, int *playerid); /* SNetLeaveGame @ 119 - * + * * Notifies Storm that the player has left the game. Storm will * notify all connected peers through the network provider. - * + * * type: The leave type. It doesn't appear to be important, no documentation available. * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetLeaveGame( int type); -BOOL STORMAPI SNetPerformUpgrade(DWORD *upgradestatus); -BOOL STORMAPI SNetReceiveMessage(int *senderplayerid, char **data, int *databytes); -BOOL STORMAPI SNetReceiveTurns(int a1, int arraysize, char **arraydata, unsigned int *arraydatabytes, DWORD *arrayplayerstatus); +extern "C" BOOL STORMAPI SNetPerformUpgrade(DWORD *upgradestatus); +extern "C" BOOL STORMAPI SNetReceiveMessage(int *senderplayerid, char **data, int *databytes); +extern "C" BOOL STORMAPI SNetReceiveTurns(int a1, int arraysize, char **arraydata, unsigned int *arraydatabytes, DWORD *arrayplayerstatus); // Values for arrayplayerstatus #define SNET_PS_OK 0 @@ -351,16 +351,16 @@ typedef struct _s_evt // @TODO: "type" is unknown. -HANDLE STORMAPI SNetRegisterEventHandler(int type, void (STORMAPI *sEvent)(PS_EVT)); +extern "C" HANDLE STORMAPI SNetRegisterEventHandler(int type, void (STORMAPI *sEvent)(PS_EVT)); -int STORMAPI SNetSelectGame(int a1, int a2, int a3, int a4, int a5, int *playerid); +extern "C" int STORMAPI SNetSelectGame(int a1, int a2, int a3, int a4, int a5, int *playerid); /* SNetSendMessage @ 127 - * + * * Sends a message to a player given their player ID. Network message * is sent using class 01 and is retrieved by the other client using * SNetReceiveMessage(). - * + * * playerID: The player index of the player to receive the data. * Conversely, this field can be one of the following constants: * SNPLAYER_ALL | Sends the message to all players, including oneself. @@ -370,7 +370,7 @@ int STORMAPI SNetSelectGame(int a1, int a2, int a3, int a4, int a5, int *player * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetSendMessage( int playerID, @@ -384,29 +384,29 @@ SNetSendMessage( /* SNetSendTurn @ 128 - * + * * Sends a turn (data packet) to all players in the game. Network data * is sent using class 02 and is retrieved by the other client using * SNetReceiveTurns(). - * + * * data: A pointer to the data. * databytes: The amount of bytes that the data pointer contains. * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetSendTurn( char *data, size_t databytes); /* SNetSetGameMode @ 130 - * + * * Set's the game's mode flags, notifying the network * provider that the state of the game has changed. * For example: notifies Battle.net when the game is * full. - * + * * You should first call SNetGetGameInfo to retrieve * the existing mode flags. * @@ -420,7 +420,7 @@ SNetSendTurn( * * Returns TRUE if the function was called successfully and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SNetSetGameMode( DWORD modeFlags, @@ -428,59 +428,59 @@ SNetSetGameMode( #define SNMakeGamePublic() SNetSetGameMode( (DWORD mode, SNetGetGameInfo(GAMEINFO_MODEFLAGS, &mode, 4), mode), true) -BOOL STORMAPI SNetEnumGamesEx(int a1, int a2, int (__fastcall *callback)(DWORD, DWORD, DWORD), int *hintnextcall); -BOOL STORMAPI SNetSendServerChatCommand(const char *command); +extern "C" BOOL STORMAPI SNetEnumGamesEx(int a1, int a2, int (__fastcall *callback)(DWORD, DWORD, DWORD), int *hintnextcall); +extern "C" BOOL STORMAPI SNetSendServerChatCommand(const char *command); -BOOL STORMAPI SNetDisconnectAll(DWORD flags); -BOOL STORMAPI SNetCreateLadderGame(const char *pszGameName, const char *pszGamePassword, const char *pszGameStatString, DWORD dwGameType, DWORD dwGameLadderType, DWORD dwGameModeFlags, char *GameTemplateData, int GameTemplateSize, int playerCount, char *creatorName, char *a11, int *playerID); +extern "C" BOOL STORMAPI SNetDisconnectAll(DWORD flags); +extern "C" BOOL STORMAPI SNetCreateLadderGame(const char *pszGameName, const char *pszGamePassword, const char *pszGameStatString, DWORD dwGameType, DWORD dwGameLadderType, DWORD dwGameModeFlags, char *GameTemplateData, int GameTemplateSize, int playerCount, char *creatorName, char *a11, int *playerID); #define SNET_GAME_RESULT_WIN 1 #define SNET_GAME_RESULT_LOSS 2 #define SNET_GAME_RESULT_DRAW 3 #define SNET_GAME_RESULT_DISCONNECT 4 -BOOL STORMAPI SNetReportGameResult(unsigned a1, int size, int *results, const char* headerInfo, const char* detailInfo); +extern "C" BOOL STORMAPI SNetReportGameResult(unsigned a1, int size, int *results, const char* headerInfo, const char* detailInfo); -int STORMAPI SNetSendLeagueCommand(char *cmd, char *callback); -int STORMAPI SNetSendReplayPath(int a1, int a2, char *replayPath); -int STORMAPI SNetGetLeagueName(int leagueID); -BOOL STORMAPI SNetGetPlayerNames(char **names); -int STORMAPI SNetLeagueLogout(char *bnetName); -int STORMAPI SNetGetLeaguePlayerName(char *curPlayerLeageName, size_t nameSize); +extern "C" int STORMAPI SNetSendLeagueCommand(char *cmd, char *callback); +extern "C" int STORMAPI SNetSendReplayPath(int a1, int a2, char *replayPath); +extern "C" int STORMAPI SNetGetLeagueName(int leagueID); +extern "C" BOOL STORMAPI SNetGetPlayerNames(char **names); +extern "C" int STORMAPI SNetLeagueLogout(char *bnetName); +extern "C" int STORMAPI SNetGetLeaguePlayerName(char *curPlayerLeageName, size_t nameSize); -HGDIOBJ STORMAPI SDlgDefDialogProc(HWND hDlg, signed int DlgType, HDC textLabel, HWND hWnd); +extern "C" HGDIOBJ STORMAPI SDlgDefDialogProc(HWND hDlg, signed int DlgType, HDC textLabel, HWND hWnd); -HANDLE STORMAPI SDlgDialogBoxIndirectParam(HMODULE hModule, LPCSTR lpName, HWND hWndParent, LPVOID lpParam, LPARAM lParam); +extern "C" HANDLE STORMAPI SDlgDialogBoxIndirectParam(HMODULE hModule, LPCSTR lpName, HWND hWndParent, LPVOID lpParam, LPARAM lParam); -BOOL STORMAPI SDlgEndDialog(HWND hDlg, HANDLE nResult); +extern "C" BOOL STORMAPI SDlgEndDialog(HWND hDlg, HANDLE nResult); -BOOL STORMAPI SDlgSetControlBitmaps(HWND parentwindow, int *id, int a3, char *buffer2, char *buffer, int flags, int mask); +extern "C" BOOL STORMAPI SDlgSetControlBitmaps(HWND parentwindow, int *id, int a3, char *buffer2, char *buffer, int flags, int mask); /* -// lpCursorName can only be IDC_ARROW +// lpCursorName can only be IDC_ARROW BOOL STORMAPI SDlgSetSystemCursor(void *lpSrcBuffer, void *p_a2, LPSIZE lpSize, LPCSTR lpCursorName); */ -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); +extern "C" BOOL STORMAPI SDlgBltToWindowE(HWND hWnd, HRGN a2, char *a3, int a4, void *buffer, RECT *rct, SIZE *size, int a8, int a9, DWORD rop); +extern "C" BOOL STORMAPI SDlgSetBitmapE(HWND hWnd, int a2, char *src, int mask1, int flags, int a6, int a7, int width, int a9, int mask2); -int STORMAPI Ordinal224(int a1); +extern "C" int STORMAPI Ordinal224(int a1); -BOOL STORMAPI SFileCloseArchive(HANDLE hArchive); -BOOL STORMAPI SFileCloseFile(HANDLE hFile); +extern "C" BOOL STORMAPI SFileCloseArchive(HANDLE hArchive); +extern "C" BOOL STORMAPI SFileCloseFile(HANDLE hFile); -BOOL STORMAPI SFileDdaBeginEx(HANDLE directsound, DWORD flags, DWORD mask, unsigned __int32 lDistanceToMove, signed __int32 volume, signed int a6, int a7); -BOOL STORMAPI SFileDdaDestroy(); -BOOL STORMAPI SFileDdaEnd(HANDLE directsound); -BOOL STORMAPI SFileDdaGetPos(HANDLE directsound, int a2, int a3); +extern "C" BOOL STORMAPI SFileDdaBeginEx(HANDLE directsound, DWORD flags, DWORD mask, unsigned __int32 lDistanceToMove, signed __int32 volume, signed int a6, int a7); +extern "C" BOOL STORMAPI SFileDdaDestroy(); +extern "C" BOOL STORMAPI SFileDdaEnd(HANDLE directsound); +extern "C" BOOL STORMAPI SFileDdaGetPos(HANDLE directsound, int a2, int a3); -BOOL STORMAPI SFileDdaInitialize(HANDLE directsound); -BOOL STORMAPI SFileDdaSetVolume(HANDLE directsound, signed int bigvolume, signed int volume); -BOOL STORMAPI SFileDestroy(); +extern "C" BOOL STORMAPI SFileDdaInitialize(HANDLE directsound); +extern "C" BOOL STORMAPI SFileDdaSetVolume(HANDLE directsound, signed int bigvolume, signed int volume); +extern "C" BOOL STORMAPI SFileDestroy(); -BOOL STORMAPI SFileGetFileArchive(HANDLE hFile, HANDLE archive); -LONG STORMAPI SFileGetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh); -BOOL STORMAPI SFileOpenArchive(const char *szMpqName, DWORD dwPriority, DWORD dwFlags, HANDLE *phMpq); +extern "C" BOOL STORMAPI SFileGetFileArchive(HANDLE hFile, HANDLE archive); +extern "C" LONG STORMAPI SFileGetFileSize(HANDLE hFile, LPDWORD lpFileSizeHigh); +extern "C" BOOL STORMAPI SFileOpenArchive(const char *szMpqName, DWORD dwPriority, DWORD dwFlags, HANDLE *phMpq); // values for dwFlags enum MPQFlags @@ -492,8 +492,8 @@ enum MPQFlags }; -BOOL STORMAPI SFileOpenFile(const char *filename, HANDLE *phFile); -BOOL STORMAPI SFileOpenFileEx(HANDLE hMpq, const char *szFileName, DWORD dwSearchScope, HANDLE *phFile); +extern "C" BOOL STORMAPI SFileOpenFile(const char *filename, HANDLE *phFile); +extern "C" BOOL STORMAPI SFileOpenFileEx(HANDLE hMpq, const char *szFileName, DWORD dwSearchScope, HANDLE *phFile); // values for dwSearchScope enum SFileFlags @@ -504,22 +504,22 @@ enum SFileFlags SFILE_FROM_DISK = 0x00000004 }; -BOOL STORMAPI SFileReadFile(HANDLE hFile, void *buffer, DWORD nNumberOfBytesToRead, DWORD *read, LONG lpDistanceToMoveHigh); +extern "C" BOOL STORMAPI SFileReadFile(HANDLE hFile, void *buffer, DWORD nNumberOfBytesToRead, DWORD *read, LONG lpDistanceToMoveHigh); -void STORMAPI SFileSetLocale(LCID lcLocale); +extern "C" void STORMAPI SFileSetLocale(LCID lcLocale); // mode: 0 - Silent (callback is NULL) // 1 - Application Defined // 2 - Handled by storm (callback is NULL) // BOOL STORMAPI callback(const char *pszFilename, DWORD dwErrCode, DWORD dwErrCount) -BOOL STORMAPI SFileSetIoErrorMode(DWORD mode, BOOL (STORMAPI *callback)(const char*,DWORD,DWORD) ); +extern "C" BOOL STORMAPI SFileSetIoErrorMode(DWORD mode, BOOL (STORMAPI *callback)(const char*,DWORD,DWORD) ); -BOOL STORMAPI SFileGetArchiveName(HANDLE hArchive, char *name, int length); -BOOL STORMAPI SFileGetFileName(HANDLE hFile, char *buffer, int length); +extern "C" BOOL STORMAPI SFileGetArchiveName(HANDLE hArchive, char *name, int length); +extern "C" BOOL STORMAPI SFileGetFileName(HANDLE hFile, char *buffer, int length); -BOOL STORMAPI SFileLoadFile(char *filename, void *buffer, int buffersize, int a4, int a5); -BOOL STORMAPI SFileUnloadFile(HANDLE hFile); -BOOL STORMAPI SFileLoadFileEx(void *hArchive, char *filename, int a3, int a4, int a5, DWORD searchScope, struct _OVERLAPPED *lpOverlapped); +extern "C" BOOL STORMAPI SFileLoadFile(char *filename, void *buffer, int buffersize, int a4, int a5); +extern "C" BOOL STORMAPI SFileUnloadFile(HANDLE hFile); +extern "C" BOOL STORMAPI SFileLoadFileEx(void *hArchive, char *filename, int a3, int a4, int a5, DWORD searchScope, struct _OVERLAPPED *lpOverlapped); // Options are DWORD except for #6 // 1: [TRUE|FALSE] - If true, reports resource leaks (SErrReportResourceLeak/SErrReportNamedResourceLeak) to the attached debugger instead of a message box. @@ -533,8 +533,8 @@ BOOL STORMAPI SFileLoadFileEx(void *hArchive, char *filename, int a3, int a4, in //BOOL STORMAPI StormGetOption(int type, void *pValue, size_t *pSize); //BOOL STORMAPI StormSetOption(int type, void *pValue, size_t size); -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); +extern "C" BOOL STORMAPI SBltROP3(void *lpDstBuffer, void *lpSrcBuffer, int srcDrawWidth, int srcDrawHeight, int dstWidth, int srcWidth, int a7, DWORD rop); +extern "C" BOOL STORMAPI SBltROP3Clipped(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_BMP 1 @@ -543,15 +543,15 @@ BOOL STORMAPI SBltROP3Clipped(void *lpDstBuffer, RECT *lpDstRect, POINT *lpDstPt /* SBmpDecodeImage @ 321 - * + * * Decodes an image that has already been loaded into a buffer. - * + * * dwImgType: Optional, the image type. See SBMP_ macros. * pSrcBuffer: A pointer to the source buffer. * dwSrcBuffersize: The size of the data in the source buffer. * pPalette: An optional buffer that receives the image palette. * pDstBuffer: A buffer that receives the image data. - * dwDstBuffersize: The size of the specified image buffer. If the size of the + * dwDstBuffersize: The size of the specified image buffer. If the size of the * destination buffer is 0, then the destination buffer is not used. * pdwWidth: An optional variable that receives the image width. * pdwHeight: An optional variable that receives the image height. @@ -559,8 +559,8 @@ BOOL STORMAPI SBltROP3Clipped(void *lpDstBuffer, RECT *lpDstRect, POINT *lpDstPt * * Returns TRUE if the image was supported and decoded correctly, FALSE otherwise. */ -BOOL -STORMAPI +extern "C" BOOL +STORMAPI SBmpDecodeImage( DWORD dwImgType, void *pSrcBuffer, @@ -574,9 +574,9 @@ SBmpDecodeImage( /* SBmpLoadImage @ 323 - * + * * Load an image from an available archive into a buffer. - * + * * pszFileName: The name of the graphic in an active archive. * pPalette: An optional buffer that receives the image palette. * pBuffer: A buffer that receives the image data. @@ -587,7 +587,7 @@ SBmpDecodeImage( * * Returns TRUE if the image was supported and loaded correctly, FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SBmpLoadImage( const char *pszFileName, @@ -599,10 +599,10 @@ SBmpLoadImage( DWORD *pdwBpp = NULL); /* SBmpSaveImage @ 324 - * - * Save an image from a buffer to a file. The image format is determined + * + * Save an image from a buffer to a file. The image format is determined * from the filename and is either .gif, .pcx, .tga, or .bmp being the default. - * + * * pszFileName: The name of the file to create. * pPalette: A pointer to a palette array containing 256 entries. * pBuffer: A buffer containing the image data. @@ -612,7 +612,7 @@ SBmpLoadImage( * * Returns TRUE if the image was saved correctly, FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SBmpSaveImage( const char *pszFileName, @@ -623,27 +623,27 @@ SBmpSaveImage( DWORD dwBpp = 8); -HANDLE STORMAPI SBmpAllocLoadImage(const char *fileName, PALETTEENTRY *palette, void **buffer, int *width, int *height, int unused6, int unused7, void *(STORMAPI *allocFunction)(DWORD)); +extern "C" HANDLE STORMAPI SBmpAllocLoadImage(const char *fileName, PALETTEENTRY *palette, void **buffer, int *width, int *height, int unused6, int unused7, void *(STORMAPI *allocFunction)(DWORD)); -BOOL STORMAPI SCodeCompile(char *directives1, char *directives2, char *loopstring, unsigned int maxiterations, unsigned int flags, HANDLE handle); -BOOL STORMAPI SCodeDelete(HANDLE handle); +extern "C" BOOL STORMAPI SCodeCompile(char *directives1, char *directives2, char *loopstring, unsigned int maxiterations, unsigned int flags, HANDLE handle); +extern "C" BOOL STORMAPI SCodeDelete(HANDLE handle); -int STORMAPI SCodeExecute(HANDLE handle, int a2); +extern "C" int STORMAPI SCodeExecute(HANDLE handle, int a2); -BOOL STORMAPI SDrawAutoInitialize(HINSTANCE hInst, LPCSTR lpClassName, LPCSTR lpWindowName, WNDPROC pfnWndProc, int nMode, int nWidth, int nHeight, int nBits); +extern "C" BOOL STORMAPI SDrawAutoInitialize(HINSTANCE hInst, LPCSTR lpClassName, LPCSTR lpWindowName, WNDPROC pfnWndProc, int nMode, int nWidth, int nHeight, int nBits); /* SDrawCaptureScreen @ 342 - * + * * Saves a screenshot from the primary surface being handled by Storm. - * + * * pszOutput: The name of the output file. The save format is automatically set by the extension. * The extensions supported are .gif, .pcx, .tga, and .bmp. It will write a bitmap by default. * * Returns TRUE if successful and FALSE otherwise. */ -BOOL -STORMAPI +extern "C" BOOL +STORMAPI SDrawCaptureScreen( const char *pszOutput); @@ -652,22 +652,22 @@ SDrawCaptureScreen( * * Retrieves the window handle that was specified in * SDrawManualInitialize or created in SDrawAutoInitialize. - * + * * sdraw_framewindow: Optional variable that receives the returned handle. * * Returns the handle of the window. */ -HWND +extern "C" HWND STORMAPI SDrawGetFrameWindow( HWND *sdraw_framewindow = NULL); /* SDrawGetObjects @ 347 - * + * * Retrieves the object information that was initialized using * SDrawManualInitialize or SDrawAutoInitialize. - * + * * ddInterface: The DirectDraw interface. * primarySurface: The primary DirectDraw surface. * surface2: A second unknown surface. @@ -678,7 +678,7 @@ SDrawGetFrameWindow( * * Returns FALSE if the direct draw interface has not been initialized. */ -BOOL +extern "C" BOOL STORMAPI SDrawGetObjects( LPDIRECTDRAW *ddInterface = NULL, @@ -691,7 +691,7 @@ SDrawGetObjects( /* SDrawGetScreenSize @ 348 - * + * * Obtains information for the current screen resolution. * * pdwWidth: Optional variable that receives the screen width. @@ -700,7 +700,7 @@ SDrawGetObjects( * * Returns FALSE if no variables were specified. */ -BOOL +extern "C" BOOL STORMAPI SDrawGetScreenSize( DWORD *pdwWidth, @@ -709,11 +709,11 @@ SDrawGetScreenSize( // undefined -BOOL STORMAPI SDrawLockSurface(int surfacenumber, RECT *lpDestRect, void **lplpSurface, int *lpPitch, int arg_unused); +extern "C" BOOL STORMAPI SDrawLockSurface(int surfacenumber, RECT *lpDestRect, void **lplpSurface, int *lpPitch, int arg_unused); /* SDrawManualInitialize @ 351 - * + * * Sets the DirectDraw variables to be referenced in Storm. * * hWnd: The handle of the DirectDraw window. @@ -730,7 +730,7 @@ BOOL STORMAPI SDrawLockSurface(int surfacenumber, RECT *lpDestRect, void **lplpS * * Returns FALSE if no variables were specified. */ -BOOL +extern "C" BOOL STORMAPI SDrawManualInitialize( HWND hWnd = NULL, @@ -745,12 +745,12 @@ SDrawManualInitialize( /* SDrawPostClose @ 353 * - * Posts a WM_QUIT message to the active drawing window specified + * Posts a WM_QUIT message to the active drawing window specified * in SDrawManualInitialize or created in SDrawAutoInitialize. * * Returns TRUE if successful and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SDrawPostClose(); @@ -758,27 +758,27 @@ SDrawPostClose(); // undefined //BOOL STORMAPI SDrawRealizePalette(); -BOOL STORMAPI SDrawUnlockSurface(int surfacenumber, void *lpSurface, int a3, RECT *lpRect); -BOOL STORMAPI SDrawUpdatePalette(unsigned int firstentry, unsigned int numentries, PALETTEENTRY *pPalEntries, int a4); +extern "C" BOOL STORMAPI SDrawUnlockSurface(int surfacenumber, void *lpSurface, int a3, RECT *lpRect); +extern "C" BOOL STORMAPI SDrawUpdatePalette(unsigned int firstentry, unsigned int numentries, PALETTEENTRY *pPalEntries, int a4); -BOOL STORMAPI SEvtDispatch(DWORD dwMessageID, DWORD dwFlags, int type, PS_EVT pEvent); +extern "C" BOOL STORMAPI SEvtDispatch(DWORD dwMessageID, DWORD dwFlags, int type, PS_EVT pEvent); -BOOL STORMAPI SGdiDeleteObject(HANDLE handle); +extern "C" BOOL STORMAPI SGdiDeleteObject(HANDLE handle); -BOOL STORMAPI SGdiExtTextOut(int a1, int a2, int a3, int a4, unsigned int a8, signed int a6, signed int a7, const char *pszString, unsigned int arg20); -BOOL STORMAPI SGdiImportFont(HGDIOBJ handle, int windowsfont); +extern "C" BOOL STORMAPI SGdiExtTextOut(int a1, int a2, int a3, int a4, unsigned int a8, signed int a6, signed int a7, const char *pszString, unsigned int arg20); +extern "C" BOOL STORMAPI SGdiImportFont(HGDIOBJ handle, int windowsfont); -BOOL STORMAPI SGdiSelectObject(int handle); -BOOL STORMAPI SGdiSetPitch(int pitch); +extern "C" BOOL STORMAPI SGdiSelectObject(int handle); +extern "C" BOOL STORMAPI SGdiSetPitch(int pitch); -BOOL STORMAPI Ordinal393(char *pszString, int, int); +extern "C" BOOL STORMAPI Ordinal393(char *pszString, int, int); /* SMemAlloc @ 401 - * + * * Allocates a block of memory. This block is different * from the standard malloc by including a header containing - * information about the block. + * information about the block. * * amount: The amount of memory to allocate, in bytes. * logfilename: The name of the file or object that this call belongs to. @@ -788,7 +788,7 @@ BOOL STORMAPI Ordinal393(char *pszString, int, int); * Returns a pointer to the allocated memory. This pointer does NOT include * the additional storm header. */ -void* +extern "C" void* STORMAPI SMemAlloc( size_t amount, @@ -800,18 +800,18 @@ SMemAlloc( /* SMemFree @ 403 - * - * Frees a block of memory that was created using SMemAlloc, + * + * Frees a block of memory that was created using SMemAlloc, * includes the log file and line for debugging purposes. * * location: The memory location to be freed. * logfilename: The name of the file or object that this call belongs to. * logline: The line in the file or one of the SLOG_ macros. - * defaultValue: + * defaultValue: * * Returns TRUE if the call was successful and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SMemFree( void *location, @@ -823,8 +823,8 @@ SMemFree( /* SMemReAlloc @ 405 - * - * Reallocates a block of memory that was created using SMemAlloc, + * + * Reallocates a block of memory that was created using SMemAlloc, * includes the log file and line for debugging purposes. * * location: The memory location to be re-allocated. If this parameter @@ -832,12 +832,12 @@ SMemFree( * amount: The amount of memory to re-allocate. * logfilename: The name of the file or object that this call belongs to. * logline: The line in the file or one of the SLOG_ macros. - * defaultValue: + * defaultValue: * * Returns a pointer to the re-allocated memory. This pointer does NOT include * the additional storm header. */ -void* +extern "C" void* STORMAPI SMemReAlloc( void *location, @@ -857,14 +857,14 @@ SMemReAlloc( #define SLOG_EXCEPTION -5 -BOOL STORMAPI SRegLoadData(const char *keyname, const char *valuename, int size, LPBYTE lpData, BYTE flags, LPDWORD lpcbData); -BOOL STORMAPI SRegLoadString(const char *keyname, const char *valuename, BYTE flags, char *buffer, size_t buffersize); -BOOL STORMAPI SRegLoadValue(const char *keyname, const char *valuename, BYTE flags, int *value); -BOOL STORMAPI SRegSaveData(const char *keyname, const char *valuename, int size, BYTE *lpData, DWORD cbData); -BOOL STORMAPI SRegSaveString(const char *keyname, const char *valuename, BYTE flags, char *string); -BOOL STORMAPI SRegSaveValue(const char *keyname, const char *valuename, BYTE flags, DWORD result); +extern "C" BOOL STORMAPI SRegLoadData(const char *keyname, const char *valuename, int size, LPBYTE lpData, BYTE flags, LPDWORD lpcbData); +extern "C" BOOL STORMAPI SRegLoadString(const char *keyname, const char *valuename, BYTE flags, char *buffer, size_t buffersize); +extern "C" BOOL STORMAPI SRegLoadValue(const char *keyname, const char *valuename, BYTE flags, int *value); +extern "C" BOOL STORMAPI SRegSaveData(const char *keyname, const char *valuename, int size, BYTE *lpData, DWORD cbData); +extern "C" BOOL STORMAPI SRegSaveString(const char *keyname, const char *valuename, BYTE flags, char *string); +extern "C" BOOL STORMAPI SRegSaveValue(const char *keyname, const char *valuename, BYTE flags, DWORD result); -BOOL STORMAPI SRegDeleteValue(const char *keyname, const char *valuename, BYTE flags); +extern "C" BOOL STORMAPI SRegDeleteValue(const char *keyname, const char *valuename, BYTE flags); // Flags for SReg functions @@ -876,29 +876,29 @@ BOOL STORMAPI SRegDeleteValue(const char *keyname, const char *valuename, BYTE f #define SREG_EXCLUDE_CURRENT_USER 0x00000004 // excludes checking the HKEY_CURRENT_USER hive #define SREG_ABSOLUTE 0x00000010 // specifies that the key is not a relative key -BOOL STORMAPI STransBlt(void *lpSurface, int x, int y, int width, HANDLE hTrans); -BOOL STORMAPI STransBltUsingMask(void *lpDest, void *lpSource, int pitch, int width, HANDLE hTrans); +extern "C" BOOL STORMAPI STransBlt(void *lpSurface, int x, int y, int width, HANDLE hTrans); +extern "C" BOOL STORMAPI STransBltUsingMask(void *lpDest, void *lpSource, int pitch, int width, HANDLE hTrans); -BOOL STORMAPI STransDelete(HANDLE hTrans); +extern "C" BOOL STORMAPI STransDelete(HANDLE hTrans); -BOOL STORMAPI STransDuplicate(HANDLE hTransSource, HANDLE hTransDest); -BOOL STORMAPI STransIntersectDirtyArray(HANDLE hTrans, char * dirtyarraymask, unsigned flags, HANDLE * phTransResult); -BOOL STORMAPI STransInvertMask(HANDLE hTrans, HANDLE * phTransResult); +extern "C" BOOL STORMAPI STransDuplicate(HANDLE hTransSource, HANDLE hTransDest); +extern "C" BOOL STORMAPI STransIntersectDirtyArray(HANDLE hTrans, char * dirtyarraymask, unsigned flags, HANDLE * phTransResult); +extern "C" BOOL STORMAPI STransInvertMask(HANDLE hTrans, HANDLE * phTransResult); -BOOL STORMAPI STransSetDirtyArrayInfo(int width, int height, int depth, int bits); +extern "C" BOOL STORMAPI STransSetDirtyArrayInfo(int width, int height, int depth, int bits); -BOOL STORMAPI STransPointInMask(HANDLE hTrans, int x, int y); // Name is a pure guess -BOOL STORMAPI STransCombineMasks(HANDLE hTransA, HANDLE hTransB, int left, int top, int flags, HANDLE * phTransResult); +extern "C" BOOL STORMAPI STransPointInMask(HANDLE hTrans, int x, int y); // Name is a pure guess +extern "C" BOOL STORMAPI STransCombineMasks(HANDLE hTransA, HANDLE hTransB, int left, int top, int flags, HANDLE * phTransResult); -BOOL STORMAPI STransCreateE(void *pBuffer, int width, int height, int bpp, int a5, int bufferSize, HANDLE *phTransOut); +extern "C" BOOL STORMAPI STransCreateE(void *pBuffer, int width, int height, int bpp, int a5, int bufferSize, HANDLE *phTransOut); -BOOL STORMAPI SVidDestroy(); -BOOL STORMAPI SVidGetSize(HANDLE video, int width, int height, int zero); -BOOL STORMAPI SVidInitialize(HANDLE video); -BOOL STORMAPI SVidPlayBegin(char *filename, int arg4, int a3, int a4, int a5, int a6, HANDLE* video); +extern "C" BOOL STORMAPI SVidDestroy(); +extern "C" BOOL STORMAPI SVidGetSize(HANDLE video, int width, int height, int zero); +extern "C" BOOL STORMAPI SVidInitialize(HANDLE video); +extern "C" BOOL STORMAPI SVidPlayBegin(char *filename, int arg4, int a3, int a4, int a5, int a6, HANDLE* video); -BOOL STORMAPI SVidPlayContinueSingle(HANDLE video, int a2, int a3); -BOOL STORMAPI SVidPlayEnd(HANDLE video); +extern "C" BOOL STORMAPI SVidPlayContinueSingle(HANDLE video, int a2, int a3); +extern "C" BOOL STORMAPI SVidPlayEnd(HANDLE video); /* SErrDisplayError @ 461 * @@ -915,7 +915,7 @@ BOOL STORMAPI SVidPlayEnd(HANDLE video); * * Returns TRUE if the user chose to continue execution, FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SErrDisplayError( DWORD dwErrMsg, @@ -930,7 +930,7 @@ SErrDisplayError( #define SEDisplayError(err) SErrDisplayError(e, __FILE__, __LINE__) /* SErrGetErrorStr @ 462 - * + * * Retrieves a string that describes the specified error code for * the system, Storm, DirectDraw, or DirectSound. * @@ -940,7 +940,7 @@ SErrDisplayError( * * Returns TRUE if the call was successful and FALSE otherwise. */ -BOOL +extern "C" BOOL STORMAPI SErrGetErrorStr( DWORD dwErrCode, @@ -951,13 +951,13 @@ SErrGetErrorStr( /* SErrGetLastError @ 463 - * + * * Retrieves the last error that was specifically * set for the Storm library. * * Returns the last error set within the Storm library. */ -DWORD +extern "C" DWORD STORMAPI SErrGetLastError(); @@ -968,21 +968,21 @@ SErrGetLastError(); /* SErrSetLastError @ 465 - * + * * Sets the last error for the Storm library and the Kernel32 library. * * dwErrCode: The error code that will be set. */ -void +extern "C" void STORMAPI SErrSetLastError( DWORD dwErrCode = NO_ERROR); -// +// // void STORMAPI SErrReportNamedResourceLeak(const char *pszMsg, const char *pszSubMsg = nullptr) // void STORMAPI SErrReportResourceLeak(const char *pszMsg) -void STORMAPI SErrSuppressErrors(BOOL suppressErrors); +extern "C" void STORMAPI SErrSuppressErrors(BOOL suppressErrors); // Values for dwErrCode #define STORM_ERROR_ASSERTION 0x85100000 @@ -1022,7 +1022,7 @@ void STORMAPI SErrSuppressErrors(BOOL suppressErrors); /* SMemCopy @ 491 - * + * * Copies a block of memory from source to destination. * This function immediately calls memcpy. See online documentation * of memcpy for more details. @@ -1031,17 +1031,17 @@ void STORMAPI SErrSuppressErrors(BOOL suppressErrors); * source: The source buffer. * size: The number of bytes to copy. */ -void +extern "C" void STORMAPI SMemCopy( - void *dest, - const void *source, + void *dest, + const void *source, size_t size); #define SMCopy(d,s) ( SMemCopy(d, s, __STORM_SSIZEMIN(s,d)) ) /* SMemFill @ 492 - * + * * Fills a block of memory with the specified character. * This function immediately calls memset. See online documentation * of memset for more details. @@ -1050,7 +1050,7 @@ SMemCopy( * source: The size of the destination buffer. * size: The format to use. */ -void +extern "C" void STORMAPI SMemFill( void *location, @@ -1060,14 +1060,14 @@ SMemFill( #define SMFill(l,f) (SMemFill(l, sizeof(l), f)) /* SMemZero @ 494 - * + * * Fills a block of memory with the integer 0x00 (Zero). * * location: The location to write at. * length: The amount of bytes to write. */ -void -STORMAPI +extern "C" void +STORMAPI SMemZero( void *location, size_t length); @@ -1075,12 +1075,12 @@ SMemZero( #define SMZero(l) (SMemZero(l, sizeof(l))) -int STORMAPI SMemCmp(void *location1, void *location2, DWORD size); +extern "C" int STORMAPI SMemCmp(void *location1, void *location2, DWORD size); #define SMCmp(l,x) ( SMemCmp(l, x, __STORM_SSIZEMIN(x,l)) ) /* SStrCopy @ 501 - * + * * Copies a string from src to dest (including NULL terminator) * until the max_length is reached. * @@ -1090,10 +1090,10 @@ int STORMAPI SMemCmp(void *location1, void *location2, DWORD size); * * Returns the number of characters copied. */ -int +extern "C" int STORMAPI SStrCopy( - char *dest, + char *dest, const char *src, int max_length = 0x7FFFFFFF); @@ -1102,7 +1102,7 @@ SStrCopy( #define STORM_HASH_ABSOLUTE 1 /* SStrHash @ 502 - * + * * Creates a simple hash for the string. This function * should NOT be used for sensitive information. * @@ -1116,17 +1116,17 @@ SStrCopy( * * Returns the 32-bit hash of the string. */ -DWORD +extern "C" DWORD STORMAPI SStrHash( const char *string, DWORD flags = 0, DWORD Seed = 0); -int STORMAPI SStrNCat(char *dest, const char *src, DWORD max_length); +extern "C" int STORMAPI SStrNCat(char *dest, const char *src, DWORD max_length); /* SStrLen @ 506 - * + * * Retrieves the length of a string. * * string: The input string of which to obtain a @@ -1134,13 +1134,13 @@ int STORMAPI SStrNCat(char *dest, const char *src, DWORD max_length); * * Returns the length of the string. */ -int +extern "C" int STORMAPI SStrLen( const char *string); /* SStrCmp @ 508 - * + * * Compares two strings case sensitive. * * string1: The first string. @@ -1149,17 +1149,17 @@ SStrLen( * * Returns 0 if strings are equal. See strcmp documentation for more details. */ -int +extern "C" int STORMAPI SStrCmp( - const char *string1, - const char *string2, + const char *string1, + const char *string2, size_t size); #define SSCmp(s,x) ( SStrCmp(s,x,__STORM_SSIZEMIN(s,x)) ) /* SStrCmpI @ 509 - * + * * Compares two strings case insensitive. * * string1: The first string. @@ -1168,33 +1168,33 @@ SStrCmp( * * Returns 0 if strings are equal. See strcmpi documentation for more details. */ -int +extern "C" int STORMAPI SStrCmpI( - const char *string1, - const char *string2, + const char *string1, + const char *string2, size_t size); #define SSCmpI(s,x) ( SStrCmpI(s,x,__STORM_SSIZEMIN(s,x)) ) /* SStrUpper @ 510 - * + * * Converts all lower-case alpha characters of a string to upper-case. * * string: The string to convert. - * + * * Returns the same pointer given in the input. */ -char* +extern "C" char* STORMAPI SStrUpper( char* string); -void STORMAPI SRgn523(HANDLE hRgn, RECT *pRect, int a3, int a4); -void STORMAPI SRgnCreateRegion(HANDLE *hRgn, int a2); -void STORMAPI SRgnDeleteRegion(HANDLE hRgn); +extern "C" void STORMAPI SRgn523(HANDLE hRgn, RECT *pRect, int a3, int a4); +extern "C" void STORMAPI SRgnCreateRegion(HANDLE *hRgn, int a2); +extern "C" void STORMAPI SRgnDeleteRegion(HANDLE hRgn); -void STORMAPI SRgn529i(int handle, int a2, int a3); +extern "C" void STORMAPI SRgn529i(int handle, int a2, int a3); /* SErrDisplayErrorFmt @ 562 @@ -1212,7 +1212,7 @@ void STORMAPI SRgn529i(int handle, int a2, int a3); * * Returns TRUE if the user chose to continue execution, FALSE otherwise. */ -BOOL +extern "C" BOOL SErrDisplayErrorFmt( DWORD dwErrMsg, const char *logfilename, @@ -1225,37 +1225,37 @@ SErrDisplayErrorFmt( //#define SEDisplayErrorFmt(err,...) SErrDisplayErrorFmt(err, __FILE__, __LINE__, FALSE, 1, __VA_ARGS__) /* SErrCatchUnhandledExceptions @ 567 - * + * * Registers a top-level exception filter managed entirely by Storm. * The registered filter will display formatted exception information by calling SErrDisplayError. */ -void +extern "C" void STORMAPI SErrCatchUnhandledExceptions(); /* SStrChr @ 571 - * - * Searches a string for the given character. See + * + * Searches a string for the given character. See * strchr documentation for more details. * * string: The string to search. * c: The character to search for. - * + * * Returns a pointer to the first occurance of the character. */ -char* +extern "C" char* STORMAPI SStrChr( - const char *string, + const char *string, char c); -char *STORMAPI SStrChrR(const char *string, char c); +extern "C" char *STORMAPI SStrChrR(const char *string, char c); /* SStrVPrintf @ 578 - * + * * Prints a formatted string to a destination buffer. * This function calls vsnprintf with some extra error handling. * See online documentation of vsnprintf for more details. @@ -1266,34 +1266,35 @@ char *STORMAPI SStrChrR(const char *string, char c); * * Returns the number of characters written. */ -size_t +extern "C" size_t SStrVPrintf( - char *dest, - size_t size, + char *dest, + size_t size, const char *format, ...); -int STORMAPI SBigDel(void *buffer); +extern "C" int STORMAPI SBigDel(void *buffer); -int STORMAPI SBigFromBinary(void *buffer, const void *str, size_t size); +extern "C" int STORMAPI SBigFromBinary(void *buffer, const void *str, size_t size); -int STORMAPI SBigNew(void **buffer); +extern "C" int STORMAPI SBigNew(void **buffer); -int STORMAPI SBigPowMod(void *buffer1, void *buffer2, int a3, int a4); +extern "C" int STORMAPI SBigPowMod(void *buffer1, void *buffer2, int a3, int a4); -int STORMAPI SBigToBinaryBuffer(void *buffer, int length, int a3, int a4); +extern "C" int STORMAPI SBigToBinaryBuffer(void *buffer, int length, int a3, int a4); + +extern "C" void __stdcall SDrawMessageBox(char *,char *,int); +extern "C" void __cdecl SDrawDestroy(void); +extern "C" bool __cdecl StormDestroy(void); +extern "C" bool __stdcall SFileSetBasePath(char *); +extern "C" void __cdecl SDrawRealizePalette(void); +extern "C" bool __cdecl SVidPlayContinue(void); +extern "C" bool __stdcall SNetGetOwnerTurnsWaiting(int *); +extern "C" void * __stdcall SNetUnregisterEventHandler(int,void (__stdcall*)(struct _SNETEVENT *)); +extern "C" void * __stdcall SNetRegisterEventHandler(int,void (__stdcall*)(struct _SNETEVENT *)); +extern "C" bool __stdcall SNetSetBasePlayer(int); +extern "C" int __stdcall SNetInitializeProvider(unsigned long,struct _SNETPROGRAMDATA *,struct _SNETPLAYERDATA *,struct _SNETUIDATA *,struct _SNETVERSIONDATA *); +extern "C" int __stdcall SNetGetProviderCaps(struct _SNETCAPS *); +extern "C" int __stdcall SFileSetFilePointer(HANDLE,int,HANDLE,int); -void __stdcall SDrawMessageBox(char *,char *,int); -void __cdecl SDrawDestroy(void); -bool __cdecl StormDestroy(void); -bool __stdcall SFileSetBasePath(char *); -void __cdecl SDrawRealizePalette(void); -bool __cdecl SVidPlayContinue(void); -bool __stdcall SNetGetOwnerTurnsWaiting(int *); -void * __stdcall SNetUnregisterEventHandler(int,void (__stdcall*)(struct _SNETEVENT *)); -void * __stdcall SNetRegisterEventHandler(int,void (__stdcall*)(struct _SNETEVENT *)); -bool __stdcall SNetSetBasePlayer(int); -int __stdcall SNetInitializeProvider(unsigned long,struct _SNETPROGRAMDATA *,struct _SNETPLAYERDATA *,struct _SNETUIDATA *,struct _SNETVERSIONDATA *); -int __stdcall SNetGetProviderCaps(struct _SNETCAPS *); -int __stdcall SFileSetFilePointer(HANDLE,int,HANDLE,int); #endif diff --git a/DiabloUI/_DiabloUI.h b/DiabloUI/_DiabloUI.h index 317a658..1afca5e 100644 --- a/DiabloUI/_DiabloUI.h +++ b/DiabloUI/_DiabloUI.h @@ -9,29 +9,29 @@ */ -void __cdecl UiDestroy(); // { return; } -void __stdcall UiTitleDialog(int a1); // { return; } -void __cdecl UiInitialize(); // { return; } -void __stdcall UiCopyProtError(int a1); // { return; } -void __stdcall UiAppActivate(int a1); // { return; } -int __stdcall UiValidPlayerName(char *a1); // { return 0; } -int __stdcall UiSelHeroMultDialog(void *fninfo, void *fncreate, void *fnremove, void *fnstats, int *a5, int *a6, char *name); // { return 0; } -int __stdcall UiSelHeroSingDialog(void *fninfo, void *fncreate, void *fnremove, void *fnstats, int *a5, char *name, int *difficulty); // { return 0; } -void __stdcall UiCreditsDialog(int a1); // { return; } -int __stdcall UiMainMenuDialog(char *name, int *a2, void *fnSound, int a4); // { return 0; } -int __stdcall UiProgressDialog(HWND window, char *msg, int a3, void *fnfunc, int a5); // { return 0; } -int __cdecl UiProfileGetString(); // { return; } -void __cdecl UiProfileCallback(); // { return; } -void __cdecl UiProfileDraw(); // { return; } -void __cdecl UiCategoryCallback(); // { return; } -void __cdecl UiGetDataCallback(); // { return; } -void __cdecl UiAuthCallback(); // { return; } -void __cdecl UiSoundCallback(); // { return; } -void __cdecl UiMessageBoxCallback(); // { return; } -void __cdecl UiDrawDescCallback(); // { return; } -void __cdecl UiCreateGameCallback(); // { return; } -void __cdecl UiArtCallback(); // { return; } -int __stdcall UiSelectGame(int a1, _SNETPROGRAMDATA *client_info, _SNETPLAYERDATA *user_info, _SNETUIDATA *ui_info, _SNETVERSIONDATA *file_info, int *a6); // { return 0; } -int __stdcall UiSelectProvider(int a1, _SNETPROGRAMDATA *client_info, _SNETPLAYERDATA *user_info, _SNETUIDATA *ui_info, _SNETVERSIONDATA *file_info, int *type); // { return 0; } -int __stdcall UiCreatePlayerDescription(_uiheroinfo *info, int mode, char *desc); // { return 0; } -int __stdcall UiSetupPlayerInfo(char *str, _uiheroinfo *info, int mode); // { return 0; } +extern "C" void UiDestroy(); // { return; } +extern "C" void __stdcall UiTitleDialog(int a1); // { return; } +extern "C" void __cdecl UiInitialize(); // { return; } +extern "C" void __stdcall UiCopyProtError(int a1); // { return; } +extern "C" void __stdcall UiAppActivate(int a1); // { return; } +extern "C" int __stdcall UiValidPlayerName(char *a1); // { return 0; } +extern "C" int __stdcall UiSelHeroMultDialog(void *fninfo, void *fncreate, void *fnremove, void *fnstats, int *a5, int *a6, char *name); // { return 0; } +extern "C" int __stdcall UiSelHeroSingDialog(void *fninfo, void *fncreate, void *fnremove, void *fnstats, int *a5, char *name, int *difficulty); // { return 0; } +extern "C" void __stdcall UiCreditsDialog(int a1); // { return; } +extern "C" int __stdcall UiMainMenuDialog(char *name, int *a2, void *fnSound, int a4); // { return 0; } +extern "C" int __stdcall UiProgressDialog(HWND window, char *msg, int a3, void *fnfunc, int a5); // { return 0; } +extern "C" int __cdecl UiProfileGetString(); // { return; } +extern "C" void __cdecl UiProfileCallback(); // { return; } +extern "C" void __cdecl UiProfileDraw(); // { return; } +extern "C" void __cdecl UiCategoryCallback(); // { return; } +extern "C" void __cdecl UiGetDataCallback(); // { return; } +extern "C" void __cdecl UiAuthCallback(); // { return; } +extern "C" void __cdecl UiSoundCallback(); // { return; } +extern "C" void __cdecl UiMessageBoxCallback(); // { return; } +extern "C" void __cdecl UiDrawDescCallback(); // { return; } +extern "C" void __cdecl UiCreateGameCallback(); // { return; } +extern "C" void __cdecl UiArtCallback(); // { return; } +extern "C" int __stdcall UiSelectGame(int a1, _SNETPROGRAMDATA *client_info, _SNETPLAYERDATA *user_info, _SNETUIDATA *ui_info, _SNETVERSIONDATA *file_info, int *a6); // { return 0; } +extern "C" int __stdcall UiSelectProvider(int a1, _SNETPROGRAMDATA *client_info, _SNETPLAYERDATA *user_info, _SNETUIDATA *ui_info, _SNETVERSIONDATA *file_info, int *type); // { return 0; } +extern "C" int __stdcall UiCreatePlayerDescription(_uiheroinfo *info, int mode, char *desc); // { return 0; } +extern "C" int __stdcall UiSetupPlayerInfo(char *str, _uiheroinfo *info, int mode); // { return 0; } diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..44d6520 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +DIABLO_SRC=$(wildcard Source/*.cpp) +DIABLO_OBJ=$(DIABLO_SRC:.cpp=.o) + +PKWARE_SRC=$(wildcard 3rdParty/PKWare/*.cpp) +PKWARE_OBJ=$(PKWARE_SRC:.cpp=.o) + +all: diablo.exe + +diablo.exe: $(DIABLO_OBJ) $(PKWARE_OBJ) storm.lib + i686-w64-mingw32-gcc -L./ -o $@ $^ -lgdi32 -lversion -ldiabloui -lstorm + +%.o: %.cpp + i686-w64-mingw32-gcc -c -fpermissive -o $@ $< + +storm.lib: storm.dll + i686-w64-mingw32-dlltool -d 3rdParty/Storm/Source/storm.def -D storm.dll -l storm.lib + +storm.dll: + echo "Please copy storm.dll (version 1.09b) here." + +clean: + rm -f $(DIABLO_OBJ) $(PKWARE_OBJ) + +.PHONY: clean all