From b4163081bae2dac5571ff7bd0299fecc883607c6 Mon Sep 17 00:00:00 2001 From: Mika Attila Date: Sat, 11 Mar 2017 11:42:07 +0100 Subject: [PATCH] Add missing const qualifiers to sfFont methods --- include/SFML/Graphics/Font.h | 10 +++++----- src/SFML/Graphics/Font.cpp | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/include/SFML/Graphics/Font.h b/include/SFML/Graphics/Font.h index 9b1aa09..cf5cb5a 100644 --- a/include/SFML/Graphics/Font.h +++ b/include/SFML/Graphics/Font.h @@ -97,7 +97,7 @@ CSFML_GRAPHICS_API void sfFont_destroy(sfFont* font); /// \return The corresponding glyph /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold, float outlineThickness); +CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph(const sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold, float outlineThickness); //////////////////////////////////////////////////////////// /// \brief Get the kerning value corresponding to a given pair of characters in a font @@ -110,7 +110,7 @@ CSFML_GRAPHICS_API sfGlyph sfFont_getGlyph(sfFont* font, sfUint32 codePoint, uns /// \return Kerning offset, in pixels /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API float sfFont_getKerning(sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize); +CSFML_GRAPHICS_API float sfFont_getKerning(const sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize); //////////////////////////////////////////////////////////// /// \brief Get the line spacing value @@ -121,7 +121,7 @@ CSFML_GRAPHICS_API float sfFont_getKerning(sfFont* font, sfUint32 first, sfUint3 /// \return Line spacing, in pixels /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API float sfFont_getLineSpacing(sfFont* font, unsigned int characterSize); +CSFML_GRAPHICS_API float sfFont_getLineSpacing(const sfFont* font, unsigned int characterSize); //////////////////////////////////////////////////////////// /// \brief Get the position of the underline @@ -135,7 +135,7 @@ CSFML_GRAPHICS_API float sfFont_getLineSpacing(sfFont* font, unsigned int charac /// \return Underline position, in pixels /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API float sfFont_getUnderlinePosition(sfFont* font, unsigned int characterSize); +CSFML_GRAPHICS_API float sfFont_getUnderlinePosition(const sfFont* font, unsigned int characterSize); //////////////////////////////////////////////////////////// /// \brief Get the thickness of the underline @@ -148,7 +148,7 @@ CSFML_GRAPHICS_API float sfFont_getUnderlinePosition(sfFont* font, unsigned int /// \return Underline thickness, in pixels /// //////////////////////////////////////////////////////////// -CSFML_GRAPHICS_API float sfFont_getUnderlineThickness(sfFont* font, unsigned int characterSize); +CSFML_GRAPHICS_API float sfFont_getUnderlineThickness(const sfFont* font, unsigned int characterSize); //////////////////////////////////////////////////////////// /// \brief Get the texture containing the glyphs of a given size in a font diff --git a/src/SFML/Graphics/Font.cpp b/src/SFML/Graphics/Font.cpp index 1f54e4a..9fffeb8 100644 --- a/src/SFML/Graphics/Font.cpp +++ b/src/SFML/Graphics/Font.cpp @@ -93,7 +93,7 @@ void sfFont_destroy(sfFont* font) //////////////////////////////////////////////////////////// -sfGlyph sfFont_getGlyph(sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold, float outlineThickness) +sfGlyph sfFont_getGlyph(const sfFont* font, sfUint32 codePoint, unsigned int characterSize, sfBool bold, float outlineThickness) { sfGlyph glyph = {0, {0, 0, 0, 0}, {0, 0, 0, 0}}; CSFML_CHECK_RETURN(font, glyph); @@ -115,28 +115,28 @@ sfGlyph sfFont_getGlyph(sfFont* font, sfUint32 codePoint, unsigned int character //////////////////////////////////////////////////////////// -float sfFont_getKerning(sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize) +float sfFont_getKerning(const sfFont* font, sfUint32 first, sfUint32 second, unsigned int characterSize) { CSFML_CALL_RETURN(font, getKerning(first, second, characterSize), 0); } //////////////////////////////////////////////////////////// -float sfFont_getLineSpacing(sfFont* font, unsigned int characterSize) +float sfFont_getLineSpacing(const sfFont* font, unsigned int characterSize) { CSFML_CALL_RETURN(font, getLineSpacing(characterSize), 0); } //////////////////////////////////////////////////////////// -float sfFont_getUnderlinePosition(sfFont* font, unsigned int characterSize) +float sfFont_getUnderlinePosition(const sfFont* font, unsigned int characterSize) { CSFML_CALL_RETURN(font, getUnderlinePosition(characterSize), 0) } //////////////////////////////////////////////////////////// -float sfFont_getUnderlineThickness(sfFont* font, unsigned int characterSize) +float sfFont_getUnderlineThickness(const sfFont* font, unsigned int characterSize) { CSFML_CALL_RETURN(font, getUnderlineThickness(characterSize), 0) }