diff options
Diffstat (limited to 'graphics/macgui/macwindow.cpp')
-rw-r--r-- | graphics/macgui/macwindow.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/graphics/macgui/macwindow.cpp b/graphics/macgui/macwindow.cpp index dbb600ba82..975d52639e 100644 --- a/graphics/macgui/macwindow.cpp +++ b/graphics/macgui/macwindow.cpp @@ -317,26 +317,27 @@ void MacWindow::setScroll(float scrollPos, float scrollSize) { void MacWindow::loadBorder(Common::SeekableReadStream &file, bool active, int lo, int ro, int to, int bo) { Image::BitmapDecoder bmpDecoder; - Graphics::Surface source; + Graphics::Surface *source; Graphics::TransparentSurface *surface = new Graphics::TransparentSurface(); bmpDecoder.loadStream(file); - source = *(bmpDecoder.getSurface()); + source = bmpDecoder.getSurface()->convertTo(surface->getSupportedPixelFormat(), bmpDecoder.getPalette()); - source.convertToInPlace(surface->getSupportedPixelFormat(), bmpDecoder.getPalette()); - surface->create(source.w, source.h, source.format); - surface->copyFrom(source); + surface->create(source->w, source->h, surface->getSupportedPixelFormat()); + surface->copyFrom(*source); surface->applyColorKey(255, 0, 255, false); if (active) - _macBorder.addActiveBorder(*surface); + _macBorder.addActiveBorder(surface); else - _macBorder.addInactiveBorder(*surface); + _macBorder.addInactiveBorder(surface); if (!_macBorder.hasOffsets()) _macBorder.setOffsets(lo, ro, to, bo); updateInnerDims(); + source->free(); + delete source; } void MacWindow::setCloseable(bool closeable) { |