Skip to content

Commit

Permalink
correct rotation of exported tiles (270 is unmodified)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpetig committed Oct 26, 2020
1 parent 035ff2c commit 1b0bbea
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/plugins/rpmap/rpmapplugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,10 @@ static void writeTokenMap(QXmlStreamWriter &writer, Tiled::Map const* map) {
for (int x = 0; x < mapWidth; ++x) {
Cell t = tileLayer->cellAt(x, y);
if (t.isEmpty()) continue;
static const uint16_t rotation[8] = { 0, 0, 0, 180, 0, 90, 270, 0 };
static const uint16_t rotation[8] = { 270, 270, 270, 90, 0, 0, 180, 180 };
// in addition to rotation
static const bool flip_horiz[8] = { false, false, true, false, false, false, false, true };
static const bool flip_vert[8] = { false, true, false, false, true, false, false, false };
static const bool flip_horiz[8] = { false, false, true, false, true, false, false, true };
static const bool flip_vert[8] = { false, true, false, false, false, false, false, false };
uint8_t rot_index = (t.flippedVertically() ? 1 : 0) | (t.flippedHorizontally() ? 2 : 0) | (t.flippedAntiDiagonally() ? 4 : 0);
//int tileid= t.tileId();
Tile const* tile = t.tile();
Expand Down

0 comments on commit 1b0bbea

Please sign in to comment.