From: <sag...@us...> - 2010-09-13 15:53:22
|
Revision: 709 http://modplug.svn.sourceforge.net/modplug/?rev=709&view=rev Author: saga-games Date: 2010-09-13 15:53:16 +0000 (Mon, 13 Sep 2010) Log Message: ----------- [Fix] Instrument editor: Changing the filter mode didn't set the file as modified. [Fix] (Just a theoretical fix at the moment, since OpenMPT just runs on little-endian hosts anyway): When converting ints to synchsafe ints, the input variable must match the host's endianness. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_ins.cpp trunk/OpenMPT/mptrack/tagging.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-09-12 19:55:14 UTC (rev 708) +++ trunk/OpenMPT/mptrack/Ctrl_ins.cpp 2010-09-13 15:53:16 UTC (rev 709) @@ -2311,16 +2311,17 @@ if ((!IsLocked()) && (pIns)) { int instFiltermode = m_CbnFilterMode.GetItemData(m_CbnFilterMode.GetCurSel()); - if (!m_pModDoc) { + if (!m_pModDoc) return; - } CSoundFile *pSndFile = m_pModDoc->GetSoundFile(); MODINSTRUMENT *pIns = pSndFile->Instruments[m_nInstrument]; - if (pIns) { + if (pIns) + { pIns->nFilterMode = instFiltermode; + m_pModDoc->SetModified(); // Translate from mode as stored in instrument to mode as understood by player. // (The reason for the translation is that the player treats 0 as lowpass, @@ -2334,11 +2335,12 @@ }*/ //Update channel settings where this instrument is active, if required. - if (instFiltermode != FLTMODE_UNCHANGED) { - for (UINT i=0; i<MAX_CHANNELS; i++) { - if (pSndFile->Chn[i].pModInstrument == pIns) { + if(instFiltermode != FLTMODE_UNCHANGED) + { + for (CHANNELINDEX i = 0; i < MAX_CHANNELS; i++) + { + if (pSndFile->Chn[i].pModInstrument == pIns) pSndFile->Chn[i].nFilterMode = instFiltermode; - } } } Modified: trunk/OpenMPT/mptrack/tagging.cpp =================================================================== --- trunk/OpenMPT/mptrack/tagging.cpp 2010-09-12 19:55:14 UTC (rev 708) +++ trunk/OpenMPT/mptrack/tagging.cpp 2010-09-13 15:53:16 UTC (rev 709) @@ -27,9 +27,9 @@ uint32 CFileTagging::intToSynchsafe(uint32 iIn) //--------------------------------------------- { - iIn = LittleEndian(iIn); uint32 iOut = 0, iSteps = 0; - do { + do + { iOut |= (iIn & 0x7F) << iSteps; iSteps += 8; } while(iIn >>= 7); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |