diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9928767f..279484a4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -25,7 +25,7 @@ jobs: uses: actions/checkout@v3 with: repository: SFML/SFML - ref: 2.5.1 + ref: 2.6.0 path: SFML - name: Configure SFML CMake diff --git a/include/SFML/Graphics/Font.h b/include/SFML/Graphics/Font.h index f33b6911..32f456bf 100644 --- a/include/SFML/Graphics/Font.h +++ b/include/SFML/Graphics/Font.h @@ -161,6 +161,35 @@ CSFML_GRAPHICS_API float sfFont_getUnderlineThickness(const sfFont* font, unsign //////////////////////////////////////////////////////////// CSFML_GRAPHICS_API const sfTexture* sfFont_getTexture(sfFont* font, unsigned int characterSize); +//////////////////////////////////////////////////////////// +/// \brief Enable or disable the smooth filter +/// +/// When the filter is activated, the font appears smoother +/// so that pixels are less noticeable. However if you want +/// the font to look exactly the same as its source file, +/// you should disable it. +/// The smooth filter is enabled by default. +/// +/// \param font Source font +/// \param smooth sfTrue to enable smoothing, sfFalse to disable it +/// +/// \see isSmooth +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API void sfFont_setSmooth(sfFont* font, sfBool smooth); + +//////////////////////////////////////////////////////////// +/// \brief Tell whether the smooth filter is enabled or disabled +/// +/// \param font Source font +/// +/// \return sfTrue if smoothing is enabled, sfFalse if it is disabled +/// +/// \see setSmooth +/// +//////////////////////////////////////////////////////////// +CSFML_GRAPHICS_API const sfBool sfFont_isSmooth(const sfFont* font); + //////////////////////////////////////////////////////////// /// \brief Get the font information /// diff --git a/include/SFML/Network/Packet.h b/include/SFML/Network/Packet.h index 28e6c70e..c9ea8ce2 100644 --- a/include/SFML/Network/Packet.h +++ b/include/SFML/Network/Packet.h @@ -69,6 +69,18 @@ CSFML_NETWORK_API void sfPacket_destroy(sfPacket* packet); //////////////////////////////////////////////////////////// CSFML_NETWORK_API void sfPacket_append(sfPacket* packet, const void* data, size_t sizeInBytes); +//////////////////////////////////////////////////////////// +/// \brief Get the current reading position in the packet +/// +/// The next read operation will read data from this position +/// +/// \return The byte offset of the current read position +/// +/// \see append +/// +//////////////////////////////////////////////////////////// +CSFML_NETWORK_API size_t sfPacket_getReadPosition(const sfPacket* packet); + //////////////////////////////////////////////////////////// /// \brief Clear a packet /// diff --git a/src/SFML/Graphics/Font.cpp b/src/SFML/Graphics/Font.cpp index 7355d35d..58dd8d94 100644 --- a/src/SFML/Graphics/Font.cpp +++ b/src/SFML/Graphics/Font.cpp @@ -152,6 +152,26 @@ const sfTexture* sfFont_getTexture(sfFont* font, unsigned int characterSize) return &font->Textures[characterSize]; } + +//////////////////////////////////////////////////////////// +void sfFont_setSmooth(sfFont* font, sfBool smooth) +{ + font->This.setSmooth(smooth == sfTrue); +} + + +//////////////////////////////////////////////////////////// +const sfBool sfFont_isSmooth(const sfFont *font) +{ + if (font->This.isSmooth()) + { + return sfTrue; + } + + return sfFalse; +} + + //////////////////////////////////////////////////////////// sfFontInfo sfFont_getInfo(const sfFont* font) { diff --git a/src/SFML/Network/Packet.cpp b/src/SFML/Network/Packet.cpp index f0f3a1a4..cd8de463 100644 --- a/src/SFML/Network/Packet.cpp +++ b/src/SFML/Network/Packet.cpp @@ -60,6 +60,13 @@ void sfPacket_append(sfPacket* packet, const void* data, size_t sizeInBytes) } +//////////////////////////////////////////////////////////// +size_t sfPacket_getReadPosition(const sfPacket* packet) +{ + CSFML_CALL_RETURN(packet, getReadPosition(), 0); +} + + //////////////////////////////////////////////////////////// void sfPacket_clear(sfPacket* packet) {