1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 17:57:35 +00:00

LibCards: Painting disabled cards

This commit is contained in:
david072 2023-11-12 11:35:53 +01:00 committed by Sam Atkins
parent 65b9cb63ee
commit 55168b50dc
4 changed files with 56 additions and 0 deletions

View file

@ -1,5 +1,6 @@
/*
* Copyright (c) 2022-2023, Sam Atkins <atkinssj@serenityos.org>
* Copyright (c) 2023, David Ganz <david.g.ganz@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
@ -23,6 +24,8 @@ public:
NonnullRefPtr<Gfx::Bitmap> card_front_inverted(Suit, Rank);
NonnullRefPtr<Gfx::Bitmap> card_back_inverted();
NonnullRefPtr<Gfx::Bitmap> card_front_highlighted(Suit, Rank);
NonnullRefPtr<Gfx::Bitmap> card_front_disabled(Suit, Rank);
NonnullRefPtr<Gfx::Bitmap> card_back_disabled();
void set_back_image_path(StringView path);
void set_front_images_set_name(StringView path);
@ -36,14 +39,17 @@ private:
void paint_card_back(Gfx::Bitmap&);
void paint_inverted_card(Gfx::Bitmap& bitmap, Gfx::Bitmap const& source_to_invert);
void paint_highlighted_card(Gfx::Bitmap& bitmap, Gfx::Bitmap const& source_to_highlight);
void paint_disabled_card(Gfx::Bitmap& bitmap, Gfx::Bitmap const& source_to_disable);
Array<RefPtr<Gfx::Bitmap>, to_underlying(Suit::__Count)> m_suit_pips;
Array<RefPtr<Gfx::Bitmap>, to_underlying(Suit::__Count)> m_suit_pips_flipped_vertically;
Array<Array<RefPtr<Gfx::Bitmap>, to_underlying(Rank::__Count)>, to_underlying(Suit::__Count)> m_cards;
Array<Array<RefPtr<Gfx::Bitmap>, to_underlying(Rank::__Count)>, to_underlying(Suit::__Count)> m_cards_inverted;
Array<Array<RefPtr<Gfx::Bitmap>, to_underlying(Rank::__Count)>, to_underlying(Suit::__Count)> m_cards_highlighted;
Array<Array<RefPtr<Gfx::Bitmap>, to_underlying(Rank::__Count)>, to_underlying(Suit::__Count)> m_cards_disabled;
RefPtr<Gfx::Bitmap> m_card_back;
RefPtr<Gfx::Bitmap> m_card_back_inverted;
RefPtr<Gfx::Bitmap> m_card_back_disabled;
String m_back_image_path;
String m_front_images_set_name;