From: <sag...@us...> - 2015-05-25 12:52:14
|
Revision: 5170 http://sourceforge.net/p/modplug/code/5170 Author: saga-games Date: 2015-05-25 12:52:07 +0000 (Mon, 25 May 2015) Log Message: ----------- [Ref] Always use 0xFFFF and 0xFFFE for stop/ignore indices internally, regardless of format. Modified Paths: -------------- trunk/OpenMPT/mptrack/Ctrl_seq.cpp trunk/OpenMPT/soundlib/Load_669.cpp trunk/OpenMPT/soundlib/Load_dsm.cpp trunk/OpenMPT/soundlib/Load_far.cpp trunk/OpenMPT/soundlib/Load_gdm.cpp trunk/OpenMPT/soundlib/Load_it.cpp trunk/OpenMPT/soundlib/Load_itp.cpp trunk/OpenMPT/soundlib/Load_mdl.cpp trunk/OpenMPT/soundlib/Load_mod.cpp trunk/OpenMPT/soundlib/Load_mtm.cpp trunk/OpenMPT/soundlib/Load_okt.cpp trunk/OpenMPT/soundlib/Load_ptm.cpp trunk/OpenMPT/soundlib/Load_s3m.cpp trunk/OpenMPT/soundlib/Load_stm.cpp trunk/OpenMPT/soundlib/Load_ult.cpp trunk/OpenMPT/soundlib/ModSequence.cpp trunk/OpenMPT/soundlib/ModSequence.h trunk/OpenMPT/soundlib/load_j2b.cpp Modified: trunk/OpenMPT/mptrack/Ctrl_seq.cpp =================================================================== --- trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/mptrack/Ctrl_seq.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -723,8 +723,7 @@ { if(nPat == sndFile.Order.GetInvalidPatIndex()) strcpy(s, "---"); else if(nPat == sndFile.Order.GetIgnoreIndex()) strcpy(s, "+++"); - else if(nPat < std::max(sndFile.Patterns.Size(), sndFile.GetModSpecifications().patternsMax)) wsprintf(s, "%u", nPat); - else strcpy(s, "???"); + else wsprintf(s, _T("%u"), nPat); } const COLORREF &textCol = Modified: trunk/OpenMPT/soundlib/Load_669.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_669.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/Load_669.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -142,7 +142,7 @@ songMessage.ReadFixedLineLength(fileHeader.songMessage, 108, 36, 0); // Reading Orders - Order.ReadFromArray(fileHeader.orders); + Order.ReadFromArray(fileHeader.orders, CountOf(fileHeader.orders), 0xFF, 0xFE); m_nRestartPos = fileHeader.restartPos; if(Order[m_nRestartPos] >= fileHeader.patterns) m_nRestartPos = 0; Modified: trunk/OpenMPT/soundlib/Load_dsm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_dsm.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/Load_dsm.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -197,7 +197,7 @@ } } - Order.ReadFromArray(songHeader.orders, songHeader.numOrders); + Order.ReadFromArray(songHeader.orders, songHeader.numOrders, 0xFF, 0xFE); // Read pattern and sample chunks PATTERNINDEX patNum = 0; Modified: trunk/OpenMPT/soundlib/Load_far.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_far.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/Load_far.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -183,7 +183,7 @@ { return false; } - Order.ReadFromArray(orderHeader.orders, orderHeader.numOrders); + Order.ReadFromArray(orderHeader.orders, orderHeader.numOrders, 0xFF, 0xFE); m_nRestartPos = orderHeader.restartPos; file.Seek(fileHeader.headerLength); Modified: trunk/OpenMPT/soundlib/Load_gdm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_gdm.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/Load_gdm.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -189,7 +189,7 @@ // Read orders if(file.Seek(fileHeader.orderOffset)) { - Order.ReadAsByte(file, fileHeader.lastOrder + 1); + Order.ReadAsByte(file, fileHeader.lastOrder + 1, fileHeader.lastOrder + 1, 0xFF, 0xFE); } // Read samples Modified: trunk/OpenMPT/soundlib/Load_it.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_it.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/Load_it.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -448,7 +448,7 @@ file.Seek(sizeof(ITFileHeader)); if(GetType() == MOD_TYPE_IT) { - Order.ReadAsByte(file, fileHeader.ordnum); + Order.ReadAsByte(file, fileHeader.ordnum, fileHeader.ordnum, 0xFF, 0xFE); } else { if(fileHeader.cwtv > 0x88A && fileHeader.cwtv <= 0x88D) @@ -456,10 +456,7 @@ Order.Deserialize(file); } else { - Order.ReadAsByte(file, fileHeader.ordnum); - // Replacing 0xFF and 0xFE with new corresponding indexes - Order.Replace(0xFE, Order.GetIgnoreIndex()); - Order.Replace(0xFF, Order.GetInvalidPatIndex()); + Order.ReadAsByte(file, fileHeader.ordnum, fileHeader.ordnum, 0xFF, 0xFE); } } @@ -1151,7 +1148,7 @@ if(GetType() == MOD_TYPE_MPT) { if(!Order.NeedsExtraDatafield()) itHeader.ordnum = Order.size(); - else itHeader.ordnum = MIN(Order.size(), MAX_ORDERS); //Writing MAX_ORDERS at max here, and if there's more, writing them elsewhere. + else itHeader.ordnum = std::min(Order.size(), MAX_ORDERS); //Writing MAX_ORDERS at max here, and if there's more, writing them elsewhere. //Crop unused orders from the end. while(itHeader.ordnum > 1 && Order[itHeader.ordnum - 1] == Order.GetInvalidPatIndex()) itHeader.ordnum--; Modified: trunk/OpenMPT/soundlib/Load_itp.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_itp.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/Load_itp.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -160,7 +160,8 @@ } // Song Orders - Order.ReadAsByte(file, file.ReadUint32LE()); + size = file.ReadUint32LE(); + Order.ReadAsByte(file, size, size, 0xFF, 0xFE); // Song Patterns const PATTERNINDEX numPats = static_cast<PATTERNINDEX>(file.ReadUint32LE()); Modified: trunk/OpenMPT/soundlib/Load_mdl.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mdl.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/Load_mdl.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -372,7 +372,7 @@ else m_nChannels = i+1; } - Order.ReadFromArray(pmib->seq, norders); + Order.ReadFromArray(pmib->seq, norders, 0xFF, 0xFE); break; // ME: song message case 0x454D: Modified: trunk/OpenMPT/soundlib/Load_mod.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mod.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/Load_mod.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -567,7 +567,7 @@ file.ReadStruct(fileHeader); file.Skip(4); // Magic bytes (we already parsed these) - Order.ReadFromArray(fileHeader.orderList); + Order.ReadFromArray(fileHeader.orderList, CountOf(fileHeader.orderList), 0xFF, 0xFE); ORDERINDEX realOrders = fileHeader.numOrders; if(realOrders > 128) Modified: trunk/OpenMPT/soundlib/Load_mtm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_mtm.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/Load_mtm.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -144,7 +144,7 @@ // Reading pattern order const ORDERINDEX readOrders = fileHeader.lastOrder + 1; - Order.ReadAsByte(file, 128, readOrders); + Order.ReadAsByte(file, 128, readOrders, 0xFF, 0xFE); // Reading Patterns const ROWINDEX rowsPerPat = std::min(ROWINDEX(fileHeader.beatsPerTrack), MAX_PATTERN_ROWS); Modified: trunk/OpenMPT/soundlib/Load_okt.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_okt.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/Load_okt.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -373,7 +373,7 @@ case OktIffChunk::idPATT: // read the orderlist - Order.ReadAsByte(chunk, chunk.GetLength()); + Order.ReadAsByte(chunk, chunk.GetLength(), ORDERINDEX_MAX, 0xFF, 0xFE); break; case OktIffChunk::idPBOD: Modified: trunk/OpenMPT/soundlib/Load_ptm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ptm.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/Load_ptm.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -170,7 +170,7 @@ m_SongFlags = SONG_ITCOMPATGXX | SONG_ITOLDEFFECTS; m_nChannels = fileHeader.numChannels; m_nSamples = std::min<SAMPLEINDEX>(fileHeader.numSamples, MAX_SAMPLES - 1); - Order.ReadFromArray(fileHeader.orders, fileHeader.numOrders); + Order.ReadFromArray(fileHeader.orders, fileHeader.numOrders, 0xFF, 0xFE); // Reading channel panning for(CHANNELINDEX chn = 0; chn < m_nChannels; chn++) Modified: trunk/OpenMPT/soundlib/Load_s3m.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_s3m.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/Load_s3m.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -342,7 +342,7 @@ m_nChannels = 1; } - Order.ReadAsByte(file, fileHeader.ordNum); + Order.ReadAsByte(file, fileHeader.ordNum, fileHeader.ordNum, 0xFF, 0xFE); // Read sample header offsets std::vector<uint16> sampleOffsets(fileHeader.smpNum); Modified: trunk/OpenMPT/soundlib/Load_stm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_stm.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/Load_stm.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -179,7 +179,7 @@ } // Read order list - Order.ReadFromArray(fileHeader.order); + Order.ReadFromArray(fileHeader.order, CountOf(fileHeader.order), 0xFF, 0xFE); for(ORDERINDEX ord = 0; ord < 128; ord++) { if(Order[ord] >= 99) Modified: trunk/OpenMPT/soundlib/Load_ult.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_ult.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/Load_ult.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -432,8 +432,7 @@ mpt::String::Read<mpt::String::maybeNullTerminated>(m_szNames[smp], sampleHeader.name); } - // ult just so happens to use 255 for its end mark, so there's no need to fiddle with this - Order.ReadAsByte(file, 256); + Order.ReadAsByte(file, 256, 256, 0xFF, 0xFE); m_nChannels = file.ReadUint8() + 1; PATTERNINDEX numPats = file.ReadUint8() + 1; Modified: trunk/OpenMPT/soundlib/ModSequence.cpp =================================================================== --- trunk/OpenMPT/soundlib/ModSequence.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/ModSequence.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -40,8 +40,6 @@ m_pArray(pArray), m_nSize(nSize), m_nCapacity(nCapacity), - m_nInvalidIndex(0xFF), - m_nIgnoreIndex(0xFE), m_bDeletableArray(bDeletableArray) //------------------------------------------------------- {} @@ -49,15 +47,13 @@ ModSequence::ModSequence(CSoundFile& rSf, ORDERINDEX nSize) : m_sndFile(rSf), - m_nInvalidIndex(GetInvalidPatIndex(MOD_TYPE_MPT)), - m_nIgnoreIndex(GetIgnoreIndex(MOD_TYPE_MPT)), m_bDeletableArray(true) //------------------------------------------------------------------- { m_nSize = nSize; m_nCapacity = m_nSize; m_pArray = new PATTERNINDEX[m_nCapacity]; - std::fill(begin(), end(), GetInvalidPatIndex(MOD_TYPE_MPT)); + std::fill(begin(), end(), GetInvalidPatIndex()); } @@ -66,8 +62,6 @@ m_pArray(nullptr), m_nSize(0), m_nCapacity(0), - m_nInvalidIndex(0xFF), - m_nIgnoreIndex(0xFE), m_bDeletableArray(false) //------------------------------------------ { @@ -100,25 +94,18 @@ //--------------------------------------------------------- { const CModSpecifications specs = m_sndFile.GetModSpecifications(); - const MODTYPE newtype = m_sndFile.GetType(); - m_nInvalidIndex = GetInvalidPatIndex(newtype); - m_nIgnoreIndex = GetIgnoreIndex(newtype); - if(oldtype != MOD_TYPE_NONE) { // If not supported, remove "+++" separator order items. if(specs.hasIgnoreIndex == false) { - RemovePattern(GetIgnoreIndex(oldtype)); - } else - { - Replace(GetIgnoreIndex(oldtype), GetIgnoreIndex()); + RemovePattern(GetIgnoreIndex()); } // If not supported, remove "---" items between patterns. if(specs.hasStopIndex == false) { - RemovePattern(GetInvalidPatIndex(oldtype)); + RemovePattern(GetInvalidPatIndex()); } } @@ -137,9 +124,6 @@ } resize(specs.ordersMax); } - - // Replace items used to denote end of song order. - if(oldtype != MOD_TYPE_NONE) Replace(GetInvalidPatIndex(oldtype), GetInvalidPatIndex()); } @@ -302,8 +286,7 @@ if (nNewSize > m_nSize) std::fill(begin() + m_nSize, begin() + nNewSize, nFill); m_nSize = nNewSize; - } - else + } else { const PATTERNINDEX* const pOld = m_pArray; m_nCapacity = nNewSize + 100; @@ -330,8 +313,6 @@ { if (&seq == this) return *this; - m_nIgnoreIndex = seq.m_nIgnoreIndex; - m_nInvalidIndex = seq.m_nInvalidIndex; resize(seq.GetLength()); std::copy(seq.begin(), seq.end(), begin()); m_sName = seq.m_sName; @@ -376,7 +357,7 @@ m_nCurrentSeq(0) //-------------------------------------------------------------- { - std::fill(m_Cache, m_Cache + s_nCacheSize, GetInvalidPatIndex(MOD_TYPE_MPT)); + std::fill(m_Cache, m_Cache + s_nCacheSize, GetInvalidPatIndex()); m_Sequences.push_back(ModSequence(sndFile, s_nCacheSize)); } @@ -711,38 +692,33 @@ } -size_t ModSequence::WriteAsByte(FILE* f, const uint16 count) const -//---------------------------------------------------------------- +size_t ModSequence::WriteAsByte(FILE* f, const ORDERINDEX count, uint8 stopIndex, uint8 ignoreIndex) const +//-------------------------------------------------------------------------------------------------------- { - const size_t limit = MIN(count, GetLength()); + const size_t limit = std::min(count, GetLength()); size_t i = 0; for(i = 0; i < limit; i++) { const PATTERNINDEX pat = (*this)[i]; - BYTE temp = static_cast<BYTE>((*this)[i]); + uint8 temp = static_cast<uint8>((*this)[i]); - if(pat > 0xFD) - { - if(pat == GetInvalidPatIndex()) temp = 0xFF; - else temp = 0xFE; - } + if(pat == GetInvalidPatIndex()) temp = stopIndex; + else if(pat == GetIgnoreIndex() || pat > 0xFF) temp = ignoreIndex; fwrite(&temp, 1, 1, f); } // Fill non-existing order items with stop indices for(i = limit; i < count; i++) { - BYTE temp = 0xFF; - fwrite(&temp, 1, 1, f); + fwrite(&stopIndex, 1, 1, f); } return i; //Returns the number of bytes written. } -// TODO: Need a way to declare skip/stop indices? -bool ModSequence::ReadAsByte(FileReader &file, size_t howMany, size_t readEntries) -//-------------------------------------------------------------------------------- +bool ModSequence::ReadAsByte(FileReader &file, size_t howMany, size_t readEntries, uint16 stopIndex, uint16 ignoreIndex) +//---------------------------------------------------------------------------------------------------------------------- { if(!file.CanRead(howMany)) { @@ -758,7 +734,10 @@ for(size_t i = 0; i < readEntries; i++) { - (*this)[i] = file.ReadUint8(); + PATTERNINDEX pat = file.ReadUint8(); + if(pat == stopIndex) pat = GetInvalidPatIndex(); + if(pat == ignoreIndex) pat = GetIgnoreIndex(); + (*this)[i] = pat; } std::fill(begin() + readEntries, end(), GetInvalidPatIndex()); @@ -767,13 +746,6 @@ } -MODTYPE ModSequence::GetSndFileType() const -//----------------------------------------- -{ - return m_sndFile.GetType(); -} - - void ReadModSequenceOld(std::istream& iStrm, ModSequenceSet& seq, const size_t) //----------------------------------------------------------------------------- { Modified: trunk/OpenMPT/soundlib/ModSequence.h =================================================================== --- trunk/OpenMPT/soundlib/ModSequence.h 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/ModSequence.h 2015-05-25 12:52:07 UTC (rev 5170) @@ -83,12 +83,11 @@ // Returns length of sequence stopping counting on first '---' (or at the end of sequence). ORDERINDEX GetLengthFirstEmpty() const; - PATTERNINDEX GetInvalidPatIndex() const {return m_nInvalidIndex;} // To correspond 0xFF - static PATTERNINDEX GetInvalidPatIndex(const MODTYPE type); + // Returns the internal representation of a stop '---' index + static PATTERNINDEX GetInvalidPatIndex() { return uint16_max; } + // Returns the internal representation of an ignore '+++' index + static PATTERNINDEX GetIgnoreIndex() {return uint16_max - 1; } - PATTERNINDEX GetIgnoreIndex() const {return m_nIgnoreIndex;} // To correspond 0xFE - static PATTERNINDEX GetIgnoreIndex(const MODTYPE type); - // Returns the previous/next order ignoring skip indices(+++). // If no previous/next order exists, return first/last order, and zero // when orderlist is empty. @@ -100,11 +99,15 @@ ModSequence& operator=(const ModSequence& seq); - // Read/write. - size_t WriteAsByte(FILE* f, const uint16 count) const; - bool ReadAsByte(FileReader &file, size_t howMany, size_t readEntries = ORDERINDEX_MAX); + // Write order items as bytes. '---' is written as stopIndex, '+++' is written as ignoreIndex + size_t WriteAsByte(FILE* f, const ORDERINDEX count, uint8 stopIndex = 0xFF, uint8 ignoreIndex = 0xFE) const; + // Read order items as bytes from a file. 'howMany' bytes are read from the file, optionally only the first 'readEntries' of them are actually processed. + // 'stopIndex' is treated as '---', 'ignoreIndex' is treated as '+++'. If the format doesn't support such indices, just pass a parameter that does not fit into a byte. + bool ReadAsByte(FileReader &file, size_t howMany, size_t readEntries = ORDERINDEX_MAX, uint16 stopIndex = ORDERINDEX_INVALID, uint16 ignoreIndex = ORDERINDEX_INVALID); template<typename T, size_t arraySize> - bool ReadFromArray(const T (&orders)[arraySize], size_t howMany = arraySize); + // Read order items from an array. Only the first 'howMany' entries are actually processed. + // 'stopIndex' is treated as '---', 'ignoreIndex' is treated as '+++'. If the format doesn't support such indices, just pass ORDERINDEX_INVALID. + bool ReadFromArray(const T (&orders)[arraySize], size_t howMany = arraySize, uint16 stopIndex = ORDERINDEX_INVALID, uint16 ignoreIndex = ORDERINDEX_INVALID); // Deprecated function used for MPTm files created with OpenMPT 1.17.02.46 - 1.17.02.48. bool Deserialize(FileReader &file); @@ -130,35 +133,23 @@ const_iterator end() const {return m_pArray + m_nSize;} protected: - std::string m_sName; // Sequence name. + std::string m_sName; // Sequence name. -protected: CSoundFile &m_sndFile; // Pointer to associated CSoundFile. PATTERNINDEX *m_pArray; // Pointer to sequence array. ORDERINDEX m_nSize; // Sequence length. ORDERINDEX m_nCapacity; // Capacity in m_pArray. - PATTERNINDEX m_nInvalidIndex; // Invalid pat index. - PATTERNINDEX m_nIgnoreIndex; // Ignore pat index. bool m_bDeletableArray; // True if m_pArray points the deletable(with delete[]) array. - MODTYPE GetSndFileType() const; }; -inline PATTERNINDEX ModSequence::GetInvalidPatIndex(const MODTYPE type) {return (type & (MOD_TYPE_MPT | MOD_TYPE_XM)) ? uint16_max : 0xFF;} -inline PATTERNINDEX ModSequence::GetIgnoreIndex(const MODTYPE type) {return (type & (MOD_TYPE_MPT | MOD_TYPE_XM)) ? uint16_max - 1 : 0xFE;} - - template<typename T, size_t arraySize> -bool ModSequence::ReadFromArray(const T (&orders)[arraySize], size_t howMany) -//--------------------------------------------------------------------------- +bool ModSequence::ReadFromArray(const T (&orders)[arraySize], size_t howMany, uint16 stopIndex, uint16 ignoreIndex) +//----------------------------------------------------------------------------------------------------------------- { + STATIC_ASSERT(arraySize < ORDERINDEX_MAX); LimitMax(howMany, arraySize); - ORDERINDEX readEntries = static_cast<ORDERINDEX>(howMany); - if(!(GetSndFileType() & MOD_TYPE_MPT)) - { - LimitMax(readEntries, MAX_ORDERS); - } if(GetLength() < readEntries) { @@ -167,7 +158,10 @@ for(int i = 0; i < readEntries; i++) { - (*this)[i] = static_cast<ORDERINDEX>(orders[i]); + PATTERNINDEX pat = static_cast<PATTERNINDEX>(orders[i]); + if(pat == stopIndex) pat = GetInvalidPatIndex(); + if(pat == ignoreIndex) pat = GetIgnoreIndex(); + (*this)[i] = pat; } return true; } Modified: trunk/OpenMPT/soundlib/load_j2b.cpp =================================================================== --- trunk/OpenMPT/soundlib/load_j2b.cpp 2015-05-25 12:42:48 UTC (rev 5169) +++ trunk/OpenMPT/soundlib/load_j2b.cpp 2015-05-25 12:52:07 UTC (rev 5170) @@ -830,7 +830,7 @@ // "ORDR" - Order list FileReader chunk(chunks.GetChunk(AMFFRiffChunk::idORDR)); uint8 numOrders = chunk.ReadUint8() + 1; - Order.ReadAsByte(chunk, numOrders); + Order.ReadAsByte(chunk, numOrders, numOrders, 0xFF, 0xFE); } // "PATT" - Pattern data for one pattern This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |