|
From: <sag...@us...> - 2014-03-12 23:23:42
|
Revision: 3878
http://sourceforge.net/p/modplug/code/3878
Author: saga-games
Date: 2014-03-12 23:23:32 +0000 (Wed, 12 Mar 2014)
Log Message:
-----------
[Imp] Raise plugin limit from 100 to 250.
Modified Paths:
--------------
trunk/OpenMPT/soundlib/ITTools.cpp
trunk/OpenMPT/soundlib/Load_it.cpp
trunk/OpenMPT/soundlib/Snd_defs.h
Modified: trunk/OpenMPT/soundlib/ITTools.cpp
===================================================================
--- trunk/OpenMPT/soundlib/ITTools.cpp 2014-03-12 15:04:21 UTC (rev 3877)
+++ trunk/OpenMPT/soundlib/ITTools.cpp 2014-03-12 23:23:32 UTC (rev 3878)
@@ -238,7 +238,7 @@
// MIDI Setup
mbank = mptIns.wMidiBank;
mpr = mptIns.nMidiProgram;
- if(mptIns.nMidiChannel || mptIns.nMixPlug == 0 || compatExport)
+ if(mptIns.nMidiChannel || mptIns.nMixPlug == 0 || mptIns.nMixPlug > 127 || compatExport)
{
// Default. Prefer MIDI channel over mixplug to keep the semantics intact.
mch = mptIns.nMidiChannel;
Modified: trunk/OpenMPT/soundlib/Load_it.cpp
===================================================================
--- trunk/OpenMPT/soundlib/Load_it.cpp 2014-03-12 15:04:21 UTC (rev 3877)
+++ trunk/OpenMPT/soundlib/Load_it.cpp 2014-03-12 23:23:32 UTC (rev 3878)
@@ -1714,7 +1714,7 @@
// rewbs.modularPlugData
DWORD MPTxPlugDataSize = 4 + (sizeof(m_MixPlugins[i].fDryRatio)) + //4 for ID and size of dryRatio
4 + (sizeof(m_MixPlugins[i].defaultProgram)); //rewbs.plugDefaultProgram
- // for each extra entity, add 4 for ID, plus size of entity, plus optionally 4 for size of entity.
+ // for each extra entity, add 4 for ID, plus size of entity, plus optionally 4 for size of entity.
nPluginSize += MPTxPlugDataSize + 4; //+4 is for size itself: sizeof(DWORD) is 4
// rewbs.modularPlugData
@@ -1722,9 +1722,9 @@
{
// write plugin ID
id[0] = 'F';
- id[1] = 'X';
- id[2] = '0' + (i / 10);
- id[3] = '0' + (i % 10);
+ id[1] = i < 100 ? 'X' : '0' + i / 100;
+ id[2] = '0' + (i / 10) % 10u;
+ id[3] = '0' + (i % 10u);
fwrite(id, 1, 4, f);
// write plugin size:
@@ -1806,10 +1806,13 @@
ChnSettings[ch].nMixPlugin = (uint8)chunk.ReadUint32LE();
}
}
- // Plugin Data
- else if(memcmp(code, "FX00", 4) >= 0 && memcmp(code, "FX99", 4) <= 0)
+ // Plugin Data FX00, ... FX99, F100, ... F255
+#define ISNUMERIC(x) (code[(x)] >= '0' && code[(x)] <= '9')
+ else if(code[0] == 'F' && (code[1] == 'X' || ISNUMERIC(1)) && ISNUMERIC(2) && ISNUMERIC(3))
+#undef ISNUMERIC
{
PLUGINDEX plug = (code[2] - '0') * 10 + (code[3] - '0'); //calculate plug-in number.
+ if(code[1] != 'X') plug += (code[1] - '0') * 100;
if(plug < MAX_MIXPLUGINS)
{
Modified: trunk/OpenMPT/soundlib/Snd_defs.h
===================================================================
--- trunk/OpenMPT/soundlib/Snd_defs.h 2014-03-12 15:04:21 UTC (rev 3877)
+++ trunk/OpenMPT/soundlib/Snd_defs.h 2014-03-12 23:23:32 UTC (rev 3878)
@@ -44,8 +44,8 @@
const ORDERINDEX MAX_ORDERS = 256;
const PATTERNINDEX MAX_PATTERNS = 240;
const SAMPLEINDEX MAX_SAMPLES = 4000;
-const INSTRUMENTINDEX MAX_INSTRUMENTS = 256; //200
-const PLUGINDEX MAX_MIXPLUGINS = 100; //50
+const INSTRUMENTINDEX MAX_INSTRUMENTS = 256;
+const PLUGINDEX MAX_MIXPLUGINS = 250;
const SEQUENCEINDEX MAX_SEQUENCES = 50;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|