Commit Graph

76 Commits

Author SHA1 Message Date
Martín Capello
47a1c407c3 Update the way vectors are serialized to support mixed elements types 2023-02-22 12:51:51 -03:00
David Capello
64ce25fae2 Add property to disable the standard tilemap UI
Added a Sprite.tileManagementPlugin property for plugins that want to
replace the standard tilemap/tileset interface. This includes a new
external file field in .aseprite files to specify that the sprite
tiles are controlled by a specific plugin.

Once this property is set, the standard tilemap/tileset modes
selectors will disappear and the only way to make then available will
be setting this property to nil/empty string again.

Fix https://github.com/aseprite/Attachment-System/issues/21
2023-02-15 18:55:21 -03:00
David Capello
ccef9cee4f Cache compressed tileset information from .aseprite files on memory
We've added an experimental option (enabled by default) to keep the
compressed tileset data when we load/save a .aseprite file to avoid
recompressing each time we save (and only compressing the tileset if
tiles are modified).

This is an attempt to make the save operation faster when we use
sprites with several tilemap layers + large tilesets (many tiles, with
big tiles).

Reference: https://github.com/aseprite/Attachment-System/issues/54
2023-02-14 13:03:06 -03:00
David Capello
6603775368 Minor refactor in .aseprite decoder/encoder
We've tested writing uncompressed tilesets, it's too slow for big
tilesets. Anyway read_raw_image/write_raw_image now support saving
uncompressed tilemaps if necessary in the future.
2023-02-14 12:29:49 -03:00
Martín Capello
5823abd1c0 Add serialization of custom properties 2023-01-12 17:15:25 -03:00
Martín Capello
6d4e699601 Fix warning because AsepriteExternalFiles is declared as a class now 2023-01-12 14:59:15 -03:00
David Capello
dd33cef4be Store one time each extension name in the external files chunk in .aseprite files
We've refactored the AsepriteExternalFiles struct to make it a
class (hiding members), storing maps ID -> filename per file
type (e.g. so we don't mix external tileset filenames with extensions
names, etc.), and re-using IDs for extensions names with the same
name (there is no need to store the same extension name multiple times
in the external files chunk).
2023-01-09 14:49:37 -03:00
David Capello
4232410719 Simplify AsepriteExternalFiles using one std::map for filenames/types 2023-01-09 12:53:06 -03:00
David Capello
bb3ba19fc6 Minor changes in .aseprite decoder/encoder to avoid depending on exceptions to control flow 2023-01-09 12:53:04 -03:00
David Capello
d590d3f39a Add nullptr_t to doc::UserData::Variant to fix bug when undoing an previously unexistent property 2023-01-06 14:36:51 -03:00
David Capello
8f09728105 Merge branch 'custom-properties-serialization' (fix #3632, #3645) 2023-01-06 10:03:19 -03:00
Martín Capello
b00b96877a Remove unused include 2023-01-06 10:02:14 -03:00
David Capello
177f42898a Replace std::stringstream() with fmt::format() 2023-01-05 16:35:24 -03:00
Martín Capello
03d66aa203 Introduce FLOAT and DOUBLE types 2023-01-05 15:30:45 -03:00
Martín Capello
03f0c7ff08 Replace use of new with make_unique 2023-01-05 15:17:02 -03:00
Martín Capello
6c886cfa19 Add serialization/deserialization of user data custom properties 2023-01-05 15:16:57 -03:00
David Capello
d3aac6a1cd Add support for .qoi file format (fix #3121) 2023-01-05 14:23:01 -03:00
Martín Capello
8b4b803a22 Refactor AsepriteExternalFiles usage 2023-01-03 16:59:36 -03:00
David Capello
4f96d37b1f Add repeat field to animation tags (#1275, #1740) 2022-10-19 12:25:06 -03:00
David Capello
7e1d3832f0 Merge branch 'main' into beta 2022-03-04 23:56:55 -03:00
David Capello
c5ee08e3b5 Add required include directory to use doc/dio/fixmath libraries
This is used for the fuzz project.
2022-03-04 23:53:43 -03:00
David Capello
efd8a71b9f Merge branch 'main' into beta 2022-01-10 17:03:04 -03:00
David Capello
817879d700 Fix possible infinite loop reading broken .aseprite files (fix #3123) 2022-01-10 17:00:12 -03:00
Joshua Ogunyinka
9a12eb584b Initial to decode PSD files 2021-12-06 15:33:32 -03:00
David Capello
5238bfc7d7 Merge branch 'main' into beta (fix #2970) 2021-09-29 14:54:30 -03:00
David Capello
d7ddb7feed Fix changing random values to transparent color for non-indexed sprite from cmd::SetPalette
Possible fix for #2970
Possible regression introduced in dd2d226264
2021-09-29 14:42:55 -03:00
Joshua Ogunyinka
ed8e2c8392 Fix performance issue/lag drawing in 'Auto' mode on a tilemap layer (fix #2877)
We receive a .aseprite example where the tilemap contain some tiles
with huge tile indexes. We don't know why the tilemap was saved with
those wrong values (tile index out of bounds), but it was the cause of
the lag.
2021-09-08 12:04:39 -03:00
David Capello
650ab7b8d6 Minor change: move comment to its related if-condition 2021-09-01 11:10:19 -03:00
Joshua Ogunyinka
d502876cd3 Fixed saving of blend mode and opacity in aseprite files 2021-09-01 11:08:53 -03:00
David Capello
c42c5e1453 Backport new laf API to main branch of aseprite
Some features from the beta branch of aseprite & laf were backported
to the main branch of aseprite.

Related commits:
- New memory handling (db4504e816)
- New get event with timeout (e6ec13cc31)
- Convert os::NativeCursor to an enum (06a5b4f3ae)
- Adapt code to the new os::Display -> os::Window refactor (5d31314cdb)
- Save/load main window layout correctly and limit to current workarea (d6acb9e20f)
- Redraw window immediately on "live resizing" (d0b39ebade)
2021-07-05 17:51:29 -03:00
David Capello
1d1982d312 Merge branch 'main' into beta 2021-07-01 11:50:55 -03:00
David Capello
ffe65bface Detect webp files by file content (fix #2807) 2021-07-01 11:37:11 -03:00
Gaspar Capello
a4ae88f307 Fix regression loading tag colors incorrectly from .aseprite files
Without this fix we would read old .aseprite files (saved with v1.2)
incorrectly: assigning user data that corresponded to other
objects (cels/slices/etc.) to tags.

Co-authored-by: David Capello <david@igarastudio.com>
2021-04-13 10:07:28 -03:00
David Capello
e83ed244b8 Fix bug loading the correct mask color for tilesets 2021-02-22 16:21:18 -03:00
David Capello
289a6ab864 Merge branch 'master' into beta 2021-01-29 12:19:43 -03:00
David Capello
e813773445 Merge branch 'feature-css-export' into css-export 2021-01-05 12:23:57 -03:00
Gaspar Capello
116201d8a1 Add custom data to Sprite Properties Window (fix #1306) 2020-12-16 12:40:05 -03:00
David Capello
a3286fc20a Minor refactor "first visible index" -> "base index" 2020-10-30 20:58:45 -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
9ad8f8bf73 Minor comments in code and .aseprite specs about user data for tags 2020-08-21 19:11:59 -03:00
Gaspar Capello
f630714547 Removed color functions from tag related code, fix backward compatibilty and added default color in tag constructor (before this, tests were failing) 2020-08-21 18:51:43 -03:00
Gaspar Capello
1cd584413d Fix ase format write/read for tags user data (backward compatible) 2020-08-21 18:51:40 -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
2ffac6803c Merge branch 'beta' into tilemap-editor 2020-08-06 10:47:06 -03:00
David Capello
4e08d12f28 Merge branch 'master' into beta 2020-08-06 10:46:32 -03:00
David Capello
7355d0e2db Add minor checks of .ase header 2020-08-03 17:33:15 -03:00
David Capello
515dace441 Merge branch 'beta' into tilemap-editor 2020-07-13 17:32:42 -03:00
David Capello
db4504e816 Refactor laf-os memory handling 2020-07-07 19:06:48 -03:00
Gaspar Capello
fbe2f8645d Fix invalid tileset when number of tiles is 0 opening a file
Before this fix, aseprite threw an error: 'Invalid tileset' and delete the Tilemap layer, after it tried to open an aseprite file with a empty tileset on a Tilemap layer.
2020-06-24 16:13:59 -03:00
Hamed Zaghaghi
123fa7d106 add css export 2020-03-24 05:51:02 +04:30