From 93e8109cdfd37a5e5cc55eeba4d0e9aa9dcefca2 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Fri, 4 Oct 2019 19:08:58 +0200 Subject: GRAPHICS: MACGUI: Add possibility to pass borders as a surface --- graphics/macgui/macwindow.cpp | 10 ++++++++-- graphics/macgui/macwindow.h | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'graphics/macgui') diff --git a/graphics/macgui/macwindow.cpp b/graphics/macgui/macwindow.cpp index f41378bd9e..e100820b9e 100644 --- a/graphics/macgui/macwindow.cpp +++ b/graphics/macgui/macwindow.cpp @@ -336,6 +336,14 @@ void MacWindow::loadBorder(Common::SeekableReadStream &file, bool active, int lo surface->create(source->w, source->h, surface->getSupportedPixelFormat()); surface->copyFrom(*source); + + source->free(); + delete source; + + setBorder(surface, active, lo, ro, to, bo); +} + +void MacWindow::setBorder(Graphics::TransparentSurface *surface, bool active, int lo, int ro, int to, int bo) { surface->applyColorKey(255, 0, 255, false); if (active) @@ -350,8 +358,6 @@ void MacWindow::loadBorder(Common::SeekableReadStream &file, bool active, int lo } updateInnerDims(); - source->free(); - delete source; } void MacWindow::setCloseable(bool closeable) { diff --git a/graphics/macgui/macwindow.h b/graphics/macgui/macwindow.h index fdf750c50a..94d6e943a7 100644 --- a/graphics/macgui/macwindow.h +++ b/graphics/macgui/macwindow.h @@ -277,7 +277,7 @@ public: * @param bo Width of the bottom side of the border, in pixels. */ void loadBorder(Common::SeekableReadStream &file, bool active, int lo = -1, int ro = -1, int to = -1, int bo = -1); - //void setBorder(TransparentSurface &border, bool active); + void setBorder(TransparentSurface *border, bool active, int lo = -1, int ro = -1, int to = -1, int bo = -1); /** * Indicate whether the window can be closed (false by default). -- cgit v1.2.3