diff --git a/core/src/mindustry/game/MapObjectives.java b/core/src/mindustry/game/MapObjectives.java index 3371998af8..31fac3c1e0 100644 --- a/core/src/mindustry/game/MapObjectives.java +++ b/core/src/mindustry/game/MapObjectives.java @@ -3,6 +3,7 @@ package mindustry.game; import arc.*; import arc.func.*; import arc.graphics.*; +import arc.graphics.Texture.*; import arc.graphics.g2d.*; import arc.math.*; import arc.math.geom.*; @@ -98,7 +99,7 @@ public class MapObjectives implements Iterable, Eachable prov) { + public static void registerLegacyMarker(String name, Prov prov){ Class type = prov.get().getClass(); markerNameToType.put(name, prov); @@ -663,7 +664,7 @@ public class MapObjectives implements Iterable, Eachable, Eachable, Eachable ((int)p1 == 0 ? pos : (int)p1 == 1 ? endPos : Tmp.v1).x = (float)p2 * tilesize; case colori -> ((int)p1 == 0 ? color1 : (int)p1 == 1 ? color2 : Tmp.c1).fromDouble(p2); } @@ -1179,7 +1180,7 @@ public class MapObjectives implements Iterable, Eachable, Eachable, Eachable= 0 && i < 4){ if(!Double.isNaN(x)) vertices[i * 6] = (float)x * tilesize; @@ -1270,11 +1272,16 @@ public class MapObjectives implements Iterable, Eachable= 0 && i < 4){ if(fetchedRegion == null) setTexture(textureName); - if(!Double.isNaN(u)) vertices[i * 6 + 3] = Mathf.map(Mathf.clamp((float)u), fetchedRegion.u, fetchedRegion.u2); - if(!Double.isNaN(v)) vertices[i * 6 + 4] = Mathf.map(1 - Mathf.clamp((float)v), fetchedRegion.v, fetchedRegion.v2); + if(!Double.isNaN(u)){ + boolean clampU = fetchedRegion.texture.getUWrap() != TextureWrap.mirroredRepeat && fetchedRegion.texture.getUWrap() != TextureWrap.repeat; + vertices[i * 6 + 3] = Mathf.map(clampU ? Mathf.clamp((float)u) : (float)u, fetchedRegion.u, fetchedRegion.u2); + } + if(!Double.isNaN(v)){ + boolean clampV = fetchedRegion.texture.getVWrap() != TextureWrap.mirroredRepeat && fetchedRegion.texture.getVWrap() != TextureWrap.repeat; + vertices[i * 6 + 4] = Mathf.map(clampV ? 1 - Mathf.clamp((float)v) : 1 - (float)v, fetchedRegion.v, fetchedRegion.v2); + } } } - } private static void lookupRegion(String name, TextureRegion out){