diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2019-09-04 10:27:21 -0700 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2019-09-04 10:27:21 -0700 |
| commit | 70407e4d871ad7e42e707e2e0b53c50c32872cc5 (patch) | |
| tree | 2ff58852368b46bb854241521218051366e3f9ce /shared-module | |
| parent | 949f8761b8c41ecbf8660bcd5a333890a37e426e (diff) | |
Bitpack bools in TileGrid and Group
Diffstat (limited to 'shared-module')
| -rw-r--r-- | shared-module/displayio/Group.h | 13 | ||||
| -rw-r--r-- | shared-module/displayio/TileGrid.h | 21 |
2 files changed, 18 insertions, 16 deletions
diff --git a/shared-module/displayio/Group.h b/shared-module/displayio/Group.h index 7021da4bd..5afaac1ba 100644 --- a/shared-module/displayio/Group.h +++ b/shared-module/displayio/Group.h @@ -42,17 +42,18 @@ typedef struct { typedef struct { mp_obj_base_t base; displayio_group_child_t* children; + displayio_buffer_transform_t absolute_transform; + displayio_area_t dirty_area; // Catch all for changed area int16_t x; int16_t y; uint16_t scale; uint16_t size; uint16_t max_size; - bool item_removed; - bool in_group; - bool hidden; - bool hidden_by_parent; - displayio_buffer_transform_t absolute_transform; - displayio_area_t dirty_area; // Catch all for changed area + bool item_removed :1; + bool in_group :1; + bool hidden :1; + bool hidden_by_parent :1; + uint8_t padding :4; } displayio_group_t; 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); diff --git a/shared-module/displayio/TileGrid.h b/shared-module/displayio/TileGrid.h index 3e95dd20a..e97d3dfd4 100644 --- a/shared-module/displayio/TileGrid.h +++ b/shared-module/displayio/TileGrid.h @@ -55,16 +55,17 @@ typedef struct { displayio_area_t dirty_area; // Stored as a relative area until the refresh area is fetched. displayio_area_t previous_area; // Stored as an absolute area. displayio_area_t current_area; // Stored as an absolute area so it applies across frames. - bool partial_change; - bool full_change; - bool moved; - bool inline_tiles; - bool in_group; - bool flip_x; - bool flip_y; - bool transpose_xy; - bool hidden; - bool hidden_by_parent; + bool partial_change :1; + bool full_change :1; + bool moved :1; + bool inline_tiles :1; + bool in_group :1; + bool flip_x :1; + bool flip_y :1; + bool transpose_xy :1; + bool hidden :1; + bool hidden_by_parent :1; + uint8_t padding :6; } displayio_tilegrid_t; void displayio_tilegrid_set_hidden_by_parent(displayio_tilegrid_t *self, bool hidden); |
