diff --git a/src/sprites.cpp b/src/sprites.cpp index 1d63fb8..a4e37aa 100644 --- a/src/sprites.cpp +++ b/src/sprites.cpp @@ -35,11 +35,11 @@ static int decodetile(U8 *buffer, int sx, int sy, CommonPixel *imgbuffer, long t for (int y=0; y> 8) & 0xFF; + tile[offset++] = (tileofs >> 16) & 0xFF; + tile[offset++] = tileofs >> 24; } else { - U16 *lineofs = (U16*)tile; - lineofs[y] = BE_SWAP16(tileofs); + size_t offset = y * sizeof(U16); + tile[offset++] = tileofs & 0xFF; + tile[offset++] = tileofs >> 8; } long lastlenofs = tileofs;