--- a/rust/lib-hedgewars-engine/src/lib.rs Fri Mar 22 21:06:12 2019 +0100
+++ b/rust/lib-hedgewars-engine/src/lib.rs Fri Mar 22 21:29:10 2019 +0100
@@ -10,6 +10,8 @@
os::raw::{c_char, c_void},
};
+use integral_geometry::Point;
+
use self::instance::EngineInstance;
#[repr(C)]
@@ -101,6 +103,14 @@
engine_state.world.step();
true
}
+
+#[no_mangle]
+pub extern "C" fn move_camera(engine_state: &mut EngineInstance, delta_x: i32, delta_y: i32) {
+ engine_state
+ .world
+ .move_camera(Point::new(delta_x, delta_y), 0.0);
+}
+
#[no_mangle]
pub extern "C" fn cleanup(engine_state: *mut EngineInstance) {
unsafe {