summaryrefslogtreecommitdiff
path: root/Games/Snake/main.cpp
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2020-02-06 13:39:17 +0100
committerAndreas Kling <kling@serenityos.org>2020-02-06 13:39:17 +0100
commit5c06c32df4062a17e1caf7aa01ee51e87852070a (patch)
tree1590bbe4af3624accc6e30575c9ec6a64d692890 /Games/Snake/main.cpp
parentf8b00aa29010cc3a99b285d0afd88314c40be079 (diff)
downloadserenity-5c06c32df4062a17e1caf7aa01ee51e87852070a.zip
LibGfx: Prefer using Gfx::Bitmap::load_from_file instead of load_png()
Code that just wants to open a Gfx::Bitmap from a file should not be calling the PNG codec directly.
Diffstat (limited to 'Games/Snake/main.cpp')
-rw-r--r--Games/Snake/main.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/Games/Snake/main.cpp b/Games/Snake/main.cpp
index 42df1d9799..dd09ab55f3 100644
--- a/Games/Snake/main.cpp
+++ b/Games/Snake/main.cpp
@@ -25,7 +25,6 @@
*/
#include "SnakeGame.h"
-#include <LibGfx/PNGLoader.h>
#include <LibGUI/GAboutDialog.h>
#include <LibGUI/GAction.h>
#include <LibGUI/GApplication.h>
@@ -74,7 +73,7 @@ int main(int argc, char** argv)
auto help_menu = GUI::Menu::construct("Help");
help_menu->add_action(GUI::Action::create("About", [&](const GUI::Action&) {
- GUI::AboutDialog::show("Snake", Gfx::load_png("/res/icons/32x32/app-snake.png"), window);
+ GUI::AboutDialog::show("Snake", Gfx::Bitmap::load_from_file("/res/icons/32x32/app-snake.png"), window);
}));
menubar->add_menu(move(help_menu));
@@ -82,7 +81,7 @@ int main(int argc, char** argv)
window->show();
- window->set_icon(Gfx::load_png("/res/icons/16x16/app-snake.png"));
+ window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/app-snake.png"));
return app.exec();
}