- // Generic scaling functions that refer to more then one material
- // distribution. They should be probed after the specialized ones.
- // Note that these ones don't return after setting the function.
- if (is_KBPsKs<WHITE>(pos))
- e->scalingFunction[WHITE] = &ScaleKBPsK[WHITE];
-
- if (is_KBPsKs<BLACK>(pos))
- e->scalingFunction[BLACK] = &ScaleKBPsK[BLACK];
-
- if (is_KQKRPs<WHITE>(pos))
- e->scalingFunction[WHITE] = &ScaleKQKRPs[WHITE];
+ // We didn't find any specialized scaling function, so fall back on generic
+ // ones that refer to more than one material distribution. Note that in this
+ // case we don't return after setting the function.
+ for (Color c = WHITE; c <= BLACK; ++c)
+ {
+ if (is_KBPsKs(pos, c))
+ e->scalingFunction[c] = &ScaleKBPsK[c];