diff --git a/src/modules/graphics/opengl/Font.cpp b/src/modules/graphics/opengl/Font.cpp index 584d7fed3..7d576f9a3 100644 --- a/src/modules/graphics/opengl/Font.cpp +++ b/src/modules/graphics/opengl/Font.cpp @@ -65,11 +65,6 @@ namespace opengl return height / lineHeight; } - void Font::print(std::string text, float x, float y) const - { - print(text, x, y, 0.0f, 1.0f, 1.0f); - } - void Font::print(std::string text, float x, float y, float angle, float sx, float sy) const { float dx = 0.0f; // spacing counter for newline handling diff --git a/src/modules/graphics/opengl/Font.h b/src/modules/graphics/opengl/Font.h index 90985f0dc..a277a62e9 100644 --- a/src/modules/graphics/opengl/Font.h +++ b/src/modules/graphics/opengl/Font.h @@ -73,15 +73,6 @@ namespace opengl virtual ~Font(); - /** - * Prints the text at the designated position. - * - * @param text A string. - * @param x The x-coordinate. - * @param y The y-coordinate. - **/ - void print(std::string text, float x, float y) const; - /** * Prints the text at the designated position with rotation and scaling. * @@ -90,7 +81,7 @@ namespace opengl * @param y The y-coordinate. * @param angle The amount of rotation. **/ - void print(std::string text, float x, float y, float angle, float sx, float sy) const; + void print(std::string text, float x, float y, float angle = 0.0f, float sx = 1.0f, float sy = 1.0f) const; /** * Prints the character at the designated position. diff --git a/src/modules/graphics/opengl/Graphics.cpp b/src/modules/graphics/opengl/Graphics.cpp index 6f117967c..df59c1057 100644 --- a/src/modules/graphics/opengl/Graphics.cpp +++ b/src/modules/graphics/opengl/Graphics.cpp @@ -708,25 +708,6 @@ namespace opengl return (int)max; } - void Graphics::print( const char * str, float x, float y) - { - if(currentFont != 0) - { - std::string text(str); - currentFont->print(text, x, y); - } - } - - void Graphics::print( const char * str, float x, float y, float angle) - { - print(str, x, y, angle, 1, 1); - } - - void Graphics::print( const char * str, float x, float y, float angle, float s) - { - print(str, x, y, angle, s, s); - } - void Graphics::print( const char * str, float x, float y , float angle, float sx, float sy) { if(currentFont != 0) diff --git a/src/modules/graphics/opengl/Graphics.h b/src/modules/graphics/opengl/Graphics.h index eab462031..00bc7df61 100644 --- a/src/modules/graphics/opengl/Graphics.h +++ b/src/modules/graphics/opengl/Graphics.h @@ -397,33 +397,6 @@ namespace opengl **/ int getMaxPointSize(); - /** - * Draw text on screen at the specified coordiantes (automatically breaks \n characters). - * - * @param str A string of text. - * @param x The x-coordiante. - * @param y The y-coordiante. - **/ - void print(const char * str, float x, float y); - - /** - * Draws text at the specified coordinates, with rotation. - * @param x The x-coordinate. - * @param y The y-coordinate. - * @param angle The amount of rotation. - **/ - void print(const char * str, float x, float y , float angle); - - /** - * Draws text at the specified coordinates, with rotation and - * scaling. - * @param x The x-coordinate. - * @param y The y-coordinate. - * @param angle The amount of rotation. - * @param s The scale factor. (1 = normal). - **/ - void print(const char * str, float x, float y , float angle, float s); - /** * Draws text at the specified coordinates, with rotation and * scaling along both axes. @@ -433,7 +406,7 @@ namespace opengl * @param sx The scale factor along the x-axis. (1 = normal). * @param sy The scale factor along the y-axis. (1 = normal). **/ - void print(const char * str, float x, float y , float angle, float sx, float sy); + void print(const char * str, float x, float y , float angle = 0.0f, float sx = 1.0f, float sy = 1.0f); /** * Draw formatted text on screen at the specified coordinates. diff --git a/src/modules/graphics/opengl/wrap_Graphics.cpp b/src/modules/graphics/opengl/wrap_Graphics.cpp index 9e1cdf0d9..63cd882b1 100644 --- a/src/modules/graphics/opengl/wrap_Graphics.cpp +++ b/src/modules/graphics/opengl/wrap_Graphics.cpp @@ -755,24 +755,7 @@ namespace opengl float angle = (float)luaL_optnumber(L, 4, 0.0f); float sx = (float)luaL_optnumber(L, 5, 1.0f); float sy = (float)luaL_optnumber(L, 6, sx); - - switch(lua_gettop(L)) - { - case 3: - instance->print(str, x, y); - break; - case 4: - instance->print(str, x, y, angle); - break; - case 5: - instance->print(str, x, y, angle, sx); - break; - case 6: - instance->print(str, x, y, angle, sx, sy); - break; - default: - return luaL_error(L, "Incorrect number of parameters"); - } + instance->print(str, x, y, angle, sx, sy); return 0; }