warning on filters

This commit is contained in:
2016-10-01 03:51:10 +07:00
parent 37230465b7
commit 5718916aeb
4 changed files with 18 additions and 1 deletions

View File

@@ -116,6 +116,16 @@ namespace FlashTools.Internal {
List<SwfInstanceData> parent_masks,
SwfFrameData frame)
{
var inst_filter_types = display_list.Instances.Values
.Where(p => p.Visible && p.FilterList.Filters.Count > 0)
.SelectMany(p => p.FilterList.Filters)
.Select(p => p.Type)
.Distinct();
foreach ( var filter_type in inst_filter_types ) {
Debug.LogWarningFormat(
"<b>[FlashTools]</b> SwfSurfaceFilters. Unsupported filter type '{0}'",
filter_type);
}
var self_masks = new List<SwfInstanceData>();
foreach ( var inst in display_list.Instances.Values.Where(p => p.Visible) ) {
CheckSelfMasks(self_masks, inst.Depth, frame);

View File

@@ -83,6 +83,7 @@ namespace FlashTools.Internal.SwfTools {
public bool Visible;
public SwfMatrix Matrix;
public SwfBlendMode BlendMode;
public SwfSurfaceFilters FilterList;
public SwfColorTransform ColorTransform;
}

View File

@@ -45,6 +45,7 @@ namespace FlashTools.Internal.SwfTools {
new_inst.Visible = true;
new_inst.Matrix = tag.Matrix;
new_inst.BlendMode = SwfBlendMode.identity;
new_inst.FilterList = SwfSurfaceFilters.identity;
new_inst.ColorTransform = tag.ColorTransform;
dl.Instances.Add(new_inst.Depth, new_inst);
}
@@ -79,6 +80,7 @@ namespace FlashTools.Internal.SwfTools {
new_inst.Visible = true;
new_inst.Matrix = tag.HasMatrix ? tag.Matrix : (old_inst != null ? old_inst.Matrix : SwfMatrix.identity);
new_inst.BlendMode = SwfBlendMode.identity;
new_inst.FilterList = SwfSurfaceFilters.identity;
new_inst.ColorTransform = tag.HasColorTransform ? tag.ColorTransform : (old_inst != null ? old_inst.ColorTransform : SwfColorTransform.identity);
dl.Instances.Add(new_inst.Depth, new_inst);
}
@@ -127,6 +129,7 @@ namespace FlashTools.Internal.SwfTools {
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.BlendMode = tag.HasBlendMode ? tag.BlendMode : (old_inst != null ? old_inst.BlendMode : SwfBlendMode.identity);
new_inst.FilterList = tag.HasFilterList ? tag.SurfaceFilters : (old_inst != null ? old_inst.FilterList : SwfSurfaceFilters.identity);
new_inst.ColorTransform = tag.HasColorTransform ? tag.ColorTransform : (old_inst != null ? old_inst.ColorTransform : SwfColorTransform.identity);
dl.Instances.Add(new_inst.Depth, new_inst);
}
@@ -145,6 +148,9 @@ namespace FlashTools.Internal.SwfTools {
if ( tag.HasBlendMode ) {
inst.BlendMode = tag.BlendMode;
}
if ( tag.HasFilterList ) {
inst.FilterList = tag.SurfaceFilters;
}
if ( tag.HasColorTransform ) {
inst.ColorTransform = tag.ColorTransform;
}

View File

@@ -65,7 +65,7 @@ namespace FlashTools.Internal.SwfTools.SwfTypes {
return new SwfBlendModeData(SwfBlendModeData.Types.Hardlight);
default:
Debug.LogWarningFormat(
"<b>[FlashTools]</b> SwfBlendMode. Unsupported blend mode {0}",
"<b>[FlashTools]</b> SwfBlendMode. Unsupported blend mode '{0}'",
Value);
return new SwfBlendModeData(SwfBlendModeData.Types.Normal);
}