Fixed ugly oversized shadows in corner autotiles
This commit is contained in:
BIN
core/assets-raw/sprites/blocks/extra/shadow-corner.png
Normal file
BIN
core/assets-raw/sprites/blocks/extra/shadow-corner.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 197 B |
File diff suppressed because it is too large
Load Diff
Binary file not shown.
|
Before Width: | Height: | Size: 134 KiB After Width: | Height: | Size: 135 KiB |
@@ -36,29 +36,37 @@ public class Conduit extends LiquidBlock{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawShadow(Tile tile){
|
||||||
|
ConduitEntity entity = tile.entity();
|
||||||
|
|
||||||
|
if(entity.blendshadowrot == -1){
|
||||||
|
super.drawShadow(tile);
|
||||||
|
}else{
|
||||||
|
Draw.rect("shadow-corner", tile.drawx(), tile.drawy(), (tile.getRotation() + 3 + entity.blendshadowrot) * 90);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onProximityUpdate(Tile tile){
|
public void onProximityUpdate(Tile tile){
|
||||||
ConduitEntity entity = tile.entity();
|
ConduitEntity entity = tile.entity();
|
||||||
entity.blendbits = 0;
|
entity.blendbits = 0;
|
||||||
|
entity.blendshadowrot = -1;
|
||||||
|
|
||||||
if(blends(tile, 2) && blends(tile, 1) && blends(tile, 3)){
|
if(blends(tile, 2) && blends(tile, 1) && blends(tile, 3)){
|
||||||
entity.blendbits = 3;
|
entity.blendbits = 3;
|
||||||
}else if(blends(tile, 1) && blends(tile, 3)){
|
}else if(blends(tile, 1) && blends(tile, 3)){
|
||||||
entity.blendbits = 6;
|
entity.blendbits = 6;
|
||||||
}else if(blends(tile, 1) && blends(tile, 2)){
|
}else if(blends(tile, 1) && blends(tile, 2)){
|
||||||
entity.blendbits = 2;
|
entity.blendbits = 2;
|
||||||
}else if(blends(tile, 3) && blends(tile, 2)){
|
}else if(blends(tile, 3) && blends(tile, 2)){
|
||||||
entity.blendbits = 4;
|
entity.blendbits = 4;
|
||||||
}else if(blends(tile, 0)){
|
|
||||||
if(blends(tile, 1)){
|
|
||||||
entity.blendbits = 5;
|
|
||||||
}else if(blends(tile, 3)){
|
|
||||||
entity.blendbits = 1;
|
|
||||||
}
|
|
||||||
}else if(blends(tile, 1)){
|
}else if(blends(tile, 1)){
|
||||||
entity.blendbits = 5;
|
entity.blendbits = 5;
|
||||||
|
entity.blendshadowrot = 0;
|
||||||
}else if(blends(tile, 3)){
|
}else if(blends(tile, 3)){
|
||||||
entity.blendbits = 1;
|
entity.blendbits = 1;
|
||||||
|
entity.blendshadowrot = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -122,7 +130,9 @@ public class Conduit extends LiquidBlock{
|
|||||||
|
|
||||||
public static class ConduitEntity extends TileEntity{
|
public static class ConduitEntity extends TileEntity{
|
||||||
public float smoothLiquid;
|
public float smoothLiquid;
|
||||||
public byte blendbits;
|
|
||||||
|
byte blendbits;
|
||||||
|
int blendshadowrot;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(DataOutputStream stream) throws IOException{
|
public void write(DataOutputStream stream) throws IOException{
|
||||||
|
|||||||
@@ -32,7 +32,8 @@ public class Conveyor extends Block{
|
|||||||
private static ItemPos pos2 = new ItemPos();
|
private static ItemPos pos2 = new ItemPos();
|
||||||
private final Translator tr1 = new Translator();
|
private final Translator tr1 = new Translator();
|
||||||
private final Translator tr2 = new Translator();
|
private final Translator tr2 = new Translator();
|
||||||
private final TextureRegion[][] regions = new TextureRegion[7][4];
|
|
||||||
|
private TextureRegion[][] regions = new TextureRegion[7][4];
|
||||||
|
|
||||||
protected float speed = 0f;
|
protected float speed = 0f;
|
||||||
protected float carryCapacity = 8f;
|
protected float carryCapacity = 8f;
|
||||||
@@ -74,13 +75,25 @@ public class Conveyor extends Block{
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawShadow(Tile tile){
|
||||||
|
ConveyorEntity entity = tile.entity();
|
||||||
|
|
||||||
|
if(entity.blendshadowrot == -1){
|
||||||
|
super.drawShadow(tile);
|
||||||
|
}else{
|
||||||
|
Draw.rect("shadow-corner", tile.drawx(), tile.drawy(), (tile.getRotation() + 3 + entity.blendshadowrot) * 90);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Tile tile){
|
public void draw(Tile tile){
|
||||||
ConveyorEntity entity = tile.entity();
|
ConveyorEntity entity = tile.entity();
|
||||||
byte rotation = tile.getRotation();
|
byte rotation = tile.getRotation();
|
||||||
|
|
||||||
int frame = entity.clogHeat <= 0.5f ? (int) ((Timers.time() / 4f) % 4) : 0;
|
int frame = entity.clogHeat <= 0.5f ? (int) ((Timers.time() / 4f) % 4) : 0;
|
||||||
Draw.rect(regions[entity.blendbits][frame], tile.drawx(), tile.drawy(), tilesize * entity.blendsclx, tilesize * entity.blendscly, rotation*90);
|
Draw.rect(regions[entity.blendbits][frame], tile.drawx(), tile.drawy(),
|
||||||
|
tilesize * entity.blendsclx, tilesize * entity.blendscly, rotation*90);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -88,6 +101,7 @@ public class Conveyor extends Block{
|
|||||||
ConveyorEntity entity = tile.entity();
|
ConveyorEntity entity = tile.entity();
|
||||||
entity.blendbits = 0;
|
entity.blendbits = 0;
|
||||||
entity.blendsclx = entity.blendscly = 1;
|
entity.blendsclx = entity.blendscly = 1;
|
||||||
|
entity.blendshadowrot = -1;
|
||||||
|
|
||||||
if(blends(tile, 2) && blends(tile, 1) && blends(tile, 3)){
|
if(blends(tile, 2) && blends(tile, 1) && blends(tile, 3)){
|
||||||
entity.blendbits = 3;
|
entity.blendbits = 3;
|
||||||
@@ -98,18 +112,13 @@ public class Conveyor extends Block{
|
|||||||
}else if(blends(tile, 3) && blends(tile, 2)){
|
}else if(blends(tile, 3) && blends(tile, 2)){
|
||||||
entity.blendbits = 2;
|
entity.blendbits = 2;
|
||||||
entity.blendscly = -1;
|
entity.blendscly = -1;
|
||||||
}else if(blends(tile, 0)){
|
|
||||||
if(blends(tile, 1)){
|
|
||||||
entity.blendbits = 1;
|
|
||||||
entity.blendscly = -1;
|
|
||||||
}else if(blends(tile, 3)){
|
|
||||||
entity.blendbits = 1;
|
|
||||||
}
|
|
||||||
}else if(blends(tile, 1)){
|
}else if(blends(tile, 1)){
|
||||||
entity.blendbits = 1;
|
entity.blendbits = 1;
|
||||||
entity.blendscly = -1;
|
entity.blendscly = -1;
|
||||||
|
entity.blendshadowrot = 0;
|
||||||
}else if(blends(tile, 3)){
|
}else if(blends(tile, 3)){
|
||||||
entity.blendbits = 1;
|
entity.blendbits = 1;
|
||||||
|
entity.blendshadowrot = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -364,6 +373,8 @@ public class Conveyor extends Block{
|
|||||||
float minitem = 1;
|
float minitem = 1;
|
||||||
float carrying;
|
float carrying;
|
||||||
float minCarry = 2f;
|
float minCarry = 2f;
|
||||||
|
|
||||||
|
int blendshadowrot = -1;
|
||||||
int blendbits;
|
int blendbits;
|
||||||
int blendsclx, blendscly;
|
int blendsclx, blendscly;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user