On 30.04.2015 17:57, Edmund Grimley Evans wrote:
> Source: freeorion
> Version: 0.4.4-2
> 
> It failed to build in Jessie, amd64 and arm64. In each case the error
> was:
> 
> /«PKGBUILDDIR»/FreeOrion/GG/src/Font.cpp: In member function 'void 
> GG::Font::Ini
> t(FT_FaceRec_*&)':
> /«PKGBUILDDIR»/FreeOrion/GG/src/Font.cpp:1289:41: error: ambiguous
> overload for 'operator>' (operand types are 'const unsigned int' and
> 'const GG::X')
>                  if ((glyph_bitmap.width > BUF_WIDTH) |
> (glyph_bitmap.rows > BUF_HEIGHT)) {
>                                          ^

Hi,

could you please test the attached patch and report back if this solves
your problem?

I have created this patch based on the information I have found here:

http://www.freeorion.org/forum/viewtopic.php?f=24&t=9206&p=73785

If it works, I will fix this bug with the next point release for Jessie.

Regards,

Markus
From: Markus Koschany <a...@gambaru.de>
Date: Sun, 3 May 2015 21:39:23 +0200
Subject: fix FTBFS

Fixes some compiler errors due to a newer version of freetype.

Bug: https://bugs.debian.org/783839
Forwarded: no, already fixed
---
 FreeOrion/GG/src/Font.cpp | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/FreeOrion/GG/src/Font.cpp b/FreeOrion/GG/src/Font.cpp
index 170863b..d3c501c 100644
--- a/FreeOrion/GG/src/Font.cpp
+++ b/FreeOrion/GG/src/Font.cpp
@@ -1286,16 +1286,16 @@ void Font::Init(FT_Face& face)
         for (boost::uint32_t c = low; c < high; ++c) {
             if (temp_glyph_data.find(c) == temp_glyph_data.end() && GenerateGlyph(face, c)) {
                 const FT_Bitmap& glyph_bitmap = face->glyph->bitmap;
-                if ((glyph_bitmap.width > BUF_WIDTH) | (glyph_bitmap.rows > BUF_HEIGHT)) {
+                if ((glyph_bitmap.width > Value(BUF_WIDTH)) | (glyph_bitmap.rows > Value(BUF_HEIGHT))) {
                     ThrowBadGlyph("GG::Font::Init : Glyph too large for buffer'%1%'", c); // catch broken fonts
                 }
 
-                if (x + glyph_bitmap.width > BUF_WIDTH) { // start a new row of glyph images
+                if (Value(x) + glyph_bitmap.width > Value(BUF_WIDTH)) { // start a new row of glyph images
                     if (x > max_x) max_x = x;
                     x = X0;
                     y = max_y;
                 }
-                if (y + glyph_bitmap.rows > BUF_HEIGHT) { // if there's not enough room, create a new buffer
+                if (Value(y) + glyph_bitmap.rows > Value(BUF_HEIGHT)) { // if there's not enough room, create a new buffer
                     // cut off bottom and side of buffer just written, if it is possible to do so and maintain power-of-two height
                     X pow_of_2_x(NextPowerOfTwo(max_x));
                     Y pow_of_2_y(NextPowerOfTwo(max_y));
@@ -1312,8 +1312,8 @@ void Font::Init(FT_Face& face)
                     buffer_vec.push_back(temp_buf);
                     buffer_sizes.push_back(Pt(BUF_WIDTH, BUF_HEIGHT));
                 }
-                if (y + glyph_bitmap.rows > max_y) {
-                    max_y = y + glyph_bitmap.rows;
+                if (Value(y) + glyph_bitmap.rows > Value(max_y)) {
+                    max_y = y + Y(glyph_bitmap.rows);
                 }
 
                 boost::uint8_t*  src_start = glyph_bitmap.buffer;
@@ -1334,13 +1334,13 @@ void Font::Init(FT_Face& face)
                 // record info on how to find and use this glyph later
                 temp_glyph_data[c] =
                     TempGlyphData(static_cast<int>(buffer_vec.size()) - 1,
-                                  Pt(x, y), Pt(x + glyph_bitmap.width, y + glyph_bitmap.rows),
+                                  Pt(x, y), Pt(x + X(glyph_bitmap.width), y + Y(glyph_bitmap.rows)),
                                   Y(m_height - 1 + m_descent - face->glyph->bitmap_top),
                                   X(static_cast<int>((std::ceil(face->glyph->metrics.horiBearingX / 64.0)))),
                                   X(static_cast<int>((std::ceil(face->glyph->metrics.horiAdvance / 64.0)))));
 
                 // advance buffer write-position
-                x += glyph_bitmap.width;
+                x += X(glyph_bitmap.width);
             }
         }
     }

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to