From 007211cee8402be98bb74b5a85a98d7d06c04594 Mon Sep 17 00:00:00 2001 From: En Yi Date: Mon, 1 Sep 2025 20:53:15 +0800 Subject: [PATCH] Tweak sandbox bbox rendering --- scenes/editor_scene.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/scenes/editor_scene.c b/scenes/editor_scene.c index 409ad8a..0f8c654 100644 --- a/scenes/editor_scene.c +++ b/scenes/editor_scene.c @@ -387,6 +387,8 @@ static void render_editor_game_scene(Scene_t* scene) } } + execute_render(&data->render_manager); + char buffer[64] = {0}; if (data->show_grid) { @@ -428,6 +430,8 @@ static void render_editor_game_scene(Scene_t* scene) break; } + colour = ColorAlpha(colour, 0.5f); + if (p_ent->m_tag == LEVEL_END_TAG) { DrawCircleV(p_ent->position, tilemap.tile_size >> 1, (data->coins.current < data->coins.total)? RED : GREEN); @@ -445,14 +449,7 @@ static void render_editor_game_scene(Scene_t* scene) if (p_bbox != NULL) { - if (p_ent->m_tag == BOULDER_ENT_TAG) - { - DrawCircleV(Vector2Add(p_ent->position, p_bbox->half_size), p_bbox->half_size.x, colour); - } - else - { - DrawRectangle(p_ent->position.x, p_ent->position.y, p_bbox->size.x, p_bbox->size.y, colour); - } + DrawRectangle(p_ent->position.x, p_ent->position.y, p_bbox->size.x, p_bbox->size.y, colour); if (p_ent->m_tag == CRATES_ENT_TAG) { @@ -507,6 +504,13 @@ static void render_editor_game_scene(Scene_t* scene) } } + if (p_ent->m_tag == BOULDER_ENT_TAG) + { + CMoveable_t* p_moveable = get_component(p_ent, CMOVEABLE_T); + DrawCircleV(Vector2Add(p_ent->position, p_bbox->half_size), 4, p_moveable->gridmove ? GREEN : RED); + + } + CHurtbox_t* p_hurtbox = get_component(p_ent, CHURTBOX_T); CHitBoxes_t* p_hitbox = get_component(p_ent, CHITBOXES_T); if (p_hitbox != NULL) @@ -535,7 +539,6 @@ static void render_editor_game_scene(Scene_t* scene) } } - execute_render(&data->render_manager); const Color water_colour = ColorAlpha(BLUE, 0.5); for (int tile_y = min.y; tile_y < max.y; tile_y++)