Mercurial > mm7
comparison UI/UiGame.cpp @ 1507:a109bb203e28
UIGame.cpp cleaning(continue) GameUI_DrawMinimap
author | Ritor1 |
---|---|
date | Mon, 02 Sep 2013 17:30:50 +0600 |
parents | c76c0f6974bc |
children | 9c1838b78ffc |
comparison
equal
deleted
inserted
replaced
1506:c76c0f6974bc | 1507:a109bb203e28 |
---|---|
814 sprintfex(pTmpBuf.data(), "\f%05d", ui_character_header_text_color); | 814 sprintfex(pTmpBuf.data(), "\f%05d", ui_character_header_text_color); |
815 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s" | 815 sprintfex(pTmpBuf2.data(), pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s" |
816 strcat(pTmpBuf.data(), pTmpBuf2.data()); | 816 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
817 strcat(pTmpBuf.data(), "\f00000\n"); | 817 strcat(pTmpBuf.data(), "\f00000\n"); |
818 | 818 |
819 pTextColor = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth()); | 819 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->sHealth, player->GetMaxHealth()); |
820 sprintfex(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[108], // "Hit Points" | 820 sprintfex(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[108], // "Hit Points" |
821 pTextColor, player->sHealth, player->GetMaxHealth()); | 821 pTextColor, player->sHealth, player->GetMaxHealth()); |
822 strcat(pTmpBuf.data(), pTmpBuf2.data()); | 822 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
823 | 823 |
824 pTextColor = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana()); | 824 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->sMana, player->GetMaxMana()); |
825 sprintfex(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[212], // "Spell Points" | 825 sprintfex(pTmpBuf2.data(), "%s : \f%05u%d\f00000 / %d\n", pGlobalTXT_LocalizationStrings[212], // "Spell Points" |
826 pTextColor, player->sMana, player->GetMaxMana()); | 826 pTextColor, player->sMana, player->GetMaxMana()); |
827 strcat(pTmpBuf.data(), pTmpBuf2.data()); | 827 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
828 | 828 |
829 pTextColor = player->GetMajorConditionIdx(); | 829 pTextColor = player->GetMajorConditionIdx(); |
892 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pClassNames[player->classType], 84, 0); | 892 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, 0, pClassNames[player->classType], 84, 0); |
893 pY = pFontHeight + pY; | 893 pY = pFontHeight + pY; |
894 if ( i == 0 ) | 894 if ( i == 0 ) |
895 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[107], 60, 0);//Здор. | 895 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[107], 60, 0);//Здор. |
896 sprintf(pTmpBuf.data(), "%d", player->sHealth); | 896 sprintf(pTmpBuf.data(), "%d", player->sHealth); |
897 pTextColor = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth()); | 897 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->sHealth, player->GetMaxHealth()); |
898 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0); | 898 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0); |
899 pY = pFontHeight + pY; | 899 pY = pFontHeight + pY; |
900 if ( i == 0 ) | 900 if ( i == 0 ) |
901 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[209], 60, 0);//Мана | 901 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[209], 60, 0);//Мана |
902 sprintf(pTmpBuf.data(), "%d", player->sMana); | 902 sprintf(pTmpBuf.data(), "%d", player->sMana); |
903 pTextColor = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana()); | 903 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->sMana, player->GetMaxMana()); |
904 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0); | 904 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0); |
905 pY = pFontHeight + pY; | 905 pY = pFontHeight + pY; |
906 if ( i == 0 ) | 906 if ( i == 0 ) |
907 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[0], 60, 0);//Класс брони | 907 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[0], 60, 0);//Класс брони |
908 sprintf(pTmpBuf.data(), "%d", player->GetActualAC()); | 908 sprintf(pTmpBuf.data(), "%d", player->GetActualAC()); |
909 pTextColor = UI_GetHealthManaStringColor(player->GetActualAC(), player->GetBaseAC()); | 909 pTextColor = UI_GetHealthManaAndOtherQualitiesStringColor(player->GetActualAC(), player->GetBaseAC()); |
910 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0); | 910 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, pX, pY, pTextColor, pTmpBuf.data(), 84, 0); |
911 pY = pFontHeight + pY; | 911 pY = pFontHeight + pY; |
912 if ( !i ) | 912 if ( !i ) |
913 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[18], 60, 0);//Атака | 913 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 22, pY, 0, pGlobalTXT_LocalizationStrings[18], 60, 0);//Атака |
914 sprintf(pTmpBuf.data(), "%+d", player->GetActualAttack(0)); | 914 sprintf(pTmpBuf.data(), "%+d", player->GetActualAttack(0)); |
1976 | 1976 |
1977 //----- (00441D38) -------------------------------------------------------- | 1977 //----- (00441D38) -------------------------------------------------------- |
1978 void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap) | 1978 void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap) |
1979 { | 1979 { |
1980 int uHeight; // ebx@6 | 1980 int uHeight; // ebx@6 |
1981 __int16 v11; // cx@11 | |
1982 unsigned int v14; // ebx@23 | 1981 unsigned int v14; // ebx@23 |
1983 int v15; // eax@23 | 1982 int v15; // eax@23 |
1984 __int16 v17; // di@30 | 1983 __int16 v17; // di@30 |
1985 double v18; // st7@30 | |
1986 float v19; // ST38_4@30 | |
1987 double v20; // st7@30 | 1984 double v20; // st7@30 |
1988 double v21; // st6@30 | |
1989 double v22; // st5@33 | |
1990 signed int v27; // eax@37 | 1985 signed int v27; // eax@37 |
1991 unsigned __int16 *v28; // ecx@37 | 1986 unsigned __int16 *v28; // ecx@37 |
1992 signed int v29; // edi@40 | 1987 signed int v29; // edi@40 |
1993 int v37; // edi@72 | 1988 int pObject_X; // edi@72 |
1994 int v38; // ebx@72 | 1989 int pObject_Y; // ebx@72 |
1995 __int16 v39; // ax@87 | 1990 int pActor_X; // edi@91 |
1996 int v40; // edi@91 | 1991 int pActor_Y; // ebx@91 |
1997 int v41; // ebx@91 | 1992 int pDecoration_X; // edi@108 |
1998 unsigned int v42; // eax@101 | 1993 int pDecoration_Y; // eax@108 |
1999 unsigned int v43; // ebx@101 | |
2000 unsigned int v44; // ST30_4@101 | |
2001 char *v45; // ebx@106 | |
2002 int v46; // edi@108 | |
2003 int v47; // eax@108 | |
2004 unsigned int v48; // ebx@114 | |
2005 unsigned int v49; // ST64_4@114 | |
2006 unsigned int v52; // [sp-10h] [bp-64h]@100 | |
2007 unsigned int v54; // [sp-Ch] [bp-60h]@100 | |
2008 unsigned int v56; // [sp-8h] [bp-5Ch]@100 | |
2009 unsigned __int16 v59; // [sp-4h] [bp-58h]@100 | |
2010 unsigned int lPitch; // [sp+20h] [bp-34h]@1 | 1994 unsigned int lPitch; // [sp+20h] [bp-34h]@1 |
2011 unsigned int lPitcha; // [sp+20h] [bp-34h]@23 | 1995 unsigned int lPitcha; // [sp+20h] [bp-34h]@23 |
2012 char *lPitchb; // [sp+20h] [bp-34h]@106 | |
2013 unsigned int v69; // [sp+24h] [bp-30h]@23 | 1996 unsigned int v69; // [sp+24h] [bp-30h]@23 |
2014 signed int v70; // [sp+24h] [bp-30h]@37 | 1997 signed int v70; // [sp+24h] [bp-30h]@37 |
2015 signed int uBluea; // [sp+28h] [bp-2Ch]@37 | 1998 signed int uBluea; // [sp+28h] [bp-2Ch]@37 |
2016 int v73; // [sp+2Ch] [bp-28h]@30 | 1999 int v73; // [sp+2Ch] [bp-28h]@30 |
2017 int v76; // [sp+34h] [bp-20h]@91 | |
2018 int v77; // [sp+34h] [bp-20h]@108 | |
2019 signed int uCenterY; // [sp+48h] [bp-Ch]@1 | 2000 signed int uCenterY; // [sp+48h] [bp-Ch]@1 |
2020 signed int uCenterX; // [sp+4Ch] [bp-8h]@1 | 2001 signed int uCenterX; // [sp+4Ch] [bp-8h]@1 |
2021 signed int uWidth; // [sp+5Ch] [bp+8h]@30 | 2002 signed int uWidth; // [sp+5Ch] [bp+8h]@30 |
2022 signed int uZf; // [sp+5Ch] [bp+8h]@85 | |
2023 signed int uZg; // [sp+5Ch] [bp+8h]@105 | |
2024 unsigned int uWa; // [sp+60h] [bp+Ch]@23 | 2003 unsigned int uWa; // [sp+60h] [bp+Ch]@23 |
2025 float uWb; // [sp+60h] [bp+Ch]@30 | 2004 float uWb; // [sp+60h] [bp+Ch]@30 |
2026 unsigned int uWd; // [sp+60h] [bp+Ch]@95 | 2005 unsigned int uWd; // [sp+60h] [bp+Ch]@95 |
2027 float uZooma; // [sp+64h] [bp+10h]@117 | 2006 unsigned int pColor; |
2028 Actor *flagsc; // [sp+68h] [bp+14h]@86 | |
2029 | 2007 |
2030 uCenterX = (uX + uZ) / 2; | 2008 uCenterX = (uX + uZ) / 2; |
2031 uCenterY = (uY + uW) / 2; | 2009 uCenterY = (uY + uW) / 2; |
2032 lPitch = pRenderer->uTargetSurfacePitch; | 2010 lPitch = pRenderer->uTargetSurfacePitch; |
2033 //TargetColor(0, 0, 0); | |
2034 //uBlue = TargetColor(0, 0, 0xFFu); | |
2035 auto bWizardEyeActive = pParty->WizardEyeActive(); | 2011 auto bWizardEyeActive = pParty->WizardEyeActive(); |
2036 auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel(); | 2012 auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel(); |
2037 if ( CheckHiredNPCSpeciality(Cartographer) ) | 2013 if ( CheckHiredNPCSpeciality(Cartographer) ) |
2038 { | 2014 { |
2039 bWizardEyeActive = true; | 2015 bWizardEyeActive = true; |
2047 } | 2023 } |
2048 pRenderer->SetRasterClipRect(uX, uY, uZ - 1, uW - 1); | 2024 pRenderer->SetRasterClipRect(uX, uY, uZ - 1, uW - 1); |
2049 uHeight = uW - uY; | 2025 uHeight = uW - uY; |
2050 uWidth = uZ - uX; | 2026 uWidth = uZ - uX; |
2051 | 2027 |
2052 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | 2028 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
2053 { | 2029 { |
2054 v17 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; | 2030 v17 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; |
2055 auto pMapLod0 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0_prolly_alpha_mask; | 2031 auto pMapLod0 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0_prolly_alpha_mask; |
2056 auto pPal = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; | 2032 auto pPal = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; |
2057 v73 = (1 << (v17 + 16)) / (signed int)uZoom; | 2033 v73 = (1 << (v17 + 16)) / (signed int)uZoom; |
2058 v18 = (double)(1 << (16 - v17)); | 2034 v20 = (double)(pParty->vPosition.x + 32768) / (double)(1 << (16 - v17)); |
2059 v19 = v18; | 2035 uWb = (double)(32768 - pParty->vPosition.y) / (double)(1 << (16 - v17)); |
2060 v20 = (double)(pParty->vPosition.x + 32768) / v18; | |
2061 v21 = (double)(32768 - pParty->vPosition.y) / v19; | |
2062 uWb = v21; | |
2063 switch (uZoom) | 2036 switch (uZoom) |
2064 { | 2037 { |
2065 case 512: | 2038 case 512: |
2066 { | 2039 { |
2067 v20 = v20 - (double)(uWidth / 2); | 2040 v20 = v20 - (double)(uWidth / 2); |
2068 v22 = (double)(uHeight / 2); | 2041 uWb = uWb - (double)(uHeight / 2); |
2069 uWb = v21 - v22; | |
2070 } | 2042 } |
2071 break; | 2043 break; |
2072 | |
2073 case 1024: | 2044 case 1024: |
2074 { | 2045 { |
2075 v20 = v20 - (double)(uWidth / 4); | 2046 v20 = v20 - (double)(uWidth / 4); |
2076 v22 = (double)(uHeight / 4); | 2047 uWb = uWb - (double)(uHeight / 4); |
2077 uWb = v21 - v22; | |
2078 } | 2048 } |
2079 break; | 2049 break; |
2080 | |
2081 case 2048: | 2050 case 2048: |
2082 { | 2051 { |
2083 v20 = v20 - (double)(uWidth / 8); | 2052 v20 = v20 - (double)(uWidth / 8); |
2084 v22 = (double)(uHeight / 8); | 2053 uWb = uWb - (double)(uHeight / 8); |
2085 uWb = v21 - v22; | |
2086 } | 2054 } |
2087 break; | 2055 break; |
2088 | |
2089 default: assert(false); | 2056 default: assert(false); |
2090 } | 2057 } |
2091 assert(sizeof(pOdmMinimap) == 137 * 117 * sizeof(short)); | 2058 assert(sizeof(pOdmMinimap) == 137 * 117 * sizeof(short)); |
2092 | 2059 |
2093 v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24); | 2060 v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24); |
2097 if (pMapLod0 && bRedrawOdmMinimap) | 2064 if (pMapLod0 && bRedrawOdmMinimap) |
2098 { | 2065 { |
2099 assert(uWidth == 137 && uHeight == 117); | 2066 assert(uWidth == 137 && uHeight == 117); |
2100 //auto pMinimap = (unsigned __int16 *)pOdmMinimap; | 2067 //auto pMinimap = (unsigned __int16 *)pOdmMinimap; |
2101 | 2068 |
2102 auto mapWidth = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; | 2069 auto mapWidth = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; |
2103 | 2070 |
2104 v29 = v70 >> 16; | 2071 v29 = v70 >> 16; |
2105 | 2072 for (int y = 0; y < uHeight; ++y) |
2106 for (int y = 0; y < uHeight; ++y) | 2073 { |
2107 { | 2074 auto pMapLod0Line = &pMapLod0[v27 * mapWidth]; |
2108 auto pMapLod0Line = &pMapLod0[v27 * mapWidth]; | 2075 for (int x = 0; x < uWidth; ++x) |
2109 for (int x = 0; x < uWidth; ++x) | 2076 { |
2110 { | 2077 //*pMinimap++ = pPal[pMapLod0Line[v29]]; |
2111 //*pMinimap++ = pPal[pMapLod0Line[v29]]; | 2078 pOdmMinimap[y][x] = pPal[pMapLod0Line[v29]]; |
2112 pOdmMinimap[y][x] = pPal[pMapLod0Line[v29]]; | 2079 v29 = (v70 + x * v73) >> 16; |
2113 v29 = (v70 + x * v73) >> 16; | 2080 } |
2114 } | 2081 v29 = v70 >> 16; |
2115 | 2082 v28 += 137 - uWidth; |
2116 v29 = v70 >> 16; | 2083 uBluea += v73; |
2117 v28 += 137 - uWidth; | 2084 v27 = uBluea >> 16; |
2118 uBluea += v73; | 2085 } |
2119 v27 = uBluea >> 16; | |
2120 } | |
2121 } | 2086 } |
2122 | 2087 |
2123 for (int y = 0; y < 117; ++y) | 2088 for (int y = 0; y < 117; ++y) |
2124 { | 2089 { |
2125 for (int x = 0; x < 137; ++x) | 2090 for (int x = 0; x < 137; ++x) |
2128 } | 2093 } |
2129 v28 += lPitch - 137; | 2094 v28 += lPitch - 137; |
2130 } | 2095 } |
2131 uNumBlueFacesInBLVMinimap = 0; | 2096 uNumBlueFacesInBLVMinimap = 0; |
2132 } | 2097 } |
2133 else | 2098 else// uCurrentlyLoadedLevelType == LEVEL_Indoor |
2134 { | 2099 { |
2135 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF); | 2100 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF); |
2136 uNumBlueFacesInBLVMinimap = 0; | 2101 uNumBlueFacesInBLVMinimap = 0; |
2137 | 2102 |
2138 for (uint i = 0; i < pIndoor->pMapOutlines->uNumOutlines; ++i) | 2103 for (uint i = 0; i < pIndoor->pMapOutlines->uNumOutlines; ++i) |
2139 { | 2104 { |
2140 auto pOutline = &pIndoor->pMapOutlines->pOutlines[i]; | 2105 auto pOutline = &pIndoor->pMapOutlines->pOutlines[i]; |
2141 | |
2142 auto pFace1 = pIndoor->pFaces + pOutline->uFace1ID; | 2106 auto pFace1 = pIndoor->pFaces + pOutline->uFace1ID; |
2143 auto pFace2 = pIndoor->pFaces + pOutline->uFace2ID; | 2107 auto pFace2 = pIndoor->pFaces + pOutline->uFace2ID; |
2144 //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes; | 2108 //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes; |
2145 //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes; | 2109 //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes; |
2146 if (pFace1->Visible() && pFace2->Visible()) | 2110 if (pFace1->Visible() && pFace2->Visible()) |
2147 { | 2111 { |
2148 v11 = pOutline->uFlags; | 2112 //v11 = pOutline->uFlags; |
2149 if ( v11 & 1 ) | 2113 if ( pOutline->uFlags & 1 ) |
2150 goto LABEL_15; | 2114 goto LABEL_15; |
2151 if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80) | 2115 if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80) |
2152 goto LABEL_ABC; | 2116 goto LABEL_ABC; |
2153 | |
2154 } | 2117 } |
2155 continue; | 2118 continue; |
2156 | 2119 |
2157 LABEL_ABC: | 2120 LABEL_ABC: |
2158 pOutline->uFlags = v11 | 1; | 2121 pOutline->uFlags = pOutline->uFlags | 1; |
2159 pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8); | 2122 pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8); |
2160 | 2123 |
2161 LABEL_15: | 2124 LABEL_15: |
2162 //v12 = &pIndoor->pFaces[pOutline->uFace1ID]; | 2125 //v12 = &pIndoor->pFaces[pOutline->uFace1ID]; |
2163 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && | 2126 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && |
2164 (pFace1->uAttributes & 0x2000 || pFace2->uAttributes & 0x2000) && | 2127 (pFace1->uAttributes & 0x2000 || pFace2->uAttributes & 0x2000) && |
2165 (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID)) | 2128 (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID)) |
2166 { | 2129 { |
2167 if (uNumBlueFacesInBLVMinimap < 49) | 2130 if (uNumBlueFacesInBLVMinimap < 49) |
2168 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; | 2131 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; |
2169 } | 2132 } |
2170 else | 2133 else |
2171 { | 2134 { |
2172 auto _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x); | 2135 auto _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x); |
2173 auto _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16); | 2136 auto _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16); |
2174 auto _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16); | 2137 auto _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16); |
2175 v69 = uCenterX + _c; | 2138 //v69 = uCenterX + _c; |
2176 v69 = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); | 2139 v69 = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); |
2177 lPitcha = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); | 2140 lPitcha = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); |
2178 uWa = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); | 2141 uWa = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); |
2179 v14 = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); | 2142 v14 = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); |
2180 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; | 2143 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; |
2181 if ( v15 > 100 ) | 2144 if ( v15 > 100 ) |
2182 v15 = 100; | 2145 v15 = 100; |
2183 pRenderer->RasterLine2D(v69, lPitcha, uWa, v14, viewparams->pPalette[-v15 + 200]); | 2146 pRenderer->RasterLine2D(v69, lPitcha, uWa, v14, viewparams->pPalette[-v15 + 200]); |
2184 } | 2147 } |
2185 } | 2148 } |
2186 | 2149 |
2187 | 2150 for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i) |
2188 for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i) | 2151 { |
2189 { | 2152 //v16 = (uint *)&pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[uZb]]; |
2190 //v16 = (uint *)&pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[uZb]]; | 2153 auto pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]]; |
2191 auto pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]]; | 2154 pRenderer->RasterLine2D(uCenterX + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16), |
2192 pRenderer->RasterLine2D(uCenterX + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | 2155 uCenterY - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16), |
2193 * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) | 2156 uCenterX + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16), |
2194 - uZoom * pParty->vPosition.x) >> 16), | 2157 uCenterY - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16), |
2195 uCenterY | 2158 ui_game_minimap_outline_color); |
2196 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | 2159 } |
2197 * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) | 2160 } |
2198 - uZoom * pParty->vPosition.y) >> 16), | |
2199 uCenterX | |
2200 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | |
2201 * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) | |
2202 - uZoom * pParty->vPosition.x) >> 16), | |
2203 uCenterY | |
2204 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | |
2205 * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) | |
2206 - uZoom * pParty->vPosition.y) >> 16), | |
2207 ui_game_minimap_outline_color); | |
2208 } | |
2209 } | |
2210 | |
2211 | 2161 |
2212 assert(pParty->sRotationY >= 0); | 2162 assert(pParty->sRotationY >= 0); |
2213 float angle = (pParty->sRotationY % 2048) / 2048.0f; | 2163 float angle = (pParty->sRotationY % 2048) / 2048.0f; |
2214 const float two_pi = 2.0f * 3.14159f; | 2164 const float two_pi = 2.0f * 3.14159f; |
2215 | 2165 |
2216 uint arrow_idx = floorf(0.5f + 7 * angle); | 2166 uint arrow_idx = floorf(0.5f + 7 * angle); |
2217 pRenderer->DrawTextureTransparent(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx])); | 2167 pRenderer->DrawTextureTransparent(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx])); |
2218 | 2168 |
2219 //flagsb = TargetColor(0, 0, 255); | 2169 if ( bWizardEyeActive ) |
2220 //v60 = TargetColor(255, 0, 0); | 2170 { |
2221 if (bWizardEyeActive) | 2171 if ( uWizardEyeSkillLevel >= 2 ) |
2222 { | 2172 { |
2223 //uZe = 0; | 2173 for ( uint i = 0; i < uNumSpriteObjects; ++i ) |
2224 if (uWizardEyeSkillLevel >= 2) | 2174 { |
2225 for (uint i = 0; i < uNumSpriteObjects; ++i) | 2175 if ( !pSpriteObjects[i].uType || !pSpriteObjects[i].uObjectDescID ) |
2226 //if (uNumSpriteObjects > 0) | 2176 continue; |
2227 { | 2177 //if (uWizardEyeSkillLevel == 1 |
2228 auto object = &pSpriteObjects[i]; | 2178 pObject_X = uCenterX + ((unsigned __int64)((pSpriteObjects[i].vPosition.x - pParty->vPosition.x) * (signed __int64)uZoom) >> 16); |
2229 | 2179 pObject_Y = uCenterY - ((signed __int64)((pSpriteObjects[i].vPosition.y - pParty->vPosition.y) * (signed __int64)uZoom) >> 16); |
2230 //a2c = (char *)&pSpriteObjects[0].uObjectDescID; | 2180 if ( pObject_X >= pRenderer->raster_clip_x && pObject_X <= pRenderer->raster_clip_z && |
2231 //while ( 1 ) | 2181 pObject_Y >= pRenderer->raster_clip_y && pObject_Y <= pRenderer->raster_clip_w) |
2232 //{ | 2182 { |
2233 if (!object->uType || !object->uObjectDescID) | 2183 if (pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uFlags & OBJECT_DESC_UNPICKABLE) |
2234 continue; | |
2235 //if (uWizardEyeSkillLevel == 1 | |
2236 v37 = uCenterX + ((unsigned __int64)((object->vPosition.x - pParty->vPosition.x) * (signed __int64)uZoom) >> 16); | |
2237 //v79 = (unsigned __int64)((object->vPosition.y - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16; | |
2238 //v38 = uCenterY - v79; | |
2239 v38 = uCenterY - ((signed __int64)((object->vPosition.y - pParty->vPosition.y) * (signed __int64)uZoom) >> 16); | |
2240 if (v37 < pRenderer->raster_clip_x || v37 > pRenderer->raster_clip_z || | |
2241 v38 < pRenderer->raster_clip_y || v38 > pRenderer->raster_clip_w) | |
2242 continue; | |
2243 | |
2244 assert(uZoom >= 512); | |
2245 if (pObjectList->pObjects[object->uObjectDescID].uFlags & OBJECT_DESC_UNPICKABLE) | |
2246 { | |
2247 pRenderer->RasterLine2D(v37, v38, v37, v38, ui_game_minimap_projectile_color); | |
2248 } | |
2249 else if (uZoom > 512) | |
2250 { | |
2251 pRenderer->RasterLine2D(v37 - 1, v38 - 1, v37 - 1, v38 + 1, ui_game_minimap_treasure_color); | |
2252 pRenderer->RasterLine2D(v37, v38 - 2, v37, v38 + 1, ui_game_minimap_treasure_color); | |
2253 pRenderer->RasterLine2D(v37 + 1, v38 - 1, v37 + 1, v38 + 1, ui_game_minimap_treasure_color); | |
2254 pRenderer->RasterLine2D(v37 - 2, v38, v37 - 2, v38 + 1, ui_game_minimap_treasure_color); | |
2255 pRenderer->RasterLine2D(v37 + 2, v38, | |
2256 v37 + 2, v38 + 1, ui_game_minimap_treasure_color); | |
2257 } | |
2258 else | |
2259 { | |
2260 pRenderer->RasterLine2D(v37 - 1, v38 - 1, | |
2261 v37 - 1, v38, ui_game_minimap_treasure_color); | |
2262 pRenderer->RasterLine2D(v37, v38 - 1, | |
2263 v37, v38, ui_game_minimap_treasure_color); | |
2264 } | |
2265 //LABEL_82: | |
2266 //LABEL_83: | |
2267 //++uZe; | |
2268 //a2c += 112; | |
2269 //if ( uZe >= (signed int)uNumSpriteObjects ) | |
2270 //{ | |
2271 //goto LABEL_85; | |
2272 //} | |
2273 //} | |
2274 } | |
2275 | |
2276 | |
2277 LABEL_85: | |
2278 //v63 = TargetColor(255, 0, 0); | |
2279 //v61 = TargetColor(0, 255, 0); | |
2280 //v65 = TargetColor(255, 255, 0); | |
2281 uZf = 0; | |
2282 if ( (signed int)uNumActors > 0 ) | |
2283 { | |
2284 flagsc = pActors.data();//[0].uAIState; | |
2285 do | |
2286 { | |
2287 v39 = flagsc->uAIState; | |
2288 if ( flagsc->uAIState != 11 && v39 != 19 && (v39 == 5 || BYTE1(flagsc->uAttributes) & 0x80) ) | |
2289 { | |
2290 v40 = ((unsigned __int64)(( flagsc->vPosition.x - pParty->vPosition.x) | |
2291 * (signed __int64)(signed int)uZoom) >> 16) | |
2292 + uCenterX; | |
2293 v76 = (unsigned __int64)(( flagsc->vPosition.y - pParty->vPosition.y) | |
2294 * (signed __int64)(signed int)uZoom) >> 16; | |
2295 v41 = uCenterY - v76; | |
2296 if ( v40 >= pRenderer->raster_clip_x ) | |
2297 { | 2184 { |
2298 if ( v40 <= pRenderer->raster_clip_z && v41 >= pRenderer->raster_clip_y && v41 <= pRenderer->raster_clip_w ) | 2185 pRenderer->RasterLine2D(pObject_X, pObject_Y, pObject_X, pObject_Y, ui_game_minimap_projectile_color); |
2299 { | |
2300 uWd = ui_game_minimap_actor_friendly_color; | |
2301 if ( BYTE3(flagsc->uAttributes) & 1 ) | |
2302 uWd = ui_game_minimap_actor_hostile_color; | |
2303 if ( flagsc->uAIState == Dead) | |
2304 uWd = ui_game_minimap_actor_corpse_color; | |
2305 if ( (signed int)uZoom > 1024 ) | |
2306 { | |
2307 pRenderer->RasterLine2D(v40 - 1, v41 - 2, v40 - 1, v41 + 2, uWd); | |
2308 pRenderer->RasterLine2D(v40, v41 - 2, v40, v41 + 2, uWd); | |
2309 pRenderer->RasterLine2D(v40 + 1, v41 - 2, v40 + 1, v41 + 2, uWd); | |
2310 v42 = v41 + 1; | |
2311 v43 = v41 - 1; | |
2312 v44 = v42; | |
2313 pRenderer->RasterLine2D(v40 - 2, v43, v40 - 2, v42, uWd); | |
2314 v40 += 2; | |
2315 v59 = uWd; | |
2316 v56 = v44; | |
2317 v54 = v40; | |
2318 v52 = v43; | |
2319 } | |
2320 else | |
2321 { | |
2322 pRenderer->RasterLine2D(v40 - 1, v41 - 1, v40 - 1, uCenterY - v76, uWd); | |
2323 v59 = uWd; | |
2324 v56 = uCenterY - v76; | |
2325 v54 = v40; | |
2326 v52 = v41 - 1; | |
2327 } | |
2328 pRenderer->RasterLine2D(v40, v52, v54, v56, v59); | |
2329 } | |
2330 } | 2186 } |
2331 } | 2187 else if ( uZoom > 512 ) |
2332 ++uZf; | |
2333 ++flagsc; | |
2334 } | |
2335 while ( uZf < (signed int)uNumActors ); | |
2336 } | |
2337 } | |
2338 | |
2339 | |
2340 //flagsd = TargetColor(255, 255, 255); | |
2341 uZg = 0; | |
2342 if ( (signed int)uNumLevelDecorations > 0 ) | |
2343 { | |
2344 v45 = (char *)&pLevelDecorations[0].vPosition; | |
2345 lPitchb = (char *)&pLevelDecorations[0].vPosition; | |
2346 do | |
2347 { | |
2348 if ( *(v45 - 2) & 8 ) | |
2349 { | |
2350 v46 = ((unsigned __int64)((*(int *)v45 - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16) | |
2351 + uCenterX; | |
2352 v77 = (unsigned __int64)((*((int *)v45 + 1) - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16; | |
2353 v47 = uCenterY - v77; | |
2354 if ( v46 >= pRenderer->raster_clip_x ) | |
2355 { | |
2356 if ( v46 <= pRenderer->raster_clip_z && v47 >= pRenderer->raster_clip_y && v47 <= pRenderer->raster_clip_w ) | |
2357 { | 2188 { |
2358 if ( (signed int)uZoom > 512 ) | 2189 pRenderer->RasterLine2D(pObject_X - 2, pObject_Y, pObject_X - 2, pObject_Y + 1, ui_game_minimap_treasure_color); |
2359 { | 2190 pRenderer->RasterLine2D(pObject_X - 1, pObject_Y - 1, pObject_X - 1, pObject_Y + 1, ui_game_minimap_treasure_color); |
2360 v48 = v47 + 1; | 2191 pRenderer->RasterLine2D(pObject_X, pObject_Y - 2, pObject_X, pObject_Y + 1, ui_game_minimap_treasure_color); |
2361 v49 = v47 - 1; | 2192 pRenderer->RasterLine2D(pObject_X + 1, pObject_Y - 1, pObject_X + 1, pObject_Y + 1, ui_game_minimap_treasure_color); |
2362 pRenderer->RasterLine2D(v46 - 1, v47 - 1, v46 - 1, v47 + 1, ui_game_minimap_decoration_color_1); | 2193 pRenderer->RasterLine2D(pObject_X + 2, pObject_Y, pObject_X + 2, pObject_Y + 1, ui_game_minimap_treasure_color); |
2363 pRenderer->RasterLine2D(v46, v49, v46, v48, ui_game_minimap_decoration_color_1); | |
2364 pRenderer->RasterLine2D(v46 + 1, v49, v46 + 1, v48, ui_game_minimap_decoration_color_1); | |
2365 v45 = lPitchb; | |
2366 } | |
2367 else | |
2368 { | |
2369 pRenderer->RasterLine2D(v46, uCenterY - v77, v46, uCenterY - v77, ui_game_minimap_decoration_color_1); | |
2370 } | |
2371 } | 2194 } |
2372 } | 2195 else |
2373 } | 2196 { |
2374 ++uZg; | 2197 pRenderer->RasterLine2D(pObject_X - 1, pObject_Y - 1, pObject_X - 1, pObject_Y, ui_game_minimap_treasure_color); |
2375 v45 += 32; | 2198 pRenderer->RasterLine2D(pObject_X, pObject_Y - 1, pObject_X, pObject_Y, ui_game_minimap_treasure_color); |
2376 lPitchb = v45; | 2199 } |
2377 } | 2200 } |
2378 while ( uZg < (signed int)uNumLevelDecorations ); | 2201 } |
2379 } | 2202 } |
2380 pRenderer->DrawTextureTransparent(0x1D4u, 0, pIcons_LOD->GetTexture(dword_5079D8)); | 2203 for ( uint i = 0; i < uNumActors; ++i )//draw actors(отрисовка монстров и нпс) |
2381 uZooma = (double)pParty->sRotationY * 0.1171875; | 2204 { |
2382 //v50 = uZooma + 6.7553994e15; | 2205 if ( pActors[i].uAIState != Removed && pActors[i].uAIState != Disabled |
2206 && (pActors[i].uAIState == Dead || BYTE1(pActors[i].uAttributes) & 0x80) ) | |
2207 { | |
2208 pActor_X = uCenterX + ((unsigned __int64)(( pActors[i].vPosition.x - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16); | |
2209 pActor_Y = uCenterY - ((unsigned __int64)(( pActors[i].vPosition.y - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16); | |
2210 if ( pActor_X >= pRenderer->raster_clip_x && pActor_X <= pRenderer->raster_clip_z | |
2211 && pActor_Y >= pRenderer->raster_clip_y && pActor_Y <= pRenderer->raster_clip_w ) | |
2212 { | |
2213 pColor = ui_game_minimap_actor_friendly_color; | |
2214 if ( BYTE3(pActors[i].uAttributes) & 1 ) | |
2215 pColor = ui_game_minimap_actor_hostile_color; | |
2216 if ( pActors[i].uAIState == Dead) | |
2217 pColor = ui_game_minimap_actor_corpse_color; | |
2218 if ( uZoom > 1024 ) | |
2219 { | |
2220 pRenderer->RasterLine2D(pActor_X - 2, pActor_Y - 1, pActor_X - 2, pActor_Y + 1, pColor); | |
2221 pRenderer->RasterLine2D(pActor_X - 1, pActor_Y - 2, pActor_X - 1, pActor_Y + 2, pColor); | |
2222 pRenderer->RasterLine2D(pActor_X, pActor_Y - 2, pActor_X, pActor_Y + 2, pColor); | |
2223 pRenderer->RasterLine2D(pActor_X + 1, pActor_Y - 2, pActor_X + 1, pActor_Y + 2, pColor); | |
2224 pRenderer->RasterLine2D(pActor_X + 2, pActor_Y - 1, pActor_X + 2, pActor_Y + 1, pColor); | |
2225 } | |
2226 else | |
2227 { | |
2228 pRenderer->RasterLine2D(pActor_X - 1, pActor_Y - 1, pActor_X - 1, pActor_Y, pColor); | |
2229 pRenderer->RasterLine2D(pActor_X, pActor_Y - 1, pActor_X, pActor_Y, pColor); | |
2230 } | |
2231 } | |
2232 } | |
2233 } | |
2234 for ( uint i = 0; i < (signed int)uNumLevelDecorations; ++i )//draw items(отрисовка предметов) | |
2235 { | |
2236 if ( pLevelDecorations[i].uFlags & 8 ) | |
2237 { | |
2238 pDecoration_X = uCenterX + ((unsigned __int64)((pLevelDecorations[i].vPosition.x - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16); | |
2239 pDecoration_Y = uCenterY - ((unsigned __int64)((pLevelDecorations[i].vPosition.y - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16); | |
2240 if ( pDecoration_X >= pRenderer->raster_clip_x && pDecoration_X <= pRenderer->raster_clip_z | |
2241 && pDecoration_Y >= pRenderer->raster_clip_y && pDecoration_Y <= pRenderer->raster_clip_w ) | |
2242 { | |
2243 if ( (signed int)uZoom > 512 ) | |
2244 { | |
2245 pRenderer->RasterLine2D(pDecoration_X - 1, pDecoration_Y - 1, pDecoration_X - 1, pDecoration_Y + 1, ui_game_minimap_decoration_color_1); | |
2246 pRenderer->RasterLine2D(pDecoration_X, pDecoration_Y - 1, pDecoration_X, pDecoration_Y + 1, ui_game_minimap_decoration_color_1); | |
2247 pRenderer->RasterLine2D(pDecoration_X + 1, pDecoration_Y - 1, pDecoration_X + 1, pDecoration_Y + 1, ui_game_minimap_decoration_color_1); | |
2248 } | |
2249 else | |
2250 pRenderer->RasterLine2D(pDecoration_X, pDecoration_Y, pDecoration_X, pDecoration_Y, ui_game_minimap_decoration_color_1); | |
2251 } | |
2252 } | |
2253 } | |
2254 } | |
2255 pRenderer->DrawTextureTransparent(468, 0, pIcons_LOD->GetTexture(uTextureID_Minimap_Loop));//draw minimap_loop | |
2383 pRenderer->SetTextureClipRect(541, 0, 567, 480); | 2256 pRenderer->SetTextureClipRect(541, 0, 567, 480); |
2384 pRenderer->DrawTextureIndexed(floorf(uZooma + 0.5f) + 285, 136, pIcons_LOD->GetTexture(dword_5079B4)); | 2257 pRenderer->DrawTextureIndexed(floorf(((double)pParty->sRotationY * 0.1171875) + 0.5f) + 285, 136, pIcons_LOD->GetTexture(uTextureID_Compas));//draw compas |
2385 pRenderer->ResetTextureClipRect(); | 2258 pRenderer->ResetTextureClipRect(); |
2386 } | 2259 } |
2387 | 2260 |
2388 //----- (00441498) -------------------------------------------------------- | 2261 //----- (00441498) -------------------------------------------------------- |
2389 void GameUI_DrawTorchlightAndWizardEye() | 2262 void GameUI_DrawTorchlightAndWizardEye() |
2443 pTmpBuf[v22++] = i + 2; | 2316 pTmpBuf[v22++] = i + 2; |
2444 } | 2317 } |
2445 } | 2318 } |
2446 } | 2319 } |
2447 | 2320 |
2448 //v6 = (unsigned __int8)pParty->field_709; | |
2449 for ( int i = (unsigned __int8)pParty->field_709; i < v22 && pNPC_limit_ID < 2; i++ ) | 2321 for ( int i = (unsigned __int8)pParty->field_709; i < v22 && pNPC_limit_ID < 2; i++ ) |
2450 { | 2322 { |
2451 if ( (unsigned __int8)pTmpBuf[i] >= 2 ) | 2323 if ( (unsigned __int8)pTmpBuf[i] >= 2 ) |
2452 { | 2324 { |
2453 sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[i] + 499].uPortraitID); | 2325 sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)pTmpBuf[i] + 499].uPortraitID); |
2480 } | 2352 } |
2481 } | 2353 } |
2482 // 6BE3C5: using guessed type char bNoNPCHiring; | 2354 // 6BE3C5: using guessed type char bNoNPCHiring; |
2483 | 2355 |
2484 //----- (004178FE) -------------------------------------------------------- | 2356 //----- (004178FE) -------------------------------------------------------- |
2485 unsigned int __fastcall UI_GetHealthManaStringColor(signed int a1, signed int a2) | 2357 unsigned int UI_GetHealthManaAndOtherQualitiesStringColor(signed int current_pos, signed int base_pos) |
2486 { | 2358 { |
2487 unsigned __int16 v2; // dx@2 | 2359 unsigned __int16 R, G, B; |
2488 unsigned __int16 v3; // cx@2 | 2360 |
2489 int v5; // eax@5 | 2361 if ( current_pos <= base_pos ) |
2490 unsigned __int16 v6; // [sp-4h] [bp-8h]@2 | 2362 { |
2491 | 2363 if ( current_pos == base_pos )//White |
2492 if ( a1 <= a2 ) | |
2493 { | |
2494 if ( a1 == a2 ) | |
2495 return 0; | 2364 return 0; |
2496 v5 = 100 * a1 / a2; | 2365 if ( 100 * current_pos / base_pos >= 25 )//Yellow( current_pos > 1/4 ) |
2497 v3 = 255; | 2366 R = 255, G = 255, B = 100; |
2498 if ( v5 >= 25 ) | 2367 else//Red( current_pos < 1/4 ) |
2499 { | 2368 R = 255, G = 0, B = 0; |
2500 v6 = 100; | 2369 } |
2501 v2 = 255; | 2370 else//Green |
2502 } | 2371 R = 0, G = 255, B = 0; |
2503 else | 2372 return TargetColor(R, G, B); |
2504 { | |
2505 v6 = 0; | |
2506 v2 = 0; | |
2507 } | |
2508 } | |
2509 else | |
2510 { | |
2511 v6 = 0; | |
2512 v2 = 255; | |
2513 v3 = 0; | |
2514 } | |
2515 return TargetColor(v3, v2, v6); | |
2516 } | 2373 } |
2517 | 2374 |
2518 //----- (00417939) -------------------------------------------------------- | 2375 //----- (00417939) -------------------------------------------------------- |
2519 int GetConditionDrawColor(unsigned int uConditionIdx) | 2376 int GetConditionDrawColor(unsigned int uConditionIdx) |
2520 { | 2377 { |