Jazz2::Compatibility::JJ2Level class

Parses original .j2l level files.

Reads an original level layout, including its tile layers, per-tile events, animated tiles, palettes and MLLE extension data, and writes the converted level to the target path. Events are translated to the engine's native types via an EventConverter during conversion.

Public types

struct LevelToken
Episode name and level name.
struct AlternatePalette
Alternate palette.
struct ExtraTilesetEntry
Extra tileset used in the level.
enum class TilesetColorMode : std::uint8_t { Original8bit, Remapped8bit, Original24bit, AlternatePalette24bit }
Color mode of tile set.

Public static variables

static std::int32_t JJ2LayerCount constexpr
Number of layers in the original game.
static std::int32_t TextEventStringsCount constexpr
Number of level text entries in the original game.

Constructors, destructors, conversion operators

JJ2Level()
Creates a new instance.

Public functions

auto Open(StringView path, bool strictParser) -> bool
Opens and parses the specified level file.
void Convert(StringView targetPath, EventConverter& eventConverter, Function<LevelToken(StringView)>&& levelTokenConversion = {})
Converts the level and writes the result to the specified target path.
void AddLevelTokenTextID(std::uint8_t textId)
Marks the level text with the specified ID as a level token.
auto GetVersion() const -> JJ2Version
Returns target version of the level.
auto GetMaxSupportedTiles() const -> std::int32_t
Returns maximum number of supported tiles.
auto GetMaxSupportedAnims() const -> std::int32_t
Returns maximum number of supported animations.

Public variables

String LevelName
Internal name of the level.
String DisplayName
Display name of the level.
String Tileset
Name of the tile set used by the level.
SmallVector<AlternatePalette, 0> AlternatePalettes
List of alternate palettes.
SmallVector<ExtraTilesetEntry, 0> ExtraTilesets
List of extra tile sets used by the level.
String Music
Name of the music track.
String NextLevel
Name of the next level.
String BonusLevel
Name of the bonus level.
String SecretLevel
Name of the secret level.
std::uint8_t LightingMin
Minimum and starting lighting level.
std::uint8_t LightingStart

Enum documentation

enum class Jazz2::Compatibility::JJ2Level::TilesetColorMode : std::uint8_t

Color mode of tile set.

Enumerators
Original8bit

Original 8-bit palette is used

Remapped8bit

8-bit palette is remapped according to PaletteRemapping

Original24bit

Original 24-bit palette is used

AlternatePalette24bit

Alternate 24-bit palette is used