/// Calculates new Range from given Buffers
Calculates new Range from given Buffers
Calculates new Range from given Buffers
fn calc_range(buf_x: u64, buf_y: u64, cam: &mut Cam) -> Self {
        let mut new = Range::new();
        new.x_min = if cam.coord.get_x() < buf_x {
            0
        } else {
            cam.coord.get_x() - buf_x
        };
        new.y_min = if cam.coord.get_y() < buf_y {
            0
        } else {
            cam.coord.get_y() - buf_y
        };
        new.x_max = if cam.coord.get_x() + buf_x + 1 > cam.level_w {
            cam.level_w
        } else {
            cam.coord.get_x() + buf_x + 1
        };
        new.y_max = if cam.coord.get_y() + buf_y + 1 > cam.level_h {
            cam.level_h
        } else {
            cam.coord.get_y() + buf_y + 1
        };
        new
    }
fn calc_range ( buf_x : u64 , buf_y : u64 , cam : & mut Cam ) -> Self { let mut new = Range :: new ( ) ; new . x_min = if cam . coord . get_x ( ) < buf_x { 0 } else { cam . coord . get_x ( ) - buf_x } ; new . y_min = if cam . coord . get_y ( ) < buf_y { 0 } else { cam . coord . get_y ( ) - buf_y } ; new . x_max = if cam . coord . get_x ( ) + buf_x + 1 > cam . level_w { cam . level_w } else { cam . coord . get_x ( ) + buf_x + 1 } ; new . y_max = if cam . coord . get_y ( ) + buf_y + 1 > cam . level_h { cam . level_h } else { cam . coord . get_y ( ) + buf_y + 1 } ; new }
Calculates new Range from given Buffers
Calculates new Range from given Buffers
buf_x
u64
buf_y
u64
cam
&mut Cam