Diffstat (limited to 'core/multimedia/opieplayer/modplug/load_mdl.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/modplug/load_mdl.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/multimedia/opieplayer/modplug/load_mdl.cpp b/core/multimedia/opieplayer/modplug/load_mdl.cpp index 806b68b..e1f78d5 100644 --- a/core/multimedia/opieplayer/modplug/load_mdl.cpp +++ b/core/multimedia/opieplayer/modplug/load_mdl.cpp | |||
@@ -224,49 +224,49 @@ BOOL CSoundFile::ReadMDL(const BYTE *lpStream, DWORD dwMemLength) | |||
224 | pmib = (MDLINFOBLOCK *)(lpStream+dwMemPos); | 224 | pmib = (MDLINFOBLOCK *)(lpStream+dwMemPos); |
225 | memcpy(m_szNames[0], pmib->songname, 32); | 225 | memcpy(m_szNames[0], pmib->songname, 32); |
226 | norders = pmib->norders; | 226 | norders = pmib->norders; |
227 | if (norders > MAX_ORDERS) norders = MAX_ORDERS; | 227 | if (norders > MAX_ORDERS) norders = MAX_ORDERS; |
228 | m_nRestartPos = pmib->repeatpos; | 228 | m_nRestartPos = pmib->repeatpos; |
229 | m_nDefaultGlobalVolume = pmib->globalvol; | 229 | m_nDefaultGlobalVolume = pmib->globalvol; |
230 | m_nDefaultTempo = pmib->tempo; | 230 | m_nDefaultTempo = pmib->tempo; |
231 | m_nDefaultSpeed = pmib->speed; | 231 | m_nDefaultSpeed = pmib->speed; |
232 | m_nChannels = 4; | 232 | m_nChannels = 4; |
233 | for (i=0; i<32; i++) | 233 | for (i=0; i<32; i++) |
234 | { | 234 | { |
235 | ChnSettings[i].nVolume = 64; | 235 | ChnSettings[i].nVolume = 64; |
236 | ChnSettings[i].nPan = (pmib->channelinfo[i] & 0x7F) << 1; | 236 | ChnSettings[i].nPan = (pmib->channelinfo[i] & 0x7F) << 1; |
237 | if (pmib->channelinfo[i] & 0x80) | 237 | if (pmib->channelinfo[i] & 0x80) |
238 | ChnSettings[i].dwFlags |= CHN_MUTE; | 238 | ChnSettings[i].dwFlags |= CHN_MUTE; |
239 | else | 239 | else |
240 | m_nChannels = i+1; | 240 | m_nChannels = i+1; |
241 | } | 241 | } |
242 | for (j=0; j<norders; j++) Order[j] = pmib->seq[j]; | 242 | for (j=0; j<norders; j++) Order[j] = pmib->seq[j]; |
243 | break; | 243 | break; |
244 | // ME: song message | 244 | // ME: song message |
245 | case 0x454D: | 245 | case 0x454D: |
246 | if (blocklen) | 246 | if (blocklen) |
247 | { | 247 | { |
248 | if (m_lpszSongComments) delete m_lpszSongComments; | 248 | if (m_lpszSongComments) delete [] m_lpszSongComments; |
249 | m_lpszSongComments = new char[blocklen]; | 249 | m_lpszSongComments = new char[blocklen]; |
250 | if (m_lpszSongComments) | 250 | if (m_lpszSongComments) |
251 | { | 251 | { |
252 | memcpy(m_lpszSongComments, lpStream+dwMemPos, blocklen); | 252 | memcpy(m_lpszSongComments, lpStream+dwMemPos, blocklen); |
253 | m_lpszSongComments[blocklen-1] = 0; | 253 | m_lpszSongComments[blocklen-1] = 0; |
254 | } | 254 | } |
255 | } | 255 | } |
256 | break; | 256 | break; |
257 | // PA: Pattern Data | 257 | // PA: Pattern Data |
258 | case 0x4150: | 258 | case 0x4150: |
259 | npatterns = lpStream[dwMemPos]; | 259 | npatterns = lpStream[dwMemPos]; |
260 | if (npatterns > MAX_PATTERNS) npatterns = MAX_PATTERNS; | 260 | if (npatterns > MAX_PATTERNS) npatterns = MAX_PATTERNS; |
261 | dwPos = dwMemPos + 1; | 261 | dwPos = dwMemPos + 1; |
262 | for (i=0; i<npatterns; i++) | 262 | for (i=0; i<npatterns; i++) |
263 | { | 263 | { |
264 | if (dwPos+18 >= dwMemLength) break; | 264 | if (dwPos+18 >= dwMemLength) break; |
265 | pmpd = (MDLPATTERNDATA *)(lpStream + dwPos); | 265 | pmpd = (MDLPATTERNDATA *)(lpStream + dwPos); |
266 | if (pmpd->channels > 32) break; | 266 | if (pmpd->channels > 32) break; |
267 | PatternSize[i] = pmpd->lastrow+1; | 267 | PatternSize[i] = pmpd->lastrow+1; |
268 | if (m_nChannels < pmpd->channels) m_nChannels = pmpd->channels; | 268 | if (m_nChannels < pmpd->channels) m_nChannels = pmpd->channels; |
269 | dwPos += 18 + 2*pmpd->channels; | 269 | dwPos += 18 + 2*pmpd->channels; |
270 | for (j=0; j<pmpd->channels; j++) | 270 | for (j=0; j<pmpd->channels; j++) |
271 | { | 271 | { |
272 | patterntracks[i*32+j] = pmpd->data[j]; | 272 | patterntracks[i*32+j] = pmpd->data[j]; |