Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void MacWindow::loadBorder(Common::SeekableReadStream &file, bool active, int lo, int ro, int to, int bo) {
- Image::BitmapDecoder bmpDecoder;
- Graphics::Surface *source;
- Graphics::TransparentSurface *surface = new Graphics::TransparentSurface();
- bmpDecoder.loadStream(file);
- source = bmpDecoder.getSurface()->convertTo(surface->getSupportedPixelFormat(), bmpDecoder.getPalette());
- surface->create(source->w, source->h, surface->getSupportedPixelFormat());
- surface->copyFrom(*source);
- surface->applyColorKey(255, 0, 255, false);
- if (active)
- _macBorder.addActiveBorder(surface);
- else
- _macBorder.addInactiveBorder(surface);
- if (!_macBorder.hasOffsets())
- _macBorder.setOffsets(lo, ro, to, bo);
- updateInnerDims();
- source->free();
- delete source;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement