diff options
Diffstat (limited to 'graphics/macgui')
-rw-r--r-- | graphics/macgui/macwindow.cpp | 18 | ||||
-rw-r--r-- | graphics/macgui/macwindow.h | 4 |
2 files changed, 13 insertions, 9 deletions
diff --git a/graphics/macgui/macwindow.cpp b/graphics/macgui/macwindow.cpp index 0ca0a89acb..dfb1c07f86 100644 --- a/graphics/macgui/macwindow.cpp +++ b/graphics/macgui/macwindow.cpp @@ -79,6 +79,8 @@ MacWindow::MacWindow(int id, bool scrollable, bool resizable, bool editable, Mac _type = kWindowWindow; + _borders = nullptr; + } MacWindow::~MacWindow() { @@ -148,11 +150,13 @@ bool MacWindow::draw(ManagedSurface *g, bool forceRedraw) { _composeSurface.blitFrom(_surface, Common::Rect(0, 0, _surface.w - 2, _surface.h - 2), Common::Point(2, 2)); _composeSurface.transBlitFrom(_borderSurface, kColorGreen); - TransparentSurface tr(_borders); - //tr.create(_composeSurface.w, _composeSurface.h, tr.getSupportedPixelFormat()); - - //_bmp->blit(tr, 0, 0, tr.w, tr.h) - _composeSurface.transBlitFrom(tr); + if (_borders) { + TransparentSurface tr(*_borders); + //tr.create(_composeSurface.w, _composeSurface.h, tr.getSupportedPixelFormat()); + + //_bmp->blit(tr, 0, 0, tr.w, tr.h) + _composeSurface.transBlitFrom(tr); + } g->transBlitFrom(_composeSurface, _composeSurface.getBounds(), Common::Point(_dims.left - 2, _dims.top - 2), kColorGreen2); @@ -286,8 +290,8 @@ void MacWindow::setHighlight(WindowClick highlightedPart) { } void MacWindow::setBorders(TransparentSurface *source) { - _bmp = NinePatchBitmap(source, true); - _borders = TransparentSurface(*source); + _bmp = new NinePatchBitmap(source, true); + _borders = new TransparentSurface(*source); } diff --git a/graphics/macgui/macwindow.h b/graphics/macgui/macwindow.h index 335722b6e2..9c908f3912 100644 --- a/graphics/macgui/macwindow.h +++ b/graphics/macgui/macwindow.h @@ -149,8 +149,8 @@ private: ManagedSurface _borderSurface; ManagedSurface _composeSurface; - NinePatchBitmap _bmp; - TransparentSurface _borders; + NinePatchBitmap *_bmp; + TransparentSurface *_borders = nullptr; bool _scrollable; bool _resizable; |