In this way we always have an empty tile available in the drawing
process. We've also added the Tileset::firstVisibleIndex field to
change the visible index of the tile 1 so we can offset the visible
number by the user (just as a visual aid / simulate old tilesets with
index=0=non-empty tile).
This is the first commit with a simple tilemap editor. Still buggy but
functional in several ways. Several changes were made:
* NewLayer command can receive a tilemap=true to create a new tilemap
layer
* New ToggleTilesMode command added to switch between the palette and
the tileset in the ColorBar (the ColorBar was expanded to show
colors or tilesets with a generic AbstractPaletteViewAdapter)
* All commands to create new layers were moved to Layer >
New... submenu
* There are a new tileset chunk to save tilesets in .aseprite files,
and a new kind of cels to save tilemaps
* Added doc::LayerTilemap, doc::Tileset, etc. and several other types
to handle tilesets/tilemaps in the doc layer.
* Added doc::Grid class with grid specifications that indicates how a
tilemap <-> tileset must be drawn
* Added and expanded cel operations to work with tilemaps and
conversions between regular LayerImage cels <-> LayerTilemap cels
(e.g. copy cels in the timeline between layer types)
- The order is fixed because we now iterate a LayerList (a
std::vector) instead of a SelectedLayers (a std::set)
- This can be an issue each time we iterate over a std::set (and
SelectedLayers is a std::set) because it depends on the specific STL
impl details (which vary depending on msvc/clang/gcc compiler).
- This fix iterates over layers, no matter if are visible or not
(SelectedLayers::toLayerList() returns only browseable layers)
* Added the gfx::ColorSpace field in doc::ImageSpec
* Removed some methods like Sprites::add(width, height, etc.)
* Prefer methods with ImageSpec as argument (which now includes the color space)
Changes:
* With this patch we finally removed the LayerIndex class and member
functions to access layers by index (like Sprite::firstLayer/layerLayer
/layer/indexToLayer/layerToIndex() etc.). As layer groups can be
expanded/collapsed, it doesn't make sense to use layer index to
access layers directly from sprite.
* Now we use a layer_t (int) to access a list of browsable layers each
time we want to iterate visible layers in the timeline.
* Replaced CelsRange() and Sprite::uniqueCels() param with
SelectedFrames to iterate non-adjacent cels.
* Updated clipboard operations (copy/paste) in timeline to support
layer groups.
* Updated Timeline control to support selecting multiple layer/frame
ranges with Ctrl+ or Alt+click (fix#1157)
* Added more test units for DocumentRange operations (mainly for
non-adjacent ranges).
If the Timeline has an active selected range of layers and the user
creates a new layer group, the selected layers will be be grouped as
children of the new layer 'group'.