Support of mods with textures in different resolution (HD or low-res) (#7602)

* HDustry - scl() & private map

Co-Authored-By: citrusMarmelade <20476281+citrusMarmelade@users.noreply.github.com>

* MEEP stop doing stuff when i work

<3 <3

* Replaced Draw.scl

Co-authored-by: citrusMarmelade <20476281+citrusMarmelade@users.noreply.github.com>
Co-authored-by: Anuken <arnukren@gmail.com>
This commit is contained in:
hortiSquash
2022-09-23 22:21:53 +02:00
committed by GitHub
parent 0e9e3de11f
commit 1d971231ca
19 changed files with 79 additions and 54 deletions

View File

@@ -1653,20 +1653,26 @@ public abstract class InputHandler implements InputProcessor, GestureListener{
public void drawArrow(Block block, int x, int y, int rotation, boolean valid){
float trns = (block.size / 2) * tilesize;
int dx = Geometry.d4(rotation).x, dy = Geometry.d4(rotation).y;
float offsetx = x * tilesize + block.offset + dx*trns;
float offsety = y * tilesize + block.offset + dy*trns;
Draw.color(!valid ? Pal.removeBack : Pal.accentBack);
Draw.rect(Core.atlas.find("place-arrow"),
x * tilesize + block.offset + dx*trns,
y * tilesize + block.offset - 1 + dy*trns,
Core.atlas.find("place-arrow").width * Draw.scl,
Core.atlas.find("place-arrow").height * Draw.scl, rotation * 90 - 90);
TextureRegion regionArrow = Core.atlas.find("place-arrow");
Draw.rect(regionArrow,
offsetx,
offsety - 1,
regionArrow.width * regionArrow.scl(),
regionArrow.height * regionArrow.scl(),
rotation * 90 - 90);
Draw.color(!valid ? Pal.remove : Pal.accent);
Draw.rect(Core.atlas.find("place-arrow"),
x * tilesize + block.offset + dx*trns,
y * tilesize + block.offset + dy*trns,
Core.atlas.find("place-arrow").width * Draw.scl,
Core.atlas.find("place-arrow").height * Draw.scl, rotation * 90 - 90);
Draw.rect(regionArrow,
offsetx,
offsety,
regionArrow.width * regionArrow.scl(),
regionArrow.height * regionArrow.scl(),
rotation * 90 - 90);
}
void iterateLine(int startX, int startY, int endX, int endY, Cons<PlaceLine> cons){