From: <sag...@us...> - 2010-06-19 19:48:00
|
Revision: 628 http://modplug.svn.sourceforge.net/modplug/?rev=628&view=rev Author: saga-games Date: 2010-06-19 19:47:53 +0000 (Sat, 19 Jun 2010) Log Message: ----------- [Fix] Pattern Editor: New patterns were inserted in the wrong orderlist position for MOD/S3M files (before instead of after the current order). This broke in rev 616 and was supposed to be fixed in rev 622, but I somehow failed to include the patch. [Fix] (Still unfunctional) Sample Generator: There was an error in one of the preset formulas. [Imp] Instrument Editor: More helpful value display for the panning envelope in the status bar with indication what's left and what's right. [Imp] XM Saving: Panbrello is not saved anymore in compatibility mode. [Imp] Mod Conversion: When converting to XM, rogue note delays are removed from the patterns to avoid interferrence with a FT2 bug. [Ref] Some refactoring [Mod] Changed link in the release notes (history.txt -> History.txt for those case-sensitive OSes), added revision number to History.txt Revision Links: -------------- http://modplug.svn.sourceforge.net/modplug/?rev=616&view=rev http://modplug.svn.sourceforge.net/modplug/?rev=622&view=rev Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_pat.cpp trunk/OpenMPT/mptrack/Mpdlgs.cpp trunk/OpenMPT/mptrack/SampleGenerator.cpp trunk/OpenMPT/mptrack/View_ins.cpp trunk/OpenMPT/mptrack/View_pat.cpp trunk/OpenMPT/packageTemplate/History.txt trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2010-06-19 17:12:30 UTC (rev 627) +++ trunk/OpenMPT/mptrack/Ctrl_pat.cpp 2010-06-19 19:47:53 UTC (rev 628) @@ -324,11 +324,10 @@ if (dwHintMask & (HINT_MODTYPE|HINT_PATNAMES)) { UINT nPat; - if (dwHintMask&HINT_PATNAMES) { + if (dwHintMask&HINT_PATNAMES) nPat = (dwHintMask >> HINT_SHIFT_PAT); - } else { + else nPat = SendViewMessage(VIEWMSG_GETCURRENTPATTERN); - } m_pSndFile->GetPatternName(nPat, s, sizeof(s)); m_EditPatName.SetWindowText(s); BOOL bXMIT = (m_pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT)) ? TRUE : FALSE; @@ -781,11 +780,11 @@ ORDERINDEX nCurOrd = m_OrderList.GetCurSel(true).nOrdLo; PATTERNINDEX pat = pSndFile->Order[nCurOrd]; ROWINDEX rows = 64; - if ((pat < pSndFile->Patterns.Size()) && (pSndFile->Patterns[pat]) && (pSndFile->m_nType & (MOD_TYPE_XM|MOD_TYPE_IT|MOD_TYPE_MPT))) + if(pSndFile->Patterns.IsValidPat(pat)) { + nCurOrd++; // only if the current oder is already occupied, create a new pattern at the next position. rows = pSndFile->Patterns[pat].GetNumRows(); rows = CLAMP(rows, pSndFile->GetModSpecifications().patternRowsMin, pSndFile->GetModSpecifications().patternRowsMax); - nCurOrd++; // only if the current oder is already occupied, create a new pattern at the next position. } PATTERNINDEX nNewPat = m_pModDoc->InsertPattern(nCurOrd, rows); if ((nNewPat != PATTERNINDEX_INVALID) && (nNewPat < pSndFile->Patterns.Size())) Modified: trunk/OpenMPT/mptrack/Mpdlgs.cpp =================================================================== --- trunk/OpenMPT/mptrack/Mpdlgs.cpp 2010-06-19 17:12:30 UTC (rev 627) +++ trunk/OpenMPT/mptrack/Mpdlgs.cpp 2010-06-19 19:47:53 UTC (rev 628) @@ -9,7 +9,7 @@ #include "snddev.h" #include ".\mpdlgs.h" -#define str_preampChangeNote GetStrI18N(_TEXT("Note: Pre-Amp setting affects sample volume only. Changing this setting may cause undesired effects on volume balance between sample based instruments and plugin instrument.")) +#define str_preampChangeNote GetStrI18N(_TEXT("Note: Pre-Amp setting affects sample volume only. Changing this setting may cause undesired effects on volume balance between sample based instruments and plugin instruments.")) //#pragma warning(disable:4244) //"conversion from 'type1' to 'type2', possible loss of data" @@ -353,13 +353,7 @@ m_CbnBufferLength.GetWindowText(s, sizeof(s)); m_nBufferLength = atoi(s); //Check given value. - if(m_nBufferLength < SNDDEV_MINBUFFERLEN) - m_nBufferLength = SNDDEV_MINBUFFERLEN; - else - { - if(m_nBufferLength > SNDDEV_MAXBUFFERLEN) - m_nBufferLength = SNDDEV_MAXBUFFERLEN; - } + m_nBufferLength = CLAMP(m_nBufferLength, SNDDEV_MINBUFFERLEN, SNDDEV_MAXBUFFERLEN); wsprintf(s, "%d ms", m_nBufferLength); m_CbnBufferLength.SetWindowText(s); } Modified: trunk/OpenMPT/mptrack/SampleGenerator.cpp =================================================================== --- trunk/OpenMPT/mptrack/SampleGenerator.cpp 2010-06-19 17:12:30 UTC (rev 627) +++ trunk/OpenMPT/mptrack/SampleGenerator.cpp 2010-06-19 19:47:53 UTC (rev 628) @@ -601,7 +601,7 @@ presets.AddPreset(preset); preset.description = "Noisy Saw"; - preset.expression = "(x mod 800) / 800 - 0.5 + rnd (0.1)"; + preset.expression = "(x mod 800) / 800 - 0.5 + rnd(0.1)"; presets.AddPreset(preset); preset.description = "PWM Filter"; Modified: trunk/OpenMPT/mptrack/View_ins.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_ins.cpp 2010-06-19 17:12:30 UTC (rev 627) +++ trunk/OpenMPT/mptrack/View_ins.cpp 2010-06-19 19:47:53 UTC (rev 628) @@ -1387,15 +1387,23 @@ if (nVal < 0) nVal = 0; if (nVal > 64) nVal = 64; if (nTick < 0) nTick = 0; - if (nTick <= EnvGetReleaseNodeTick() + 1 || EnvGetReleaseNode() == ENV_RELEASE_NODE_UNSET) { - int displayVal = (m_nEnv != ENV_VOLUME && !(m_nEnv == ENV_PITCH && (pIns->PitchEnv.dwFlags & ENV_FILTER))) ? nVal - 32 : nVal; - wsprintf(s, "Tick %d, [%d]", nTick, displayVal); - } else { + if (nTick <= EnvGetReleaseNodeTick() + 1 || EnvGetReleaseNode() == ENV_RELEASE_NODE_UNSET) + { + // ticks before release node (or no release node) + const int displayVal = (m_nEnv != ENV_VOLUME && !(m_nEnv == ENV_PITCH && (pIns->PitchEnv.dwFlags & ENV_FILTER))) ? nVal - 32 : nVal; + if(m_nEnv != ENV_PANNING) + wsprintf(s, "Tick %d, [%d]", nTick, displayVal); + else // panning envelope: display right/center/left chars + wsprintf(s, "Tick %d, [%d %c]", nTick, abs(displayVal), displayVal > 0 ? 'R' : (displayVal < 0 ? 'L' : 'C')); + } else + { + // ticks after release node int displayVal = (nVal - EnvGetReleaseNodeValue()) * 2; displayVal = (m_nEnv != ENV_VOLUME) ? displayVal - 32 : displayVal; wsprintf(s, "Tick %d, [Rel%c%d]", nTick, displayVal > 0 ? '+' : '-', abs(displayVal)); } UpdateIndicator(s); + if ((m_dwStatus & INSSTATUS_DRAGGING) && (m_nDragItem)) { BOOL bChanged = FALSE; Modified: trunk/OpenMPT/mptrack/View_pat.cpp =================================================================== --- trunk/OpenMPT/mptrack/View_pat.cpp 2010-06-19 17:12:30 UTC (rev 627) +++ trunk/OpenMPT/mptrack/View_pat.cpp 2010-06-19 19:47:53 UTC (rev 628) @@ -777,12 +777,12 @@ //Log("dst: %d; src: %d; blk: %d\n", row, (row-offset/2), (row-1)); switch(i & 7) { - case 0: dest->note = src->note; blank->note=0; break; - case 1: dest->instr = src->instr; blank->instr=0; break; - case 2: dest->vol = src->vol; blank->vol=0; - dest->volcmd = src->volcmd; blank->volcmd=0; break; - case 3: dest->command = src->command; blank->command=0;break; - case 4: dest->param = src->param; blank->param=0; break; + case NOTE_COLUMN: dest->note = src->note; blank->note = 0; break; + case INST_COLUMN: dest->instr = src->instr; blank->instr = 0; break; + case VOL_COLUMN: dest->vol = src->vol; blank->vol = 0; + dest->volcmd = src->volcmd; blank->volcmd = 0; break; + case EFFECT_COLUMN: dest->command = src->command; blank->command = 0; break; + case PARAM_COLUMN: dest->param = src->param; blank->param = 0; break; } } } @@ -830,12 +830,12 @@ Log("dst: %d; src: %d\n", row, srcRow); switch(i & 7) { - case 0: dest->note = src->note; break; - case 1: dest->instr = src->instr; break; - case 2: dest->vol = src->vol; - dest->volcmd = src->volcmd; break; - case 3: dest->command = src->command; break; - case 4: dest->param = src->param; break; + case NOTE_COLUMN: dest->note = src->note; break; + case INST_COLUMN: dest->instr = src->instr; break; + case VOL_COLUMN: dest->vol = src->vol; + dest->volcmd = src->volcmd; break; + case EFFECT_COLUMN: dest->command = src->command; break; + case PARAM_COLUMN: dest->param = src->param; break; } } } @@ -2046,18 +2046,18 @@ MODCOMMAND *m = pSndFile->Patterns[m_nPattern] + m_nRow * pSndFile->m_nChannels + ((m_dwCursor & 0xFFFF) >> 3); switch(m_dwCursor & 7) { - case 0: - case 1: + case NOTE_COLUMN: + case INST_COLUMN: m_cmdOld.note = m->note; m_cmdOld.instr = m->instr; SendCtrlMessage(CTRLMSG_SETCURRENTINSTRUMENT, m_cmdOld.instr); break; - case 2: + case VOL_COLUMN: m_cmdOld.volcmd = m->volcmd; m_cmdOld.vol = m->vol; break; - case 3: - case 4: + case EFFECT_COLUMN: + case PARAM_COLUMN: m_cmdOld.command = m->command; m_cmdOld.param = m->param; break; @@ -2082,11 +2082,11 @@ switch(nCursor) { - case 0: p->note = m_cmdOld.note; //Note - case 1: p->instr = m_cmdOld.instr; break; //Octave - case 2: p->vol = m_cmdOld.vol; p->volcmd = m_cmdOld.volcmd; break; //Vol - case 3: //Effect - case 4: p->command = m_cmdOld.command; p->param = m_cmdOld.param; break; + case NOTE_COLUMN: p->note = m_cmdOld.note; + case INST_COLUMN: p->instr = m_cmdOld.instr; break; + case VOL_COLUMN: p->vol = m_cmdOld.vol; p->volcmd = m_cmdOld.volcmd; break; + case EFFECT_COLUMN: + case PARAM_COLUMN: p->command = m_cmdOld.command; p->param = m_cmdOld.param; break; } pModDoc->SetModified(); @@ -4424,7 +4424,7 @@ // Simply backup the whole row. pModDoc->GetPatternUndo()->PrepareUndo(m_nPattern, nChn, m_nRow, pSndFile->GetNumChannels(), 1); - PatternRow prowbase = pSndFile->Patterns[m_nPattern].GetRow(m_nRow); + const PatternRow prowbase = pSndFile->Patterns[m_nPattern].GetRow(m_nRow); MODCOMMAND* p = &prowbase[nChn]; const MODCOMMAND oldcmd = *p; // This is the command we are about to overwrite Modified: trunk/OpenMPT/packageTemplate/History.txt =================================================================== --- trunk/OpenMPT/packageTemplate/History.txt 2010-06-19 17:12:30 UTC (rev 627) +++ trunk/OpenMPT/packageTemplate/History.txt 2010-06-19 19:47:53 UTC (rev 628) @@ -10,8 +10,8 @@ (tx XYZ): thanks to XYZ for telling us about the bug -v1.18.02.00 (May 2010) ----------------------- +v1.18.02.00 (May 2010, revision 610) +------------------------------------ General tab [Imp] <Jojo> Disabled tempo slider for MOD files (it was just confusing) Modified: trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html =================================================================== --- trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-06-19 17:12:30 UTC (rev 627) +++ trunk/OpenMPT/packageTemplate/OMPT_1.18_ReleaseNotes.html 2010-06-19 19:47:53 UTC (rev 628) @@ -186,7 +186,7 @@ <h3>There's more...</h3> <p> - For a detailed description of what has changed, check <a href="history.txt">history.txt</a>. + For a detailed description of what has changed, check <a href="History.txt">History.txt</a>. </p> <h2>Known Issues</h2> Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2010-06-19 17:12:30 UTC (rev 627) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2010-06-19 19:47:53 UTC (rev 628) @@ -58,7 +58,7 @@ case '\\' - 56: command = CMD_SMOOTHMIDI; break; //rewbs.smoothVST: 36 - note: this is actually displayed as "-" in FT2, but seems to be doing nothing. //case ':' - 21: command = CMD_DELAYCUT; break; //37 case '#' + 3: command = CMD_XPARAM; break; //rewbs.XMfixes - XParam is 38 - default: command = 0; + default: command = CMD_NONE; } m->command = command; m->param = param; @@ -68,7 +68,7 @@ WORD CSoundFile::ModSaveCommand(const MODCOMMAND *m, const bool bXM, const bool bCompatibilityExport) const //--------------------------------------------------------------------------------------------------------- { - UINT command = m->command & 0x3F, param = m->param; + UINT command = m->command, param = m->param; switch(command) { @@ -77,16 +77,16 @@ case CMD_PORTAMENTOUP: if (m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_STM|MOD_TYPE_MPT)) { - if ((param & 0xF0) == 0xE0) { command=0x0E; param=((param & 0x0F) >> 2)|0x10; break; } - else if ((param & 0xF0) == 0xF0) { command=0x0E; param &= 0x0F; param|=0x10; break; } + if ((param & 0xF0) == 0xE0) { command = 0x0E; param = ((param & 0x0F) >> 2) | 0x10; break; } + else if ((param & 0xF0) == 0xF0) { command = 0x0E; param &= 0x0F; param |= 0x10; break; } } command = 0x01; break; case CMD_PORTAMENTODOWN: if (m_nType & (MOD_TYPE_S3M|MOD_TYPE_IT|MOD_TYPE_STM|MOD_TYPE_MPT)) { - if ((param & 0xF0) == 0xE0) { command=0x0E; param=((param & 0x0F) >> 2)|0x20; break; } - else if ((param & 0xF0) == 0xF0) { command=0x0E; param &= 0x0F; param|=0x20; break; } + if ((param & 0xF0) == 0xE0) { command = 0x0E; param= ((param & 0x0F) >> 2) | 0x20; break; } + else if ((param & 0xF0) == 0xF0) { command = 0x0E; param &= 0x0F; param |= 0x20; break; } } command = 0x02; break; @@ -103,7 +103,7 @@ { param = min(param << 1, 0xFF); } - else if(param == 0xA4) + else if(param == 0xA4) // surround { if(bCompatibilityExport || !bXM) { @@ -135,12 +135,17 @@ case CMD_RETRIG: command = 'R' - 55; break; case CMD_TREMOR: command = 'T' - 55; break; case CMD_XFINEPORTAUPDOWN: - if(bCompatibilityExport && (param & 0xF0) > 2) + if(bCompatibilityExport && (param & 0xF0) > 2) // X1x and X2x are legit, everything above are MPT extensions, which don't belong here. command = param = 0; else command = 'X' - 55; break; - case CMD_PANBRELLO: command = 'Y' - 55; break; + case CMD_PANBRELLO: + if(bCompatibilityExport) + command = param = 0; + else + command = 'Y' - 55; + break; case CMD_MIDI: if(bCompatibilityExport) command = param = 0; @@ -153,9 +158,6 @@ else command = '\\' - 56; break; - case CMD_DELAYCUT: - command = param = 0; - break; case CMD_XPARAM: //rewbs.XMfixes - XParam is 38 if(bCompatibilityExport) command = param = 0; @@ -183,8 +185,14 @@ default: command = 0x0E; break; } break; - default: command = param = 0; + default: + command = param = 0; } + + // don't even think about saving XM effects in MODs... + if(command > 0x0F && !bXM) + command = param = 0; + return (WORD)((command << 8) | (param)); } Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-06-19 17:12:30 UTC (rev 627) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2010-06-19 19:47:53 UTC (rev 628) @@ -3572,13 +3572,14 @@ { MODINSTRUMENT *pIns = pChn->pModInstrument; if (((pIns->VolEnv.dwFlags & ENV_LOOP) || (m_nType & (MOD_TYPE_XM|MOD_TYPE_MT2))) && (pIns->nFadeOut)) - { + { pChn->dwFlags |= CHN_NOTEFADE; } if (pIns->VolEnv.nReleaseNode != ENV_RELEASE_NODE_UNSET) { - pChn->nVolEnvValueAtReleaseJump = getVolEnvValueFromPosition(pChn->nVolEnvPosition, pIns); pChn->nVolEnvPosition= pIns->VolEnv.Ticks[pIns->VolEnv.nReleaseNode]; + pChn->nVolEnvValueAtReleaseJump = getVolEnvValueFromPosition(pChn->nVolEnvPosition, pIns); + pChn->nVolEnvPosition= pIns->VolEnv.Ticks[pIns->VolEnv.nReleaseNode]; } } Modified: trunk/OpenMPT/soundlib/Sndfile.cpp =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.cpp 2010-06-19 17:12:30 UTC (rev 627) +++ trunk/OpenMPT/soundlib/Sndfile.cpp 2010-06-19 19:47:53 UTC (rev 628) @@ -3794,10 +3794,16 @@ } } // End if (newTypeIsS3M) - ////////////////////////////////////////////////// - // Convert anything to XM - adjust volume column + //////////////////////////////////////////////////////////////////////// + // Convert anything to XM - adjust volume column, breaking EDx command if (newTypeIsXM) { + // remove EDx if no note is next to it, or it will retrigger the note in FT2 mode + if(m->command == CMD_MODCMDEX && (m->param & 0xF0) == 0xD0 && m->note == NOTE_NONE) + { + m->command = m->param = 0; + } + if(!m->command) switch(m->volcmd) { case VOLCMD_PORTADOWN: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |