Skip to content

Commit

Permalink
Allow .ico files on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
hughsando committed Mar 20, 2024
1 parent fa27d00 commit 1def906
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
10 changes: 10 additions & 0 deletions tools/nme/src/helpers/IconHelper.hx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import sys.io.File;
import sys.FileSystem;

import haxe.ds.IntMap;
using StringTools;

class IconHelper
{
Expand Down Expand Up @@ -145,6 +146,15 @@ class IconHelper

public static function createWindowsIcon(icons:Array<Icon>, targetPath:String, favicon = false):Bool
{
for(icon in icons)
{
if (icon.path!=null && icon.path.endsWith(".ico"))
{
FileHelper.copyFile(icon.path, targetPath);
return true;
}
}

var sizes = [ 256, 128, 64, 48, 40, 32, 24, 16 ];
var sizes_8bit = [ 48, 32, 16 ];
var bmps = new Array<BitmapData>();
Expand Down
2 changes: 1 addition & 1 deletion tools/nme/src/platforms/WindowsPlatform.hx
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class WindowsPlatform extends DesktopPlatform

if (IconHelper.createWindowsIcon(project.icons, iconPath))
{
outputFiles.push(ico);
//outputFiles.push(ico);
var replaceVI = CommandLineTools.nme + "/tools/nme/bin/ReplaceVistaIcon.exe";
ProcessHelper.runCommand("", replaceVI , [ executablePath, iconPath ], true, true);
}
Expand Down

0 comments on commit 1def906

Please sign in to comment.