From b58b93ac98d49c487e8b9e519182a3fb569b4eee Mon Sep 17 00:00:00 2001 From: Benau Date: Thu, 20 Jun 2019 16:29:07 +0800 Subject: [PATCH] Reserve enough space for each line in profiler And use drawQuick to avoid text shaping --- src/utils/profiler.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/utils/profiler.cpp b/src/utils/profiler.cpp index 2196df273..c228333a6 100644 --- a/src/utils/profiler.cpp +++ b/src/utils/profiler.cpp @@ -42,8 +42,8 @@ Profiler profiler; #define MARGIN_Y 0.02f // top margin #define LINE_HEIGHT 0.030f // height of a line representing a thread -#define MARKERS_NAMES_POS core::rect(50,100,150,200) -#define GPU_MARKERS_NAMES_POS core::rect(50,165,150,250) +#define MARKERS_NAMES_POS core::rect(50,100,150,600) +#define GPU_MARKERS_NAMES_POS core::rect(50,165,150,300) // The width of the profiler corresponds to TIME_DRAWN_MS milliseconds #define TIME_DRAWN_MS 30.0f @@ -463,14 +463,14 @@ void Profiler::draw() text += oss.str().c_str(); hovered_markers.pop(); } - font->draw(text, MARKERS_NAMES_POS, video::SColor(0xFF, 0xFF, 0x00, 0x00)); + font->drawQuick(text, MARKERS_NAMES_POS, video::SColor(0xFF, 0xFF, 0x00, 0x00)); if (hovered_gpu_marker != Q_LAST) { std::ostringstream oss; oss << irr_driver->getGPUQueryPhaseName(hovered_gpu_marker) << " : " << hovered_gpu_marker_elapsed << " us"; - font->draw(oss.str().c_str(), GPU_MARKERS_NAMES_POS, + font->drawQuick(oss.str().c_str(), GPU_MARKERS_NAMES_POS, video::SColor(0xFF, 0xFF, 0x00, 0x00)); } }