diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs index 723a1fd..9ba63e0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,17 +1,18 @@ +pub mod editor; pub mod grid; +pub mod map_data; pub mod math; pub mod tool; pub mod transform; -pub use transform::Transform; - +use editor::Editor; use raylib::prelude::*; -use tool::{Tool, ToolShed}; +use transform::Transform; fn main() { let (mut rl, thread) = raylib::init().resizable().title("Hello there!").build(); - let mut tool_shed = ToolShed::new(); + let mut editor = Editor::new(); let mut transform = Transform::new(); let mut last_mouse_pos = rl.get_mouse_position(); @@ -21,7 +22,7 @@ fn main() { // Move the canvas together with the mouse if rl.is_mouse_button_down(MouseButton::MOUSE_MIDDLE_BUTTON) { - transform.move_by_px(rl.get_mouse_position() - last_mouse_pos); + transform.move_by_px((rl.get_mouse_position() - last_mouse_pos).into()); } // Handle scrolling of the canvas @@ -31,7 +32,7 @@ fn main() { transform.try_zoom_out(); } - tool_shed.update(&rl, &transform); + editor.update(&rl, &transform); // Update the last mouse position last_mouse_pos = rl.get_mouse_position(); @@ -42,7 +43,7 @@ fn main() { d.clear_background(Color::BLACK); grid::draw_grid(&mut d, screen_width, screen_height, &transform); - tool_shed.draw_tools(&mut d, &transform); + editor.draw_tools(&mut d, &transform); } } } |
