Commit Graph

7092 Commits

Author SHA1 Message Date
David Capello
f2abf09bbf Change TilesetMode names: Manual/Auto/Stack 2020-02-17 09:06:02 -03:00
David Capello
2bb8dc93af Separate the "Edit Color" button in Color Bar
In this way the "Edit Color" switch and the button to toggle
palette/tilesets are aligned.
2020-02-17 09:06:02 -03:00
David Capello
5a8fb9cd67 Fix warning using || and && without parentheses in ASSERT() 2020-02-17 09:06:02 -03:00
David Capello
12becdaf45 Add "external files chunk" to .aseprite files
This will be a way to reference the same external file from other file
through IDs (instead of using filenames on each reference).
2020-02-17 09:06:02 -03:00
David Capello
c98c931227 Change tileset chunk format saving the tileset as one image (one big column of tiles) 2020-02-17 09:06:02 -03:00
David Capello
615fa33188 Fix flashing selected layer for tilemaps
We've also removed the necessity to create a temporary image for the
flashing effect, so it uses less memory.
2020-02-17 09:06:02 -03:00
David Capello
472861ddd9 Fix eyedropper when picking colors from the top or left edge of a tile (in composition mode) 2020-02-17 09:06:02 -03:00
David Capello
1e5c096236 Display correct grid bounds when using Rectangular Marquee tool on a tilemap layer 2020-02-17 09:06:02 -03:00
David Capello
9f6b18ddb3 A tilemap cannot be a background layer in the first release 2020-02-17 09:06:02 -03:00
David Capello
962ad545ad Disable merge down for tilemaps (at least for the first version of tilemaps) 2020-02-17 09:06:02 -03:00
David Capello
53cabc3a1d Add minor asserts/comments 2020-02-17 09:06:01 -03:00
David Capello
4d69106993 Fix crash merging a tilemap layer into a regular layer 2020-02-17 09:06:01 -03:00
David Capello
a6302b91f7 Fix paint bucket and magic wand tools for tilemaps 2020-02-17 09:06:01 -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
40c4c549cd Always Show the tileset grid when we are in a tilemap layer (even when there is no active cel) 2020-02-17 09:06:01 -03:00
David Capello
99b1474bdf Don't show tiles controls in color bar by default 2020-02-17 09:06:01 -03:00
David Capello
dfaf01ced4 Show tile value in the status bar 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
6616f0d327 Fix Remap palette colors for tilesets/tilemaps 2020-02-17 09:06:01 -03:00
David Capello
2156820512 Redraw editor when we switch to a layer w/different grid settings 2020-02-17 09:06:01 -03:00
David Capello
6c68df4f25 Fix call to shrink_bounds() from DocApi::cropCel() 2020-02-17 09:06:01 -03:00
David Capello
7331f50d9a Fix color mode conversion on sprites with tilemaps/tilesets 2020-02-17 09:06:01 -03:00
David Capello
12e1b4d934 Add dialog to create new tilemaps selecting the tileset specs 2020-02-17 09:06:01 -03:00
David Capello
21be7c5eac Fix LayerTilemap serialization on undo/redo 2020-02-17 09:06:01 -03:00
David Capello
6d62b02543 Fix thumbnails for tilemap layers 2020-02-17 09:06:01 -03:00
David Capello
9073b4aec6 Show correct active tile on status bar when we are in a tilemap 2020-02-17 09:06:01 -03:00
David Capello
0b700f947e Fix Edit > Copy (not merged) on tilemaps 2020-02-17 09:06:01 -03:00
David Capello
f7b5304d77 Fix SelectTile command on tilemaps 2020-02-17 09:06:01 -03:00
David Capello
04ffea04ee Fix eyedropper on tilemaps when zoom != 100% 2020-02-17 09:06:01 -03:00
David Capello
fead20a7b5 Fix eyedropper tool to pick colors from the current tilemap layer 2020-02-17 09:06:01 -03:00
David Capello
ec8bad3bb5 Don't select random entries in the tileset view when the tileset is modified 2020-02-17 09:06:01 -03:00
David Capello
4c583c2619 Fix new bounds of tilemap after Edit > Clear or Edit > Cut 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
David Capello
9fe05a5dd5 Fix crash double-clicking a moving selection (fix regression in 7b07f29f0b)
Here we avoid two ExpandCelCanvas at the same time with
MovingPixelsState + DrawingState. Double-clicking inside the selection
when we are moving it (MovingPixelsState) could start a new
DrawingState which creates a new ToolLoopImpl that needs a new
ExpandCelCanvas. So we have to drop the pixels before.
2020-02-17 08:28:30 -03:00
David Capello
7b07f29f0b Add possibility to select multiple tiles with double-click + dragging mouse (fix #1988)
Fixes: https://community.aseprite.org/t/1929
Related to #939
2020-02-16 12:42:29 -03:00
David Capello
6b7a593858 Minor formatting change in SelectTileCommand 2020-02-14 14:32:28 -03:00
David Capello
a1317eaede Show some extra debug info if Object::setId() assert fails 2020-02-12 23:07:00 -03:00
David Capello
294401b18a Select the correct tile when we double-click on negative coordinates of the grid 2020-02-11 12:43:29 -03:00
Gaspar Capello
f8cca1eba4 Removed unnecessary lines in remap.cpp 2020-02-11 09:24:24 -03:00
David Capello
47a568ee86 Resize selection correctly on "Sprite Size" even when the Bilinear method is used 2020-02-07 15:11:03 -03:00
David Capello
59fa7d956b DocExporter: Don't share the original size between samples
If we use two sprites with different canvas sizes, and both sprites
have a similar cel, they can share the inTextureBounds, but not the
original size (which is the original sprite canvas size of each cel).
This can be reproduced using the CLI and creating a texture
atlas (-sheet) with two or more sprites.
2020-02-06 15:07:40 -03:00
David Capello
a7f1f4bd64 DocExporter: render samples with trimmed size
This fix an issue merging similar cels from different sprites with
different canvas sizes.
2020-02-06 14:23:33 -03:00
David Capello
00cdda7b85 Minor change in DocExporter 2020-02-06 12:01:29 -03:00
David Capello
1c39d907cb Fix bug genering "spriteSourceSize" for similar cels but with different positions in the canvas
This can happen when we use -trim (Trim Cels) + -merge-duplicates
options together. The trimmed bounds are unique to each sample, and
only the position in the texture (inTextureBounds) can be shared.

Fixes: https://igarastudio.zendesk.com/agent/tickets/407
2020-02-06 11:59:29 -03:00
David Capello
df74444347 Now ContextWriter will always wait 1/2 second to unlock the backup thread 2020-02-05 17:50:17 -03:00
David Capello
d316781e8a Remove usage of ContextWriter from all Command::onEnabled() impls 2020-02-05 17:39:56 -03:00
David Capello
7306a685f8 Fix random bug showing disabled menu items right-clicking the timeline
When the backup thread is running, the upgradeToWrite() needed some
extra time to lock the document to check if we can write or not in the
sprite. Now we just check the ability to write the sprite with the new
RWLock::canWriteLockFromRead() function.
2020-02-05 17:03:48 -03:00
David Capello
28969d968c Finally removing a problematic assert from ~UIContext() 2020-02-05 12:23:11 -03:00