From: <sag...@us...> - 2014-01-20 21:45:51
|
Revision: 3584 http://sourceforge.net/p/modplug/code/3584 Author: saga-games Date: 2014-01-20 21:45:44 +0000 (Mon, 20 Jan 2014) Log Message: ----------- [Fix] Instrument editor: XM panning envelope should have a range of 0...63 instead of 0...64 (whyyyyy) [Fix] Tree view: Possible crash when loading a module with no patterns. Modified Paths: -------------- trunk/OpenMPT/mptrack/View_ins.cpp trunk/OpenMPT/mptrack/View_tre.cpp trunk/OpenMPT/soundlib/XMTools.h Modified: trunk/OpenMPT/mptrack/View_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_ins.cpp 2014-01-19 22:02:56 UTC (rev 3583) +++ trunk/OpenMPT/mptrack/View_ins.cpp 2014-01-20 21:45:44 UTC (rev 3584) @@ -314,7 +314,8 @@ } if(nValue >= 0) { - if(nValue > 64) nValue = 64; + const int maxVal = (GetDocument()->GetModType() != MOD_TYPE_XM || m_nEnv != ENV_PANNING) ? 64 : 63; + LimitMax(nValue, maxVal); if(nValue != envelope->Values[nPoint]) { envelope->Values[nPoint] = (uint8)nValue; Modified: trunk/OpenMPT/mptrack/View_tre.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_tre.cpp 2014-01-19 22:02:56 UTC (rev 3583) +++ trunk/OpenMPT/mptrack/View_tre.cpp 2014-01-20 21:45:44 UTC (rev 3584) @@ -170,6 +170,7 @@ { SetEvent(m_hWatchDirKillThread); WaitForSingleObject(watchDirThread, INFINITE); + CloseHandle(watchDirThread); } } @@ -934,7 +935,7 @@ } } // Add Patterns - if (info.hPatterns && (hintFlagPart & (HINT_MODTYPE | HINT_PATNAMES))) + if (info.hPatterns && (hintFlagPart & (HINT_MODTYPE | HINT_PATNAMES)) && sndFile.Patterns.Size() > 0) { const PATTERNINDEX nPat = (PATTERNINDEX)(lHint >> HINT_SHIFT_PAT); info.tiPatterns.resize(sndFile.Patterns.Size(), NULL); @@ -1821,6 +1822,7 @@ PostMessage(WM_COMMAND, ID_MODTREE_REFRESHINSTRLIB); } } while(result != WAIT_OBJECT_0); + CloseHandle(m_hWatchDirKillThread); } Modified: trunk/OpenMPT/soundlib/XMTools.h =================================================================== --- trunk/OpenMPT/soundlib/XMTools.h 2014-01-19 22:02:56 UTC (rev 3583) +++ trunk/OpenMPT/soundlib/XMTools.h 2014-01-20 21:45:44 UTC (rev 3584) @@ -58,8 +58,8 @@ }; uint8 sampleMap[96]; // Note -> Sample assignment - uint16 volEnv[24]; // Volume envelope nodes / values - uint16 panEnv[24]; // Panning envelope nodes / values + uint16 volEnv[24]; // Volume envelope nodes / values (0...64) + uint16 panEnv[24]; // Panning envelope nodes / values (0...63) uint8 volPoints; // Volume envelope length uint8 panPoints; // Panning envelope length uint8 volSustain; // Volume envelope sustain point This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |