From: <sag...@us...> - 2011-10-15 13:37:04
|
Revision: 1104 http://modplug.svn.sourceforge.net/modplug/?rev=1104&view=rev Author: saga-games Date: 2011-10-15 13:36:57 +0000 (Sat, 15 Oct 2011) Log Message: ----------- [Fix] ITI Saving: Sample name / file name are now also sanitized. [Fix] Pattern Editor: Replacing "no note" with note + 1 or note + 12 will not create C-0 / B-0 notes in the pattern anymore. [Fix] Pattern Editor: When default volumes are enabled, default volume is now also shown for instrument notes that have no sample assigned (for VSTi) Modified Paths: -------------- trunk/OpenMPT/mptrack/Draw_pat.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/soundlib/Sampleio.cpp Modified: trunk/OpenMPT/mptrack/Draw_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-10-12 19:10:41 UTC (rev 1103) +++ trunk/OpenMPT/mptrack/Draw_pat.cpp 2011-10-15 13:36:57 UTC (rev 1104) @@ -477,10 +477,13 @@ sample = 0; } } + volcmd = VOLCMD_VOLUME; if(sample && sample <= pSndFile->GetNumSamples()) { - volcmd = VOLCMD_VOLUME; vol = pSndFile->GetSample(sample).nVolume / 4; + } else + { + vol = 64; } } Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2011-10-12 19:10:41 UTC (rev 1103) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2011-10-15 13:36:57 UTC (rev 1104) @@ -2044,29 +2044,29 @@ { // Just create one logic undo step when auto-replacing all occurences. const bool linkUndoBuffer = (nFound > 1) && (m_findReplace.dwReplaceFlags & PATSEARCH_REPLACEALL) != 0; - pModDoc->GetPatternUndo()->PrepareUndo(nPat, n % pSndFile->m_nChannels, n / pSndFile->m_nChannels, 1, 1, linkUndoBuffer); + pModDoc->GetPatternUndo()->PrepareUndo(nPat, n % pSndFile->GetNumChannels(), n / pSndFile->GetNumChannels(), 1, 1, linkUndoBuffer); if ((m_findReplace.dwReplaceFlags & PATSEARCH_NOTE)) { // -1 octave if (m_findReplace.cmdReplace.note == CFindReplaceTab::replaceNoteMinusOctave) { - if (m->note > 12) m->note -= 12; + if (m->note > (12 + NOTE_MIN - 1) && m->note <= NOTE_MAX) m->note -= 12; } else // +1 octave if (m_findReplace.cmdReplace.note == CFindReplaceTab::replaceNotePlusOctave) { - if (m->note <= NOTE_MAX - 12) m->note += 12; + if (m->note <= NOTE_MAX - 12 && m->note >= NOTE_MIN) m->note += 12; } else // Note-- if (m_findReplace.cmdReplace.note == CFindReplaceTab::replaceNoteMinusOne) { - if (m->note > 1) m->note--; + if (m->note > NOTE_MIN && m->note <= NOTE_MAX) m->note--; } else // Note++ if (m_findReplace.cmdReplace.note == CFindReplaceTab::replaceNotePlusOne) { - if (m->note < NOTE_MAX) m->note++; + if (m->note < NOTE_MAX && m->note >= NOTE_MIN) m->note++; } else // Replace with another note { Modified: trunk/OpenMPT/soundlib/Sampleio.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sampleio.cpp 2011-10-12 19:10:41 UTC (rev 1103) +++ trunk/OpenMPT/soundlib/Sampleio.cpp 2011-10-15 13:36:57 UTC (rev 1104) @@ -1393,7 +1393,7 @@ // XI Sample Data for (UINT dsmp=0; dsmp<nsamples; dsmp++) { - MODSAMPLE *pSmp = &Samples[smptable[dsmp]]; + const MODSAMPLE *pSmp = &Samples[smptable[dsmp]]; UINT smpflags = (pSmp->uFlags & CHN_16BIT) ? RS_PCM16D : RS_PCM8D; if (pSmp->uFlags & CHN_STEREO) smpflags = (pSmp->uFlags & CHN_16BIT) ? RS_STPCM16D : RS_STPCM8D; WriteSample(f, pSmp, smpflags); @@ -1910,7 +1910,9 @@ MODSAMPLE *psmp = &Samples[nsmp]; itss.id = LittleEndian(IT_IMPS); memcpy(itss.filename, psmp->filename, 12); + StringFixer::FixNullString(itss.filename); memcpy(itss.name, m_szNames[nsmp], 26); + StringFixer::FixNullString(itss.name); itss.gvl = (BYTE)psmp->nGlobalVol; itss.flags = 0x01; if (psmp->uFlags & CHN_LOOP) itss.flags |= 0x10; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |