mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2024-11-29 22:55:51 +08:00
Compatify the Screen memory.
Instead of storing all the booleans with 5 bytes, use a bit field. The size of a Pixel has been reduced by 25%, from 20 byte to 15 bytes.
This commit is contained in:
parent
4d29dccb06
commit
6f87740801
@ -18,14 +18,21 @@ using Element = std::shared_ptr<Node>;
|
|||||||
/// @brief A unicode character and its associated style.
|
/// @brief A unicode character and its associated style.
|
||||||
/// @ingroup screen
|
/// @ingroup screen
|
||||||
struct Pixel {
|
struct Pixel {
|
||||||
wchar_t character = U' ';
|
|
||||||
bool blink = false;
|
|
||||||
bool bold = false;
|
|
||||||
bool dim = false;
|
|
||||||
bool inverted = false;
|
|
||||||
bool underlined = false;
|
|
||||||
Color background_color = Color::Default;
|
Color background_color = Color::Default;
|
||||||
Color foreground_color = Color::Default;
|
Color foreground_color = Color::Default;
|
||||||
|
wchar_t character = U' ';
|
||||||
|
bool blink : 1;
|
||||||
|
bool bold : 1;
|
||||||
|
bool dim : 1;
|
||||||
|
bool inverted : 1;
|
||||||
|
bool underlined : 1;
|
||||||
|
|
||||||
|
Pixel()
|
||||||
|
: blink(false),
|
||||||
|
bold(false),
|
||||||
|
dim(false),
|
||||||
|
inverted(false),
|
||||||
|
underlined(false) {}
|
||||||
};
|
};
|
||||||
|
|
||||||
/// @brief Define how the Screen's dimensions should look like.
|
/// @brief Define how the Screen's dimensions should look like.
|
||||||
|
Loading…
Reference in New Issue
Block a user