comparison mm7_1.cpp @ 315:2a09e1d6fc8f

Some 0041D895 GameUI_DrawItemInfo overhaul
author Nomad
date Wed, 20 Feb 2013 01:17:13 +0200
parents e33f5a1cdc46
children 922a96fdcc86
comparison
equal deleted inserted replaced
306:e33f5a1cdc46 315:2a09e1d6fc8f
879 v14 = 14; 879 v14 = 14;
880 v16 = pItem->uAttributes; 880 v16 = pItem->uAttributes;
881 v17 = uCellX + ((v15 - v10) >> 1) + pSRZBufferLineOffsets[uCellY + ((((v14 - 14) & 0xFFFFFFE0) - v9 + 32) >> 1)]; 881 v17 = uCellX + ((v15 - v10) >> 1) + pSRZBufferLineOffsets[uCellY + ((((v14 - 14) & 0xFFFFFFE0) - v9 + 32) >> 1)];
882 if ( !(v16 & 0xF0) ) 882 if ( !(v16 & 0xF0) )
883 { 883 {
884 if ( v16 & 1 884 if (pItem->Identified() || pCurrentScreen != SCREEN_HOUSE )
885 || pCurrentScreen != SCREEN_HOUSE )
886 { 885 {
887 if ( v16 & 2 ) 886 if (pItem->Broken())
888 pRenderer->_4A6776(uCellX, uCellY, v7); 887 pRenderer->DrawTransparentRedShade(uCellX, uCellY, v7);
889 else 888 else
890 pRenderer->DrawTextureTransparent(uCellX, uCellY, v7); 889 pRenderer->DrawTextureTransparent(uCellX, uCellY, v7);
891 } 890 }
892 else 891 else
893 { 892 {
2303 return a1->DrawText(a2, 32, uY, 0, pTmpBuf, 0, 0, 0); 2302 return a1->DrawText(a2, 32, uY, 0, pTmpBuf, 0, 0, 0);
2304 } 2303 }
2305 2304
2306 2305
2307 //----- (0041D895) -------------------------------------------------------- 2306 //----- (0041D895) --------------------------------------------------------
2308 void __thiscall GameUI_DrawItemInfo(ItemGen *ecx0) 2307 void GameUI_DrawItemInfo(ItemGen *ecx0)
2309 { 2308 {
2310 ItemGen *v1; // esi@1 2309 ItemGen *v1; // esi@1
2311 unsigned int v2; // eax@3 2310 unsigned int v2; // eax@3
2312 char *v3; // edi@5 2311 //char *v3; // edi@5
2313 unsigned int v4; // eax@5 2312 //unsigned int v4; // eax@5
2314 unsigned int v5; // esi@5 2313 //unsigned int v5; // esi@5
2315 signed int v6; // eax@5 2314 signed int v6; // eax@5
2316 int v7; // edx@5 2315 int v7; // edx@5
2317 ItemGen *v8; // ecx@10 2316 ItemGen *v8; // ecx@10
2318 unsigned int v9; // eax@12 2317 //unsigned int v9; // eax@12
2319 char v10; // zf@16 2318 char v10; // zf@16
2320 ItemGen *v11; // eax@16 2319 ItemGen *v11; // eax@16
2321 ItemGen *v12; // eax@25 2320 ItemGen *v12; // eax@25
2322 unsigned int v13; // ecx@32 2321 //unsigned int v13; // ecx@32
2323 unsigned int v14; // eax@32 2322 //unsigned int v14; // eax@32
2324 Render *v15; // edi@33 2323 //Render *v15; // edi@33
2325 const char *v16; // eax@34 2324 const char *v16; // eax@34
2326 int v17; // eax@36 2325 int v17; // eax@36
2327 int v18; // esi@37 2326 int v18; // esi@37
2328 unsigned __int16 v19; // ax@37 2327 unsigned __int16 v19; // ax@37
2329 char v20; // al@40 2328 //char v20; // al@40
2330 char v21; // al@44 2329 char v21; // al@44
2331 char v22; // al@48 2330 //char v22; // al@48
2332 char v23; // al@51 2331 //char v23; // al@51
2333 int v24; // eax@52 2332 int v24; // eax@52
2334 int v25; // eax@57 2333 int v25; // eax@57
2335 int v26; // eax@60 2334 int v26; // eax@60
2336 int v27; // eax@67 2335 int v27; // eax@67
2337 const char *v28; // edi@69 2336 const char *v28; // edi@69
2347 unsigned int v38; // eax@109 2346 unsigned int v38; // eax@109
2348 int v39; // eax@113 2347 int v39; // eax@113
2349 GUIFont *v40; // edx@113 2348 GUIFont *v40; // edx@113
2350 signed int v41; // [sp-20h] [bp-298h]@113 2349 signed int v41; // [sp-20h] [bp-298h]@113
2351 int v42; // [sp-1Ch] [bp-294h]@113 2350 int v42; // [sp-1Ch] [bp-294h]@113
2352 char *v43; // [sp-18h] [bp-290h]@46 2351 //char *v43; // [sp-18h] [bp-290h]@46
2353 unsigned int v44; // [sp-18h] [bp-290h]@113 2352 unsigned int v44; // [sp-18h] [bp-290h]@113
2354 int v45; // [sp-14h] [bp-28Ch]@46 2353 //int v45; // [sp-14h] [bp-28Ch]@46
2355 const char *v46; // [sp-14h] [bp-28Ch]@58 2354 const char *v46; // [sp-14h] [bp-28Ch]@58
2356 char *v47; // [sp-14h] [bp-28Ch]@110 2355 char *v47; // [sp-14h] [bp-28Ch]@110
2357 char *v48; // [sp-10h] [bp-288h]@46 2356 //char *v48; // [sp-10h] [bp-288h]@46
2358 const char *v49; // [sp-10h] [bp-288h]@56 2357 const char *v49; // [sp-10h] [bp-288h]@56
2359 char *v50; // [sp-10h] [bp-288h]@58 2358 char *v50; // [sp-10h] [bp-288h]@58
2360 int v51; // [sp-10h] [bp-288h]@110 2359 int v51; // [sp-10h] [bp-288h]@110
2361 const char *v52; // [sp-Ch] [bp-284h]@36 2360 const char *v52; // [sp-Ch] [bp-284h]@36
2362 int v53; // [sp-Ch] [bp-284h]@46 2361 //int v53; // [sp-Ch] [bp-284h]@46
2363 char *v54; // [sp-Ch] [bp-284h]@56 2362 char *v54; // [sp-Ch] [bp-284h]@56
2364 int v55; // [sp-Ch] [bp-284h]@58 2363 int v55; // [sp-Ch] [bp-284h]@58
2365 int v56; // [sp-Ch] [bp-284h]@110 2364 int v56; // [sp-Ch] [bp-284h]@110
2366 unsigned int v57; // [sp-8h] [bp-280h]@36 2365 unsigned int v57; // [sp-8h] [bp-280h]@36
2367 int v58; // [sp-8h] [bp-280h]@46 2366 //int v58; // [sp-8h] [bp-280h]@46
2368 int v59; // [sp-8h] [bp-280h]@56 2367 int v59; // [sp-8h] [bp-280h]@56
2369 int v60; // [sp-8h] [bp-280h]@58 2368 int v60; // [sp-8h] [bp-280h]@58
2370 unsigned int v61; // [sp-8h] [bp-280h]@110 2369 unsigned int v61; // [sp-8h] [bp-280h]@110
2371 char a1[100]; // [sp+8h] [bp-270h]@40 2370 char a1[300]; // [sp+8h] [bp-270h]@40
2372 char Dest[100]; // [sp+6Ch] [bp-20Ch]@40 2371 //char Dest[100]; // [sp+6Ch] [bp-20Ch]@40
2373 char v64[100]; // [sp+D0h] [bp-1A8h]@40 2372 //char v64[100]; // [sp+D0h] [bp-1A8h]@40
2374 char v65[120]; // [sp+134h] [bp-144h]@92 2373 char v65[120]; // [sp+134h] [bp-144h]@92
2375 char Source[40]; // [sp+1ACh] [bp-CCh]@49 2374 char Source[40]; // [sp+1ACh] [bp-CCh]@49
2376 int v67; // [sp+1D4h] [bp-A4h]@91 2375 int v67; // [sp+1D4h] [bp-A4h]@91
2377 int v68; // [sp+1D8h] [bp-A0h]@106 2376 int v68; // [sp+1D8h] [bp-A0h]@106
2378 int v69; // [sp+1DCh] [bp-9Ch]@101 2377 int v69; // [sp+1DCh] [bp-9Ch]@101
2379 int v70; // [sp+1E0h] [bp-98h]@97 2378 int v70; // [sp+1E0h] [bp-98h]@97
2380 int v71; // [sp+1E8h] [bp-90h]@93 2379 int v71; // [sp+1E8h] [bp-90h]@93
2381 int v72; // [sp+1ECh] [bp-8Ch]@91 2380 int v72; // [sp+1ECh] [bp-8Ch]@91
2382 int var88; // [sp+1F0h] [bp-88h]@1 2381 int var88; // [sp+1F0h] [bp-88h]@1
2383 Texture *v73; // [sp+1F4h] [bp-84h]@5 2382 Texture *v73; // [sp+1F4h] [bp-84h]@5
2384 unsigned int v75; // [sp+1F8h] [bp-80h]@5 2383 //unsigned int v75; // [sp+1F8h] [bp-80h]@5
2385 char *v76; // [sp+1FCh] [bp-7Ch]@5 2384 //char *v76; // [sp+1FCh] [bp-7Ch]@5
2386 int v77; // [sp+200h] [bp-78h]@12 2385 int v77; // [sp+200h] [bp-78h]@12
2387 int v78; // [sp+204h] [bp-74h]@5 2386 int v78; // [sp+204h] [bp-74h]@5
2388 GUIWindow v79; // [sp+208h] [bp-70h]@2 2387 GUIWindow v79; // [sp+208h] [bp-70h]@2
2389 POINT a2; // [sp+25Ch] [bp-1Ch]@2 2388 POINT a2; // [sp+25Ch] [bp-1Ch]@2
2390 int v81; // [sp+264h] [bp-14h]@5 2389 int v81; // [sp+264h] [bp-14h]@5
2407 if ( pMouse->GetCursorPos(&a2)->x <= 320 ) 2406 if ( pMouse->GetCursorPos(&a2)->x <= 320 )
2408 v2 = pMouse->GetCursorPos(&a2)->x + 30; 2407 v2 = pMouse->GetCursorPos(&a2)->x + 30;
2409 else 2408 else
2410 v2 = pMouse->GetCursorPos(&a2)->x - v79.uFrameWidth - 30; 2409 v2 = pMouse->GetCursorPos(&a2)->x - v79.uFrameWidth - 30;
2411 v79.uFrameX = v2; 2410 v79.uFrameX = v2;
2412 v3 = (char *)&pItemsTable->pItems[_this->uItemID].pIconName; 2411 auto item_desc = &pItemsTable->pItems[_this->uItemID];
2413 v76 = v3; 2412 //v3 = (char *)&pItemsTable->pItems[_this->uItemID].pIconName;
2414 v4 = pIcons_LOD->LoadTexture(*(const char **)v3, TEXTURE_16BIT_PALETTE); 2413 //v76 = v3;
2415 v5 = v4; 2414 //v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[_this->uItemID].pIconName, TEXTURE_16BIT_PALETTE);
2416 v4 *= 72; 2415 //v5 = v4;
2417 v75 = v4; 2416 //v4 *= 72;
2418 v73 = (struct Texture *)((char *)pIcons_LOD->pTextures + v4); 2417 //v75 = v4;
2419 v6 = 100 - *(unsigned __int16 *)((char *)&pIcons_LOD->pTextures[0].uTextureWidth + v4); 2418 //v73 = &pIcons_LOD->pTextures[v4];
2419 v73 = pIcons_LOD->LoadTexturePtr(item_desc->pIconName, TEXTURE_16BIT_PALETTE);
2420 v6 = 100 - v73->uTextureWidth;
2420 v7 = v73->uTextureHeight; 2421 v7 = v73->uTextureHeight;
2421 v78 = v6; 2422 v78 = v6;
2422 v81 = 144 - v7; 2423 v81 = 144 - v7;
2423 if ( v6 > 0 ) 2424 if ( v6 > 0 )
2424 v78 = v6 >> 1; 2425 v78 = v6 >> 1;
2425 if ( v81 <= 0 ) 2426 if ( v81 <= 0 )
2426 v81 = 0; 2427 v81 = 0;
2427 else 2428 else
2428 v81 >>= 1; 2429 v81 >>= 1;
2429 v8 = _this; 2430 v8 = _this;
2430 if ( !v3[46] ) 2431 if ( !item_desc->uItemID_Rep_St )
2431 _this->uAttributes |= 1u; 2432 _this->SetIdentified();
2432 v9 = v8->uAttributes; 2433 //v9 = v8->uAttributes;
2433 v77 = 0; 2434 v77 = 0;
2434 a2.y = v9 & 2; 2435 //a2.y = v8->uAttributes & 2;
2435 if ( pItemsTable->pItems[v8->uItemID].uEquipType == 18 ) 2436 if (pItemsTable->pItems[v8->uItemID].uEquipType == EQUIP_GOLD)
2436 v77 = v8->uAdditionalValue; 2437 v77 = v8->uAdditionalValue;
2437 if ( uActiveCharacter ) 2438 if ( uActiveCharacter )
2438 { 2439 {
2439 if ( !(v9 & 1) ) 2440 if (!v8->Identified())
2440 { 2441 {
2441 v10 = pPlayers[uActiveCharacter]->CanIdentify(_this) == 1; 2442 v10 = pPlayers[uActiveCharacter]->CanIdentify(_this) == 1;
2442 v11 = _this; 2443 v11 = _this;
2443 if ( v10 ) 2444 if ( v10 )
2444 _this->uAttributes |= 1u; 2445 _this->SetIdentified();
2445 v10 = (v11->uAttributes & 1) == 0; 2446 v10 = !v11->Identified();
2446 v83 = (char *)9; 2447 v83 = (char *)9;
2447 if ( v10 ) 2448 if ( v10 )
2448 { 2449 {
2449 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u); 2450 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u);
2450 } 2451 }
2459 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); 2460 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0);
2460 dword_4E455C = 0; 2461 dword_4E455C = 0;
2461 } 2462 }
2462 } 2463 }
2463 _this->UpdateTempBonus(pParty->uTimePlayed); 2464 _this->UpdateTempBonus(pParty->uTimePlayed);
2464 if ( a2.y ) 2465 if (v8->Broken())
2465 { 2466 {
2466 v10 = pPlayers[uActiveCharacter]->CanRepair(_this) == 1; 2467 v10 = pPlayers[uActiveCharacter]->CanRepair(_this) == 1;
2467 v12 = _this; 2468 v12 = _this;
2468 if ( v10 ) 2469 if ( v10 )
2469 _this->uAttributes = _this->uAttributes & 0xFFFFFFFD | 1; 2470 _this->uAttributes = _this->uAttributes & 0xFFFFFFFD | 1;
2470 v10 = (v12->uAttributes & 2) == 0; 2471 v10 = !v12->Broken();
2471 v83 = (char *)SPEECH_11; 2472 v83 = (char *)SPEECH_11;
2472 if ( v10 ) 2473 if ( v10 )
2473 v83 = (char *)SPEECH_10; 2474 v83 = (char *)SPEECH_10;
2474 else 2475 else
2475 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u); 2476 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u);
2478 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); 2479 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0);
2479 dword_4E455C = 0; 2480 dword_4E455C = 0;
2480 } 2481 }
2481 } 2482 }
2482 } 2483 }
2483 v13 = _this->uAttributes; 2484 //v13 = _this->uAttributes;
2484 v14 = _this->uAttributes & 1; 2485 //v14 = _this->Identified();
2485 a2.y = _this->uAttributes & 1; 2486 a2.y = _this->Identified();
2486 if ( v13 & 2 ) 2487 if (_this->Broken())
2487 { 2488 {
2488 v79.DrawMessageBox(0); 2489 v79.DrawMessageBox(0);
2489 //v15 = &; 2490 //v15 = &;
2490 pRenderer->Clip( 2491 pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12,
2491 v79.uFrameX + 12, 2492 v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12);
2492 v79.uFrameY + 12,
2493 v79.uFrameX + v79.uFrameWidth - 12,
2494 v79.uFrameY + v79.uFrameHeight - 12);
2495 v79.uFrameWidth -= 24; 2493 v79.uFrameWidth -= 24;
2496 v79.uFrameHeight -= 12; 2494 v79.uFrameHeight -= 12;
2497 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; 2495 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1;
2498 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; 2496 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1;
2499 pRenderer->_4A6776( 2497 pRenderer->DrawTransparentRedShade(v79.uFrameX + v78, v81 + v79.uFrameY + 30, v73);
2500 v79.uFrameX + v78,
2501 v81 + v79.uFrameY + 30,
2502 (Texture *)(v5 != -1 ? (int)((char *)pIcons_LOD->pTextures + v75) : 0));
2503 if ( a2.y ) 2498 if ( a2.y )
2504 v16 = _this->GetIdentifiedName(); 2499 v16 = _this->GetIdentifiedName();
2505 else 2500 else
2506 v16 = (const char *)*((int *)v76 + 2); 2501 v16 = item_desc->pUnidentifiedName;
2507 v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u); 2502 v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u);
2508 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &v79, 0, 0); 2503 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &v79, 0, 0);
2509 v57 = 3; 2504 v57 = 3;
2510 v52 = pGlobalTXT_LocalizationStrings[32]; 2505 v52 = pGlobalTXT_LocalizationStrings[32];
2511 goto LABEL_37; 2506 goto LABEL_37;
2512 } 2507 }
2513 if ( !v14 ) 2508 if (!_this->Identified())
2514 { 2509 {
2515 v79.DrawMessageBox(0); 2510 v79.DrawMessageBox(0);
2516 v15 = pRenderer; 2511 //v15 = pRenderer;
2517 pRenderer->Clip( 2512 pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12,
2518 v79.uFrameX + 12, 2513 v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12);
2519 v79.uFrameY + 12,
2520 v79.uFrameX + v79.uFrameWidth - 12,
2521 v79.uFrameY + v79.uFrameHeight - 12);
2522 v79.uFrameWidth -= 24; 2514 v79.uFrameWidth -= 24;
2523 v79.uFrameHeight -= 12; 2515 v79.uFrameHeight -= 12;
2524 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; 2516 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1;
2525 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; 2517 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1;
2526 pRenderer->DrawTextureTransparent( 2518 pRenderer->DrawTextureTransparent(v79.uFrameX + v78, v81 + v79.uFrameY + 30, v73);
2527 v79.uFrameX + v78, 2519 v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, item_desc->pUnidentifiedName, 3u);
2528 v81 + v79.uFrameY + 30,
2529 (Texture *)(v5 != -1 ? (int)((char *)pIcons_LOD->pTextures + v75) : 0));
2530 v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, *((const char **)v76 + 2), 3u);
2531 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &v79, 0, 0); 2520 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &v79, 0, 0);
2532 v57 = 3; 2521 v57 = 3;
2533 v52 = pGlobalTXT_LocalizationStrings[232]; 2522 v52 = pGlobalTXT_LocalizationStrings[232];
2534 LABEL_37: 2523 LABEL_37:
2535 v18 = v17 >> 1; 2524 v18 = v17 >> 1;
2536 v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); 2525 v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u);
2537 v79.DrawTitleText(pFontArrus, 0x64u, ((signed int)v79.uFrameHeight >> 1) - v18, v19, v52, v57); 2526 v79.DrawTitleText(pFontArrus, 0x64u, ((signed int)v79.uFrameHeight >> 1) - v18, v19, v52, v57);
2538 goto LABEL_116; 2527 goto LABEL_116;
2539 } 2528 }
2540 sprintf(a1, pGlobalTXT_LocalizationStrings[463], *((int *)v3 + 2)); 2529
2541 strcpy(Dest, ""); 2530 sprintfex(a1, pGlobalTXT_LocalizationStrings[463], item_desc->pUnidentifiedName);
2542 strcpy(v64, ""); 2531 a1[100] = 0;
2543 v20 = v3[28]; 2532 a1[200] = 0;
2544 if ( (unsigned __int8)v20 <= 1u ) 2533 //v20 = item_desc->uEquipType;
2545 { 2534 switch (item_desc->uEquipType)
2546 v58 = (unsigned __int8)v3[31]; 2535 {
2547 v53 = (unsigned __int8)v3[30]; 2536 case EQUIP_ONE_OR_TWO_HANDS:
2548 v48 = pGlobalTXT_LocalizationStrings[53]; 2537 case EQUIP_TWO_HANDED:
2549 v45 = (unsigned __int8)v3[32]; 2538 sprintfex(a1 + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[18], (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll);
2550 v43 = pGlobalTXT_LocalizationStrings[18]; 2539 if (item_desc->uDamageMod)
2551 }
2552 else
2553 {
2554 if ( v20 != 2 )
2555 {
2556 if ( (unsigned __int8)v20 > 2u )
2557 { 2540 {
2558 if ( (unsigned __int8)v20 <= 0xBu ) 2541 char mod[16];
2559 { 2542 sprintf(mod, "+%d", (int)item_desc->uDamageMod);
2560 v21 = v3[30]; 2543 strcat(a1 + 100, mod);
2561 if ( v21 )
2562 sprintf(
2563 Dest,
2564 "%s: +%d",
2565 pGlobalTXT_LocalizationStrings[11],
2566 (unsigned __int8)v21 + (unsigned __int8)v3[32]);
2567 }
2568 } 2544 }
2569 goto LABEL_50; 2545 break;
2570 } 2546
2571 v58 = (unsigned __int8)v3[31]; 2547 case EQUIP_BOW:
2572 v53 = (unsigned __int8)v3[30]; 2548 sprintfex(a1 + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll);
2573 v48 = pGlobalTXT_LocalizationStrings[53]; 2549 if (item_desc->uDamageMod)
2574 v45 = (unsigned __int8)v3[32]; 2550 {
2575 v43 = pGlobalTXT_LocalizationStrings[203]; 2551 char mod[16];
2576 } 2552 sprintf(mod, "+%d", (int)item_desc->uDamageMod);
2577 sprintf(Dest, "%s: +%d %s: %dd%d", v43, v45, v48, v53, v58); 2553 strcat(a1 + 100, mod);
2578 v22 = v3[32]; 2554 }
2579 if ( v22 ) 2555 break;
2580 { 2556
2581 sprintf(Source, " +%d", (unsigned __int8)v22); 2557 case EQUIP_ARMOUR:
2582 strcat(Dest, Source); 2558 case EQUIP_SHIELD:
2583 } 2559 case EQUIP_HELMET:
2584 LABEL_50: 2560 case EQUIP_BELT:
2561 case EQUIP_CLOAK:
2562 case EQUIP_GAUNTLETS:
2563 case EQUIP_BOOTS:
2564 case EQUIP_RING:
2565 case EQUIP_AMULET:
2566 if (item_desc->uDamageDice)
2567 sprintfex(a1 + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod);
2568 break;
2569 }
2570
2585 if ( v77 ) 2571 if ( v77 )
2586 goto LABEL_65; 2572 goto LABEL_65;
2587 v23 = v3[28]; 2573 //v23 = item_desc->uEquipType;
2588 if ( v23 == 14 ) 2574 if (item_desc->uEquipType == 14)
2589 { 2575 {
2590 v24 = _this->_bonus_type; 2576 v24 = _this->_bonus_type;
2591 if ( v24 ) 2577 if ( v24 )
2592 goto LABEL_56; 2578 goto LABEL_56;
2593 LABEL_65: 2579 LABEL_65:
2606 } 2592 }
2607 v83 += 100; 2593 v83 += 100;
2608 --a2.y; 2594 --a2.y;
2609 } 2595 }
2610 while ( a2.y ); 2596 while ( a2.y );
2611 v28 = (const char *)*((int *)v3 + 3); 2597 v28 = item_desc->pDescription;
2612 if ( *v28 ) 2598 if ( *v28 )
2613 { 2599 {
2614 v29 = pFontSmallnum->CalcTextHeight(v28, &v79, 100, 0); 2600 v29 = pFontSmallnum->CalcTextHeight(v28, &v79, 100, 0);
2615 Str += v29; 2601 Str += v29;
2616 } 2602 }
2632 v79.uFrameWidth += 12; 2618 v79.uFrameWidth += 12;
2633 v79.uFrameHeight += (unsigned int)v83; 2619 v79.uFrameHeight += (unsigned int)v83;
2634 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; 2620 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1;
2635 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; 2621 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1;
2636 v79.DrawMessageBox(0); 2622 v79.DrawMessageBox(0);
2637 v15 = pRenderer; 2623 //v15 = pRenderer;
2638 pRenderer->Clip( 2624 pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12,
2639 v79.uFrameX + 12, 2625 v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12);
2640 v79.uFrameY + 12,
2641 v79.uFrameX + v79.uFrameWidth - 12,
2642 v79.uFrameY + v79.uFrameHeight - 12);
2643 v79.uFrameWidth -= 12; 2626 v79.uFrameWidth -= 12;
2644 v32 = v73->uTextureHeight; 2627 v32 = v73->uTextureHeight;
2645 v33 = v79.uFrameHeight; 2628 v33 = v79.uFrameHeight;
2646 v79.uFrameHeight -= 12; 2629 v79.uFrameHeight -= 12;
2647 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; 2630 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1;
2648 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; 2631 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1;
2649 pRenderer->DrawTextureTransparent( 2632 pRenderer->DrawTextureTransparent(
2650 v79.uFrameX + v78, 2633 v79.uFrameX + v78,
2651 v79.uFrameY + (signed int)(v33 - v32) / 2, 2634 v79.uFrameY + (signed int)(v33 - v32) / 2,
2652 (Texture *)(v5 != -1 ? (int)((char *)pIcons_LOD->pTextures + v75) : 0)); 2635 v73);
2653 a2.y = 3; 2636 a2.y = 3;
2654 v34 = (int)(v83 + 35); 2637 v34 = (int)(v83 + 35);
2655 Str = a1; 2638 Str = a1;
2656 do 2639 do
2657 { 2640 {
2662 } 2645 }
2663 Str += 100; 2646 Str += 100;
2664 --a2.y; 2647 --a2.y;
2665 } 2648 }
2666 while ( a2.y ); 2649 while ( a2.y );
2667 v35 = (const char *)*((int *)v76 + 3); 2650 v35 = item_desc->pDescription;
2668 if ( *v35 ) 2651 if ( *v35 )
2669 v79.DrawText(pFontSmallnum, 100, v34, 0, v35, 0, 0, 0); 2652 v79.DrawText(pFontSmallnum, 100, v34, 0, v35, 0, 0, 0);
2670 v79.uFrameX += 12; 2653 v79.uFrameX += 12;
2671 v79.uFrameWidth -= 24; 2654 v79.uFrameWidth -= 24;
2672 v36 = _this->GetIdentifiedName(); 2655 v36 = _this->GetIdentifiedName();
2743 v73->Release(); 2726 v73->Release();
2744 pIcons_LOD->_40F9C5(); 2727 pIcons_LOD->_40F9C5();
2745 } 2728 }
2746 return; 2729 return;
2747 } 2730 }
2748 if ( v23 == 13 ) 2731 if (item_desc->uEquipType == 13)
2749 { 2732 {
2750 v24 = pItemsTable->pItems[_this->uItemID].uDamageDice; 2733 v24 = pItemsTable->pItems[_this->uItemID].uDamageDice;
2751 LABEL_56: 2734 LABEL_56:
2752 v59 = v24; 2735 v59 = v24;
2753 v54 = pGlobalTXT_LocalizationStrings[449]; 2736 v54 = pGlobalTXT_LocalizationStrings[449];
2754 v49 = "%s: %d"; 2737 v49 = "%s: %d";
2755 LABEL_64: 2738 LABEL_64:
2756 sprintf(v64, v49, v54, v59); 2739 sprintf(a1 + 200, v49, v54, v59);
2757 goto LABEL_65; 2740 goto LABEL_65;
2758 } 2741 }
2759 v25 = _this->_bonus_type; 2742 v25 = _this->_bonus_type;
2760 if ( v25 ) 2743 if ( v25 )
2761 { 2744 {
2781 v60 = _this->_bonus_strength; 2764 v60 = _this->_bonus_strength;
2782 v55 = *((int *)&pItemsTable->pEnchantments[23].pBonusStat + 7 * v26); 2765 v55 = *((int *)&pItemsTable->pEnchantments[23].pBonusStat + 7 * v26);
2783 v50 = pGlobalTXT_LocalizationStrings[210]; 2766 v50 = pGlobalTXT_LocalizationStrings[210];
2784 v46 = "%s: %s"; 2767 v46 = "%s: %s";
2785 } 2768 }
2786 sprintf(v64, v46, v50, v55, v60); 2769 sprintf(a1 + 200, v46, v50, v55, v60);
2787 goto LABEL_65; 2770 goto LABEL_65;
2788 } 2771 }
2789 // 4E455C: using guessed type int dword_4E455C; 2772 // 4E455C: using guessed type int dword_4E455C;
2790 // 506128: using guessed type int areWeLoadingTexture; 2773 // 506128: using guessed type int areWeLoadingTexture;
2791 2774
4277 } 4260 }
4278 if(v6<uChestArea) 4261 if(v6<uChestArea)
4279 { 4262 {
4280 Chest::PlaceItemAt((unsigned __int8)Dst[v6], v11, v10); 4263 Chest::PlaceItemAt((unsigned __int8)Dst[v6], v11, v10);
4281 if ( pChests[v3].uFlags & 4 ) 4264 if ( pChests[v3].uFlags & 4 )
4282 v12->uAttributes |= 1u; 4265 v12->SetIdentified();
4283 } 4266 }
4284 } 4267 }
4285 ++v11; 4268 ++v11;
4286 ++v12; 4269 ++v12;
4287 } 4270 }
6647 dword_50B700 = 1; 6630 dword_50B700 = 1;
6648 } 6631 }
6649 else 6632 else
6650 { 6633 {
6651 dword_50B700 = 0; 6634 dword_50B700 = 0;
6652 if ( !(v1->uAttributes & 1) ) 6635 if ( !v1->TwoSided() )
6653 return 0; 6636 return 0;
6654 } 6637 }
6655 //v66 = v1->uNumVertices; 6638 //v66 = v1->uNumVertices;
6656 for (uint i = 0; i < v1->uNumVertices; ++i) 6639 for (uint i = 0; i < v1->uNumVertices; ++i)
6657 { 6640 {