From: <sag...@us...> - 2012-12-23 19:32:17
|
Revision: 1476 http://sourceforge.net/p/modplug/code/1476 Author: saga-games Date: 2012-12-23 19:32:07 +0000 (Sun, 23 Dec 2012) Log Message: ----------- [Imp] ITI files can now also be read as samples (only reads first sample, naturally) [Fix] IT Compatibility: pxx should also reset the surround flag, like all other panning commands. [Mod] OpenMPT: Version is now 1.21.01.01 Modified Paths: -------------- trunk/OpenMPT/mptrack/version.h trunk/OpenMPT/soundlib/SampleFormats.cpp trunk/OpenMPT/soundlib/Snd_fx.cpp trunk/OpenMPT/soundlib/Sndfile.h Modified: trunk/OpenMPT/mptrack/version.h =================================================================== --- trunk/OpenMPT/mptrack/version.h 2012-12-23 19:30:34 UTC (rev 1475) +++ trunk/OpenMPT/mptrack/version.h 2012-12-23 19:32:07 UTC (rev 1476) @@ -17,9 +17,9 @@ //Version definitions. The only thing that needs to be changed when changing version number. #define VER_MAJORMAJOR 1 -#define VER_MAJOR 20 -#define VER_MINOR 04 -#define VER_MINORMINOR 09 +#define VER_MAJOR 21 +#define VER_MINOR 01 +#define VER_MINORMINOR 01 //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/SampleFormats.cpp =================================================================== --- trunk/OpenMPT/soundlib/SampleFormats.cpp 2012-12-23 19:30:34 UTC (rev 1475) +++ trunk/OpenMPT/soundlib/SampleFormats.cpp 2012-12-23 19:32:07 UTC (rev 1476) @@ -31,6 +31,7 @@ if(!nSample || nSample >= MAX_SAMPLES) return false; if(!ReadWAVSample(nSample, file) && !ReadXISample(nSample, file) + && !ReadITISample(nSample, file) && !ReadAIFFSample(nSample, file) && !ReadITSSample(nSample, file) && !ReadPATSample(nSample, lpMemFile, dwFileLength) @@ -1492,6 +1493,27 @@ } +bool CSoundFile::ReadITISample(SAMPLEINDEX nSample, FileReader &file) +//------------------------------------------------------------------- +{ + ITInstrument instrumentHeader; + + file.Rewind(); + if(!file.ReadConvertEndianness(instrumentHeader) + || instrumentHeader.id != ITInstrument::magic + || instrumentHeader.nos == 0) + { + return false; + } + file.Rewind(); + ModInstrument dummy; + ITInstrToMPT(file, dummy, instrumentHeader.trkvers); + ReadITSSample(nSample, file, false); + + return true; +} + + bool CSoundFile::ReadITIInstrument(INSTRUMENTINDEX nInstr, FileReader &file) //-------------------------------------------------------------------------- { Modified: trunk/OpenMPT/soundlib/Snd_fx.cpp =================================================================== --- trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-12-23 19:30:34 UTC (rev 1475) +++ trunk/OpenMPT/soundlib/Snd_fx.cpp 2012-12-23 19:32:07 UTC (rev 1476) @@ -1934,8 +1934,13 @@ } else if (volcmd == VOLCMD_PANNING) { - if (vol > 64) vol = 64; - pChn->nPan = vol << 2; + // IT Compatibility (and other trackers as well): panning disables surround (unless panning in rear channels is enabled, which is not supported by the original trackers anyway) + if(IsCompatibleMode(TRK_ALLTRACKERS) && !m_SongFlags[SONG_SURROUNDPAN]) + { + pChn->dwFlags.reset(CHN_SURROUND); + } + if(vol > 64) vol = 64; + pChn->nPan = vol * 4; pChn->dwFlags.set(CHN_FASTVOLRAMP); pChn->nRestorePanOnNewNote = 0; //IT compatibility 20. Set pan overrides random pan Modified: trunk/OpenMPT/soundlib/Sndfile.h =================================================================== --- trunk/OpenMPT/soundlib/Sndfile.h 2012-12-23 19:30:34 UTC (rev 1475) +++ trunk/OpenMPT/soundlib/Sndfile.h 2012-12-23 19:32:07 UTC (rev 1476) @@ -633,6 +633,7 @@ bool ReadAIFFSample(SAMPLEINDEX nSample, FileReader &file); bool ReadXISample(SAMPLEINDEX nSample, FileReader &file); bool ReadITSSample(SAMPLEINDEX nSample, FileReader &file, bool rewind = true); + bool ReadITISample(SAMPLEINDEX nSample, FileReader &file); bool Read8SVXSample(SAMPLEINDEX nInstr, const LPBYTE lpMemFile, DWORD dwFileLength); bool ReadFLACSample(SAMPLEINDEX sample, FileReader &file); bool SaveWAVSample(SAMPLEINDEX nSample, const LPCSTR lpszFileName) const; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |