Maintain hierarchical structure of sprite groups instead of flattening.
Allows opacity and blend mode to be applied correctly to groups.
Sets the foundation for future features like mask layers.
Note:
Requires full image rendering and impacts performance in some scenarios.
Avoids complex code changes for minor performance gains.
Co-authored-by: Guilherme Marcondes <guilherme.marcondes@tecnico.ulisboa.pt>
* Now a Cel has a z-index property to change the order of layers per frame
* A new doc::RenderPlan class can calculate the order of cels to be rendered
* z-index is saved as a int16_t in the .aseprite files
* This new field can be set/get from Lua with Cel.zIndex
In this way we can see the changes to all instances of the same tile
in the tilemap in real-time. The preview is done through a new
"preview tileset" that is used in the render concept (instead of the
preview image, a preview tileset is used as a temporal tileset to be
used for preview purposes only).
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)
A new Render::renderCel() method is used to render the specific cel
thumbnail, useful in the future to render thumbnails of different kind
of layers (e.g. future tilemaps). And now the background is rendered
in a different step (so the thumbnails doesn't contain the
background.)
We use the new general image composite code in case that there is a
reference layer or the background grid is so small that we need a
pixel-by-pixel color blending.
We can return the specific function to composite images depending on the
actual zoom level. In this commit I include a new
composite_image_without_scale() to completely ignore the zoom level when
it's possible.
With this patch now we can use the selection tool in locked or hidden
layers, because the selection doesn't modify the layers (only the
selection). Also we can use the selection tool on any layer and we'll
always see the feedback stroke/shape/rectangle while we're creating
the new selection.
- Added doc::BlendMode enum and doc::BlendFunc type
- Renamed LayerImage::getBlendMode() -> blendMode()
- BLEND_MODE_COPY is BlendMode::SRC now
- BLEND_MODE_NORMAL is BlendMode::NORMAL now
- Added app::cmd::SetLayerBlendMode
With this we can see the exact preview in real-time of the the left
click paiting (e.g. using real Indexed composition, ink, point shape, etc.)
We are able to preview blur, eraser, or flood fill preview too (anyway
these are not enabled at this moment).
Changes:
* Add render::ExtraType enum to indicate if the extra cel acts like a
patch for the current cel (e.g. cursor), or as an extra layer for
composition (e.g. selection/moving pixels)
* Add ExtraCelType property to app::Document and to render::Render
* Add ToolBox::getPointShapeById()
* As the current cursor preview depends on the current layer, when
we change the current layer we've to update the Preview editor
with the new selected layer (now we listen to
Document:.onAfterLayerChanged())
* Add create_tool_loop_preview() and PreviewToolLoopImpl
Changes:
* Create render library (move util/render.cpp to render/render.cpp)
* Move app::Zoom class to render::Zoom
* Remove doc::Image::merge() member function
* Add gfx::Clip helper class (to clip dst/src rectangles before a blit)
* Move doc::composite_image() to render::composite_image()
* Remove doc::Sprite::render()
* Replace Sprite::getPixel() with render::get_sprite_pixel()
* Remove doc::layer_render() function
* Convert DitheringMethod to a enum class
* Add AppRender to configure a render::Render with the app configuration
* Move checked background preferences as document-specific configuration
* Add doc::Sprite::layer() and palette() member functions
* Add doc::Layer::cel() member function
* Add doc::Palette::entry() member function()
* Add doc::frame_t type
* Move create_palette_from_rgb/convert_pixel_format to render library
* ExportSpriteSheet doesn't need a temporary image now that we can specify
the source rectangle in the render routine