From: <sag...@us...> - 2011-11-06 15:05:16
|
Revision: 1133 http://modplug.svn.sourceforge.net/modplug/?rev=1133&view=rev Author: saga-games Date: 2011-11-06 15:05:09 +0000 (Sun, 06 Nov 2011) Log Message: ----------- [Fix] Instrument Editor: Envelope position display is now correct again in IT compatible mode. [Imp] Comments tab: Instrument list building is now more efficient (mostly noticeable in debug mode, but anyway...) [Mod] OpenMPT: Version is now 1.20.00.52 Modified Paths: -------------- trunk/OpenMPT/mptrack/MainFrm.cpp trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/mptrack/view_com.cpp Modified: trunk/OpenMPT/mptrack/MainFrm.cpp =================================================================== --- trunk/OpenMPT/mptrack/MainFrm.cpp 2011-11-05 15:15:50 UTC (rev 1132) +++ trunk/OpenMPT/mptrack/MainFrm.cpp 2011-11-06 15:05:09 UTC (rev 1133) @@ -1086,7 +1086,16 @@ env = &pChn->PanEnv; } - if (env->flags & ENV_ENABLED) p->dwPos[k] = MPTNOTIFY_POSVALID | (DWORD)(env->nEnvPosition); + if (env->flags & ENV_ENABLED) + { + DWORD pos = env->nEnvPosition; + if(m_pSndFile->IsCompatibleMode(TRK_IMPULSETRACKER) && pos > 0) + { + // Impulse Tracker envelope handling (see SndMix.cpp for details) + pos--; + } + p->dwPos[k] = MPTNOTIFY_POSVALID | pos; + } } } } else Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2011-11-05 15:15:50 UTC (rev 1132) +++ trunk/OpenMPT/mptrack/version.h 2011-11-06 15:05:09 UTC (rev 1133) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 20 #define VER_MINOR 00 -#define VER_MINORMINOR 51 +#define VER_MINORMINOR 52 //Creates version number from version parts that appears in version string. //For example MAKE_VERSION_NUMERIC(1,17,02,28) gives version number of Modified: trunk/OpenMPT/mptrack/view_com.cpp =================================================================== --- trunk/OpenMPT/mptrack/view_com.cpp 2011-11-05 15:15:50 UTC (rev 1132) +++ trunk/OpenMPT/mptrack/view_com.cpp 2011-11-06 15:05:09 UTC (rev 1133) @@ -8,6 +8,7 @@ #include "ChannelManagerDlg.h" #include "../common/StringFixer.h" #include "view_com.h" +#include <set> #define DETAILS_TOOLBAR_CY 28 @@ -238,9 +239,9 @@ { UINT nMax = nCount; if (nMax < pSndFile->GetNumSamples()) nMax = pSndFile->GetNumSamples(); - for (UINT iSmp=0; iSmp<nMax; iSmp++) + for (SAMPLEINDEX iSmp = 0; iSmp < nMax; iSmp++) { - if (iSmp < pSndFile->m_nSamples) + if (iSmp < pSndFile->GetNumSamples()) { UINT nCol = 0; for (UINT iCol=0; iCol<SMPLIST_COLUMNS; iCol++) @@ -271,24 +272,25 @@ } break; case SMPLIST_INSTR: - if (pSndFile->m_nInstruments) + if (pSndFile->GetNumInstruments()) { - UINT k = 0; - for (UINT i=0; i<pSndFile->m_nInstruments; i++) if (pSndFile->Instruments[i+1]) + bool first = true; + for (INSTRUMENTINDEX i = 0; i < pSndFile->GetNumInstruments(); i++) if (pSndFile->Instruments[i + 1]) { - MODINSTRUMENT *pIns = pSndFile->Instruments[i+1]; - for (UINT j=0; j<NOTE_MAX; j++) + MODINSTRUMENT *pIns = pSndFile->Instruments[i + 1]; + for (size_t j = 0; j < CountOf(pIns->Keyboard); j++) { - if ((UINT)pIns->Keyboard[j] == (iSmp+1)) + if (pIns->Keyboard[j] == (iSmp + 1)) { - if (k) strcat(s, ","); - wsprintf(stmp, "%d", i+1); + if (!first) strcat(s, ","); + first = false; + + wsprintf(stmp, "%d", i + 1); strcat(s, stmp); - k++; break; } } - if (strlen(s) > sizeof(s)-10) + if (strlen(s) > sizeof(s) - 10) { strcat(s, "..."); break; @@ -313,7 +315,7 @@ lvi.pszText = (LPTSTR)s; if ((iCol) || (iSmp < nCount)) { - BOOL bOk = TRUE; + bool bOk = true; if (iSmp < nCount) { lvi2 = lvi; @@ -321,7 +323,7 @@ lvi2.cchTextMax = sizeof(stmp); stmp[0] = 0; m_ItemList.GetItem(&lvi2); - if (!strcmp(s, stmp)) bOk = FALSE; + if (!strcmp(s, stmp)) bOk = false; } if (bOk) m_ItemList.SetItem(&lvi); } else @@ -340,7 +342,7 @@ if ((m_nCurrentListId == IDC_LIST_INSTRUMENTS) && (lHint & (HINT_MODTYPE|HINT_INSNAMES|HINT_INSTRUMENT))) { UINT nMax = nCount; - if (nMax < pSndFile->m_nInstruments) nMax = pSndFile->m_nInstruments; + if (nMax < pSndFile->GetNumInstruments()) nMax = pSndFile->GetNumInstruments(); for (UINT iIns=0; iIns<nMax; iIns++) { if (iIns < pSndFile->m_nInstruments) @@ -361,24 +363,26 @@ case INSLIST_SAMPLES: if (pIns) { - vector<bool> smpRef(MAX_SAMPLES, false); - for (UINT i=0; i<NOTE_MAX; i++) + std::set<SAMPLEINDEX> referencedSamples; + for(size_t i = 0; i < CountOf(pIns->Keyboard); i++) { - UINT n = pIns->Keyboard[i]; - if ((n) && (n < MAX_SAMPLES)) smpRef[n] = true; + referencedSamples.insert(pIns->Keyboard[i]); } - UINT k = 0; - for (UINT j=1; j<MAX_SAMPLES; j++) if (smpRef[j]) + + bool first = true; + for(std::set<SAMPLEINDEX>::iterator iter = referencedSamples.begin(); iter != referencedSamples.end(); iter++) { - if (k) strcat(s, ","); - UINT l = strlen(s); - if (l >= sizeof(s)-8) + if(!first) strcat(s, ","); + first = false; + + size_t l = strlen(s); + if(l >= sizeof(s) - 8) { strcat(s, "..."); break; } - wsprintf(s+l, "%d", j); - k++; + + wsprintf(s + l, "%d", *iter); } } break; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |