Mercurial > audlegacy-plugins
diff src/modplug/load_mtm.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 |
line wrap: on
line diff
--- a/src/modplug/load_mtm.cxx Fri Dec 07 12:09:16 2007 -0600 +++ b/src/modplug/load_mtm.cxx Fri Dec 07 12:13:37 2007 -0600 @@ -59,8 +59,8 @@ || (!pmh->lastpattern) || (pmh->lastpattern > MAX_PATTERNS)) return FALSE; strncpy(m_szNames[0], pmh->songname, 20); m_szNames[0][20] = 0; - if (dwMemPos + 37*pmh->numsamples + 128 + 192*bswapLE16(pmh->numtracks) - + 64 * (pmh->lastpattern+1) + bswapLE16(pmh->commentsize) >= dwMemLength) return FALSE; + if (dwMemPos + 37*pmh->numsamples + 128 + 192*pmh->numtracks + + 64 * (pmh->lastpattern+1) + pmh->commentsize >= dwMemLength) return FALSE; m_nType = MOD_TYPE_MTM; m_nSamples = pmh->numsamples; m_nChannels = pmh->numchannels; @@ -72,12 +72,12 @@ m_szNames[i][22] = 0; Ins[i].nVolume = pms->volume << 2; Ins[i].nGlobalVol = 64; - DWORD len = bswapLE32(pms->length); + DWORD len = pms->length; if ((len > 4) && (len <= MAX_SAMPLE_LENGTH)) { Ins[i].nLength = len; - Ins[i].nLoopStart = bswapLE32(pms->reppos); - Ins[i].nLoopEnd = bswapLE32(pms->repend); + Ins[i].nLoopStart = pms->reppos; + Ins[i].nLoopEnd = pms->repend; if (Ins[i].nLoopEnd > Ins[i].nLength) Ins[i].nLoopEnd = Ins[i].nLength; if (Ins[i].nLoopStart + 4 >= Ins[i].nLoopEnd) Ins[i].nLoopStart = Ins[i].nLoopEnd = 0; if (Ins[i].nLoopEnd) Ins[i].uFlags |= CHN_LOOP; @@ -104,14 +104,13 @@ dwMemPos += 128; // Reading Patterns LPCBYTE pTracks = lpStream + dwMemPos; - dwMemPos += 192 * bswapLE16(pmh->numtracks); + dwMemPos += 192 * pmh->numtracks; LPWORD pSeq = (LPWORD)(lpStream + dwMemPos); for (UINT pat=0; pat<=pmh->lastpattern; pat++) { PatternSize[pat] = 64; - PatternAllocSize[pat] = 64; if ((Patterns[pat] = AllocatePattern(64, m_nChannels)) == NULL) break; - for (UINT n=0; n<32; n++) if ((pSeq[n]) && (pSeq[n] <= bswapLE16(pmh->numtracks)) && (n < m_nChannels)) + for (UINT n=0; n<32; n++) if ((pSeq[n]) && (pSeq[n] <= pmh->numtracks) && (n < m_nChannels)) { LPCBYTE p = pTracks + 192 * (pSeq[n]-1); MODCOMMAND *m = Patterns[pat] + n; @@ -133,9 +132,9 @@ pSeq += 32; } dwMemPos += 64*(pmh->lastpattern+1); - if (bswapLE16(pmh->commentsize) && (dwMemPos + bswapLE16(pmh->commentsize) < dwMemLength)) + if ((pmh->commentsize) && (dwMemPos + pmh->commentsize < dwMemLength)) { - UINT n = bswapLE16(pmh->commentsize); + UINT n = pmh->commentsize; m_lpszSongComments = new char[n+1]; if (m_lpszSongComments) { @@ -150,7 +149,7 @@ } } } - dwMemPos += bswapLE16(pmh->commentsize); + dwMemPos += pmh->commentsize; // Reading Samples for (UINT ismp=1; ismp<=m_nSamples; ismp++) {