This is the first attempt to finally implement the require() function
on Lua. The main problem was how to solve conflicts between plugins
that use the same library name. Here we separate each plugin like in a
namespace, so require(name) inside a plugin will save the module in
_LOADED["pluginName/libraryName"] to avoid conflicts with other
libraryName from other plugins.
We receive kMouseMoveMessage as the first message of a multiselect
message in a ListBox when the kMouseDownMessage message is received by
a separator first e.g. if we click a separator from the Recover Files
tab and start dragging the mouse this assert was failing.
Before this the ASSERT(group.items.empty()) in
AppMenus::removeMenuGroup() was failing when a plugin created
subgroups/submenus inside groups.
We have to remove plugins items in the reverse order that they were
added to uninstall them correctly.
An empty cel must be counted as a layer for the z-index ordering, so
the z-index refers to number of layers to move back/front, but number
of non-empty cels in the specific frame.
A this fix, a new issue appears: #3820
We can use:
Image:clear()
Image:clear(color)
Image:clear(rectangle)
Image:clear(rectangle, color)
If the color is not specified it will be the transparent color of the
image.
Co-authored-by: David Capello <david@igara.com>
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.
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)
* 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
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).
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.
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.
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().
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.