Mercurial > mm7
comparison IconFrameTable.cpp @ 1583:75fafd8ced59
Allocator (CMemory) bye-bye
author | Nomad |
---|---|
date | Tue, 10 Sep 2013 21:07:07 +0200 |
parents | c4ab816fcc5e |
children | c1c74df0a33e |
comparison
equal
deleted
inserted
replaced
1577:1b6217e07b26 | 1583:75fafd8ced59 |
---|---|
1 #include "IconFrameTable.h" | 1 #include "IconFrameTable.h" |
2 #include "LOD.h" | 2 #include "LOD.h" |
3 #include "mm7_data.h" | 3 #include "mm7_data.h" |
4 #include "Allocator.h" | |
5 #include "FrameTableInc.h" | 4 #include "FrameTableInc.h" |
6 | 5 |
7 //----- (00494F3A) -------------------------------------------------------- | 6 //----- (00494F3A) -------------------------------------------------------- |
8 unsigned int IconFrameTable::FindIcon(const char *pIconName) | 7 unsigned int IconFrameTable::FindIcon(const char *pIconName) |
9 { | 8 { |
120 | 119 |
121 uNumIcons = num_mm6_frames + num_mm7_frames + num_mm8_frames; | 120 uNumIcons = num_mm6_frames + num_mm7_frames + num_mm8_frames; |
122 Assert(uNumIcons); | 121 Assert(uNumIcons); |
123 Assert(!num_mm8_frames); | 122 Assert(!num_mm8_frames); |
124 | 123 |
125 pIcons = (IconFrame *)pAllocator->AllocNamedChunk(pIcons, uNumIcons * sizeof(IconFrame), "I Frames"); | 124 pIcons = (IconFrame *)malloc(uNumIcons * sizeof(IconFrame)); |
126 memcpy(pIcons, (char *)data_mm7 + 4, num_mm7_frames * sizeof(IconFrame)); | 125 memcpy(pIcons, (char *)data_mm7 + 4, num_mm7_frames * sizeof(IconFrame)); |
127 memcpy(pIcons + num_mm7_frames, (char *)data_mm6 + 4, num_mm6_frames * sizeof(IconFrame)); | 126 memcpy(pIcons + num_mm7_frames, (char *)data_mm6 + 4, num_mm6_frames * sizeof(IconFrame)); |
128 memcpy(pIcons + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 4, num_mm8_frames * sizeof(IconFrame)); | 127 memcpy(pIcons + num_mm6_frames + num_mm7_frames, (char *)data_mm8 + 4, num_mm8_frames * sizeof(IconFrame)); |
129 } | 128 } |
130 | 129 |
180 } | 179 } |
181 while ( fgets(&Buf, 490, File) ); | 180 while ( fgets(&Buf, 490, File) ); |
182 v4 = v21; | 181 v4 = v21; |
183 } | 182 } |
184 v2->uNumIcons = v4; | 183 v2->uNumIcons = v4; |
185 v5 = pAllocator->AllocNamedChunk(v2->pIcons, 32 * v4, "I Frames"); | 184 v5 = malloc(32 * v4);//, "I Frames"); |
186 v2->pIcons = (IconFrame *)v5; | 185 v2->pIcons = (IconFrame *)v5; |
187 if ( v5 ) | 186 if ( v5 ) |
188 { | 187 { |
189 v6 = File; | 188 v6 = File; |
190 v2->uNumIcons = 0; | 189 v2->uNumIcons = 0; |