Skip to content

Commit

Permalink
Added support for 1.1.2 savegames
Browse files Browse the repository at this point in the history
Added targetFrameRate to reduce CPU usage
Removed WebP reference for Windows.Forms (now we have linux & mac support)
Added .webp file extension as selectable for import.
Added application icon.
  • Loading branch information
jaeger-pmohrenstecher committed Apr 2, 2020
1 parent 53dcb64 commit 58b3105
Show file tree
Hide file tree
Showing 11 changed files with 2,607 additions and 2,489 deletions.
1,347 changes: 678 additions & 669 deletions Assembly-CSharp-firstpass.csproj

Large diffs are not rendered by default.

1,291 changes: 650 additions & 641 deletions Assembly-CSharp.csproj

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion Assets/Plugins/MyHorizons/Data/Save/RevisionManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ public static class RevisionManager
{
new SaveRevision(0x67, 0x6F, 0, 2, 0, 2, "1.0.0", 0, 0), // 1.0.0
new SaveRevision(0x6D, 0x78, 0, 2, 1, 2, "1.1.0", 1, 1), // 1.1.0
new SaveRevision(0x6D, 0x78, 0, 2, 2, 2, "1.1.1", 1, 1) // 1.1.1
new SaveRevision(0x6D, 0x78, 0, 2, 2, 2, "1.1.1", 1, 1), // 1.1.1
new SaveRevision(0x6D, 0x78, 0, 2, 3, 2, "1.1.2", 1, 1) // 1.1.2
};

// Table of save file sizes by revision
Expand Down
39 changes: 1 addition & 38 deletions Assets/Plugins/WebP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
using System.IO;
using System.Runtime.InteropServices;
using System.Security;
using System.Windows.Forms;

namespace WebPWrapper
{
Expand Down Expand Up @@ -478,29 +477,7 @@ public byte[] EncodeLossy(Bitmap bmp, int quality, int speed, bool info = false)
if (info)
{
stats = (WebPAuxStats) Marshal.PtrToStructure(ptrStats, typeof(WebPAuxStats));
MessageBox.Show("Dimension: " + wpic.width + " x " + wpic.height + " pixels\n" +
"Output: " + stats.coded_size + " bytes\n" +
"PSNR Y: " + stats.PSNRY + " db\n" +
"PSNR u: " + stats.PSNRU + " db\n" +
"PSNR v: " + stats.PSNRV + " db\n" +
"PSNR ALL: " + stats.PSNRALL + " db\n" +
"Block intra4: " + stats.block_count_intra4 + "\n" +
"Block intra16: " + stats.block_count_intra16 + "\n" +
"Block skipped: " + stats.block_count_skipped + "\n" +
"Header size: " + stats.header_bytes + " bytes\n" +
"Mode-partition: " + stats.mode_partition_0 + " bytes\n" +
"Macroblocks 0: " + stats.segment_size_segments0 + " residuals bytes\n" +
"Macroblocks 1: " + stats.segment_size_segments1 + " residuals bytes\n" +
"Macroblocks 2: " + stats.segment_size_segments2 + " residuals bytes\n" +
"Macroblocks 3: " + stats.segment_size_segments3 + " residuals bytes\n" +
"Quantizer 0: " + stats.segment_quant_segments0 + " residuals bytes\n" +
"Quantizer 1: " + stats.segment_quant_segments1 + " residuals bytes\n" +
"Quantizer 2: " + stats.segment_quant_segments2 + " residuals bytes\n" +
"Quantizer 3: " + stats.segment_quant_segments3 + " residuals bytes\n" +
"Filter level 0: " + stats.segment_level_segments0 + " residuals bytes\n" +
"Filter level 1: " + stats.segment_level_segments1 + " residuals bytes\n" +
"Filter level 2: " + stats.segment_level_segments2 + " residuals bytes\n" +
"Filter level 3: " + stats.segment_level_segments3 + " residuals bytes\n");

}

return rawWebP;
Expand Down Expand Up @@ -670,13 +647,6 @@ public byte[] EncodeLossless(Bitmap bmp, int speed, bool info = false)
if ((stats.lossless_features & 2) > 0) features = features + " CROSS-COLOR-TRANSFORM";
if ((stats.lossless_features & 4) > 0) features = features + " SUBTRACT-GREEN";
if ((stats.lossless_features & 8) > 0) features = features + " PALETTE";
MessageBox.Show("Dimension: " + wpic.width + " x " + wpic.height + " pixels\n" +
"Output: " + stats.coded_size + " bytes\n" +
"Losslesss compressed size: " + stats.lossless_size + " bytes\n" +
" * Header size: " + stats.lossless_hdr_size + " bytes\n" +
" * Image data size: " + stats.lossless_data_size + " bytes\n" +
" * Lossless features used:" + features + "\n" +
" * Precision Bits: histogram=" + stats.histogram_bits + " transform=" + stats.transform_bits + " cache=" + stats.cache_bits);
}

return rawWebP;
Expand Down Expand Up @@ -792,13 +762,6 @@ public byte[] EncodeNearLossless(Bitmap bmp, int quality, int speed = 9, bool in
if ((stats.lossless_features & 2) > 0) features = features + " CROSS-COLOR-TRANSFORM";
if ((stats.lossless_features & 4) > 0) features = features + " SUBTRACT-GREEN";
if ((stats.lossless_features & 8) > 0) features = features + " PALETTE";
MessageBox.Show("Dimension: " + wpic.width + " x " + wpic.height + " pixels\n" +
"Output: " + stats.coded_size + " bytes\n" +
"Losslesss compressed size: " + stats.lossless_size + " bytes\n" +
" * Header size: " + stats.lossless_hdr_size + " bytes\n" +
" * Image data size: " + stats.lossless_data_size + " bytes\n" +
" * Lossless features used:" + features + "\n" +
" * Precision Bits: histogram=" + stats.histogram_bits + " transform=" + stats.transform_bits + " cache=" + stats.cache_bits);
}

return rawWebP;
Expand Down
1 change: 1 addition & 0 deletions Assets/Scripts/Controller.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ public void PlayPopoutSound()

void Start()
{
Application.targetFrameRate = 60;
Popup.gameObject.SetActive(true);
MainMenu.gameObject.SetActive(true);
Tooltip.gameObject.SetActive(true);
Expand Down
2 changes: 1 addition & 1 deletion Assets/Scripts/Operations/ImportOperation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public bool IsFinished()
public void Start()
{
Controller.Instance.Popup.SetText("Please select any <#FF6666>Image<#FFFFFF> file to import.", false, () => {
StandaloneFileBrowser.OpenFilePanelAsync("Import image", "", new ExtensionFilter[] { new ExtensionFilter("Image", new string[] { "png", "jpg", "jpeg", "bmp", "gif", "acnl" }) }, false, (path) =>
StandaloneFileBrowser.OpenFilePanelAsync("Import image", "", new ExtensionFilter[] { new ExtensionFilter("Image", new string[] { "png", "jpg", "jpeg", "bmp", "gif", "acnl", "webp" }) }, false, (path) =>
{
if (path.Length > 0)
{
Expand Down
Binary file added Assets/UI/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 92 additions & 0 deletions Assets/UI/Icon.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 58b3105

Please sign in to comment.