diff --git a/include/SFML/Audio/Listener.hpp b/include/SFML/Audio/Listener.hpp index 26b33b5a3..b920dd2e3 100644 --- a/include/SFML/Audio/Listener.hpp +++ b/include/SFML/Audio/Listener.hpp @@ -222,10 +222,10 @@ SFML_AUDIO_API Vector3f getUpVector(); /// Usage example: /// \code /// // Move the listener to the position (1, 0, -5) -/// sf::Listener::setPosition(1, 0, -5); +/// sf::Listener::setPosition({1, 0, -5}); /// /// // Make it face the right axis (1, 0, 0) -/// sf::Listener::setDirection(1, 0, 0); +/// sf::Listener::setDirection({1, 0, 0}); /// /// // Reduce the global volume /// sf::Listener::setGlobalVolume(50); diff --git a/include/SFML/Audio/Music.hpp b/include/SFML/Audio/Music.hpp index e28e15ae2..a01ef115f 100644 --- a/include/SFML/Audio/Music.hpp +++ b/include/SFML/Audio/Music.hpp @@ -303,10 +303,10 @@ private: /// auto music = sf::Music::openFromFile("music.ogg").value(); /// /// // Change some parameters -/// music.setPosition(0, 1, 10); // change its 3D position -/// music.setPitch(2); // increase the pitch -/// music.setVolume(50); // reduce the volume -/// music.setLoop(true); // make it loop +/// music.setPosition({0, 1, 10}); // change its 3D position +/// music.setPitch(2); // increase the pitch +/// music.setVolume(50); // reduce the volume +/// music.setLoop(true); // make it loop /// /// // Play it /// music.play(); diff --git a/include/SFML/Graphics/CircleShape.hpp b/include/SFML/Graphics/CircleShape.hpp index 13e7c5988..a703ed752 100644 --- a/include/SFML/Graphics/CircleShape.hpp +++ b/include/SFML/Graphics/CircleShape.hpp @@ -146,7 +146,7 @@ private: /// circle.setRadius(150); /// circle.setOutlineColor(sf::Color::Red); /// circle.setOutlineThickness(5); -/// circle.setPosition(10, 20); +/// circle.setPosition({10, 20}); /// ... /// window.draw(circle); /// \endcode diff --git a/include/SFML/Graphics/ConvexShape.hpp b/include/SFML/Graphics/ConvexShape.hpp index 8e4b3c85b..494def03f 100644 --- a/include/SFML/Graphics/ConvexShape.hpp +++ b/include/SFML/Graphics/ConvexShape.hpp @@ -145,7 +145,7 @@ private: /// polygon.setPoint(2, sf::Vector2f(25, 5)); /// polygon.setOutlineColor(sf::Color::Red); /// polygon.setOutlineThickness(5); -/// polygon.setPosition(10, 20); +/// polygon.setPosition({10, 20}); /// ... /// window.draw(polygon); /// \endcode diff --git a/include/SFML/Graphics/RectangleShape.hpp b/include/SFML/Graphics/RectangleShape.hpp index 99a7a5020..05555c424 100644 --- a/include/SFML/Graphics/RectangleShape.hpp +++ b/include/SFML/Graphics/RectangleShape.hpp @@ -133,7 +133,7 @@ private: /// rectangle.setSize(sf::Vector2f(100, 50)); /// rectangle.setOutlineColor(sf::Color::Red); /// rectangle.setOutlineThickness(5); -/// rectangle.setPosition(10, 20); +/// rectangle.setPosition({10, 20}); /// ... /// window.draw(rectangle); /// \endcode diff --git a/include/SFML/Graphics/Sprite.hpp b/include/SFML/Graphics/Sprite.hpp index 67cfdace7..60bb20da6 100644 --- a/include/SFML/Graphics/Sprite.hpp +++ b/include/SFML/Graphics/Sprite.hpp @@ -273,7 +273,7 @@ private: /// sf::Sprite sprite(texture); /// sprite.setTextureRect(sf::IntRect({10, 10}, {50, 30})); /// sprite.setColor(sf::Color(255, 255, 255, 200)); -/// sprite.setPosition(100, 25); +/// sprite.setPosition({100, 25}); /// /// // Draw it /// window.draw(sprite); diff --git a/include/SFML/Graphics/Transformable.hpp b/include/SFML/Graphics/Transformable.hpp index 1aa355eea..d907764d6 100644 --- a/include/SFML/Graphics/Transformable.hpp +++ b/include/SFML/Graphics/Transformable.hpp @@ -296,8 +296,8 @@ private: /// }; /// /// MyEntity entity; -/// entity.setPosition(10, 20); -/// entity.setRotation(45); +/// entity.setPosition({10, 20}); +/// entity.setRotation(sf::degrees(45)); /// window.draw(entity); /// \endcode /// diff --git a/test/Graphics/Image.test.cpp b/test/Graphics/Image.test.cpp index d0e44e1cc..00e74e857 100644 --- a/test/Graphics/Image.test.cpp +++ b/test/Graphics/Image.test.cpp @@ -54,7 +54,7 @@ TEST_CASE("[Graphics] sf::Image") SECTION("Vector2 and std::uint8_t* constructor") { - // 10 x 10, with 4 colour channels array + // 10 x 10, with 4 color channels array std::array pixels{}; for (std::size_t i = 0; i < pixels.size(); i += 4) { @@ -359,7 +359,7 @@ TEST_CASE("[Graphics] sf::Image") const sf::Color dest(255, 0, 0, 255); const sf::Color source(5, 255, 78, 232); - // Create the composited colour for via the alpha composite over operation + // Create the composited color for via the alpha composite over operation const auto a = static_cast(source.a + (dest.a * (255 - source.a)) / 255); const auto r = static_cast( ((source.r * source.a) + ((dest.r * dest.a) * (255 - source.a)) / 255) / a);