Bitpack bools in TileGrid and Group

This commit is contained in:
Scott Shawcroft 2019-09-04 10:27:21 -07:00
parent 949f8761b8
commit 70407e4d87
No known key found for this signature in database
GPG Key ID: 9349BC7E64B1921E
2 changed files with 18 additions and 16 deletions

View File

@ -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);

View File

@ -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);