From 7a07650556d3d3c190bcec5c56cd86c2d6ee196c Mon Sep 17 00:00:00 2001 From: thrust26 Date: Mon, 21 Dec 2020 09:14:42 +0100 Subject: [PATCH] limited redraw debug output to DEBUG_BUILD --- src/emucore/FrameBuffer.cxx | 2 ++ src/gui/Dialog.cxx | 12 +++++++++--- src/gui/DialogContainer.cxx | 8 ++++++-- src/gui/PopUpWidget.cxx | 1 - src/gui/TimeLineWidget.cxx | 2 -- src/gui/Widget.cxx | 4 ++++ 6 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/emucore/FrameBuffer.cxx b/src/emucore/FrameBuffer.cxx index 670e33f8c..4f6006e49 100644 --- a/src/emucore/FrameBuffer.cxx +++ b/src/emucore/FrameBuffer.cxx @@ -739,8 +739,10 @@ inline bool FrameBuffer::drawMessage() if(myMsg.dirty) { + #ifdef DEBUG_BUILD cerr << "m"; //cerr << "--- draw message ---" << endl; + #endif // Draw the bounded box and text const Common::Rect& dst = myMsg.surface->dstRect(); diff --git a/src/gui/Dialog.cxx b/src/gui/Dialog.cxx index 72bdc398a..95107b7b3 100644 --- a/src/gui/Dialog.cxx +++ b/src/gui/Dialog.cxx @@ -244,7 +244,9 @@ void Dialog::redraw(bool force) // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void Dialog::render() { +#ifdef DEBUG_BUILD //cerr << " render " << typeid(*this).name() << endl; +#endif // Update dialog surface; also render any extra surfaces // Extra surfaces must be rendered afterwards, so they are drawn on top @@ -263,8 +265,6 @@ void Dialog::render() if(!onTop) { - //cerr << " shade " << typeid(*this).name() << endl; - _shadeSurface->setDstRect(_surface->dstRect()); _shadeSurface->render(); } @@ -433,8 +433,10 @@ void Dialog::drawDialog() if(isDirty()) { - cerr << endl << "d"; + #ifdef DEBUG_BUILD //cerr << "*** draw dialog " << typeid(*this).name() << " ***" << endl; + cerr << endl << "d"; + #endif if(clearsBackground()) { @@ -453,7 +455,9 @@ void Dialog::drawDialog() } else { s.invalidate(); + #ifdef DEBUG_BUILD //cerr << "invalidate " << typeid(*this).name() << endl; + #endif } if(hasBorder()) // currently only used by Dialog itself s.frameRect(_x, _y, _w, _h, kColor); @@ -463,8 +467,10 @@ void Dialog::drawDialog() clearDirty(); } +#ifdef DEBUG_BUILD else cerr << endl; +#endif // Draw all children drawChain(); diff --git a/src/gui/DialogContainer.cxx b/src/gui/DialogContainer.cxx index c421cb430..b4307aa45 100644 --- a/src/gui/DialogContainer.cxx +++ b/src/gui/DialogContainer.cxx @@ -94,8 +94,9 @@ void DialogContainer::draw(bool full) { if(myDialogStack.empty()) return; - +#ifdef DEBUG_BUILD //cerr << "draw " << full << " " << typeid(*this).name() << endl; +#endif // Draw and render all dirty dialogs myDialogStack.applyAll([&](Dialog*& d) { @@ -118,8 +119,9 @@ void DialogContainer::render() { if(myDialogStack.empty()) return; - +#ifdef DEBUG_BUILD //cerr << "full re-render " << typeid(*this).name() << endl; +#endif // Make sure we start in a clean state (with zero'ed buffers) if(!myOSystem.eventHandler().inTIAMode()) @@ -171,7 +173,9 @@ void DialogContainer::removeDialog() { if(!myDialogStack.empty()) { + #ifdef DEBUG_BUILD //cerr << "remove dialog " << typeid(*myDialogStack.top()).name() << endl; + #endif myDialogStack.pop(); // Inform the frame buffer that it has to render all surfaces diff --git a/src/gui/PopUpWidget.cxx b/src/gui/PopUpWidget.cxx index 762ce3bf8..0bdd2e552 100644 --- a/src/gui/PopUpWidget.cxx +++ b/src/gui/PopUpWidget.cxx @@ -247,7 +247,6 @@ void PopUpWidget::setArrow() // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - void PopUpWidget::drawWidget(bool hilite) { -//cerr << "PopUpWidget::drawWidget\n"; FBSurface& s = dialog().surface(); int x = _x + _labelWidth; diff --git a/src/gui/TimeLineWidget.cxx b/src/gui/TimeLineWidget.cxx index 3018bb40c..23d50d542 100644 --- a/src/gui/TimeLineWidget.cxx +++ b/src/gui/TimeLineWidget.cxx @@ -143,8 +143,6 @@ void TimeLineWidget::drawWidget(bool hilite) { FBSurface& s = _boss->dialog().surface(); - //cerr << "TimeLineWidget::drawWidget " << typeid(s).name() << endl; - // Draw the label, if any if(_labelWidth > 0) s.drawString(_font, _label, _x, _y + 2, _labelWidth, diff --git a/src/gui/Widget.cxx b/src/gui/Widget.cxx index 4e11b59ff..2d4a4c135 100644 --- a/src/gui/Widget.cxx +++ b/src/gui/Widget.cxx @@ -99,8 +99,10 @@ void Widget::draw() if(isDirty()) { + #ifdef DEBUG_BUILD //cerr << " *** draw widget " << typeid(*this).name() << " ***" << endl; cerr << "w"; + #endif FBSurface& s = _boss->dialog().surface(); int oldX = _x, oldY = _y; @@ -383,7 +385,9 @@ void Widget::setDirtyInChain(Widget* start) { while(start) { + #ifdef DEBUG_BUILD //cerr << "setDirtyInChain " << typeid(*start).name() << endl; + #endif start->setDirty(); start = start->_next; }