X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FGraphic%2FText.cpp;h=ffc8b0a22db3154cc2427de4ab075ca39cacf020;hb=24c49b5bd8c82cd433fffe3456334bd3be743da9;hp=31bbe9f9ea9a7007afee14a87e26acca2581dc61;hpb=b84825978803615f45a9f128232e62431042aec0;p=lugaru.git diff --git a/Source/Graphic/Text.cpp b/Source/Graphic/Text.cpp index 31bbe9f..ffc8b0a 100644 --- a/Source/Graphic/Text.cpp +++ b/Source/Graphic/Text.cpp @@ -18,9 +18,9 @@ You should have received a copy of the GNU General Public License along with Lugaru. If not, see . */ -/**> HEADER FILES <**/ -#include "Graphic/Text.h" -#include "Game.h" +#include "Graphic/Text.hpp" + +#include "Game.hpp" void Text::LoadFontTexture(const std::string& fileName) { @@ -77,12 +77,12 @@ void Text::BuildFont() // Build Our Font Display List } // Loop Until All 256 Are Built } -void Text::glPrint(float x, float y, const char *string, int set, float size, float width, float height) // Where The Printing Happens +void Text::glPrint(float x, float y, const std::string& string, int set, float size, float width, float height) // Where The Printing Happens { - glPrint(x, y, string, set, size, width, height, 0, strlen(string)); + glPrint(x, y, string, set, size, width, height, 0, string.size()); } -void Text::_glPrint(float x, float y, const char *string, int set, float size, float width, float height, int start, int end, int offset) // Where The Printing Happens +void Text::_glPrint(float x, float y, const std::string& string, int set, float size, float width, float height, int start, int end, int offset) // Where The Printing Happens { if (set > 1) { set = 1; @@ -112,26 +112,26 @@ void Text::_glPrint(float x, float y, const char *string, int set, float size, f glTexEnvi( GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE ); } -void Text::glPrint(float x, float y, const char *string, int set, float size, float width, float height, int start, int end) // Where The Printing Happens +void Text::glPrint(float x, float y, const std::string& string, int set, float size, float width, float height, int start, int end) // Where The Printing Happens { _glPrint(x, y, string, set, size, width, height, start, end, 0); } -void Text::glPrintOutline(float x, float y, const char *string, int set, float size, float width, float height) // Where The Printing Happens +void Text::glPrintOutline(float x, float y, const std::string& string, int set, float size, float width, float height) // Where The Printing Happens { - glPrintOutline(x, y, string, set, size, width, height, 0, strlen(string)); + glPrintOutline(x, y, string, set, size, width, height, 0, string.size()); } -void Text::glPrintOutline(float x, float y, const char *string, int set, float size, float width, float height, int start, int end) // Where The Printing Happens +void Text::glPrintOutline(float x, float y, const std::string& string, int set, float size, float width, float height, int start, int end) // Where The Printing Happens { _glPrint(x, y, string, set, size, width, height, start, end, 256); } -void Text::glPrintOutlined(float x, float y, const char *string, int set, float size, float width, float height) // Where The Printing Happens +void Text::glPrintOutlined(float x, float y, const std::string& string, int set, float size, float width, float height) // Where The Printing Happens { glPrintOutlined(1, 1, 1, x, y, string, set, size, width, height); } -void Text::glPrintOutlined(float r, float g, float b, float x, float y, const char *string, int set, float size, float width, float height) // Where The Printing Happens +void Text::glPrintOutlined(float r, float g, float b, float x, float y, const std::string& string, int set, float size, float width, float height) // Where The Printing Happens { glColor4f(0, 0, 0, 1); glPrintOutline( x - 2 * size, y - 2 * size, string, set, size * 2.5 / 2, width, height);