Skip to content

Commit 70407e4

Browse files
committed
Bitpack bools in TileGrid and Group
1 parent 949f876 commit 70407e4

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

shared-module/displayio/Group.h

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,18 @@ typedef struct {
4242
typedef struct {
4343
mp_obj_base_t base;
4444
displayio_group_child_t* children;
45+
displayio_buffer_transform_t absolute_transform;
46+
displayio_area_t dirty_area; // Catch all for changed area
4547
int16_t x;
4648
int16_t y;
4749
uint16_t scale;
4850
uint16_t size;
4951
uint16_t max_size;
50-
bool item_removed;
51-
bool in_group;
52-
bool hidden;
53-
bool hidden_by_parent;
54-
displayio_buffer_transform_t absolute_transform;
55-
displayio_area_t dirty_area; // Catch all for changed area
52+
bool item_removed :1;
53+
bool in_group :1;
54+
bool hidden :1;
55+
bool hidden_by_parent :1;
56+
uint8_t padding :4;
5657
} displayio_group_t;
5758

5859
void displayio_group_construct(displayio_group_t* self, displayio_group_child_t* child_array, uint32_t max_size, uint32_t scale, mp_int_t x, mp_int_t y);

shared-module/displayio/TileGrid.h

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -55,16 +55,17 @@ typedef struct {
5555
displayio_area_t dirty_area; // Stored as a relative area until the refresh area is fetched.
5656
displayio_area_t previous_area; // Stored as an absolute area.
5757
displayio_area_t current_area; // Stored as an absolute area so it applies across frames.
58-
bool partial_change;
59-
bool full_change;
60-
bool moved;
61-
bool inline_tiles;
62-
bool in_group;
63-
bool flip_x;
64-
bool flip_y;
65-
bool transpose_xy;
66-
bool hidden;
67-
bool hidden_by_parent;
58+
bool partial_change :1;
59+
bool full_change :1;
60+
bool moved :1;
61+
bool inline_tiles :1;
62+
bool in_group :1;
63+
bool flip_x :1;
64+
bool flip_y :1;
65+
bool transpose_xy :1;
66+
bool hidden :1;
67+
bool hidden_by_parent :1;
68+
uint8_t padding :6;
6869
} displayio_tilegrid_t;
6970

7071
void displayio_tilegrid_set_hidden_by_parent(displayio_tilegrid_t *self, bool hidden);

0 commit comments

Comments
 (0)