Add Tile class and constructor overloads for tile data initialization
This commit is contained in:
@@ -60,6 +60,13 @@ class TileInfo {
|
|||||||
vertical_mirror_(v),
|
vertical_mirror_(v),
|
||||||
horizontal_mirror_(h),
|
horizontal_mirror_(h),
|
||||||
palette_(palette) {}
|
palette_(palette) {}
|
||||||
|
TileInfo(uint8_t b1, uint8_t b2) {
|
||||||
|
id_ = (uint16_t)(((b2 & 0x01) << 8) + (b1));
|
||||||
|
vertical_mirror_ = (b2 & 0x80) == 0x80;
|
||||||
|
horizontal_mirror_ = (b2 & 0x40) == 0x40;
|
||||||
|
over_ = (b2 & 0x20) == 0x20;
|
||||||
|
palette_ = (b2 >> 2) & 0x07;
|
||||||
|
}
|
||||||
|
|
||||||
bool operator==(const TileInfo& other) const {
|
bool operator==(const TileInfo& other) const {
|
||||||
return id_ == other.id_ && over_ == other.over_ &&
|
return id_ == other.id_ && over_ == other.over_ &&
|
||||||
|
|||||||
Reference in New Issue
Block a user