From 7b565582f6daa03ff488798013ac720cc47b8a07 Mon Sep 17 00:00:00 2001 From: Aldrik Ramaekers Date: Wed, 4 Dec 2024 16:09:50 +0100 Subject: small improvements, close #48 --- src/world.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'src/world.c') diff --git a/src/world.c b/src/world.c index 83ca6d9..14000d3 100644 --- a/src/world.c +++ b/src/world.c @@ -1454,6 +1454,8 @@ static float get_fine_multiplier(world* world) // $100 = 1% off of fine. float multiplier = 1.0f; multiplier -= (world->investments.legal / 100.0f) * 0.01f; + if (multiplier < 0.2f) multiplier = 0.2f; + if (multiplier > 1.0f) multiplier = 1.0f; return multiplier; } @@ -1836,7 +1838,7 @@ static void draw_dotted_line(float x1, float y1, float x2, float y2, color line_ } } -world_update_result world_render(platform_window* window, world* world) +world_update_result world_render(platform_window* window, world* world, bool interactive) { world_update_result result = {0,0}; @@ -1856,7 +1858,7 @@ world_update_result world_render(platform_window* window, world* world) s32 circle_x = location->map_position_x - dotsize/2; s32 circle_y = location->map_position_y - dotsize/2; - bool hovered = mouse_interacts(circle_x, circle_y, dotsize, dotsize); + bool hovered = mouse_interacts(circle_x, circle_y, dotsize, dotsize) && interactive; location->is_hovered = hovered; if (hovered && location->is_accessible) { @@ -1879,7 +1881,14 @@ world_update_result world_render(platform_window* window, world* world) renderer->render_image_tint(img_locationdot, circle_x, circle_y, dotsize, dotsize, tint); if (!world_map_location_is_in_sun(map_pos)) { - renderer->render_image_tint(img_locationdot, circle_x, circle_y, dotsize, dotsize, rgba(255, 255, 0, 110)); + renderer->render_image_tint(img_locationdot, circle_x, circle_y, dotsize, dotsize, rgba(255, 255, 0, 170)); + } + + if (location->is_owned) { + float size = dotsize/3.0f; + s32 circle_x = location->map_position_x - size/2; + s32 circle_y = location->map_position_y - size/2; + renderer->render_image_tint(img_locationdot, circle_x, circle_y, size, size, rgba(0,0,0,255)); } } @@ -1893,7 +1902,7 @@ world_update_result world_render(platform_window* window, world* world) s32 circle_x = job->px_pos.x - dotsize/2; s32 circle_y = job->px_pos.y - dotsize/2; - bool hovered = mouse_interacts(circle_x, circle_y, dotsize, dotsize); + bool hovered = mouse_interacts(circle_x, circle_y, dotsize, dotsize) && interactive; job->is_hovered = hovered; if (hovered) { platform_set_cursor(window, CURSOR_POINTER); -- cgit v1.2.3-70-g09d2