From afa22dc6450a7f2341c432604d5e50735d6830c7 Mon Sep 17 00:00:00 2001 From: HampusM Date: Thu, 23 Jun 2022 20:16:07 +0200 Subject: perf: reduce cout flushing --- src/engine/graphics/component_renderer.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/engine/graphics/component_renderer.cpp') diff --git a/src/engine/graphics/component_renderer.cpp b/src/engine/graphics/component_renderer.cpp index eb024bc..effe153 100644 --- a/src/engine/graphics/component_renderer.cpp +++ b/src/engine/graphics/component_renderer.cpp @@ -21,7 +21,7 @@ void ComponentRenderer::render( const auto previous_pos = _cursor_controller->where(); _cursor_controller->hide(); - _cursor_controller->move_to(position); + _cursor_controller->move_to(position, true); _use_component_colors(component); @@ -61,15 +61,14 @@ void ComponentRenderer::render( const auto current_pos = _cursor_controller->where(); _cursor_controller->move_to( - Vector2({.x = previous_pos.get_x(), .y = current_pos.get_y() - 1})); + Vector2({.x = previous_pos.get_x(), .y = current_pos.get_y() - 1}), + true); } fmt::print(RESET_ALL_MODES, fmt::arg("esc", ESC)); - std::cout.flush(); - _cursor_controller->move_to(previous_pos); - _cursor_controller->show(); + _cursor_controller->show(true); } void ComponentRenderer::_use_component_colors( -- cgit v1.2.3-18-g5258