Mercurial > hg > dmlib
diff tools/xm2jss.c @ 1342:f2fd1ad84829
Constify and move effect conversion back to where it was.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 22 Aug 2017 20:55:53 +0300 |
parents | 04b1bf207636 |
children | cffb1597ab06 |
line wrap: on
line diff
--- a/tools/xm2jss.c Tue Aug 22 17:15:22 2017 +0300 +++ b/tools/xm2jss.c Tue Aug 22 20:55:53 2017 +0300 @@ -732,9 +732,10 @@ /* Scan given pattern for used instruments and channels. - * Also checks if the pattern is empty and convert certain effects. + * Also checks if the pattern is empty. */ -void scanPattern(JSSModule *module, JSSPattern *pattern, int npattern, BOOL *usedExtInstruments, BOOL *usedChannels, BOOL *empty) +void scanPattern(const JSSModule *module, const JSSPattern *pattern, + const int npattern, BOOL *usedExtInstruments, BOOL *usedChannels, BOOL *empty) { JSSNote *n = pattern->data; *empty = FALSE; @@ -743,8 +744,6 @@ for (int row = 0; row < pattern->nrows; row++) for (int channel = 0; channel < pattern->nchannels; channel++, n++) { - char effect; - // Is the instrument set? if (n->instrument != jsetNotSet) { @@ -768,20 +767,6 @@ usedChannels[channel] = TRUE; *empty = FALSE; } - - // Convert certain effects - JMPGETEFFECT(effect, n->effect); - switch (effect) - { - case 'C': // Cxx = Set volume - if (n->volume == jsetNotSet) - { - n->volume = n->param; - n->effect = jsetNotSet; - n->param = jsetNotSet; - } - break; - } } } @@ -1120,6 +1105,21 @@ n->instrument + 1); } } + + // Convert certain effects + char effect; + JMPGETEFFECT(effect, n->effect); + switch (effect) + { + case 'C': // Cxx = Set volume + if (n->volume == jsetNotSet) + { + n->volume = n->param; + n->effect = jsetNotSet; + n->param = jsetNotSet; + } + break; + } } }