aboutsummaryrefslogtreecommitdiff
path: root/src/engine/graphics
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2022-06-23 20:16:07 +0200
committerHampusM <hampus@hampusmat.com>2022-06-23 20:16:07 +0200
commitafa22dc6450a7f2341c432604d5e50735d6830c7 (patch)
treeb2d3b9a27f8403b1b1117ae7dfef951b14b3c013 /src/engine/graphics
parent0f9d874b6af4698234be96de1fddad15aa882a1d (diff)
perf: reduce cout flushing
Diffstat (limited to 'src/engine/graphics')
-rw-r--r--src/engine/graphics/component_renderer.cpp9
1 files changed, 4 insertions, 5 deletions
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(