From 3dc8a1f0ee7479dc1612de4cc7df83c03205b08d Mon Sep 17 00:00:00 2001 From: scawful Date: Tue, 29 Apr 2025 00:09:58 -0400 Subject: [PATCH] Add Tile class and constructor overloads for tile data initialization --- src/app/gfx/snes_tile.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/app/gfx/snes_tile.h b/src/app/gfx/snes_tile.h index a4ed5284..91bca1fb 100644 --- a/src/app/gfx/snes_tile.h +++ b/src/app/gfx/snes_tile.h @@ -60,6 +60,13 @@ class TileInfo { vertical_mirror_(v), horizontal_mirror_(h), 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 { return id_ == other.id_ && over_ == other.over_ &&