Author: sagamusix
Date: Thu Jun 6 21:50:52 2024
New Revision: 20936
URL: https://source.openmpt.org/browse/openmpt/?op=revision&rev=20936
Log:
[Imp] MED: Further improvements to effect juggling to potentially keep X-param if the other effect can be moved to the volume colum instead.
Modified:
trunk/OpenMPT/soundlib/Load_med.cpp
Modified: trunk/OpenMPT/soundlib/Load_med.cpp
==============================================================================
--- trunk/OpenMPT/soundlib/Load_med.cpp Thu Jun 6 15:17:00 2024 (r20935)
+++ trunk/OpenMPT/soundlib/Load_med.cpp Thu Jun 6 21:50:52 2024 (r20936)
@@ -639,11 +639,11 @@
if(oldCmd.first != CMD_NONE && m->command != oldCmd.first)
{
- // Restore effect from previous page, or reset X-Param to 8-bit value if this cell was overwritten with a "useful" effect
- if(row > 0 && oldCmd.first == CMD_XPARAM)
- pattern.GetpModCommand(row - 1, chn)->param = Util::MaxValueOfType(m->param);
- else if(!ModCommand::CombineEffects(m->command, m->param, oldCmd.first, oldCmd.second) && m->volcmd == VOLCMD_NONE)
+ if(!ModCommand::CombineEffects(m->command, m->param, oldCmd.first, oldCmd.second) && m->volcmd == VOLCMD_NONE)
m->FillInTwoCommands(m->command, m->param, oldCmd.first, oldCmd.second);
+ // Reset X-Param to 8-bit value if this cell was overwritten with a "useful" effect
+ if(row > 0 && oldCmd.first == CMD_XPARAM && m->command != CMD_XPARAM)
+ pattern.GetpModCommand(row - 1, chn)->param = Util::MaxValueOfType(m->param);
}
if(extraCmd.first != CMD_NONE)
{
|