From 7ab9c6fd9cc4418dd14065b3db5f0815a13e850f Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 21 May 2023 15:47:56 -0400 Subject: [PATCH] Logic sprite upper limit now 64 --- tools/src/mindustry/tools/Generators.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tools/src/mindustry/tools/Generators.java b/tools/src/mindustry/tools/Generators.java index c15bf06a22..a48462ebbd 100644 --- a/tools/src/mindustry/tools/Generators.java +++ b/tools/src/mindustry/tools/Generators.java @@ -27,7 +27,7 @@ import static mindustry.Vars.*; import static mindustry.tools.ImagePacker.*; public class Generators{ - static final int logicIconSize = (int)iconMed, maxUiIcon = 128; + static final int logicIconSize = 64, maxUiIcon = 128; private static float fluid(boolean gas, double x, double y, float frame){ int keyframes = gas ? 4 : 3; @@ -44,9 +44,7 @@ public class Generators{ }else{ //liquids float min = 0.84f; double rx = (x + frame*32) % 32, ry = (y + frame*32) % 32; - //rx = x; ry = y; - //(float)liquidFrame(rx, ry, 0) - float interpolated = (float)liquidFrame(rx, ry, 2);//Mathf.lerp((float)liquidFrame(rx, ry, curFrame), (float)liquidFrame(rx, ry, nextFrame), progress); + float interpolated = (float)liquidFrame(rx, ry, 2); //only two colors here return min + (interpolated >= 0.3f ? 1f - min : 0f); } @@ -460,7 +458,7 @@ public class Generators{ base = container.outline(Pal.gray, 3); } - saveScaled(base, item.name + "-icon-logic", logicIconSize); + saveScaled(base, item.name + "-icon-logic", Math.min(logicIconSize, Math.min(base.width, base.height))); save(base, "../ui/" + item.getContentType().name() + "-" + item.name + "-ui"); } }); @@ -718,7 +716,7 @@ public class Generators{ Pixmap fit = new Pixmap(maxd, maxd); drawScaledFit(fit, image); - saveScaled(fit, type.name + "-icon-logic", logicIconSize); + saveScaled(fit, type.name + "-icon-logic", Math.min(logicIconSize, Math.min(fit.width, fit.height))); save(fit, "../ui/unit-" + type.name + "-ui"); }catch(IllegalArgumentException e){ Log.err("WARNING: Skipping unit @: @", type.name, e.getMessage());