Added grey highlighting to the debug text

This commit is contained in:
Kayne Ruse
2014-03-01 03:31:46 +11:00
parent 7703c4b0ad
commit 19749f7c87
+9 -7
View File
@@ -114,13 +114,15 @@ void EditorScene::Render(SDL_Surface* const screen) {
} }
void EditorScene::DrawToDebugInfo(std::string str, int line) { void EditorScene::DrawToDebugInfo(std::string str, int line) {
//draw the debug info on the right //draw the debug info on the right, with a grey background
font.DrawStringTo( SDL_Rect clip = {
str, Sint16(debugInfo.GetClipW() - str.size() * font.GetCharW()),
debugInfo.GetSurface(), Sint16(font.GetCharH() * line),
debugInfo.GetClipW() - str.size() * font.GetCharW(), Uint16(str.size() * font.GetCharW()),
font.GetCharH() * line 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);
} }
//------------------------- //-------------------------