[Scummvm-git-logs] scummvm master -> f4772f01bdde2a49f934bd644f48871faec58c0d
bluegr
noreply at scummvm.org
Tue Aug 12 07:49:51 UTC 2025
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:
ac6ed58737 GRAPHICS: MACGUI: Define custom copy constructor for `MacWindow`
f4772f01bd GRAPHICS: Fix Deprecation Warning in ManagedSurface copy constructor
Commit: ac6ed5873755017db744d45ae7fdc53119889445
https://github.com/scummvm/scummvm/commit/ac6ed5873755017db744d45ae7fdc53119889445
Author: Malhar (themalharbdv2046 at gmail.com)
Date: 2025-08-12T10:49:48+03:00
Commit Message:
GRAPHICS: MACGUI: Define custom copy constructor for `MacWindow`
To avoid using the deprecated copy constructor for `ManagedSurface`
MacWindow has a member `_borderSurface` of type ManagedSurface
Changed paths:
graphics/macgui/macwindow.cpp
graphics/macgui/macwindow.h
graphics/managed_surface.cpp
diff --git a/graphics/macgui/macwindow.cpp b/graphics/macgui/macwindow.cpp
index ab48e59321a..0fc31f88c8c 100644
--- a/graphics/macgui/macwindow.cpp
+++ b/graphics/macgui/macwindow.cpp
@@ -78,6 +78,40 @@ MacWindow::MacWindow(int id, bool scrollable, bool resizable, bool editable, Mac
_mode = 0;
}
+MacWindow::MacWindow(const MacWindow &source) :
+ BaseMacWindow(source),
+
+ _borderIsDirty(source._borderIsDirty),
+ _innerDims(source._innerDims),
+ _dirtyRects(source._dirtyRects),
+ _hasScrollBar(source._hasScrollBar),
+ _mode(source._mode),
+
+ _macBorder(source._macBorder),
+ _pattern(source._pattern),
+ _hasPattern(source._hasPattern),
+ _scrollable(source._scrollable),
+ _resizable(source._resizable),
+ _closeable(source._closeable),
+ _isTitleVisible(source._isTitleVisible),
+ _borderWidth(source._borderWidth),
+
+ _beingDragged(source._beingDragged),
+ _beingResized(source._beingResized),
+ _draggedX(source._draggedX),
+ _draggedY(source._draggedY),
+ _highlightedPart(source._highlightedPart),
+
+ _title(source._title),
+ _shadowedTitle(source._shadowedTitle),
+ _borderType(source._borderType) {
+
+ // The copy constructor of ManagedSurface is deprecated
+ // Need to use copyFrom
+ _borderSurface.copyFrom(source._borderSurface);
+
+}
+
void MacWindow::disableBorder() {
_macBorder.disableBorder();
}
diff --git a/graphics/macgui/macwindow.h b/graphics/macgui/macwindow.h
index d81601778ee..36d15f1b078 100644
--- a/graphics/macgui/macwindow.h
+++ b/graphics/macgui/macwindow.h
@@ -202,6 +202,13 @@ public:
* @param wm See BaseMacWindow.
*/
MacWindow(int id, bool scrollable, bool resizable, bool editable, MacWindowManager *wm);
+
+ /**
+ * Copy constructor for MacWindow
+ * Needs defining because ManagedSurface has a deprecated default copy constructor
+ * @param source Source window to copy from
+ */
+ MacWindow(const MacWindow &source);
virtual ~MacWindow() {}
/**
diff --git a/graphics/managed_surface.cpp b/graphics/managed_surface.cpp
index f6420d48ebb..dcf3ea1501a 100644
--- a/graphics/managed_surface.cpp
+++ b/graphics/managed_surface.cpp
@@ -1046,7 +1046,7 @@ Common::Rect ManagedSurface::blendBlitTo(Surface &target,
const AlphaType alphaType) {
Common::Rect srcArea = srcRect ? *srcRect : Common::Rect(0, 0, w, h);
Common::Rect dstArea(posX, posY, posX + (width == -1 ? srcArea.width() : width), posY + (height == -1 ? srcArea.height() : height));
-
+
if (!isBlendBlitPixelFormatSupported(format, target.format)) {
warning("ManagedSurface::blendBlitTo only accepts RGBA32!");
return Common::Rect(0, 0, 0, 0);
Commit: f4772f01bdde2a49f934bd644f48871faec58c0d
https://github.com/scummvm/scummvm/commit/f4772f01bdde2a49f934bd644f48871faec58c0d
Author: Malhar (themalharbdv2046 at gmail.com)
Date: 2025-08-12T10:49:48+03:00
Commit Message:
GRAPHICS: Fix Deprecation Warning in ManagedSurface copy constructor
Instead of using the deprecated `operator=` method, use `copyFrom()`
Changed paths:
graphics/managed_surface.cpp
diff --git a/graphics/managed_surface.cpp b/graphics/managed_surface.cpp
index dcf3ea1501a..fb65c46c1ff 100644
--- a/graphics/managed_surface.cpp
+++ b/graphics/managed_surface.cpp
@@ -41,7 +41,7 @@ ManagedSurface::ManagedSurface(const ManagedSurface &surf) :
w(_innerSurface.w), h(_innerSurface.h), pitch(_innerSurface.pitch), format(_innerSurface.format),
_disposeAfterUse(DisposeAfterUse::NO), _owner(nullptr),
_transparentColor(0), _transparentColorSet(false), _palette(nullptr) {
- *this = surf;
+ (*this).copyFrom(surf);
}
ManagedSurface::ManagedSurface(ManagedSurface &&surf) :
More information about the Scummvm-git-logs
mailing list