mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-09 18:44:46 +00:00
Merge branch 'main' into beta
This commit is contained in:
commit
66d74688e2
@ -30,13 +30,6 @@ set(CMAKE_USER_MAKE_RULES_OVERRIDE_CXX ${CMAKE_CURRENT_SOURCE_DIR}/laf/cmake/cxx
|
|||||||
# Aseprite project
|
# Aseprite project
|
||||||
project(aseprite C CXX)
|
project(aseprite C CXX)
|
||||||
|
|
||||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
|
|
||||||
# As we compile with CMAKE_OSX_DEPLOYMENT_TARGET=10.9, we have to
|
|
||||||
# explicitly say that we want to use libc++ instead of the GNU
|
|
||||||
# libstdc++
|
|
||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# Check repository status
|
# Check repository status
|
||||||
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/laf/CMakeLists.txt)
|
if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/laf/CMakeLists.txt)
|
||||||
message(FATAL_ERROR "Your Aseprite repository is incomplete, initialize submodules using:\n git submodule update --init --recursive")
|
message(FATAL_ERROR "Your Aseprite repository is incomplete, initialize submodules using:\n git submodule update --init --recursive")
|
||||||
|
2
laf
2
laf
@ -1 +1 @@
|
|||||||
Subproject commit ba02ed3e24974e8cd60ddccdac9dc3a5fa3bd6d7
|
Subproject commit d562448222c1990719f860246b5b3bcc3d2e1aa0
|
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2018-2020 Igara Studio S.A.
|
// Copyright (C) 2018-2022 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -390,18 +390,13 @@ public:
|
|||||||
return;
|
return;
|
||||||
token.set_progress(0.2f + 0.2f * i / samples.size());
|
token.set_progress(0.2f + 0.2f * i / samples.size());
|
||||||
|
|
||||||
if (sample.isLinked()) {
|
|
||||||
++i;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sample.isEmpty()) {
|
if (sample.isEmpty()) {
|
||||||
sample.setInTextureBounds(gfx::Rect(0, 0, 0, 0));
|
sample.setInTextureBounds(gfx::Rect(0, 0, 0, 0));
|
||||||
++i;
|
++i;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_mergeDups) {
|
if (m_mergeDups || sample.isLinked()) {
|
||||||
doc::ImageBufferPtr sampleBuf = std::make_shared<doc::ImageBuffer>();
|
doc::ImageBufferPtr sampleBuf = std::make_shared<doc::ImageBuffer>();
|
||||||
doc::ImageRef sampleRender(sample.createRender(sampleBuf));
|
doc::ImageRef sampleRender(sample.createRender(sampleBuf));
|
||||||
auto it = duplicates.find(sampleRender);
|
auto it = duplicates.find(sampleRender);
|
||||||
@ -527,8 +522,7 @@ public:
|
|||||||
token.set_progress_range(0.2f, 0.3f);
|
token.set_progress_range(0.2f, 0.3f);
|
||||||
token.set_progress(float(i) / samples.size());
|
token.set_progress(float(i) / samples.size());
|
||||||
|
|
||||||
if (sample.isLinked() ||
|
if (sample.isEmpty()) {
|
||||||
sample.isEmpty()) {
|
|
||||||
++i;
|
++i;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@ -609,7 +603,6 @@ void DocExporter::reset()
|
|||||||
m_listLayers = false;
|
m_listLayers = false;
|
||||||
m_listSlices = false;
|
m_listSlices = false;
|
||||||
m_documents.clear();
|
m_documents.clear();
|
||||||
m_tagDelta.clear();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DocExporter::setDocImageBuffer(const doc::ImageBufferPtr& docBuf)
|
void DocExporter::setDocImageBuffer(const doc::ImageBufferPtr& docBuf)
|
||||||
@ -912,6 +905,7 @@ void DocExporter::captureSamples(Samples& samples,
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Re-use linked samples
|
// Re-use linked samples
|
||||||
|
bool alreadyTrimmed = false;
|
||||||
if (link && m_mergeDuplicates) {
|
if (link && m_mergeDuplicates) {
|
||||||
for (const Sample& other : samples) {
|
for (const Sample& other : samples) {
|
||||||
if (token.canceled())
|
if (token.canceled())
|
||||||
@ -923,7 +917,9 @@ void DocExporter::captureSamples(Samples& samples,
|
|||||||
ASSERT(!other.isLinked());
|
ASSERT(!other.isLinked());
|
||||||
|
|
||||||
sample.setLinked();
|
sample.setLinked();
|
||||||
|
sample.setTrimmedBounds(other.trimmedBounds());
|
||||||
sample.setSharedBounds(other.sharedBounds());
|
sample.setSharedBounds(other.sharedBounds());
|
||||||
|
alreadyTrimmed = true;
|
||||||
done = true;
|
done = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -933,7 +929,6 @@ void DocExporter::captureSamples(Samples& samples,
|
|||||||
ASSERT(done || (!done && tag));
|
ASSERT(done || (!done && tag));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool alreadyTrimmed = false;
|
|
||||||
if (!done && (m_ignoreEmptyCels || m_trimCels)) {
|
if (!done && (m_ignoreEmptyCels || m_trimCels)) {
|
||||||
// Ignore empty cels
|
// Ignore empty cels
|
||||||
if (layer && layer->isImage() && !cel && m_ignoreEmptyCels)
|
if (layer && layer->isImage() && !cel && m_ignoreEmptyCels)
|
||||||
@ -969,15 +964,8 @@ void DocExporter::captureSamples(Samples& samples,
|
|||||||
|
|
||||||
// Should we ignore this empty frame? (i.e. don't include
|
// Should we ignore this empty frame? (i.e. don't include
|
||||||
// the frame in the sprite sheet)
|
// the frame in the sprite sheet)
|
||||||
if (m_ignoreEmptyCels) {
|
if (m_ignoreEmptyCels)
|
||||||
for (Tag* tag : sprite->tags()) {
|
|
||||||
auto& delta = m_tagDelta[tag->id()];
|
|
||||||
|
|
||||||
if (frame < tag->fromFrame()) --delta.first;
|
|
||||||
if (frame <= tag->toFrame()) --delta.second;
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
// Create an entry with Size(1, 1) for this completely
|
// Create an entry with Size(1, 1) for this completely
|
||||||
// trimmed frame anyway so we conserve the frame information
|
// trimmed frame anyway so we conserve the frame information
|
||||||
@ -1349,13 +1337,9 @@ void DocExporter::createDataFile(const Samples& samples,
|
|||||||
else
|
else
|
||||||
os << ",";
|
os << ",";
|
||||||
|
|
||||||
std::pair<int, int> delta(0, 0);
|
|
||||||
if (!m_tagDelta.empty())
|
|
||||||
delta = m_tagDelta[tag->id()];
|
|
||||||
|
|
||||||
os << "\n { \"name\": \"" << escape_for_json(tag->name()) << "\","
|
os << "\n { \"name\": \"" << escape_for_json(tag->name()) << "\","
|
||||||
<< " \"from\": " << (tag->fromFrame()+delta.first) << ","
|
<< " \"from\": " << (tag->fromFrame()) << ","
|
||||||
<< " \"to\": " << (tag->toFrame()+delta.second) << ","
|
<< " \"to\": " << (tag->toFrame()) << ","
|
||||||
" \"direction\": \"" << escape_for_json(convert_anidir_to_string(tag->aniDir())) << "\"";
|
" \"direction\": \"" << escape_for_json(convert_anidir_to_string(tag->aniDir())) << "\"";
|
||||||
os << tag->userData() << " }";
|
os << tag->userData() << " }";
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2019 Igara Studio S.A.
|
// Copyright (C) 2019-2022 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -21,7 +21,6 @@
|
|||||||
#include "gfx/rect.h"
|
#include "gfx/rect.h"
|
||||||
|
|
||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <map>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
@ -163,11 +162,6 @@ namespace app {
|
|||||||
bool m_listSlices;
|
bool m_listSlices;
|
||||||
Items m_documents;
|
Items m_documents;
|
||||||
|
|
||||||
// Displacement for each tag from/to frames in case we export
|
|
||||||
// them. It's used in case we trim frames outside tags and they
|
|
||||||
// will not be exported at all in the final result.
|
|
||||||
std::map<doc::ObjectId, std::pair<int, int> > m_tagDelta;
|
|
||||||
|
|
||||||
// Buffers used
|
// Buffers used
|
||||||
doc::ImageBufferPtr m_docBuf;
|
doc::ImageBufferPtr m_docBuf;
|
||||||
doc::ImageBufferPtr m_sampleBuf;
|
doc::ImageBufferPtr m_sampleBuf;
|
||||||
|
@ -115,7 +115,7 @@ app::Color Color_new(lua_State* L, int index)
|
|||||||
int a = 255;
|
int a = 255;
|
||||||
if (lua_getfield(L, index, "alpha") != LUA_TNIL)
|
if (lua_getfield(L, index, "alpha") != LUA_TNIL)
|
||||||
a = lua_tointeger(L, -1);
|
a = lua_tointeger(L, -1);
|
||||||
color = app::Color::fromHsv(lua_tonumber(L, -2),
|
color = app::Color::fromHsl(lua_tonumber(L, -2),
|
||||||
lua_tonumber(L, -3),
|
lua_tonumber(L, -3),
|
||||||
lua_tonumber(L, -4), a);
|
lua_tonumber(L, -4), a);
|
||||||
lua_pop(L, 4);
|
lua_pop(L, 4);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user