From: <sag...@us...> - 2014-02-03 17:00:10
|
Revision: 3637 http://sourceforge.net/p/modplug/code/3637 Author: saga-games Date: 2014-02-03 17:00:01 +0000 (Mon, 03 Feb 2014) Log Message: ----------- [Mod] XM: Don't try to be smarter than FT2 and dumbly scale volume column panning to 0,4,8...56,60. Modified Paths: -------------- trunk/OpenMPT/soundlib/Load_xm.cpp trunk/OpenMPT/test/test.cpp Modified: trunk/OpenMPT/soundlib/Load_xm.cpp =================================================================== --- trunk/OpenMPT/soundlib/Load_xm.cpp 2014-02-03 13:11:54 UTC (rev 3636) +++ trunk/OpenMPT/soundlib/Load_xm.cpp 2014-02-03 17:00:01 UTC (rev 3637) @@ -231,7 +231,7 @@ if(m->volcmd == VOLCMD_PANNING) { - m->vol = ((m->vol * 64 + 8) / 15); + m->vol *= 4; // FT2 does indeed not scale panning symmetrically. } } } @@ -788,7 +788,7 @@ case VOLCMD_FINEVOLUP: vol = 0x90 + (p->vol & 0x0F); break; case VOLCMD_VIBRATOSPEED: vol = 0xA0 + (p->vol & 0x0F); break; case VOLCMD_VIBRATODEPTH: vol = 0xB0 + (p->vol & 0x0F); break; - case VOLCMD_PANNING: vol = 0xC0 + ((p->vol * 15 + 32) / 64); if (vol > 0xCF) vol = 0xCF; break; + case VOLCMD_PANNING: vol = 0xC0 + (p->vol / 4); if (vol > 0xCF) vol = 0xCF; break; case VOLCMD_PANSLIDELEFT: vol = 0xD0 + (p->vol & 0x0F); break; case VOLCMD_PANSLIDERIGHT: vol = 0xE0 + (p->vol & 0x0F); break; case VOLCMD_TONEPORTAMENTO: vol = 0xF0 + (p->vol & 0x0F); break; Modified: trunk/OpenMPT/test/test.cpp =================================================================== --- trunk/OpenMPT/test/test.cpp 2014-02-03 13:11:54 UTC (rev 3636) +++ trunk/OpenMPT/test/test.cpp 2014-02-03 17:00:01 UTC (rev 3637) @@ -1152,7 +1152,7 @@ // Test 4-Bit Panning conversion for(int i = 0; i < 16; i++) { - VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(10 + i, 0)->vol, ((i * 64 + 8) / 15)); + VERIFY_EQUAL_NONCONT(sndFile.Patterns[1].GetpModCommand(10 + i, 0)->vol, i * 4); } // Plugins This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |