Mercurial > mm7
comparison Texture.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 | dfc9484ed94c |
children | c4ab816fcc5e |
comparison
equal
deleted
inserted
replaced
1475:d7720c1f1d3b | 1477:7ef4b64f6329 |
---|---|
262 fwrite(v1->pTextures, 0x14u, v1->sNumTextures, v3); | 262 fwrite(v1->pTextures, 0x14u, v1->sNumTextures, v3); |
263 fclose(v3); | 263 fclose(v3); |
264 } | 264 } |
265 | 265 |
266 //----- (0044E0A0) -------------------------------------------------------- | 266 //----- (0044E0A0) -------------------------------------------------------- |
267 void TextureFrameTable::FromFile(void *pSerialized) | 267 void TextureFrameTable::FromFile(void *data_mm6, void *data_mm7, void *data_mm8) |
268 { | 268 { |
269 sNumTextures = *(int *)pSerialized; | 269 uint num_mm6_frames = data_mm6 ? *(int *)data_mm6 : 0, |
270 pTextures = (TextureFrame *)pAllocator->AllocNamedChunk(pTextures, 20 * sNumTextures, "Txt Frames"); | 270 num_mm7_frames = data_mm7 ? *(int *)data_mm7 : 0, |
271 memcpy(pTextures, (char *)pSerialized + 4, 20 * sNumTextures); | 271 num_mm8_frames = data_mm8 ? *(int *)data_mm8 : 0; |
272 | |
273 sNumTextures = num_mm6_frames + num_mm7_frames + num_mm8_frames; | |
274 assert(sNumTextures); | |
275 assert(!num_mm8_frames); | |
276 | |
277 pTextures = (TextureFrame *)pAllocator->AllocNamedChunk(pTextures, sNumTextures * sizeof(TextureFrame), "Txt Frames"); | |
278 | |
279 memcpy(pTextures, (char *)data_mm7 + 4, num_mm7_frames * sizeof(TextureFrame)); | |
280 memcpy(pTextures + num_mm7_frames, (char *)data_mm6 + 4, num_mm6_frames * sizeof(TextureFrame)); | |
281 memcpy(pTextures + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 4, num_mm8_frames * sizeof(TextureFrame)); | |
272 } | 282 } |
273 | 283 |
274 //----- (0044E0ED) -------------------------------------------------------- | 284 //----- (0044E0ED) -------------------------------------------------------- |
275 void TextureFrameTable::LoadAnimationSequenceAndPalettes( signed int uIconID ) | 285 void TextureFrameTable::LoadAnimationSequenceAndPalettes( signed int uIconID ) |
276 { | 286 { |