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

digitall 547637+digitall at users.noreply.github.com
Sun Oct 31 17:44:42 UTC 2021


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:
cee7064a12 SWORD2: Implement Center-Center Text Message Alignment Correctly


Commit: cee7064a128af634cb8bf2eac5362f29a8f285e9
    https://github.com/scummvm/scummvm/commit/cee7064a128af634cb8bf2eac5362f29a8f285e9
Author: D G Turner (digitall at scummvm.org)
Date: 2021-10-31T17:43:42Z

Commit Message:
SWORD2: Implement Center-Center Text Message Alignment Correctly

This fixes a Duplicated Branch GCC Warning as a side effect.

Changed paths:
    engines/sword2/maketext.cpp
    engines/sword2/maketext.h
    engines/sword2/mouse.cpp


diff --git a/engines/sword2/maketext.cpp b/engines/sword2/maketext.cpp
index 18da4d9ef0..9e63f95602 100644
--- a/engines/sword2/maketext.cpp
+++ b/engines/sword2/maketext.cpp
@@ -535,6 +535,10 @@ uint32 FontRenderer::buildNewBloc(byte *ascii, int16 x, int16 y, uint16 width, u
 		case POSITION_AT_CENTER_OF_TOP:
 			x -= (frame_head.width / 2);
 			break;
+		case POSITION_AT_CENTER_OF_CENTER:
+			x -= (frame_head.width / 2);
+			y -= (frame_head.height) / 2;
+			break;
 		case POSITION_AT_LEFT_OF_TOP:
 			// The given coords are already correct for this!
 			break;
diff --git a/engines/sword2/maketext.h b/engines/sword2/maketext.h
index 64024f8db3..7f859508c4 100644
--- a/engines/sword2/maketext.h
+++ b/engines/sword2/maketext.h
@@ -51,7 +51,8 @@ enum {
 	POSITION_AT_LEFT_OF_BASE = 5,
 	POSITION_AT_RIGHT_OF_BASE = 6,
 	POSITION_AT_LEFT_OF_CENTER = 7,
-	POSITION_AT_RIGHT_OF_CENTER = 8
+	POSITION_AT_RIGHT_OF_CENTER = 8,
+	POSITION_AT_CENTER_OF_CENTER = 9
 };
 
 enum {
diff --git a/engines/sword2/mouse.cpp b/engines/sword2/mouse.cpp
index 3066b9e54d..59b8e6f877 100644
--- a/engines/sword2/mouse.cpp
+++ b/engines/sword2/mouse.cpp
@@ -1296,8 +1296,8 @@ void Mouse::createPointerText(uint32 text_id, uint32 pointer_res) {
 			// Center right
 			justification = POSITION_AT_LEFT_OF_CENTER;
 		} else {
-			// Center center - shouldn't happen anyway!
-			justification = POSITION_AT_LEFT_OF_CENTER;
+			// Center center (shouldn't happen)
+			justification = POSITION_AT_CENTER_OF_CENTER;
 		}
 	}
 




More information about the Scummvm-git-logs mailing list