porymap/include/core/tile.h

36 lines
680 B
C
Raw Normal View History

2020-09-13 23:37:55 +01:00
#pragma once
#ifndef TILE_H
#define TILE_H
2022-02-04 02:32:27 +00:00
#include <QObject>
class Tile
{
public:
Tile();
2022-08-27 00:30:40 +01:00
Tile(uint16_t tileId, uint16_t xflip, uint16_t yflip, uint16_t palette);
2022-02-04 02:32:27 +00:00
Tile(uint16_t raw);
2021-02-17 02:45:54 +00:00
public:
2022-08-27 00:30:40 +01:00
uint16_t tileId:10;
uint16_t xflip:1;
uint16_t yflip:1;
uint16_t palette:4;
2022-02-04 02:32:27 +00:00
uint16_t rawValue() const;
static int getIndexInTileset(int);
};
inline bool operator==(const Tile &a, const Tile &b) {
return a.tileId == b.tileId &&
a.xflip == b.xflip &&
a.yflip == b.yflip &&
a.palette == b.palette;
}
inline bool operator!=(const Tile &a, const Tile &b) {
return !(operator==(a, b));
}
#endif // TILE_H