26 Commits

Author SHA1 Message Date
David Capello
e6bf19e1c1 Fix bug not re-using a tile when A=0 and RGB values are different
When alpha=0, we can ignore RGB values and re-use a tile in the
tileset.
2021-04-19 16:56:30 -03:00
David Capello
14c3cfe393 Fix conversions between layer <-> tilemap when grid origin != 0,0
We've changed a restriction for tilesets: grid's in doc::Tileset must
have origin=(0,0); and the origin of a doc::Grid only makes sense for
the sprite grid (where the origin is set by the user) or for a tilemap
cel (where the origin is the cel origin).
2021-04-15 21:26:45 -03:00
David Capello
db80c2a07e Real-time preview when editing tilemaps in Manual mode
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).
2020-11-04 16:54:12 -03:00
David Capello
c2e5e69882 Simplify tilesets impl using tile index 0 = an empty tile
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).
2020-10-30 16:33:34 -03:00
David Capello
9113a690f0 Fix crash duplicating tilemap layers 2020-10-26 19:56:56 -03:00
David Capello
0993248189 Try to avoid modifying indexes of non-modified tiles in Auto mode 2020-10-19 22:21:31 -03:00
David Capello
423cec71e5 Improve Auto tileset mode: re-use the same tile index when it's possible 2020-10-19 21:54:16 -03:00
David Capello
108f2bc1a3 Fix minor typo 2020-10-19 16:56:41 -03:00
David Capello
b1c0d80356 Add support to clear/fill/stroke selections in tiles mode 2020-08-27 20:32:22 -03:00
David Capello
0ec8efd366 Fix auto and stack tileset modes when drawing on a tile_i_notile 2020-08-21 21:30:48 -03:00
David Capello
fa46aff072 Minor changes in modify_tilemap_cel_region() 2020-08-20 14:22:28 -03:00
David Capello
8ff438c365 Fix crash copying from a tilemap with notiles 2020-08-20 14:22:05 -03:00
Gaspar Capello
a195487fc0 Fix bounds calculation on tiles drawing outside cel bounds and the filling tile index is tile_i_notile, instead of empty tile. 2020-08-06 10:52:41 -03:00
David Capello
7b7fa29710 Fix copy_tiles_in_tileset() case when the "beforeIndex" is out of range 2020-07-16 19:00:31 -03:00
David Capello
7f3a34c757 Implement copy_tiles_in_tileset() 2020-07-16 18:47:31 -03:00
David Capello
8582826013 Fix move_tiles_in_tileset 2020-06-30 18:53:14 -03:00
David Capello
21fa63da76 Fix Manual mode when we touch the same tile in different locations
This also fixes the re-hashing of the internal Tileset hash table when
a tile is modified.
2020-02-17 16:47:27 -03:00
David Capello
d0f9429d03 Integrate the TilesetHashTable inside the same Tileset 2020-02-17 09:06:02 -03:00
David Capello
736e119440 Don't create an empty cmd::CopyRegion()
This might happen when we double-click some tiles outside the tilemap region.
2020-02-17 09:06:02 -03:00
David Capello
e792d4e078 Add possibility to move tiles w/drag and drop + remap tiles 2020-02-17 09:06:02 -03:00
David Capello
f2abf09bbf Change TilesetMode names: Manual/Auto/Stack 2020-02-17 09:06:02 -03:00
David Capello
559a244e6a Fix crash applying a filter to a tilemap in certain cases 2020-02-17 09:06:01 -03:00
David Capello
dde2722ac1 Fix applying a filter in a tilemap (don't displace cel to origin 0,0) 2020-02-17 09:06:01 -03:00
David Capello
92b794d457 Add the final TilesetModes UI: Manual/Semi/Auto 2020-02-17 09:06:01 -03:00
David Capello
2baf405b37 Add support to apply filters to tiles 2020-02-17 09:06:01 -03:00
David Capello
26139c4ae2 Add tilemap layers (#977)
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)
2020-02-17 09:06:00 -03:00