Yeah maybe put the configuration in some sort of associative array structure and pass that along. Then let the function use what is in the array or default values otherwise. (That is, first assign default values and then overwrite with what's in the array.)
Or check if it is in the array and otherwise use default like in this pseudo code.
Or check if it is in the array and otherwise use default like in this pseudo code.
function setScreenMode(configuration) { width = (isSet(configuration['width']) ? configuration['width'] : DEFAULT_SCREEN_WIDTH); height = (isSet(configuration['height']) ? configuration['height'] : DEFAULT_SCREEN_HEIGHT); }