GRAPHICS: MACGUI: Add disableBorder() to MacWindow

This commit is contained in:
Eugene Sandulenko 2020-04-08 00:47:11 +02:00
parent 54251d658f
commit 8ae73ce263
2 changed files with 23 additions and 0 deletions

View File

@ -68,6 +68,28 @@ MacWindow::MacWindow(int id, bool scrollable, bool resizable, bool editable, Mac
MacWindow::~MacWindow() {
}
static const byte noborderData[3][3] = {
{ 0, 1, 0 },
{ 1, 0, 1 },
{ 0, 1, 0 },
};
void MacWindow::disableBorder() {
Graphics::TransparentSurface *noborder = new Graphics::TransparentSurface();
noborder->create(3, 3, noborder->getSupportedPixelFormat());
uint32 colorBlack = noborder->getSupportedPixelFormat().RGBToColor(0, 0, 0);
uint32 colorPink = noborder->getSupportedPixelFormat().RGBToColor(255, 0, 255);
for (int y = 0; y < 3; y++)
for (int x = 0; x < 3; x++)
*((uint32 *)noborder->getBasePtr(x, y)) = noborderData[y][x] ? colorBlack : colorPink;
setBorder(noborder, true);
Graphics::TransparentSurface *noborder2 = new Graphics::TransparentSurface(*noborder, true);
setBorder(noborder2, false);
}
const Font *MacWindow::getTitleFont() {
return _wm->_fontMan->getFont(Graphics::MacFont(kMacFontChicago, 12));
}

View File

@ -266,6 +266,7 @@ public:
*/
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, int lo = -1, int ro = -1, int to = -1, int bo = -1);
void disableBorder();
/**
* Indicate whether the window can be closed (false by default).