Mercurial > mm7
changeset 18:d5954a85577a
17.01.13 (WrawPaperdoll work)
author | Ritor1 |
---|---|
date | Thu, 17 Jan 2013 17:56:08 +0600 |
parents | fe0d9a98213f |
children | 980c34defdab 5c9930cc1959 |
files | mm7_5.cpp |
diffstat | 1 files changed, 80 insertions(+), 158 deletions(-) [+] |
line wrap: on
line diff
--- a/mm7_5.cpp Thu Jan 17 16:24:25 2013 +0600 +++ b/mm7_5.cpp Thu Jan 17 17:56:08 2013 +0600 @@ -7006,8 +7006,8 @@ { Player **ppPlayer; // esi@1 Player *pPlayer; // ebx@1 - enum CHARACTER_RACE v3; // edi@1 - signed int v4; // eax@1 + enum CHARACTER_RACE pRace; // edi@1 + signed int pSex; // eax@1 int v5; // edi@4 unsigned int v6; // ecx@9 int v7; // ecx@10 @@ -7242,7 +7242,7 @@ int v236; // [sp+20h] [bp-2Ch]@260 int v237; // [sp+20h] [bp-2Ch]@298 int v238; // [sp+20h] [bp-2Ch]@336 - int v239; // [sp+24h] [bp-28h]@6 + int pBodyComplection; // [sp+24h] [bp-28h]@6 int v240; // [sp+28h] [bp-24h]@7 unsigned int v241; // [sp+2Ch] [bp-20h]@38 int v242; // [sp+2Ch] [bp-20h]@197 @@ -7251,7 +7251,7 @@ signed int v245; // [sp+34h] [bp-18h]@361 unsigned int uPlayerID_; // [sp+38h] [bp-14h]@1 int uPlayerID_a; // [sp+38h] [bp-14h]@9 - signed int v248; // [sp+40h] [bp-Ch]@4 + signed int IsDwarf; // [sp+40h] [bp-Ch]@4 int v249; // [sp+40h] [bp-Ch]@358 signed int v250; // [sp+44h] [bp-8h]@1 @@ -7260,36 +7260,33 @@ uPlayerID_ = uPlayerID; v217 = *ppPlayer; pIcons_LOD->LoadTexture("sptext01", TEXTURE_16BIT_PALETTE); - v3 = pPlayer->GetRace(); - v4 = pPlayer->GetSexByVoice(); - v250 = v4; - if ( v3 && v3 != 1 && v3 != 2 ) - { - v248 = 1; - v5 = (v4 != 0) + 2; - } - else - { - v248 = 0; - v5 = v4 != 0; - } - v239 = v5; + pRace = pPlayer->GetRace(); + pSex = pPlayer->GetSexByVoice(); + v250 = pSex; + if ( pRace && pRace != 1 && pRace != 2 ) + { + IsDwarf = 1; + v5 = (pSex != 0) + 2; + } + else + { + IsDwarf = 0; + v5 = pSex != 0; + } + pBodyComplection = v5; v244 = (*ppPlayer)->uFace; pRenderer->ResetClip(); - pRenderer->DrawTextureIndexed( - 0x1D3u, - 0, - (Texture *)(uTextureID_BACKDOLL != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BACKDOLL] : 0)); + pRenderer->DrawTextureIndexed(0x1D3u, 0, (Texture *)(uTextureID_BACKDOLL != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_BACKDOLL] : 0));//Подложка if ( !IsPlayerWearingWatersuit[uPlayerID_] ) { - v21 = pPlayer->pEquipment.uBow; + v21 = pPlayer->pEquipment.uBow; //сначало рисуется лук if ( !v21 ) goto LABEL_59; v230 = pPlayer->pEquipment.uBow; v22 = (int)&v217->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v21 + 5]; v23 = *(int *)v22; - v24 = papredoll_4E4C28 + array_4E4C30[v239].equip_x - pItemsTable->pItems[v23].uEquipX; - a3b = paperdoll_4E4C2C + array_4E4C30[v239].equip_y - pItemsTable->pItems[v23].uEquipY; + v24 = papredoll_4E4C28 + array_4E4C30[pBodyComplection].equip_x - pItemsTable->pItems[v23].uEquipX; + a3b = paperdoll_4E4C2C + array_4E4C30[pBodyComplection].equip_y - pItemsTable->pItems[v23].uEquipY; v241 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v23].pIconName, TEXTURE_16BIT_PALETTE); v25 = *(int *)(v22 + 20); if ( !(*(int *)(v22 + 20) & 0xF0) ) @@ -7318,7 +7315,7 @@ if ( !bRingsShownInCharScreen ) pRenderer->_4A612A(v24, a3b, v27, v230); LABEL_59: - v31 = v217->pEquipment.uCloak; + v31 = v217->pEquipment.uCloak;// потом плащ if ( !v31 ) goto LABEL_93; v231 = v217->pEquipment.uCloak; @@ -7345,7 +7342,7 @@ if ( v33 < 0 || v33 >= 10 ) goto LABEL_93; LABEL_74: - v34 = v33 + 10 * v239; + v34 = v33 + 10 * pBodyComplection; v35 = paperdoll_array_511828[0][v34]; a2c = papredoll_4E4C28 + paperdoll_array_4E5570[0][v34][0];// TODO indexing v36 = paperdoll_4E4C2C + paperdoll_array_4E5570[0][v34][1]; @@ -7368,11 +7365,9 @@ pRenderer->_4A612A(a2c, a3c, v42, v231); LABEL_93: v240 = 4 * uPlayerID_ - 4; - pRenderer->DrawTextureTransparent( - papredoll_4E4C28, - paperdoll_4E4C2C, + pRenderer->DrawTextureTransparent(papredoll_4E4C28, paperdoll_4E4C2C, (Texture *)(*(unsigned int *)((char *)papredoll_dbods + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dbods + v240)] : 0)); - v43 = v217->pEquipment.uBody; + v43 = v217->pEquipment.uBody;// потом тело if ( !v43 ) goto LABEL_127; v232 = v217->pEquipment.uBody; @@ -7399,7 +7394,7 @@ if ( v45 < 0 || v45 >= 17 ) goto LABEL_127; LABEL_106: - v46 = 17 * v239 + v45; + v46 = 17 * pBodyComplection + v45; a2d = papredoll_4E4C28 + paperdoll_array_4E4E30[0][v46][0];// TODO indexing v47 = paperdoll_4E4C2C + paperdoll_array_4E4E30[0][v46][1]; v48 = paperdoll_array_511290[0][v46][0]; @@ -7440,17 +7435,17 @@ v58 = *(int *)v57; if ( *(int *)v57 == 529 ) { - a3e = paperdoll_4E4C2C + paredoll_array_4E54B8[v239][1]; - a2e = papredoll_4E4C28 + paredoll_array_4E54B8[v239][0]; + a3e = paperdoll_4E4C2C + paredoll_array_4E54B8[pBodyComplection][1]; + a2e = papredoll_4E4C28 + paredoll_array_4E54B8[pBodyComplection][0]; v59 = papredoll_flying_feet[v244]; } else { if ( v58 == 512 ) { - a3e = paperdoll_4E4C2C + paredoll_array_4E54B8[v239][3]; - a2e = papredoll_4E4C28 + paredoll_array_4E54B8[v239][2]; - v59 = dword_511638[v239][5]; + a3e = paperdoll_4E4C2C + paredoll_array_4E54B8[pBodyComplection][3]; + a2e = papredoll_4E4C28 + paredoll_array_4E54B8[pBodyComplection][2]; + v59 = dword_511638[pBodyComplection][5]; } else { @@ -7459,14 +7454,14 @@ { a2e = 0; a3e = 0; - v59 = dword_511638[v239][0]; + v59 = dword_511638[pBodyComplection][0]; } else { - v61 = v60 + 7 * v239; + v61 = v60 + 7 * pBodyComplection; a3e = paperdoll_4E4C2C + dword_4E5490[0][v61][1]; a2e = papredoll_4E4C28 + dword_4E5490[0][v61][0]; - v59 = dword_511638[0][v60 + 6 * v239]; + v59 = dword_511638[0][v60 + 6 * pBodyComplection]; } } } @@ -7498,14 +7493,12 @@ LABEL_155: v68 = v217; v69 = v217->pEquipment.uMainHand; - uPlayerID_a = 2 * v239; - if ( !v69 - || (v70 = *(int *)&v217->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v69 + 5], + uPlayerID_a = 2 * pBodyComplection; + if ( !v69 || (v70 = *(int *)&v217->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v69 + 5], pItemsTable->pItems[v70].uEquipType != 1) && (pItemsTable->pItems[v70].uSkillType != 4 || v217->pEquipment.uOffHand) ) - pRenderer->DrawTextureTransparent( - papredoll_4E4C28 + dword_4E5AE0[2 * v239], - paperdoll_4E4C2C + dword_4E5AE0[2 * v239 + 1], + pRenderer->DrawTextureTransparent(papredoll_4E4C28 + dword_4E5AE0[2 * pBodyComplection], + paperdoll_4E4C2C + dword_4E5AE0[2 * pBodyComplection + 1], (Texture *)(*(unsigned int *)((char *)papredoll_dlads + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlads + v240)] : 0)); v71 = v217->pEquipment.uBelt; if ( v71 ) @@ -7529,13 +7522,13 @@ if ( v73 >= 0 && v73 < 7 ) { LABEL_168: - v74 = 7 * v239 + v73; + v74 = 7 * pBodyComplection + v73; a2f = papredoll_4E4C28 + dword_4E57F0[0][v74][0]; a3f = paperdoll_4E4C2C + dword_4E57F0[0][v74][1]; - if ( v248 != 1 || v73 == 5 ) + if ( IsDwarf != 1 || v73 == 5 ) v75 = stru_511718.texids[v74]; else - v75 = stru_511718.texids[v73 + 7 * (v239 - 2)]; + v75 = stru_511718.texids[v73 + 7 * (pBodyComplection - 2)]; v76 = *(int *)&v217->field_1F5[36 * v71 + 15]; if ( !(*(int *)&v217->field_1F5[36 * v71 + 15] & 0xF0) ) { @@ -7588,14 +7581,8 @@ ptr_50C9A4 = 0; } v78 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6( - a2f, - a3f, - (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), - v77, - (signed __int64)v78, - 0, - 255); + pRenderer->_4A63E6(a2f, a3f, (Texture *)(v75 != -1 ? (int)&pIcons_LOD->pTextures[v75] : 0), + v77, (signed __int64)v78, 0, 255); LABEL_191: v68 = v217; goto LABEL_192; @@ -7612,8 +7599,7 @@ v83 = *(int *)&v68->spellbook.pDarkSpellbook.bIsSpellAvailable[36 * v82 + 5]; if ( pItemsTable->pItems[v83].uEquipType == 1 || pItemsTable->pItems[v83].uSkillType == 4 && !v68->pEquipment.uOffHand ) - pRenderer->DrawTextureTransparent( - papredoll_4E4C28 + pPaperdollLeftHand[uPlayerID_a], + pRenderer->DrawTextureTransparent(papredoll_4E4C28 + pPaperdollLeftHand[uPlayerID_a], paperdoll_4E4C2C + pPaperdollLeftHand[uPlayerID_a + 1], (Texture *)(*(unsigned int *)((char *)papredoll_dlaus + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlaus + v240)] : 0)); } @@ -7666,7 +7652,7 @@ if ( v114 < 0 || v114 >= 10 ) goto LABEL_293; LABEL_274: - v115 = v114 + 10 * v239; + v115 = v114 + 10 * pBodyComplection; v116 = dword_511788[v115]; v115 *= 8; v117 = papredoll_4E4C28 + *(int *)((char *)&dword_4E56B0 + v115); @@ -7719,10 +7705,10 @@ } v125 = v192; LABEL_312: - v126 = 2 * (v125 + 16 * v239); + v126 = 2 * (v125 + 16 * pBodyComplection); a2j = papredoll_4E4C28 + dword_4E58D0[v126]; a3i = paperdoll_4E4C2C + dword_4E58D4[v126]; - if ( v248 != 1 || *(int *)v124 != 92 ) + if ( IsDwarf != 1 || *(int *)v124 != 92 ) v127 = stru_511698.texids[v125 + 16 * v250]; else v127 = papredoll_dbrds[11]; @@ -7800,10 +7786,10 @@ v136 = *(int *)v135; v137 = *(int *)v135; a2k = papredoll_4E4C28 - + array_4E4C30[v239].field_8 + + array_4E4C30[pBodyComplection].field_8 - pItemsTable->pItems[v137].uEquipX; a3j = paperdoll_4E4C2C - + array_4E4C30[v239].field_C + + array_4E4C30[pBodyComplection].field_C - pItemsTable->pItems[v137].uEquipY; if ( v136 == 64 ) v181 = "item64v1"; @@ -7850,10 +7836,10 @@ v245 = 0; LABEL_362: v150 = papredoll_4E4C28 - + array_4E4C30[v239].field_0 + + array_4E4C30[pBodyComplection].field_0 - pItemsTable->pItems[v148].uEquipX; a3k = paperdoll_4E4C2C - + LODWORD(array_4E4C30[v239].field_4) + + LODWORD(array_4E4C30[pBodyComplection].field_4) - pItemsTable->pItems[v148].uEquipY; goto LABEL_370; } @@ -7941,11 +7927,9 @@ 255); LABEL_391: if ( v245 ) - pRenderer->DrawTextureTransparent( - papredoll_4E4C28 + pRenderer->DrawTextureTransparent(papredoll_4E4C28 + pPaperdollLeftEmptyHand[uPlayerID_a], - paperdoll_4E4C2C - + pPaperdollLeftEmptyHand[uPlayerID_a + 1], + paperdoll_4E4C2C + pPaperdollLeftEmptyHand[uPlayerID_a + 1], (Texture *)(*(unsigned int *)((char *)papredoll_dlhs + v240) != -1 ? (int)&pIcons_LOD->pTextures[*(unsigned int *)((char *)papredoll_dlhs + v240)] : 0)); goto LABEL_393; @@ -7996,14 +7980,8 @@ ptr_50C9A4 = 0; } v141 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6( - a2k, - a3j, - (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0), - v140, - (signed __int64)v141, - 0, - 255); + pRenderer->_4A63E6(a2k, a3j, (Texture *)(v138 != -1 ? (int)&pIcons_LOD->pTextures[v138] : 0), + v140, (signed __int64)v141, 0, 255); goto LABEL_358; } } @@ -8085,7 +8063,7 @@ || v68->GetEquippedItemSkillType(EQUIP_TWO_HANDED) == 4 && !v68->pEquipment.uOffHand) ) { - v91 = 17 * v239 + v90; + v91 = 17 * pBodyComplection + v90; v92 = v91; v223 = paperdoll_array_511290[0][v91][2]; if ( v223 == pIcons_LOD->FindTextureByName("pending") ) @@ -8134,14 +8112,8 @@ v174 = 0; v97 = (double)GetTickCount(); LABEL_249: - pRenderer->_4A63E6( - a2g, - a3g, - (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), - (Texture *)v96, - (signed __int64)(v97 * 0.1), - v174, - v187); + pRenderer->_4A63E6(a2g, a3g, (Texture *)(v94 != -1 ? (int)&pIcons_LOD->pTextures[v94] : 0), + (Texture *)v96, (signed __int64)(v97 * 0.1), v174, v187); goto LABEL_258; } } @@ -8177,7 +8149,7 @@ v165 = a2g; goto LABEL_255; } - v102 = 17 * v239 + v90; + v102 = 17 * pBodyComplection + v90; v94 = paperdoll_array_511290[0][v102][1]; if ( v94 == pIcons_LOD->FindTextureByName("pending") ) { @@ -8341,14 +8313,8 @@ ptr_50C9A4 = 0; } v52 = (double)GetTickCount() * 0.1; - pRenderer->_4A63E6( - a2d, - a3d, - (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0), - v51, - (signed __int64)v52, - 0, - 255); + pRenderer->_4A63E6(a2d, a3d, (Texture *)(v48 != -1 ? (int)&pIcons_LOD->pTextures[v48] : 0), + v51, (signed __int64)v52, 0, 255); goto LABEL_127; } LABEL_116: @@ -17854,7 +17820,7 @@ void __cdecl sub_419401() { unsigned int v0; // ecx@3 - GUIButton *i; // eax@3 + GUIButton *pButton; // eax@3 GUIFont *v2; // eax@8 unsigned int v3; // esi@8 int v4; // eax@10 @@ -17879,18 +17845,18 @@ sub_4196A0(); v0 = uActiveCharacter; dword_507CC0 = uActiveCharacter; - for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = i->pNext ) - { - if ( i->uControlID == 120 ) - { - dword_50698C = i->uX; - dword_506988 = i->uY; - dword_506984 = i->uZ; - dword_506980 = i->uW; - i->uW = 0; - i->uZ = 0; - i->uY = 0; - i->uX = 0; + for ( pButton = pGUIWindow_CurrentMenu->pControlsHead; pButton; pButton = pButton->pNext ) + { + if ( pButton->uControlID == 120 ) + { + dword_50698C = pButton->uX; + dword_506988 = pButton->uY; + dword_506984 = pButton->uZ; + dword_506980 = pButton->uW; + pButton->uW = 0; + pButton->uZ = 0; + pButton->uY = 0; + pButton->uX = 0; v0 = uActiveCharacter; } } @@ -17902,24 +17868,13 @@ v3 = 2 * LOBYTE(pFontLucida->uFontHeight) + 13; do { - if ( v18[2 * *v14 + 264] & 0x3F ) + if ( v18[2 * *v14 + 264] & 0x3F )//crash { v4 = LOBYTE(v2->uFontHeight); v3 = v3 + v4 - 3; ++a2; ++v12; - pGUIWindow_CurrentMenu->CreateButton( - 0x18u, - v3, - 0xCCu, - v4 - 3, - 3, - *v14 | 0x8000, - 0x79u, - *v14, - 0, - "", - 0); + pGUIWindow_CurrentMenu->CreateButton(0x18u, v3, 0xCCu, v4 - 3, 3, *v14 | 0x8000, 0x79u, *v14, 0, "", 0, 0); v2 = pFontLucida; } ++v14; @@ -17936,18 +17891,7 @@ v6 = LOBYTE(v2->uFontHeight); v5 = v5 + v6 - 3; ++a2; - pGUIWindow_CurrentMenu->CreateButton( - 0x18u, - v5, - 0xCCu, - v6 - 3, - 3, - *v15 | 0x8000, - 0x79u, - *v15, - 0, - "", - 0); + pGUIWindow_CurrentMenu->CreateButton(0x18u, v5, 0xCCu, v6 - 3, 3, *v15 | 0x8000, 0x79u, *v15, 0, "", 0, 0); v2 = pFontLucida; } ++v15; @@ -17964,18 +17908,7 @@ v7 = v7 + v8 - 3; ++a2; ++v13; - pGUIWindow_CurrentMenu->CreateButton( - 0xF6u, - v7, - 0xCCu, - v8 - 3, - 3, - *v16 | 0x8000, - 0x79u, - *v16, - 0, - "", - 0); + pGUIWindow_CurrentMenu->CreateButton(0xF6u, v7, 0xCCu, v8 - 3, 3, *v16 | 0x8000, 0x79u, *v16, 0, "", 0, 0); v2 = pFontLucida; } ++v16; @@ -17992,18 +17925,7 @@ v10 = LOBYTE(v2->uFontHeight); v9 = v9 + v10 - 3; ++a2; - pGUIWindow_CurrentMenu->CreateButton( - 0xF6u, - v9, - 0xCCu, - v10 - 3, - 3, - *v17 | 0x8000, - 0x79u, - *v17, - 0, - "", - 0); + pGUIWindow_CurrentMenu->CreateButton(0xF6u, v9, 0xCCu, v10 - 3, 3, *v17 | 0x8000, 0x79u, *v17, 0, "", 0, 0); v2 = pFontLucida; } ++v17;