Mercurial > mm7
comparison GUI/UI/UIShops.cpp @ 2575:a76d408c5132 tip
DrawTranslucent -> DrawTextureGrayShade
Removed old texture drawing stuff
author | a.parshin |
---|---|
date | Wed, 09 Mar 2016 01:39:52 +0200 |
parents | 0c67be4ec900 |
children |
comparison
equal
deleted
inserted
replaced
2574:dd36326a9994 | 2575:a76d408c5132 |
---|---|
23 #include "..\../Engine/Graphics/Outdoor.h" | 23 #include "..\../Engine/Graphics/Outdoor.h" |
24 #include "..\../Engine/Graphics/Indoor.h" | 24 #include "..\../Engine/Graphics/Indoor.h" |
25 | 25 |
26 | 26 |
27 Image *shop_ui_background = nullptr; | 27 Image *shop_ui_background = nullptr; |
28 | |
29 std::array<Image *, 12> shop_ui_items_in_store; | |
28 | 30 |
29 | 31 |
30 //----- (004B910F) -------------------------------------------------------- | 32 //----- (004B910F) -------------------------------------------------------- |
31 void WeaponShopDialog() | 33 void WeaponShopDialog() |
32 { | 34 { |
90 item_X = 0; | 92 item_X = 0; |
91 for ( uint i = 0; i < 6; ++i ) | 93 for ( uint i = 0; i < 6; ++i ) |
92 { | 94 { |
93 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID) | 95 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID) |
94 { | 96 { |
95 pRenderer->DrawTextureIndexedAlpha((60 - ((signed int)ItemsInShopTexture[i]->uTextureWidth / 2)) + item_X, weapons_Ypos[i] + 30, ItemsInShopTexture[i]); | 97 pRenderer->DrawTextureAlphaNew( |
96 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[(60 - ((signed int)ItemsInShopTexture[i]->uTextureWidth / 2)) + item_X + window->GetWidth() * (weapons_Ypos[i] + 30)], ItemsInShopTexture[i], i + 1); | 98 ((60 - ((signed int)shop_ui_items_in_store[i]->GetWidth() / 2)) + item_X)/640.0f, |
99 (weapons_Ypos[i] + 30)/480.0f, | |
100 shop_ui_items_in_store[i]); | |
101 //ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[(60 - ((signed int)shop_ui_items_in_store[i]->uTextureWidth / 2)) + item_X + window->GetWidth() * (weapons_Ypos[i] + 30)], shop_ui_items_in_store[i], i + 1); | |
97 } | 102 } |
98 item_X += 70; | 103 item_X += 70; |
99 } | 104 } |
100 if ( HouseUI_CheckIfPlayerCanInteract() ) | 105 if ( HouseUI_CheckIfPlayerCanInteract() ) |
101 { | 106 { |
141 item_X = 0; | 146 item_X = 0; |
142 for ( uint i = 0; i < 6; ++i ) | 147 for ( uint i = 0; i < 6; ++i ) |
143 { | 148 { |
144 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID) | 149 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID) |
145 { | 150 { |
146 pRenderer->DrawTextureIndexedAlpha((60 - ((signed int)ItemsInShopTexture[i]->uTextureWidth / 2)) + item_X, weapons_Ypos[i] + 30, ItemsInShopTexture[i]); | 151 pRenderer->DrawTextureAlphaNew( |
147 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[(60 - ((signed int)ItemsInShopTexture[i]->uTextureWidth / 2)) + item_X + window->GetWidth() * (weapons_Ypos[i] + 30)], ItemsInShopTexture[i], i + 1); | 152 ((60 - ((signed int)shop_ui_items_in_store[i]->GetWidth() / 2)) + item_X)/640.0f, |
153 (weapons_Ypos[i] + 30)/480.0f, | |
154 shop_ui_items_in_store[i]); | |
155 //ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[(60 - ((signed int)shop_ui_items_in_store[i]->uTextureWidth / 2)) + item_X + window->GetWidth() * (weapons_Ypos[i] + 30)], shop_ui_items_in_store[i], i + 1); | |
148 } | 156 } |
149 item_X += 70; | 157 item_X += 70; |
150 } | 158 } |
151 if ( HouseUI_CheckIfPlayerCanInteract() ) | 159 if ( HouseUI_CheckIfPlayerCanInteract() ) |
152 { | 160 { |
418 { | 426 { |
419 if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID) | 427 if ( pParty->StandartItemsInShops[window_SpeakInHouse->par1C][i].uItemID) |
420 { | 428 { |
421 if ( i >= 4 ) //low row | 429 if ( i >= 4 ) //low row |
422 { | 430 { |
423 pRenderer->DrawTextureIndexedAlpha((90 - (ItemsInShopTexture[i]->uTextureWidth / 2)) + item_x - 420, 126, ItemsInShopTexture[i]); | 431 pRenderer->DrawTextureAlphaNew( |
424 v59 = (90 - (ItemsInShopTexture[i]->uTextureWidth / 2)) + item_x + 80220; | 432 ((90 - (shop_ui_items_in_store[i]->GetWidth() / 2)) + item_x - 420)/640.0f, |
433 126/480.0f, | |
434 shop_ui_items_in_store[i]); | |
435 v59 = (90 - (shop_ui_items_in_store[i]->GetWidth() / 2)) + item_x + 80220; | |
425 } | 436 } |
426 else | 437 else |
427 { | 438 { |
428 pRenderer->DrawTextureIndexedAlpha(( 86 - (ItemsInShopTexture[i]->uTextureWidth / 2)) + item_x, 98 - ItemsInShopTexture[i]->uTextureHeight, ItemsInShopTexture[i]); | 439 pRenderer->DrawTextureAlphaNew( |
429 v59 = item_x + (86 - (ItemsInShopTexture[i]->uTextureWidth / 2)) + window->GetWidth() * (98 - ItemsInShopTexture[i]->uTextureHeight); | 440 ((86 - (shop_ui_items_in_store[i]->GetWidth() / 2)) + item_x)/640.0f, |
430 } | 441 (98 - shop_ui_items_in_store[i]->GetWidth())/480.0f, |
431 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], ItemsInShopTexture[i], i + 1); | 442 shop_ui_items_in_store[i]); |
443 v59 = item_x + (86 - (shop_ui_items_in_store[i]->GetWidth() / 2)) + window->GetWidth() * (98 - shop_ui_items_in_store[i]->GetHeight()); | |
444 } | |
445 //ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], shop_ui_items_in_store[i], i + 1); | |
432 } | 446 } |
433 item_x += 105; | 447 item_x += 105; |
434 } | 448 } |
435 if ( !HouseUI_CheckIfPlayerCanInteract() ) | 449 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
436 return; | 450 return; |
477 { | 491 { |
478 if ( pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][i].uItemID ) | 492 if ( pParty->SpecialItemsInShops[window_SpeakInHouse->par1C][i].uItemID ) |
479 { | 493 { |
480 if ( i >= 4 ) | 494 if ( i >= 4 ) |
481 { | 495 { |
482 pRenderer->DrawTextureIndexedAlpha(item_x + (90 - ((signed int)ItemsInShopTexture[i]->uTextureWidth / 2)) - 420, 126, ItemsInShopTexture[i]); | 496 pRenderer->DrawTextureAlphaNew( |
483 v59 = item_x + (90 - ((signed int)ItemsInShopTexture[i]->uTextureWidth / 2)) + 80220; | 497 (item_x + (90 - ((signed int)shop_ui_items_in_store[i]->GetWidth() / 2)) - 420)/640.0f, |
498 126/480.0f, | |
499 shop_ui_items_in_store[i]); | |
500 v59 = item_x + (90 - ((signed int)shop_ui_items_in_store[i]->GetWidth() / 2)) + 80220; | |
484 } | 501 } |
485 else | 502 else |
486 { | 503 { |
487 pRenderer->DrawTextureIndexedAlpha(86 - ((signed int)ItemsInShopTexture[i]->uTextureWidth / 2) + item_x, 98 - ItemsInShopTexture[i]->uTextureHeight, ItemsInShopTexture[i]); | 504 pRenderer->DrawTextureAlphaNew( |
488 v59 = (86 - ((signed int)ItemsInShopTexture[i]->uTextureWidth / 2)) + item_x + window->GetWidth() * (98 - ItemsInShopTexture[i]->uTextureHeight); | 505 (86 - ((signed int)shop_ui_items_in_store[i]->GetWidth() / 2) + item_x)/640.0f, |
489 } | 506 (98 - shop_ui_items_in_store[i]->GetHeight())/480.0f, |
490 ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], ItemsInShopTexture[i], i + 1); | 507 shop_ui_items_in_store[i]); |
508 v59 = (86 - ((signed int)shop_ui_items_in_store[i]->GetWidth() / 2)) + item_x + window->GetWidth() * (98 - shop_ui_items_in_store[i]->GetHeight()); | |
509 } | |
510 //ZBuffer_DoFill(&pRenderer->pActiveZBuffer[v59], shop_ui_items_in_store[i], i + 1); | |
491 } | 511 } |
492 item_x += 105; | 512 item_x += 105; |
493 } | 513 } |
494 if ( !HouseUI_CheckIfPlayerCanInteract() ) | 514 if ( !HouseUI_CheckIfPlayerCanInteract() ) |
495 return; | 515 return; |
762 pRenderer->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, shop_ui_background); | 782 pRenderer->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, shop_ui_background); |
763 for ( uint i = 0; i < 6; ++i ) | 783 for ( uint i = 0; i < 6; ++i ) |
764 { | 784 { |
765 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID ) | 785 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID ) |
766 { | 786 { |
767 product_height_1row = 152 - ItemsInShopTexture[i]->uTextureHeight; | 787 product_height_1row = 152 - shop_ui_items_in_store[i]->GetHeight(); |
768 if ( (signed int)product_height_1row < 1 ) | 788 if ( (signed int)product_height_1row < 1 ) |
769 product_height_1row = 0; | 789 product_height_1row = 0; |
770 product_width_1row = 75 * i - ItemsInShopTexture[i]->uTextureWidth / 2 + 40; | 790 product_width_1row = 75 * i - shop_ui_items_in_store[i]->GetWidth() / 2 + 40; |
771 if ( i ) | 791 if ( i ) |
772 { | 792 { |
773 if ( i == 5 ) | 793 if ( i == 5 ) |
774 { | 794 { |
775 if ( (signed int)product_width_1row > 457 - ItemsInShopTexture[5]->uTextureWidth ) | 795 if ( (signed int)product_width_1row > 457 - shop_ui_items_in_store[5]->GetWidth()) |
776 product_width_1row = 457 - ItemsInShopTexture[5]->uTextureWidth; | 796 product_width_1row = 457 - shop_ui_items_in_store[5]->GetWidth(); |
777 } | 797 } |
778 } | 798 } |
779 else if ( (signed int)product_width_1row < 18 ) | 799 else if ( (signed int)product_width_1row < 18 ) |
780 product_width_1row = 18; | 800 product_width_1row = 18; |
781 pRenderer->DrawTextureIndexedAlpha(product_width_1row, product_height_1row, ItemsInShopTexture[i]); | 801 pRenderer->DrawTextureAlphaNew(product_width_1row/640.0f, product_height_1row/480.0f, shop_ui_items_in_store[i]); |
782 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[product_width_1row + window->GetWidth() * product_height_1row], ItemsInShopTexture[i], i + 1); | 802 //ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[product_width_1row + window->GetWidth() * product_height_1row], shop_ui_items_in_store[i], i + 1); |
783 } | 803 } |
784 } | 804 } |
785 for ( uint i = 0; i < 6; ++i ) | 805 for ( uint i = 0; i < 6; ++i ) |
786 { | 806 { |
787 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i + 6].uItemID ) | 807 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i + 6].uItemID ) |
788 { | 808 { |
789 product_height_2row = 308 - ItemsInShopTexture[i + 6]->uTextureHeight; | 809 product_height_2row = 308 - shop_ui_items_in_store[i + 6]->GetHeight(); |
790 if ( (signed int)product_height_2row < 1 ) | 810 if ( (signed int)product_height_2row < 1 ) |
791 product_height_2row = 0; | 811 product_height_2row = 0; |
792 product_width_2row = 75 * i - ItemsInShopTexture[i + 6]->uTextureWidth / 2 + 40; | 812 product_width_2row = 75 * i - shop_ui_items_in_store[i + 6]->GetWidth() / 2 + 40; |
793 if ( i ) | 813 if ( i ) |
794 { | 814 { |
795 if ( i == 5 ) | 815 if ( i == 5 ) |
796 { | 816 { |
797 if ( (signed int)product_width_2row > 457 - ItemsInShopTexture[11]->uTextureWidth ) | 817 if ( (signed int)product_width_2row > 457 - shop_ui_items_in_store[11]->GetWidth()) |
798 product_width_2row = 457 - ItemsInShopTexture[11]->uTextureWidth; | 818 product_width_2row = 457 - shop_ui_items_in_store[11]->GetWidth(); |
799 } | 819 } |
800 } | 820 } |
801 else | 821 else |
802 { | 822 { |
803 if ( (signed int)product_width_2row < 18 ) | 823 if ( (signed int)product_width_2row < 18 ) |
804 product_width_2row = 18; | 824 product_width_2row = 18; |
805 } | 825 } |
806 pRenderer->DrawTextureIndexedAlpha(product_width_2row, product_height_2row, ItemsInShopTexture[i + 6]); | 826 pRenderer->DrawTextureAlphaNew(product_width_2row/640.0f, product_height_2row/480.0f, shop_ui_items_in_store[i + 6]); |
807 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[product_width_2row + window->GetWidth() * product_height_2row], ItemsInShopTexture[i + 6], i + 7); | 827 //ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[product_width_2row + window->GetWidth() * product_height_2row], shop_ui_items_in_store[i + 6], i + 7); |
808 } | 828 } |
809 } | 829 } |
810 if ( HouseUI_CheckIfPlayerCanInteract() ) | 830 if ( HouseUI_CheckIfPlayerCanInteract() ) |
811 { | 831 { |
812 item_num = 0; | 832 item_num = 0; |
847 pRenderer->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, shop_ui_background); | 867 pRenderer->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, shop_ui_background); |
848 for ( uint i = 0; i < 6; ++i ) | 868 for ( uint i = 0; i < 6; ++i ) |
849 { | 869 { |
850 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID) | 870 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID) |
851 { | 871 { |
852 product_height_1row = 152 - ItemsInShopTexture[i]->uTextureHeight; | 872 product_height_1row = 152 - shop_ui_items_in_store[i]->GetHeight(); |
853 if ( (signed int)product_height_1row < 1 ) | 873 if ( (signed int)product_height_1row < 1 ) |
854 product_height_1row = 0; | 874 product_height_1row = 0; |
855 product_width_1row = 75 * i - ItemsInShopTexture[i]->uTextureWidth / 2 + 40; | 875 product_width_1row = 75 * i - shop_ui_items_in_store[i]->GetWidth() / 2 + 40; |
856 if ( i ) | 876 if ( i ) |
857 { | 877 { |
858 if ( i == 5 ) | 878 if ( i == 5 ) |
859 { | 879 { |
860 if ( (signed int)product_width_1row > 457 - ItemsInShopTexture[5]->uTextureWidth ) | 880 if ( (signed int)product_width_1row > 457 - shop_ui_items_in_store[5]->GetWidth()) |
861 product_width_1row = 457 - ItemsInShopTexture[5]->uTextureWidth; | 881 product_width_1row = 457 - shop_ui_items_in_store[5]->GetWidth(); |
862 } | 882 } |
863 } | 883 } |
864 else | 884 else |
865 { | 885 { |
866 if ( (signed int)product_width_1row < 18 ) | 886 if ( (signed int)product_width_1row < 18 ) |
867 product_width_1row = 18; | 887 product_width_1row = 18; |
868 } | 888 } |
869 pRenderer->DrawTextureIndexedAlpha(product_width_1row, product_height_1row, ItemsInShopTexture[i]); | 889 pRenderer->DrawTextureAlphaNew(product_width_1row/640.0f, product_height_1row/480.0f, shop_ui_items_in_store[i]); |
870 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[product_width_1row + window->GetWidth() * product_height_1row], ItemsInShopTexture[i], i + 1); | 890 //ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[product_width_1row + window->GetWidth() * product_height_1row], shop_ui_items_in_store[i], i + 1); |
871 } | 891 } |
872 } | 892 } |
873 for ( uint i = 0; i < 6; ++i ) | 893 for ( uint i = 0; i < 6; ++i ) |
874 { | 894 { |
875 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)i + 6].uItemID) //not itemid | 895 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][(signed int)i + 6].uItemID) //not itemid |
876 { | 896 { |
877 product_height_2row = 308 - ItemsInShopTexture[i + 6]->uTextureHeight; | 897 product_height_2row = 308 - shop_ui_items_in_store[i + 6]->GetHeight(); |
878 if ( (signed int)product_height_2row < 1 ) | 898 if ( (signed int)product_height_2row < 1 ) |
879 product_height_2row = 0; | 899 product_height_2row = 0; |
880 product_width_2row = 75 * i - ItemsInShopTexture[i + 6]->uTextureWidth / 2 + 40; | 900 product_width_2row = 75 * i - shop_ui_items_in_store[i + 6]->GetWidth() / 2 + 40; |
881 if ( i ) | 901 if ( i ) |
882 { | 902 { |
883 if ( i == 5 ) | 903 if ( i == 5 ) |
884 { | 904 { |
885 if ( (signed int)product_width_2row > 457 - ItemsInShopTexture[11]->uTextureWidth ) | 905 if ( (signed int)product_width_2row > 457 - shop_ui_items_in_store[11]->GetWidth()) |
886 product_width_2row = 457 - ItemsInShopTexture[11]->uTextureWidth; | 906 product_width_2row = 457 - shop_ui_items_in_store[11]->GetWidth(); |
887 } | 907 } |
888 } | 908 } |
889 else | 909 else |
890 { | 910 { |
891 if ( (signed int)product_width_2row < 18 ) | 911 if ( (signed int)product_width_2row < 18 ) |
892 product_width_2row = 18; | 912 product_width_2row = 18; |
893 } | 913 } |
894 pRenderer->DrawTextureIndexedAlpha(product_width_2row, product_height_2row, ItemsInShopTexture[i + 6]); | 914 pRenderer->DrawTextureAlphaNew(product_width_2row/640.0f, product_height_2row/480.0f, shop_ui_items_in_store[i + 6]); |
895 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[product_width_2row + window->GetWidth() * product_height_2row], ItemsInShopTexture[i + 6], i + 7); | 915 //ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[product_width_2row + window->GetWidth() * product_height_2row], shop_ui_items_in_store[i + 6], i + 7); |
896 } | 916 } |
897 } | 917 } |
898 if ( HouseUI_CheckIfPlayerCanInteract() ) | 918 if ( HouseUI_CheckIfPlayerCanInteract() ) |
899 { | 919 { |
900 item_num = 0; | 920 item_num = 0; |
1136 pRenderer->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, shop_ui_background); | 1156 pRenderer->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, shop_ui_background); |
1137 for ( uint i = 0; i < 6; ++i ) | 1157 for ( uint i = 0; i < 6; ++i ) |
1138 { | 1158 { |
1139 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID) | 1159 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID) |
1140 { | 1160 { |
1141 product_height_1row = 152 - ItemsInShopTexture[i]->uTextureHeight; | 1161 product_height_1row = 152 - shop_ui_items_in_store[i]->GetHeight(); |
1142 if ( (signed int)product_height_1row < 1 ) | 1162 if ( (signed int)product_height_1row < 1 ) |
1143 product_height_1row = 0; | 1163 product_height_1row = 0; |
1144 product_width_1row = 75 * i - ItemsInShopTexture[i]->uTextureWidth / 2 + 40; | 1164 product_width_1row = 75 * i - shop_ui_items_in_store[i]->GetWidth() / 2 + 40; |
1145 if ( i ) | 1165 if ( i ) |
1146 { | 1166 { |
1147 if ( i == 5 ) | 1167 if ( i == 5 ) |
1148 { | 1168 { |
1149 if ( (signed int)product_width_1row > 457 - ItemsInShopTexture[5]->uTextureWidth ) | 1169 if ( (signed int)product_width_1row > 457 - shop_ui_items_in_store[5]->GetWidth()) |
1150 product_width_1row = 457 - ItemsInShopTexture[5]->uTextureWidth; | 1170 product_width_1row = 457 - shop_ui_items_in_store[5]->GetWidth(); |
1151 } | 1171 } |
1152 } | 1172 } |
1153 else | 1173 else |
1154 { | 1174 { |
1155 if ( (signed int)product_width_1row < 18 ) | 1175 if ( (signed int)product_width_1row < 18 ) |
1156 product_width_1row = 18; | 1176 product_width_1row = 18; |
1157 } | 1177 } |
1158 pRenderer->DrawTextureIndexedAlpha(product_width_1row, product_height_1row, ItemsInShopTexture[i]); | 1178 pRenderer->DrawTextureAlphaNew(product_width_1row/640.0f, product_height_1row/480.0f, shop_ui_items_in_store[i]); |
1159 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[product_width_1row + window->GetWidth() * product_height_1row], ItemsInShopTexture[i], i + 1); | 1179 //ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[product_width_1row + window->GetWidth() * product_height_1row], shop_ui_items_in_store[i], i + 1); |
1160 } | 1180 } |
1161 } | 1181 } |
1162 for ( uint i = 0; i < 6; ++i ) | 1182 for ( uint i = 0; i < 6; ++i ) |
1163 { | 1183 { |
1164 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i + 6].uItemID) | 1184 if ( pParty->StandartItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i + 6].uItemID) |
1165 { | 1185 { |
1166 product_height_2row = 306 - ItemsInShopTexture[i + 6]->uTextureHeight; | 1186 product_height_2row = 306 - shop_ui_items_in_store[i + 6]->GetHeight(); |
1167 product_width_2row = 75 * i - ItemsInShopTexture[i + 6]->uTextureWidth / 2 + 40; | 1187 product_width_2row = 75 * i - shop_ui_items_in_store[i + 6]->GetWidth() / 2 + 40; |
1168 if ( i ) | 1188 if ( i ) |
1169 { | 1189 { |
1170 if ( i == 5 ) | 1190 if ( i == 5 ) |
1171 { | 1191 { |
1172 if ( (signed int)product_width_2row > 457 - ItemsInShopTexture[11]->uTextureWidth ) | 1192 if ( (signed int)product_width_2row > 457 - shop_ui_items_in_store[11]->GetWidth()) |
1173 product_width_2row = 457 - ItemsInShopTexture[11]->uTextureWidth; | 1193 product_width_2row = 457 - shop_ui_items_in_store[11]->GetWidth(); |
1174 } | 1194 } |
1175 } | 1195 } |
1176 else | 1196 else |
1177 { | 1197 { |
1178 if ( (signed int)product_width_2row < 18 ) | 1198 if ( (signed int)product_width_2row < 18 ) |
1179 product_width_2row = 18; | 1199 product_width_2row = 18; |
1180 } | 1200 } |
1181 pRenderer->DrawTextureIndexedAlpha(product_width_2row, product_height_2row, ItemsInShopTexture[i + 6]); | 1201 pRenderer->DrawTextureAlphaNew(product_width_2row/640.0f, product_height_2row/480.0f, shop_ui_items_in_store[i + 6]); |
1182 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[product_width_2row + window->GetWidth() * product_height_2row], ItemsInShopTexture[i + 6], i + 7); | 1202 //ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[product_width_2row + window->GetWidth() * product_height_2row], shop_ui_items_in_store[i + 6], i + 7); |
1183 } | 1203 } |
1184 } | 1204 } |
1185 if ( HouseUI_CheckIfPlayerCanInteract() ) | 1205 if ( HouseUI_CheckIfPlayerCanInteract() ) |
1186 { | 1206 { |
1187 item_num = 0; | 1207 item_num = 0; |
1222 pRenderer->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, shop_ui_background); | 1242 pRenderer->DrawTextureAlphaNew(8 / 640.0f, 8 / 480.0f, shop_ui_background); |
1223 for ( uint i = 0; i < 6; ++i ) | 1243 for ( uint i = 0; i < 6; ++i ) |
1224 { | 1244 { |
1225 if ( pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID ) | 1245 if ( pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i].uItemID ) |
1226 { | 1246 { |
1227 product_height_1row = 152 - ItemsInShopTexture[i]->uTextureHeight; | 1247 product_height_1row = 152 - shop_ui_items_in_store[i]->GetHeight(); |
1228 if ( (signed int)product_height_1row < 1 ) | 1248 if ( (signed int)product_height_1row < 1 ) |
1229 product_height_1row = 0; | 1249 product_height_1row = 0; |
1230 product_width_1row = 75 * i - ItemsInShopTexture[i]->uTextureWidth / 2 + 40; | 1250 product_width_1row = 75 * i - shop_ui_items_in_store[i]->GetWidth() / 2 + 40; |
1231 if ( i ) | 1251 if ( i ) |
1232 { | 1252 { |
1233 if ( i == 5 ) | 1253 if ( i == 5 ) |
1234 { | 1254 { |
1235 if ( (signed int)product_width_1row > 457 - ItemsInShopTexture[5]->uTextureWidth ) | 1255 if ( (signed int)product_width_1row > 457 - shop_ui_items_in_store[5]->GetWidth()) |
1236 product_width_1row = 457 - ItemsInShopTexture[5]->uTextureWidth; | 1256 product_width_1row = 457 - shop_ui_items_in_store[5]->GetWidth(); |
1237 } | 1257 } |
1238 } | 1258 } |
1239 else | 1259 else |
1240 { | 1260 { |
1241 if ( (signed int)product_width_1row < 18 ) | 1261 if ( (signed int)product_width_1row < 18 ) |
1242 product_width_1row = 18; | 1262 product_width_1row = 18; |
1243 } | 1263 } |
1244 pRenderer->DrawTextureIndexedAlpha(product_width_1row, product_height_1row, ItemsInShopTexture[i]); | 1264 pRenderer->DrawTextureAlphaNew(product_width_1row/640.0f, product_height_1row/480.0f, shop_ui_items_in_store[i]); |
1245 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[product_width_1row + window->GetWidth() * product_height_1row], ItemsInShopTexture[i], i + 1); | 1265 //ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[product_width_1row + window->GetWidth() * product_height_1row], shop_ui_items_in_store[i], i + 1); |
1246 } | 1266 } |
1247 } | 1267 } |
1248 for ( uint i = 0; i < 6; ++i ) | 1268 for ( uint i = 0; i < 6; ++i ) |
1249 { | 1269 { |
1250 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i + 6].uItemID) | 1270 if (pParty->SpecialItemsInShops[(unsigned int)window_SpeakInHouse->ptr_1C][i + 6].uItemID) |
1251 { | 1271 { |
1252 product_height_2row = 306 - ItemsInShopTexture[i + 6]->uTextureHeight; | 1272 product_height_2row = 306 - shop_ui_items_in_store[i + 6]->GetHeight(); |
1253 if ( (signed int)product_height_2row < 1 ) | 1273 if ( (signed int)product_height_2row < 1 ) |
1254 product_height_2row = 0; | 1274 product_height_2row = 0; |
1255 product_width_2row = 75 * i - ItemsInShopTexture[i + 6]->uTextureWidth / 2 + 40; | 1275 product_width_2row = 75 * i - shop_ui_items_in_store[i + 6]->GetWidth() / 2 + 40; |
1256 if ( i ) | 1276 if ( i ) |
1257 { | 1277 { |
1258 if ( i == 5 ) | 1278 if ( i == 5 ) |
1259 { | 1279 { |
1260 if ( (signed int)product_width_2row > 457 - ItemsInShopTexture[11]->uTextureWidth ) | 1280 if ( (signed int)product_width_2row > 457 - shop_ui_items_in_store[11]->GetWidth()) |
1261 product_width_2row = 457 - ItemsInShopTexture[11]->uTextureWidth; | 1281 product_width_2row = 457 - shop_ui_items_in_store[11]->GetWidth(); |
1262 } | 1282 } |
1263 } | 1283 } |
1264 else | 1284 else |
1265 { | 1285 { |
1266 if ( (signed int)product_width_2row < 18 ) | 1286 if ( (signed int)product_width_2row < 18 ) |
1267 product_width_2row = 18; | 1287 product_width_2row = 18; |
1268 } | 1288 } |
1269 pRenderer->DrawTextureIndexedAlpha(product_width_2row, product_height_2row, ItemsInShopTexture[i + 6]); | 1289 pRenderer->DrawTextureAlphaNew(product_width_2row/640.0f, product_height_2row/480.0f, shop_ui_items_in_store[i + 6]); |
1270 ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[product_width_2row + window->GetWidth() * product_height_2row], ItemsInShopTexture[i + 6], i + 7); | 1290 //ZBuffer_DoFill2(&pRenderer->pActiveZBuffer[product_width_2row + window->GetWidth() * product_height_2row], shop_ui_items_in_store[i + 6], i + 7); |
1271 } | 1291 } |
1272 } | 1292 } |
1273 if ( HouseUI_CheckIfPlayerCanInteract() ) | 1293 if ( HouseUI_CheckIfPlayerCanInteract() ) |
1274 { | 1294 { |
1275 item_num = 0; | 1295 item_num = 0; |