Changeset - r21925:935378684340
[Not reviewed]
master
0 2 0
planetmaker - 9 years ago 2014-12-11 12:25:53
planetmaker@openttd.org
(svn r27079) -Fix: Compilation with freetype2 version 2.5.4 and newer (AMDmi3)
2 files changed with 9 insertions and 9 deletions:
0 comments (0 inline, 0 general)
findversion.sh
Show inline comments
 
@@ -109,21 +109,21 @@ elif [ -d "$ROOT_DIR/.hg" ]; then
 
	if [ -n "`HGPLAIN= hg status | grep -v '^?'`" ]; then
 
		MODIFIED="2"
 
	fi
 
	HASH=`LC_ALL=C HGPLAIN= hg id -i | cut -c1-12`
 
	REV="h`echo $HASH | cut -c1-8`"
 
	BRANCH="`HGPLAIN= hg branch | sed 's@^default$@@'`"
 
	TAG="`hg id -t | grep -v 'tip$'`"
 
	TAG="`HGPLAIN= hg id -t | grep -v 'tip$'`"
 
	if [ -n "$TAG" ]; then
 
		BRANCH=""
 
		REV="$TAG"
 
	fi
 
	REV_NR=`LC_ALL=C hg log -f -k "(svn r" -l 1 --template "{desc|firstline}\n" | grep "^(svn r[0-9]*)" | sed "s@.*(svn r\([0-9]*\)).*@\1@"`
 
	REV_NR=`LC_ALL=C HGPLAIN= hg log -f -k "(svn r" -l 1 --template "{desc|firstline}\n" | grep "^(svn r[0-9]*)" | sed "s@.*(svn r\([0-9]*\)).*@\1@"`
 
	if [ -z "$REV_NR" ]; then
 
		# No rev? Maybe it is a custom hgsubversion clone
 
		REV_NR=`LC_ALL=C hg parent --template="{svnrev}"`
 
		REV_NR=`LC_ALL=C HGPLAIN= hg parent --template="{svnrev}"`
 
	fi
 
elif [ -f "$ROOT_DIR/.ottdrev" ]; then
 
	# We are an exported source bundle
 
	cat $ROOT_DIR/.ottdrev
 
	exit
 
else
src/fontcache.cpp
Show inline comments
 
@@ -533,14 +533,14 @@ const Sprite *FreeTypeFontCache::GetGlyp
 
	FT_Render_Glyph(this->face->glyph, aa ? FT_RENDER_MODE_NORMAL : FT_RENDER_MODE_MONO);
 

	
 
	/* Despite requesting a normal glyph, FreeType may have returned a bitmap */
 
	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");
 

	
 
	/* FreeType has rendered the glyph, now we allocate a sprite and copy the image into it */
 
	SpriteLoader::Sprite sprite;
 
@@ -550,24 +550,24 @@ const Sprite *FreeTypeFontCache::GetGlyp
 
	sprite.height = height;
 
	sprite.x_offs = slot->bitmap_left;
 
	sprite.y_offs = this->ascender - slot->bitmap_top;
 

	
 
	/* 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;
 
				}
 
			}
 
		}
 
	}
 

	
 
	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;
 
			}
 
		}
 
	}
0 comments (0 inline, 0 general)