GUI: Fix compilation with LAYOUT_DEBUG_DIALOG enabled
This commit is contained in:
parent
f0f213ca6b
commit
b9a2753c2c
3 changed files with 20 additions and 10 deletions
|
@ -96,8 +96,17 @@ public:
|
||||||
Graphics::TextAlign getWidgetTextHAlign(const Common::String &widget);
|
Graphics::TextAlign getWidgetTextHAlign(const Common::String &widget);
|
||||||
|
|
||||||
#ifdef LAYOUT_DEBUG_DIALOG
|
#ifdef LAYOUT_DEBUG_DIALOG
|
||||||
void debugDraw(Graphics::Surface *screen, const Graphics::Font *font) {
|
void debugDraw(Graphics::ManagedSurface *screen, const Graphics::Font *font) {
|
||||||
_layouts[LAYOUT_DEBUG_DIALOG]->debugDraw(screen, font);
|
if (_layouts.contains(LAYOUT_DEBUG_DIALOG)) {
|
||||||
|
_layouts[LAYOUT_DEBUG_DIALOG]->debugDraw(screen, font);
|
||||||
|
} else {
|
||||||
|
Common::String list;
|
||||||
|
|
||||||
|
for (auto l = _layouts.begin(); l != _layouts.end(); ++l)
|
||||||
|
list += " " + l->_key;
|
||||||
|
|
||||||
|
warning("debugDraw: Unknown layout %s\nList:%s", LAYOUT_DEBUG_DIALOG, list.c_str());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -146,7 +146,7 @@ int16 ThemeLayoutStacked::getParentHeight() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef LAYOUT_DEBUG_DIALOG
|
#ifdef LAYOUT_DEBUG_DIALOG
|
||||||
void ThemeLayout::debugDraw(Graphics::Surface *screen, const Graphics::Font *font) {
|
void ThemeLayout::debugDraw(Graphics::ManagedSurface *screen, const Graphics::Font *font) {
|
||||||
uint32 color = 0xFFFFFFFF;
|
uint32 color = 0xFFFFFFFF;
|
||||||
font->drawString(screen, getName(), _x, _y, _w, color, Graphics::kTextAlignRight, 0, true);
|
font->drawString(screen, getName(), _x, _y, _w, color, Graphics::kTextAlignRight, 0, true);
|
||||||
screen->hLine(_x, _y, _x + _w, color);
|
screen->hLine(_x, _y, _x + _w, color);
|
||||||
|
|
|
@ -27,6 +27,8 @@
|
||||||
#include "common/rect.h"
|
#include "common/rect.h"
|
||||||
#include "graphics/font.h"
|
#include "graphics/font.h"
|
||||||
|
|
||||||
|
//#define LAYOUT_DEBUG_DIALOG "Dialog.Launcher"
|
||||||
|
|
||||||
#ifdef LAYOUT_DEBUG_DIALOG
|
#ifdef LAYOUT_DEBUG_DIALOG
|
||||||
namespace Graphics {
|
namespace Graphics {
|
||||||
struct Surface;
|
struct Surface;
|
||||||
|
@ -124,10 +126,9 @@ public:
|
||||||
Graphics::TextAlign getTextHAlign() { return _textHAlign; }
|
Graphics::TextAlign getTextHAlign() { return _textHAlign; }
|
||||||
|
|
||||||
#ifdef LAYOUT_DEBUG_DIALOG
|
#ifdef LAYOUT_DEBUG_DIALOG
|
||||||
void debugDraw(Graphics::Surface *screen, const Graphics::Font *font);
|
void debugDraw(Graphics::ManagedSurface *screen, const Graphics::Font *font);
|
||||||
|
|
||||||
virtual const char *getName() const = 0;
|
|
||||||
#endif
|
#endif
|
||||||
|
virtual const char *getName() const { return "<override-me>"; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ThemeLayout *_parent;
|
ThemeLayout *_parent;
|
||||||
|
@ -159,7 +160,7 @@ public:
|
||||||
_y = _defaultY;
|
_y = _defaultY;
|
||||||
}
|
}
|
||||||
|
|
||||||
const char *getName() const { return _name.c_str(); }
|
virtual const char *getName() const override { return _name.c_str(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
LayoutType getLayoutType() const override { return kLayoutMain; }
|
LayoutType getLayoutType() const override { return kLayoutMain; }
|
||||||
|
@ -192,7 +193,7 @@ public:
|
||||||
void reflowLayoutVertical(Widget *widgetChain);
|
void reflowLayoutVertical(Widget *widgetChain);
|
||||||
|
|
||||||
#ifdef LAYOUT_DEBUG_DIALOG
|
#ifdef LAYOUT_DEBUG_DIALOG
|
||||||
const char *getName() const {
|
const char *getName() const override {
|
||||||
return (_type == kLayoutVertical)
|
return (_type == kLayoutVertical)
|
||||||
? "Vertical Layout" : "Horizontal Layout";
|
? "Vertical Layout" : "Horizontal Layout";
|
||||||
}
|
}
|
||||||
|
@ -234,7 +235,7 @@ public:
|
||||||
|
|
||||||
void reflowLayout(Widget *widgetChain) override;
|
void reflowLayout(Widget *widgetChain) override;
|
||||||
|
|
||||||
virtual const char *getName() const { return _name.c_str(); }
|
virtual const char *getName() const override { return _name.c_str(); }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
LayoutType getLayoutType() const override { return kLayoutWidget; }
|
LayoutType getLayoutType() const override { return kLayoutWidget; }
|
||||||
|
@ -300,7 +301,7 @@ public:
|
||||||
bool getWidgetData(const Common::String &name, int16 &x, int16 &y, int16 &w, int16 &h, bool &useRTL) override { return false; }
|
bool getWidgetData(const Common::String &name, int16 &x, int16 &y, int16 &w, int16 &h, bool &useRTL) override { return false; }
|
||||||
void reflowLayout(Widget *widgetChain) override {}
|
void reflowLayout(Widget *widgetChain) override {}
|
||||||
#ifdef LAYOUT_DEBUG_DIALOG
|
#ifdef LAYOUT_DEBUG_DIALOG
|
||||||
const char *getName() const { return "SPACE"; }
|
const char *getName() const override { return "SPACE"; }
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue