ext/worldgen/heightmap.c
/**
 * Normalize the heightmap to be between a specified range. The default range
 * is from 0 to 1.
 * Arguments:
 * * min - Minimum value for normalization (default 0).
 * * max - Maximum value for normalization (default 1).
 */
Normalize the heightmap to be between a specified range. The default range
is from 0 to 1.
Arguments:
min - Minimum value for normalization (default 0).
max - Maximum value for normalization (default 1).
Normalize the heightmap to be between a specified range . The default range is from 0 to 1 . Arguments : min - Minimum value for normalization ( default 0 ) . max - Maximum value for normalization ( default 1 ) .
VALUE normalize_hm(int argc, VALUE *argv, VALUE self) {
  heightmap map = get_heights(self);
  VALUE vmin, vmax;
  double min, max;
  rb_scan_args(argc, argv, "02", &vmin, &vmax);
  min = vmin == Qnil ? 0.0 : NUM2DBL(vmin);
  max = vmax == Qnil ? 1.0 : NUM2DBL(vmax);
  normalize_range(map.heights, map.size, min, max);
  return self;
}
VALUE normalize_hm ( int argc , VALUE * argv , VALUE self ) { heightmap map = get_heights ( self ) ; VALUE vmin , vmax ; double min , max ; rb_scan_args ( argc , argv , " " , & vmin , & vmax ) ; min = vmin == Qnil ? 0.0 : NUM2DBL ( vmin ) ; max = vmax == Qnil ? 1.0 : NUM2DBL ( vmax ) ; normalize_range ( map . heights , map . size , min , max ) ; return self ; }
Normalize the heightmap to be between a specified range.
Normalize the heightmap to be between a specified range .