From b28f9bc860d2a8a0351e6f866e1b2de2a84cf436 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Sun, 12 May 2024 13:04:19 +0200 Subject: map work --- src/editor.c | 3 ++- src/map.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/editor.c b/src/editor.c index f65d966..4c005f8 100644 --- a/src/editor.c +++ b/src/editor.c @@ -33,6 +33,7 @@ static void update_tile_editor(platform_window* window) { if (pos.x < 0 || pos.y < 0) return; if (pos.x >= loaded_map.width || pos.y >= loaded_map.height) return; + if (_global_mouse.x < editor_width) return; switch (tile_edit_state) { @@ -90,7 +91,7 @@ void update_editor(platform_window* window) if (!is_editing_map) return; - float cam_speed = 500; + float cam_speed = 1000; if (keyboard_is_key_down(KEY_W)) { camera_y -= update_delta*cam_speed; } diff --git a/src/map.c b/src/map.c index fb8b5bc..087d03c 100644 --- a/src/map.c +++ b/src/map.c @@ -364,8 +364,10 @@ inline int get_tile_width(platform_window* window) { //int tile_width = window->height / player_zoom; //if (window->width > window->height) tile_width = window->width / player_zoom; //return round_up(tile_width, 8); - - return 32; + #ifdef MODE_DEBUG + if (is_editing_map) return 32; + #endif + return 256/5.0f+1; } inline int get_tile_height(platform_window* window) { -- cgit v1.2.3-70-g09d2