JJ2Tileset class
#include <Jazz2/Compatibility/JJ2Tileset.h>
Parses original .j2t tile set files.
Reads an original tile set, decoding its palette and per-tile image, alpha and collision mask data, and writes the converted tile set to the target path for use by the engine's tile maps.
Public static functions
-
static auto ConvertTiles(StringView path,
ArrayView<const std::
int32_t> tiles, Formats:: TileSetData& data, std:: int32_t& tileCount) -> bool - Converts only some tiles of a tile set file into memory.
Constructors, destructors, conversion operators
- JJ2Tileset()
- Creates a new instance.
Public functions
- auto Open(StringView path, bool strictParser) -> bool
- Opens and parses the specified tile set file.
- void Convert(StringView targetPath) const
- Converts the tile set and writes the result to the specified target path.
-
void Convert(Formats::
TileSetData& data) const - Copies the converted tile set, the same data the overload above writes.
-
auto GetMaxSupportedTiles() const -> std::
int32_t - Returns maximum number of supported tiles.
Constants
-
static std::
int32_t BlockSize constexpr - Size of a tile.
Function documentation
static bool Jazz2:: Compatibility:: JJ2Tileset:: ConvertTiles(StringView path,
ArrayView<const std:: int32_t> tiles,
Formats:: TileSetData& data,
std:: int32_t& tileCount)
Converts only some tiles of a tile set file into memory.
The tiles of tiles, indices into the tile set, go into data in the same order, as Convert() converts them but without their collision masks; one past the end of the tile set stays empty. tileCount is set to the number of tiles of the whole tile set. Unlike Open(), which keeps the whole tile set, it takes little more memory than the tiles it returns, which is what the previews of the levels need where memory is scarce.