Mercurial > mm7
comparison mm7_2.cpp @ 440:4946b3ed74be
more itemgen
author | Gloval |
---|---|
date | Sun, 24 Feb 2013 16:11:51 +0400 |
parents | 6b8118542175 |
children | a812665688e4 |
comparison
equal
deleted
inserted
replaced
439:6b8118542175 | 440:4946b3ed74be |
---|---|
959 goto LABEL_13; | 959 goto LABEL_13; |
960 } | 960 } |
961 if ( v2 <= 41 ) | 961 if ( v2 <= 41 ) |
962 { | 962 { |
963 v4 = word_4F0576[v2]; | 963 v4 = word_4F0576[v2]; |
964 v9 = 22; | 964 v9 = 22; //misc |
965 goto LABEL_12; | 965 goto LABEL_12; |
966 } | 966 } |
967 if ( v2 <= 53 ) | 967 if ( v2 <= 53 ) |
968 { | 968 { |
969 if ( v1 >= 6 ) | 969 if ( v1 >= 6 ) |
970 { | 970 { |
971 v4 = word_4F0578[v2]; | 971 v4 = word_4F0578[v2]; |
972 v9 = 45; | 972 v9 = 45; //reagent |
973 LABEL_12: | 973 LABEL_12: |
974 v5 = v9; | 974 v5 = v9; |
975 LABEL_13: | 975 LABEL_13: |
976 pItemsTable->GenerateItem(v4, v5, (ItemGen *)&pParty->field_777C[9 * (v1 + 12 * v2)]); | 976 pItemsTable->GenerateItem(v4, v5, (ItemGen *)&pParty->field_777C[v2][v1]);//9 * (v1 + 12 * v2)]); |
977 v0 = window_SpeakInHouse; | 977 v0 = window_SpeakInHouse; |
978 pParty->field_777C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 5] = 1; | 978 pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v1].uAttributes = 1; //identified |
979 goto LABEL_14; | 979 goto LABEL_14; |
980 } | 980 } |
981 auto _t = (ItemGen *)&pParty->field_777C[9 * (v1 + 12 * v2)]; | 981 auto _t = (ItemGen *)&pParty->field_777C[v2][v1]; |
982 _t->Reset(); | 982 _t->Reset(); |
983 v0 = window_SpeakInHouse; | 983 v0 = window_SpeakInHouse; |
984 pParty->field_777C[9 * (v1 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] = 220; | 984 pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v1].uItemID = 220; //potion bottle |
985 } | 985 } |
986 LABEL_14: | 986 LABEL_14: |
987 v2 = (signed int)v0->ptr_1C; | 987 v2 = (signed int)v0->ptr_1C; |
988 ++v1; | 988 ++v1; |
989 //if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v0->ptr_1C]] ) | 989 //if ( v1 >= (unsigned __int8)_4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v0->ptr_1C]] ) |
1489 v48 = 0; | 1489 v48 = 0; |
1490 v108 = 0; | 1490 v108 = 0; |
1491 v109 = 0; | 1491 v109 = 0; |
1492 do | 1492 do |
1493 { | 1493 { |
1494 if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] ) | 1494 // if ( pParty->field_777C[9 * (int)&v48[3 * (unsigned int)window_SpeakInHouse->ptr_1C]] ) |
1495 if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][(int)v48].uItemID); | |
1495 { | 1496 { |
1496 v49 = word_F8B158[(signed int)v48]; | 1497 v49 = word_F8B158[(signed int)v48]; |
1497 v50 = dword_F8B168[(signed int)v48]; | 1498 v50 = dword_F8B168[(signed int)v48]; |
1498 v49 += 30; | 1499 v49 += 30; |
1499 v51 = 60 - ((signed int)v50->uTextureWidth >> 1); | 1500 v51 = 60 - ((signed int)v50->uTextureWidth >> 1); |
1541 if ( dword_F8B19C == 2 ) | 1542 if ( dword_F8B19C == 2 ) |
1542 { | 1543 { |
1543 v106.x = 0; | 1544 v106.x = 0; |
1544 do | 1545 do |
1545 { | 1546 { |
1546 if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) | 1547 if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID);//9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) |
1547 ++v106.x; | 1548 ++v106.x; |
1548 ++v55; | 1549 ++v55; |
1549 } | 1550 } |
1550 while ( v55 < 6 ); | 1551 while ( v55 < 6 ); |
1551 } | 1552 } |
1581 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF ) | 1582 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF ) |
1582 { | 1583 { |
1583 v60 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; | 1584 v60 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; |
1584 v106.x = v60; | 1585 v106.x = v60; |
1585 v61 = (int)window_SpeakInHouse->ptr_1C; | 1586 v61 = (int)window_SpeakInHouse->ptr_1C; |
1586 v62 = 9 * (v60 + 12 * v61); | 1587 // v62 = 9 * (v60 + 12 * v61); |
1587 v63 = (ItemGen *)&pParty->field_777C[v62]; | 1588 v63 = (ItemGen *)&pParty->field_777C[(int)v61][v60]; |
1588 if ( dword_F8B19C != 2 ) | 1589 if ( dword_F8B19C != 2 ) |
1589 v63 = &pParty->Recipes_Item[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724]; | 1590 v63 = &pParty->Recipes_Item[(int)v61][v60];//v63 = (ItemGen *)&pParty->field_C59C[v62 + 724]; |
1590 if ( !v56 || !Str ) | 1591 if ( !v56 || !Str ) |
1591 { | 1592 { |
1592 v85 = 0; | 1593 v85 = 0; |
2029 v114 = 0; | 2030 v114 = 0; |
2030 if ( dword_F8B19C == 2 ) | 2031 if ( dword_F8B19C == 2 ) |
2031 { | 2032 { |
2032 do | 2033 do |
2033 { | 2034 { |
2034 if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) | 2035 // if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) |
2036 if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v114].uItemID); | |
2035 { | 2037 { |
2036 v46 = dword_F8B168[v114]; | 2038 v46 = dword_F8B168[v114]; |
2037 v47 = 152 - v46->uTextureHeight; | 2039 v47 = 152 - v46->uTextureHeight; |
2038 if ( (signed int)v47 < 1 ) | 2040 if ( (signed int)v47 < 1 ) |
2039 v47 = 0; | 2041 v47 = 0; |
2059 } | 2061 } |
2060 while ( v114 < 6 ); | 2062 while ( v114 < 6 ); |
2061 v114 = 0; | 2063 v114 = 0; |
2062 do | 2064 do |
2063 { | 2065 { |
2064 if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] ) | 2066 // if ( pParty->field_777C[9 * (v114 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 54] ) |
2067 if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v114+1].uItemID); | |
2065 { | 2068 { |
2066 v50 = dword_F8B168[v114 + 6]; | 2069 v50 = dword_F8B168[v114 + 6]; |
2067 v51 = 308 - v50->uTextureHeight; | 2070 v51 = 308 - v50->uTextureHeight; |
2068 if ( (signed int)v51 < 1 ) | 2071 if ( (signed int)v51 < 1 ) |
2069 v51 = 0; | 2072 v51 = 0; |
2160 v109 = 0; | 2163 v109 = 0; |
2161 if ( dword_F8B19C == 2 ) | 2164 if ( dword_F8B19C == 2 ) |
2162 { | 2165 { |
2163 do | 2166 do |
2164 { | 2167 { |
2165 if ( pParty->field_777C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) | 2168 // if ( pParty->field_777C[9 * (v62 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) |
2169 if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v62].uItemID); | |
2166 ++v109; | 2170 ++v109; |
2167 ++v62; | 2171 ++v62; |
2168 } | 2172 } |
2169 while ( v62 < 12 ); | 2173 while ( v62 < 12 ); |
2170 } | 2174 } |
2204 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF ) | 2208 if ( pRenderer->pActiveZBuffer[(int)result] & 0xFFFF ) |
2205 { | 2209 { |
2206 v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; | 2210 v67 = (pRenderer->pActiveZBuffer[(int)result] & 0xFFFF) - 1; |
2207 v109 = v67; | 2211 v109 = v67; |
2208 v68 = (int)window_SpeakInHouse->ptr_1C; | 2212 v68 = (int)window_SpeakInHouse->ptr_1C; |
2209 v69 = 9 * (v67 + 12 * v68); | 2213 // v69 = 9 * (v67 + 12 * v68); |
2210 v70 = (ItemGen *)&pParty->field_777C[v69]; | 2214 v70 = (ItemGen *)&pParty->field_777C[v68][v67]; |
2211 if ( dword_F8B19C != 2 ) | 2215 if ( dword_F8B19C != 2 ) |
2212 v70 = &pParty->Recipes_Item[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724]; | 2216 v70 = &pParty->Recipes_Item[(int)v68][v67];//v70 = (ItemGen *)&pParty->field_C59C[v69 + 724]; |
2213 if ( !v63 || !Str ) | 2217 if ( !v63 || !Str ) |
2214 { | 2218 { |
2215 v93 = 0; | 2219 v93 = 0; |
2631 { | 2635 { |
2632 v55 = 0; | 2636 v55 = 0; |
2633 v153 = 0; | 2637 v153 = 0; |
2634 do | 2638 do |
2635 { | 2639 { |
2636 if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) | 2640 // if ( pParty->field_777C[9 * (v55 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] ) |
2641 if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v55].uItemID); | |
2637 { | 2642 { |
2638 v56 = dword_F8B168[v55]; | 2643 v56 = dword_F8B168[v55]; |
2639 if ( v55 >= 4 ) | 2644 if ( v55 >= 4 ) |
2640 { | 2645 { |
2641 v60 = 90 - ((signed int)v56->uTextureWidth >> 1); | 2646 v60 = 90 - ((signed int)v56->uTextureWidth >> 1); |
2702 v149 = (__int32)v11; | 2707 v149 = (__int32)v11; |
2703 if ( dword_F8B19C == 2 ) | 2708 if ( dword_F8B19C == 2 ) |
2704 { | 2709 { |
2705 do | 2710 do |
2706 { | 2711 { |
2707 if ( (char *)pParty->field_777C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] != v11 ) | 2712 // if ( (char *)pParty->field_777C[9 * (v68 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C)] != v11 ) |
2713 if ( pParty->field_777C[(unsigned int)window_SpeakInHouse->ptr_1C][v68].uItemID); | |
2708 ++v149; | 2714 ++v149; |
2709 ++v68; | 2715 ++v68; |
2710 } | 2716 } |
2711 while ( v68 < 6 ); | 2717 while ( v68 < 6 ); |
2712 } | 2718 } |
4222 { | 4228 { |
4223 if ( _4F063C_smthn_by_2da_uType[v44] ) | 4229 if ( _4F063C_smthn_by_2da_uType[v44] ) |
4224 { | 4230 { |
4225 do | 4231 do |
4226 { | 4232 { |
4227 v45 = pParty->field_777C[9 * (v43 + 12 * (int)v42)]; | 4233 v45 = pParty->field_777C[(int)v42][v43].uItemID; |
4228 if ( v45 ) | 4234 if ( v45 ) |
4229 { | 4235 { |
4230 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE); | 4236 v46 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v45].pIconName, TEXTURE_16BIT_PALETTE); |
4231 //v3 = dword_F8B198; | 4237 //v3 = dword_F8B198; |
4232 v8 = window_SpeakInHouse; | 4238 v8 = window_SpeakInHouse; |
4245 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] ) | 4251 //if ( _4F063C_smthn_by_2da_uType[p2DEvents_minus1___00[26 * (unsigned int)v8->ptr_1C]] ) |
4246 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] ) | 4252 if ( _4F063C_smthn_by_2da_uType[p2DEvents[(unsigned int)v8->ptr_1C - 1].uType] ) |
4247 { | 4253 { |
4248 do | 4254 do |
4249 { | 4255 { |
4250 if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] ) | 4256 // if ( pParty->field_777C[9 * (v48 + 12 * (int)v47)] ) |
4257 if ( pParty->field_777C[(int)v47][v48].uItemID); | |
4251 { | 4258 { |
4252 v49 = rand(); | 4259 v49 = rand(); |
4253 v8 = window_SpeakInHouse; | 4260 v8 = window_SpeakInHouse; |
4254 word_F8B158[v48] = v49 % (300 - dword_F8B168[v48]->uTextureHeight); | 4261 word_F8B158[v48] = v49 % (300 - dword_F8B168[v48]->uTextureHeight); |
4255 } | 4262 } |
4600 v28 = pMouse->GetCursorPos(&v59); | 4607 v28 = pMouse->GetCursorPos(&v59); |
4601 v29 = pRenderer->pActiveZBuffer[v28->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v57)->y]] & 0xFFFF; | 4608 v29 = pRenderer->pActiveZBuffer[v28->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v57)->y]] & 0xFFFF; |
4602 if ( !v29 ) | 4609 if ( !v29 ) |
4603 return; | 4610 return; |
4604 v30 = window_SpeakInHouse->ptr_1C; | 4611 v30 = window_SpeakInHouse->ptr_1C; |
4605 v31 = 9 * (v29 - 1 + 12 * (int)v30); | 4612 // v31 = 9 * (v29 - 1 + 12 * (int)v30); |
4606 if ( dword_F8B19C == 2 ) | 4613 if ( dword_F8B19C == 2 ) |
4607 { | 4614 { |
4608 v32 = (ItemGen *)&pParty->field_777C[v31]; | 4615 v32 = (ItemGen *)&pParty->field_777C[(int)v30][v29]; |
4609 _this = (ItemGen *)&pParty->field_777C[v31]; | 4616 _this = (ItemGen *)&pParty->field_777C[(int)v30][v29]; |
4610 } | 4617 } |
4611 else | 4618 else |
4612 { | 4619 { |
4613 _this =&pParty->Recipes_Item[(int)v30][v29-1]; //(ItemGen *)&pParty->field_C59C[v31 + 724]; | 4620 _this =&pParty->Recipes_Item[(int)v30][v29-1]; //(ItemGen *)&pParty->field_C59C[v31 + 724]; |
4614 v32 = &pParty->Recipes_Item[(int)v30][v29-1];//(ItemGen *)&pParty->field_C59C[v31 + 724]; | 4621 v32 = &pParty->Recipes_Item[(int)v30][v29-1];//(ItemGen *)&pParty->field_C59C[v31 + 724]; |