Mercurial > mm7
comparison mm7_4.cpp @ 720:05f7a11f4f20
Слияние
author | Ritor1 |
---|---|
date | Tue, 19 Mar 2013 23:41:29 +0600 |
parents | a5ee769b02c6 ef4d646d738d |
children | f39d5902c85a |
comparison
equal
deleted
inserted
replaced
719:d394cc892106 | 720:05f7a11f4f20 |
---|---|
1945 Abortf("TileTable::load - Unable to open file: %s."); | 1945 Abortf("TileTable::load - Unable to open file: %s."); |
1946 v4 = 0; | 1946 v4 = 0; |
1947 for ( i = v3; fgets(&Buf, 490, i); i = File ) | 1947 for ( i = v3; fgets(&Buf, 490, i); i = File ) |
1948 { | 1948 { |
1949 *strchr(&Buf, 10) = 0; | 1949 *strchr(&Buf, 10) = 0; |
1950 memcpy(&v84, texture_frame_table_txt_parser(&Buf, &v85), sizeof(v84)); | 1950 memcpy(&v84, txt_file_frametable_parser(&Buf, &v85), sizeof(v84)); |
1951 if ( v84.field_0 && *v84.pProperties[0] != 47 ) | 1951 if ( v84.uPropCount && *v84.pProperties[0] != 47 ) |
1952 ++v4; | 1952 ++v4; |
1953 } | 1953 } |
1954 v2->uNumTiles = v4; | 1954 v2->uNumTiles = v4; |
1955 v5 = pAllocator->AllocNamedChunk(v2->pTiles, 26 * v4, "Tile Descrip"); | 1955 v5 = pAllocator->AllocNamedChunk(v2->pTiles, 26 * v4, "Tile Descrip"); |
1956 v2->pTiles = (TileDesc *)v5; | 1956 v2->pTiles = (TileDesc *)v5; |
1962 if ( fgets(&Buf, 490, File) ) | 1962 if ( fgets(&Buf, 490, File) ) |
1963 { | 1963 { |
1964 while ( 1 ) | 1964 while ( 1 ) |
1965 { | 1965 { |
1966 *strchr(&Buf, 10) = 0; | 1966 *strchr(&Buf, 10) = 0; |
1967 memcpy(&v84, texture_frame_table_txt_parser(&Buf, &v85), sizeof(v84)); | 1967 memcpy(&v84, txt_file_frametable_parser(&Buf, &v85), sizeof(v84)); |
1968 if ( v84.field_0 ) | 1968 if ( v84.uPropCount ) |
1969 { | 1969 { |
1970 if ( *v84.pProperties[0] != 47 ) | 1970 if ( *v84.pProperties[0] != 47 ) |
1971 break; | 1971 break; |
1972 } | 1972 } |
1973 LABEL_173: | 1973 LABEL_173: |
2194 v2->pTiles[v2->uNumTiles].uAttributes = 0; | 2194 v2->pTiles[v2->uNumTiles].uAttributes = 0; |
2195 if ( !_strcmpi(v35, "TTsect_NULL") ) | 2195 if ( !_strcmpi(v35, "TTsect_NULL") ) |
2196 { | 2196 { |
2197 LOBYTE(v2->pTiles[v2->uNumTiles].uSection) = -1; | 2197 LOBYTE(v2->pTiles[v2->uNumTiles].uSection) = -1; |
2198 LABEL_152: | 2198 LABEL_152: |
2199 for ( j = 5; j < v84.field_0; ++j ) | 2199 for ( j = 5; j < v84.uPropCount; ++j ) |
2200 { | 2200 { |
2201 v72 = v84.pProperties[j]; | 2201 v72 = v84.pProperties[j]; |
2202 if ( _strcmpi(v84.pProperties[j], "TTattr_Burn") ) | 2202 if ( _strcmpi(v84.pProperties[j], "TTattr_Burn") ) |
2203 { | 2203 { |
2204 if ( _strcmpi(v72, "TTattr_Water") ) | 2204 if ( _strcmpi(v72, "TTattr_Water") ) |
4428 if ( fgets(&Buf, 490, v3) ) | 4428 if ( fgets(&Buf, 490, v3) ) |
4429 { | 4429 { |
4430 do | 4430 do |
4431 { | 4431 { |
4432 *strchr(&Buf, 10) = 0; | 4432 *strchr(&Buf, 10) = 0; |
4433 memcpy(&v24, texture_frame_table_txt_parser(&Buf, &v23), sizeof(v24)); | 4433 memcpy(&v24, txt_file_frametable_parser(&Buf, &v23), sizeof(v24)); |
4434 if ( v24.field_0 && *v24.pProperties[0] != 47 ) | 4434 if ( v24.uPropCount && *v24.pProperties[0] != 47 ) |
4435 { | 4435 { |
4436 if ( v24.field_0 < 3 ) | 4436 if ( v24.uPropCount < 3 ) |
4437 Abortf("PlayerFrameTable::load, too few arguments, %s line %i.", Args, v26); | 4437 Abortf("PlayerFrameTable::load, too few arguments, %s line %i.", Args, v26); |
4438 ++v25; | 4438 ++v25; |
4439 } | 4439 } |
4440 ++v26; | 4440 ++v26; |
4441 } | 4441 } |
4451 v2->uNumFrames = 0; | 4451 v2->uNumFrames = 0; |
4452 fseek(v6, 0, 0); | 4452 fseek(v6, 0, 0); |
4453 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) ) | 4453 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) ) |
4454 { | 4454 { |
4455 *strchr(&Buf, 10) = 0; | 4455 *strchr(&Buf, 10) = 0; |
4456 memcpy(&v24, texture_frame_table_txt_parser(&Buf, &v23), sizeof(v24)); | 4456 memcpy(&v24, txt_file_frametable_parser(&Buf, &v23), sizeof(v24)); |
4457 if ( v24.field_0 && *v24.pProperties[0] != 47 ) | 4457 if ( v24.uPropCount && *v24.pProperties[0] != 47 ) |
4458 { | 4458 { |
4459 v8 = atoi(v24.pProperties[0]); | 4459 v8 = atoi(v24.pProperties[0]); |
4460 v9 = v24.pProperties[1]; | 4460 v9 = v24.pProperties[1]; |
4461 v2->pFrames[v2->uNumFrames].expression = (CHARACTER_EXPRESSION_ID)v8; | 4461 v2->pFrames[v2->uNumFrames].expression = (CHARACTER_EXPRESSION_ID)v8; |
4462 v10 = atoi(v9); | 4462 v10 = atoi(v9); |
4463 v11 = v24.pProperties[2]; | 4463 v11 = v24.pProperties[2]; |
4464 v2->pFrames[v2->uNumFrames].uTextureID = v10; | 4464 v2->pFrames[v2->uNumFrames].uTextureID = v10; |
4465 v2->pFrames[v2->uNumFrames].uAnimTime = atoi(v11); | 4465 v2->pFrames[v2->uNumFrames].uAnimTime = atoi(v11); |
4466 v2->pFrames[v2->uNumFrames].uAnimLength = 0; | 4466 v2->pFrames[v2->uNumFrames].uAnimLength = 0; |
4467 v2->pFrames[v2->uNumFrames].uFlags = 0; | 4467 v2->pFrames[v2->uNumFrames].uFlags = 0; |
4468 for ( j = 3; j < v24.field_0; ++j ) | 4468 for ( j = 3; j < v24.uPropCount; ++j ) |
4469 { | 4469 { |
4470 if ( !_strcmpi(v24.pProperties[j], "New") ) | 4470 if ( !_strcmpi(v24.pProperties[j], "New") ) |
4471 { | 4471 { |
4472 v13 = (int)&v2->pFrames[v2->uNumFrames].uFlags; | 4472 v13 = (int)&v2->pFrames[v2->uNumFrames].uFlags; |
4473 *(char *)v13 |= 4u; | 4473 *(char *)v13 |= 4u; |
4666 { | 4666 { |
4667 do | 4667 do |
4668 { | 4668 { |
4669 *strchr(&Buf, 10) = 0; | 4669 *strchr(&Buf, 10) = 0; |
4670 memcpy(&v20, frame_table_txt_parser(&Buf, &v19), sizeof(v20)); | 4670 memcpy(&v20, frame_table_txt_parser(&Buf, &v19), sizeof(v20)); |
4671 if ( v20.field_0 && *v20.pProperties[0] != 47 ) | 4671 if ( v20.uPropCount && *v20.pProperties[0] != 47 ) |
4672 { | 4672 { |
4673 if ( v20.field_0 < 3 ) | 4673 if ( v20.uPropCount < 3 ) |
4674 Abortf("IconFrameTable::loadText, too few arguments, %s line %i.", Args, v22); | 4674 Abortf("IconFrameTable::loadText, too few arguments, %s line %i.", Args, v22); |
4675 ++v21; | 4675 ++v21; |
4676 } | 4676 } |
4677 ++v22; | 4677 ++v22; |
4678 } | 4678 } |
4689 fseek(v6, 0, 0); | 4689 fseek(v6, 0, 0); |
4690 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) ) | 4690 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) ) |
4691 { | 4691 { |
4692 *strchr(&Buf, 10) = 0; | 4692 *strchr(&Buf, 10) = 0; |
4693 memcpy(&v20, frame_table_txt_parser(&Buf, &v19), sizeof(v20)); | 4693 memcpy(&v20, frame_table_txt_parser(&Buf, &v19), sizeof(v20)); |
4694 if ( v20.field_0 && *v20.pProperties[0] != 47 ) | 4694 if ( v20.uPropCount && *v20.pProperties[0] != 47 ) |
4695 { | 4695 { |
4696 strcpy(v2->pIcons[v2->uNumIcons].pAnimationName, v20.pProperties[0]); | 4696 strcpy(v2->pIcons[v2->uNumIcons].pAnimationName, v20.pProperties[0]); |
4697 strcpy(v2->pIcons[v2->uNumIcons].pTextureName, v20.pProperties[1]); | 4697 strcpy(v2->pIcons[v2->uNumIcons].pTextureName, v20.pProperties[1]); |
4698 v8 = v20.pProperties[2]; | 4698 v8 = v20.pProperties[2]; |
4699 v2->pIcons[v2->uNumIcons].uFlags = 0; | 4699 v2->pIcons[v2->uNumIcons].uFlags = 0; |
11050 int v7; // edx@9 | 11050 int v7; // edx@9 |
11051 int v8; // edx@10 | 11051 int v8; // edx@10 |
11052 unsigned __int8 v9; // zf@16 | 11052 unsigned __int8 v9; // zf@16 |
11053 char v10; // sf@16 | 11053 char v10; // sf@16 |
11054 unsigned __int8 v11; // of@16 | 11054 unsigned __int8 v11; // of@16 |
11055 bool test; | |
11055 | 11056 |
11056 auto a2 = _2da_idx; | 11057 auto a2 = _2da_idx; |
11057 //v2 = p2DEvents_minus1___00[26 * a2]; | 11058 //v2 = p2DEvents_minus1___00[26 * a2]; |
11058 v2 = p2DEvents[a2 - 1].uType; | 11059 v2 = p2DEvents[a2 - 1].uType; |
11059 v3 = a1->uItemID; | 11060 v3 = a1->uItemID; |
11060 v4 = a1->uItemID; | 11061 v4 = a1->uItemID; |
11061 v5 = pItemsTable->pItems[v4].uEquipType; | 11062 v5 = pItemsTable->pItems[v4].uEquipType; |
11062 if ( (v2 != 4 || (signed int)v3 < 740 || (signed int)v3 > 771) | 11063 if ( (v2 != 4 || (signed int)v3 < 740 || (signed int)v3 > 771) |
11063 && ((signed int)v3 >= 600 || (signed int)v3 >= 529 && (signed int)v3 <= 599) || a1->Stolen()) | 11064 && ((signed int)v3 >= 600 || (signed int)v3 >= 529 && (signed int)v3 <= 599) || a1->Stolen()) |
11064 return 0; | 11065 return 0; |
11065 v6 = v2 - 1; | 11066 switch( p2DEvents[a2 - 1].uType ) |
11066 if ( !v6 ) | 11067 { |
11068 case BildingType_WeaponShop: | |
11069 { | |
11070 test = v5 <= 2; | |
11071 break; | |
11072 } | |
11073 case BildingType_ArmorShop: | |
11074 { | |
11075 test = v5 >= 3; | |
11076 break; | |
11077 } | |
11078 case BildingType_MagicShop: | |
11079 { | |
11080 test = pItemsTable->pItems[v4].uSkillType == 38 || v5 == 16; | |
11081 break; | |
11082 } | |
11083 case BildingType_AlchemistShop: | |
11084 { | |
11085 __debugbreak(); // need to test | |
11086 test = v5 == 13 || v5 == 14 || (v5 > 14 && !(v5 != 17 || (signed int)v3 < 740) && v3 != 771); | |
11087 break; | |
11088 } | |
11089 default: | |
11090 { | |
11091 test = 0; | |
11092 break; | |
11093 } | |
11094 } | |
11095 | |
11096 return test; | |
11097 /* | |
11098 if ( p2DEvents[a2 - 1].uType == 1 ) | |
11067 { | 11099 { |
11068 v11 = __OFSUB__(v5, 2); | 11100 v11 = __OFSUB__(v5, 2); |
11069 v9 = v5 == 2; | 11101 v9 = v5 == 2; |
11070 v10 = v5 - 2 < 0; | 11102 v10 = v5 - 2 < 0; |
11071 goto LABEL_23; | 11103 goto LABEL_23; |
11072 } | 11104 } |
11073 v7 = v6 - 1; | 11105 if ( p2DEvents[a2 - 1].uType > 2 ) |
11074 if ( v7 ) | 11106 { |
11075 { | 11107 if ( p2DEvents[a2 - 1].uType == 3 ) |
11076 v8 = v7 - 1; | |
11077 if ( !v8 ) | |
11078 { | 11108 { |
11079 if ( pItemsTable->pItems[v4].uSkillType != 38 ) | 11109 if ( pItemsTable->pItems[v4].uSkillType != 38 ) |
11080 return v5 == 16; | 11110 return v5 == 16; |
11081 return 1; | 11111 return 1; |
11082 } | 11112 } |
11083 if ( v8 != 1 || v5 < 13 ) | 11113 if ( p2DEvents[a2 - 1].uType != 4 || v5 < 13 ) |
11084 return 0; | 11114 return 0; |
11085 if ( v5 <= 14 ) | 11115 if ( p2DEvents[a2 - 1].uType == 4) |
11086 return 1; | 11116 { |
11087 if ( v5 != 17 || (signed int)v3 < 740 ) | 11117 if ( v5 < 13 ) |
11088 return 0; | 11118 return 0; |
11089 v11 = __OFSUB__(v3, 771); | 11119 if ( v5 <= 14 ) |
11090 v9 = v3 == 771; | 11120 return 1; |
11091 v10 = ((v3 - 771) & 0x80000000u) != 0; | 11121 if ( v5 != 17 || (signed int)v3 < 740 ) |
11122 return 0; | |
11123 v11 = __OFSUB__(v3, 771); | |
11124 v9 = v3 == 771; | |
11125 v10 = ((v3 - 771) & 0x80000000u) != 0; | |
11092 LABEL_23: | 11126 LABEL_23: |
11093 if ( !((unsigned __int8)(v10 ^ v11) | v9) ) | 11127 if ( !((unsigned __int8)(v10 ^ v11) | v9) ) |
11094 return 0; | 11128 return 0; |
11095 return 1; | 11129 return 1; |
11096 } | 11130 } |
11097 if ( v5 >= 3 ) | 11131 } |
11098 { | 11132 if ( p2DEvents[a2 - 1].uType == 2 ) |
11099 v11 = __OFSUB__(v5, 9); | 11133 { |
11100 v9 = v5 == 9; | 11134 if ( v5 >= 3 ) |
11101 v10 = v5 - 9 < 0; | 11135 { |
11102 goto LABEL_23; | 11136 v11 = __OFSUB__(v5, 9); |
11137 v9 = v5 == 9; | |
11138 v10 = v5 - 9 < 0; | |
11139 goto LABEL_23; | |
11140 } | |
11103 } | 11141 } |
11104 return 0; | 11142 return 0; |
11143 */ | |
11105 } | 11144 } |
11106 | 11145 |
11107 | 11146 |
11108 | 11147 |
11109 | 11148 |