summaryrefslogtreecommitdiff
path: root/texteff.c
diff options
context:
space:
mode:
authorDarkvater <darkvater@openttd.org>2006-09-16 13:20:14 +0000
committerDarkvater <darkvater@openttd.org>2006-09-16 13:20:14 +0000
commit3ccc87b376a5560e3933263dc0e684ddf1136236 (patch)
treecfe40a58aa6ed11051036a76e69dd295f0b05d31 /texteff.c
parentba3ae8e43d19e4553a8c753c66c6a199b28cc1e1 (diff)
downloadopenttd-3ccc87b376a5560e3933263dc0e684ddf1136236.tar.xz
(svn r6462) -Codechange: Have GetStringWidth() return width as well as the height bounding
box of the string. Therefore rename the function to GetStringBoundingRect() and have it return a BoundingRect type of width/height
Diffstat (limited to 'texteff.c')
-rw-r--r--texteff.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/texteff.c b/texteff.c
index 53c369c54..982b964a9 100644
--- a/texteff.c
+++ b/texteff.c
@@ -70,7 +70,7 @@ void CDECL AddTextMessage(uint16 color, uint8 duration, const char *message, ...
/* Cut the message till it fits inside the chatbox */
length = strlen(buf);
- while (GetStringWidth(buf) > _textmessage_width - 9) buf[--length] = '\0';
+ while (GetStringBoundingBox(buf).width > _textmessage_width - 9) buf[--length] = '\0';
/* Find an empty spot and put the message there */
for (i = 0; i < MAX_CHAT_MESSAGES; i++) {
@@ -247,7 +247,7 @@ void AddTextEffect(StringID msg, int x, int y, uint16 duration)
te->params_2 = GetDParam(4);
GetString(buffer, msg);
- w = GetStringWidth(buffer);
+ w = GetStringBoundingBox(buffer).width;
te->x = x - (w >> 1);
te->right = x + (w >> 1) - 1;