[Scummvm-git-logs] scummvm master -> bfd65a257ec6170fc4fadd843d699bf23bcfa1b2
sev-
noreply at scummvm.org
Sat Apr 11 20:49:16 UTC 2026
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
b5e9e7aa1a GRAPHICS: Add mask drawing mode to 9-patch
bfd65a257e GRAPHICS: MACGUI: Create MacText border mask
Commit: b5e9e7aa1ac46fc0725b85b42b076224192a6025
https://github.com/scummvm/scummvm/commit/b5e9e7aa1ac46fc0725b85b42b076224192a6025
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-04-11T22:49:02+02:00
Commit Message:
GRAPHICS: Add mask drawing mode to 9-patch
Changed paths:
graphics/nine_patch.cpp
graphics/nine_patch.h
diff --git a/graphics/nine_patch.cpp b/graphics/nine_patch.cpp
index ce86fed5a60..711aefbe663 100644
--- a/graphics/nine_patch.cpp
+++ b/graphics/nine_patch.cpp
@@ -285,7 +285,7 @@ void NinePatchBitmap::modifyTitleWidth(int titleWidth) {
_h.calcOffsets(_cached_dw, _titleIndex, _titleWidth);
}
-void NinePatchBitmap::blit(Graphics::ManagedSurface &target, int dx, int dy, int dw, int dh, MacWindowManager *wm) {
+void NinePatchBitmap::blit(Graphics::ManagedSurface &target, int dx, int dy, int dw, int dh, MacWindowManager *wm, bool maskOnly, uint32 maskColor) {
/* don't draw bitmaps that are smaller than the fixed area */
if (dw < _h._fix || dh < _v._fix)
return;
@@ -325,7 +325,7 @@ void NinePatchBitmap::blit(Graphics::ManagedSurface &target, int dx, int dy, int
byte r = palette[(color * 3) + 0];
byte g = palette[(color * 3) + 1];
byte b = palette[(color * 3) + 2];
- *((byte *)target.getBasePtr(i, j)) = wm->findBestColor(r, g, b);
+ *((byte *)target.getBasePtr(i, j)) = maskOnly ? maskColor : wm->findBestColor(r, g, b);
}
}
}
@@ -336,7 +336,7 @@ void NinePatchBitmap::blit(Graphics::ManagedSurface &target, int dx, int dy, int
if (color != transColor) {
byte a, r, g, b;
srf->format.colorToARGB(color, a, r, g, b);
- *((byte *)target.getBasePtr(i, j)) = wm->findBestColor(r, g, b);
+ *((byte *)target.getBasePtr(i, j)) = maskOnly ? maskColor : wm->findBestColor(r, g, b);
}
}
}
diff --git a/graphics/nine_patch.h b/graphics/nine_patch.h
index 8252b612d9f..bd1e3934195 100644
--- a/graphics/nine_patch.h
+++ b/graphics/nine_patch.h
@@ -88,7 +88,7 @@ public:
NinePatchBitmap(Graphics::ManagedSurface *bmp, bool owns_bitmap, int titlePos = 0);
~NinePatchBitmap();
- void blit(Graphics::ManagedSurface &target, int dx, int dy, int dw, int dh, MacWindowManager *wm = NULL);
+ void blit(Graphics::ManagedSurface &target, int dx, int dy, int dw, int dh, MacWindowManager *wm = NULL, bool maskOnly = false, uint32 maskColor = 0);
void modifyTitleWidth(int titleWidth);
int getWidth() { return _width; }
Commit: bfd65a257ec6170fc4fadd843d699bf23bcfa1b2
https://github.com/scummvm/scummvm/commit/bfd65a257ec6170fc4fadd843d699bf23bcfa1b2
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-04-11T22:49:02+02:00
Commit Message:
GRAPHICS: MACGUI: Create MacText border mask
Changed paths:
graphics/macgui/mactext.cpp
graphics/macgui/mactext.h
graphics/macgui/macwindowborder.cpp
graphics/macgui/macwindowborder.h
diff --git a/graphics/macgui/mactext.cpp b/graphics/macgui/mactext.cpp
index 663d9ad6d64..8690275fd8a 100644
--- a/graphics/macgui/mactext.cpp
+++ b/graphics/macgui/mactext.cpp
@@ -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
diff --git a/graphics/macgui/mactext.h b/graphics/macgui/mactext.h
index 697ead43d21..9249732950c 100644
--- a/graphics/macgui/mactext.h
+++ b/graphics/macgui/mactext.h
@@ -235,6 +235,7 @@ protected:
bool _scrollBar;
MacWindowBorder _scrollBorder;
ManagedSurface _borderSurface;
+ ManagedSurface _borderMaskSurface;
int _selEnd;
int _selStart;
diff --git a/graphics/macgui/macwindowborder.cpp b/graphics/macgui/macwindowborder.cpp
index 8048b7abbdd..6893c53684b 100644
--- a/graphics/macgui/macwindowborder.cpp
+++ b/graphics/macgui/macwindowborder.cpp
@@ -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);
}
diff --git a/graphics/macgui/macwindowborder.h b/graphics/macgui/macwindowborder.h
index 2f9bc3bd07d..87497cbd7dd 100644
--- a/graphics/macgui/macwindowborder.h
+++ b/graphics/macgui/macwindowborder.h
@@ -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);
More information about the Scummvm-git-logs
mailing list