diff --git a/.gitignore b/.gitignore index b94b316ed..2d8ef0b63 100644 --- a/.gitignore +++ b/.gitignore @@ -36,7 +36,7 @@ Tests/*Cases/*.js /jsil.org/demos/Sully/*.js /jsil.org/demos/Sully/Content /jsil.org/demos/Soulcaster/*.js -/jsil.org/demos/Soulcaster/Content +/jsil.org/demos/Soulcaster/Soulcaster2Content /jsil.org/demos/RPG/Content /jsil.org/demos/Lumberjack/Content /jsil.org/demos/Lumberjack/*.js diff --git a/Compiler/Profiles/XNA3/Profiles.XNA3.csproj b/Compiler/Profiles/XNA3/Profiles.XNA3.csproj index d81502f7b..a4b995ffe 100644 --- a/Compiler/Profiles/XNA3/Profiles.XNA3.csproj +++ b/Compiler/Profiles/XNA3/Profiles.XNA3.csproj @@ -25,6 +25,7 @@ true true false + true ..\..\..\bin\ @@ -36,6 +37,7 @@ true false false + true diff --git a/Compiler/Profiles/XNA4/Profiles.XNA4.csproj b/Compiler/Profiles/XNA4/Profiles.XNA4.csproj index f03575c2b..8b7cc4001 100644 --- a/Compiler/Profiles/XNA4/Profiles.XNA4.csproj +++ b/Compiler/Profiles/XNA4/Profiles.XNA4.csproj @@ -22,6 +22,7 @@ prompt false false + true ..\..\..\bin\ @@ -33,6 +34,7 @@ true true true + true diff --git a/Compiler/Profiles/XNACommon.cs b/Compiler/Profiles/XNACommon.cs index bb90d6aae..a12cab83e 100644 --- a/Compiler/Profiles/XNACommon.cs +++ b/Compiler/Profiles/XNACommon.cs @@ -329,8 +329,115 @@ public static IEnumerable CompressAudio (string fileName, string } } - public static CompressResult? CompressImage (string imageName, string sourceFolder, string outputFolder, Dictionary settings, CompressResult? oldResult) { - const int CompressVersion = 3; + private static System.Drawing.Bitmap LoadBitmap (string filename, out bool hasAlphaChannel, out System.Drawing.Color? existingColorKeyColor) { + existingColorKeyColor = null; + + switch (Path.GetExtension(filename).ToLower()) { + case ".bmp": + var hImage = LoadImage(IntPtr.Zero, filename, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); + var texture = System.Drawing.Image.FromHbitmap(hImage); + try { + switch (texture.PixelFormat) { + case PixelFormat.Gdi: + case PixelFormat.Extended: + case PixelFormat.Canonical: + case PixelFormat.Undefined: + case PixelFormat.Format16bppRgb555: + case PixelFormat.Format16bppRgb565: + case PixelFormat.Format24bppRgb: + hasAlphaChannel = false; + return texture; + + case PixelFormat.Format32bppArgb: + case PixelFormat.Format32bppPArgb: + case PixelFormat.Format32bppRgb: { + // Do an elaborate song and dance to extract the alpha channel from the PNG, because + // GDI+ is too utterly shitty to do that itself + var dc = CreateCompatibleDC(IntPtr.Zero); + + var newImage = new System.Drawing.Bitmap( + texture.Width, texture.Height, PixelFormat.Format32bppArgb + ); + var bits = newImage.LockBits( + new System.Drawing.Rectangle(0, 0, texture.Width, texture.Height), + ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb + ); + + var info = new BITMAPINFO { + biBitCount = 32, + biClrImportant = 0, + biClrUsed = 0, + biCompression = 0, + biHeight = -texture.Height, + biPlanes = 1, + biSizeImage = bits.Stride * bits.Height, + biWidth = bits.Width, + }; + info.biSize = Marshal.SizeOf(info); + + var rv = GetDIBits(dc, hImage, 0, (uint)texture.Height, bits.Scan0, ref info, 0); + + newImage.UnlockBits(bits); + + DeleteObject(dc); + + texture.Dispose(); + hasAlphaChannel = true; + return newImage; + } + + default: + Console.Error.WriteLine("// Unsupported bitmap format: '{0}' {1}", Path.GetFileNameWithoutExtension(filename), texture.PixelFormat); + texture.Dispose(); + hasAlphaChannel = false; + return null; + } + } finally { + DeleteObject(hImage); + } + + default: { + var result = (System.Drawing.Bitmap)System.Drawing.Image.FromFile(filename, true); + + switch (result.PixelFormat) { + case PixelFormat.Format8bppIndexed: + case PixelFormat.Format4bppIndexed: + case PixelFormat.Format1bppIndexed: + case PixelFormat.Indexed: + var palette = result.Palette; + + for (var i = 0; i < palette.Entries.Length; i++) { + if (palette.Entries[i].A < 255) { + existingColorKeyColor = palette.Entries[i]; + break; + } + } + + hasAlphaChannel = (existingColorKeyColor.HasValue); + break; + + case PixelFormat.Format32bppArgb: + case PixelFormat.Format32bppPArgb: + hasAlphaChannel = true; + break; + + default: + hasAlphaChannel = false; + break; + } + + return result; + } + } + } + + public static CompressResult? CompressImage ( + string imageName, string sourceFolder, + string outputFolder, Dictionary settings, + Dictionary itemMetadata, + CompressResult? oldResult + ) { + const int CompressVersion = 4; EnsureDirectoryExists(outputFolder); @@ -345,107 +452,69 @@ public static IEnumerable CompressAudio (string fileName, string var outputPath = Path.Combine(outputFolder, Path.GetFileNameWithoutExtension(imageName)); var justCopy = true; - Action saveJpeg = (bitmap) => { + Action saveJpeg = (bitmap, path) => { var encoder = GetEncoder(ImageFormat.Jpeg); var encoderParameters = new System.Drawing.Imaging.EncoderParameters(1); encoderParameters.Param[0] = new EncoderParameter( System.Drawing.Imaging.Encoder.Quality, Convert.ToInt64(settings["JPEGQuality"]) ); - bitmap.Save(outputPath, encoder, encoderParameters); + bitmap.Save(path, encoder, encoderParameters); }; + bool colorKey = true; + var colorKeyColor = System.Drawing.Color.FromArgb(255, 255, 0, 255); + + if (itemMetadata.ContainsKey("ProcessorParameters_ColorKeyEnabled")) { + colorKey = Convert.ToBoolean(itemMetadata["ProcessorParameters_ColorKeyEnabled"].EvaluatedValue); + } + + if (itemMetadata.ContainsKey("ProcessorParameters_ColorKeyColor")) { + var parts = itemMetadata["ProcessorParameters_ColorKeyColor"].EvaluatedValue.Split(new[] { "," }, StringSplitOptions.RemoveEmptyEntries); + colorKeyColor = System.Drawing.Color.FromArgb( + Convert.ToInt32(parts[3]), + Convert.ToInt32(parts[0]), + Convert.ToInt32(parts[1]), + Convert.ToInt32(parts[2]) + ); + } + + justCopy &= !colorKey; + if (forceJpeg) { - justCopy = false; outputPath += ".jpg"; - using (var img = (System.Drawing.Bitmap)System.Drawing.Image.FromFile(sourcePath)) - saveJpeg(img); + bool temp; + System.Drawing.Color? temp2; + using (var img = LoadBitmap(sourcePath, out temp, out temp2)) + saveJpeg(img, outputPath); + } else if (justCopy) { + outputPath += Path.GetExtension(sourcePath); + + File.Copy(sourcePath, outputPath, true); } else { - switch (Path.GetExtension(imageName).ToLower()) { - case ".jpg": - case ".jpeg": + bool hasAlphaChannel; + System.Drawing.Color? existingColorKey; + + using (var img = LoadBitmap(sourcePath, out hasAlphaChannel, out existingColorKey)) { + if (hasAlphaChannel || colorKey || existingColorKey.HasValue) + outputPath += ".png"; + else outputPath += ".jpg"; - break; - case ".bmp": - justCopy = false; - - var hImage = LoadImage(IntPtr.Zero, sourcePath, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE); - try { - using (var texture = (System.Drawing.Bitmap)System.Drawing.Image.FromHbitmap(hImage)) { - switch (texture.PixelFormat) { - case PixelFormat.Gdi: - case PixelFormat.Extended: - case PixelFormat.Canonical: - case PixelFormat.Undefined: - case PixelFormat.Format16bppRgb555: - case PixelFormat.Format16bppRgb565: - case PixelFormat.Format24bppRgb: - outputPath += ".jpg"; - saveJpeg(texture); - break; - - case PixelFormat.Format32bppArgb: - case PixelFormat.Format32bppPArgb: - case PixelFormat.Format32bppRgb: { - // Do an elaborate song and dance to extract the alpha channel from the PNG, because - // GDI+ is too utterly shitty to do that itself - var dc = CreateCompatibleDC(IntPtr.Zero); - - var newImage = new System.Drawing.Bitmap( - texture.Width, texture.Height, PixelFormat.Format32bppArgb - ); - var bits = newImage.LockBits( - new System.Drawing.Rectangle(0, 0, texture.Width, texture.Height), - ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb - ); - - var info = new BITMAPINFO { - biBitCount = 32, - biClrImportant = 0, - biClrUsed = 0, - biCompression = 0, - biHeight = -texture.Height, - biPlanes = 1, - biSizeImage = bits.Stride * bits.Height, - biWidth = bits.Width, - }; - info.biSize = Marshal.SizeOf(info); - - var rv = GetDIBits(dc, hImage, 0, (uint)texture.Height, bits.Scan0, ref info, 0); - - newImage.UnlockBits(bits); - - DeleteObject(dc); - - outputPath += ".png"; - newImage.Save(outputPath, ImageFormat.Png); - newImage.Dispose(); - - break; - } - - default: - Console.Error.WriteLine("// Unsupported bitmap format: '{0}' {1}", Path.GetFileNameWithoutExtension(imageName), texture.PixelFormat); - return null; - } - } - } finally { - DeleteObject(hImage); - } - break; + if (existingColorKey.HasValue) + img.MakeTransparent(existingColorKey.Value); - case ".png": - default: - outputPath += Path.GetExtension(imageName); - break; + if (colorKey) + img.MakeTransparent(colorKeyColor); + + if (hasAlphaChannel || colorKey || existingColorKey.HasValue) + img.Save(outputPath, ImageFormat.Png); + else + saveJpeg(img, outputPath); } } - if (justCopy) - File.Copy(sourcePath, outputPath, true); - bool usePNGQuant = Convert.ToBoolean(settings["UsePNGQuant"]); var pngQuantParameters = String.Format( "{0} {1}", @@ -819,6 +888,7 @@ where bi.OutputPath.EndsWith(".xnb", StringComparison.OrdinalIgnoreCase) ); continue; + case "FontTextureProcessor": case "FontDescriptionProcessor": copyRawXnb(item, xnbPath, "SpriteFont"); @@ -840,7 +910,7 @@ where bi.OutputPath.EndsWith(".xnb", StringComparison.OrdinalIgnoreCase) var result = Common.CompressImage( item.EvaluatedInclude, contentProjectDirectory, itemOutputDirectory, - configuration.ProfileSettings, existingJournalEntry + configuration.ProfileSettings, metadata, existingJournalEntry ); if (result.HasValue) { diff --git a/Libraries/JSIL.Browser.js b/Libraries/JSIL.Browser.js index fb060e802..aecd2b427 100644 --- a/Libraries/JSIL.Browser.js +++ b/Libraries/JSIL.Browser.js @@ -451,7 +451,8 @@ function loadBinaryFileAsync (uri, onComplete) { } var loadedFontCount = 0; -var loadingPollInterval = 25; +var loadingPollInterval = 10; +var maxAssetsLoading = 16; var soundLoadTimeout = 30000; var fontLoadTimeout = 15000; @@ -822,7 +823,7 @@ function pollAssetQueue () { }; }; - while ((state.assetsLoading < state.maxAssetsLoading) && (state.loadIndex < state.assetCount)) { + while ((state.assetsLoading < maxAssetsLoading) && (state.loadIndex < state.assetCount)) { try { var assetSpec = state.assets[state.loadIndex]; @@ -906,7 +907,6 @@ function loadAssets (assets, onDoneLoading) { assetsLoaded: 0, assetsFinished: 0, assetsLoading: 0, - maxAssetsLoading: 16, onDoneLoading: onDoneLoading, assets: assets, interval: null, diff --git a/Libraries/System.Drawing.js b/Libraries/System.Drawing.js index a2de0ecf0..2d0af65be 100644 --- a/Libraries/System.Drawing.js +++ b/Libraries/System.Drawing.js @@ -8,6 +8,13 @@ var $jsildrawing = JSIL.DeclareAssembly("JSIL.Drawing"); JSIL.DeclareNamespace("System"); JSIL.DeclareNamespace("System.Drawing"); +var $sdasms = new JSIL.AssemblyCollection({ + 5: "mscorlib", + 6: "System", + 11: "System.Drawing", + 15: "System.Windows.Forms", +}); + if (JSIL.HostType.IsBrowser) { JSIL.ImplementExternals("System.Drawing.Image", function ($) { var mscorlib = JSIL.GetAssembly("mscorlib", true); @@ -333,7 +340,7 @@ JSIL.ImplementExternals("System.Drawing.Rectangle", function ($) { ); $.Method({Static:false, Public:true }, ".ctor", - (new JSIL.MethodSignature(null, [$asms[11].TypeRef("System.Drawing.Point"), $asms[11].TypeRef("System.Drawing.Size")], [])), + (new JSIL.MethodSignature(null, [$sdasms[11].TypeRef("System.Drawing.Point"), $sdasms[11].TypeRef("System.Drawing.Size")], [])), function _ctor (location, size) { this.x = location.X; this.y = location.Y; diff --git a/Libraries/System.Windows.js b/Libraries/System.Windows.js index ec87fb88d..7397cf3c6 100644 --- a/Libraries/System.Windows.js +++ b/Libraries/System.Windows.js @@ -7,9 +7,16 @@ JSIL.DeclareAssembly("JSIL.Windows"); JSIL.DeclareNamespace("JSIL"); +var $wfasms = new JSIL.AssemblyCollection({ + 5: "mscorlib", + 6: "System", + 11: "System.Drawing", + 15: "System.Windows.Forms", +}); + JSIL.ImplementExternals("System.Windows.Forms.Control", function ($) { var coreCtor = function _ctor (text) { - this._controls = new $asms[15].System.Windows.Forms.Control_ControlCollection (); + this._controls = new $wfasms[15].System.Windows.Forms.Control_ControlCollection (); this.clientSize = new System.Drawing.Size(0, 0); this.size = new System.Drawing.Size(0, 0); this.location = new System.Drawing.Point(0, 0); @@ -40,35 +47,35 @@ JSIL.ImplementExternals("System.Windows.Forms.Control", function ($) { ); $.Method({Static:false, Public:true }, "get_Controls", - (new JSIL.MethodSignature($asms[15].TypeRef("System.Windows.Forms.Control/ControlCollection"), [], [])), + (new JSIL.MethodSignature($wfasms[15].TypeRef("System.Windows.Forms.Control/ControlCollection"), [], [])), function get_Controls () { return this._controls; } ); $.Method({Static:false, Public:true }, "get_ClientSize", - (new JSIL.MethodSignature($asms[11].TypeRef("System.Drawing.Size"), [], [])), + (new JSIL.MethodSignature($wfasms[11].TypeRef("System.Drawing.Size"), [], [])), function get_ClientSize () { return this.clientSize; } ); $.Method({Static:false, Public:true }, "set_ClientSize", - (new JSIL.MethodSignature(null, [$asms[11].TypeRef("System.Drawing.Size")], [])), + (new JSIL.MethodSignature(null, [$wfasms[11].TypeRef("System.Drawing.Size")], [])), function set_ClientSize (value) { this.clientSize = value; } ); $.Method({Static:false, Public:true }, "get_Size", - (new JSIL.MethodSignature($asms[11].TypeRef("System.Drawing.Size"), [], [])), + (new JSIL.MethodSignature($wfasms[11].TypeRef("System.Drawing.Size"), [], [])), function get_Size () { return this.size; } ); $.Method({Static:false, Public:true }, "set_Size", - (new JSIL.MethodSignature(null, [$asms[11].TypeRef("System.Drawing.Size")], [])), + (new JSIL.MethodSignature(null, [$wfasms[11].TypeRef("System.Drawing.Size")], [])), function set_Size (value) { this.size = value; } @@ -96,7 +103,7 @@ JSIL.ImplementExternals("System.Windows.Forms.Control", function ($) { ); $.Method({Static:false, Public:true }, "get_Location", - (new JSIL.MethodSignature($asms[11].TypeRef("System.Drawing.Point"), [], [])), + (new JSIL.MethodSignature($wfasms[11].TypeRef("System.Drawing.Point"), [], [])), function get_Location () { return this.location; } @@ -145,7 +152,7 @@ JSIL.ImplementExternals("System.Windows.Forms.Control", function ($) { ); $.Method({Static:false, Public:true }, "set_Location", - (new JSIL.MethodSignature(null, [$asms[11].TypeRef("System.Drawing.Point")], [])), + (new JSIL.MethodSignature(null, [$wfasms[11].TypeRef("System.Drawing.Point")], [])), function set_Location (value) { this.location = value; } @@ -173,7 +180,7 @@ JSIL.ImplementExternals("System.Windows.Forms.Control", function ($) { ); $.Method({Static:false, Public:true }, "set_Dock", - (new JSIL.MethodSignature(null, [$asms[15].TypeRef("System.Windows.Forms.DockStyle")], [])), + (new JSIL.MethodSignature(null, [$wfasms[15].TypeRef("System.Windows.Forms.DockStyle")], [])), function set_Dock (value) { // FIXME } @@ -182,15 +189,15 @@ JSIL.ImplementExternals("System.Windows.Forms.Control", function ($) { }); JSIL.ImplementExternals("System.Windows.Forms.Control/ControlCollection", function ($) { - $jsilcore.$ListExternals($, $asms[15].TypeRef("System.Windows.Forms.Control"), "ArrangedElementCollection"); + $jsilcore.$ListExternals($, $wfasms[15].TypeRef("System.Windows.Forms.Control"), "ArrangedElementCollection"); }); JSIL.ImplementExternals("System.Windows.Forms.StatusBar/StatusBarPanelCollection", function ($) { - $jsilcore.$ListExternals($, $asms[15].TypeRef("System.Windows.Forms.StatusBarPanel"), "ObjectCollection"); + $jsilcore.$ListExternals($, $wfasms[15].TypeRef("System.Windows.Forms.StatusBarPanel"), "ObjectCollection"); }); JSIL.ImplementExternals("System.Windows.Forms.TabControl/TabPageCollection", function ($) { - $jsilcore.$ListExternals($, $asms[15].TypeRef("System.Windows.Forms.TabPage"), "ArrangedElementCollection"); + $jsilcore.$ListExternals($, $wfasms[15].TypeRef("System.Windows.Forms.TabPage"), "ArrangedElementCollection"); }); JSIL.ImplementExternals("System.Windows.Forms.ListBox/ObjectCollection", function ($) { @@ -206,12 +213,12 @@ JSIL.ImplementExternals("System.Windows.Forms.ListBox", function ($) { (new JSIL.MethodSignature(null, [], [])), function _ctor () { this.$coreCtor(); - this._items = new $asms[15].System.Windows.Forms.ListBox_ObjectCollection (); + this._items = new $wfasms[15].System.Windows.Forms.ListBox_ObjectCollection (); } ); $.Method({Static:false, Public:true }, "get_Items", - (new JSIL.MethodSignature($asms[15].TypeRef("System.Windows.Forms.ListBox/ObjectCollection"), [], [])), + (new JSIL.MethodSignature($wfasms[15].TypeRef("System.Windows.Forms.ListBox/ObjectCollection"), [], [])), function get_Items () { return this._items; } @@ -237,12 +244,12 @@ JSIL.ImplementExternals("System.Windows.Forms.StatusBar", function ($) { (new JSIL.MethodSignature(null, [], [])), function _ctor () { this.$coreCtor(); - this._panels = new $asms[15].System.Windows.Forms.StatusBar_StatusBarPanelCollection (); + this._panels = new $wfasms[15].System.Windows.Forms.StatusBar_StatusBarPanelCollection (); } ); $.Method({Static:false, Public:true }, "get_Panels", - (new JSIL.MethodSignature($asms[15].TypeRef("System.Windows.Forms.StatusBar/StatusBarPanelCollection"), [], [])), + (new JSIL.MethodSignature($wfasms[15].TypeRef("System.Windows.Forms.StatusBar/StatusBarPanelCollection"), [], [])), function get_Panels () { return this._panels; } @@ -254,14 +261,96 @@ JSIL.ImplementExternals("System.Windows.Forms.TabControl", function ($) { (new JSIL.MethodSignature(null, [], [])), function _ctor () { this.$coreCtor(); - this._tabPages = new $asms[15].System.Windows.Forms.TabControl_TabPageCollection (); + this._tabPages = new $wfasms[15].System.Windows.Forms.TabControl_TabPageCollection (); } ); $.Method({Static:false, Public:true }, "get_TabPages", - (new JSIL.MethodSignature($asms[15].TypeRef("System.Windows.Forms.TabControl/TabPageCollection"), [], [])), + (new JSIL.MethodSignature($wfasms[15].TypeRef("System.Windows.Forms.TabControl/TabPageCollection"), [], [])), function get_TabPages () { return this._tabPages; } ); }); + + +JSIL.ImplementExternals("System.Windows.Forms.Screen", function ($) { + var getBoundsImpl = function () { + var canvas = null; + + if (JSIL.Host.getCanvas) + canvas = JSIL.Host.getCanvas(); + + if (canvas) + return new System.Drawing.Rectangle( + 0, 0, canvas.width, canvas.height + ); + else + return new System.Drawing.Rectangle( + 0, 0, document.clientWidth, document.clientHeight + ); + }; + + $.Method({Static:false, Public:true }, "get_Bounds", + (new JSIL.MethodSignature($wfasms[11].TypeRef("System.Drawing.Rectangle"), [], [])), + function get_Bounds () { + return getBoundsImpl(); + } + ); + + $.Method({Static:true , Public:true }, "get_PrimaryScreen", + (new JSIL.MethodSignature($wfasms[15].TypeRef("System.Windows.Forms.Screen"), [], [])), + function get_PrimaryScreen () { + return Object.create(System.Windows.Forms.Screen.prototype); + } + ); + + $.Method({Static:false, Public:true }, "get_WorkingArea", + (new JSIL.MethodSignature($wfasms[11].TypeRef("System.Drawing.Rectangle"), [], [])), + function get_WorkingArea () { + return getBoundsImpl(); + } + ); + + $.Method({Static:true , Public:true }, "GetBounds", + (new JSIL.MethodSignature($wfasms[11].TypeRef("System.Drawing.Rectangle"), [$wfasms[11].TypeRef("System.Drawing.Point")], [])), + function GetBounds (pt) { + return getBoundsImpl(); + } + ); + + $.Method({Static:true , Public:true }, "GetBounds", + (new JSIL.MethodSignature($wfasms[11].TypeRef("System.Drawing.Rectangle"), [$wfasms[11].TypeRef("System.Drawing.Rectangle")], [])), + function GetBounds (rect) { + return getBoundsImpl(); + } + ); + + $.Method({Static:true , Public:true }, "GetBounds", + (new JSIL.MethodSignature($wfasms[11].TypeRef("System.Drawing.Rectangle"), [$wfasms[15].TypeRef("System.Windows.Forms.Control")], [])), + function GetBounds (ctl) { + return getBoundsImpl(); + } + ); + + $.Method({Static:true , Public:true }, "GetWorkingArea", + (new JSIL.MethodSignature($wfasms[11].TypeRef("System.Drawing.Rectangle"), [$wfasms[11].TypeRef("System.Drawing.Point")], [])), + function GetWorkingArea (pt) { + return getBoundsImpl(); + } + ); + + $.Method({Static:true , Public:true }, "GetWorkingArea", + (new JSIL.MethodSignature($wfasms[11].TypeRef("System.Drawing.Rectangle"), [$wfasms[11].TypeRef("System.Drawing.Rectangle")], [])), + function GetWorkingArea (rect) { + return getBoundsImpl(); + } + ); + + $.Method({Static:true , Public:true }, "GetWorkingArea", + (new JSIL.MethodSignature($wfasms[11].TypeRef("System.Drawing.Rectangle"), [$wfasms[15].TypeRef("System.Windows.Forms.Control")], [])), + function GetWorkingArea (ctl) { + return getBoundsImpl(); + } + ); +}); \ No newline at end of file diff --git a/Upstream/PNGQuant/README.txt b/Upstream/PNGQuant/README.txt new file mode 100644 index 000000000..27edabc45 --- /dev/null +++ b/Upstream/PNGQuant/README.txt @@ -0,0 +1,74 @@ + +http://pngquant.org + +BATCH FILES +Originally produced by Thomas Rutter, now with minor amendments by BJ. + +You can drag and drop your 24-bit PNGs onto these batch files as an easy way +to process them without messing around with the command line. Dithered and +non-dithered optimised copies of the source PNGs will be created in the same +directory as the originals. The batch files must remain in the same directory +as pngquant.exe. + + +COPYRIGHT AND LICENSES + +Improved PNGQuant is +- Copyright (C) 1989, 1991 by Jef Poskanzer +- Copyright (C) 1997, 2000, 2002 by Greg Roelofs; based on an idea by Stefan Schneider. +- Copyright (C) 2009 by Kornel Lesinski. +** Permission to use, copy, modify, and distribute this software and its +** documentation for any purpose and without fee is hereby granted, provided +** that the above copyright notice appear in all copies and that both that +** copyright notice and this permission notice appear in supporting +** documentation. This software is provided "as is" without express or +** implied warranty. + +libpng: +* Copyright (c) 1998-2009 Glenn Randers-Pehrson +* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) +* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) +- Full license is supplied in png.h file, but here is an excerpt: +* The PNG Reference Library is supplied "AS IS". The Contributing Authors +* and Group 42, Inc. disclaim all warranties, expressed or implied, +* including, without limitation, the warranties of merchantability and of +* fitness for any purpose. The Contributing Authors and Group 42, Inc. +* assume no liability for direct, indirect, incidental, special, exemplary, +* or consequential damages, which may result from the use of the PNG +* Reference Library, even if advised of the possibility of such damage. +* +* Permission is hereby granted to use, copy, modify, and distribute this +* source code, or portions hereof, for any purpose, without fee, subject +* to the following restrictions: +* +* 1. The origin of this source code must not be misrepresented. +* +* 2. Altered versions must be plainly marked as such and +* must not be misrepresented as being the original source. +* +* 3. This Copyright notice may not be removed or altered from +* any source or altered source distribution. +* +* The Contributing Authors and Group 42, Inc. specifically permit, without +* fee, and encourage the use of this source code as a component to +* supporting the PNG file format in commercial products. If you use this +* source code in a product, acknowledgment is not required but would be +* appreciated. + +zlib: +- Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler +* This software is provided 'as-is', without any express or implied +* warranty. In no event will the authors be held liable for any damages +* arising from the use of this software. +* +* Permission is granted to anyone to use this software for any purpose, +* including commercial applications, and to alter it and redistribute it +* freely, subject to the following restrictions: +* +* 1. The origin of this software must not be misrepresented; you must not +* claim that you wrote the original software. If you use this software +* in a product, an acknowledgment in the product documentation would be +* appreciated but is not required. +* 2. Altered source versions must be plainly marked as such, and must not be +* misrepresented as being the original software. +* 3. This notice may not be removed or altered from any source distribution. diff --git a/Upstream/PNGQuant/libpng3.dll b/Upstream/PNGQuant/libpng3.dll new file mode 100644 index 000000000..649ec6489 Binary files /dev/null and b/Upstream/PNGQuant/libpng3.dll differ diff --git a/Upstream/PNGQuant/pngquant.exe b/Upstream/PNGQuant/pngquant.exe index b90ae4bfb..cee4d9094 100644 Binary files a/Upstream/PNGQuant/pngquant.exe and b/Upstream/PNGQuant/pngquant.exe differ diff --git a/Upstream/PNGQuant/zlib1.dll b/Upstream/PNGQuant/zlib1.dll new file mode 100644 index 000000000..31996cd3e Binary files /dev/null and b/Upstream/PNGQuant/zlib1.dll differ diff --git a/build_demos.bat b/build_demos.bat index fd35398fc..5b95c54bc 100644 --- a/build_demos.bat +++ b/build_demos.bat @@ -7,4 +7,5 @@ JSILc "C:\Users\Kevin\Documents\Projects\PlatformerStarterKit\PlatformerStarterK JSILc "C:\Users\Kevin\Documents\Projects\RPGStarterKit\RolePlayingGameWindows.sln" "C:\Users\Kevin\Documents\Projects\JSIL\jsil.org\demos\RPG\RPG.jsilconfig" --platform="Mixed Platforms" --configuration=Debug JSILc "C:\Users\Kevin\Documents\Projects\lumberjack\LumberjackPC.sln" "C:\Users\Kevin\Documents\Projects\lumberjack\Lumberjack\Lumberjack\bin\x86\Debug\Lumberjack.XmlSerializers.dll" "C:\Users\Kevin\Documents\Projects\JSIL\jsil.org\demos\Lumberjack\Lumberjack.jsilconfig" --platform:x86 --configuration:Debug JSILc "C:\Users\Kevin\Documents\Projects\XNAVERGE\Sully.sln" "C:\Users\Kevin\Documents\Projects\JSIL\jsil.org\demos\Sully\Sully.jsilconfig" --platform:x86 --configuration:Debug +JSILc "C:\Users\Kevin\Documents\Projects\Soulcaster\SoulcasterHTML5.sln" "C:\Users\Kevin\Documents\Projects\Soulcaster\Soulcaster2\Soulcaster2\bin\x86\DebugPC\TarchonData.XmlSerializers.dll" "C:\Users\Kevin\Documents\Projects\JSIL\jsil.org\demos\Soulcaster\Soulcaster.jsilconfig" --platform:x86 --configuration:DebugPC popd \ No newline at end of file