summaryrefslogtreecommitdiff
path: root/src/gfx.cpp
diff options
context:
space:
mode:
authoralberth <alberth@openttd.org>2009-06-27 20:53:45 +0000
committeralberth <alberth@openttd.org>2009-06-27 20:53:45 +0000
commit9b070b5405d11c74d89a747e912e627e39850f7c (patch)
tree5143dbacaa7e860b2253b091bd195f4e2d287efc /src/gfx.cpp
parent812ad41f23b7ed52a161ed15b15a2af3a7edb41f (diff)
downloadopenttd-9b070b5405d11c74d89a747e912e627e39850f7c.tar.xz
(svn r16677) -Codechange: Dimension width and height are unsigned.
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r--src/gfx.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index c67dba176..482427a72 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -483,7 +483,7 @@ static int DrawString(int left, int right, int top, char *str, const char *last,
* but once SETX is used you cannot be sure the actual content of the
* string is centered, so it doesn't really matter. */
align = SA_LEFT | SA_FORCE;
- initial_left = left = max(left, (left + right - GetStringBoundingBox(str).width) / 2);
+ initial_left = left = max(left, (left + right - (int)GetStringBoundingBox(str).width) / 2);
}
/* We add the begin of the string, but don't add it twice */
@@ -798,7 +798,7 @@ Dimension GetStringBoundingBox(const char *str)
{
FontSize size = _cur_fontsize;
Dimension br;
- int max_width;
+ uint max_width;
WChar c;
br.width = br.height = max_width = 0;
@@ -809,10 +809,10 @@ Dimension GetStringBoundingBox(const char *str)
br.width += GetCharacterWidth(size, c);
} else {
switch (c) {
- case SCC_SETX: br.width = max((int)*str++, br.width); break;
+ case SCC_SETX: br.width = max((uint)*str++, br.width); break;
case SCC_SETXY:
- br.width = max((int)*str++, br.width);
- br.height = max((int)*str++, br.height);
+ br.width = max((uint)*str++, br.width);
+ br.height = max((uint)*str++, br.height);
break;
case SCC_TINYFONT: size = FS_SMALL; break;
case SCC_BIGFONT: size = FS_LARGE; break;