Mercurial > audlegacy-plugins
comparison src/modplug/load_amf.cxx @ 2218:6907fc39b53f
That didn't merge properly. I'll try again at some other point.
author | William Pitcock <nenolod@atheme.org> |
---|---|
date | Fri, 07 Dec 2007 12:13:37 -0600 |
parents | 3673c7ec4ea2 |
children | 107c1fed3d92 |
comparison
equal
deleted
inserted
replaced
2217:6a4d667a9183 | 2218:6907fc39b53f |
---|---|
1 /* | 1 /* |
2 * This source code is public domain. | 2 * This program is free software; you can redistribute it and modify it |
3 * under the terms of the GNU General Public License as published by the | |
4 * Free Software Foundation; either version 2 of the license or (at your | |
5 * option) any later version. | |
3 * | 6 * |
4 * Authors: Olivier Lapicque <olivierl@jps.net> | 7 * Authors: Olivier Lapicque <olivierl@jps.net> |
5 */ | 8 */ |
6 | 9 |
7 /////////////////////////////////////////////////// | 10 /////////////////////////////////////////////////// |
8 // | 11 // |
9 // AMF module loader | 12 // AMF module loader |
10 // | 13 // |
218 { | 221 { |
219 MODCOMMAND *p = AllocatePattern(64, m_nChannels); | 222 MODCOMMAND *p = AllocatePattern(64, m_nChannels); |
220 if (!p) break; | 223 if (!p) break; |
221 Patterns[iPat] = p; | 224 Patterns[iPat] = p; |
222 PatternSize[iPat] = 64; | 225 PatternSize[iPat] = 64; |
223 PatternAllocSize[iPat] = 64; | |
224 const UCHAR *pin = lpStream + dwMemPos; | 226 const UCHAR *pin = lpStream + dwMemPos; |
225 for (UINT i=0; i<8*64; i++) | 227 for (UINT i=0; i<8*64; i++) |
226 { | 228 { |
227 p->note = 0; | 229 p->note = 0; |
228 | 230 |
310 Order[iOrd] = 0xFF; | 312 Order[iOrd] = 0xFF; |
311 if (iOrd < pfh->numorders) | 313 if (iOrd < pfh->numorders) |
312 { | 314 { |
313 Order[iOrd] = iOrd; | 315 Order[iOrd] = iOrd; |
314 PatternSize[iOrd] = 64; | 316 PatternSize[iOrd] = 64; |
315 PatternAllocSize[iOrd] = 64; | |
316 if (pfh->version >= 14) | 317 if (pfh->version >= 14) |
317 { | 318 { |
318 PatternSize[iOrd] = bswapLE16(*(USHORT *)(lpStream+dwMemPos)); | 319 PatternSize[iOrd] = bswapLE16(*(USHORT *)(lpStream+dwMemPos)); |
319 PatternAllocSize[iOrd] = bswapLE16(*(USHORT *)(lpStream+dwMemPos)); | |
320 dwMemPos += 2; | 320 dwMemPos += 2; |
321 } | 321 } |
322 ptracks[iOrd] = (USHORT *)(lpStream+dwMemPos); | 322 ptracks[iOrd] = (USHORT *)(lpStream+dwMemPos); |
323 dwMemPos += m_nChannels * sizeof(USHORT); | 323 dwMemPos += m_nChannels * sizeof(USHORT); |
324 } | 324 } |
351 } | 351 } |
352 sampleseekpos[iIns] = 0; | 352 sampleseekpos[iIns] = 0; |
353 if ((psh->type) && (bswapLE32(psh->offset) < dwMemLength-1)) | 353 if ((psh->type) && (bswapLE32(psh->offset) < dwMemLength-1)) |
354 { | 354 { |
355 sampleseekpos[iIns] = bswapLE32(psh->offset); | 355 sampleseekpos[iIns] = bswapLE32(psh->offset); |
356 if (bswapLE32(psh->offset) > maxsampleseekpos) maxsampleseekpos = bswapLE32(psh->offset); | 356 if (bswapLE32(psh->offset) > maxsampleseekpos) |
357 maxsampleseekpos = bswapLE32(psh->offset); | |
357 if ((pins->nLoopEnd > pins->nLoopStart + 2) | 358 if ((pins->nLoopEnd > pins->nLoopStart + 2) |
358 && (pins->nLoopEnd <= pins->nLength)) pins->uFlags |= CHN_LOOP; | 359 && (pins->nLoopEnd <= pins->nLength)) pins->uFlags |= CHN_LOOP; |
359 } | 360 } |
360 } | 361 } |
361 // Read Track Mapping Table | 362 // Read Track Mapping Table |
415 break; | 416 break; |
416 } | 417 } |
417 } | 418 } |
418 return TRUE; | 419 return TRUE; |
419 } | 420 } |
420 | |
421 |