Move the GEOPATCH_MAX_DEPTH into GeoPatchContext and then limit the max depth by it instead of hardcoding the number.
Also recalculate the max depth when changing the settings.
Eliminate warning about bool to int comparison