Advertisement
Guest User

Untitled

a guest
Aug 26th, 2016
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.77 KB | None | 0 0
  1. void MacWindow::loadBorder(Common::SeekableReadStream &file, bool active, int lo, int ro, int to, int bo) {
  2.     Image::BitmapDecoder bmpDecoder;
  3.     Graphics::Surface *source;
  4.     Graphics::TransparentSurface *surface = new Graphics::TransparentSurface();
  5.  
  6.     bmpDecoder.loadStream(file);
  7.     source = bmpDecoder.getSurface()->convertTo(surface->getSupportedPixelFormat(), bmpDecoder.getPalette());
  8.  
  9.     surface->create(source->w, source->h, surface->getSupportedPixelFormat());
  10.     surface->copyFrom(*source);
  11.     surface->applyColorKey(255, 0, 255, false);
  12.  
  13.     if (active)
  14.         _macBorder.addActiveBorder(surface);
  15.     else
  16.         _macBorder.addInactiveBorder(surface);
  17.  
  18.     if (!_macBorder.hasOffsets())
  19.         _macBorder.setOffsets(lo, ro, to, bo);
  20.  
  21.     updateInnerDims();
  22.     source->free();
  23.     delete source;
  24. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement