comparison mm7_4.cpp @ 1477:7ef4b64f6329

* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load Added support for most of mm6 resources, placeholders for mm8 resources. Fixed few C4258
author Nomad
date Wed, 28 Aug 2013 18:43:07 +0200
parents 845907a747d3
children a27cdb3d753e
comparison
equal deleted inserted replaced
1475:d7720c1f1d3b 1477:7ef4b64f6329
1695 fwrite(v1->pFrames, 0xAu, v1->uNumFrames, v3); 1695 fwrite(v1->pFrames, 0xAu, v1->uNumFrames, v3);
1696 fclose(v3); 1696 fclose(v3);
1697 } 1697 }
1698 1698
1699 //----- (00494C0F) -------------------------------------------------------- 1699 //----- (00494C0F) --------------------------------------------------------
1700 void PlayerFrameTable::FromFile(void *pSerialized) 1700 void PlayerFrameTable::FromFile(void *data_mm6, void *data_mm7, void *data_mm8)
1701 { 1701 {
1702 uNumFrames = *(int *)pSerialized; 1702 uint num_mm6_frames = data_mm6 ? *(int *)data_mm6 : 0,
1703 pFrames = (PlayerFrame *)pAllocator->AllocNamedChunk(pFrames, 10 * uNumFrames, "P Frames"); 1703 num_mm7_frames = data_mm7 ? *(int *)data_mm7 : 0,
1704 memcpy(pFrames, (char *)pSerialized + 4, 10 * uNumFrames); 1704 num_mm8_frames = data_mm8 ? *(int *)data_mm8 : 0;
1705 uNumFrames = num_mm6_frames + num_mm7_frames + num_mm8_frames;
1706 assert(uNumFrames);
1707 assert(!num_mm8_frames);
1708
1709 pFrames = (PlayerFrame *)pAllocator->AllocNamedChunk(pFrames, uNumFrames * sizeof(PlayerFrame), "P Frames");
1710 memcpy(pFrames, (char *)data_mm7 + 4, num_mm7_frames * sizeof(PlayerFrame));
1711 memcpy(pFrames + num_mm7_frames, (char *)data_mm6 + 4, num_mm6_frames * sizeof(PlayerFrame));
1712 memcpy(pFrames + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 4, num_mm8_frames * sizeof(PlayerFrame));
1705 } 1713 }
1706 1714
1707 //----- (00494C5A) -------------------------------------------------------- 1715 //----- (00494C5A) --------------------------------------------------------
1708 int PlayerFrameTable::FromFileTxt(const char *Args) 1716 int PlayerFrameTable::FromFileTxt(const char *Args)
1709 { 1717 {
1998 i += 2; 2006 i += 2;
1999 break; 2007 break;
2000 case 8: 2008 case 8:
2001 v63 = 0; 2009 v63 = 0;
2002 v20 = (unsigned __int8 *)pPlayer->_achieved_awards_bits; 2010 v20 = (unsigned __int8 *)pPlayer->_achieved_awards_bits;
2003 for ( uint i = 0; i < 28; ++i ) 2011 for ( uint _i = 0; _i < 28; ++_i )
2004 { 2012 {
2005 if ( (unsigned __int16)_449B57_test_bit(v20, word_4EE150[i]) ) 2013 if ( (unsigned __int16)_449B57_test_bit(v20, word_4EE150[i]) )
2006 { 2014 {
2007 v21 = v63; 2015 v21 = v63;
2008 ++v63; 2016 ++v63;
2139 strcat(pTmpBuf2.data(), a1); 2147 strcat(pTmpBuf2.data(), a1);
2140 dst = strlen(pTmpBuf2.data()); 2148 dst = strlen(pTmpBuf2.data());
2141 i += 2; 2149 i += 2;
2142 break; 2150 break;
2143 case 23: 2151 case 23:
2144 if ( pMapStats->GetMapInfo(pCurrentMapName.data()) ) 2152 if ( pMapStats->GetMapInfo(pCurrentMapName) )
2145 pText = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName.data())].pName; 2153 pText = pMapStats->pInfos[pMapStats->GetMapInfo(pCurrentMapName)].pName;
2146 else 2154 else
2147 pText = pGlobalTXT_LocalizationStrings[394];// "Unknown" 2155 pText = pGlobalTXT_LocalizationStrings[394];// "Unknown"
2148 strcat(pTmpBuf2.data(), pText); 2156 strcat(pTmpBuf2.data(), pText);
2149 dst = strlen(pTmpBuf2.data()); 2157 dst = strlen(pTmpBuf2.data());
2150 i += 2; 2158 i += 2;