comparison mm7_1.cpp @ 609:42d5777c2f47

Слияние
author Ritor1
date Wed, 06 Mar 2013 18:22:25 +0600
parents 3c7fca0e01a0
children fb0e105683e9 c615ff03b144
comparison
equal deleted inserted replaced
608:653724e9c234 609:42d5777c2f47
662 } 662 }
663 if ( dword_50651C < 0 ) 663 if ( dword_50651C < 0 )
664 { 664 {
665 result += awards_count; 665 result += awards_count;
666 dword_506528 = result; 666 dword_506528 = result;
667 if ( (signed int)(awards_count + result) <= awards_count2 ) 667 if ( (signed int)(awards_count + result) > awards_count2 )
668 goto LABEL_14; 668 {
669 result = awards_count2 - awards_count; 669 result = awards_count2 - awards_count;
670 goto LABEL_13; 670 dword_506528 = result;
671 } 671 }
672 if ( dword_50651C > 0 ) 672 }
673 else if ( dword_50651C > 0 )
673 { 674 {
674 result -= awards_count; 675 result -= awards_count;
675 dword_506528 = result; 676 dword_506528 = result;
676 if ( (result & 0x80000000u) != 0 ) 677 if ( (result & 0x80000000u) != 0 )
677 { 678 {
678 result = 0; 679 result = 0;
679 LABEL_13:
680 dword_506528 = result; 680 dword_506528 = result;
681 goto LABEL_14; 681 }
682 } 682 }
683 } 683 //LABEL_14:
684 LABEL_14:
685 dword_506544 = 0; 684 dword_506544 = 0;
686 dword_506548 = 0; 685 dword_506548 = 0;
687 awards_count = 0; 686 awards_count = 0;
688 dword_50651C = 0; 687 dword_50651C = 0;
689 v21 = result; 688 v21 = result;
693 { 692 {
694 v5 = achievedAwardsIndex[v21]; 693 v5 = achievedAwardsIndex[v21];
695 v20 = achievedAwardsIndex[v21]; 694 v20 = achievedAwardsIndex[v21];
696 v6 = (char *)pAwards[v20].pText;//(char *)dword_723E80_award_related[v20 / 4]; 695 v6 = (char *)pAwards[v20].pText;//(char *)dword_723E80_award_related[v20 / 4];
697 if ( v5 != 1 ) 696 if ( v5 != 1 )
698 break; 697 {
699 v17 = pParty->uFine; 698 if (!( (v5 < 85 || v5 > 91) && (v5 < 103 || v5 > 104) ))
700 LABEL_42: 699 {
701 sprintf(pTmpBuf, v6, v17); 700 if ( v5 > 89 )
702 v6 = pTmpBuf; 701 {
703 LABEL_43: 702 if ( v5 == 90 )
703 {
704 v10 = (unsigned __int8)pParty->uNumArenaKnightWins;
705 v22 = v10;
706 }
707 else if ( v5 == 91 )
708 {
709 v10 = (unsigned __int8)pParty->uNumArenaLordWins;
710 v22 = v10;
711 }
712 else if ( v5 == 103 )
713 {
714 v10 = pParty->field_874;
715 v22 = v10;
716 }
717 else if ( v5 == 104 )
718 {
719 v10 = pParty->field_878;
720 v22 = v10;
721 }
722 }
723 else
724 {
725 if ( v5 == 89 )
726 {
727 v10 = (unsigned __int8)pParty->uNumArenaSquireWins;
728 v22 = v10;
729 }
730 else if ( v5 == 85 )
731 {
732 v10 = pParty->uNumDeaths;
733 v22 = v10;
734 }
735 else if ( v5 == 86 )
736 {
737 v10 = pParty->uNumBountiesCollected;
738 v22 = v10;
739 }
740 else if ( v5 == 87 )
741 {
742 v10 = pParty->uNumPrisonTerms;
743 v22 = v10;
744 }
745 else if ( v5 == 88)
746 {
747 v10 = (unsigned __int8)pParty->uNumArenaPageWins;
748 v22 = v10;
749 }
750 }
751 v17 = v22;
752 sprintf(pTmpBuf, v6, v17);
753 v6 = pTmpBuf;
754 }
755 }
756 else
757 {
758 v17 = pParty->uFine;
759 sprintf(pTmpBuf, v6, v17);
760 v6 = pTmpBuf;
761 }
704 v14 = pAwards[v20].uSort;//dword_723E84[v20 / 4]; 762 v14 = pAwards[v20].uSort;//dword_723E84[v20 / 4];
705 ++awards_count; 763 ++awards_count;
706 v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat( 764 v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(
707 pAwardsTextColors[3 * v14 % 6], 765 pAwardsTextColors[3 * v14 % 6],
708 pAwardsTextColors[3 * v14 % 6 + 1], 766 pAwardsTextColors[3 * v14 % 6 + 1],
718 if ( v21 < awards_count2 ) 776 if ( v21 < awards_count2 )
719 continue; 777 continue;
720 } 778 }
721 return; 779 return;
722 } 780 }
723 if ( (v5 < 85 || v5 > 91) && (v5 < 103 || v5 > 104) ) 781
724 goto LABEL_43;
725 if ( v5 > 89 )
726 {
727 v11 = v5 - 90;
728 if ( !v11 )
729 {
730 v10 = (unsigned __int8)pParty->uNumArenaKnightWins;
731 goto LABEL_40;
732 }
733 v12 = v11 - 1;
734 if ( !v12 )
735 {
736 v10 = (unsigned __int8)pParty->uNumArenaLordWins;
737 goto LABEL_40;
738 }
739 v13 = v12 - 12;
740 if ( !v13 )
741 {
742 v10 = pParty->field_874;
743 goto LABEL_40;
744 }
745 if ( v13 == 1 )
746 {
747 v10 = pParty->field_878;
748 goto LABEL_40;
749 }
750 }
751 else
752 {
753 if ( v5 == 89 )
754 {
755 v10 = (unsigned __int8)pParty->uNumArenaSquireWins;
756 goto LABEL_40;
757 }
758 v7 = v5 - 85;
759 if ( !v7 )
760 {
761 v10 = pParty->uNumDeaths;
762 goto LABEL_40;
763 }
764 v8 = v7 - 1;
765 if ( !v8 )
766 {
767 v10 = pParty->uNumBountiesCollected;
768 goto LABEL_40;
769 }
770 v9 = v8 - 1;
771 if ( !v9 )
772 {
773 v10 = pParty->uNumPrisonTerms;
774 goto LABEL_40;
775 }
776 if ( v9 == 1 )
777 {
778 v10 = (unsigned __int8)pParty->uNumArenaPageWins;
779 LABEL_40:
780 v22 = v10;
781 goto LABEL_41;
782 }
783 }
784 LABEL_41:
785 v17 = v22;
786 goto LABEL_42;
787 } 782 }
788 return; 783 return;
789 } 784 }
790 // 50651C: using guessed type int dword_50651C; 785 // 50651C: using guessed type int dword_50651C;
791 // 506520: using guessed type int dword_506520; 786 // 506520: using guessed type int dword_506520;
983 ++uCellID; 978 ++uCellID;
984 v26 += 4; 979 v26 += 4;
985 } 980 }
986 while ( uCellID < 126 ); 981 while ( uCellID < 126 );
987 } 982 }
988 // 4E28F8: using guessed type int pCurrentScreen;
989 // 507958: using guessed type int uTextureID_507958;
990 // 50C9A8: using guessed type int dword_50C9A8;
991 983
992 //----- (0041A556) -------------------------------------------------------- 984 //----- (0041A556) --------------------------------------------------------
993 void __cdecl draw_leather() 985 void __cdecl draw_leather()
994 { 986 {
995 pRenderer->DrawTextureIndexed( 987 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_Leather));
996 8u,
997 8u,
998 (Texture *)(uTextureID_Leather != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Leather] : 0));
999 } 988 }
1000 989
1001 //----- (0041A57E) -------------------------------------------------------- 990 //----- (0041A57E) --------------------------------------------------------
1002 char __cdecl QuickRefDraw() 991 void QuickRefDraw()
1003 { 992 {
1004 unsigned int v0; // ebx@1 993 unsigned int v0; // ebx@1
1005 unsigned int v1; // eax@1 994 //unsigned int v1; // eax@1
1006 Player *pPlayer; // ebp@2 995 Player *pPlayer; // ebp@2
1007 int v3; // eax@6 996 int v3; // eax@6
1008 int v4; // edi@6 997 int v4; // edi@6
1009 unsigned int v5; // eax@7 998 unsigned int v5; // eax@7
1010 unsigned int v6; // edi@9 999 unsigned int v6; // edi@9
1047 unsigned int v44; // [sp+14h] [bp-18h]@2 1036 unsigned int v44; // [sp+14h] [bp-18h]@2
1048 int v45; // [sp+18h] [bp-14h]@1 1037 int v45; // [sp+18h] [bp-14h]@1
1049 unsigned int v46; // [sp+1Ch] [bp-10h]@1 1038 unsigned int v46; // [sp+1Ch] [bp-10h]@1
1050 unsigned int v47; // [sp+20h] [bp-Ch]@1 1039 unsigned int v47; // [sp+20h] [bp-Ch]@1
1051 unsigned int v48; // [sp+24h] [bp-8h]@33 1040 unsigned int v48; // [sp+24h] [bp-8h]@33
1052 unsigned int v49; // [sp+28h] [bp-4h]@1 1041 //unsigned int v49; // [sp+28h] [bp-4h]@1
1053 1042
1054 v0 = 0; 1043 v0 = 0;
1055 v47 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); 1044 v47 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
1056 v49 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); 1045 //v49 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0);
1057 v46 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); 1046 v46 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0);
1058 v1 = pIcons_LOD->LoadTexture("quikref", TEXTURE_16BIT_PALETTE); 1047 //v1 = pIcons_LOD->LoadTexture("quikref", TEXTURE_16BIT_PALETTE);
1059 pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(v1 != -1 ? &pIcons_LOD->pTextures[v1] : 0)); 1048 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("quikref", TEXTURE_16BIT_PALETTE));
1060 v43 = 0; 1049 v43 = 0;
1061 v45 = LOBYTE(pFontArrus->uFontHeight) + 1; 1050 v45 = LOBYTE(pFontArrus->uFontHeight) + 1;
1062 do 1051 do
1063 { 1052 {
1064 pPlayer = &pParty->pPlayers[v43]; 1053 pPlayer = &pParty->pPlayers[v43];
1165 v37 = pGlobalTXT_LocalizationStrings[153];// 1154 v37 = pGlobalTXT_LocalizationStrings[153];//
1166 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v35, 0, v37, 84, 0); 1155 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v35, 0, v37, 84, 0);
1167 ++v43; 1156 ++v43;
1168 } 1157 }
1169 while ( v43 < 4 ); 1158 while ( v43 < 4 );
1159
1170 v38 = GetPartyReputation(); 1160 v38 = GetPartyReputation();
1171 if ( v38 >= 0 ) 1161 if ( v38 >= 0 )
1172 { 1162 {
1173 v39 = v49;
1174 if ( v38 <= 5 ) 1163 if ( v38 <= 5 )
1175 v39 = 65535; 1164 v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF);
1165 else
1166 v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0, 0);
1176 } 1167 }
1177 else 1168 else
1178 {
1179 v39 = v46; 1169 v39 = v46;
1180 } 1170
1181 v40 = GetReputationString(v38); 1171 v40 = GetReputationString(v38);
1182 sprintf(pTmpBuf, "%s: ", pGlobalTXT_LocalizationStrings[180], v39, v40);//Reputation 1172 sprintf(pTmpBuf, "%s: \xC" "%05d%s\xC" "00000", pGlobalTXT_LocalizationStrings[180], v39, v40);//Reputation
1183 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 22, 323, 0, pTmpBuf, 0, 0, 0); 1173 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 22, 323, 0, pTmpBuf, 0, 0, 0);
1184 v41 = pParty->GetPartyFame(); 1174 v41 = pParty->GetPartyFame();
1185 sprintf(pTmpBuf, "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], v41);// Fame 1175 sprintf(pTmpBuf, "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], v41);// Fame
1186 return pGUIWindow_CurrentMenu->DrawText(pFontArrus, 0, 323, 0, pTmpBuf, 0, 0, 0); 1176 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 0, 323, 0, pTmpBuf, 0, 0, 0);
1187 } 1177 }
1188 1178
1189 //----- (0041ABFD) -------------------------------------------------------- 1179 //----- (0041ABFD) --------------------------------------------------------
1190 void __thiscall CharacterUI_CharacterScreen_Draw(unsigned int uPlayerIdx) 1180 void __thiscall CharacterUI_CharacterScreen_Draw(unsigned int uPlayerIdx)
1191 { 1181 {
1208 sub_419379(); 1198 sub_419379();
1209 CharacterUI_StatsTab_Draw(v1); 1199 CharacterUI_StatsTab_Draw(v1);
1210 v7 = pIcons_LOD->LoadTexture("ib-cd1-d", TEXTURE_16BIT_PALETTE); 1200 v7 = pIcons_LOD->LoadTexture("ib-cd1-d", TEXTURE_16BIT_PALETTE);
1211 pTexture = (Texture *)(v7 != -1 ? (int)&pIcons_LOD->pTextures[v7] : 0); 1201 pTexture = (Texture *)(v7 != -1 ? (int)&pIcons_LOD->pTextures[v7] : 0);
1212 pButton = pCharacterScreen_StatsBtn; 1202 pButton = pCharacterScreen_StatsBtn;
1213 break; 1203 pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture);
1204 break;
1214 case WINDOW_CharacterWindow_Skills: // skills 1205 case WINDOW_CharacterWindow_Skills: // skills
1215 if ( dword_507CC0 != uActiveCharacter ) 1206 if ( dword_507CC0 != uActiveCharacter )
1216 { 1207 {
1217 sub_4196A0(); 1208 sub_4196A0();
1218 CharacterUI_SkillScreen_Draw(); 1209 CharacterUI_SkillScreen_Draw();
1220 sub_419379(); 1211 sub_419379();
1221 CharacterUI_SkillsTab_Draw(v1); 1212 CharacterUI_SkillsTab_Draw(v1);
1222 v6 = pIcons_LOD->LoadTexture("ib-cd2-d", TEXTURE_16BIT_PALETTE); 1213 v6 = pIcons_LOD->LoadTexture("ib-cd2-d", TEXTURE_16BIT_PALETTE);
1223 pTexture = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0); 1214 pTexture = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0);
1224 pButton = pCharacterScreen_SkillsBtn; 1215 pButton = pCharacterScreen_SkillsBtn;
1225 break; 1216 pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture);
1217 break;
1226 case WINDOW_CharacterWindow_Awards: // awards 1218 case WINDOW_CharacterWindow_Awards: // awards
1227 sub_4196A0(); 1219 sub_4196A0();
1228 sub_419379(); 1220 sub_419379();
1229 sub_419220(); 1221 sub_419220();
1230 CharacterUI_AwardsTab_Draw(v1); 1222 CharacterUI_AwardsTab_Draw(v1);
1231 v5 = pIcons_LOD->LoadTexture("ib-cd4-d", TEXTURE_16BIT_PALETTE); 1223 v5 = pIcons_LOD->LoadTexture("ib-cd4-d", TEXTURE_16BIT_PALETTE);
1232 pTexture = (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0); 1224 pTexture = (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0);
1233 pButton = pCharacterScreen_AwardsBtn; 1225 pButton = pCharacterScreen_AwardsBtn;
1226 pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture);
1234 break; 1227 break;
1235 default: // inventory and other 1228 case WINDOW_CharacterWindow_Inventory: // inventory and other
1236 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] != 103 )
1237 goto LABEL_13;
1238 sub_4196A0(); 1229 sub_4196A0();
1239 sub_419379(); 1230 sub_419379();
1240 CharacterUI_InventoryTab_Draw(v1, 0); 1231 CharacterUI_InventoryTab_Draw(v1, 0);
1241 v2 = pIcons_LOD->LoadTexture("ib-cd3-d", TEXTURE_16BIT_PALETTE); 1232 v2 = pIcons_LOD->LoadTexture("ib-cd3-d", TEXTURE_16BIT_PALETTE);
1242 pTexture = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0); 1233 pTexture = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0);
1243 pButton = pCharacterScreen_InventoryBtn; 1234 pButton = pCharacterScreen_InventoryBtn;
1235 pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture);
1244 break; 1236 break;
1245 } 1237 default:
1246 pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture); 1238 break;
1247 LABEL_13: 1239 }
1248 if ( bRingsShownInCharScreen ) 1240 if ( bRingsShownInCharScreen )
1249 CharacterUI_DrawPaperdollWithRingOverlay(v1); 1241 CharacterUI_DrawPaperdollWithRingOverlay(v1);
1250 else 1242 else
1251 CharacterUI_DrawPaperdoll(v1); 1243 CharacterUI_DrawPaperdoll(v1);
1252 } 1244 }
1253 } 1245 }
1254 // 507CC0: using guessed type int dword_507CC0;
1255 // 5118E0: using guessed type int bRingsShownInCharScreen;
1256 1246
1257 //----- (0041AD6E) -------------------------------------------------------- 1247 //----- (0041AD6E) --------------------------------------------------------
1258 void __cdecl GameUI_DrawRightPanelItems() 1248 void __cdecl GameUI_DrawRightPanelItems()
1259 { 1249 {
1260 if ( (signed int)((pParty->uTimePlayed - qword_507CC8) >> 32) <= 0 && (((pParty->uTimePlayed - qword_507CC8) >> 32) & 0x80000000u) != 0i64 ) 1250 if (GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed)
1261 qword_507CC8 = 0i64; 1251 GameUI_RightPanel_BookFlashTimer = 0;
1262 if ( (((pParty->uTimePlayed - qword_507CC8) >> 32) & 0x80000000u) == 0i64 1252
1263 && (!(SHIDWORD(pParty->uTimePlayed) < (LODWORD(pParty->uTimePlayed) < (unsigned int)qword_507CC8) 1253 if (pParty->uTimePlayed - GameUI_RightPanel_BookFlashTimer > 128)
1264 + HIDWORD(qword_507CC8) | (pParty->uTimePlayed - qword_507CC8) >> 32 == 0) 1254 {
1265 || (unsigned int)(LODWORD(pParty->uTimePlayed) - qword_507CC8) > 0x80) ) 1255 GameUI_RightPanel_BookFlashTimer = pParty->uTimePlayed;
1266 {
1267 qword_507CC8 = pParty->uTimePlayed;
1268 byte_50697C = byte_50697C == 0; 1256 byte_50697C = byte_50697C == 0;
1269 if ( byte_50697C && pCurrentScreen != SCREEN_REST ) 1257 if ( byte_50697C && pCurrentScreen != SCREEN_REST )
1270 { 1258 {
1271 if ( bFlashQuestBook ) 1259 if ( bFlashQuestBook )
1272 pRenderer->DrawTextureTransparent(493, 355, (Texture *)(uTextureID_ib_td1_A != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ib_td1_A] : 0)); 1260 pRenderer->DrawTextureTransparent(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A));
1273 if ( bFlashAutonotesBook ) 1261 if ( bFlashAutonotesBook )
1274 pRenderer->DrawTextureTransparent(527, 353, (Texture *)(uTextureID_ib_td2_A != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ib_td2_A] : 0)); 1262 pRenderer->DrawTextureTransparent(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A));
1275 if ( bFlashHistoryBook ) 1263 if ( bFlashHistoryBook )
1276 pRenderer->DrawTextureTransparent(600, 361, (Texture *)(uTextureID_ib_td5_A != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_ib_td5_A] : 0)); 1264 pRenderer->DrawTextureTransparent(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A));
1277 } 1265 }
1278 else 1266 else
1279 { 1267 {
1280 pRenderer->DrawTextureRGB(468u, 0, pTexture_RightFrame); 1268 pRenderer->DrawTextureRGB(468u, 0, pTexture_RightFrame);
1281 DrawHiredNPCs(); 1269 DrawHiredNPCs();
1284 } 1272 }
1285 1273
1286 //----- (0041AEBB) -------------------------------------------------------- 1274 //----- (0041AEBB) --------------------------------------------------------
1287 void __cdecl GameUI_DrawFoodAndGold() 1275 void __cdecl GameUI_DrawFoodAndGold()
1288 { 1276 {
1289 unsigned int v0; // ebx@2
1290 unsigned int v1; // ebp@2
1291 int v2; // esi@2 1277 int v2; // esi@2
1292 1278
1293 if ( uGameState != GAME_STATE_FINAL_WINDOW ) 1279 if ( uGameState != GAME_STATE_FINAL_WINDOW )
1294 { 1280 {
1295 v0 = uGameUIFontMain;
1296 v1 = uGameUIFontShadow;
1297 v2 = sub_44100D() != 0 ? 381 : 322; 1281 v2 = sub_44100D() != 0 ? 381 : 322;
1298 sprintf(pTmpBuf, "\r087%lu", pParty->uNumFoodRations); 1282 sprintf(pTmpBuf, "\r087%lu", pParty->uNumFoodRations);
1299 pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, v0, pTmpBuf, 0, 0, v1); 1283 pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow);
1300 sprintf(pTmpBuf, "\r028%lu", pParty->uNumGold); 1284 sprintf(pTmpBuf, "\r028%lu", pParty->uNumGold);
1301 pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, v0, pTmpBuf, 0, 0, v1); 1285 pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow);
1302 } 1286 }
1303 } 1287 }
1304 1288
1305 //----- (0041AF52) -------------------------------------------------------- 1289 //----- (0041AF52) --------------------------------------------------------
1306 void Actor::DrawHealthBar(Actor *a1, GUIWindow *a2) 1290 void Actor::DrawHealthBar(Actor *a1, GUIWindow *a2)
1332 v6 = (double)(signed int)v2; 1316 v6 = (double)(signed int)v2;
1333 v10 = (signed __int64)((double)(signed int)v4 / (double)(signed int)v2 * (double)a1->sCurrentHP); 1317 v10 = (signed __int64)((double)(signed int)v4 / (double)(signed int)v2 * (double)a1->sCurrentHP);
1334 if ( v5 <= (signed int)(signed __int64)(0.34 * v6) ) 1318 if ( v5 <= (signed int)(signed __int64)(0.34 * v6) )
1335 { 1319 {
1336 v7 = uTextureID_mhp_red; 1320 v7 = uTextureID_mhp_red;
1337 LABEL_9:
1338 v9 = v7; 1321 v9 = v7;
1339 goto LABEL_10; 1322 }
1340 } 1323 else if ( v5 <= (signed int)(signed __int64)(v6 * 0.67) )
1341 if ( v5 <= (signed int)(signed __int64)(v6 * 0.67) )
1342 { 1324 {
1343 v7 = uTextureID_mhp_yel; 1325 v7 = uTextureID_mhp_yel;
1344 goto LABEL_9; 1326 v9 = v7;
1345 } 1327 }
1346 } 1328 }
1347 LABEL_10:
1348 v8 = a2->uFrameX + (signed int)(a2->uFrameWidth - v4) / 2; 1329 v8 = a2->uFrameX + (signed int)(a2->uFrameWidth - v4) / 2;
1349 pRenderer->Clip(v8, a2->uFrameY + 32, v8 + v4, a2->uFrameY + 52); 1330 pRenderer->Clip(v8, a2->uFrameY + 32, v8 + v4, a2->uFrameY + 52);
1350 pRenderer->DrawTextureIndexed( 1331 pRenderer->DrawTextureIndexed(
1351 v8, 1332 v8,
1352 v3->uFrameY + 32, 1333 v3->uFrameY + 32,
1397 v15 = (double)(uTextureID_BarGreen != -1 ? pIcons_LOD->pTextures[uTextureID_BarGreen].uTextureHeight : 26); 1378 v15 = (double)(uTextureID_BarGreen != -1 ? pIcons_LOD->pTextures[uTextureID_BarGreen].uTextureHeight : 26);
1398 do 1379 do
1399 { 1380 {
1400 v1 = &pParty->pPlayers[v16]; 1381 v1 = &pParty->pPlayers[v16];
1401 v11 = v1; 1382 v11 = v1;
1402 if ( v1->sHealth <= 0 ) 1383 if ( v1->sHealth > 0 )
1403 goto LABEL_24; 1384 {
1404 v11 = &pParty->pPlayers[v16]; 1385 v11 = &pParty->pPlayers[v16];
1405 v2 = (double)v1->sHealth; 1386 v2 = (double)v1->sHealth;
1406 v3 = v2 / (double)v1->GetMaxHealth(); 1387 v3 = v2 / (double)v1->GetMaxHealth();
1407 if ( v3 <= 0.5 ) 1388 if( v3 > 0.5 )
1408 { 1389 {
1409 if ( v3 <= 0.25 ) 1390 if ( v3 > 1.0 )
1410 { 1391 v3 = 1.0;
1411 if ( v3 <= 0.0 ) 1392 v4 = (signed __int64)((1.0 - v3) * v15);
1412 goto LABEL_24; 1393 if ( v16 == 2 || v16 == 3 )
1413 if ( v16 == 2 || v16 == 3 ) 1394 v17 = 2;
1414 v17 = 2; 1395 else
1415 else 1396 v17 = 0;
1416 v17 = 0; 1397 pRenderer->Clip(
1417 pRenderer->Clip( 1398 v17 + pHealthBarPos[v16],
1418 v17 + pHealthBarPos[v16], 1399 v4 + 402,
1419 (unsigned __int64)(signed __int64)((1.0 - v3) * v15) + 402, 1400 v17 + pHealthBarPos[v16] + v0->uTextureWidth,
1420 v17 + pHealthBarPos[v16] + v13->uTextureWidth, 1401 v0->uTextureHeight + 402);
1421 v13->uTextureHeight + 402); 1402 v9 = v0;
1422 v9 = v13; 1403 }
1423 } 1404 else if ( v3 > 0.25 )
1424 else 1405 {
1425 { 1406 if ( v16 == 2 || v16 == 3 )
1426 if ( v16 == 2 || v16 == 3 ) 1407 v17 = 2;
1427 v17 = 2; 1408 else
1428 else 1409 v17 = 0;
1429 v17 = 0; 1410 pRenderer->Clip(
1430 pRenderer->Clip( 1411 v17 + pHealthBarPos[v16],
1431 v17 + pHealthBarPos[v16], 1412 (unsigned __int64)(signed __int64)((1.0 - v3) * v15) + 402,
1432 (unsigned __int64)(signed __int64)((1.0 - v3) * v15) + 402, 1413 v17 + pHealthBarPos[v16] + v14->uTextureWidth,
1433 v17 + pHealthBarPos[v16] + v14->uTextureWidth, 1414 v14->uTextureHeight + 402);
1434 v14->uTextureHeight + 402); 1415 v9 = v14;
1435 v9 = v14; 1416 }
1436 } 1417 else if ( v3 > 0.0 )
1437 } 1418 {
1438 else 1419 if ( v16 == 2 || v16 == 3 )
1439 { 1420 v17 = 2;
1440 if ( v3 > 1.0 ) 1421 else
1441 v3 = 1.0; 1422 v17 = 0;
1442 v4 = (signed __int64)((1.0 - v3) * v15); 1423 pRenderer->Clip(
1443 if ( v16 == 2 || v16 == 3 ) 1424 v17 + pHealthBarPos[v16],
1444 v17 = 2; 1425 (unsigned __int64)(signed __int64)((1.0 - v3) * v15) + 402,
1445 else 1426 v17 + pHealthBarPos[v16] + v13->uTextureWidth,
1446 v17 = 0; 1427 v13->uTextureHeight + 402);
1447 pRenderer->Clip( 1428 v9 = v13;
1448 v17 + pHealthBarPos[v16], 1429 }
1449 v4 + 402, 1430 if( v3 > 0.0 )
1450 v17 + pHealthBarPos[v16] + v0->uTextureWidth, 1431 {
1451 v0->uTextureHeight + 402); 1432 pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[v16], 0x192u, v9);
1452 v9 = v0; 1433 pRenderer->ResetClip();
1453 } 1434 }
1454 pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[v16], 0x192u, v9); 1435 }
1455 pRenderer->ResetClip();
1456 LABEL_24:
1457 v5 = v11; 1436 v5 = v11;
1458 v12 = v11->sMana; 1437 v12 = v11->sMana;
1459 if ( v12 > 0 ) 1438 if ( v12 > 0 )
1460 { 1439 {
1461 v6 = (double)v12; 1440 v6 = (double)v12;
1775 (Texture *)(uTextureID_Btn_QuickReference != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_QuickReference] : 0), 0); 1754 (Texture *)(uTextureID_Btn_QuickReference != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_QuickReference] : 0), 0);
1776 pBtn_GameSettings = pPrimaryWindow->CreateButton(0x25Au, 0x1C2u, 1755 pBtn_GameSettings = pPrimaryWindow->CreateButton(0x25Au, 0x1C2u,
1777 (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureWidth : 24), 1756 (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureWidth : 24),
1778 (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureHeight : 26), 1757 (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureHeight : 26),
1779 1, 0, 0x6Bu, 0, 0, pGlobalTXT_LocalizationStrings[93], 1758 1, 0, 0x6Bu, 0, 0, pGlobalTXT_LocalizationStrings[93],
1780 (Texture *)(uTextureID_Btn_GameSettings != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings] : 0), 0); 1759 (Texture *)(uTextureID_Btn_GameSettings != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_GameSettings] : 0), 0);
1781 pBtn_NPCLeft = pPrimaryWindow->CreateButton(0x1D5u, 0xB2u, 1760 pBtn_NPCLeft = pPrimaryWindow->CreateButton(0x1D5u, 0xB2u,
1782 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24), 1761 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24),
1783 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26), 1762 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26),
1784 1, 0, 0xBCu, 0, 0, "", 1763 1, 0, 0xBCu, 0, 0, "",
1785 (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0), 0); 1764 (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0), 0);
1786 pBtn_NPCRight = pPrimaryWindow->CreateButton(0x272u, 0xB2u, 1765 pBtn_NPCRight = pPrimaryWindow->CreateButton(0x272u, 0xB2u,
1787 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24), 1766 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24),
1788 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26), 1767 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26),
1789 1, 0, 0xBCu, 1u, 0, "", 1768 1, 0, 0xBCu, 1u, 0, "",
1790 (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), 0); 1769 (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), 0);
1791 Load_isn_spells_21_27(); 1770 LoadPartyBuffIcons();
1792 } 1771 }
1793 1772
1794 1773
1795 //----- (0041C047) -------------------------------------------------------- 1774 //----- (0041C047) --------------------------------------------------------
1796 void __cdecl GameUI_DrawStatusBar_2() 1775 void __cdecl GameUI_DrawStatusBar_2()
1950 return 0; 1929 return 0;
1951 v2 = pMessageQueue_50CBD0->uNumMessages; 1930 v2 = pMessageQueue_50CBD0->uNumMessages;
1952 while ( 1 ) 1931 while ( 1 )
1953 { 1932 {
1954 v3 = pVisibleWindowsIdxs[v27] - 1; 1933 v3 = pVisibleWindowsIdxs[v27] - 1;
1955 if ( pWindowList[v3].field_44 == v1 ) 1934 if ( pWindowList[v3].field_44 != v1 )
1956 goto LABEL_47; 1935 {
1957 if ( v26 != 34 ) 1936 switch(v26)
1958 break; 1937 {
1959 if ( pWindowList[v3].field_30 != v1 ) 1938 case VK_LEFT:
1960 { 1939 {
1961 pMouse->GetClickPos(&uClickX, &uClickY); 1940 v12 = pWindowList[v3].field_34;
1962 v4 = pWindowList[v3].pStartingPosActiveItem; 1941 if ( pWindowList[v3].pCurrentPosActiveItem - pWindowList[v3].pStartingPosActiveItem - v12 >= 0 )
1963 v29 = v4 + pWindowList[v3].pNumPresenceButton; 1942 {
1964 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton ) 1943 v8 = pCurrentScreen == SCREEN_PARTY_CREATION;
1965 { 1944 pWindowList[v3].pCurrentPosActiveItem -= v12;
1966 while ( 1 ) 1945 if ( v8 )
1967 { 1946 {
1968 v14 = pWindowList[v3].pControlsHead; 1947 pAudioPlayer->PlaySound(SOUND_Button, v1, v1, -1, v1, v1, v1, v1);
1969 if ( v4 > 0 ) 1948 v2 = pMessageQueue_50CBD0->uNumMessages;
1970 { 1949 }
1971 v15 = v4; 1950 }
1972 do 1951 if ( pWindowList[v3].field_30 != v1 )
1973 { 1952 {
1974 v14 = v14->pNext; 1953 break;
1975 --v15; 1954 }
1976 } 1955 v9 = pWindowList[v3].pControlsHead;
1977 while ( v15 ); 1956 v13 = pWindowList[v3].pCurrentPosActiveItem;
1978 } 1957 if ( v13 > (signed int)v1 )
1979 if ( (signed int)uClickX >= (signed int)v14->uX 1958 {
1980 && (signed int)uClickX <= (signed int)v14->uZ 1959 do
1981 && (signed int)uClickY >= (signed int)v14->uY 1960 {
1982 && (signed int)uClickY <= (signed int)v14->uW ) 1961 v9 = v9->pNext;
1983 goto LABEL_66; 1962 --v13;
1984 ++v4; 1963 }
1985 if ( v4 >= v29 ) 1964 while ( v13 );
1986 { 1965 }
1987 LABEL_45: 1966 v11 = v9->uControlParam;
1988 v1 = 0; 1967 /*if ( (signed int)v2 < 40 )
1989 goto LABEL_46; 1968 {
1990 } 1969 pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v9->uControlID;
1991 } 1970 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v11;
1992 } 1971 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
1993 goto LABEL_46; 1972 v2 = pMessageQueue_50CBD0->uNumMessages + 1;
1994 } 1973 ++pMessageQueue_50CBD0->uNumMessages;
1995 LABEL_47: 1974 }*/
1975 pMessageQueue_50CBD0->AddMessage((UIMessageType)v9->uControlID, v11, v1);
1976 break;
1977 }
1978 case VK_RIGHT:
1979 {
1980 v7 = pWindowList[v3].pCurrentPosActiveItem + pWindowList[v3].field_34;
1981 if ( v7 < pWindowList[v3].pNumPresenceButton + pWindowList[v3].pStartingPosActiveItem )
1982 {
1983 v8 = pCurrentScreen == SCREEN_PARTY_CREATION;
1984 pWindowList[v3].pCurrentPosActiveItem = v7;
1985 if ( v8 )
1986 {
1987 pAudioPlayer->PlaySound(SOUND_Button, v1, v1, -1, v1, v1, v1, v1);
1988 v2 = pMessageQueue_50CBD0->uNumMessages;
1989 }
1990 }
1991 if ( pWindowList[v3].field_30 != v1 )
1992 {
1993 break;
1994 }
1995 v9 = pWindowList[v3].pControlsHead;
1996 v10 = pWindowList[v3].pCurrentPosActiveItem;
1997 if ( v10 > (signed int)v1 )
1998 {
1999 do
2000 {
2001 v9 = v9->pNext;
2002 --v10;
2003 }
2004 while ( v10 );
2005 }
2006 v11 = v9->uControlParam;
2007 pMessageQueue_50CBD0->AddMessage((UIMessageType)v9->uControlID, v11, v1);
2008 break;
2009 }
2010 case VK_DOWN:
2011 {
2012 v17 = pWindowList[v3].pStartingPosActiveItem;
2013 v18 = pWindowList[v3].pCurrentPosActiveItem;
2014 if ( v18 >= pWindowList[v3].pNumPresenceButton + v17 - 1 )
2015 pWindowList[v3].pCurrentPosActiveItem = v17;
2016 else
2017 pWindowList[v3].pCurrentPosActiveItem = v18 + 1;
2018 if ( pWindowList[v3].field_30 != v1 )
2019 return 1;
2020 v19 = pWindowList[v3].pControlsHead;
2021 v20 = pWindowList[v3].pCurrentPosActiveItem;
2022 if ( v20 > (signed int)v1 )
2023 {
2024 do
2025 {
2026 v19 = v19->pNext;
2027 --v20;
2028 }
2029 while ( v20 );
2030 }
2031 v21 = v19->uControlParam;
2032 pMessageQueue_50CBD0->AddMessage((UIMessageType)v19->uControlID, v21, v1);
2033 return 1;
2034 }
2035 case VK_SELECT:
2036 {
2037 pMouse->GetClickPos(&uClickX, &uClickY);
2038 v4 = pWindowList[v3].pStartingPosActiveItem;
2039 v28 = v4 + pWindowList[v3].pNumPresenceButton;
2040 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton )
2041 {
2042 while ( 1 )
2043 {
2044 v5 = pWindowList[v3].pControlsHead;
2045 if ( v4 > 0 )
2046 {
2047 v6 = v4;
2048 do
2049 {
2050 v5 = v5->pNext;
2051 --v6;
2052 }
2053 while ( v6 );
2054 }
2055 if ( (signed int)uClickX >= (signed int)v5->uX
2056 && (signed int)uClickX <= (signed int)v5->uZ
2057 && (signed int)uClickY >= (signed int)v5->uY
2058 && (signed int)uClickY <= (signed int)v5->uW )
2059 break;
2060 ++v4;
2061 if ( v4 >= v28 )
2062 {
2063 v1 = 0;
2064 v2 = pMessageQueue_50CBD0->uNumMessages;
2065 --v27;
2066 if ( v27 < 0 )
2067 return 0;
2068 continue;
2069 }
2070 }
2071 pWindowList[v3].pCurrentPosActiveItem = v4;
2072 return 1;
2073 }
2074 v2 = pMessageQueue_50CBD0->uNumMessages;
2075 break;
2076 }
2077 case VK_UP:
2078 {
2079 v22 = pWindowList[v3].pCurrentPosActiveItem;
2080 v23 = pWindowList[v3].pStartingPosActiveItem;
2081 if ( v22 <= v23 )
2082 v24 = pWindowList[v3].pNumPresenceButton + v23 - 1;
2083 else
2084 v24 = v22 - 1;
2085 v8 = pWindowList[v3].field_30 == v1;
2086 pWindowList[v3].pCurrentPosActiveItem = v24;
2087 if ( !v8 )
2088 return 1;
2089 v19 = pWindowList[v3].pControlsHead;
2090 v25 = pWindowList[v3].pCurrentPosActiveItem;
2091 if ( v25 > (signed int)v1 )
2092 {
2093 do
2094 {
2095 v19 = v19->pNext;
2096 --v25;
2097 }
2098 while ( v25 );
2099 }
2100 v21 = v19->uControlParam;
2101 /*if ( (signed int)v2 < 40 )
2102 {
2103 pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v19->uControlID;
2104 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v21;
2105 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
2106 ++pMessageQueue_50CBD0->uNumMessages;
2107 }*/
2108 pMessageQueue_50CBD0->AddMessage((UIMessageType)v19->uControlID, v21, v1);
2109 return 1;
2110 }
2111 case VK_NEXT:
2112 {
2113 if ( pWindowList[v3].field_30 != v1 )
2114 {
2115 pMouse->GetClickPos(&uClickX, &uClickY);
2116 v4 = pWindowList[v3].pStartingPosActiveItem;
2117 v29 = v4 + pWindowList[v3].pNumPresenceButton;
2118 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton )
2119 {
2120 while ( 1 )
2121 {
2122 v14 = pWindowList[v3].pControlsHead;
2123 if ( v4 > 0 )
2124 {
2125 v15 = v4;
2126 do
2127 {
2128 v14 = v14->pNext;
2129 --v15;
2130 }
2131 while ( v15 );
2132 }
2133 if ( (signed int)uClickX >= (signed int)v14->uX
2134 && (signed int)uClickX <= (signed int)v14->uZ
2135 && (signed int)uClickY >= (signed int)v14->uY
2136 && (signed int)uClickY <= (signed int)v14->uW )
2137 {
2138 pWindowList[v3].pCurrentPosActiveItem = v4;
2139 return 1;
2140 }
2141 ++v4;
2142 if ( v4 >= v29 )
2143 {
2144 v1 = 0;
2145 v2 = pMessageQueue_50CBD0->uNumMessages;
2146 break;
2147 }
2148 }
2149 }
2150 else
2151 {
2152 v2 = pMessageQueue_50CBD0->uNumMessages;
2153 }
2154 }
2155 break;
2156 }
2157 default:
2158 {
2159 break;
2160 }
2161
2162 }
2163 }
1996 --v27; 2164 --v27;
1997 if ( v27 < 0 ) 2165 if ( v27 < 0 )
1998 return 0; 2166 return 0;
1999 } 2167 }
2000 if ( v26 == 37 ) 2168
2001 {
2002 v12 = pWindowList[v3].field_34;
2003 if ( pWindowList[v3].pCurrentPosActiveItem - pWindowList[v3].pStartingPosActiveItem - v12 >= 0 )
2004 {
2005 v8 = pCurrentScreen == SCREEN_PARTY_CREATION;
2006 pWindowList[v3].pCurrentPosActiveItem -= v12;
2007 if ( v8 )
2008 {
2009 pAudioPlayer->PlaySound(SOUND_Button, v1, v1, -1, v1, v1, v1, v1);
2010 v2 = pMessageQueue_50CBD0->uNumMessages;
2011 }
2012 }
2013 if ( pWindowList[v3].field_30 != v1 )
2014 goto LABEL_47;
2015 v9 = pWindowList[v3].pControlsHead;
2016 v13 = pWindowList[v3].pCurrentPosActiveItem;
2017 if ( v13 > (signed int)v1 )
2018 {
2019 do
2020 {
2021 v9 = v9->pNext;
2022 --v13;
2023 }
2024 while ( v13 );
2025 }
2026 LABEL_26:
2027 v11 = v9->uControlParam;
2028 /*if ( (signed int)v2 < 40 )
2029 {
2030 pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v9->uControlID;
2031 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v11;
2032 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
2033 v2 = pMessageQueue_50CBD0->uNumMessages + 1;
2034 ++pMessageQueue_50CBD0->uNumMessages;
2035 }*/
2036 pMessageQueue_50CBD0->AddMessage((UIMessageType)v9->uControlID, v11, v1);
2037 goto LABEL_47;
2038 }
2039 if ( v26 != 38 )
2040 {
2041 if ( v26 == 39 )
2042 {
2043 v7 = pWindowList[v3].pCurrentPosActiveItem + pWindowList[v3].field_34;
2044 if ( v7 < pWindowList[v3].pNumPresenceButton + pWindowList[v3].pStartingPosActiveItem )
2045 {
2046 v8 = pCurrentScreen == SCREEN_PARTY_CREATION;
2047 pWindowList[v3].pCurrentPosActiveItem = v7;
2048 if ( v8 )
2049 {
2050 pAudioPlayer->PlaySound(SOUND_Button, v1, v1, -1, v1, v1, v1, v1);
2051 v2 = pMessageQueue_50CBD0->uNumMessages;
2052 }
2053 }
2054 if ( pWindowList[v3].field_30 != v1 )
2055 goto LABEL_47;
2056 v9 = pWindowList[v3].pControlsHead;
2057 v10 = pWindowList[v3].pCurrentPosActiveItem;
2058 if ( v10 > (signed int)v1 )
2059 {
2060 do
2061 {
2062 v9 = v9->pNext;
2063 --v10;
2064 }
2065 while ( v10 );
2066 }
2067 goto LABEL_26;
2068 }
2069 if ( v26 == 40 )
2070 {
2071 v17 = pWindowList[v3].pStartingPosActiveItem;
2072 v18 = pWindowList[v3].pCurrentPosActiveItem;
2073 if ( v18 >= pWindowList[v3].pNumPresenceButton + v17 - 1 )
2074 pWindowList[v3].pCurrentPosActiveItem = v17;
2075 else
2076 pWindowList[v3].pCurrentPosActiveItem = v18 + 1;
2077 if ( pWindowList[v3].field_30 != v1 )
2078 return 1;
2079 v19 = pWindowList[v3].pControlsHead;
2080 v20 = pWindowList[v3].pCurrentPosActiveItem;
2081 if ( v20 > (signed int)v1 )
2082 {
2083 do
2084 {
2085 v19 = v19->pNext;
2086 --v20;
2087 }
2088 while ( v20 );
2089 }
2090 goto LABEL_56;
2091 }
2092 if ( v26 == 41 )
2093 {
2094 pMouse->GetClickPos(&uClickX, &uClickY);
2095 v4 = pWindowList[v3].pStartingPosActiveItem;
2096 v28 = v4 + pWindowList[v3].pNumPresenceButton;
2097 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton )
2098 {
2099 while ( 1 )
2100 {
2101 v5 = pWindowList[v3].pControlsHead;
2102 if ( v4 > 0 )
2103 {
2104 v6 = v4;
2105 do
2106 {
2107 v5 = v5->pNext;
2108 --v6;
2109 }
2110 while ( v6 );
2111 }
2112 if ( (signed int)uClickX >= (signed int)v5->uX
2113 && (signed int)uClickX <= (signed int)v5->uZ
2114 && (signed int)uClickY >= (signed int)v5->uY
2115 && (signed int)uClickY <= (signed int)v5->uW )
2116 break;
2117 ++v4;
2118 if ( v4 >= v28 )
2119 goto LABEL_45;
2120 }
2121 LABEL_66:
2122 pWindowList[v3].pCurrentPosActiveItem = v4;
2123 return 1;
2124 }
2125 LABEL_46:
2126 v2 = pMessageQueue_50CBD0->uNumMessages;
2127 goto LABEL_47;
2128 }
2129 goto LABEL_47;
2130 }
2131 v22 = pWindowList[v3].pCurrentPosActiveItem;
2132 v23 = pWindowList[v3].pStartingPosActiveItem;
2133 if ( v22 <= v23 )
2134 v24 = pWindowList[v3].pNumPresenceButton + v23 - 1;
2135 else
2136 v24 = v22 - 1;
2137 v8 = pWindowList[v3].field_30 == v1;
2138 pWindowList[v3].pCurrentPosActiveItem = v24;
2139 if ( !v8 )
2140 return 1;
2141 v19 = pWindowList[v3].pControlsHead;
2142 v25 = pWindowList[v3].pCurrentPosActiveItem;
2143 if ( v25 > (signed int)v1 )
2144 {
2145 do
2146 {
2147 v19 = v19->pNext;
2148 --v25;
2149 }
2150 while ( v25 );
2151 }
2152 LABEL_56:
2153 v21 = v19->uControlParam;
2154 /*if ( (signed int)v2 < 40 )
2155 {
2156 pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v19->uControlID;
2157 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v21;
2158 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1;
2159 ++pMessageQueue_50CBD0->uNumMessages;
2160 }*/
2161 pMessageQueue_50CBD0->AddMessage((UIMessageType)v19->uControlID, v21, v1);
2162 return 1;
2163 } 2169 }
2164 2170
2165 //----- (0041D20D) -------------------------------------------------------- 2171 //----- (0041D20D) --------------------------------------------------------
2166 char __fastcall sub_41D20D_buff_remaining_time_string(int ecx0, GUIWindow *edx0, __int64 a3, GUIFont *a2) 2172 char __fastcall sub_41D20D_buff_remaining_time_string(int ecx0, GUIWindow *edx0, __int64 a3, GUIFont *a2)
2167 { 2173 {
2231 return a1->DrawText(a2, 32, uY, 0, pTmpBuf, 0, 0, 0); 2237 return a1->DrawText(a2, 32, uY, 0, pTmpBuf, 0, 0, 0);
2232 } 2238 }
2233 2239
2234 2240
2235 //----- (0041D895) -------------------------------------------------------- 2241 //----- (0041D895) --------------------------------------------------------
2236 void GameUI_DrawItemInfo(ItemGen *ecx0) 2242 void GameUI_DrawItemInfo( struct ItemGen* inspect_item )
2237 { 2243 {
2238 ItemGen *v1; // esi@1 2244 ItemGen *v1; // esi@1
2239 unsigned int v2; // eax@3 2245 unsigned int v2; // eax@3
2240 //char *v3; // edi@5 2246 //char *v3; // edi@5
2241 //unsigned int v4; // eax@5 2247 //unsigned int v4; // eax@5
2242 //unsigned int v5; // esi@5 2248 //unsigned int v5; // esi@5
2243 signed int v6; // eax@5 2249 signed int v6; // eax@5
2244 int v7; // edx@5 2250 int v7; // edx@5
2245 ItemGen *v8; // ecx@10
2246 //unsigned int v9; // eax@12 2251 //unsigned int v9; // eax@12
2247 char v10; // zf@16 2252 char v10; // zf@16
2248 ItemGen *v11; // eax@16 2253 ItemGen *v11; // eax@16
2249 ItemGen *v12; // eax@25 2254 ItemGen *v12; // eax@25
2250 //unsigned int v13; // ecx@32 2255 //unsigned int v13; // ecx@32
2262 int v25; // eax@57 2267 int v25; // eax@57
2263 int v26; // eax@60 2268 int v26; // eax@60
2264 int v27; // eax@67 2269 int v27; // eax@67
2265 const char *v28; // edi@69 2270 const char *v28; // edi@69
2266 int v29; // eax@70 2271 int v29; // eax@70
2267 char *v30; // edi@78 2272 char v30; // edi@78
2268 const char *v31; // eax@78 2273 const char *v31; // eax@78
2269 int v32; // ecx@81 2274 int v32; // ecx@81
2270 unsigned int v33; // eax@81 2275 unsigned int v33; // eax@81
2271 int v34; // esi@81 2276 int v34; // esi@81
2272 const char *v35; // eax@85 2277 const char *v35; // eax@85
2294 unsigned int v57; // [sp-8h] [bp-280h]@36 2299 unsigned int v57; // [sp-8h] [bp-280h]@36
2295 //int v58; // [sp-8h] [bp-280h]@46 2300 //int v58; // [sp-8h] [bp-280h]@46
2296 int v59; // [sp-8h] [bp-280h]@56 2301 int v59; // [sp-8h] [bp-280h]@56
2297 int v60; // [sp-8h] [bp-280h]@58 2302 int v60; // [sp-8h] [bp-280h]@58
2298 unsigned int v61; // [sp-8h] [bp-280h]@110 2303 unsigned int v61; // [sp-8h] [bp-280h]@110
2299 char a1[300]; // [sp+8h] [bp-270h]@40 2304 char out_text[300]; // [sp+8h] [bp-270h]@40
2300 //char Dest[100]; // [sp+6Ch] [bp-20Ch]@40 2305 //char Dest[100]; // [sp+6Ch] [bp-20Ch]@40
2301 //char v64[100]; // [sp+D0h] [bp-1A8h]@40 2306 //char v64[100]; // [sp+D0h] [bp-1A8h]@40
2302 char v65[120]; // [sp+134h] [bp-144h]@92 2307 char v65[120]; // [sp+134h] [bp-144h]@92
2303 char Source[40]; // [sp+1ACh] [bp-CCh]@49 2308 char Source[40]; // [sp+1ACh] [bp-CCh]@49
2304 stru351_summoned_item v67; 2309 stru351_summoned_item v67;
2312 Texture *v73; // [sp+1F4h] [bp-84h]@5 2317 Texture *v73; // [sp+1F4h] [bp-84h]@5
2313 //unsigned int v75; // [sp+1F8h] [bp-80h]@5 2318 //unsigned int v75; // [sp+1F8h] [bp-80h]@5
2314 //char *v76; // [sp+1FCh] [bp-7Ch]@5 2319 //char *v76; // [sp+1FCh] [bp-7Ch]@5
2315 int v77; // [sp+200h] [bp-78h]@12 2320 int v77; // [sp+200h] [bp-78h]@12
2316 int v78; // [sp+204h] [bp-74h]@5 2321 int v78; // [sp+204h] [bp-74h]@5
2317 GUIWindow v79; // [sp+208h] [bp-70h]@2 2322 GUIWindow wHintWindow; // [sp+208h] [bp-70h]@2
2318 POINT a2; // [sp+25Ch] [bp-1Ch]@2 2323 POINT a2; // [sp+25Ch] [bp-1Ch]@2
2319 int v81; // [sp+264h] [bp-14h]@5 2324 int v81; // [sp+264h] [bp-14h]@5
2320 GUIFont *v82; // [sp+268h] [bp-10h]@1 2325 // GUIFont *pFontComic; // [sp+268h] [bp-10h]@1
2321 char *v83; // [sp+26Ch] [bp-Ch]@18 2326 PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18
2327 char* v84;
2328 int v85;
2322 char *Str; // [sp+270h] [bp-8h]@65 2329 char *Str; // [sp+270h] [bp-8h]@65
2323 ItemGen *_this; // [sp+274h] [bp-4h]@1 2330
2324 2331 v1 = inspect_item;
2325 v1 = ecx0;
2326 _this = ecx0;
2327 var88 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); 2332 var88 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu);
2328 v82 = pFontComic; 2333 if (!inspect_item->uItemID)
2329 if (!v1->uItemID)
2330 return; 2334 return;
2331 2335
2332 v79.Hint = 0; 2336 wHintWindow.Hint = 0;
2333 v79.uFrameWidth = 384; 2337 wHintWindow.uFrameWidth = 384;
2334 v79.uFrameHeight = 180; 2338 wHintWindow.uFrameHeight = 180;
2335 v79.uFrameY = 40; 2339 wHintWindow.uFrameY = 40;
2336 if ( pMouse->GetCursorPos(&a2)->x <= 320 ) 2340 if ( pMouse->GetCursorPos(&a2)->x <= 320 )
2337 v2 = pMouse->GetCursorPos(&a2)->x + 30; 2341 v2 = pMouse->GetCursorPos(&a2)->x + 30;
2338 else 2342 else
2339 v2 = pMouse->GetCursorPos(&a2)->x - v79.uFrameWidth - 30; 2343 v2 = pMouse->GetCursorPos(&a2)->x - wHintWindow.uFrameWidth - 30;
2340 v79.uFrameX = v2; 2344 wHintWindow.uFrameX = v2;
2341 auto item_desc = &pItemsTable->pItems[_this->uItemID]; 2345 auto item_desc = &pItemsTable->pItems[inspect_item->uItemID];
2342 //v3 = (char *)&pItemsTable->pItems[_this->uItemID].pIconName; 2346 //v3 = (char *)&pItemsTable->pItems[_this->uItemID].pIconName;
2343 //v76 = v3; 2347 //v76 = v3;
2344 //v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[_this->uItemID].pIconName, TEXTURE_16BIT_PALETTE); 2348 //v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[_this->uItemID].pIconName, TEXTURE_16BIT_PALETTE);
2345 //v5 = v4; 2349 //v5 = v4;
2346 //v4 *= 72; 2350 //v4 *= 72;
2355 v78 = v6 >> 1; 2359 v78 = v6 >> 1;
2356 if ( v81 <= 0 ) 2360 if ( v81 <= 0 )
2357 v81 = 0; 2361 v81 = 0;
2358 else 2362 else
2359 v81 >>= 1; 2363 v81 >>= 1;
2360 v8 = _this;
2361 if ( !item_desc->uItemID_Rep_St ) 2364 if ( !item_desc->uItemID_Rep_St )
2362 _this->SetIdentified(); 2365 inspect_item->SetIdentified();
2363 //v9 = v8->uAttributes; 2366 //v9 = v8->uAttributes;
2364 v77 = 0; 2367 v77 = 0;
2365 //a2.y = v8->uAttributes & 2; 2368 //a2.y = v8->uAttributes & 2;
2366 if (pItemsTable->pItems[v8->uItemID].uEquipType == EQUIP_GOLD) 2369 if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_GOLD)
2367 v77 = v8->uSpecEnchantmentType; 2370 v77 = inspect_item->uSpecEnchantmentType;
2368 if ( uActiveCharacter ) 2371 if ( uActiveCharacter )
2369 { 2372 {
2370 if (!v8->Identified()) 2373 //try to identify
2371 { 2374 if (!inspect_item->Identified())
2372 v10 = pPlayers[uActiveCharacter]->CanIdentify(_this) == 1; 2375 {
2373 v11 = _this; 2376
2374 if ( v10 ) 2377 v11 = inspect_item;
2375 _this->SetIdentified(); 2378 if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 )
2376 v10 = !v11->Identified(); 2379 inspect_item->SetIdentified();
2377 v83 = (char *)9; 2380 v83 = SPEECH_9;
2378 if ( v10 ) 2381 if ( !inspect_item->Identified() )
2379 { 2382 {
2380 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u); 2383 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u);//"Identify Failed"
2381 } 2384 }
2382 else 2385 else
2383 { 2386 {
2384 v83 = (char *)SPEECH_8; 2387 v83 = SPEECH_8;
2385 if ( _this->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) 2388 if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) )
2386 v83 = (char *)SPEECH_7; 2389 v83 = SPEECH_7;
2387 } 2390 }
2388 if ( dword_4E455C ) 2391 if ( dword_4E455C )
2389 { 2392 {
2390 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); 2393 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0);
2391 dword_4E455C = 0; 2394 dword_4E455C = 0;
2392 } 2395 }
2393 } 2396 }
2394 _this->UpdateTempBonus(pParty->uTimePlayed); 2397 inspect_item->UpdateTempBonus(pParty->uTimePlayed);
2395 if (v8->Broken()) 2398 if (inspect_item->Broken())
2396 { 2399 {
2397 v10 = pPlayers[uActiveCharacter]->CanRepair(_this) == 1; 2400 if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 )
2398 v12 = _this; 2401 inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1;
2399 if ( v10 ) 2402 v83 = SPEECH_11;
2400 _this->uAttributes = _this->uAttributes & 0xFFFFFFFD | 1; 2403 if ( !inspect_item->Broken() )
2401 v10 = !v12->Broken(); 2404 v83 = SPEECH_10;
2402 v83 = (char *)SPEECH_11;
2403 if ( v10 )
2404 v83 = (char *)SPEECH_10;
2405 else 2405 else
2406 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u); 2406 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u);//"Repair Failed"
2407 if ( dword_4E455C ) 2407 if ( dword_4E455C )
2408 { 2408 {
2409 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); 2409 pPlayers[uActiveCharacter]->PlaySound(v83, 0);
2410 dword_4E455C = 0; 2410 dword_4E455C = 0;
2411 } 2411 }
2412 } 2412 }
2413 } 2413 }
2414 //v13 = _this->uAttributes; 2414 //v13 = _this->uAttributes;
2415 //v14 = _this->Identified(); 2415 //v14 = _this->Identified();
2416 a2.y = _this->Identified(); 2416 //a2.y = inspect_item->Identified();
2417 if (_this->Broken()) 2417 if (inspect_item->Broken())
2418 { 2418 {
2419 v79.DrawMessageBox(0); 2419 wHintWindow.DrawMessageBox(0);
2420 //v15 = &; 2420 //v15 = &;
2421 pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12, 2421 pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12,
2422 v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12); 2422 wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12,
2423 v79.uFrameWidth -= 24; 2423 wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12);
2424 v79.uFrameHeight -= 12; 2424 wHintWindow.uFrameWidth -= 24;
2425 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; 2425 wHintWindow.uFrameHeight -= 12;
2426 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; 2426 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1;
2427 pRenderer->DrawTransparentRedShade(v79.uFrameX + v78, v81 + v79.uFrameY + 30, v73); 2427 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1;
2428 if ( a2.y ) 2428 pRenderer->DrawTransparentRedShade(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73);
2429 v16 = _this->GetIdentifiedName(); 2429 if ( inspect_item->Identified())
2430 v16 = inspect_item->GetIdentifiedName();
2430 else 2431 else
2431 v16 = item_desc->pUnidentifiedName; 2432 v16 = item_desc->pUnidentifiedName;
2432 v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u); 2433 wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u);
2433 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &v79, 0, 0); 2434 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &wHintWindow, 0, 0); //"Broken Item"
2434 v57 = 3;
2435 v52 = pGlobalTXT_LocalizationStrings[32];
2436 goto LABEL_37;
2437 }
2438 if (!_this->Identified())
2439 {
2440 v79.DrawMessageBox(0);
2441 //v15 = pRenderer;
2442 pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12,
2443 v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12);
2444 v79.uFrameWidth -= 24;
2445 v79.uFrameHeight -= 12;
2446 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1;
2447 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1;
2448 pRenderer->DrawTextureTransparent(v79.uFrameX + v78, v81 + v79.uFrameY + 30, v73);
2449 v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, item_desc->pUnidentifiedName, 3u);
2450 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &v79, 0, 0);
2451 v57 = 3;
2452 v52 = pGlobalTXT_LocalizationStrings[232];
2453 LABEL_37:
2454 v18 = v17 >> 1; 2435 v18 = v17 >> 1;
2455 v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); 2436 v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u);
2456 v79.DrawTitleText(pFontArrus, 0x64u, ((signed int)v79.uFrameHeight >> 1) - v18, v19, v52, v57); 2437 wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item"
2457 goto LABEL_116; 2438 pRenderer->ResetClip();
2458 } 2439 if ( !areWeLoadingTexture )
2459 2440 {
2460 sprintfex(a1, pGlobalTXT_LocalizationStrings[463], item_desc->pUnidentifiedName); 2441 v73->Release();
2461 a1[100] = 0; 2442 pIcons_LOD->_40F9C5();
2462 a1[200] = 0; 2443 }
2444 return;
2445 }
2446 if (!inspect_item->Identified())
2447 {
2448 wHintWindow.DrawMessageBox(0);
2449 pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12,
2450 wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12,
2451 wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12);
2452 wHintWindow.uFrameWidth -= 24;
2453 wHintWindow.uFrameHeight -= 12;
2454 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1;
2455 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1;
2456 pRenderer->DrawTextureTransparent(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73);
2457 wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, item_desc->pUnidentifiedName, 3u);
2458 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &wHintWindow, 0, 0); ///"Not Identified"
2459 v18 = v17 >> 1;
2460 v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u);
2461 wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[232], 3);
2462 pRenderer->ResetClip();
2463 if ( !areWeLoadingTexture )
2464 {
2465 v73->Release();
2466 pIcons_LOD->_40F9C5();
2467 }
2468 return;
2469 }
2470
2471 sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], item_desc->pUnidentifiedName); //"Type: %s"
2472 out_text[100] = 0;
2473 out_text[200] = 0;
2463 //v20 = item_desc->uEquipType; 2474 //v20 = item_desc->uEquipType;
2464 switch (item_desc->uEquipType) 2475 switch (item_desc->uEquipType)
2465 { 2476 {
2466 case EQUIP_ONE_OR_TWO_HANDS: 2477 case EQUIP_ONE_OR_TWO_HANDS:
2467 case EQUIP_TWO_HANDED: 2478 case EQUIP_TWO_HANDED:
2468 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); 2479 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK],
2480 (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); //"Damage"
2469 if (item_desc->uDamageMod) 2481 if (item_desc->uDamageMod)
2470 { 2482 {
2471 char mod[16]; 2483 char mod[16];
2472 sprintf(mod, "+%d", (int)item_desc->uDamageMod); 2484 sprintf(mod, "+%d", (int)item_desc->uDamageMod);
2473 strcat(a1 + 100, mod); 2485 strcat(out_text + 100, mod);
2474 } 2486 }
2475 break; 2487 break;
2476 2488
2477 case EQUIP_BOW: 2489 case EQUIP_BOW:
2478 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); 2490 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot"
2491 (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], //"Damage"
2492 (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll);
2479 if (item_desc->uDamageMod) 2493 if (item_desc->uDamageMod)
2480 { 2494 {
2481 char mod[16]; 2495 char mod[16];
2482 sprintf(mod, "+%d", (int)item_desc->uDamageMod); 2496 sprintf(mod, "+%d", (int)item_desc->uDamageMod);
2483 strcat(a1 + 100, mod); 2497 strcat(out_text + 100, mod);
2484 } 2498 }
2485 break; 2499 break;
2486 2500
2487 case EQUIP_ARMOUR: 2501 case EQUIP_ARMOUR:
2488 case EQUIP_SHIELD: 2502 case EQUIP_SHIELD:
2491 case EQUIP_CLOAK: 2505 case EQUIP_CLOAK:
2492 case EQUIP_GAUNTLETS: 2506 case EQUIP_GAUNTLETS:
2493 case EQUIP_BOOTS: 2507 case EQUIP_BOOTS:
2494 case EQUIP_RING: 2508 case EQUIP_RING:
2495 case EQUIP_AMULET: 2509 case EQUIP_AMULET:
2496 if (item_desc->uDamageDice) 2510 if (item_desc->uDamageDice) //"Armor"
2497 sprintfex(a1 + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod); 2511 sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod);
2498 break; 2512 break;
2499 } 2513 case EQUIP_POTION:
2500 2514 if ( inspect_item->uEncantmentType )
2501 if ( v77 ) 2515 sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEncantmentType); //"Power"
2502 goto LABEL_65; 2516 break;
2517 case EQUIP_REAGENT:
2518 sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power"
2519 break;
2520 }
2521
2522 if ( !v77 )
2523 {
2503 //v23 = item_desc->uEquipType; 2524 //v23 = item_desc->uEquipType;
2504 if (item_desc->uEquipType == 14) 2525 if ( inspect_item->uEncantmentType )
2505 { 2526 {
2506 v24 = _this->uEncantmentType; 2527 sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210],
2507 if ( v24 ) 2528 pItemsTable->pEnchantments[inspect_item->uEncantmentType-1].pBonusStat, inspect_item->_bonus_strength); //"Special"
2508 goto LABEL_56; 2529 }
2509 LABEL_65: 2530 else if ( inspect_item->uSpecEnchantmentType )
2510 v79.uFrameWidth -= 12; 2531 {
2511 a2.y = 3; 2532 sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210],
2512 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; 2533 pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement, inspect_item->_bonus_strength);
2513 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; 2534 }
2514 Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); 2535
2515 v83 = a1; 2536 else if ( inspect_item->uNumCharges )
2516 do 2537 {
2517 { 2538 sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges"
2518 if ( *v83 ) 2539
2540 }
2541 }
2542 wHintWindow.uFrameWidth -= 12;
2543 v85 = 3;
2544 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1;
2545 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1;
2546 Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8));
2547 v84 = &out_text[0];
2548 do
2519 { 2549 {
2520 v27 = v82->CalcTextHeight(v83, &v79, 100, 0); 2550 if ( *v84 )
2521 Str += v27 + 3; 2551 {
2552 v27 = pFontComic->CalcTextHeight(v84, &wHintWindow, 100, 0);
2553 Str += v27 + 3;
2554 }
2555 v84 += 100;
2556 --v85;
2522 } 2557 }
2523 v83 += 100; 2558 while ( v85 );
2524 --a2.y; 2559 v28 = item_desc->pDescription;
2525 } 2560 if ( *v28 )
2526 while ( a2.y ); 2561 {
2527 v28 = item_desc->pDescription; 2562 v29 = pFontSmallnum->CalcTextHeight(v28, &wHintWindow, 100, 0);
2528 if ( *v28 ) 2563 Str += v29;
2529 { 2564 }
2530 v29 = pFontSmallnum->CalcTextHeight(v28, &v79, 100, 0); 2565 wHintWindow.uFrameHeight = v73->uTextureHeight + v81 + 54;
2531 Str += v29; 2566 if ( (signed int)Str > (signed int)wHintWindow.uFrameHeight )
2532 } 2567 wHintWindow.uFrameHeight = (unsigned int)Str;
2533 v79.uFrameHeight = v73->uTextureHeight + v81 + 54; 2568 if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEncantmentType) )
2534 if ( (signed int)Str > (signed int)v79.uFrameHeight ) 2569 wHintWindow.uFrameHeight += LOBYTE(pFontComic->uFontHeight);
2535 v79.uFrameHeight = (unsigned int)Str; 2570 v85 = 0;
2536 if ( _this->uAttributes & 8 && (_this->uSpecEnchantmentType || _this->uEncantmentType) ) 2571 if ( pFontArrus->uFontHeight )
2537 v79.uFrameHeight += LOBYTE(v82->uFontHeight); 2572 {
2538 v83 = 0; 2573 wHintWindow.uFrameWidth -= 24;
2539 if ( LOBYTE(pFontArrus->uFontHeight) ) 2574 v30 = pFontArrus->uFontHeight;
2540 { 2575 v31 = inspect_item->GetIdentifiedName();
2541 v79.uFrameWidth -= 24; 2576 if ( pFontArrus->CalcTextHeight(v31, &wHintWindow, 0, 0) / (signed int)v30 )
2542 v30 = (char *)LOBYTE(pFontArrus->uFontHeight); 2577 v85 = v30;
2543 v31 = _this->GetIdentifiedName(); 2578 wHintWindow.uFrameWidth += 24;
2544 if ( pFontArrus->CalcTextHeight(v31, &v79, 0, 0) / (signed int)v30 ) 2579 }
2545 v83 = v30; 2580 wHintWindow.uFrameWidth += 12;
2546 v79.uFrameWidth += 24; 2581 wHintWindow.uFrameHeight += (unsigned int)v85;
2547 } 2582 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1;
2548 v79.uFrameWidth += 12; 2583 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1;
2549 v79.uFrameHeight += (unsigned int)v83; 2584 wHintWindow.DrawMessageBox(0);
2550 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; 2585 //v15 = pRenderer;
2551 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; 2586 pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12,
2552 v79.DrawMessageBox(0); 2587 wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12);
2553 //v15 = pRenderer; 2588 wHintWindow.uFrameWidth -= 12;
2554 pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12, 2589 v32 = v73->uTextureHeight;
2555 v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12); 2590 v33 = wHintWindow.uFrameHeight;
2556 v79.uFrameWidth -= 12; 2591 wHintWindow.uFrameHeight -= 12;
2557 v32 = v73->uTextureHeight; 2592 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1;
2558 v33 = v79.uFrameHeight; 2593 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1;
2559 v79.uFrameHeight -= 12; 2594 pRenderer->DrawTextureTransparent(
2560 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; 2595 wHintWindow.uFrameX + v78,
2561 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; 2596 wHintWindow.uFrameY + (signed int)(v33 - v32) / 2,
2562 pRenderer->DrawTextureTransparent( 2597 v73);
2563 v79.uFrameX + v78, 2598
2564 v79.uFrameY + (signed int)(v33 - v32) / 2, 2599 v34 = (int)(v85 + 35);
2565 v73); 2600 v85 = 3;
2566 a2.y = 3; 2601 Str = out_text;
2567 v34 = (int)(v83 + 35); 2602 do
2568 Str = a1; 2603 {
2569 do 2604 if ( *Str )
2570 { 2605 {
2571 if ( *Str ) 2606 wHintWindow.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0);
2572 { 2607 v34 += pFontComic->CalcTextHeight(Str, &wHintWindow, 100, 0) + 3;
2573 v79.DrawText(v82, 100, v34, 0, Str, 0, 0, 0); 2608 }
2574 v34 += v82->CalcTextHeight(Str, &v79, 100, 0) + 3; 2609 Str += 100;
2575 } 2610 --v85;
2576 Str += 100; 2611 }
2577 --a2.y; 2612 while (v85 );
2578 } 2613 v35 = item_desc->pDescription;
2579 while ( a2.y ); 2614 if ( *v35 )
2580 v35 = item_desc->pDescription; 2615 wHintWindow.DrawText(pFontSmallnum, 100, v34, 0, v35, 0, 0, 0);
2581 if ( *v35 ) 2616 wHintWindow.uFrameX += 12;
2582 v79.DrawText(pFontSmallnum, 100, v34, 0, v35, 0, 0, 0); 2617 wHintWindow.uFrameWidth -= 24;
2583 v79.uFrameX += 12; 2618 v36 = inspect_item->GetIdentifiedName();
2584 v79.uFrameWidth -= 24; 2619 wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v36, 3u);
2585 v36 = _this->GetIdentifiedName(); 2620 wHintWindow.uFrameWidth += 24;
2586 v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, v36, 3u); 2621 wHintWindow.uFrameX -= 12;
2587 v79.uFrameWidth += 24; 2622 if ( v77 )
2588 v79.uFrameX -= 12; 2623 {
2589 if ( v77 ) 2624 sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value"
2590 { 2625 v40 = pFontComic;
2591 sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77); 2626 v61 = 0;
2592 v40 = v82; 2627 v56 = 0;
2593 v61 = 0; 2628 v51 = 0;
2594 v56 = 0; 2629 v47 = pTmpBuf;
2595 v51 = 0; 2630 v44 = 0;
2596 v47 = pTmpBuf; 2631 v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight);
2597 v44 = 0; 2632 v41 = 100;
2598 v42 = v79.uFrameHeight - LOBYTE(v82->uFontHeight); 2633 }
2599 v41 = 100; 2634 else
2600 } 2635 {
2601 else 2636 if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEncantmentType) )
2602 { 2637 {
2603 if ( _this->uAttributes & 8 && (_this->uSpecEnchantmentType || _this->uEncantmentType) ) 2638 sub_493F79(&v67, inspect_item->uExpireTime - pParty->uTimePlayed);
2604 { 2639 strcpy(pTmpBuf, "Duration:");
2605 sub_493F79(&v67, _this->uExpireTime - pParty->uTimePlayed); 2640 Str = (char *)(v67.field_18_expire_year - game_starting_year);
2606 strcpy(pTmpBuf, "Duration:"); 2641 if (v67.field_18_expire_year != 1168 )
2607 Str = (char *)(v67.field_18_expire_year - game_starting_year); 2642 {
2608 if (v67.field_18_expire_year != 1168 ) 2643 sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year);
2609 { 2644 strcat(pTmpBuf, v65);
2610 sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year); 2645 }
2611 strcat(pTmpBuf, v65); 2646 if ( (((v67.field_14_exprie_month || Str) &&
2612 } 2647 ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str)
2613 if ( (((v67.field_14_exprie_month || Str) && ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str) || v67.field_C_expire_day) 2648 || v67.field_C_expire_day)
2614 && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || v67.field_C_expire_day) 2649 && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str ||
2615 || v67.field_8_expire_hour) 2650 v67.field_C_expire_day)
2616 && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || v67.field_C_expire_day || v67.field_8_expire_hour) 2651 || v67.field_8_expire_hour)
2617 || v67.field_4_expire_minute ) 2652 && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str ||
2618 { 2653 v67.field_C_expire_day || v67.field_8_expire_hour)
2619 sprintf(v65, " %d:mn", v67.field_4_expire_minute); 2654 || v67.field_4_expire_minute )
2620 strcat(pTmpBuf, v65); 2655 {
2621 } 2656 sprintf(v65, " %d:mn", v67.field_4_expire_minute);
2622 v79.DrawText(v82, 100, v79.uFrameHeight - 2 * LOBYTE(v82->uFontHeight), 0, pTmpBuf, 0, 0, 0); 2657 strcat(pTmpBuf, v65);
2623 } 2658 }
2624 v37 = _this->GetValue(); 2659 wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0);
2625 sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37); 2660 }
2626 v79.DrawText(v82, 100, v79.uFrameHeight - LOBYTE(v82->uFontHeight), 0, pTmpBuf, 0, 0, 0); 2661 v37 = inspect_item->GetValue();
2627 v38 = _this->uAttributes; 2662 sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37);
2628 if ( BYTE1(v38) & 1 ) 2663 wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0);
2629 { 2664 v38 = inspect_item->uAttributes;
2630 v61 = 0; 2665 if ( BYTE1(v38) & 1 )
2631 v56 = 0; 2666 {
2632 v51 = 0; 2667 v61 = 0;
2633 v47 = pGlobalTXT_LocalizationStrings[187]; 2668 v56 = 0;
2634 } 2669 v51 = 0;
2635 else 2670 v47 = pGlobalTXT_LocalizationStrings[187]; //"Stolen"
2636 { 2671 }
2637 if ( !(BYTE1(v38) & 2) ) 2672 else
2638 goto LABEL_116; 2673 {
2639 v61 = 0; 2674 if ( !(BYTE1(v38) & 2) )
2640 v56 = 0; 2675 {
2641 v51 = 0; 2676 pRenderer->ResetClip();
2642 v47 = pGlobalTXT_LocalizationStrings[651]; 2677 if ( !areWeLoadingTexture )
2643 } 2678 {
2644 LOWORD(v38) = LOWORD(pRenderer->uTargetRMask); 2679 v73->Release();
2645 v44 = v38; 2680 pIcons_LOD->_40F9C5();
2646 v42 = v79.uFrameHeight - LOBYTE(v82->uFontHeight); 2681 }
2647 v39 = v82->GetLineWidth(pTmpBuf); 2682 return;
2648 v40 = v82; 2683 }
2649 v41 = v39 + 132; 2684 v61 = 0;
2650 } 2685 v56 = 0;
2651 v79.DrawText(v40, v41, v42, v44, v47, v51, v56, v61); 2686 v51 = 0;
2652 LABEL_116: 2687 v47 = pGlobalTXT_LocalizationStrings[651]; //"Hardened"
2653 pRenderer->ResetClip(); 2688 }
2654 if ( !areWeLoadingTexture ) 2689 LOWORD(v38) = LOWORD(pRenderer->uTargetRMask);
2655 { 2690 v44 = v38;
2656 v73->Release(); 2691 v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight);
2657 pIcons_LOD->_40F9C5(); 2692 v39 = pFontComic->GetLineWidth(pTmpBuf);
2658 } 2693 v40 = pFontComic;
2659 return; 2694 v41 = v39 + 132;
2660 } 2695 }
2661 if (item_desc->uEquipType == 13) 2696 wHintWindow.DrawText(v40, v41, v42, v44, v47, v51, v56, v61);
2662 { 2697 pRenderer->ResetClip();
2663 v24 = pItemsTable->pItems[_this->uItemID].uDamageDice; 2698 if ( !areWeLoadingTexture )
2664 LABEL_56: 2699 {
2665 v59 = v24; 2700 v73->Release();
2666 v54 = pGlobalTXT_LocalizationStrings[449]; 2701 pIcons_LOD->_40F9C5();
2667 v49 = "%s: %d"; 2702 }
2668 LABEL_64: 2703 return;
2669 sprintf(a1 + 200, v49, v54, v59);
2670 goto LABEL_65;
2671 }
2672 v25 = _this->uEncantmentType;
2673 if ( v25 )
2674 {
2675 v60 = _this->_bonus_strength;
2676 v55 = *((int *)&pItemsTable->pItems[799].uDamageMod + 5 * v25);
2677 v50 = pGlobalTXT_LocalizationStrings[210];
2678 v46 = "%s: %s +%d";
2679 }
2680 else
2681 {
2682 v26 = _this->uSpecEnchantmentType;
2683 if ( !v26 )
2684 {
2685 if ( _this->uNumCharges )
2686 {
2687 v59 = _this->uNumCharges;
2688 v54 = pGlobalTXT_LocalizationStrings[464];
2689 v49 = "%s: %lu";
2690 goto LABEL_64;
2691 }
2692 goto LABEL_65;
2693 }
2694 v60 = _this->_bonus_strength;
2695 v55 = *((int *)&pItemsTable->pEnchantments[23].pBonusStat + 7 * v26);
2696 v50 = pGlobalTXT_LocalizationStrings[210];
2697 v46 = "%s: %s";
2698 }
2699 sprintf(a1 + 200, v46, v50, v55, v60);
2700 goto LABEL_65;
2701 } 2704 }
2702 // 4E455C: using guessed type int dword_4E455C; 2705 // 4E455C: using guessed type int dword_4E455C;
2703 // 506128: using guessed type int areWeLoadingTexture; 2706 // 506128: using guessed type int areWeLoadingTexture;
2707
2704 2708
2705 //----- (0041E360) -------------------------------------------------------- 2709 //----- (0041E360) --------------------------------------------------------
2706 char *__fastcall MonsterPopup_Draw(unsigned int uActorID, GUIWindow *edx0) 2710 char *__fastcall MonsterPopup_Draw(unsigned int uActorID, GUIWindow *edx0)
2707 { 2711 {
2708 unsigned int v2; // esi@1 2712 unsigned int v2; // esi@1
5313 } 5317 }
5314 else 5318 else
5315 { 5319 {
5316 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) 5320 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 )
5317 { 5321 {
5318 pParty->uFlags |= 8u; 5322 pParty->uFlags |= PARTY_FLAGS_1_FALLING;
5319 return; 5323 return;
5320 } 5324 }
5321 if ( uActiveCharacter 5325 if ( uActiveCharacter
5322 && sub_427769_spell(pPlayers[uActiveCharacter]->uQuickSpell)) 5326 && sub_427769_spell(pPlayers[uActiveCharacter]->uQuickSpell))
5323 { 5327 {
5378 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-C", 2); 5382 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-C", 2);
5379 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2); 5383 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2);
5380 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2); 5384 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2);
5381 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2); 5385 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2);
5382 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2); 5386 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2);
5383 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50796C], "isg-01-c", 2); 5387
5384 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507968], "isg-02-c", 2); 5388 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-c", 2);
5385 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507964], "isg-03-c", 2); 5389 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-c", 2);
5386 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507960], "isg-04-c", 2); 5390 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-c", 2);
5391 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-c", 2);
5392
5387 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); 5393 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC");
5388 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); 5394 pIconsFrameTable->InitializeAnimation(pUIAnim_WizardEye->uIconID);
5389 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); 5395 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC");
5390 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); 5396 pIconsFrameTable->InitializeAnimation(pUIAnum_Torchlight->uIconID);
5397
5391 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-c", 2); 5398 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-c", 2);
5392 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2); 5399 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2);
5393 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven-c", 2); 5400 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven-c", 2);
5394 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); 5401 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2);
5395 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-c", 2); 5402 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-c", 2);
5423 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE); 5430 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE);
5424 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE); 5431 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE);
5425 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE); 5432 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE);
5426 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE); 5433 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE);
5427 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE); 5434 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE);
5428 dword_50796C = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE); 5435 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE);
5429 dword_507968 = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE); 5436 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE);
5430 dword_507964 = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE); 5437 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE);
5431 dword_507960 = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE); 5438 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE);
5432 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE); 5439 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE);
5433 uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); 5440 uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE);
5434 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); 5441 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC");
5435 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); 5442 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
5436 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); 5443 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC");
5463 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-a", 2); 5470 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-a", 2);
5464 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2); 5471 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2);
5465 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2); 5472 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2);
5466 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2); 5473 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2);
5467 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2); 5474 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2);
5468 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50796C], "isg-01-a", 2); 5475 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-a", 2);
5469 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507968], "isg-02-a", 2); 5476 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-a", 2);
5470 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507964], "isg-03-a", 2); 5477 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-a", 2);
5471 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507960], "isg-04-a", 2); 5478 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-a", 2);
5472 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); 5479 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA");
5473 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); 5480 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
5474 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); 5481 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA");
5475 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); 5482 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID);
5476 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-a", 2); 5483 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-a", 2);
5508 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE); 5515 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE);
5509 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-a", TEXTURE_16BIT_PALETTE); 5516 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-a", TEXTURE_16BIT_PALETTE);
5510 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE); 5517 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE);
5511 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE); 5518 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE);
5512 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE); 5519 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE);
5513 dword_50796C = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE); 5520 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE);
5514 dword_507968 = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE); 5521 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE);
5515 dword_507964 = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE); 5522 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE);
5516 dword_507960 = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE); 5523 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE);
5517 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE); 5524 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE);
5518 uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); 5525 uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE);
5519 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); 5526 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA");
5520 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); 5527 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
5521 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); 5528 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA");
5559 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-B", 2); 5566 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-B", 2);
5560 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2); 5567 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2);
5561 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2); 5568 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2);
5562 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2); 5569 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2);
5563 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2); 5570 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2);
5564 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50796C], "isg-01-b", 2); 5571 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-b", 2);
5565 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507968], "isg-02-b", 2); 5572 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-b", 2);
5566 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507964], "isg-03-b", 2); 5573 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-b", 2);
5567 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507960], "isg-04-b", 2); 5574 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-b", 2);
5568 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeB"); 5575 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeB");
5569 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); 5576 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID);
5570 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB"); 5577 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB");
5571 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); 5578 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID);
5572 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-b", 2); 5579 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-b", 2);
5816 5823
5817 v79 = 0; 5824 v79 = 0;
5818 _50B924_view_transformed_xs[v1->uNumVertices] = _50B924_view_transformed_xs[0]; 5825 _50B924_view_transformed_xs[v1->uNumVertices] = _50B924_view_transformed_xs[0];
5819 _50B834_view_transformed_zs[v1->uNumVertices] = _50B834_view_transformed_zs[0]; 5826 _50B834_view_transformed_zs[v1->uNumVertices] = _50B834_view_transformed_zs[0];
5820 _50B744_view_transformed_ys[v1->uNumVertices] = _50B744_view_transformed_ys[0]; 5827 _50B744_view_transformed_ys[v1->uNumVertices] = _50B744_view_transformed_ys[0];
5821 thisa = _50B924_view_transformed_xs[0] >= 0x80000u; 5828 thisa = _50B924_view_transformed_xs[0] >= (signed int)0x80000u;
5822 //int i = 1; 5829 //int i = 1;
5823 for (uint i = 1; i < v1->uNumVertices; ++i) 5830 for (uint i = 1; i <= v1->uNumVertices; ++i)
5824 { 5831 {
5825 v10 = _50B924_view_transformed_xs[i]; 5832 v10 = _50B924_view_transformed_xs[i];
5826 v81 = v10 >= (signed int)0x80000u; 5833 v81 = v10 >= (signed int)0x80000u;
5827 if ( thisa ^ v81 ) 5834 if ( thisa ^ v81 )
5828 { 5835 {
5860 dword_50B738[v20] = _50B744_view_transformed_ys[i]; 5867 dword_50B738[v20] = _50B744_view_transformed_ys[i];
5861 } 5868 }
5862 //++i; 5869 //++i;
5863 thisa = v81; 5870 thisa = v81;
5864 } 5871 }
5865 ia = 0;
5866 v21 = v79; 5872 v21 = v79;
5867 dword_50B918[v79] = dword_50B918[0]; 5873 dword_50B918[v79] = dword_50B918[0];
5868 dword_50B828[v79] = dword_50B828[0]; 5874 dword_50B828[v79] = dword_50B828[0];
5869 for ( dword_50B738[v79] = dword_50B738[0]; ia < v79; dword_50BA08[v22] = pBLVRenderParams->uViewportCenterY - v35 ) 5875 dword_50B738[v79] = dword_50B738[0];
5876 for (ia = 0; ia < v79; ++ia)
5870 { 5877 {
5871 v22 = ia; 5878 v22 = ia;
5872 thisc = abs(dword_50B918[ia]); 5879 thisc = abs(dword_50B918[ia]);
5873 if ( abs(dword_50B828[ia]) >> 13 <= thisc ) 5880 if ( abs(dword_50B828[ia]) >> 13 <= thisc )
5874 { 5881 {
5893 v25 = v24 - 1; 5900 v25 = v24 - 1;
5894 v26 = (v25 & 0x800000) - 0x400000; 5901 v26 = (v25 & 0x800000) - 0x400000;
5895 } 5902 }
5896 } 5903 }
5897 v29 = dword_50B738[v22]; 5904 v29 = dword_50B738[v22];
5898 dword_50BAF4_xs[v22 + 1] = v26; 5905 dword_50BAF8_xs[v22] = v26;
5899 if ( abs(v29) >> 13 <= thisc ) 5906 if ( abs(v29) >> 13 <= thisc )
5900 { 5907 {
5901 v33 = dword_50B738[v22]; 5908 v33 = dword_50B738[v22];
5902 LODWORD(v34) = v33 << 16; 5909 LODWORD(v34) = v33 << 16;
5903 HIDWORD(v34) = v33 >> 16; 5910 HIDWORD(v34) = v33 >> 16;
5916 LOBYTE(v30) = dword_50B918[v22] >= v23; 5923 LOBYTE(v30) = dword_50B918[v22] >= v23;
5917 v31 = v30 - 1; 5924 v31 = v30 - 1;
5918 v32 = (v31 & 0x800000) - 0x400000; 5925 v32 = (v31 & 0x800000) - 0x400000;
5919 } 5926 }
5920 } 5927 }
5921 dword_50BA08[v22] = v32; 5928 dword_50BA08_ys[v22] = v32;
5922 dword_50BAF4_xs[v22 + 1] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BAF4_xs[v22 + 1]) >> 16; 5929 dword_50BAF8_xs[v22] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BAF8_xs[v22]) >> 16;
5923 v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BA08[v22]) >> 16; 5930 v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BA08_ys[v22]) >> 16;
5924 dword_50BAF4_xs[v22 + 1] = pBLVRenderParams->uViewportCenterX - dword_50BAF4_xs[v22 + 1]; 5931 dword_50BAF8_xs[v22] = pBLVRenderParams->uViewportCenterX - dword_50BAF8_xs[v22];
5925 ++ia; 5932 dword_50BA08_ys[v22] = pBLVRenderParams->uViewportCenterY - v35;
5926 } 5933 }
5927 v36 = 0; 5934 v36 = 0;
5928 dword_50BAF4_xs[v21 + 1] = dword_50BAF4_xs[1]; 5935 dword_50BAF8_xs[v21] = dword_50BAF8_xs[0];
5929 dword_50BA08[v21] = dword_50BA08[0]; 5936 dword_50BA08_ys[v21] = dword_50BA08_ys[0];
5930 v37 = pBLVRenderParams->uViewportX; 5937 v37 = pBLVRenderParams->uViewportX;
5931 v38 = dword_50BAF4_xs[1] < (signed int)pBLVRenderParams->uViewportX; 5938 v38 = dword_50BAF8_xs[0] < (signed int)pBLVRenderParams->uViewportX;
5932 LOBYTE(v38) = dword_50BAF4_xs[1] >= (signed int)pBLVRenderParams->uViewportX; 5939 LOBYTE(v38) = dword_50BAF8_xs[0] >= (signed int)pBLVRenderParams->uViewportX;
5933 v39 = 1; 5940 v39 = 1;
5934 ib = 1; 5941 ib = 1;
5935 if ( v79 < 1 ) 5942 if ( v79 < 1 )
5936 return 0; 5943 return 0;
5937 do 5944 do
5938 { 5945 {
5939 v40 = v39; 5946 v40 = v39;
5940 v41 = dword_50BAF4_xs[v40 + 1]; 5947 v41 = dword_50BAF8_xs[v40];
5941 v82 = v41 >= (signed int)v37; 5948 v82 = v41 >= (signed int)v37;
5942 if ( v38 ^ v82 ) 5949 if ( v38 ^ v82 )
5943 { 5950 {
5944 if ( v41 >= (signed int)v37 ) 5951 if ( v41 >= (signed int)v37 )
5945 { 5952 {
5946 v67 = (signed int)(v37 - dword_50BAF4_xs[v40]) * (signed __int64)(dword_50BA08[v40] - dword_50B9F8[v40 + 3]) / (v41 - dword_50BAF4_xs[v40]); 5953 v67 = (signed int)(v37 - dword_50BAF8_xs[v40 - 1]) * (signed __int64)(dword_50BA08_ys[v40] - dword_50BA08_ys[v40 - 1]) / (v41 - dword_50BAF8_xs[v40 - 1]);
5947 v42 = dword_50B9F8[v40 + 3]; 5954 v42 = dword_50BA08_ys[v40 - 1];
5948 } 5955 }
5949 else 5956 else
5950 { 5957 {
5951 v67 = (signed int)(v37 - v41) * (signed __int64)(dword_50B9F8[v40 + 3] - dword_50BA08[v40]) / (dword_50BAF4_xs[v40] - v41); 5958 v67 = (signed int)(v37 - v41) * (signed __int64)(dword_50BA08_ys[v40 - 1] - dword_50BA08_ys[v40]) / (dword_50BAF8_xs[v40 - 1] - v41);
5952 v42 = dword_50BA08[v40]; 5959 v42 = dword_50BA08_ys[v40];
5953 } 5960 }
5961 dword_50B9FC_ys[v36] = v67 + v42;
5962 v37 = pBLVRenderParams->uViewportX;
5963 dword_50BAEC_xs[v36] = pBLVRenderParams->uViewportX;
5954 ++v36; 5964 ++v36;
5955 dword_50B9F8[v36] = v67 + v42;
5956 v37 = pBLVRenderParams->uViewportX;
5957 dword_50BAE8_xs[v36] = pBLVRenderParams->uViewportX;
5958 } 5965 }
5959 v38 = v82; 5966 v38 = v82;
5960 if ( v82 ) 5967 if ( v82 )
5961 { 5968 {
5962 dword_50BAE8_xs[v36 + 1] = dword_50BAF4_xs[v40 + 1]; 5969 dword_50BAEC_xs[v36] = dword_50BAF8_xs[v40];
5963 dword_50B9F8[v36++ + 1] = dword_50BA08[v40]; 5970 dword_50B9FC_ys[v36] = dword_50BA08_ys[v40];
5971 ++v36;
5964 } 5972 }
5965 v39 = ib++ + 1; 5973 v39 = ib++ + 1;
5966 } 5974 }
5967 while ( ib <= v79 ); 5975 while ( ib <= v79 );
5968 5976
5969 if (v36 < 1) 5977 if (v36 < 1)
5970 return 0; 5978 return 0;
5971 5979
5972 v43 = 0; 5980 v43 = 0;
5973 dword_50BAE8_xs[v36 + 1] = dword_50BAE8_xs[1]; 5981 dword_50BAEC_xs[v36] = dword_50BAEC_xs[0];
5974 dword_50B9F8[v36 + 1] = dword_50B9F8[1]; 5982 dword_50B9FC_ys[v36] = dword_50B9FC_ys[0];
5975 v44 = pBLVRenderParams->uViewportZ; 5983 v44 = pBLVRenderParams->uViewportZ;
5976 thisd = dword_50BAE8_xs[1] <= (signed int)pBLVRenderParams->uViewportZ; 5984 thisd = dword_50BAEC_xs[0] <= (signed int)pBLVRenderParams->uViewportZ;
5977 ic = 1; 5985 ic = 1;
5978 5986
5979 do 5987 do
5980 { 5988 {
5981 v45 = ic; 5989 v45 = ic;
5982 v46 = dword_50BAE8_xs[ic + 1]; 5990 v46 = dword_50BAEC_xs[ic];
5983 v83 = v46 <= (signed int)v44; 5991 v83 = v46 <= (signed int)v44;
5984 if ( thisd ^ v83 ) 5992 if ( thisd ^ v83 )
5985 { 5993 {
5986 if ( v46 <= (signed int)v44 ) 5994 if ( v46 <= (signed int)v44 )
5987 { 5995 {
5988 v68 = (signed int)(v44 - dword_50BAE8_xs[v45]) * (signed __int64)(dword_50B9F8[v45 + 1] - dword_50B9F8[v45]) / (v46 - dword_50BAE8_xs[v45]); 5996 v68 = (signed int)(v44 - dword_50BAEC_xs[v45 - 1]) * (signed __int64)(dword_50B9FC_ys[v45] - dword_50B9FC_ys[v45 - 1]) / (v46 - dword_50BAEC_xs[v45 - 1]);
5989 v47 = dword_50B9F8[v45]; 5997 v47 = dword_50B9FC_ys[v45 - 1];
5990 } 5998 }
5991 else 5999 else
5992 { 6000 {
5993 v68 = (signed int)(v44 - v46) * (signed __int64)(dword_50B9F8[v45] - dword_50B9F8[v45 + 1]) / (dword_50BAE8_xs[v45] - v46); 6001 v68 = (signed int)(v44 - v46) * (signed __int64)(dword_50B9FC_ys[v45 - 1] - dword_50B9FC_ys[v45]) / (dword_50BAEC_xs[v45 - 1] - v46);
5994 v47 = dword_50B9F8[v45 + 1]; 6002 v47 = dword_50B9FC_ys[v45];
5995 } 6003 }
6004 dword_50B9F0[v43] = v68 + v47;
6005 v44 = pBLVRenderParams->uViewportZ;
6006 dword_50BAE0[v43] = pBLVRenderParams->uViewportZ;
5996 ++v43; 6007 ++v43;
5997 dword_50B9EC[v43] = v68 + v47;
5998 v44 = pBLVRenderParams->uViewportZ;
5999 dword_50BADC_xs[v43] = pBLVRenderParams->uViewportZ;
6000 } 6008 }
6001 if ( v83 ) 6009 if ( v83 )
6002 { 6010 {
6003 dword_50BAE0[v43] = dword_50BAE8_xs[v45 + 1]; 6011 dword_50BAE0[v43] = dword_50BAEC_xs[v45];
6004 dword_50B9F0[v43++] = dword_50B9F8[v45 + 1]; 6012 dword_50B9F0[v43++] = dword_50B9FC_ys[v45];
6005 } 6013 }
6006 ++ic; 6014 ++ic;
6007 thisd = v83; 6015 thisd = v83;
6008 } 6016 }
6009 while ( ic <= v36 ); 6017 while ( ic <= v36 );
6026 v84 = v53 >= (signed int)v49; 6034 v84 = v53 >= (signed int)v49;
6027 if ( v50 ^ v84 ) 6035 if ( v50 ^ v84 )
6028 { 6036 {
6029 if ( v53 >= (signed int)v49 ) 6037 if ( v53 >= (signed int)v49 )
6030 { 6038 {
6031 v69 = (signed int)(v49 - dword_50B9EC[v52]) * (signed __int64)(dword_50BAE0[v52] - dword_50BADC_xs[v52]) / (v53 - dword_50B9EC[v52]); 6039 v69 = (signed int)(v49 - dword_50B9F0[v52 - 1]) * (signed __int64)(dword_50BAE0[v52] - dword_50BAE0[v52 - 1]) / (v53 - dword_50B9F0[v52 - 1]);
6032 v54 = dword_50BADC_xs[v52]; 6040 v54 = dword_50BAE0[v52 - 1];
6033 } 6041 }
6034 else 6042 else
6035 { 6043 {
6036 v69 = (signed int)(v49 - v53) * (signed __int64)(dword_50BADC_xs[v52] - dword_50BAE0[v52]) / (dword_50B9EC[v52] - v53); 6044 v69 = (signed int)(v49 - v53) * (signed __int64)(dword_50BAE0[v52 - 1] - dword_50BAE0[v52]) / (dword_50B9F0[v52 - 1] - v53);
6037 v54 = dword_50BAE0[v52]; 6045 v54 = dword_50BAE0[v52];
6038 } 6046 }
6047 dword_50BAD4[v48] = v69 + v54;
6048 v49 = pBLVRenderParams->uViewportY;
6049 dword_50B9E4[v48] = pBLVRenderParams->uViewportY;
6039 ++v48; 6050 ++v48;
6040 dword_50BAD0[v48] = v69 + v54;
6041 v49 = pBLVRenderParams->uViewportY;
6042 dword_50B9E0_ys[v48] = pBLVRenderParams->uViewportY;
6043 } 6051 }
6044 v50 = v84; 6052 v50 = v84;
6045 if ( v84 ) 6053 if ( v84 )
6046 { 6054 {
6047 dword_50BAD4[v48] = dword_50BAE0[v52]; 6055 dword_50BAD4[v48] = dword_50BAE0[v52];
6048 dword_50B9E0_ys[v48++ + 1] = dword_50B9F0[v52]; 6056 dword_50B9E4[v48++] = dword_50B9F0[v52];
6049 } 6057 }
6050 v51 = id++ + 1; 6058 v51 = id++ + 1;
6051 } 6059 }
6052 while ( id <= v43 ); 6060 while ( id <= v43 );
6053 6061
6054 if (v48 < 1) 6062 if (v48 < 1)
6055 return 0; 6063 return 0;
6056 6064
6057 v55 = 0; 6065 v55 = 0;
6058 dword_50BAD4[v48] = dword_50BAD4[0]; 6066 dword_50BAD4[v48] = dword_50BAD4[0];
6059 dword_50B9E0_ys[v48 + 1] = dword_50B9E0_ys[1]; 6067 dword_50B9E4[v48] = dword_50B9E4[0];
6060 v56 = pBLVRenderParams->uViewportW; 6068 v56 = pBLVRenderParams->uViewportW;
6061 thise = dword_50B9E0_ys[1] <= (signed int)pBLVRenderParams->uViewportW; 6069 thise = dword_50B9E4[0] <= (signed int)pBLVRenderParams->uViewportW;
6062 ie = 1; 6070 ie = 1;
6063 do 6071 do
6064 { 6072 {
6065 v57 = ie; 6073 v57 = ie;
6066 v58 = dword_50B9E0_ys[ie + 1]; 6074 v58 = dword_50B9E4[ie];
6067 v85 = v58 <= (signed int)v56; 6075 v85 = v58 <= (signed int)v56;
6068 if ( thise ^ v85 ) 6076 if ( thise ^ v85 )
6069 { 6077 {
6070 if ( v58 <= (signed int)v56 ) 6078 if ( v58 <= (signed int)v56 )
6071 { 6079 {
6072 v70 = (signed int)(v56 - dword_50B9E0_ys[v57]) * (signed __int64)(dword_50BAD4[v57] - dword_50BAD0[v57]) / (v58 - dword_50B9E0_ys[v57]); 6080 v70 = (signed int)(v56 - dword_50B9E4[v57 - 1]) * (signed __int64)(dword_50BAD4[v57] - dword_50BAD4[v57 - 1]) / (v58 - dword_50B9E4[v57 - 1]);
6073 v59 = dword_50BAD0[v57]; 6081 v59 = dword_50BAD4[v57 - 1];
6074 } 6082 }
6075 else 6083 else
6076 { 6084 {
6077 v70 = (signed int)(v56 - v58) * (signed __int64)(dword_50BAD0[v57] - dword_50BAD4[v57]) / (dword_50B9E0_ys[v57] - v58); 6085 v70 = (signed int)(v56 - v58) * (signed __int64)(dword_50BAD4[v57 - 1] - dword_50BAD4[v57]) / (dword_50B9E4[v57 - 1] - v58);
6078 v59 = dword_50BAD4[v57]; 6086 v59 = dword_50BAD4[v57];
6079 } 6087 }
6088 dword_50BAC8[v55] = v70 + v59;
6089 v56 = pBLVRenderParams->uViewportW;
6090 dword_50B9D8_ys[v55] = pBLVRenderParams->uViewportW;
6080 ++v55; 6091 ++v55;
6081 dword_50BAC4[v55] = v70 + v59;
6082 v56 = pBLVRenderParams->uViewportW;
6083 unk_50B9D4[v55] = pBLVRenderParams->uViewportW;
6084 } 6092 }
6085 if ( v85 ) 6093 if ( v85 )
6086 { 6094 {
6087 dword_50BAC8[v55] = dword_50BAD4[v57]; 6095 dword_50BAC8[v55] = dword_50BAD4[v57];
6088 dword_50B9D8_ys[v55++] = dword_50B9E0_ys[v57 + 1]; 6096 dword_50B9D8_ys[v55++] = dword_50B9E4[v57];
6089 } 6097 }
6090 ++ie; 6098 ++ie;
6091 thise = v85; 6099 thise = v85;
6092 } 6100 }
6093 while ( ie <= v48 ); 6101 while ( ie <= v48 );