From 6f7c96aef18658eb939c8e01e96ea3924fd8b200 Mon Sep 17 00:00:00 2001 From: thrust26 Date: Thu, 14 Sep 2023 19:37:27 +0200 Subject: [PATCH] fixed build without image support --- src/gui/RomImageWidget.cxx | 15 +++++++++------ src/gui/RomImageWidget.hxx | 4 ++-- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/gui/RomImageWidget.cxx b/src/gui/RomImageWidget.cxx index 431ad116b..1421b1da1 100644 --- a/src/gui/RomImageWidget.cxx +++ b/src/gui/RomImageWidget.cxx @@ -559,17 +559,20 @@ void RomImageWidget::drawWidget(bool hilite) return; } +#ifdef IMAGE_SUPPORT if(mySurfaceIsValid) { s.fillRect(_x, _y, _w, myImageHeight, 0); positionSurfaces(); } - else if(!mySurfaceErrorMsg.empty()) - { - const uInt32 x = _x + ((_w - _font.getStringWidth(mySurfaceErrorMsg)) >> 1); - const uInt32 y = _y + ((myImageHeight - _font.getLineHeight()) >> 1); - s.drawString(_font, mySurfaceErrorMsg, x, y, _w - 10, _textcolor); - } + else +#endif + if(!mySurfaceErrorMsg.empty()) + { + const uInt32 x = _x + ((_w - _font.getStringWidth(mySurfaceErrorMsg)) >> 1); + const uInt32 y = _y + ((myImageHeight - _font.getLineHeight()) >> 1); + s.drawString(_font, mySurfaceErrorMsg, x, y, _w - 10, _textcolor); + } // Draw the image label and counter ostringstream buf; diff --git a/src/gui/RomImageWidget.hxx b/src/gui/RomImageWidget.hxx index 7b1c30cb5..6f27204fd 100644 --- a/src/gui/RomImageWidget.hxx +++ b/src/gui/RomImageWidget.hxx @@ -47,12 +47,12 @@ class RomImageWidget : public Widget uInt64 pendingLoadTime() { return myMaxLoadTime * timeFactor; } protected: -#ifdef IMAGE_SUPPORT + #ifdef IMAGE_SUPPORT bool handleEvent(Event::Type event) override; void handleMouseUp(int x, int y, MouseButton b, int clickCount) override; void handleMouseMoved(int x, int y) override; void tick() override; -#endif + #endif void drawWidget(bool hilite) override; private: