From: <sag...@us...> - 2014-04-09 19:13:15
|
Revision: 4006 http://sourceforge.net/p/modplug/code/4006 Author: saga-games Date: 2014-04-09 19:13:07 +0000 (Wed, 09 Apr 2014) Log Message: ----------- [Fix] Message when removing instrument was never shown [Fix] Some sample editor updates were incomplete. [Fix] Song time signature ignoring stopped working for older MPT versions a while ago. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_smp.cpp trunk/OpenMPT/mptrack/Modedit.cpp trunk/OpenMPT/mptrack/View_smp.cpp trunk/OpenMPT/soundlib/Load_it.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-04-09 01:07:20 UTC (rev 4005) +++ trunk/OpenMPT/mptrack/Ctrl_smp.cpp 2014-04-09 19:13:07 UTC (rev 4006) @@ -3024,7 +3024,7 @@ if(nCode == SB_ENDSCROLL) SwitchToView(); if(redraw) { - SetModified(HINT_SAMPLEINFO, false); + SetModified(HINT_SAMPLEINFO | HINT_SAMPLEDATA, false); } UnlockControls(); } Modified: trunk/OpenMPT/mptrack/Modedit.cpp =================================================================== --- trunk/OpenMPT/mptrack/Modedit.cpp 2014-04-09 01:07:20 UTC (rev 4005) +++ trunk/OpenMPT/mptrack/Modedit.cpp 2014-04-09 19:13:07 UTC (rev 4006) @@ -863,9 +863,7 @@ { bool instrumentsLeft = false; ConfirmAnswer result = cnfNo; - std::vector<bool> samples; - m_SndFile.Instruments[nIns]->GetSamples(samples); - if(!samples.empty()) result = Reporting::Confirm("Remove samples associated with an instrument if they are unused?", "Removing instrument", true); + if(!m_SndFile.Instruments[nIns]->GetSamples().empty()) result = Reporting::Confirm("Remove samples associated with an instrument if they are unused?", "Removing instrument", true); if(result == cnfCancel) { return false; Modified: trunk/OpenMPT/mptrack/View_smp.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_smp.cpp 2014-04-09 01:07:20 UTC (rev 4005) +++ trunk/OpenMPT/mptrack/View_smp.cpp 2014-04-09 19:13:07 UTC (rev 4006) @@ -2049,7 +2049,7 @@ sample.PrecomputeLoops(sndFile); } SetCurSel(0, 0); - SetModified(dwUpdateFlags, false); + SetModified(dwUpdateFlags, true); } Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2014-04-09 01:07:20 UTC (rev 4005) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2014-04-09 19:13:07 UTC (rev 4006) @@ -413,25 +413,6 @@ if(GetType() == MOD_TYPE_IT) mptStartPos = file.GetLength(); - // Read row highlights - if((fileHeader.special & ITFileHeader::embedPatternHighlights)) - { - // MPT 1.09, 1.07 and most likely other old MPT versions leave this blank (0/0), but have the "special" flag set. - // Newer versions of MPT and OpenMPT 1.17 *always* write 4/16 here. - // Thus, we will just ignore those old versions. - if(m_dwLastSavedWithVersion == 0 || m_dwLastSavedWithVersion >= MAKE_VERSION_NUMERIC(1, 17, 03, 02)) - { - m_nDefaultRowsPerBeat = fileHeader.highlight_minor; - m_nDefaultRowsPerMeasure = fileHeader.highlight_major; - } -#ifdef _DEBUG - if((fileHeader.highlight_minor | fileHeader.highlight_major) == 0) - { - Log("IT Header: Row highlight is 0"); - } -#endif - } - m_SongFlags.set(SONG_LINEARSLIDES, (fileHeader.flags & ITFileHeader::linearSlides) != 0); m_SongFlags.set(SONG_ITOLDEFFECTS, (fileHeader.flags & ITFileHeader::itOldEffects) != 0); m_SongFlags.set(SONG_ITCOMPATGXX, (fileHeader.flags & ITFileHeader::itCompatGxx) != 0); @@ -1001,6 +982,19 @@ } } + // Read row highlights + if((fileHeader.special & ITFileHeader::embedPatternHighlights)) + { + // MPT 1.09 and older (and maybe also newer) versions leave this blank (0/0), but have the "special" flag set. + // Newer versions of MPT and OpenMPT 1.17 *always* write 4/16 here. + // Thus, we will just ignore those old versions. + if(m_dwLastSavedWithVersion == 0 || m_dwLastSavedWithVersion >= MAKE_VERSION_NUMERIC(1, 17, 03, 02)) + { + m_nDefaultRowsPerBeat = fileHeader.highlight_minor; + m_nDefaultRowsPerMeasure = fileHeader.highlight_major; + } + } + if(GetType() == MOD_TYPE_IT) { // Set appropriate mod flags if the file was not made with MPT. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |