RuntimeSync class
#include <Jazz2/Editor/Runtime/RuntimeSync.h>
Brings the level shown by the editor up to date with the level being edited.
Most changes are applied to the shown level in place, layers that were only moved too. The rest — other tile sets, added, removed or resized layers, changed animations — need the level to be loaded again from the document, which the editor does when told so.
Public static functions
-
static auto Apply(const LevelDocument& document,
Tiles::
TileMap& tileMap, const DocumentChanges& changes) -> bool - Applies changes to the shown level, returns
falseif it has to be loaded again instead. -
static void ApplyLayerStates(const LevelDocument& document,
Tiles::
TileMap& tileMap) - Applies the editor state of all layers, such as which are hidden.
-
static void ApplyTiles(const LevelDocument& document,
Tiles::
TileMap& tileMap, std:: int32_t layerIndex, const Recti& area) - Copies tiles of an area of a layer from the document.
-
static auto MakeLayerTile(const LevelDocument& document,
const TileRef& tile) -> Tiles::
LayerTile - Makes the tile the shown level has for a tile of the document.
- static auto IsLayerShown(const DocumentLayer& layer) -> bool
- Returns
trueif the editor shows a layer, which it doesn't if it's hidden in the editor or in the game (Formats::LayerRecord:: Visible). -
static void ApplyEditorOpacity(const DocumentLayer& layer,
Tiles::
LayerDescription& description) - Makes a layer of the shown level as opaque as the editor shows it, see DocumentLayer::
EditorOpacity. - static auto IsTexturedBackground(const DocumentLayer& layer) -> bool
- Returns
trueif a layer is drawn from a texture of its tiles, a sky, a tunnel or a reflection. -
static auto ShowsAnyTile(const LevelDocument& document,
const TileRef& tile,
ArrayView<const std::
uint16_t> sortedTileIds) -> bool - Returns
trueif a tile of a layer shows one of the tiles ofsortedTileIds, an animated one by any of its frames.
Constructors, destructors, conversion operators
- RuntimeSync() deleted
Function documentation
static bool Jazz2:: Editor:: RuntimeSync:: ShowsAnyTile(const LevelDocument& document,
const TileRef& tile,
ArrayView<const std:: uint16_t> sortedTileIds)
Returns true if a tile of a layer shows one of the tiles of sortedTileIds, an animated one by any of its frames.
The tile IDs have to be sorted.