mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-29 01:20:17 +00:00
Save/restore opacity & blend mode correctly from recovery data
This commit is contained in:
parent
d1508ce119
commit
fe5d3236a3
@ -302,6 +302,7 @@ private:
|
|||||||
return spr.release();
|
return spr.release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO could we use doc::read_layer() here?
|
||||||
Layer* readLayer(std::ifstream& s) {
|
Layer* readLayer(std::ifstream& s) {
|
||||||
LayerFlags flags = (LayerFlags)read32(s);
|
LayerFlags flags = (LayerFlags)read32(s);
|
||||||
ObjectType type = (ObjectType)read16(s);
|
ObjectType type = (ObjectType)read16(s);
|
||||||
@ -315,6 +316,10 @@ private:
|
|||||||
lay->setName(name);
|
lay->setName(name);
|
||||||
lay->setFlags(flags);
|
lay->setFlags(flags);
|
||||||
|
|
||||||
|
// Blend mode & opacity
|
||||||
|
lay->setBlendMode((BlendMode)read16(s));
|
||||||
|
lay->setOpacity(read8(s));
|
||||||
|
|
||||||
// Cels
|
// Cels
|
||||||
int ncels = read32(s);
|
int ncels = read32(s);
|
||||||
for (int i=0; i<ncels; ++i) {
|
for (int i=0; i<ncels; ++i) {
|
||||||
|
@ -190,6 +190,10 @@ private:
|
|||||||
CelConstIterator it, begin = static_cast<const LayerImage*>(lay)->getCelBegin();
|
CelConstIterator it, begin = static_cast<const LayerImage*>(lay)->getCelBegin();
|
||||||
CelConstIterator end = static_cast<const LayerImage*>(lay)->getCelEnd();
|
CelConstIterator end = static_cast<const LayerImage*>(lay)->getCelEnd();
|
||||||
|
|
||||||
|
// Blend mode & opacity
|
||||||
|
write16(s, (int)static_cast<const LayerImage*>(lay)->blendMode());
|
||||||
|
write8(s, static_cast<const LayerImage*>(lay)->opacity());
|
||||||
|
|
||||||
// Cels
|
// Cels
|
||||||
write32(s, static_cast<const LayerImage*>(lay)->getCelsCount());
|
write32(s, static_cast<const LayerImage*>(lay)->getCelsCount());
|
||||||
for (it=begin; it != end; ++it) {
|
for (it=begin; it != end; ++it) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user