Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request for 2.6.x CSFML #186

Merged
merged 3 commits into from
Jun 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 29 additions & 0 deletions include/SFML/Graphics/Font.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down
12 changes: 12 additions & 0 deletions include/SFML/Network/Packet.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
///
Expand Down
20 changes: 20 additions & 0 deletions src/SFML/Graphics/Font.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,26 @@ const sfTexture* sfFont_getTexture(sfFont* font, unsigned int characterSize)
return &font->Textures[characterSize];
}


////////////////////////////////////////////////////////////
dogunbound marked this conversation as resolved.
Show resolved Hide resolved
void sfFont_setSmooth(sfFont* font, sfBool smooth)
{
font->This.setSmooth(smooth == sfTrue);
}


////////////////////////////////////////////////////////////
dogunbound marked this conversation as resolved.
Show resolved Hide resolved
const sfBool sfFont_isSmooth(const sfFont *font)
{
if (font->This.isSmooth())
{
return sfTrue;
}

return sfFalse;
}

dogunbound marked this conversation as resolved.
Show resolved Hide resolved

////////////////////////////////////////////////////////////
sfFontInfo sfFont_getInfo(const sfFont* font)
{
Expand Down
7 changes: 7 additions & 0 deletions src/SFML/Network/Packet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,13 @@ void sfPacket_append(sfPacket* packet, const void* data, size_t sizeInBytes)
}


////////////////////////////////////////////////////////////
dogunbound marked this conversation as resolved.
Show resolved Hide resolved
size_t sfPacket_getReadPosition(const sfPacket* packet)
{
CSFML_CALL_RETURN(packet, getReadPosition(), 0);
}
dogunbound marked this conversation as resolved.
Show resolved Hide resolved


////////////////////////////////////////////////////////////
void sfPacket_clear(sfPacket* packet)
{
Expand Down