summaryrefslogtreecommitdiff
path: root/Userland/Games/Snake/SnakeGame.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-07-21 18:02:15 +0200
committerAndreas Kling <kling@serenityos.org>2021-07-21 18:02:15 +0200
commitc7d891765cc87ec04f8d332b93fc7c3f82521d7f (patch)
tree9d414d3ad62e0193b1b6fb0d12079e11e96e69b1 /Userland/Games/Snake/SnakeGame.cpp
parentf0409081f562b635de3a23d7babbc7348cbb970c (diff)
downloadserenity-c7d891765cc87ec04f8d332b93fc7c3f82521d7f.zip
LibGfx: Use "try_" prefix for static factory functions
Also mark them as [[nodiscard]].
Diffstat (limited to 'Userland/Games/Snake/SnakeGame.cpp')
-rw-r--r--Userland/Games/Snake/SnakeGame.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Games/Snake/SnakeGame.cpp b/Userland/Games/Snake/SnakeGame.cpp
index 5a63aa5e37..328a0ae255 100644
--- a/Userland/Games/Snake/SnakeGame.cpp
+++ b/Userland/Games/Snake/SnakeGame.cpp
@@ -16,10 +16,10 @@
SnakeGame::SnakeGame()
{
set_font(Gfx::FontDatabase::default_fixed_width_font().bold_variant());
- m_fruit_bitmaps.append(*Gfx::Bitmap::load_from_file("/res/icons/snake/paprika.png"));
- m_fruit_bitmaps.append(*Gfx::Bitmap::load_from_file("/res/icons/snake/eggplant.png"));
- m_fruit_bitmaps.append(*Gfx::Bitmap::load_from_file("/res/icons/snake/cauliflower.png"));
- m_fruit_bitmaps.append(*Gfx::Bitmap::load_from_file("/res/icons/snake/tomato.png"));
+ m_fruit_bitmaps.append(*Gfx::Bitmap::try_load_from_file("/res/icons/snake/paprika.png"));
+ m_fruit_bitmaps.append(*Gfx::Bitmap::try_load_from_file("/res/icons/snake/eggplant.png"));
+ m_fruit_bitmaps.append(*Gfx::Bitmap::try_load_from_file("/res/icons/snake/cauliflower.png"));
+ m_fruit_bitmaps.append(*Gfx::Bitmap::try_load_from_file("/res/icons/snake/tomato.png"));
srand(time(nullptr));
reset();