[132608] trunk/dports/games/openttd

cal at macports.org cal at macports.org
Thu Feb 5 13:16:51 PST 2015


Revision: 132608
          https://trac.macports.org/changeset/132608
Author:   cal at macports.org
Date:     2015-02-05 13:16:51 -0800 (Thu, 05 Feb 2015)
Log Message:
-----------
openttd: backport fix instead of using our fix

No revbump, because besides fixing a couple of warnings, the patch is
equivalent to what we had locally.

Modified Paths:
--------------
    trunk/dports/games/openttd/Portfile

Added Paths:
-----------
    trunk/dports/games/openttd/files/openttd-fontcache.patch

Removed Paths:
-------------
    trunk/dports/games/openttd/files/patch-src__fontcache.cpp-signed-vs-unsigned-max.diff

Modified: trunk/dports/games/openttd/Portfile
===================================================================
--- trunk/dports/games/openttd/Portfile	2015-02-05 20:58:38 UTC (rev 132607)
+++ trunk/dports/games/openttd/Portfile	2015-02-05 21:16:51 UTC (rev 132608)
@@ -46,8 +46,7 @@
                         port:openttd-openmsx
 
     patchfiles          patch-config.lib-remove-deployment-target.diff \
-                        patch-src__fontcache.cpp-signed-vs-unsigned-max.diff
-                        # see https://bugs.openttd.org/task/6223
+                        openttd-fontcache.patch
 
     configure.env-append \
                         CFLAGS_BUILD="${configure.cflags}" \

Added: trunk/dports/games/openttd/files/openttd-fontcache.patch
===================================================================
--- trunk/dports/games/openttd/files/openttd-fontcache.patch	                        (rev 0)
+++ trunk/dports/games/openttd/files/openttd-fontcache.patch	2015-02-05 21:16:51 UTC (rev 132608)
@@ -0,0 +1,42 @@
+Fix: Compilation with freetype2 version 2.5.4 and newer (AMDmi3)
+
+See upstream tickets #6223 and #6185.
+
+Upstream-Status: Backport [committed in r27079]
+Index: src/fontcache.cpp
+===================================================================
+--- src/fontcache.cpp	(revision 27078)
++++ src/fontcache.cpp	(working copy)
+@@ -536,8 +536,8 @@
+ 	aa = (slot->bitmap.pixel_mode == FT_PIXEL_MODE_GRAY);
+ 
+ 	/* Add 1 pixel for the shadow on the medium font. Our sprite must be at least 1x1 pixel */
+-	int width  = max(1, slot->bitmap.width + (this->fs == FS_NORMAL));
+-	int height = max(1, slot->bitmap.rows  + (this->fs == FS_NORMAL));
++	unsigned int width  = max(1U, (unsigned int)slot->bitmap.width + (this->fs == FS_NORMAL));
++	unsigned int height = max(1U, (unsigned int)slot->bitmap.rows  + (this->fs == FS_NORMAL));
+ 
+ 	/* Limit glyph size to prevent overflows later on. */
+ 	if (width > 256 || height > 256) usererror("Font glyph is too large");
+@@ -553,8 +553,8 @@
+ 
+ 	/* Draw shadow for medium size */
+ 	if (this->fs == FS_NORMAL && !aa) {
+-		for (int y = 0; y < slot->bitmap.rows; y++) {
+-			for (int x = 0; x < slot->bitmap.width; x++) {
++		for (unsigned int y = 0; y < (unsigned int)slot->bitmap.rows; y++) {
++			for (unsigned int x = 0; x < (unsigned int)slot->bitmap.width; x++) {
+ 				if (aa ? (slot->bitmap.buffer[x + y * slot->bitmap.pitch] > 0) : HasBit(slot->bitmap.buffer[(x / 8) + y * slot->bitmap.pitch], 7 - (x % 8))) {
+ 					sprite.data[1 + x + (1 + y) * sprite.width].m = SHADOW_COLOUR;
+ 					sprite.data[1 + x + (1 + y) * sprite.width].a = aa ? slot->bitmap.buffer[x + y * slot->bitmap.pitch] : 0xFF;
+@@ -563,8 +563,8 @@
+ 		}
+ 	}
+ 
+-	for (int y = 0; y < slot->bitmap.rows; y++) {
+-		for (int x = 0; x < slot->bitmap.width; x++) {
++	for (unsigned int y = 0; y < (unsigned int)slot->bitmap.rows; y++) {
++		for (unsigned int x = 0; x < (unsigned int)slot->bitmap.width; x++) {
+ 			if (aa ? (slot->bitmap.buffer[x + y * slot->bitmap.pitch] > 0) : HasBit(slot->bitmap.buffer[(x / 8) + y * slot->bitmap.pitch], 7 - (x % 8))) {
+ 				sprite.data[x + y * sprite.width].m = FACE_COLOUR;
+ 				sprite.data[x + y * sprite.width].a = aa ? slot->bitmap.buffer[x + y * slot->bitmap.pitch] : 0xFF;

Deleted: trunk/dports/games/openttd/files/patch-src__fontcache.cpp-signed-vs-unsigned-max.diff
===================================================================
--- trunk/dports/games/openttd/files/patch-src__fontcache.cpp-signed-vs-unsigned-max.diff	2015-02-05 20:58:38 UTC (rev 132607)
+++ trunk/dports/games/openttd/files/patch-src__fontcache.cpp-signed-vs-unsigned-max.diff	2015-02-05 21:16:51 UTC (rev 132608)
@@ -1,13 +0,0 @@
---- src/fontcache.cpp.orig	2015-01-31 17:48:10.000000000 +0100
-+++ src/fontcache.cpp	2015-01-31 17:49:31.000000000 +0100
-@@ -527,8 +527,8 @@
- 	aa = (slot->bitmap.pixel_mode == FT_PIXEL_MODE_GRAY);
- 
- 	/* Add 1 pixel for the shadow on the medium font. Our sprite must be at least 1x1 pixel */
--	int width  = max(1, slot->bitmap.width + (this->fs == FS_NORMAL));
--	int height = max(1, slot->bitmap.rows  + (this->fs == FS_NORMAL));
-+	int width  = max(1u, slot->bitmap.width + (this->fs == FS_NORMAL));
-+	int height = max(1u, slot->bitmap.rows  + (this->fs == FS_NORMAL));
- 
- 	/* Limit glyph size to prevent overflows later on. */
- 	if (width > 256 || height > 256) usererror("Font glyph is too large");
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150205/e960ade4/attachment.html>


More information about the macports-changes mailing list