diff options
Diffstat (limited to 'Games/Snake')
-rw-r--r-- | Games/Snake/SnakeGame.cpp | 2 | ||||
-rw-r--r-- | Games/Snake/SnakeGame.h | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/Games/Snake/SnakeGame.cpp b/Games/Snake/SnakeGame.cpp index 251367dace..7229895159 100644 --- a/Games/Snake/SnakeGame.cpp +++ b/Games/Snake/SnakeGame.cpp @@ -200,7 +200,7 @@ void SnakeGame::paint_event(GPaintEvent& event) painter.fill_rect(bottom_side, Color::from_rgb(0x888800)); } - painter.draw_scaled_bitmap(cell_rect(m_fruit), *m_fruit_bitmaps[m_fruit_type], m_fruit_bitmaps[m_fruit_type]->rect()); + 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); diff --git a/Games/Snake/SnakeGame.h b/Games/Snake/SnakeGame.h index 19cb36e722..2c03e2541b 100644 --- a/Games/Snake/SnakeGame.h +++ b/Games/Snake/SnakeGame.h @@ -1,6 +1,7 @@ #pragma once #include <AK/CircularQueue.h> +#include <AK/NonnullRefPtrVector.h> #include <LibGUI/GWidget.h> class SnakeGame : public GWidget { @@ -59,5 +60,5 @@ private: unsigned m_high_score { 0 }; String m_high_score_text; - Vector<NonnullRefPtr<GraphicsBitmap>> m_fruit_bitmaps; + NonnullRefPtrVector<GraphicsBitmap> m_fruit_bitmaps; }; |