Welcome to mirror list, hosted at ThFree Co, Russian Federation.

NesTiler.git/NesTiler.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2023-09-17 20:55:47 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2023-09-17 20:55:47 +0300
commit7434a0587738599f6f649b5730c0f0d1e3830bcd (patch)
tree97be314dbb717f6b069ac7b813b186ab095a0305
parent62e1bee82e3ecb2a29f245cbe20b8ea22bb8c171 (diff)
Some fixes
-rw-r--r--NesTiler/CmdArgs.cs2
-rw-r--r--NesTiler/Program.cs12
2 files changed, 7 insertions, 7 deletions
diff --git a/NesTiler/CmdArgs.cs b/NesTiler/CmdArgs.cs
index 98411f9..7e337c3 100644
--- a/NesTiler/CmdArgs.cs
+++ b/NesTiler/CmdArgs.cs
@@ -125,7 +125,7 @@
public const string S = "s";
public const string L = "share-pattern-table";
public string? Params { get; } = null;
- public string Description { get; } = "vertical offset for attribute table in pixels (default - 0)";
+ public string Description { get; } = "share pattern table between input images";
public bool HasIndex { get; } = false;
public string Short { get; } = S;
public string Long { get; } = L;
diff --git a/NesTiler/Program.cs b/NesTiler/Program.cs
index 193caf9..5884aa0 100644
--- a/NesTiler/Program.cs
+++ b/NesTiler/Program.cs
@@ -27,7 +27,7 @@ namespace com.clusterrr.Famicom.NesTiler
#if !INTERIM
$"v{versionStr}"
#else
- "intrerim version"
+ "intrerim version"
#endif
#if DEBUG
+ " (debug)"
@@ -136,9 +136,8 @@ namespace com.clusterrr.Famicom.NesTiler
if (image == null) throw new InvalidDataException($"Can't load {filename}.");
images[imageFile.Key] = image;
- if (c.Mode == Config.TilesMode.Backgrounds && image.Width != 256) throw new ArgumentException("Image width must be 256 for backgrounds mode.", filename);
- if (image.Width % c.TileWidth != 0) throw new ArgumentException($"Image width must be divisible by {c.TileWidth}.", filename);
- if (image.Height % c.TileHeight != 0) throw new ArgumentException($"Image height must be divisible by {c.TileHeight}.", filename);
+ if (image.Width % c.TilePalWidth != 0) throw new ArgumentException($"Image width must be divisible by {c.TilePalWidth}.", filename);
+ if (image.Height % c.TilePalHeight != 0) throw new ArgumentException($"Image height must be divisible by {c.TilePalHeight}.", filename);
}
// Change all colors in the images to colors from the NES palette
@@ -151,7 +150,7 @@ namespace com.clusterrr.Famicom.NesTiler
for (int x = 0; x < image.Width; x++)
{
var color = image.GetPixelColor(x, y);
- if (color.Alpha >= 0x80 || c.Mode == Config.TilesMode.Backgrounds)
+ if (color.Alpha >= 0x80)
{
var similarColor = nesColors.FindSimilarColor(color);
if (c.LossyLevel <= 0 && similarColor != color)
@@ -246,7 +245,8 @@ namespace com.clusterrr.Famicom.NesTiler
// Lossless combinations found, get best
var kv = kvAllLossless.First();
(bgColor, calculatedPalettes) = (kv.Key, kv.Value.Palettes);
- } else
+ }
+ else
{
// Lossy combinations found
var kvLossy = calcResults.OrderBy(kv => kv.Value.Palettes.Length).First();