[Scummvm-git-logs] scummvm master -> 40bbda1fc87cce4a346c66e261d5156c0310ebff

dreammaster noreply at scummvm.org
Sat Sep 13 06:41:37 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:
40bbda1fc8 BAGEL: Hopefully fix CRect TopLeft/BottomRight casts. Again.


Commit: 40bbda1fc87cce4a346c66e261d5156c0310ebff
    https://github.com/scummvm/scummvm/commit/40bbda1fc87cce4a346c66e261d5156c0310ebff
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2025-09-12T23:41:03-07:00

Commit Message:
BAGEL: Hopefully fix CRect TopLeft/BottomRight casts. Again.

This reverts revert commit f85a43163ee64e7244e5eb5f4de72396d03036b8.

Changed paths:
    engines/bagel/hodjnpodj/hnplibs/text.cpp
    engines/bagel/mfc/atltypes.h
    engines/bagel/mfc/minwindef.h
    engines/bagel/mfc/wingdi.h


diff --git a/engines/bagel/hodjnpodj/hnplibs/text.cpp b/engines/bagel/hodjnpodj/hnplibs/text.cpp
index d8f6309e0a7..449b589d8cd 100644
--- a/engines/bagel/hodjnpodj/hnplibs/text.cpp
+++ b/engines/bagel/hodjnpodj/hnplibs/text.cpp
@@ -395,8 +395,8 @@ bool CText::DisplayText(CDC *pDC, const char *pszText, const int nSize, const in
 		m_cPosition.x = m_cSize.cx - textInfo.cx;
 	}
 
-	m_cPosition.x = MAX(m_cPosition.x, 0);
-	m_cPosition.y = MAX(m_cPosition.y, 0);
+	m_cPosition.x = MAX<int>(m_cPosition.x, 0);
+	m_cPosition.y = MAX<int>(m_cPosition.y, 0);
 
 	if (bShadowed) {
 		(*m_pWorkDC).SetTextColor(m_cShadowColor);      // set the color of the shadow
diff --git a/engines/bagel/mfc/atltypes.h b/engines/bagel/mfc/atltypes.h
index c5b5deef4a0..06bbb30bef8 100644
--- a/engines/bagel/mfc/atltypes.h
+++ b/engines/bagel/mfc/atltypes.h
@@ -285,7 +285,7 @@ public:
 		return *((CPoint *)this);
 	}
 	CPoint &BottomRight() {
-		return *((CPoint *)this + 1);
+		return *((CPoint *)&right);
 	}
 };
 
diff --git a/engines/bagel/mfc/minwindef.h b/engines/bagel/mfc/minwindef.h
index 49ebbd22c13..e769bd96cae 100644
--- a/engines/bagel/mfc/minwindef.h
+++ b/engines/bagel/mfc/minwindef.h
@@ -158,38 +158,28 @@ DECLARE_HANDLE(HWINSTA);
 DECLARE_HANDLE(HKL);
 
 typedef struct tagPOINT {
-	int  x;
-	int  y;
+	int x;
+	int y;
 } POINT, *PPOINT, NEAR *NPPOINT, FAR *LPPOINT;
 
-typedef struct _POINTL {    /* ptl  */
-	long  x;
-	long  y;
-} POINTL, *PPOINTL;
-
 typedef struct tagSIZE {
-	int        cx;
-	int        cy;
+	int cx;
+	int cy;
 } SIZE, *PSIZE, *LPSIZE;
 
-typedef SIZE               SIZEL;
+typedef SIZE SIZEL;
 typedef SIZE *PSIZEL, *LPSIZEL;
 
 typedef struct tagPOINTS {
-	#ifndef _MAC
-	SHORT   x;
-	SHORT   y;
-	#else
-	SHORT   y;
-	SHORT   x;
-	#endif
+	SHORT x;
+	SHORT y;
 } POINTS, *PPOINTS, *LPPOINTS;
 
 typedef struct tagRECT {
-	long    left;
-	long    top;
-	long    right;
-	long    bottom;
+	int left;
+	int top;
+	int right;
+	int bottom;
 
 	operator Common::Rect() const {
 		return Common::Rect(left, top, right, bottom);
diff --git a/engines/bagel/mfc/wingdi.h b/engines/bagel/mfc/wingdi.h
index 5f295df472f..27fd2d760dc 100644
--- a/engines/bagel/mfc/wingdi.h
+++ b/engines/bagel/mfc/wingdi.h
@@ -654,12 +654,12 @@ typedef struct tagBITMAPINFO {
 
 /* Bitmap Header Definition */
 typedef struct tagBITMAP {
-	long        bmType;
-	long        bmWidth;
-	long        bmHeight;
-	long        bmWidthBytes;
-	uint16        bmPlanes;
-	uint16        bmBitsPixel;
+	int bmType;
+	int bmWidth;
+	int bmHeight;
+	int bmWidthBytes;
+	uint16 bmPlanes;
+	uint16 bmBitsPixel;
 	void *     bmBits;
 } BITMAP, *PBITMAP, NEAR *NPBITMAP, FAR *LPBITMAP;
 




More information about the Scummvm-git-logs mailing list