hide mask bitmaps

This commit is contained in:
2016-07-18 23:44:17 +06:00
parent 93f34dfd99
commit 9d9f4aec85
4 changed files with 15 additions and 4 deletions

View File

@@ -82,7 +82,7 @@ namespace FlashTools.Internal {
Matrix4x4 parent_matrix, SwfAnimationColorTransform parent_color_transform,
SwfAnimationFrameData frame)
{
foreach ( var inst in dl.Instances.Values.Where(p => p.Visible) ) {
foreach ( var inst in dl.Instances.Values.Where(p => p.Visible && p.ClipDepth == 0) ) {
switch ( inst.Type ) {
case SwfDisplayInstanceType.Shape:
var shape_def = ctx.Library.FindDefine<SwfLibraryShapeDefine>(inst.Id);

View File

@@ -77,6 +77,7 @@ namespace FlashTools.Internal.SwfTools {
public ushort Id;
public ushort Depth;
public ushort ClipDepth;
public bool Visible;
public SwfMatrix Matrix;
public SwfColorTransform ColorTransform;

View File

@@ -41,6 +41,7 @@ namespace FlashTools.Internal.SwfTools {
if ( new_inst != null ) {
new_inst.Id = tag.CharacterId;
new_inst.Depth = tag.Depth;
new_inst.ClipDepth = 0;
new_inst.Visible = true;
new_inst.Matrix = tag.Matrix;
new_inst.ColorTransform = tag.ColorTransform;
@@ -74,14 +75,18 @@ namespace FlashTools.Internal.SwfTools {
if ( new_inst != null ) {
new_inst.Id = tag.CharacterId;
new_inst.Depth = tag.Depth;
new_inst.ClipDepth = tag.HasClipDepth ? tag.ClipDepth : (old_inst != null ? old_inst.ClipDepth : (ushort)0);
new_inst.Visible = true;
new_inst.Matrix = tag.HasMatrix ? tag.Matrix : (old_inst != null ? old_inst.Matrix : SwfMatrix.identity );
new_inst.Matrix = tag.HasMatrix ? tag.Matrix : (old_inst != null ? old_inst.Matrix : SwfMatrix.identity);
new_inst.ColorTransform = tag.HasColorTransform ? tag.ColorTransform : (old_inst != null ? old_inst.ColorTransform : SwfColorTransform.identity);
dl.Instances.Add(new_inst.Depth, new_inst);
}
} else if ( tag.Move ) { // move character
SwfDisplayInstance inst;
if ( dl.Instances.TryGetValue(tag.Depth, out inst) ) {
if ( tag.HasClipDepth ) {
inst.ClipDepth = tag.ClipDepth;
}
if ( tag.HasMatrix ) {
inst.Matrix = tag.Matrix;
}
@@ -118,14 +123,18 @@ namespace FlashTools.Internal.SwfTools {
if ( new_inst != null ) {
new_inst.Id = tag.CharacterId;
new_inst.Depth = tag.Depth;
new_inst.Visible = tag.HasVisible ? tag.Visible : (old_inst != null ? old_inst.Visible : true );
new_inst.Matrix = tag.HasMatrix ? tag.Matrix : (old_inst != null ? old_inst.Matrix : SwfMatrix.identity );
new_inst.ClipDepth = tag.HasClipDepth ? tag.ClipDepth : (old_inst != null ? old_inst.ClipDepth : (ushort)0);
new_inst.Visible = tag.HasVisible ? tag.Visible : (old_inst != null ? old_inst.Visible : true);
new_inst.Matrix = tag.HasMatrix ? tag.Matrix : (old_inst != null ? old_inst.Matrix : SwfMatrix.identity);
new_inst.ColorTransform = tag.HasColorTransform ? tag.ColorTransform : (old_inst != null ? old_inst.ColorTransform : SwfColorTransform.identity);
dl.Instances.Add(new_inst.Depth, new_inst);
}
} else if ( tag.Move ) { // move character
SwfDisplayInstance inst;
if ( dl.Instances.TryGetValue(tag.Depth, out inst) ) {
if ( tag.HasClipDepth ) {
inst.ClipDepth = tag.ClipDepth;
}
if ( tag.HasVisible ) {
inst.Visible = tag.Visible;
}

View File

@@ -220,6 +220,7 @@ if (!Function.prototype.bind) {
ftdoc.export_swf = function (document) {
ft.type_assert(document, Document);
ft.trace_fmt("Export swf: {0}", document.name);
document.exportSWF(ftdoc.get_swf_export_path(document));
};