1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 19:27:45 +00:00

FlappyBug: Make bitmap() methods return NonnullRefPtrs

We are already storing these as NonnullRefPtrs, so we might
as well make the functions return them as such.
This commit is contained in:
creator1creeper1 2021-12-23 22:13:11 +01:00 committed by Brian Gianforcaro
parent 6f592a32cc
commit 615c2cbcce

View file

@ -69,7 +69,7 @@ public:
y = starting_y; y = starting_y;
} }
RefPtr<Gfx::Bitmap> current_bitmap() const NonnullRefPtr<Gfx::Bitmap> current_bitmap() const
{ {
return velocity < 0 ? falling_bitmap : flapping_bitmap; return velocity < 0 ? falling_bitmap : flapping_bitmap;
} }
@ -153,7 +153,7 @@ public:
y = get_random_uniform(game_height / 2) + bitmap()->height(); y = get_random_uniform(game_height / 2) + bitmap()->height();
} }
RefPtr<Gfx::Bitmap> bitmap() const NonnullRefPtr<Gfx::Bitmap> bitmap() const
{ {
return cloud_bitmaps[bitmap_id]; return cloud_bitmaps[bitmap_id];
} }