From 19749f7c87fcf85a3b90c2364fb689fca5ef4f62 Mon Sep 17 00:00:00 2001 From: Kayne Ruse Date: Sat, 1 Mar 2014 03:31:46 +1100 Subject: [PATCH] Added grey highlighting to the debug text --- editor/editor_scene.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/editor/editor_scene.cpp b/editor/editor_scene.cpp index 2709419..005b05a 100644 --- a/editor/editor_scene.cpp +++ b/editor/editor_scene.cpp @@ -114,13 +114,15 @@ void EditorScene::Render(SDL_Surface* const screen) { } void EditorScene::DrawToDebugInfo(std::string str, int line) { - //draw the debug info on the right - font.DrawStringTo( - str, - debugInfo.GetSurface(), - debugInfo.GetClipW() - str.size() * font.GetCharW(), - font.GetCharH() * line - ); + //draw the debug info on the right, with a grey background + SDL_Rect clip = { + Sint16(debugInfo.GetClipW() - str.size() * font.GetCharW()), + Sint16(font.GetCharH() * line), + Uint16(str.size() * font.GetCharW()), + Uint16(font.GetCharH()) + }; + SDL_FillRect(debugInfo.GetSurface(), &clip, SDL_MapRGB(debugInfo.GetSurface()->format, 64, 64, 64)); + font.DrawStringTo(str, debugInfo.GetSurface(), clip.x, clip.y); } //-------------------------