From 2af0ba66f199c91c99202009cb84882dfe8efa01 Mon Sep 17 00:00:00 2001 From: vittorioromeo Date: Mon, 24 Apr 2023 01:20:35 +0200 Subject: [PATCH] Fix errors and warnings in templates --- .../templates/SFML/SFML App.xctemplate/main.cpp | 12 ++++++------ .../templates/SFML/SFML CLT.xctemplate/main.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/tools/xcode/templates/SFML/SFML App.xctemplate/main.cpp b/tools/xcode/templates/SFML/SFML App.xctemplate/main.cpp index 795c7cd3..15ce66a1 100644 --- a/tools/xcode/templates/SFML/SFML App.xctemplate/main.cpp +++ b/tools/xcode/templates/SFML/SFML App.xctemplate/main.cpp @@ -20,22 +20,22 @@ // Here is a small helper for you! Have a look. #include "ResourcePath.hpp" -int main(int, char const**) +int main() { // Create the main window sf::RenderWindow window(sf::VideoMode({800, 600}), "SFML window"); // Set the Icon sf::Image icon; - if (!icon.loadFromFile(resourcePath() + "icon.png")) + if (!icon.loadFromFile(resourcePath() / "icon.png")) { return EXIT_FAILURE; } - window.setIcon(icon.getSize().x, icon.getSize().y, icon.getPixelsPtr()); + window.setIcon(icon); // Load a sprite to display sf::Texture texture; - if (!texture.loadFromFile(resourcePath() + "background.jpg")) + if (!texture.loadFromFile(resourcePath() / "background.jpg")) { return EXIT_FAILURE; } @@ -43,7 +43,7 @@ int main(int, char const**) // Create a graphical text to display sf::Font font; - if (!font.loadFromFile(resourcePath() + "tuffy.ttf")) + if (!font.loadFromFile(resourcePath() / "tuffy.ttf")) { return EXIT_FAILURE; } @@ -52,7 +52,7 @@ int main(int, char const**) // Load a music to play sf::Music music; - if (!music.openFromFile(resourcePath() + "doodle_pop.ogg")) + if (!music.openFromFile(resourcePath() / "doodle_pop.ogg")) { return EXIT_FAILURE; } diff --git a/tools/xcode/templates/SFML/SFML CLT.xctemplate/main.cpp b/tools/xcode/templates/SFML/SFML CLT.xctemplate/main.cpp index 54dce7e2..33b329e1 100644 --- a/tools/xcode/templates/SFML/SFML CLT.xctemplate/main.cpp +++ b/tools/xcode/templates/SFML/SFML CLT.xctemplate/main.cpp @@ -18,7 +18,7 @@ #include #include -int main(int argc, char const** argv) +int main() { // Create the main window sf::RenderWindow window(sf::VideoMode({800, 600}), "SFML window"); @@ -29,7 +29,7 @@ int main(int argc, char const** argv) { return EXIT_FAILURE; } - window.setIcon(icon.getSize().x, icon.getSize().y, icon.getPixelsPtr()); + window.setIcon(icon); // Load a sprite to display sf::Texture texture;