This commit is contained in:
2016-07-26 22:23:44 +07:00
parent dcb50f002b
commit bbb2e3e741
9 changed files with 28 additions and 6 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 78dd883487f0e4a3281308f1e4c7b131
timeCreated: 1469337635
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 68ed33ba61a1243f99660fd4aa9e4777
timeCreated: 1469371596
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -100,9 +100,15 @@ namespace FlashTools.Internal {
var bitmap_matrix = i < shape_def.Matrices.Length ? shape_def.Matrices[i] : SwfMatrix.identity;
var bitmap_def = ctx.Library.FindDefine<SwfLibraryBitmapDefine>(bitmap_id);
if ( bitmap_def != null ) {
var global_depth = (parent_depth + inst.Depth);
var local_clip_depth = (parent_clip_depth != 0 ? parent_clip_depth : inst.ClipDepth);
var global_clip_depth = (parent_clip_depth != 0 ? parent_clip_depth : (local_clip_depth != 0 ? (global_depth + local_clip_depth - 1) : 0));
Debug.LogFormat("--- Depth: {0}, ClipDepth: {1}", global_depth, global_clip_depth);
frame.Instances.Add(new SwfAnimationInstanceData{
Depth = (ushort)(parent_depth + inst.Depth),
ClipDepth = (ushort)(parent_clip_depth != 0 ? parent_clip_depth : inst.ClipDepth),
Depth = (ushort)global_depth,
ClipDepth = (ushort)global_clip_depth,
Bitmap = bitmap_id,
Matrix = parent_matrix * inst.Matrix.ToUnityMatrix() * bitmap_matrix.ToUnityMatrix(),
ColorTransform = parent_color_transform * inst.ColorTransform.ToAnimationColorTransform()});

View File

@@ -97,7 +97,7 @@ namespace FlashTools.Internal.SwfTools {
get { return SwfDisplayInstanceType.Sprite; }
}
public void ResetTag() {
public void Reset() {
CurrentTag = 0;
DisplayList = new SwfDisplayList();
}

View File

@@ -170,7 +170,7 @@ namespace FlashTools.Internal.SwfTools {
var sprite_def = MainContex.Library.FindDefine<SwfLibrarySpriteDefine>(sprite.Id);
if ( sprite_def != null ) {
if ( sprite.CurrentTag >= sprite_def.ControlTags.Tags.Count ) {
sprite.ResetTag();
sprite.Reset();
}
var sprite_executer = new SwfContextExecuter(MainContex, sprite.CurrentTag);
sprite_executer.NextFrame(sprite_def.ControlTags.Tags, sprite.DisplayList);

View File

@@ -157,7 +157,7 @@ namespace FlashTools {
} else {
var last_group = _groups[_groups.Count - 1];
if ( last_group.Type == GroupType.Mask ) {
if ( inst.Depth < last_group.ClipDepth ) {
if ( inst.Depth <= last_group.ClipDepth ) {
var gr = new Group();
gr.Type = GroupType.Masked;
gr.Triangles = new List<int>();
@@ -171,7 +171,7 @@ namespace FlashTools {
_groups.Add(gr);
}
} else if ( last_group.Type == GroupType.Masked ) {
if ( inst.Depth < last_group.ClipDepth ) {
if ( inst.Depth <= last_group.ClipDepth ) {
// nothing
} else {
var gr = new Group();