summaryrefslogtreecommitdiff
path: root/src/gfx.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-08-12 11:21:37 +0000
committerrubidium <rubidium@openttd.org>2008-08-12 11:21:37 +0000
commita3910ced70d574d4730268a4df6c5411cad7a04a (patch)
tree024887c52fa7c5dc7f02ebb32f985825026c9912 /src/gfx.cpp
parent61007078b6bea4bd0f5f1b51492a6ac5fd07f68e (diff)
downloadopenttd-a3910ced70d574d4730268a4df6c5411cad7a04a.tar.xz
(svn r14051) -Codechange: enumify the DrawString buffer length.
Diffstat (limited to 'src/gfx.cpp')
-rw-r--r--src/gfx.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/gfx.cpp b/src/gfx.cpp
index 490193550..9f07a60a7 100644
--- a/src/gfx.cpp
+++ b/src/gfx.cpp
@@ -320,7 +320,7 @@ static inline int TruncateStringID(StringID src, char *dest, int maxw, const cha
*/
int DrawString(int x, int y, StringID str, uint16 color)
{
- char buffer[512];
+ char buffer[DRAW_STRING_BUFFER];
GetString(buffer, str, lastof(buffer));
return DoDrawString(buffer, x, y, color);
@@ -339,7 +339,7 @@ int DrawString(int x, int y, StringID str, uint16 color)
*/
int DrawStringTruncated(int x, int y, StringID str, uint16 color, uint maxw)
{
- char buffer[512];
+ char buffer[DRAW_STRING_BUFFER];
TruncateStringID(str, buffer, maxw, lastof(buffer));
return DoDrawString(buffer, x, y, color);
}
@@ -356,7 +356,7 @@ int DrawStringTruncated(int x, int y, StringID str, uint16 color, uint maxw)
*/
int DrawStringRightAligned(int x, int y, StringID str, uint16 color)
{
- char buffer[512];
+ char buffer[DRAW_STRING_BUFFER];
int w;
GetString(buffer, str, lastof(buffer));
@@ -377,7 +377,7 @@ int DrawStringRightAligned(int x, int y, StringID str, uint16 color)
*/
void DrawStringRightAlignedTruncated(int x, int y, StringID str, uint16 color, uint maxw)
{
- char buffer[512];
+ char buffer[DRAW_STRING_BUFFER];
TruncateStringID(str, buffer, maxw, lastof(buffer));
DoDrawString(buffer, x - GetStringBoundingBox(buffer).width, y, color);
@@ -409,7 +409,7 @@ void DrawStringRightAlignedUnderline(int x, int y, StringID str, uint16 color)
*/
int DrawStringCentered(int x, int y, StringID str, uint16 color)
{
- char buffer[512];
+ char buffer[DRAW_STRING_BUFFER];
int w;
GetString(buffer, str, lastof(buffer));
@@ -433,7 +433,7 @@ int DrawStringCentered(int x, int y, StringID str, uint16 color)
*/
int DrawStringCenteredTruncated(int xl, int xr, int y, StringID str, uint16 color)
{
- char buffer[512];
+ char buffer[DRAW_STRING_BUFFER];
int w = TruncateStringID(str, buffer, xr - xl, lastof(buffer));
return DoDrawString(buffer, (xl + xr - w) / 2, y, color);
}
@@ -595,7 +595,7 @@ static int GetMultilineStringHeight(const char *src, int num)
*/
int GetStringHeight(StringID str, int maxw)
{
- char buffer[512];
+ char buffer[DRAW_STRING_BUFFER];
GetString(buffer, str, lastof(buffer));
@@ -612,7 +612,7 @@ int GetStringHeight(StringID str, int maxw)
* @param maxw Maximum width the string can have before it is wrapped */
void DrawStringMultiCenter(int x, int y, StringID str, int maxw)
{
- char buffer[512];
+ char buffer[DRAW_STRING_BUFFER];
uint32 tmp;
int num, w, mt;
const char *src;
@@ -655,7 +655,7 @@ void DrawStringMultiCenter(int x, int y, StringID str, int maxw)
uint DrawStringMultiLine(int x, int y, StringID str, int maxw, int maxh)
{
- char buffer[512];
+ char buffer[DRAW_STRING_BUFFER];
uint32 tmp;
int num, mt;
uint total_height;
@@ -878,7 +878,7 @@ skip_cont:;
*/
int DoDrawStringTruncated(const char *str, int x, int y, uint16 color, uint maxw)
{
- char buffer[512];
+ char buffer[DRAW_STRING_BUFFER];
ttd_strlcpy(buffer, str, sizeof(buffer));
TruncateString(buffer, maxw);
return DoDrawString(buffer, x, y, color);