|
From: <sag...@us...> - 2010-09-27 12:04:32
|
Revision: 724
http://modplug.svn.sourceforge.net/modplug/?rev=724&view=rev
Author: saga-games
Date: 2010-09-27 12:04:26 +0000 (Mon, 27 Sep 2010)
Log Message:
-----------
[Mod] Improved portamento import precision for the module loaders that make use of Schism Tracker's mod command import (patch from Schism Tracker)
Modified Paths:
--------------
trunk/OpenMPT/soundlib/modcommand.cpp
Modified: trunk/OpenMPT/soundlib/modcommand.cpp
===================================================================
--- trunk/OpenMPT/soundlib/modcommand.cpp 2010-09-27 12:03:18 UTC (rev 723)
+++ trunk/OpenMPT/soundlib/modcommand.cpp 2010-09-27 12:04:26 UTC (rev 724)
@@ -814,17 +814,17 @@
*p = min(*p, 64);
break;
case CMD_PORTAMENTOUP:
- if (bForce)
- *p = min(*p, 9);
- else if (*p > 9)
+ // if not force, reject when dividing causes loss of data in LSB, or if the final value is too
+ // large to fit. (volume column Ex/Fx are four times stronger than effect column)
+ if (!bForce && ((*p & 3) || *p > 9 * 4 + 3))
return false;
+ *p = min(*p / 4, 9);
*e = VOLCMD_PORTAUP;
break;
case CMD_PORTAMENTODOWN:
- if (bForce)
- *p = min(*p, 9);
- else if (*p > 9)
+ if (!bForce && ((*p & 3) || *p > 9 * 4 + 3))
return false;
+ *p = min(*p / 4, 9);
*e = VOLCMD_PORTADOWN;
break;
case CMD_TONEPORTAMENTO:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|