summaryrefslogtreecommitdiff
path: root/src/fontcache.cpp
diff options
context:
space:
mode:
authorplanetmaker <planetmaker@openttd.org>2014-12-11 12:25:53 +0000
committerplanetmaker <planetmaker@openttd.org>2014-12-11 12:25:53 +0000
commit24fec6da12fbc7ba4c9050f8afa5f05970c346bb (patch)
tree07ae5b7ab6e39d0ed50a239a9e0269b5bc07e079 /src/fontcache.cpp
parent141b5d7050933eac015fb64bb32f006ade4124f9 (diff)
downloadopenttd-24fec6da12fbc7ba4c9050f8afa5f05970c346bb.tar.xz
(svn r27079) -Fix: Compilation with freetype2 version 2.5.4 and newer (AMDmi3)
Diffstat (limited to 'src/fontcache.cpp')
-rw-r--r--src/fontcache.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/fontcache.cpp b/src/fontcache.cpp
index a65585627..e6f1e3725 100644
--- a/src/fontcache.cpp
+++ b/src/fontcache.cpp
@@ -536,8 +536,8 @@ const Sprite *FreeTypeFontCache::GetGlyph(GlyphID key)
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 @@ const Sprite *FreeTypeFontCache::GetGlyph(GlyphID key)
/* 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 @@ const Sprite *FreeTypeFontCache::GetGlyph(GlyphID key)
}
}
- 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;