Tweak sandbox bbox rendering

main
En Yi 2025-09-01 20:53:15 +08:00
parent 2dde39067e
commit 007211cee8
1 changed files with 12 additions and 9 deletions

View File

@ -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);
@ -444,15 +448,8 @@ 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);
}
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++)