|
From: <sag...@us...> - 2010-09-23 22:37:37
|
Revision: 716
http://modplug.svn.sourceforge.net/modplug/?rev=716&view=rev
Author: saga-games
Date: 2010-09-23 22:37:31 +0000 (Thu, 23 Sep 2010)
Log Message:
-----------
[Fix] MOD Loader: The previously introduced heuristic checks for 7-bit panning broke MODs that only had 880 panning commands.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/Load_mod.cpp
Modified: trunk/OpenMPT/soundlib/Load_mod.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_mod.cpp 2010-09-23 19:24:56 UTC (rev 715)
+++ trunk/OpenMPT/soundlib/Load_mod.cpp 2010-09-23 22:37:31 UTC (rev 716)
@@ -419,7 +419,7 @@
const CHANNELINDEX nMaxChn = (bFLT8) ? 4 : m_nChannels; // 4 channels per pattern in FLT8 format.
if(bFLT8) nbp++; // as one logical pattern consists of two real patterns in FLT8 format, the highest pattern number has to be increased by one.
bool bHasTempoCommands = false; // for detecting VBlank MODs
- bool bHasExtendedPanning = false; // for detecting 800-8FF panning
+ bool bLeftPanning = false, bExtendedPanning = false; // for detecting 800-880 panning
// Reading patterns
for (PATTERNINDEX ipat = 0; ipat < nbp; ipat++)
@@ -467,8 +467,10 @@
if (m->command == CMD_TEMPO && m->param < 100)
bHasTempoCommands = true;
+ if (m->command == CMD_PANNING8 && m->param < 0x80)
+ bLeftPanning = true;
if (m->command == CMD_PANNING8 && m->param > 0x80 && m->param != 0xA4)
- bHasExtendedPanning = true;
+ bExtendedPanning = true;
if (m->note == NOTE_NONE && m->instr > 0 && !bFLT8)
{
if(lastInstrument[nChn] > 0 && lastInstrument[nChn] != m->instr)
@@ -526,9 +528,10 @@
// modules are checked.
// The same check is also applied to original Ultimate Soundtracker 15 sample mods.
const bool bVBlank = ((bMdKd && bHasTempoCommands && GetSongTime() >= 10 * 60) || m_nSamples == 15) ? true : false;
- if(bVBlank || !bHasExtendedPanning)
+ const bool b7BitPanning = bLeftPanning && !bExtendedPanning;
+ if(bVBlank || b7BitPanning)
{
- Patterns.ForEachModCommand(FixMODPatterns(bVBlank, !bHasExtendedPanning));
+ Patterns.ForEachModCommand(FixMODPatterns(bVBlank, b7BitPanning));
}
#ifdef MODPLUG_TRACKER
@@ -624,8 +627,10 @@
fwrite(ord, 128, 1, f);
// Writing signature
- if (m_nChannels == 4)
+ if (m_nChannels == 4 && nbp < 64)
lstrcpy((LPSTR)&bTab, "M.K.");
+ else if (m_nChannels == 4 && nbp >= 64)
+ lstrcpy((LPSTR)&bTab, "M!K!");
else
wsprintf((LPSTR)&bTab, "%luCHN", m_nChannels);
fwrite(bTab, 4, 1, f);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|