Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Bitpack bools in TileGrid and Group
  • Loading branch information
tannewt committed Sep 4, 2019
commit 70407e4d871ad7e42e707e2e0b53c50c32872cc5
13 changes: 7 additions & 6 deletions shared-module/displayio/Group.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
21 changes: 11 additions & 10 deletions shared-module/displayio/TileGrid.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down