From 7369332bb0a6d219cb2415a0b5e65bf2825da349 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 25 May 2015 18:45:59 +0300 Subject: Add missing safeDraw to some windows. Without it drawing code can mix safe and not safe drawing. --- src/gui/windows/debugwindow.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/gui/windows/debugwindow.cpp') diff --git a/src/gui/windows/debugwindow.cpp b/src/gui/windows/debugwindow.cpp index e0d73249b..185e4adab 100644 --- a/src/gui/windows/debugwindow.cpp +++ b/src/gui/windows/debugwindow.cpp @@ -134,6 +134,24 @@ void DebugWindow::draw(Graphics *g) BLOCK_END("DebugWindow::draw") } +void DebugWindow::safeDraw(Graphics *g) +{ + BLOCK_START("DebugWindow::draw") + Window::safeDraw(g); + + if (localPlayer) + { + const Being *const target = localPlayer->getTarget(); + if (target) + { + target->draw(g, -target->getPixelX() + mapTileSize / 2 + + mDimension.width / 2, -target->getPixelY() + mapTileSize + + mDimension.height / 2); + } + } + BLOCK_END("DebugWindow::draw") +} + void DebugWindow::widgetResized(const Event &event) { Window::widgetResized(event); -- cgit v1.2.3-60-g2f50