From: <sag...@us...> - 2010-07-17 18:28:58
|
Revision: 652 http://modplug.svn.sourceforge.net/modplug/?rev=652&view=rev Author: saga-games Date: 2010-07-17 18:28:51 +0000 (Sat, 17 Jul 2010) Log Message: ----------- [Imp] IT Saver: If filter envelopes are used, a different value for the cmwt field is now used in compatiblity export (like in SchismTracker). [Ref] Mod Savers: From now on, the CModDoc text log system should be used for displaying warnings during saving, so that unnecessary messageboxes are not shown anymore during autosave. [Mod] OpenMPT: Version is now 1.18.02.04 Modified Paths: -------------- trunk/OpenMPT/mptrack/Moddoc.cpp trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_mod.cpp Modified: trunk/OpenMPT/mptrack/Moddoc.cpp =================================================================== --- trunk/OpenMPT/mptrack/Moddoc.cpp 2010-07-16 23:18:40 UTC (rev 651) +++ trunk/OpenMPT/mptrack/Moddoc.cpp 2010-07-17 18:28:51 UTC (rev 652) @@ -424,6 +424,7 @@ return bOk; } BeginWaitCursor(); + ClearLog(); switch(nType) { case MOD_TYPE_MOD: bOk = m_SndFile.SaveMod(lpszPathName, dwPacking); break; @@ -436,6 +437,7 @@ if (bOk) { if (nType == m_SndFile.m_nType) SetPathName(lpszPathName); + ShowLog(); } else { if(nType == MOD_TYPE_IT && m_SndFile.m_dwSongFlags & SONG_ITPROJECT) ::MessageBox(NULL,"ITP projects need to have a path set for each instrument...",NULL,MB_ICONERROR | MB_OK); @@ -1757,6 +1759,7 @@ FileDlgResult files = CTrackApp::ShowOpenSaveFileDialog(false, ext, filename, pattern, CMainFrame::GetWorkingDirectory(DIR_MODS)); if(files.abort) return; + ClearLog(); switch (type) { case MOD_TYPE_MOD: @@ -1771,6 +1774,7 @@ m_SndFile.SaveCompatIT(files.first_file.c_str()); break; } + ShowLog(); } Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2010-07-16 23:18:40 UTC (rev 651) +++ trunk/OpenMPT/mptrack/version.h 2010-07-17 18:28:51 UTC (rev 652) @@ -15,7 +15,7 @@ #define VER_MAJORMAJOR 1 #define VER_MAJOR 18 #define VER_MINOR 02 -#define VER_MINORMINOR 03 +#define VER_MINORMINOR 04 //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/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2010-07-16 23:18:40 UTC (rev 651) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2010-07-17 18:28:51 UTC (rev 652) @@ -2502,8 +2502,18 @@ header.smpnum = m_nSamples; MptVersion::VersionNum vVersion = MptVersion::num; - header.cwtv = 0x5000 | (WORD)((vVersion >> 16) & 0x0FFF); // format: txyy (t = tracker ID, x = version major, yy = version minor), e.g. 0x5117 (OpenMPT = 5, 117 = v1.17) - header.cmwt = 0x0214; // Common compatible tracker :) + header.cwtv = LittleEndianW(0x5000 | (WORD)((vVersion >> 16) & 0x0FFF)); // format: txyy (t = tracker ID, x = version major, yy = version minor), e.g. 0x5117 (OpenMPT = 5, 117 = v1.17) + header.cmwt = LittleEndianW(0x0214); // Common compatible tracker :) + // hack from schism tracker: + for(INSTRUMENTINDEX nIns = 1; nIns <= GetNumInstruments(); nIns++) + { + if(Instruments[nIns] && Instruments[nIns]->PitchEnv.dwFlags & ENV_FILTER) + { + header.cmwt = LittleEndianW(0x0217); + break; + } + } + header.flags = 0x0001; header.special = 0x0006; if (m_nInstruments) header.flags |= 0x04; Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2010-07-16 23:18:40 UTC (rev 651) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2010-07-17 18:28:51 UTC (rev 652) @@ -453,12 +453,16 @@ return true; #else return bSamplesPresent; -#endif +#endif // MODPLUG_TRACKER } #ifndef MODPLUG_NO_FILESAVE +#ifdef MODPLUG_TRACKER +#include "../mptrack/moddoc.h" +#endif // MODPLUG_TRACKER + bool CSoundFile::SaveMod(LPCSTR lpszFileName, UINT nPacking, const bool bCompatibilityExport) //------------------------------------------------------------------------------------------- { @@ -588,14 +592,19 @@ } //end for all patterns //Check for unsaved patterns - for (UINT ipat=nbp; ipat<MAX_PATTERNS; ipat++) +#ifdef MODPLUG_TRACKER + if(GetpModDoc() != nullptr) { - if (Patterns[ipat]) + for(UINT ipat = nbp; ipat < MAX_PATTERNS; ipat++) { - AfxMessageBox("Warning: this track contains at least 1 pattern after the highest pattern number referred to in the sequence.\r\nSuch patterns will not be saved in the .mod format."); - break; + if(Patterns[ipat]) + { + GetpModDoc()->AddToLog(_T("Warning: This track contains at least one pattern after the highest pattern number referred to in the sequence. Such patterns are not saved in the .mod format.\n")); + break; + } } } +#endif // Writing instruments for (UINT ismpd = 1; ismpd <= 31; ismpd++) if (inslen[ismpd]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |