1
0
mirror of https://github.com/Anuken/Mindustry.git synced 2024-11-11 14:56:10 +03:00

how did this compile

This commit is contained in:
Anuken 2020-04-23 00:16:41 -04:00
parent 362846bd68
commit 18b68fefed
16 changed files with 52 additions and 62 deletions

View File

@ -981,7 +981,7 @@ public class Blocks implements ContentList{
consumes.power(1.75f);
}};
massConveyor = new MassConveyor("mass-conveyor"){{
massConveyor = new PayloadConveyor("mass-conveyor"){{
requirements(Category.distribution, ItemStack.with(Items.copper, 1));
}};

View File

@ -6,7 +6,6 @@ import arc.graphics.Texture.*;
import arc.graphics.g2d.*;
import arc.graphics.gl.*;
import arc.util.*;
import mindustry.gen.*;
import static arc.Core.*;
import static mindustry.Vars.renderer;
@ -44,7 +43,8 @@ public class Pixelator implements Disposable{
Draw.rect(buffer);
Draw.blend();
Groups.drawNames();
//TODO set all of this up
//Groups.drawNames();
Core.camera.position.set(px, py);
renderer.setScale(pre);

View File

@ -36,7 +36,6 @@ public class BuildBlock extends Block{
this.size = size;
update = true;
health = 20;
layer = Layer.placement;
consumesTap = true;
solidifes = true;
buildBlocks[size - 1] = this;
@ -180,23 +179,23 @@ public class BuildBlock extends Block{
if(Core.atlas.isFound(previous.icon(Cicon.full))){
Draw.rect(previous.icon(Cicon.full), x, y, previous.rotate ? tile.rotation() * 90 : 0);
}
}
@Override
public void drawLayer(){
Shaders.blockbuild.color = Pal.accent;
Draw.draw(Layer.blockBuilding, () -> {
Draw.shader(Shaders.blockbuild);
Shaders.blockbuild.color = Pal.accent;
Block target = cblock == null ? previous : cblock;
Block target = cblock == null ? previous : cblock;
if(target == null) return;
if(target == null) return;
for(TextureRegion region : target.getGeneratedIcons()){
Shaders.blockbuild.region = region;
Shaders.blockbuild.progress = progress;
for(TextureRegion region : target.getGeneratedIcons()){
Shaders.blockbuild.region = region;
Shaders.blockbuild.progress = progress;
Draw.rect(region, x, y, target.rotate ? tile.rotation() * 90 : 0);
Draw.flush();
}
Draw.rect(region, x, y, target.rotate ? tile.rotation() * 90 : 0);
Draw.flush();
}
});
}
public boolean construct(Unitc builder, @Nullable Tilec core, float amount, boolean configured){

View File

@ -50,8 +50,8 @@ public class LiquidTurret extends Turret{
public class LiquidTurretEntity extends TurretEntity{
@Override
public void drawLayer(){
super.drawLayer();
public void draw(){
super.draw();
if(Core.atlas.isFound(reg(liquidRegion))){
Draw.color(liquids.current().color);

View File

@ -68,7 +68,6 @@ public abstract class Turret extends Block{
priority = TargetPriority.turret;
update = true;
solid = true;
layer = Layer.turret;
group = BlockGroup.turrets;
flags = EnumSet.of(BlockFlag.turret);
outlineIcon = true;
@ -127,10 +126,9 @@ public abstract class Turret extends Block{
public void draw(){
Draw.rect(baseRegion, x, y);
Draw.color();
}
@Override
public void drawLayer(){
Draw.z(Layer.turret);
tr2.trns(rotation, -recoil);
drawer.get(this);

View File

@ -4,6 +4,7 @@ import arc.*;
import arc.graphics.g2d.*;
import arc.math.*;
import arc.math.geom.*;
import mindustry.graphics.*;
import mindustry.world.*;
import static mindustry.Vars.*;
@ -17,7 +18,11 @@ public class ExtendingItemBridge extends ItemBridge{
public class ExtendingItemBridgeEntity extends ItemBridgeEntity{
@Override
public void drawLayer(){
public void draw(){
super.draw();
Draw.z(Layer.power);
Tile other = world.tile(link);
if(!linkValid(tile, other)) return;

View File

@ -229,7 +229,11 @@ public class ItemBridge extends Block{
}
@Override
public void drawLayer(){
public void draw(){
super.draw();
Draw.z(Layer.power);
Tile other = world.tile(link);
if(!linkValid(tile, other)) return;

View File

@ -37,10 +37,9 @@ public class MassDriver extends Block{
solid = true;
configurable = true;
hasItems = true;
layer = Layer.turret;
hasPower = true;
outlineIcon = true;
//point2 is relative
//point2 is relative
config(Point2.class, (tile, point) -> ((MassDriverEntity)tile).link = Point2.pack(point.x + tile.tileX(), point.y + tile.tileY()));
config(Integer.class, (tile, point) -> ((MassDriverEntity)tile).link = point);
}
@ -187,10 +186,9 @@ public class MassDriver extends Block{
@Override
public void draw(){
Draw.rect(baseRegion, x, y);
}
@Override
public void drawLayer(){
Draw.z(Layer.turret);
Draw.rect(region,
x + Angles.trnsx(rotation + 180f, reload * knockback),
y + Angles.trnsy(rotation + 180f, reload * knockback), rotation - 90);

View File

@ -17,15 +17,14 @@ import mindustry.world.blocks.payloads.*;
import static mindustry.Vars.*;
//TODO rename
public class MassConveyor extends Block{
public class PayloadConveyor extends Block{
public float moveTime = 70f;
public TextureRegion topRegion, edgeRegion;
public Interpolation interp = Interpolation.pow5;
public MassConveyor(String name){
public PayloadConveyor(String name){
super(name);
layer = Layer.overlay;
size = 3;
rotate = true;
update = true;
@ -161,14 +160,8 @@ public class MassConveyor extends Block{
Draw.rect(edgeRegion, x, y, i * 90);
}
}
}
@Override
public void drawLayer(){
//fract:
//0: arriving
//0.5: middle
//1: leaving
Draw.z(Layer.blockOver);
if(animation > fract()){
animation = Mathf.lerp(animation, 0.8f, 0.15f);
@ -177,7 +170,7 @@ public class MassConveyor extends Block{
animation = Math.max(animation, fract());
float fract = animation;
float rot = Mathf.slerp(itemRotation, rotation() * 90, fract);
rot = Mathf.slerp(itemRotation, rotation() * 90, fract);
if(fract < 0.5f){
Tmp.v1.trns(itemRotation + 180, (0.5f - fract) * tilesize * size);

View File

@ -11,15 +11,12 @@ public class TreeBlock extends Block{
public TreeBlock(String name){
super(name);
solid = true;
layer = Layer.power;
expanded = true;
}
@Override
public void drawBase(Tile tile){}
@Override
public void drawLayer(Tile tile){
public void drawBase(Tile tile){
Draw.z(Layer.power + 1);
Draw.rect(region, tile.worldx(), tile.worldy(), Mathf.randomSeed(tile.pos(), 0, 4) * 90);
}
}

View File

@ -33,7 +33,6 @@ public class PowerNode extends PowerBlock{
public PowerNode(String name){
super(name);
expanded = true;
layer = Layer.power;
configurable = true;
consumesPower = false;
outputsPower = false;
@ -372,9 +371,13 @@ public class PowerNode extends PowerBlock{
}
@Override
public void drawLayer(){
public void draw(){
super.draw();
if(Core.settings.getInt("lasersopacity") == 0) return;
Draw.z(Layer.power);
for(int i = 0; i < power.links.size; i++){
Tilec link = world.ent(power.links.get(i));

View File

@ -57,7 +57,6 @@ public class Drill extends Block{
super(name);
update = true;
solid = true;
layer = Layer.overlay;
group = BlockGroup.drills;
hasLiquids = true;
liquidCapacity = 5f;

View File

@ -3,7 +3,6 @@ package mindustry.world.blocks.production;
import arc.*;
import arc.graphics.*;
import arc.graphics.g2d.*;
import mindustry.graphics.*;
import mindustry.type.*;
import mindustry.ui.*;
import mindustry.world.*;
@ -20,7 +19,6 @@ public class Pump extends LiquidBlock{
public Pump(String name){
super(name);
layer = Layer.overlay;
group = BlockGroup.liquids;
floating = true;
}

View File

@ -193,8 +193,11 @@ public class CoreBlock extends StorageBlock{
}
@Override
public void drawLayer(){
public void draw(){
super.draw();
if(heat > 0.001f){
Draw.z(Layer.blockOver);
Drawf.drawRespawn(this, heat, progress, time, unitType, lastRequested);
}
}

View File

@ -31,8 +31,6 @@ public class RepairPoint extends Block{
update = true;
solid = true;
flags = EnumSet.of(BlockFlag.repair);
layer = Layer.turret;
layer2 = Layer.power;
hasPower = true;
outlineIcon = true;
}
@ -75,17 +73,12 @@ public class RepairPoint extends Block{
@Override
public void draw(){
Draw.rect(baseRegion, x, y);
}
@Override
public void drawLayer(){
Draw.z(Layer.turret);
Draw.rect(region, x, y, rotation - 90);
}
@Override
public void drawLayer2(){
if(target != null &&
Angles.angleDist(angleTo(target), rotation) < 30f){
if(target != null && Angles.angleDist(angleTo(target), rotation) < 30f){
Draw.z(Layer.power);
float ang = angleTo(target);
float len = 5f;

View File

@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=7c888f92ae770e9dc3b07439c32f64cc67c2a6a6
archash=ea82048b8e19cab088c1adff13e631599469ad12