empty abc tag

This commit is contained in:
2016-09-02 20:45:00 +07:00
parent 711bc09355
commit afe588ef47
6 changed files with 55 additions and 9 deletions

View File

@@ -66,6 +66,7 @@
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfTools\SwfTags\DefineShape4Tag.cs" />
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfTools\SwfTags\DefineShapeTag.cs" />
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfTools\SwfTags\DefineSpriteTag.cs" />
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfTools\SwfTags\DoABCTag.cs" />
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfTools\SwfTags\EndTag.cs" />
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfTools\SwfTags\ExportAssetsTag.cs" />
<Compile Include="Assets\FlashTools\Scripts\Internal\Editor\SwfTools\SwfTags\FileAttributesTag.cs" />

View File

@@ -18,7 +18,7 @@ namespace FlashTools.Internal.SwfTools {
dl.FrameName = string.Empty;
while ( CurrentTag < tags.Count ) {
var tag = tags[CurrentTag++];
//TagToDebugLog(tag);
TagToDebugLog(tag);
tag.AcceptVistor(this, dl);
if ( tag.TagType == SwfTagType.ShowFrame ) {
ChildrenNextFrameLooped(dl);
@@ -198,6 +198,10 @@ namespace FlashTools.Internal.SwfTools {
return dl;
}
public SwfDisplayList Visit(DoABCTag tag, SwfDisplayList dl) {
return dl;
}
public SwfDisplayList Visit(DefineShapeTag tag, SwfDisplayList dl) {
AddShapesToLibrary(tag.ShapeId, tag.Shapes);
return dl;
@@ -318,12 +322,8 @@ namespace FlashTools.Internal.SwfTools {
}
void TagToDebugLog(SwfTagBase tag) {
if ( tag is UnsupportedTag ) {
Debug.LogError(tag);
} else if ( tag is UnknownTag ) {
Debug.LogWarning(tag);
} else {
Debug.Log(tag);
if ( tag is UnsupportedTag || tag is UnknownTag ) {
Debug.LogWarningFormat("SwfContextExecuter. {0}", tag);
}
}
}

View File

@@ -0,0 +1,32 @@
using FlashTools.Internal.SwfTools.SwfTypes;
namespace FlashTools.Internal.SwfTools.SwfTags {
public class DoABCTag : SwfTagBase {
public bool ExecuteImmediately;
public string Name;
public byte[] ABCBytes;
public override SwfTagType TagType {
get { return SwfTagType.DoABC; }
}
public override TResult AcceptVistor<TArg, TResult>(SwfTagVisitor<TArg, TResult> visitor, TArg arg) {
return visitor.Visit(this, arg);
}
public override string ToString() {
return "DoABCTag.";
}
public static DoABCTag Create(SwfStreamReader reader) {
const int kDoAbcLazyInitializeFlag = 1;
var flags = reader.ReadUInt32();
var name = reader.ReadString();
var abc_bytes = reader.ReadRest();
return new DoABCTag{
ExecuteImmediately = (flags & kDoAbcLazyInitializeFlag) == 0,
Name = name,
ABCBytes = abc_bytes};
}
}
}

View File

@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: 1644c7cd661b049a0afab118c09d69a5
timeCreated: 1472819662
licenseType: Free
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -37,7 +37,7 @@
DoAction = 12, // Unsupported
DoInitAction = 59, // Unsupported
DoABC = 82, // Unsupported
DoABC = 82,
// -----------------------------
// Shape
@@ -175,7 +175,7 @@
// Actions
case (int)SwfTagType.DoAction: return UnsupportedTag.Create(SwfTagType.DoAction);
case (int)SwfTagType.DoInitAction: return UnsupportedTag.Create(SwfTagType.DoInitAction);
case (int)SwfTagType.DoABC: return UnsupportedTag.Create(SwfTagType.DoABC);
case (int)SwfTagType.DoABC: return DoABCTag.Create(reader);
// Shape
case (int)SwfTagType.DefineShape: return DefineShapeTag.Create(reader);
case (int)SwfTagType.DefineShape2: return DefineShape2Tag.Create(reader);

View File

@@ -12,6 +12,7 @@
TResult Visit(ExportAssetsTag tag, TArg arg);
TResult Visit(SymbolClassTag tag, TArg arg);
TResult Visit(DefineSceneAndFrameLabelDataTag tag, TArg arg);
TResult Visit(DoABCTag tag, TArg arg);
TResult Visit(DefineShapeTag tag, TArg arg);
TResult Visit(DefineShape2Tag tag, TArg arg);
TResult Visit(DefineShape3Tag tag, TArg arg);