mirror of
https://github.com/BlackMATov/unity-flash-tools.git
synced 2026-03-22 04:44:08 +07:00
warning log for swf tools
This commit is contained in:
@@ -82,8 +82,10 @@ namespace FlashTools.Internal {
|
||||
static SwfSymbolData LoadSymbol(
|
||||
string symbol_name, SwfLibrary library, List<SwfTagBase> tags)
|
||||
{
|
||||
var disp_lst = new SwfDisplayList();
|
||||
var executer = new SwfContextExecuter(library, 0);
|
||||
var disp_lst = new SwfDisplayList();
|
||||
var executer = new SwfContextExecuter(library, 0, warning_msg => {
|
||||
Debug.LogWarningFormat("<b>[FlashTools]</b> {0}", warning_msg);
|
||||
});
|
||||
var symbol_frames = new List<SwfFrameData>();
|
||||
while ( executer.NextFrame(tags, disp_lst) ) {
|
||||
symbol_frames.Add(LoadSymbolFrameData(library, disp_lst));
|
||||
|
||||
@@ -6,12 +6,14 @@ using SwfTools.SwfTypes;
|
||||
|
||||
namespace SwfTools {
|
||||
public class SwfContextExecuter : SwfTagVisitor<SwfDisplayList, SwfDisplayList> {
|
||||
public SwfLibrary Library = null;
|
||||
public int CurrentTag = 0;
|
||||
public SwfLibrary Library = null;
|
||||
public int CurrentTag = 0;
|
||||
public System.Action<string> WarningLog = null;
|
||||
|
||||
public SwfContextExecuter(SwfLibrary library, int current_tag) {
|
||||
public SwfContextExecuter(SwfLibrary library, int current_tag, System.Action<string> warning_log) {
|
||||
Library = library;
|
||||
CurrentTag = current_tag;
|
||||
WarningLog = warning_log;
|
||||
}
|
||||
|
||||
public bool NextFrame(List<SwfTagBase> tags, SwfDisplayList dl) {
|
||||
@@ -283,10 +285,12 @@ namespace SwfTools {
|
||||
}
|
||||
|
||||
public SwfDisplayList Visit(UnknownTag tag, SwfDisplayList dl) {
|
||||
TagToWarningLog(tag);
|
||||
return dl;
|
||||
}
|
||||
|
||||
public SwfDisplayList Visit(UnsupportedTag tag, SwfDisplayList dl) {
|
||||
TagToWarningLog(tag);
|
||||
return dl;
|
||||
}
|
||||
|
||||
@@ -294,6 +298,12 @@ namespace SwfTools {
|
||||
//
|
||||
//
|
||||
|
||||
void TagToWarningLog(SwfTagBase tag) {
|
||||
if ( WarningLog != null ) {
|
||||
WarningLog(string.Format("SwfContextExecuter: {0}", tag));
|
||||
}
|
||||
}
|
||||
|
||||
void AddShapesToLibrary(ushort define_id, SwfShapesWithStyle shapes) {
|
||||
var bitmap_styles = shapes.FillStyles.Where(p => p.Type.IsBitmapType);
|
||||
var define = new SwfLibraryShapeDefine{
|
||||
@@ -358,7 +368,7 @@ namespace SwfTools {
|
||||
if ( IsSpriteTimelineEnd(sprite) ) {
|
||||
sprite.Reset();
|
||||
}
|
||||
var sprite_executer = new SwfContextExecuter(Library, sprite.CurrentTag);
|
||||
var sprite_executer = new SwfContextExecuter(Library, sprite.CurrentTag, WarningLog);
|
||||
sprite_executer.NextFrame(sprite_def.ControlTags.Tags, sprite.DisplayList);
|
||||
sprite.CurrentTag = sprite_executer.CurrentTag;
|
||||
}
|
||||
|
||||
@@ -1,10 +1,6 @@
|
||||
<Properties>
|
||||
<MonoDevelop.Ide.Workspace ActiveConfiguration="Debug" />
|
||||
<MonoDevelop.Ide.Workbench ActiveDocument="Assets/FlashTools/CHANGELOG.txt">
|
||||
<Files>
|
||||
<File FileName="Assets/FlashTools/CHANGELOG.txt" Line="10" Column="18" />
|
||||
</Files>
|
||||
</MonoDevelop.Ide.Workbench>
|
||||
<MonoDevelop.Ide.Workbench />
|
||||
<MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
<BreakpointStore />
|
||||
</MonoDevelop.Ide.DebuggingService.Breakpoints>
|
||||
|
||||
Reference in New Issue
Block a user