comparison UI/UiGame.cpp @ 1505:6306a33af531

UIGame.cpp cleaning(continue) wizard_eye
author Ritor1
date Mon, 02 Sep 2013 12:03:25 +0600
parents 7ef4b64f6329
children c76c0f6974bc
comparison
equal deleted inserted replaced
1485:58d43397b827 1505:6306a33af531
2354 double v21; // st6@30 2354 double v21; // st6@30
2355 double v22; // st5@33 2355 double v22; // st5@33
2356 signed int v27; // eax@37 2356 signed int v27; // eax@37
2357 unsigned __int16 *v28; // ecx@37 2357 unsigned __int16 *v28; // ecx@37
2358 signed int v29; // edi@40 2358 signed int v29; // edi@40
2359 //signed int v33; // ebx@50
2360 //unsigned int v34; // eax@50
2361 //signed int v35; // ecx@50
2362 //unsigned __int16 v36; // di@66
2363 int v37; // edi@72 2359 int v37; // edi@72
2364 int v38; // ebx@72 2360 int v38; // ebx@72
2365 __int16 v39; // ax@87 2361 __int16 v39; // ax@87
2366 int v40; // edi@91 2362 int v40; // edi@91
2367 int v41; // ebx@91 2363 int v41; // ebx@91
2371 char *v45; // ebx@106 2367 char *v45; // ebx@106
2372 int v46; // edi@108 2368 int v46; // edi@108
2373 int v47; // eax@108 2369 int v47; // eax@108
2374 unsigned int v48; // ebx@114 2370 unsigned int v48; // ebx@114
2375 unsigned int v49; // ST64_4@114 2371 unsigned int v49; // ST64_4@114
2376 //unsigned int v51; // [sp-10h] [bp-64h]@79
2377 unsigned int v52; // [sp-10h] [bp-64h]@100 2372 unsigned int v52; // [sp-10h] [bp-64h]@100
2378 //unsigned int v53; // [sp-Ch] [bp-60h]@79
2379 unsigned int v54; // [sp-Ch] [bp-60h]@100 2373 unsigned int v54; // [sp-Ch] [bp-60h]@100
2380 //unsigned int v55; // [sp-8h] [bp-5Ch]@77
2381 unsigned int v56; // [sp-8h] [bp-5Ch]@100 2374 unsigned int v56; // [sp-8h] [bp-5Ch]@100
2382 //signed int v57; // [sp-4h] [bp-58h]@54
2383 //unsigned __int16 v58; // [sp-4h] [bp-58h]@77
2384 unsigned __int16 v59; // [sp-4h] [bp-58h]@100 2375 unsigned __int16 v59; // [sp-4h] [bp-58h]@100
2385 //unsigned __int16 v60; // [sp+10h] [bp-44h]@66
2386 //unsigned int v61; // [sp+10h] [bp-44h]@85
2387 //unsigned int v63; // [sp+14h] [bp-40h]@85
2388 //unsigned int v65; // [sp+18h] [bp-3Ch]@85
2389 unsigned int lPitch; // [sp+20h] [bp-34h]@1 2376 unsigned int lPitch; // [sp+20h] [bp-34h]@1
2390 unsigned int lPitcha; // [sp+20h] [bp-34h]@23 2377 unsigned int lPitcha; // [sp+20h] [bp-34h]@23
2391 char *lPitchb; // [sp+20h] [bp-34h]@106 2378 char *lPitchb; // [sp+20h] [bp-34h]@106
2392 unsigned int v69; // [sp+24h] [bp-30h]@23 2379 unsigned int v69; // [sp+24h] [bp-30h]@23
2393 signed int v70; // [sp+24h] [bp-30h]@37 2380 signed int v70; // [sp+24h] [bp-30h]@37
2394 //unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1
2395 signed int uBluea; // [sp+28h] [bp-2Ch]@37 2381 signed int uBluea; // [sp+28h] [bp-2Ch]@37
2396 int v73; // [sp+2Ch] [bp-28h]@30 2382 int v73; // [sp+2Ch] [bp-28h]@30
2397 int v76; // [sp+34h] [bp-20h]@91 2383 int v76; // [sp+34h] [bp-20h]@91
2398 int v77; // [sp+34h] [bp-20h]@108 2384 int v77; // [sp+34h] [bp-20h]@108
2399 //int v79; // [sp+38h] [bp-1Ch]@72
2400 //char *a2c; // [sp+40h] [bp-14h]@68
2401 signed int uCenterY; // [sp+48h] [bp-Ch]@1 2385 signed int uCenterY; // [sp+48h] [bp-Ch]@1
2402 signed int uCenterX; // [sp+4Ch] [bp-8h]@1 2386 signed int uCenterX; // [sp+4Ch] [bp-8h]@1
2403 signed int uWidth; // [sp+5Ch] [bp+8h]@30 2387 signed int uWidth; // [sp+5Ch] [bp+8h]@30
2404 //signed int uZe; // [sp+5Ch] [bp+8h]@67
2405 signed int uZf; // [sp+5Ch] [bp+8h]@85 2388 signed int uZf; // [sp+5Ch] [bp+8h]@85
2406 signed int uZg; // [sp+5Ch] [bp+8h]@105 2389 signed int uZg; // [sp+5Ch] [bp+8h]@105
2407 unsigned int uWa; // [sp+60h] [bp+Ch]@23 2390 unsigned int uWa; // [sp+60h] [bp+Ch]@23
2408 float uWb; // [sp+60h] [bp+Ch]@30 2391 float uWb; // [sp+60h] [bp+Ch]@30
2409 unsigned int uWd; // [sp+60h] [bp+Ch]@95 2392 unsigned int uWd; // [sp+60h] [bp+Ch]@95
2410 float uZooma; // [sp+64h] [bp+10h]@117 2393 float uZooma; // [sp+64h] [bp+10h]@117
2411 //unsigned int flagsb; // [sp+68h] [bp+14h]@66
2412 Actor *flagsc; // [sp+68h] [bp+14h]@86 2394 Actor *flagsc; // [sp+68h] [bp+14h]@86
2413 //unsigned int flagsd; // [sp+68h] [bp+14h]@105
2414 2395
2415 uCenterX = (uX + uZ) / 2; 2396 uCenterX = (uX + uZ) / 2;
2416 uCenterY = (uY + uW) / 2; 2397 uCenterY = (uY + uW) / 2;
2417 lPitch = pRenderer->uTargetSurfacePitch; 2398 lPitch = pRenderer->uTargetSurfacePitch;
2418 //TargetColor(0, 0, 0); 2399 //TargetColor(0, 0, 0);
2419 //uBlue = TargetColor(0, 0, 0xFFu); 2400 //uBlue = TargetColor(0, 0, 0xFFu);
2420 auto bWizardEyeActive = pParty->WizardEyeActive(); 2401 auto bWizardEyeActive = pParty->WizardEyeActive();
2421 auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel(); 2402 auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel();
2422 if (CheckHiredNPCSpeciality(Cartographer)) 2403 if ( CheckHiredNPCSpeciality(Cartographer) )
2423 { 2404 {
2424 bWizardEyeActive = true; 2405 bWizardEyeActive = true;
2425 uWizardEyeSkillLevel = 2; 2406 uWizardEyeSkillLevel = 2;
2426 } 2407 }
2408 extern bool wizard_eye;
2409 if ( wizard_eye )
2410 {
2427 bWizardEyeActive = true; 2411 bWizardEyeActive = true;
2428 uWizardEyeSkillLevel = 3; 2412 uWizardEyeSkillLevel = 3;
2413 }
2429 pRenderer->SetRasterClipRect(uX, uY, uZ - 1, uW - 1); 2414 pRenderer->SetRasterClipRect(uX, uY, uZ - 1, uW - 1);
2430 uHeight = uW - uY; 2415 uHeight = uW - uY;
2431 uWidth = uZ - uX; 2416 uWidth = uZ - uX;
2432 2417
2433 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) 2418 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor)
2766 pRenderer->ResetTextureClipRect(); 2751 pRenderer->ResetTextureClipRect();
2767 } 2752 }
2768 2753
2769 //----- (00441498) -------------------------------------------------------- 2754 //----- (00441498) --------------------------------------------------------
2770 void GameUI_DrawTorchlightAndWizardEye() 2755 void GameUI_DrawTorchlightAndWizardEye()
2771 { 2756 {
2772 if (pCurrentScreen == SCREEN_GAME 2757 if (pCurrentScreen == SCREEN_GAME
2773 || pCurrentScreen == SCREEN_MENU 2758 || pCurrentScreen == SCREEN_MENU
2774 || pCurrentScreen == SCREEN_OPTIONS 2759 || pCurrentScreen == SCREEN_OPTIONS
2775 || pCurrentScreen == SCREEN_REST 2760 || pCurrentScreen == SCREEN_REST
2776 || pCurrentScreen == SCREEN_SPELL_BOOK 2761 || pCurrentScreen == SCREEN_SPELL_BOOK
2777 || pCurrentScreen == SCREEN_CHEST 2762 || pCurrentScreen == SCREEN_CHEST
2778 || pCurrentScreen == SCREEN_SAVEGAME 2763 || pCurrentScreen == SCREEN_SAVEGAME
2779 || pCurrentScreen == SCREEN_LOADGAME 2764 || pCurrentScreen == SCREEN_LOADGAME
2780 || pCurrentScreen == SCREEN_CHEST_INVENTORY 2765 || pCurrentScreen == SCREEN_CHEST_INVENTORY
2781 || pCurrentScreen == SCREEN_BOOKS 2766 || pCurrentScreen == SCREEN_BOOKS
2782 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) 2767 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG )
2783 { 2768 {
2784 if (pParty->TorchlightActive()) 2769 if (pParty->TorchlightActive())
2785 { 2770 {
2786 auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time()); 2771 auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time());
2787 pRenderer->DrawTextureTransparent(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID)); 2772 pRenderer->DrawTextureTransparent(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID));
2788 } 2773 }
2789 if (pParty->WizardEyeActive()) 2774 if (pParty->WizardEyeActive())
2790 { 2775 {
2791 auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time()); 2776 auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time());
2792 pRenderer->DrawTextureTransparent(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID)); 2777 pRenderer->DrawTextureTransparent(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID));
2793 } 2778 }
2794 } 2779 }
2795 } 2780 }
2796 // 4E28F8: using guessed type int pCurrentScreen; 2781 // 4E28F8: using guessed type int pCurrentScreen;
2797 2782
2798 2783
2799 //----- (00491F87) -------------------------------------------------------- 2784 //----- (00491F87) --------------------------------------------------------
2800 void GameUI_DrawHiredNPCs() 2785 void GameUI_DrawHiredNPCs()
2801 { 2786 {
2802 //int v6; // eax@15
2803 char v7; // al@17
2804 unsigned int v8; // eax@18
2805 int v9; // esi@18
2806 int v10; // eax@18
2807 unsigned int v11; // eax@19
2808 unsigned int v12; // esi@19
2809 unsigned int v13; // eax@23 2787 unsigned int v13; // eax@23
2810 IconFrame *v14; // eax@24
2811 unsigned int v15; // eax@26
2812 char pContainer[20]; // [sp+Ch] [bp-30h]@18 2788 char pContainer[20]; // [sp+Ch] [bp-30h]@18
2813 unsigned int v17; // [sp+20h] [bp-1Ch]@19
2814 signed int uFrameID; // [sp+24h] [bp-18h]@19 2789 signed int uFrameID; // [sp+24h] [bp-18h]@19
2815 //int i; // [sp+28h] [bp-14h]@15
2816 unsigned int v20; // [sp+2Ch] [bp-10h]@20
2817 unsigned int v21; // [sp+30h] [bp-Ch]@19
2818 int v22; // [sp+34h] [bp-8h]@2 2790 int v22; // [sp+34h] [bp-8h]@2
2819 unsigned __int8 v23; // [sp+3Bh] [bp-1h]@2 2791 unsigned __int8 pNPC_limit_ID; // [sp+3Bh] [bp-1h]@2
2820 2792
2821 if ( bNoNPCHiring != 1 ) 2793 if ( bNoNPCHiring != 1 )
2822 { 2794 {
2823 v23 = 0; 2795 pNPC_limit_ID = 0;
2824 v22 = 0; 2796 v22 = 0;
2825 /*for (uint i = 0; i < 2; ++i)
2826 {
2827 if (pParty->pHirelings[i].pName)
2828 pTmpBuf[v22++] = i;
2829 }*/
2830 if (pParty->pHirelings[0].pName) 2797 if (pParty->pHirelings[0].pName)
2831 pTmpBuf[v22++] = 0; 2798 pTmpBuf[v22++] = 0;
2832 if (pParty->pHirelings[1].pName) 2799 if (pParty->pHirelings[1].pName)
2833 pTmpBuf[v22++] = 1; 2800 pTmpBuf[v22++] = 1;
2834 2801
2843 } 2810 }
2844 } 2811 }
2845 } 2812 }
2846 2813
2847 //v6 = (unsigned __int8)pParty->field_709; 2814 //v6 = (unsigned __int8)pParty->field_709;
2848 for ( int i = (unsigned __int8)pParty->field_709; i < v22 && v23 < 2; i++ ) 2815 for ( int i = (unsigned __int8)pParty->field_709; i < v22 && pNPC_limit_ID < 2; i++ )
2849 { 2816 {
2850 v7 = pTmpBuf[i]; 2817 if ( (unsigned __int8)pTmpBuf[i] >= 2 )
2851 if ( (unsigned __int8)v7 >= 2 ) 2818 {
2852 { 2819 sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[i] + 499].uPortraitID);
2853 sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)v7 + 499].uPortraitID); 2820 pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
2854 v15 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 2821 pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)));
2855 pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[v23], pHiredNPCsIconsOffsetsY[v23], pIcons_LOD->GetTexture(v15));
2856 } 2822 }
2857 else 2823 else
2858 { 2824 {
2859 sprintf(pContainer, "NPC%03d", pParty->pHirelings[(unsigned __int8)v7].uPortraitID); 2825 sprintf(pContainer, "NPC%03d", pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].uPortraitID);
2860 v8 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); 2826 pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
2861 v9 = v23; 2827 pIcons_LOD->GetTexture(pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE)));
2862 pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[v9], pHiredNPCsIconsOffsetsY[v9], pIcons_LOD->GetTexture(v8)); 2828 if ( pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].evt_A == 1 )
2863 v10 = (unsigned __int8)pTmpBuf[i]; 2829 {
2864 if ( pParty->pHirelings[v10].evt_A == 1 ) 2830 uFrameID = pParty->pHirelings[(unsigned __int8)pTmpBuf[i]].evt_B;
2865 { 2831 v13 = 0;
2866 uFrameID = pParty->pHirelings[v10].evt_B; 2832 if ( (signed int)pIconsFrameTable->uNumIcons )
2867 v11 = pHiredNPCsIconsOffsetsX[v9];
2868 v12 = pHiredNPCsIconsOffsetsY[v9];
2869 v17 = v11;
2870 v21 = 0;
2871 if ( (signed int)pIconsFrameTable->uNumIcons <= 0 )
2872 { 2833 {
2873 LABEL_23: 2834 for ( v13 = 0; v13 < pIconsFrameTable->uNumIcons; ++v13 )
2874 v13 = 0; 2835 {
2836 if ( !_stricmp("spell96", pIconsFrameTable->pIcons[v13].pAnimationName) )
2837 break;
2838 }
2875 } 2839 }
2876 else 2840 pRenderer->DrawTextureTransparent(pHiredNPCsIconsOffsetsX[pNPC_limit_ID], pHiredNPCsIconsOffsetsY[pNPC_limit_ID],
2877 { 2841 &pIcons_LOD->pTextures[pIconsFrameTable->GetFrame(v13, uFrameID)->uTextureID]);
2878 v20 = 0; 2842 }
2879 while ( _stricmp("spell96", pIconsFrameTable->pIcons[v20 / 0x20].pAnimationName) ) 2843 }
2880 { 2844 ++pNPC_limit_ID;
2881 ++v21;
2882 v20 += 32;
2883 if ( (signed int)v21 >= (signed int)pIconsFrameTable->uNumIcons )
2884 goto LABEL_23;
2885 }
2886 v13 = v21;
2887 }
2888 v14 = pIconsFrameTable->GetFrame(v13, uFrameID);
2889 pRenderer->DrawTextureTransparent(v17, v12, &pIcons_LOD->pTextures[v14->uTextureID]);
2890 }
2891 }
2892 ++v23;
2893 } 2845 }
2894 } 2846 }
2895 } 2847 }
2896 // 6BE3C5: using guessed type char bNoNPCHiring; 2848 // 6BE3C5: using guessed type char bNoNPCHiring;
2897 2849