From: <sag...@us...> - 2012-07-13 18:45:23
|
Revision: 1325 http://modplug.svn.sourceforge.net/modplug/?rev=1325&view=rev Author: saga-games Date: 2012-07-13 18:45:15 +0000 (Fri, 13 Jul 2012) Log Message: ----------- [Fix] OpenMPT didn't write more than 255 plugins to the settings file (http://bugs.openmpt.org/view.php?id=267) [Imp] Mod Upgrade: gxx/3xx combinations in XM files made with older versions of OpenMPT are now tried to be upgraded to the new behaviour. Modified Paths: -------------- trunk/OpenMPT/mptrack/Mptrack.cpp trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/mptrack/Mptrack.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mptrack.cpp 2012-07-09 22:07:00 UTC (rev 1324) +++ trunk/OpenMPT/mptrack/Mptrack.cpp 2012-07-13 18:45:15 UTC (rev 1325) @@ -1576,7 +1576,7 @@ m_bmp.LoadBitmap(MAKEINTRESOURCE(IDB_MPTRACK)); wsprintf(s, "Build Date: %s", gszBuildDate); SetDlgItemText(IDC_EDIT2, s); - SetDlgItemText(IDC_EDIT3, CString("OpenMPT ") + MptVersion::str + " (development build)"); + SetDlgItemText(IDC_EDIT3, CString("OpenMPT ") + MptVersion::str); m_heContact.SetWindowText( "Contact / Discussion:\r\n" @@ -1584,10 +1584,11 @@ "\r\nUpdates:\r\n" "http://openmpt.org/download"); - const char* const pArrCredit = { + static const char* const pArrCredit = + { "OpenMPT / ModPlug Tracker|" "Copyright \xA9 2004-2012 Contributors|" - "Copyright \xA9 1997-2003 Olivier Lapicque (ol...@mo...)|" + "Copyright \xA9 1997-2003 Olivier Lapicque|" "|" "Contributors:|" "Johannes Schultz (2008-2012)|" @@ -1633,16 +1634,16 @@ "||||||" }; - m_static.SubclassDlgItem(IDC_CREDITS,this); - m_static.SetCredits(pArrCredit); - m_static.SetSpeed(DISPLAY_SLOW); - m_static.SetColor(BACKGROUND_COLOR, RGB(138, 165, 219)); // Background Colour - m_static.SetTransparent(); // Set parts of bitmaps with RGB(192,192,192) transparent - m_static.SetGradient(GRADIENT_LEFT_DARK); // Background goes from blue to black from left to right - // m_static.SetBkImage(IDB_BITMAP1); // Background image - m_static.StartScrolling(); - return TRUE; // return TRUE unless you set the focus to a control - // EXCEPTION: OCX Property Pages should return FALSE + m_static.SubclassDlgItem(IDC_CREDITS,this); + m_static.SetCredits(pArrCredit); + m_static.SetSpeed(DISPLAY_SLOW); + m_static.SetColor(BACKGROUND_COLOR, RGB(138, 165, 219)); // Background Colour + m_static.SetTransparent(); // Set parts of bitmaps with RGB(192,192,192) transparent + m_static.SetGradient(GRADIENT_LEFT_DARK); // Background goes from blue to black from left to right + // m_static.SetBkImage(IDB_BITMAP1); // Background image + m_static.StartScrolling(); + return TRUE; // return TRUE unless you set the focus to a control + // EXCEPTION: OCX Property Pages should return FALSE } @@ -2176,11 +2177,10 @@ //----------------------------------- { TCHAR s[_MAX_PATH], tmp[32]; - LONG nPlugins; m_pPluginManager = new CVstPluginManager; - if (!m_pPluginManager) return FALSE; - nPlugins = GetPrivateProfileInt("VST Plugins", "NumPlugins", 0, m_szConfigFileName); + if(!m_pPluginManager) return FALSE; + const size_t numPlugins = GetPrivateProfileInt("VST Plugins", "NumPlugins", 0, m_szConfigFileName); #ifndef NO_VST char buffer[64]; @@ -2210,10 +2210,10 @@ CString nonFoundPlugs; const CString failedPlugin = CMainFrame::GetPrivateProfileCString("VST Plugins", "FailedPlugin", "", m_szConfigFileName); - for (LONG iPlug=0; iPlug<nPlugins; iPlug++) + for(size_t plug = 0; plug < numPlugins; plug++) { s[0] = 0; - wsprintf(tmp, "Plugin%d", iPlug); + wsprintf(tmp, "Plugin%d", plug); GetPrivateProfileString("VST Plugins", tmp, "", s, sizeof(s), m_szConfigFileName); if (s[0]) { @@ -2227,7 +2227,7 @@ continue; } } - m_pPluginManager->AddPlugin(s, TRUE, true, &nonFoundPlugs); + m_pPluginManager->AddPlugin(s, true, true, &nonFoundPlugs); } } if(nonFoundPlugs.GetLength() > 0) @@ -2242,31 +2242,31 @@ BOOL CTrackApp::UninitializeDXPlugins() //------------------------------------- { - if (!m_pPluginManager) return FALSE; + if(!m_pPluginManager) return FALSE; #ifndef NO_VST TCHAR s[_MAX_PATH], tmp[32]; VSTPluginLib *pPlug; pPlug = m_pPluginManager->GetFirstPlugin(); - PLUGINDEX iPlug = 0; - while (pPlug) + size_t plug = 0; + while(pPlug) { - if (pPlug->dwPluginId1 != kDmoMagic) + if(pPlug->dwPluginId1 != kDmoMagic) { s[0] = 0; - wsprintf(tmp, "Plugin%d", iPlug); + wsprintf(tmp, "Plugin%d", plug); strcpy(s, pPlug->szDllPath); if(theApp.IsPortableMode()) { AbsolutePathToRelative(s); } WritePrivateProfileString("VST Plugins", tmp, s, m_szConfigFileName); - iPlug++; + plug++; } pPlug = pPlug->pNext; } - wsprintf(s, "%d", iPlug); + wsprintf(s, "%d", plug); WritePrivateProfileString("VST Plugins", "NumPlugins", s, m_szConfigFileName); #endif // NO_VST Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2012-07-09 22:07:00 UTC (rev 1324) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2012-07-13 18:45:15 UTC (rev 1325) @@ -2121,8 +2121,8 @@ if(pSndFile->GetType() == MOD_TYPE_XM) { - if(pSndFile->m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 19, 00, 00) || - (!pSndFile->IsCompatibleMode(TRK_FASTTRACKER2) && pSndFile->m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 20, 00, 00))) + if(pSndFile->m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 19, 00, 00) + || (!pSndFile->IsCompatibleMode(TRK_FASTTRACKER2) && pSndFile->m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 20, 00, 00))) { if(m.command == CMD_OFFSET && m.volcmd == VOLCMD_TONEPORTAMENTO) { @@ -2131,6 +2131,18 @@ m.command = CMD_NONE; } } + + if(pSndFile->m_dwLastSavedWithVersion < MAKE_VERSION_NUMERIC(1, 20, 01, 10) + && pSndFile->m_dwLastSavedWithVersion != MAKE_VERSION_NUMERIC(1, 20, 00, 00) // Ignore compatibility export + && m.volcmd == VOLCMD_TONEPORTAMENTO && m.command == CMD_TONEPORTAMENTO + && (m.vol != 0 || pSndFile->IsCompatibleMode(TRK_FASTTRACKER2)) && m.param != 0) + { + // Mx and 3xx on the same row does weird things in FT2: 3xx is completely ignored and the Mx parameter is doubled. Fixed in revision 1312 / OpenMPT 1.20.01.10 + // Previously the values were just added up, so let's fix this! + m.volcmd = VOLCMD_NONE; + const uint16 param = static_cast<uint16>(m.param) + static_cast<uint16>(m.vol << 4); + m.param = static_cast<uint8>(Util::Min(param, uint16(0xFF))); + } } chn++; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |