[Scummvm-git-logs] scummvm branch-3-0 -> 8167dae1a1971bbd3f8e5e047df61851197dafbc
dreammaster
noreply at scummvm.org
Sat Nov 29 04:53:35 UTC 2025
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
8167dae1a1 BAGEL: MINIGAMES: Fix multi-shifting titles in Art Parts
Commit: 8167dae1a1971bbd3f8e5e047df61851197dafbc
https://github.com/scummvm/scummvm/commit/8167dae1a1971bbd3f8e5e047df61851197dafbc
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2025-11-28T20:53:26-08:00
Commit Message:
BAGEL: MINIGAMES: Fix multi-shifting titles in Art Parts
Changed paths:
engines/bagel/hodjnpodj/artparts/artparts.cpp
engines/bagel/hodjnpodj/artparts/artparts.h
engines/bagel/mfc/atltypes.h
diff --git a/engines/bagel/hodjnpodj/artparts/artparts.cpp b/engines/bagel/hodjnpodj/artparts/artparts.cpp
index 14f8570d13c..72e5109e8c4 100644
--- a/engines/bagel/hodjnpodj/artparts/artparts.cpp
+++ b/engines/bagel/hodjnpodj/artparts/artparts.cpp
@@ -1121,7 +1121,7 @@ Other functions:
* void
*
****************************************************************/
-void CMainWindow::SwitchAreas(CRect Src, CRect Dst) {
+void CMainWindow::SwitchAreas(const CRect &Src, const CRect &Dst) {
POINT SrcCR, DstCR, SizeCR, Temp;
int c, r;
@@ -1135,7 +1135,8 @@ void CMainWindow::SwitchAreas(CRect Src, CRect Dst) {
DrawPart(Src.TopLeft(), Dst.TopLeft(), Src.Width(), Src.Height());
CRect Overlap;
- if (Overlap.IntersectRect(Src, Dst) == 0) { // They don't intersect
+ if (Overlap.IntersectRect(Src, Dst) == 0) {
+ // They don't intersect
DrawPart(Dst.TopLeft(), Src.TopLeft(), Src.Width(), Src.Height());
for (c = 0; c < SizeCR.x; c++) { // Update the Grid data
@@ -1150,7 +1151,6 @@ void CMainWindow::SwitchAreas(CRect Src, CRect Dst) {
}
} else { // Deal with intersection
-
POINT *Movers, *MGrids, *SGrids, *p, *g, *s, Part, NewPart;
Movers = (POINT *)malloc((SizeCR.x * SizeCR.y) * sizeof(POINT));
MGrids = (POINT *)malloc((SizeCR.x * SizeCR.y) * sizeof(POINT));
@@ -1246,7 +1246,7 @@ void CMainWindow::SwitchAreas(CRect Src, CRect Dst) {
* void
*
****************************************************************/
-void CMainWindow::DrawPart(CPoint Src, CPoint Dst, int nWidth, int nHeight) {
+void CMainWindow::DrawPart(const CPoint &Src, const CPoint &Dst, int nWidth, int nHeight) {
pScratch2DC->BitBlt(Dst.x, Dst.y, nWidth, nHeight, pScratch1DC, Src.x, Src.y, SRCCOPY);
diff --git a/engines/bagel/hodjnpodj/artparts/artparts.h b/engines/bagel/hodjnpodj/artparts/artparts.h
index 71f622a6e0c..f29e1daf77a 100644
--- a/engines/bagel/hodjnpodj/artparts/artparts.h
+++ b/engines/bagel/hodjnpodj/artparts/artparts.h
@@ -105,8 +105,8 @@ class CMainWindow : public CFrameWnd {
public:
CMainWindow();
bool LoadArtWork();
- void DrawPart(CPoint Src, CPoint Dst, int nWidth, int nHeight);
- void SwitchAreas(CRect Src, CRect Dst);
+ void DrawPart(const CPoint &Src, const CPoint &Dst, int nWidth, int nHeight);
+ void SwitchAreas(const CRect &Src, const CRect &Dst);
void InitValues();
void NewGame();
void CheckForWin();
diff --git a/engines/bagel/mfc/atltypes.h b/engines/bagel/mfc/atltypes.h
index 06bbb30bef8..3405381cf1a 100644
--- a/engines/bagel/mfc/atltypes.h
+++ b/engines/bagel/mfc/atltypes.h
@@ -287,6 +287,12 @@ public:
CPoint &BottomRight() {
return *((CPoint *)&right);
}
+ const CPoint &TopLeft() const {
+ return *((const CPoint *)this);
+ }
+ const CPoint &BottomRight() const {
+ return *((const CPoint *)&right);
+ }
};
// CSize
@@ -662,10 +668,10 @@ inline void CRect::MoveToXY(POINT pt) {
inline bool CRect::IntersectRect(
LPCRECT lpRect1, LPCRECT lpRect2) {
- return (lpRect1->left < lpRect2->right) &&
- (lpRect2->left < lpRect1->right) &&
- (lpRect1->top < lpRect2->bottom) &&
- (lpRect2->top < lpRect1->bottom);
+ Common::Rect r = Common::Rect(*lpRect1).findIntersectingRect(*lpRect2);
+ SetRect(r.left, r.top, r.right, r.bottom);
+
+ return !r.isEmpty();
}
inline bool CRect::UnionRect(LPCRECT lpRect1, LPCRECT lpRect2) {
More information about the Scummvm-git-logs
mailing list