Skip to content
Permalink
Browse files

complete

  • Loading branch information
yinqiang committed May 13, 2013
1 parent d758152 commit 58d7e46bae571aedd6079e165de902f92c55ab96
Showing with 99 additions and 63 deletions.
  1. +53 −53 .actionScriptProperties
  2. +14 −2 src/Atf2png.as
  3. +31 −7 src/Main.as
  4. +1 −1 src/polly/atf2png/FileUtil.as
@@ -1,53 +1,53 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<actionScriptProperties analytics="false" mainApplicationPath="Atf2png.as" projectUUID="bacdd971-679f-4e7d-9556-3121362f5223" version="10">
<compiler additionalCompilerArguments="-locale en_US -swf-version=17" autoRSLOrdering="true" copyDependentFiles="true" flexSDK="Flex 4.6.0 AIR 3.5" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="true" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
<compilerSourcePath/>
<libraryPath defaultLinkType="0">
<libraryPathEntry kind="4" path="">
<excludedEntries>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_charts.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="1" linkType="1" path="${PROJECT_FRAMEWORKS}/locale/{locale}"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/advancedgrids.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/charts.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_air.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/air/airspark.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/mx/mx.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/netmon.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/spark.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/sparkskins.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/rpc.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/videoPlayer.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp_air.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/datavisualization.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/spark_dmv.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flash-integration.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/air/airframework.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/>
</excludedEntries>
</libraryPathEntry>
</libraryPath>
<sourceAttachmentPath/>
</compiler>
<applications>
<application path="Atf2png.as">
<airExcludes/>
</application>
</applications>
<modules/>
<buildCSSFiles/>
<flashCatalyst validateFlashCatalystCompatibility="false"/>
<buildTargets>
<buildTarget buildTargetName="default">
<airSettings airCertificatePath="" airTimestamp="true" anePathSet="false" version="1">
<airExcludes/>
<anePaths/>
</airSettings>
<actionScriptSettings version="1"/>
</buildTarget>
</buildTargets>
</actionScriptProperties>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<actionScriptProperties analytics="false" mainApplicationPath="Atf2png.as" projectUUID="bacdd971-679f-4e7d-9556-3121362f5223" version="10">
<compiler additionalCompilerArguments="-locale en_US -swf-version=17" autoRSLOrdering="true" copyDependentFiles="true" flexSDK="Flex 4.6.0 air 3.5" fteInMXComponents="false" generateAccessible="true" htmlExpressInstall="true" htmlGenerate="false" htmlHistoryManagement="false" htmlPlayerVersionCheck="true" includeNetmonSwc="false" outputFolderPath="bin-debug" removeUnusedRSL="true" sourceFolderPath="src" strict="true" targetPlayerVersion="0.0.0" useApolloConfig="true" useDebugRSLSwfs="true" verifyDigests="true" warn="true">
<compilerSourcePath/>
<libraryPath defaultLinkType="0">
<libraryPathEntry kind="4" path="">
<excludedEntries>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_charts.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="1" linkType="1" path="${PROJECT_FRAMEWORKS}/locale/{locale}"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/advancedgrids.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/charts.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_air.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/air/airspark.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/framework.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/mx/mx.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/netmon.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/spark.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/sparkskins.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/rpc.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/videoPlayer.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/qtp_air.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/datavisualization.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/spark_dmv.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/flash-integration.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_dmv.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/air/airframework.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_flashflexkit.swc" useDefaultLinkType="false"/>
<libraryPathEntry kind="3" linkType="1" path="${PROJECT_FRAMEWORKS}/libs/automation_agent.swc" useDefaultLinkType="false"/>
</excludedEntries>
</libraryPathEntry>
</libraryPath>
<sourceAttachmentPath/>
</compiler>
<applications>
<application path="Atf2png.as">
<airExcludes/>
</application>
</applications>
<modules/>
<buildCSSFiles/>
<flashCatalyst validateFlashCatalystCompatibility="false"/>
<buildTargets>
<buildTarget buildTargetName="default">
<airSettings airCertificatePath="" airTimestamp="true" anePathSet="false" version="1">
<airExcludes/>
<anePaths/>
</airSettings>
<actionScriptSettings version="1"/>
</buildTarget>
</buildTargets>
</actionScriptProperties>
@@ -3,19 +3,31 @@ package
import flash.display.Sprite;
import flash.events.Event;
import flash.geom.Rectangle;
import flash.text.TextField;

import starling.core.Starling;
import starling.core.Starling;

[SWF(width="2048", height="2048")]

