comparison mm7_2.cpp @ 728:9f596a163257

Merge
author Nomad
date Fri, 22 Mar 2013 00:06:50 +0200
parents da130dd3092a 9d13d2ec35a6
children de482c901171
comparison
equal deleted inserted replaced
727:da130dd3092a 728:9f596a163257
4774 } 4774 }
4775 while ( fgets(&Buf, 490, File) ); 4775 while ( fgets(&Buf, 490, File) );
4776 v4 = v24; 4776 v4 = v24;
4777 } 4777 }
4778 v5 = v2->pTextures; 4778 v5 = v2->pTextures;
4779 v2->uNumTextures = v4; 4779 v2->sNumTextures = v4;
4780 v6 = pAllocator->AllocNamedChunk(v5, 20 * v4, "Txt Frames"); 4780 v6 = pAllocator->AllocNamedChunk(v5, 20 * v4, "Txt Frames");
4781 v2->pTextures = (TextureFrame *)v6; 4781 v2->pTextures = (TextureFrame *)v6;
4782 if ( !v6 ) 4782 if ( !v6 )
4783 Abortf("CTextureFrameTable::load - Out of Memory!"); 4783 Abortf("CTextureFrameTable::load - Out of Memory!");
4784 v7 = File; 4784 v7 = File;
4785 v2->uNumTextures = 0; 4785 v2->sNumTextures = 0;
4786 fseek(v7, 0, 0); 4786 fseek(v7, 0, 0);
4787 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) ) 4787 for ( i = fgets(&Buf, 490, File); i; i = fgets(&Buf, 490, File) )
4788 { 4788 {
4789 *strchr(&Buf, 10) = 0; 4789 *strchr(&Buf, 10) = 0;
4790 memcpy(&v21, txt_file_frametable_parser(&Buf, &v20), 0x7Cu); 4790 memcpy(&v21, txt_file_frametable_parser(&Buf, &v20), 0x7Cu);
4791 if ( v21 && *Str1 != 47 ) 4791 if ( v21 && *Str1 != 47 )
4792 { 4792 {
4793 strcpy(v2->pTextures[v2->uNumTextures].pTextureName, Str1); 4793 strcpy(v2->pTextures[v2->sNumTextures].pTextureName, Str1);
4794 v2->pTextures[v2->uNumTextures].uAnimTime = atoi(Str); 4794 v2->pTextures[v2->sNumTextures].uAnimTime = atoi(Str);
4795 v9 = 2; 4795 v9 = 2;
4796 for ( v2->pTextures[v2->uNumTextures].uFlags = 0; v9 < v21; ++v9 ) 4796 for ( v2->pTextures[v2->sNumTextures].uFlags = 0; v9 < v21; ++v9 )
4797 { 4797 {
4798 if ( !_strcmpi((&Str1)[4 * v9], "New") ) 4798 if ( !_strcmpi((&Str1)[4 * v9], "New") )
4799 { 4799 {
4800 v10 = (int)&v2->pTextures[v2->uNumTextures].uFlags; 4800 v10 = (int)&v2->pTextures[v2->sNumTextures].uFlags;
4801 *(char *)v10 |= 2u; 4801 *(char *)v10 |= 2u;
4802 } 4802 }
4803 } 4803 }
4804 ++v2->uNumTextures; 4804 ++v2->sNumTextures;
4805 } 4805 }
4806 } 4806 }
4807 fclose(File); 4807 fclose(File);
4808 v11 = 0; 4808 v11 = 0;
4809 if ( (signed int)(v2->uNumTextures - 1) > 0 ) 4809 if ( (signed int)(v2->sNumTextures - 1) > 0 )
4810 { 4810 {
4811 v12 = 0; 4811 v12 = 0;
4812 do 4812 do
4813 { 4813 {
4814 v13 = (int)&v2->pTextures[v12]; 4814 v13 = (int)&v2->pTextures[v12];
4815 if ( !(*(char *)(v13 + 38) & 2) ) 4815 if ( !(*(char *)(v13 + 38) & 2) )
4816 *(char *)(v13 + 18) |= 1u; 4816 *(char *)(v13 + 18) |= 1u;
4817 ++v11; 4817 ++v11;
4818 ++v12; 4818 ++v12;
4819 } 4819 }
4820 while ( v11 < (signed int)(v2->uNumTextures - 1) ); 4820 while ( v11 < (signed int)(v2->sNumTextures - 1) );
4821 } 4821 }
4822 for ( j = 0; j < (signed int)v2->uNumTextures; *(short *)(Argsa + 16) = v16 ) 4822 for ( j = 0; j < (signed int)v2->sNumTextures; *(short *)(Argsa + 16) = v16 )
4823 { 4823 {
4824 v15 = v2->pTextures; 4824 v15 = v2->pTextures;
4825 Argsa = (int)&v15[j]; 4825 Argsa = (int)&v15[j];
4826 v16 = *(short *)(Argsa + 14); 4826 v16 = *(short *)(Argsa + 14);
4827 if ( *(char *)(Argsa + 18) & 1 ) 4827 if ( *(char *)(Argsa + 18) & 1 )
5103 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) 5103 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor )
5104 goto LABEL_55; 5104 goto LABEL_55;
5105 v37 = pIndoor->GetSector(pPosX, a4, v36); 5105 v37 = pIndoor->GetSector(pPosX, a4, v36);
5106 if ( v37 == pSector ) 5106 if ( v37 == pSector )
5107 { 5107 {
5108 v38 = _46CEC3_get_floor_level(pPosX, a4, a3, v37, &uFaceID); 5108 v38 = BLV_GetFloorLevel(pPosX, a4, a3, v37, &uFaceID);
5109 v39 = v38; 5109 v39 = v38;
5110 if ( v38 != -30000 ) 5110 if ( v38 != -30000 )
5111 { 5111 {
5112 if ( abs(v38 - a3) <= 1024 ) 5112 if ( abs(v38 - a3) <= 1024 )
5113 { 5113 {
5234 v6->UpdateAnimation(); 5234 v6->UpdateAnimation();
5235 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor 5235 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor
5236 || (v22 = pParty->vPosition.z, 5236 || (v22 = pParty->vPosition.z,
5237 result = pIndoor->GetSector(v11, v14, pParty->vPosition.z), 5237 result = pIndoor->GetSector(v11, v14, pParty->vPosition.z),
5238 result == v21) 5238 result == v21)
5239 && (result = _46CEC3_get_floor_level(v11, v14, v22, result, &uFaceID), result != -30000) 5239 && (result = BLV_GetFloorLevel(v11, v14, v22, result, &uFaceID), result != -30000)
5240 && (result = abs(result - v22), result <= 1024) ) 5240 && (result = abs(result - v22), result <= 1024) )
5241 { 5241 {
5242 if ( v20 == uNumActors ) 5242 if ( v20 == uNumActors )
5243 ++uNumActors; 5243 ++uNumActors;
5244 v6->uSummonerID = 8 * v17 | 4; 5244 v6->uSummonerID = 8 * v17 | 4;
5546 v19.uIndex = v24; 5546 v19.uIndex = v24;
5547 v19.vPosition.y = v23 + pParty->vPosition.y; 5547 v19.vPosition.y = v23 + pParty->vPosition.y;
5548 v19.vPosition.z = pParty->vPosition.z; 5548 v19.vPosition.z = pParty->vPosition.z;
5549 v26 = 0; 5549 v26 = 0;
5550 v27 = 0; 5550 v27 = 0;
5551 v19.vPosition.z = sub_46D49E_prolly_get_world_y_under_party( 5551 v19.vPosition.z = ODM_GetFloorLevel(
5552 v19.vPosition.x, 5552 v19.vPosition.x,
5553 v23 + pParty->vPosition.y, 5553 v23 + pParty->vPosition.y,
5554 pParty->vPosition.z, 5554 pParty->vPosition.z,
5555 0, 5555 0,
5556 &v26, 5556 &v26,
5604 v19.vPosition.z = pParty->vPosition.z; 5604 v19.vPosition.z = pParty->vPosition.z;
5605 v19.uIndex = v24; 5605 v19.uIndex = v24;
5606 v17 = pIndoor->GetSector(v19.vPosition.x, v23 + pParty->vPosition.y, pParty->vPosition.z); 5606 v17 = pIndoor->GetSector(v19.vPosition.x, v23 + pParty->vPosition.y, pParty->vPosition.z);
5607 if ( v17 == v22 ) 5607 if ( v17 == v22 )
5608 { 5608 {
5609 v18 = _46CEC3_get_floor_level(v19.vPosition.x, v19.vPosition.y, v19.vPosition.z, v17, &uFaceID); 5609 v18 = BLV_GetFloorLevel(v19.vPosition.x, v19.vPosition.y, v19.vPosition.z, v17, &uFaceID);
5610 v19.vPosition.z = v18; 5610 v19.vPosition.z = v18;
5611 if ( v18 != -30000 ) 5611 if ( v18 != -30000 )
5612 { 5612 {
5613 if ( abs(v18 - pParty->vPosition.z) <= 1024 ) 5613 if ( abs(v18 - pParty->vPosition.z) <= 1024 )
5614 break; 5614 break;
11927 else 11927 else
11928 { 11928 {
11929 if ( pParty->pPickedItem.uItemID ) 11929 if ( pParty->pPickedItem.uItemID )
11930 return 1; 11930 return 1;
11931 v24 = (int)pItemsTable->pItems[v20].pUnidentifiedName; 11931 v24 = (int)pItemsTable->pItems[v20].pUnidentifiedName;
11932 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v24); 11932 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], v24);
11933 ShowStatusBarString(pTmpBuf2, 2u); 11933 ShowStatusBarString(pTmpBuf2, 2u);
11934 if ( v19->uItemID == 506 ) 11934 if ( v19->uItemID == 506 )
11935 _449B7E_toggle_bit(pParty->_quest_bits, 184, 1u); 11935 _449B7E_toggle_bit(pParty->_quest_bits, 184, 1u);
11936 if ( v19->uItemID == 455 ) 11936 if ( v19->uItemID == 455 )
11937 _449B7E_toggle_bit(pParty->_quest_bits, 185, 1u); 11937 _449B7E_toggle_bit(pParty->_quest_bits, 185, 1u);