From: <sag...@us...> - 2010-05-04 13:12:09
|
Revision: 584 http://modplug.svn.sourceforge.net/modplug/?rev=584&view=rev Author: saga-games Date: 2010-05-04 13:11:59 +0000 (Tue, 04 May 2010) Log Message: ----------- [Fix] MOD Loader: Very short loops (4-8 bytes long) are not ignored anymore. This fixes "Crew Generation" by Necros. [Ref] Some code cleanup Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/Moddoc.h trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/soundlib/LOAD_AMF.CPP trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/Load_ptm.cpp trunk/OpenMPT/soundlib/Load_s3m.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-05-01 22:35:46 UTC (rev 583) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-05-04 13:11:59 UTC (rev 584) @@ -3343,6 +3343,7 @@ //end rewbs.customKeys void CModDoc::TogglePluginEditor(UINT m_nCurrentPlugin) +//----------------------------------------------------- { PSNDMIXPLUGIN pPlugin; @@ -3356,8 +3357,8 @@ return; } -void CModDoc::ChangeFileExtension(UINT nNewType) -//---------------------------------------------- +void CModDoc::ChangeFileExtension(MODTYPE nNewType) +//------------------------------------------------- { //Not making path if path is empty(case only(?) for new file) if(GetPathName().GetLength() > 0) @@ -3409,22 +3410,22 @@ UINT CModDoc::FindAvailableChannel() -//------------------------------------------- +//---------------------------------- { // Search for available channel - for (UINT j=m_SndFile.m_nChannels; j<MAX_CHANNELS; j++) { + for (CHANNELINDEX j = m_SndFile.m_nChannels; j < MAX_CHANNELS; j++) + { MODCHANNEL *p = &m_SndFile.Chn[j]; - if (!p->nLength) { + if (!p->nLength) return j; - } } // Not found: look for one that's stopped - for (UINT j=m_SndFile.m_nChannels; j<MAX_CHANNELS; j++) { + for (CHANNELINDEX j = m_SndFile.m_nChannels; j < MAX_CHANNELS; j++) + { MODCHANNEL *p = &m_SndFile.Chn[j]; - if (p->dwFlags & CHN_NOTEFADE) { + if (p->dwFlags & CHN_NOTEFADE) return j; - } } //Last resort: go for first virutal channel. @@ -3440,7 +3441,8 @@ void CModDoc::LearnMacro(int macroToSet, long paramToUse) //------------------------------------------------------- { - if (macroToSet<0 || macroToSet>NMACROS) { + if (macroToSet<0 || macroToSet>NMACROS) + { return; } Modified: trunk/OpenMPT/mptrack/Moddoc.h =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.h 2010-05-01 22:35:46 UTC (rev 583) +++ trunk/OpenMPT/mptrack/Moddoc.h 2010-05-04 13:11:59 UTC (rev 584) @@ -378,7 +378,7 @@ DECLARE_MESSAGE_MAP() private: - void ChangeFileExtension(UINT nNewType); + void ChangeFileExtension(MODTYPE nNewType); UINT FindAvailableChannel(); }; Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2010-05-01 22:35:46 UTC (rev 583) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2010-05-04 13:11:59 UTC (rev 584) @@ -444,7 +444,6 @@ if (CSoundFile::GetSysInfo() & SYSMIX_SLOWCPU) ::EnableWindow(::GetDlgItem(m_hWnd, IDC_CHECK3), FALSE); else if (dwQuality & QUALITY_EQ) CheckDlgButton(IDC_CHECK3, MF_CHECKED); - if (CSoundFile::gdwSoundSetup & SNDMIX_EMULATE_MIX_BUGS) CheckDlgButton(IDC_CHECK7, MF_CHECKED); //rewbs.emulateMixBugs // Bass Expansion m_SbXBassDepth.SetRange(0,4); @@ -595,14 +594,6 @@ if (IsDlgButtonChecked(IDC_CHECK6)) dwQuality |= QUALITY_REVERB; dwSrcMode = m_CbnResampling.GetCurSel(); - //rewbs.emulateMixBugs - if (IsDlgButtonChecked(IDC_CHECK7)) { - CSoundFile::gdwSoundSetup |= SNDMIX_EMULATE_MIX_BUGS; - } else { - CSoundFile::gdwSoundSetup &= ~SNDMIX_EMULATE_MIX_BUGS; - } - //end rewbs.emulateMixBugs - // Bass Expansion { UINT nXBassDepth = 8-m_SbXBassDepth.GetPos(); Modified: trunk/OpenMPT/soundlib/LOAD_AMF.CPP =================================================================== --- trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2010-05-01 22:35:46 UTC (rev 583) +++ trunk/OpenMPT/soundlib/LOAD_AMF.CPP 2010-05-04 13:11:59 UTC (rev 584) @@ -54,7 +54,7 @@ extern void Log(LPCSTR, ...); #endif -VOID AMF_Unpack(MODCOMMAND *pPat, const BYTE *pTrack, UINT nRows, UINT nChannels) +void AMF_Unpack(MODCOMMAND *pPat, const BYTE *pTrack, UINT nRows, UINT nChannels) //------------------------------------------------------------------------------- { UINT lastinstr = 0; Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2010-05-01 22:35:46 UTC (rev 583) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2010-05-04 13:11:59 UTC (rev 584) @@ -280,8 +280,8 @@ if (psmp->nLoopStart >= psmp->nLength) { psmp->nLoopStart = psmp->nLength-1; derr|=1; } if (psmp->nLoopEnd > psmp->nLength) { psmp->nLoopEnd = psmp->nLength; derr |= 1; } if (psmp->nLoopStart > psmp->nLoopEnd) derr |= 1; - if ((psmp->nLoopStart > psmp->nLoopEnd) || (psmp->nLoopEnd <= 8) - || (psmp->nLoopEnd - psmp->nLoopStart <= 4)) + if ((psmp->nLoopStart > psmp->nLoopEnd) || (psmp->nLoopEnd < 4) + || (psmp->nLoopEnd - psmp->nLoopStart < 4)) { psmp->nLoopStart = 0; psmp->nLoopEnd = 0; Modified: trunk/OpenMPT/soundlib/Load_ptm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ptm.cpp 2010-05-01 22:35:46 UTC (rev 583) +++ trunk/OpenMPT/soundlib/Load_ptm.cpp 2010-05-04 13:11:59 UTC (rev 584) @@ -173,13 +173,10 @@ if (dwMemPos + 2 > dwMemLength) break; m[nChn].command = lpStream[dwMemPos++]; m[nChn].param = lpStream[dwMemPos++]; - if ((m[nChn].command == 0x0E) && ((m[nChn].param & 0xF0) == 0x80)) - { - m[nChn].command = CMD_S3MCMDEX; - } else if (m[nChn].command < 0x10) { ConvertModCommand(&m[nChn]); + MODExx2S3MSxx(&m[nChn]); } else { switch(m[nChn].command) Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-05-01 22:35:46 UTC (rev 583) +++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2010-05-04 13:11:59 UTC (rev 584) @@ -16,8 +16,6 @@ #pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data" -extern WORD S3MFineTuneTable[16]; - ////////////////////////////////////////////////////// // ScreamTracker S3M file support Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2010-05-01 22:35:46 UTC (rev 583) +++ trunk/OpenMPT/soundlib/Sndfile.h 2010-05-04 13:11:59 UTC (rev 584) @@ -635,7 +635,7 @@ void SetMasterVolume(UINT vol, bool adjustAGC = false); UINT GetMasterVolume() const { return m_nMasterVolume; } - ORDERINDEX GetNumPatterns() const; + PATTERNINDEX GetNumPatterns() const; INSTRUMENTINDEX GetNumInstruments() const { return m_nInstruments; } SAMPLEINDEX GetNumSamples() const { return m_nSamples; } UINT GetCurrentPos() const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |