[Scummvm-git-logs] scummvm master -> a76218651f89bf42b51b6cca1a868ba8e1a4549a

OMGPizzaGuy 48367439+OMGPizzaGuy at users.noreply.github.com
Mon Aug 24 23:24:08 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
a76218651f ULTIMA8: Fix gump / screen space tranforms


Commit: a76218651f89bf42b51b6cca1a868ba8e1a4549a
    https://github.com/scummvm/scummvm/commit/a76218651f89bf42b51b6cca1a868ba8e1a4549a
Author: Matthew Jimenez (matthew.jimenez at outlook.com)
Date: 2020-08-24T18:23:37-05:00

Commit Message:
ULTIMA8: Fix gump / screen space tranforms

Changed paths:
    engines/ultima/ultima8/gumps/gump.cpp


diff --git a/engines/ultima/ultima8/gumps/gump.cpp b/engines/ultima/ultima8/gumps/gump.cpp
index 009b715549..8a1e15ad01 100644
--- a/engines/ultima/ultima8/gumps/gump.cpp
+++ b/engines/ultima/ultima8/gumps/gump.cpp
@@ -472,15 +472,13 @@ void Gump::GumpRectToScreenSpace(Rect &gr, RectRoundDir r) {
 	PointRoundDir br = (r == ROUND_OUTSIDE ? ROUND_BOTTOMRIGHT : ROUND_TOPLEFT);
 
 	int32 x1 = gr.left, y1 = gr.top;
-	int32 x2 = gr.left + gr.width(), y2 = gr.top + gr.height();
+	int32 x2 = gr.right, y2 = gr.bottom;
 	GumpToScreenSpace(x1, y1, tl);
 	GumpToScreenSpace(x2, y2, br);
 	gr.left = x1;
 	gr.top = y1;
-	if (gr.width() != 0)
-		gr.setWidth(x2 - x1);
-	if (gr.height() != 0)
-		gr.setHeight(y2 - y1);
+	gr.right = x2;
+	gr.bottom = y2;
 }
 
 // Transform a rectangle to gumpspace from screenspace
@@ -489,15 +487,13 @@ void Gump::ScreenSpaceToGumpRect(Rect &sr, RectRoundDir r) {
 	PointRoundDir br = (r == ROUND_OUTSIDE ? ROUND_BOTTOMRIGHT : ROUND_TOPLEFT);
 
 	int32 x1 = sr.left, y1 = sr.top;
-	int32 x2 = sr.left + sr.width(), y2 = sr.top + sr.height();
+	int32 x2 = sr.right, y2 = sr.bottom;
 	ScreenSpaceToGump(x1, y1, tl);
 	ScreenSpaceToGump(x2, y2, br);
 	sr.left = x1;
 	sr.top = y1;
-	if (sr.width() != 0)
-		sr.setWidth(x2 - x1);
-	if (sr.height() != 0)
-		sr.setHeight(y2 - y1);
+	sr.right = x2;
+	sr.bottom = y2;
 }
 
 uint16 Gump::TraceObjId(int32 mx, int32 my) {




More information about the Scummvm-git-logs mailing list