mirror of
https://github.com/scummvm/scummvm.git
synced 2026-05-21 05:40:43 +00:00
GRAPHICS: MACGUI: Create MacText border mask
This commit is contained in:
@@ -287,6 +287,7 @@ MacText::~MacText() {
|
||||
g_system->getTimerManager()->removeTimerProc(&cursorTimerHandler);
|
||||
|
||||
_borderSurface.free();
|
||||
_borderMaskSurface.free();
|
||||
|
||||
delete _cursorRect;
|
||||
delete _cursorSurface;
|
||||
@@ -335,6 +336,13 @@ void MacText::resizeScrollBar(int w, int h) {
|
||||
_borderSurface.clear(_wm->_colorGreen);
|
||||
}
|
||||
_scrollBorder.blitBorderInto(_borderSurface, kWindowBorderScrollbar | kWindowBorderActive);
|
||||
|
||||
_borderMaskSurface.free();
|
||||
_borderMaskSurface.create(w, h, _wm->_pixelformat);
|
||||
if (_wm->_pixelformat.bytesPerPixel == 1) {
|
||||
_borderMaskSurface.clear(_wm->_colorGreen);
|
||||
}
|
||||
_scrollBorder.blitBorderInto(_borderMaskSurface, kWindowBorderScrollbar | kWindowBorderActive, true, 0xff);
|
||||
}
|
||||
|
||||
// this func returns the fg color of the first character we met in text
|
||||
|
||||
@@ -235,6 +235,7 @@ protected:
|
||||
bool _scrollBar;
|
||||
MacWindowBorder _scrollBorder;
|
||||
ManagedSurface _borderSurface;
|
||||
ManagedSurface _borderMaskSurface;
|
||||
|
||||
int _selEnd;
|
||||
int _selStart;
|
||||
|
||||
@@ -314,7 +314,7 @@ void MacWindowBorder::loadInternalBorder(uint32 flags) {
|
||||
}
|
||||
}
|
||||
|
||||
void MacWindowBorder::blitBorderInto(ManagedSurface &destination, uint32 flags) {
|
||||
void MacWindowBorder::blitBorderInto(ManagedSurface &destination, uint32 flags, bool maskOnly, uint32 maskColor) {
|
||||
if (flags >= kWindowBorderMaxFlag) {
|
||||
warning("Accessing non-existed border type");
|
||||
return;
|
||||
@@ -337,12 +337,12 @@ void MacWindowBorder::blitBorderInto(ManagedSurface &destination, uint32 flags)
|
||||
setTitle(_title, destination.w);
|
||||
}
|
||||
|
||||
src->blit(destination, 0, 0, destination.w, destination.h, _wm);
|
||||
src->blit(destination, 0, 0, destination.w, destination.h, _wm, maskOnly, maskColor);
|
||||
|
||||
if (flags & kWindowBorderTitle)
|
||||
if (flags & kWindowBorderTitle && !maskOnly)
|
||||
drawTitle(&destination, src->getTitleOffset(), _border[flags]->getMinWidth());
|
||||
|
||||
if (flags & kWindowBorderScrollbar)
|
||||
if (flags & kWindowBorderScrollbar && !maskOnly)
|
||||
drawScrollBar(&destination);
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ public:
|
||||
* @param border type that you want to draw
|
||||
* @param wm The window manager.
|
||||
*/
|
||||
void blitBorderInto(ManagedSurface &destination, uint32 flags);
|
||||
void blitBorderInto(ManagedSurface &destination, uint32 flags, bool maskOnly = false, uint32 maskColor = 0);
|
||||
|
||||
void setTitle(const Common::String& title, int width);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user