Commit Graph

9044 Commits

Author SHA1 Message Date
David Capello
89ced2e557 Add test for -save-as {slice} (#3801, #3802)
Original report: https://community.aseprite.org/t/17692
2023-04-12 15:11:37 -03:00
Gaspar Capello
17b976b3aa Fix regression {slice} format on CLI doesn't work (fix #3801) 2023-04-12 15:00:40 -03:00
Martín Capello
8841f3da32 Move window relayout before inserting the window to the manager (fix #3746)
This is necessary to prevent the manager to invalidate a window whose relayout is not finished. This can happen when a script opens a new window when another is currently opening. For instance a script whose canvas.onpaint handler opens another dialog.
2023-04-12 14:10:45 -03:00
David Capello
636cce6f0d [lua] Add Uuid type (fix #3809) 2023-04-12 13:51:37 -03:00
David Capello
7104a1a449 F2 renames the layer if a range of frames is not selected (fix #2326)
In this way we can use F2 to:

1. Set the Loop section if two or more frames are selected
2. Remove the loop section if only one frame is selected
3. Rename the active layer if the layer is selected (or no frames are selected)
2023-04-11 19:04:45 -03:00
David Capello
24846eae10 Add z-index property to cels (fix aseprite/Attachment-System#88)
* 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
2023-04-10 19:23:16 -03:00
David Capello
e38398d7aa Fix compilation when ENABLE_DEVMODE is disabled
We don't compile ShaderRenderer in production yet.
2023-04-07 21:36:04 -03:00
David Capello
538219f655 Fix warnings about unused members w/ImageIteratorT
Mainly when compiling src/doc/algorithm/rotate.cpp
2023-04-07 21:11:56 -03:00
David Capello
4f80008ea7 Merge branch 'gpu' (#3516, #3523)
An initial implementation (not yet ready for production) of the
ShaderRenderer to use SkSL shaders to convert indexed -> RGB, and draw
SkImages directly on SkCanvases (this will enable future GPU
acceleration).
2023-04-07 20:35:07 -03:00
David Capello
da9f334214 Fix FullscreenPreview for SimpleRenderer
The SimpleRenderer outputs unpremultiplied RGB values when we render
in a transparent background, we have to indicate that to Skia now that
we're compositing os::Surfaces (SkiaSurfaces) directly in this
FullscreenPreview command.
2023-04-07 20:26:16 -03:00
David Capello
be11e3b324 Recreate console window to print log messages if it was closed by the user
Regression introduced cc7da16691 when
the Console was converted to a non-modal window. If a script prints
something, the console is displayed, then the user can close the
console, and if the script tried to print something else the console
window wasn't displayed again until some other command was
executed (any command that called the Console::Console() constructor
which would create the ConsoleWindow again).

With this fix the console window is recreated/displayed again on the
screen.

This bug was well-known (but I think never reported yet) and probably
the possible source of the #3787 issue.
2023-04-05 18:26:15 -03:00
David Capello
264ee71b00 Add comment to improve Image_drawImage/convert_args_into_point() interaction in the future 2023-04-05 12:43:24 -03:00
Gaspar Capello
2b3372df0e Fix backward compatibility with Image:drawImage(image, x, y) was broken (fix #3788) 2023-04-05 12:00:42 -03:00
Martín Capello
e577852eb4 Improve message error when loading a sequence of png files whose color modes don't match (fix #3751) 2023-04-05 11:57:34 -03:00
Martín Capello
7422abf490 Ignore empty tiles when exporting tilesets and the "Ignore Empty" checkbox is checked (fix #3789) 2023-04-04 11:12:28 -03:00
David Capello
7b6187ada3 Minor changes before the merge with main
Added some extra comments + compile ShaderRenderer only when
ENABLE_DEVMODE is enabled.
2023-04-03 20:15:38 -03:00
David Capello
4fedc59f29 Fix render_tests setting the new BgOptions::colorPixelFormat field 2023-04-03 20:00:45 -03:00
David Capello
da0a8b7916 Show GPU option only in DEVMODE
We've update the label "GPU acceleration" to avoid confusion between
developers so they know that this option is not enabled in the final
release.
2023-04-03 16:09:26 -03:00
David Capello
7781ff69a1 Add support to render grayscale sprites with ShaderRenderer 2023-04-03 15:59:29 -03:00
David Capello
9e08386a28 Add support to render indexed images
For this we need a new SkSL shader that receives the palette and the
indexed image data and outputs the RGBA values for each fragment.
2023-04-03 15:59:29 -03:00
David Capello
af074fd6bf Add support to render tilemaps 2023-04-03 15:59:29 -03:00
David Capello
ef6f80221e Add preview image support in ShaderRenderer
In this way we can see the real-time feedback when we're drawing when
we use the ShaderRenderer.
2023-04-03 15:59:29 -03:00
David Capello
3dbf88c9cd Ignore hidden layers in ShaderRenderer 2023-04-03 15:59:29 -03:00
David Capello
8c7b94a934 Add support to render the background directly on screen
Renderer::renderCheckeredBackground() function was used only for the
FullscreenPreviewCommand, but now we use
ShaderRenderer::renderCheckeredBackground() to render the background
in the Editor too. So the sprite is painted in a backbuffer and then
composited with the already painted background using
Graphics::drawSurface().
2023-04-03 15:59:29 -03:00
David Capello
3c099dc4dc Add support to cel/layer opacity + some blend modes 2023-04-03 15:59:29 -03:00
David Capello
f621472b7c Draw cels creating a SkShader from SkImage directly from the doc::Image data 2023-04-03 15:59:29 -03:00
David Capello
be583f8149 Add initial (incomplete) version of ShaderRenderer
This new renderer uses a shader to paint only the checkered
background. It can be tested only in ENABLE_DEVMODE and pressing F1
key to switch between the renderers (which is a devmode special key
for testing purposes only)

We've changed the Renderer::renderSprite(Image*, ...) member function
to renderSprite(os::Surface*, ...) so we receive the os::Surface
directly to paint the SkCanvas with a SkShader. Probably more
refactors will be needed.
2023-04-03 15:59:29 -03:00
Martín Capello
a7e155a391 Hide small preview window when going full screen preview (fix #3762) 2023-04-03 15:36:04 -03:00
David Capello
4c1e5d8755 Add a test for -save-as with -filename-format and -split-tags
Test case for the issue commented here: https://github.com/aseprite/aseprite/issues/3733#issuecomment-1494682407
2023-04-03 14:09:03 -03:00
David Capello
83ddb6018e Minor change in FileOp::createSaveDocumentOperation() 2023-04-03 14:08:21 -03:00
Gaspar Capello
b83afb4daa Fix scrolling through tile entries without tilemap layer selected crashes the program (fix #3712) 2023-03-30 11:06:59 -03:00
Gaspar Capello
733f7ec2c2 Fix selecting a frame on the timeline (with left click), and immediately right clicking it, will be taken as double click (fix #3713) 2023-03-28 14:29:57 -03:00
Martín Capello
961dc46066 Avoid dialog's window relayout during an ongoing window's size change 2023-03-28 14:09:03 -03:00
Martín Capello
5fb0b72c73 Fix hexpand and vexpand setting 2023-03-28 13:54:02 -03:00
Gaspar Capello
8f515da9f0 Fix 8 Connected Fill escapes grid with "Stop At Grid" checked (fix #3564) 2023-03-28 13:45:33 -03:00
David Capello
8247d53642 Enable several ShowSomething commands in non-UI environments
This is to allow using ShowGrid in test cases when the UI is not
available (most of these commands only modify the preferences).
2023-03-28 13:42:34 -03:00
David Capello
668a3d8159 Remove the marching ants effect from Timeline after paste
This is a simple fix for a recurrent problem where users don't know
how to remove/deselect the copied selection from the timeline after
pressing Ctrl+C. Generally the solution is pressing the Escape key,
but just pasting with Ctrl+V in some destination will disable the
effect now (just like spreadsheet apps work).

Related to:
https://community.aseprite.org/t/3941
https://community.aseprite.org/t/5038
https://community.aseprite.org/t/17281
https://github.com/aseprite/aseprite/issues/1498
2023-03-27 20:46:52 -03:00
Gaspar Capello
637632eafb [lua] Add blend modes to Image:drawImage() 2023-03-27 20:31:58 -03:00
David Capello
ff9f60a8be Add more glyphs to aseprite_font.png (Cyrillic script is back)
Some glyphs are from an old Aseprite version with Cyrillic alphabet,
but I have complete it with some extra chars (e.g. Maltenese #3699).
Still a work-in-progress.

Related to:
https://community.aseprite.org/t/russian-language-aseprite/1851
https://community.aseprite.org/t/cyrillic-font-on-macos/4078
2023-03-27 19:49:40 -03:00
David Capello
af9f7288ee [lua] Add 'ondblclick' event for canvas widget 2023-03-27 14:22:10 -03:00
David Capello
11abe10c20 Add ability to use mnemonic without modifiers in alerts
Requested in https://community.aseprite.org/t/16845
2023-03-23 16:15:51 -03:00
David Capello
53c851c547 [lua] Add GraphicsContext:oval() function 2023-03-23 14:56:01 -03:00
David Capello
44729b27a7 Fix compilation when !ENABLE_UI 2023-03-23 14:48:30 -03:00
David Capello
78de8dfa56 [lua] Add app.theme:styleMetrics() function 2023-03-23 14:11:51 -03:00
David Capello
0c092cc37c Fix changing playback speed shouldn't stop the animation playback
Regression introduced in 30a88c8e3d
2023-03-22 18:39:29 -03:00
David Capello
1f7f3677f2 Play subtags + repeat field by default to avoid surprises
If we start playing from a tag with a repeat field, we'll just play
the tag as many times it says and continue with the regular animation
of the sprite. Users expect the repeat field to be useful with the
default configuration of the program.
2023-03-22 15:14:41 -03:00
David Capello
63a387d804 Fix crash right-clicking play button in the preview window is hidden
Regression introduced in 30a88c8e3d
2023-03-22 15:05:29 -03:00
David Capello
e865374805 Fix bug saving tags in file sequences using -save-as "{tag}_1.png"
Now the equivalent was "{tag}_{frame1}.png", but it looks like a
regression reported here https://community.aseprite.org/t/17253 were
it was possible to just specify the frame number as in "{tag}_1.png"
2023-03-22 14:35:52 -03:00
David Capello
30a88c8e3d Put playback options into Frame > Playback submenu
This menu was accessible right-clicking the Play button in the
Timeline (and in the Preview window, with specific options for the
Preview).

This change includes some changes:

1. Now if a menu <item> in gui.xml doesn't specify a text field, the
   text of the command is used (to avoid double translation, the bad
   side is that we don't have a mnemonic specified).
2. Menu::showPopup() can be used with submenus from the root menu, to
   do this we have to remove the menu item owner temporarily before we
   show the menu as popup (see the change in Menu::showPopup())
3. We can specify a special active DocView for commands with
   UIContext::SetTargetView, this is used to set the Preview editor as
   active view for commands like TogglePlayOnce, etc.
2023-03-21 17:18:05 -03:00
David Capello
0dbcdc8159 [lua] Add app.uiScale property 2023-03-20 18:26:44 -03:00