diff options
Diffstat (limited to 'Games')
-rw-r--r-- | Games/Minesweeper/Field.cpp | 20 | ||||
-rw-r--r-- | Games/Minesweeper/Field.h | 16 | ||||
-rw-r--r-- | Games/Minesweeper/main.cpp | 10 | ||||
-rw-r--r-- | Games/Snake/SnakeGame.cpp | 12 | ||||
-rw-r--r-- | Games/Snake/SnakeGame.h | 2 | ||||
-rw-r--r-- | Games/Snake/main.cpp | 4 |
6 files changed, 32 insertions, 32 deletions
diff --git a/Games/Minesweeper/Field.cpp b/Games/Minesweeper/Field.cpp index ef8074250a..7f4039bc28 100644 --- a/Games/Minesweeper/Field.cpp +++ b/Games/Minesweeper/Field.cpp @@ -134,17 +134,17 @@ Field::Field(GUI::Label& flag_label, GUI::Label& time_label, GUI::Button& face_b }; m_timer->set_interval(100); set_frame_thickness(2); - set_frame_shape(FrameShape::Container); - set_frame_shadow(FrameShadow::Sunken); - m_mine_bitmap = GraphicsBitmap::load_from_file("/res/icons/minesweeper/mine.png"); - m_flag_bitmap = GraphicsBitmap::load_from_file("/res/icons/minesweeper/flag.png"); - m_badflag_bitmap = GraphicsBitmap::load_from_file("/res/icons/minesweeper/badflag.png"); - m_consider_bitmap = GraphicsBitmap::load_from_file("/res/icons/minesweeper/consider.png"); - m_default_face_bitmap = GraphicsBitmap::load_from_file("/res/icons/minesweeper/face-default.png"); - m_good_face_bitmap = GraphicsBitmap::load_from_file("/res/icons/minesweeper/face-good.png"); - m_bad_face_bitmap = GraphicsBitmap::load_from_file("/res/icons/minesweeper/face-bad.png"); + set_frame_shape(Gfx::FrameShape::Container); + set_frame_shadow(Gfx::FrameShadow::Sunken); + m_mine_bitmap = Gfx::Bitmap::load_from_file("/res/icons/minesweeper/mine.png"); + m_flag_bitmap = Gfx::Bitmap::load_from_file("/res/icons/minesweeper/flag.png"); + m_badflag_bitmap = Gfx::Bitmap::load_from_file("/res/icons/minesweeper/badflag.png"); + m_consider_bitmap = Gfx::Bitmap::load_from_file("/res/icons/minesweeper/consider.png"); + m_default_face_bitmap = Gfx::Bitmap::load_from_file("/res/icons/minesweeper/face-default.png"); + m_good_face_bitmap = Gfx::Bitmap::load_from_file("/res/icons/minesweeper/face-good.png"); + m_bad_face_bitmap = Gfx::Bitmap::load_from_file("/res/icons/minesweeper/face-bad.png"); for (int i = 0; i < 8; ++i) - m_number_bitmap[i] = GraphicsBitmap::load_from_file(String::format("/res/icons/minesweeper/%u.png", i + 1)); + m_number_bitmap[i] = Gfx::Bitmap::load_from_file(String::format("/res/icons/minesweeper/%u.png", i + 1)); set_fill_with_background_color(true); reset(); diff --git a/Games/Minesweeper/Field.h b/Games/Minesweeper/Field.h index 7aa0b26fd3..5d99b0e3ec 100644 --- a/Games/Minesweeper/Field.h +++ b/Games/Minesweeper/Field.h @@ -113,14 +113,14 @@ private: int m_mine_count { 0 }; int m_unswept_empties { 0 }; Vector<OwnPtr<Square>> m_squares; - RefPtr<GraphicsBitmap> m_mine_bitmap; - RefPtr<GraphicsBitmap> m_flag_bitmap; - RefPtr<GraphicsBitmap> m_badflag_bitmap; - RefPtr<GraphicsBitmap> m_consider_bitmap; - RefPtr<GraphicsBitmap> m_default_face_bitmap; - RefPtr<GraphicsBitmap> m_good_face_bitmap; - RefPtr<GraphicsBitmap> m_bad_face_bitmap; - RefPtr<GraphicsBitmap> m_number_bitmap[8]; + RefPtr<Gfx::Bitmap> m_mine_bitmap; + RefPtr<Gfx::Bitmap> m_flag_bitmap; + RefPtr<Gfx::Bitmap> m_badflag_bitmap; + RefPtr<Gfx::Bitmap> m_consider_bitmap; + RefPtr<Gfx::Bitmap> m_default_face_bitmap; + RefPtr<Gfx::Bitmap> m_good_face_bitmap; + RefPtr<Gfx::Bitmap> m_bad_face_bitmap; + RefPtr<Gfx::Bitmap> m_number_bitmap[8]; GUI::Button& m_face_button; GUI::Label& m_flag_label; GUI::Label& m_time_label; diff --git a/Games/Minesweeper/main.cpp b/Games/Minesweeper/main.cpp index 58bfc99ac7..657be40720 100644 --- a/Games/Minesweeper/main.cpp +++ b/Games/Minesweeper/main.cpp @@ -69,14 +69,14 @@ int main(int argc, char** argv) container->set_preferred_size(0, 36); container->set_layout(make<GUI::HBoxLayout>()); auto flag_icon_label = GUI::Label::construct(container); - flag_icon_label->set_icon(GraphicsBitmap::load_from_file("/res/icons/minesweeper/flag.png")); + flag_icon_label->set_icon(Gfx::Bitmap::load_from_file("/res/icons/minesweeper/flag.png")); auto flag_label = GUI::Label::construct(container); auto face_button = GUI::Button::construct(container); - face_button->set_button_style(ButtonStyle::CoolBar); + face_button->set_button_style(Gfx::ButtonStyle::CoolBar); face_button->set_size_policy(GUI::SizePolicy::Fixed, GUI::SizePolicy::Fill); face_button->set_preferred_size(36, 0); auto time_icon_label = GUI::Label::construct(container); - time_icon_label->set_icon(GraphicsBitmap::load_from_file("/res/icons/minesweeper/timer.png")); + time_icon_label->set_icon(Gfx::Bitmap::load_from_file("/res/icons/minesweeper/timer.png")); auto time_label = GUI::Label::construct(container); auto field = Field::construct(*flag_label, *time_label, *face_button, widget, [&](Size size) { size.set_height(size.height() + container->preferred_size().height()); @@ -129,7 +129,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("Minesweeper", load_png("/res/icons/32x32/app-minesweeper.png"), window); + GUI::AboutDialog::show("Minesweeper", Gfx::load_png("/res/icons/32x32/app-minesweeper.png"), window); })); menubar->add_menu(move(help_menu)); @@ -137,7 +137,7 @@ int main(int argc, char** argv) window->show(); - window->set_icon(load_png("/res/icons/minesweeper/mine.png")); + window->set_icon(Gfx::load_png("/res/icons/minesweeper/mine.png")); return app.exec(); } diff --git a/Games/Snake/SnakeGame.cpp b/Games/Snake/SnakeGame.cpp index 98a0acd403..2eed90cf6c 100644 --- a/Games/Snake/SnakeGame.cpp +++ b/Games/Snake/SnakeGame.cpp @@ -35,10 +35,10 @@ SnakeGame::SnakeGame(GUI::Widget* parent) : GUI::Widget(parent) { set_font(GFontDatabase::the().get_by_name("Liza Regular")); - m_fruit_bitmaps.append(*GraphicsBitmap::load_from_file("/res/icons/snake/paprika.png")); - m_fruit_bitmaps.append(*GraphicsBitmap::load_from_file("/res/icons/snake/eggplant.png")); - m_fruit_bitmaps.append(*GraphicsBitmap::load_from_file("/res/icons/snake/cauliflower.png")); - m_fruit_bitmaps.append(*GraphicsBitmap::load_from_file("/res/icons/snake/tomato.png")); + 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")); srand(time(nullptr)); reset(); @@ -228,8 +228,8 @@ void SnakeGame::paint_event(GUI::PaintEvent& event) painter.draw_scaled_bitmap(cell_rect(m_fruit), m_fruit_bitmaps[m_fruit_type], m_fruit_bitmaps[m_fruit_type].rect()); - painter.draw_text(high_score_rect(), m_high_score_text, TextAlignment::TopLeft, Color::from_rgb(0xfafae0)); - painter.draw_text(score_rect(), m_score_text, TextAlignment::TopLeft, Color::White); + painter.draw_text(high_score_rect(), m_high_score_text, Gfx::TextAlignment::TopLeft, Color::from_rgb(0xfafae0)); + painter.draw_text(score_rect(), m_score_text, Gfx::TextAlignment::TopLeft, Color::White); } void SnakeGame::game_over() diff --git a/Games/Snake/SnakeGame.h b/Games/Snake/SnakeGame.h index 69df7d5c0e..3cc2a40f50 100644 --- a/Games/Snake/SnakeGame.h +++ b/Games/Snake/SnakeGame.h @@ -87,5 +87,5 @@ private: unsigned m_high_score { 0 }; String m_high_score_text; - NonnullRefPtrVector<GraphicsBitmap> m_fruit_bitmaps; + NonnullRefPtrVector<Gfx::Bitmap> m_fruit_bitmaps; }; diff --git a/Games/Snake/main.cpp b/Games/Snake/main.cpp index d9293f16fa..191c12ff9b 100644 --- a/Games/Snake/main.cpp +++ b/Games/Snake/main.cpp @@ -74,7 +74,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", load_png("/res/icons/32x32/app-snake.png"), window); + GUI::AboutDialog::show("Snake", Gfx::load_png("/res/icons/32x32/app-snake.png"), window); })); menubar->add_menu(move(help_menu)); @@ -82,7 +82,7 @@ int main(int argc, char** argv) window->show(); - window->set_icon(load_png("/res/icons/16x16/app-snake.png")); + window->set_icon(Gfx::load_png("/res/icons/16x16/app-snake.png")); return app.exec(); } |