public class Atf2png extends Sprite
{
public static var isDebug:Boolean = false;

private var txLog:TextField;
private var mStarling:Starling;

public function Atf2png()
{
if (stage) {
init(null);
} else {
addEventListener(Event.ADDED_TO_STAGE, init);
}
}

private function init(e:Event):void {
removeEventListener(Event.ADDED_TO_STAGE, init);

Starling.multitouchEnabled = false;

var viewPort:Rectangle = new Rectangle(0, 0, stage.stageWidth, stage.stageHeight);
@@ -26,7 +38,7 @@ package
mStarling.stage3D.addEventListener(Event.CONTEXT3D_CREATE, onContextCreated);
}

private function onContextCreated(e:Event):void
private function onContextCreated(e:flash.events.Event):void
{
mStarling.start();
}
@@ -1,6 +1,7 @@
package
{
import flash.display.BitmapData;
import flash.events.Event;
import flash.filesystem.File;
import flash.utils.ByteArray;

@@ -10,18 +11,39 @@ package
import starling.core.Starling;
import starling.display.Image;
import starling.display.Sprite;
import starling.textures.Texture;
import starling.text.TextField;
import starling.textures.Texture;

public class Main extends Sprite
{
private var img:Image;
private var curFileName:String;
private var files:Array;
private var index:int;
private var inportDir:File;
private var exportDir:File;

public function Main()
{
files = File.applicationDirectory.resolvePath('atfs').getDirectoryListing();
inportDir = new File();
inportDir.addEventListener(Event.SELECT, onInportDirSelected);
inportDir.browseForDirectory("导入");
}

private function onInportDirSelected(e:Event):void {
exportDir = new File();
exportDir.addEventListener(Event.SELECT, onExportDirSelected);
exportDir.browseForDirectory("导出");
}

private function onExportDirSelected(e:Event):void {
files = inportDir.getDirectoryListing();
for (var i:int=0; i<files.length; i++) {
if (String(files[i].type).toLowerCase() != '.atf') {
files.splice(i, 1);
i--;
}
}
index = 0;
loadFile(index);
}
@@ -55,16 +77,18 @@ package

Starling.context.drawToBitmapData(bd);
Starling.context.present();
var f:File = File.desktopDirectory.resolvePath('pngs/' + curFileName + '.png');
FileUtil.savePNGFile(bd, f);
trace('>', curFileName + '.png');
var file:File = exportDir.resolvePath(curFileName + '.png');
FileUtil.savePNGFile(bd, file);
trace('>', file.name);
} catch (e:Error) {
trace('!', curFileName);
trace('!', e);
}
index ++;
if (index == files.length) {
trace('done');

removeChildren();
var tx:TextField = new TextField(300, 50, "全部完成", "微软雅黑", 30, 0, true);
addChild(tx);
} else {
loadFile(index);
}
@@ -81,7 +81,7 @@ package polly.atf2png
}

var bytes:ByteArray = new ByteArray();
// bytes.endian = Endian.LITTLE_ENDIAN;
bytes.endian = Endian.LITTLE_ENDIAN;
var fs:FileStream = new FileStream();
fs.open(file, FileMode.READ);
fs.readBytes(bytes);

9 comments on commit 58d7e46

@yinqiang

This comment has been minimized.

Copy link
Owner Author

yinqiang replied Oct 29, 2013

@yinqiang

This comment has been minimized.

Copy link
Owner Author

yinqiang replied Oct 29, 2013

@yinqiang

This comment has been minimized.

Copy link
Owner Author

yinqiang replied Oct 29, 2013

@yinqiang

This comment has been minimized.

Copy link
Owner Author

yinqiang replied Dec 6, 2013

@yinqiang

This comment has been minimized.

Copy link
Owner Author

yinqiang replied Dec 6, 2013

I send Atf2png.air. You can try.

@yinqiang

This comment has been minimized.

Copy link
Owner Author

yinqiang replied Dec 8, 2013

Thank you ! :-)
I'm commit a new branch(develop-atf0.6) for compatible ATF v6

@yinqiang

This comment has been minimized.

Copy link
Owner Author

yinqiang replied Dec 16, 2013

Thank you, xenocracy!

atf v0.6 depend on Game SDK 1.2+
I'm upgrade FlashBuilder to 4.7, and push all change to master branch
And alliance0.atf tested! :-)

@yinqiang

This comment has been minimized.

Copy link
Owner Author

yinqiang replied Dec 18, 2013

@yinqiang

This comment has been minimized.

Copy link
Owner Author

yinqiang replied Dec 19, 2013

Please sign in to comment.
You can’t perform that action at this time.