Skip to content

Commit

Permalink
Fixed Mac icon and Info.plist
Browse files Browse the repository at this point in the history
git-svn-id: https://nekonme.googlecode.com/svn/trunk@1992 1509560c-5e2a-0410-865c-31c25e1cfdef
  • Loading branch information
jgranick committed Aug 18, 2012
1 parent a0ba72d commit daa3825
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 19 deletions.
2 changes: 1 addition & 1 deletion tools/command-line/CommandLine.hxml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
-cp src
-lib nme
-lib swf
-lib gm2d
-lib svg
--remap flash:nme
-D haxe3
-D hxssl
26 changes: 9 additions & 17 deletions tools/command-line/src/data/Icons.hx
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
package data;


import format.SVG;
import haxe.io.BytesOutput;
import haxe.io.Path;
import helpers.FileHelper;
import helpers.PathHelper;
import helpers.ProcessHelper;
import nme.display.BitmapData;
import nme.display.Shape;
import nme.geom.Rectangle;
import nme.utils.ByteArray;
import sys.io.File;
Expand Down Expand Up @@ -126,24 +128,14 @@ class Icons

if (ext=="svg")
{
var bytes = ByteArray.readFile(found.name);
var svg = new gm2d.svg.SVG2Gfx( Xml.parse(bytes.asString()) );

var shape = svg.CreateShape();
var scale = inHeight/32;

InstallTool.print("Creating " + inWidth + "x" + inHeight + " icon from " + found.name );

shape.scaleX = scale;
shape.scaleY = scale;
shape.x = (inWidth - 32*scale)/2;

var bmp = new nme.display.BitmapData(inWidth,inHeight, true,
inBackgroundColour==null ? {a:0, rgb:0xffffff} : inBackgroundColour );

bmp.draw(shape);
var svg = new SVG (File.getContent (found.name));
var shape = new Shape ();
svg.render (shape.graphics, 0, 0, inWidth, inHeight);

var bitmapData = new BitmapData (inWidth, inHeight, true, inBackgroundColour==null ? {a:0, rgb:0xffffff} : inBackgroundColour);
bitmapData.draw (shape);

return bmp;
return bitmapData;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion tools/command-line/src/installers/DesktopInstaller.hx
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@ class DesktopInstaller extends InstallerBase {

}

FileHelper.copyFile(templatePaths[0] + "mac/Info.plist", targetDir + "/bin/" + defines.get ("APP_FILE") + ".app/Contents/Info.plist", true);
FileHelper.copyFile(templatePaths[0] + "mac/Info.plist", targetDir + "/bin/" + defines.get ("APP_FILE") + ".app/Contents/Info.plist", context, true);

}

Expand Down

0 comments on commit daa3825

Please sign in to comment.