diff --git a/tools/xcode/templates/SFML/SFML App.xctemplate/main.cpp b/tools/xcode/templates/SFML/SFML App.xctemplate/main.cpp index 0b6b4ec89..d71a3875d 100644 --- a/tools/xcode/templates/SFML/SFML App.xctemplate/main.cpp +++ b/tools/xcode/templates/SFML/SFML App.xctemplate/main.cpp @@ -26,11 +26,7 @@ int main() sf::RenderWindow window(sf::VideoMode({800, 600}), "SFML window"); // Set the Icon - sf::Image icon; - if (!icon.loadFromFile(resourcePath() / "icon.png")) - { - return EXIT_FAILURE; - } + const auto icon = sf::Image::loadFromFile(resourcePath() / "icon.png").value(); window.setIcon(icon); // Load a sprite to display diff --git a/tools/xcode/templates/SFML/SFML CLT.xctemplate/main.cpp b/tools/xcode/templates/SFML/SFML CLT.xctemplate/main.cpp index e13e6c9c7..122bccfa4 100644 --- a/tools/xcode/templates/SFML/SFML CLT.xctemplate/main.cpp +++ b/tools/xcode/templates/SFML/SFML CLT.xctemplate/main.cpp @@ -24,11 +24,7 @@ int main() sf::RenderWindow window(sf::VideoMode({800, 600}), "SFML window"); // Set the Icon - sf::Image icon; - if (!icon.loadFromFile("icon.png")) - { - return EXIT_FAILURE; - } + const auto icon = sf::Image::loadFromFile("icon.png").value(); window.setIcon(icon); // Load a sprite to display