diff options
author | cflip <cflip@cflip.net> | 2022-03-23 18:01:39 -0600 |
---|---|---|
committer | cflip <cflip@cflip.net> | 2022-03-23 18:01:39 -0600 |
commit | 47b454c6c2266f17e29797e435e71b2d496885a0 (patch) | |
tree | 8b40da996a08c7c0da7699a912ae5ebe3e76a1af /src/level.cpp | |
parent | 3a5bd83ebae5bb4a3536e1af1d117bff2db61073 (diff) |
Simplify track sprite lookup
Diffstat (limited to 'src/level.cpp')
-rw-r--r-- | src/level.cpp | 26 |
1 files changed, 4 insertions, 22 deletions
diff --git a/src/level.cpp b/src/level.cpp index bf94d95..41b3c0e 100644 --- a/src/level.cpp +++ b/src/level.cpp @@ -58,28 +58,10 @@ void Level::draw(Bitmap& bitmap, int xo, int yo) tx = 2; ty = 0; break; - case TileTrack: { - uint8_t dir = TILE_DATA(tile); - if (dir == NorthSouth) { - tx = 0; - ty = 2; - } else if (dir == EastWest) { - tx = 1; - ty = 2; - } else if (dir == SouthEast) { - tx = 0; - ty = 3; - } else if (dir == SouthWest) { - tx = 3; - ty = 3; - } else if (dir == NorthWest) { - tx = 1; - ty = 3; - } else if (dir == NorthEast) { - tx = 2; - ty = 3; - } - } break; + case TileTrack: + tx = TILE_DATA(tile); + ty = 2; + break; } bitmap.blit(m_tileSprites, xx, yy, tx * TileSize, ty * TileSize, TileSize, TileSize); |