Fixed items clipping into each other on conveyors
This commit is contained in:
@@ -157,16 +157,20 @@ public class Conveyor extends Block implements Autotiler{
|
|||||||
Draw.rect(regions[blendbits][frame], x, y, tilesize * blendsclx, tilesize * blendscly, rotation * 90);
|
Draw.rect(regions[blendbits][frame], x, y, tilesize * blendsclx, tilesize * blendscly, rotation * 90);
|
||||||
|
|
||||||
Draw.z(Layer.block - 0.1f);
|
Draw.z(Layer.block - 0.1f);
|
||||||
|
float layer = Layer.block - 0.1f, wwidth = world.unitWidth(), wheight = world.unitHeight(), scaling = 0.01f;
|
||||||
|
|
||||||
for(int i = 0; i < len; i++){
|
for(int i = 0; i < len; i++){
|
||||||
Item item = ids[i];
|
Item item = ids[i];
|
||||||
Tmp.v1.trns(rotation * 90, tilesize, 0);
|
Tmp.v1.trns(rotation * 90, tilesize, 0);
|
||||||
Tmp.v2.trns(rotation * 90, -tilesize / 2f, xs[i] * tilesize / 2f);
|
Tmp.v2.trns(rotation * 90, -tilesize / 2f, xs[i] * tilesize / 2f);
|
||||||
|
|
||||||
Draw.rect(item.fullIcon,
|
float
|
||||||
(x + Tmp.v1.x * ys[i] + Tmp.v2.x),
|
ix = (x + Tmp.v1.x * ys[i] + Tmp.v2.x),
|
||||||
(y + Tmp.v1.y * ys[i] + Tmp.v2.y),
|
iy = (y + Tmp.v1.y * ys[i] + Tmp.v2.y);
|
||||||
itemSize, itemSize);
|
|
||||||
|
//keep draw position deterministic.
|
||||||
|
Draw.z(layer + (ix / wwidth + iy / wheight) * scaling);
|
||||||
|
Draw.rect(item.fullIcon, ix, iy, itemSize, itemSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user