From 0f22ed2ef160eef2da6080782943b22c9539650d Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Sun, 2 Feb 2025 22:49:01 +0100 Subject: wip: hacky file browser --- lib/nes/app/graphics/renderer.hh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/nes/app/graphics') diff --git a/lib/nes/app/graphics/renderer.hh b/lib/nes/app/graphics/renderer.hh index cc0b9af..5b9ec48 100644 --- a/lib/nes/app/graphics/renderer.hh +++ b/lib/nes/app/graphics/renderer.hh @@ -54,18 +54,19 @@ namespace nes::app template auto render_text_format( i32 const x, i32 const y, color const c, text_attributes const attrs, std::string_view const fmt, - Args... args) -> void + Args... args) -> u32 { char buffer[width]; auto const str = string_builder{ buffer, sizeof(buffer) }.append_format(fmt, args...).get_result(); render_text(x, y, str, c, attrs); + return static_cast(str.length()); } template auto render_text_format( - i32 const x, i32 const y, color const c, std::string_view const fmt, Args... args) -> void + i32 const x, i32 const y, color const c, std::string_view const fmt, Args... args) -> u32 { - render_text_format(x, y, c, text_attributes{}, fmt, args...); + return render_text_format(x, y, c, text_attributes{}, fmt, args...); } /// Render a rectangle at the given tile coordinates with a given size (measured in tiles). -- cgit v1.3.1