From b2db11c5a229a23e6d872bde37aca429d9bb5a7b Mon Sep 17 00:00:00 2001 From: jjceresa Date: Sat, 27 Jul 2019 15:33:05 +0200 Subject: [PATCH] Simplify identification of linked modulators. - When removing modulators in list_mod list, all linked modulators must be removed regardless they are valid or invalid modulators. This commit is just a simplification, fluid_zone_check_remove_mod() behaves as before. --- src/sfloader/fluid_defsfont.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/src/sfloader/fluid_defsfont.c b/src/sfloader/fluid_defsfont.c index bc670193..d655126f 100644 --- a/src/sfloader/fluid_defsfont.c +++ b/src/sfloader/fluid_defsfont.c @@ -1825,9 +1825,6 @@ fluid_zone_copy_linked_mod(fluid_mod_t *list_mod, int dest_idx, int new_idx, } linked_count++; /* updates count of linked mod */ - /* marks mod invalid in list. mod will be removed later */ - mod->amount = 0; /* marked invalid in mod list */ - /* is mod's source src1 linked ? */ if(is_src1_linked) { /* search a modulator with output linked to mod */ @@ -1849,7 +1846,7 @@ fluid_zone_copy_linked_mod(fluid_mod_t *list_mod, int dest_idx, int new_idx, /** * Checks and remove invalid modulators from a zone modulators list. - * - checks invalid linked modulator. + * - checks linked modulators. * - checks invalid modulator sources (specs SF 2.01 7.4, 7.8, 8.2.1). * - checks identic modulator in the list (specs SF 2.01 7.4, 7.8). * @param list_mod, address of pointer on modulator list. @@ -1861,9 +1858,8 @@ static void fluid_zone_check_remove_mod(fluid_mod_t **list_mod) while(mod) { fluid_mod_t *next = mod->next; - if( /* Is mod an invalid linked modulator ? */ - ((fluid_mod_has_linked_src1(mod)||(mod->dest & FLUID_MOD_LINK_DEST)) - && (mod->amount == 0)) + if( /* Is mod a linked modulator ? */ + (fluid_mod_has_linked_src1(mod)||(mod->dest & FLUID_MOD_LINK_DEST)) /* or has mod invalid sources ? */ || !fluid_mod_check_sources(mod, NULL) /* or is mod identic to any following modulator ? */