diff --git a/src/graphics/OpenGLDrawMethods.inl b/src/graphics/OpenGLDrawMethods.inl index 74039f33f..618ca3e5a 100644 --- a/src/graphics/OpenGLDrawMethods.inl +++ b/src/graphics/OpenGLDrawMethods.inl @@ -1,5 +1,6 @@ #include "../data/font.h" #include +#include int PIXELMETHODS_CLASS::drawtext_outline(int x, int y, String s, int r, int g, int b, int a) { @@ -15,15 +16,15 @@ int PIXELMETHODS_CLASS::drawtext_outline(int x, int y, String s, int r, int g, i int PIXELMETHODS_CLASS::drawtext(int x, int y, String str, int r, int g, int b, int a) { bool invert = false; - if(!strlen(s)) + if(str.size() == 0) return 0; int oR = r, oG = g, oB = b; int width, height; - Graphics::textsize(s, width, height); + Graphics::textsize(str, width, height); VideoBuffer texture(width, height); int characterX = 0, characterY = 0; int startX = characterX; - String::value_type *s = str.c_str(); + const String::value_type *s = str.c_str(); for (; *s; s++) { if (*s == '\n') @@ -131,7 +132,7 @@ int PIXELMETHODS_CLASS::drawtext(int x, int y, String str, int r, int g, int b, int PIXELMETHODS_CLASS::drawchar(int x, int y, String::value_type c, int r, int g, int b, int a) { - unsigned char *rp = font_data + font_ptrs[c]; + const unsigned char *rp = font_data + font_ptrs[c]; int w = *(rp++); VideoBuffer texture(w, FONT_H); texture.SetCharacter(0, 0, c, r, g, b, a); @@ -160,7 +161,7 @@ int PIXELMETHODS_CLASS::drawchar(int x, int y, String::value_type c, int r, int int PIXELMETHODS_CLASS::addchar(int x, int y, String::value_type c, int r, int g, int b, int a) { - unsigned char *rp = font_data + font_ptrs[c]; + const unsigned char *rp = font_data + font_ptrs[c]; int w = *(rp++); VideoBuffer texture(w, FONT_H); texture.AddCharacter(0, 0, c, r, g, b, a);