mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-25 23:37:05 +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();
|
||||
}
|
||||
|
||||
// TODO could we use doc::read_layer() here?
|
||||
Layer* readLayer(std::ifstream& s) {
|
||||
LayerFlags flags = (LayerFlags)read32(s);
|
||||
ObjectType type = (ObjectType)read16(s);
|
||||
@ -315,6 +316,10 @@ private:
|
||||
lay->setName(name);
|
||||
lay->setFlags(flags);
|
||||
|
||||
// Blend mode & opacity
|
||||
lay->setBlendMode((BlendMode)read16(s));
|
||||
lay->setOpacity(read8(s));
|
||||
|
||||
// Cels
|
||||
int ncels = read32(s);
|
||||
for (int i=0; i<ncels; ++i) {
|
||||
|
@ -190,6 +190,10 @@ private:
|
||||
CelConstIterator it, begin = static_cast<const LayerImage*>(lay)->getCelBegin();
|
||||
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
|
||||
write32(s, static_cast<const LayerImage*>(lay)->getCelsCount());
|
||||
for (it=begin; it != end; ++it) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user