Arc compatibility update

This commit is contained in:
Anuken
2018-12-27 15:47:17 -05:00
parent 3b42b604e1
commit db546412f1
75 changed files with 255 additions and 285 deletions

View File

@@ -202,14 +202,14 @@ public class Mechs implements ContentList{
public void draw(Player player){
if(player.shootHeat <= 0.01f) return;
float alpha = Core.graphics.batch().getColor().a;
float alpha = Draw.getColor().a;
Shaders.build.progress = player.shootHeat;
Shaders.build.region = armorRegion;
Shaders.build.time = Time.time() / 10f;
Shaders.build.color.set(Palette.accent).a = player.shootHeat;
Draw.shader(Shaders.build);
Draw.alpha(1f);
Draw.rect(armorRegion, player.snappedX(), player.snappedY()).rot(player.rotation);
Draw.rect(armorRegion, player.snappedX(), player.snappedY(), player.rotation);
Draw.shader(Shaders.mix);
Draw.color(1f, 1f, 1f, alpha);
}
@@ -268,11 +268,13 @@ public class Mechs implements ContentList{
public void draw(Player player){
float scl = scld(player);
if(scl < 0.01f) return;
float alpha = Core.graphics.batch().getColor().a;
float alpha = Draw.getColor().a;
Draw.shader();
Draw.color(Palette.lancerLaser);
Draw.alpha(scl/2f);
Draw.rect(shield, player.snappedX() + Mathf.range(scl/2f), player.snappedY() + Mathf.range(scl/2f)).rot(player.rotation - 90).blend(Blending.additive);
Draw.blend(Blending.additive);
Draw.rect(shield, player.snappedX() + Mathf.range(scl/2f), player.snappedY() + Mathf.range(scl/2f), player.rotation - 90);
Draw.blend();
Draw.shader(Shaders.mix);
Draw.color();
Draw.alpha(alpha);

View File

@@ -58,7 +58,7 @@ public class TurretBlocks extends BlockList implements ContentList{
ammoUseEffect = ShootFx.shellEjectSmall;
health = 160;
drawer = (tile, entity) -> Draw.rect(entity.target != null ? shootRegion : region, tile.drawx() + tr2.x, tile.drawy() + tr2.y).rot(entity.rotation - 90);
drawer = (tile, entity) -> Draw.rect(entity.target != null ? shootRegion : region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
}
};
@@ -74,11 +74,11 @@ public class TurretBlocks extends BlockList implements ContentList{
health = 360;
drawer = (tile, entity) -> {
Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y).rot(entity.rotation - 90);
Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
Draw.color(entity.liquids.current().color);
Draw.alpha(entity.liquids.total() / liquidCapacity);
Draw.rect(name + "-liquid", tile.drawx() + tr2.x, tile.drawy() + tr2.y).rot(entity.rotation - 90).color(entity.liquids.current().color);
Draw.rect(name + "-liquid", tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
Draw.color();
};
}};
@@ -157,7 +157,7 @@ public class TurretBlocks extends BlockList implements ContentList{
ammoUseEffect = ShootFx.shellEjectBig;
drawer = (tile, entity) -> {
Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y).rot(entity.rotation - 90);
Draw.rect(region, tile.drawx() + tr2.x, tile.drawy() + tr2.y, entity.rotation - 90);
float offsetx = (int) (abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 3f);
float offsety = -(int) (abscurve(Mathf.curve(entity.reload / reload, 0.3f, 0.2f)) * 2f);
@@ -165,7 +165,7 @@ public class TurretBlocks extends BlockList implements ContentList{
float rot = entity.rotation + 90 * i;
Draw.rect(panels[i == -1 ? 0 : 1],
tile.drawx() + tr2.x + Angles.trnsx(rot, offsetx, offsety),
tile.drawy() + tr2.y + Angles.trnsy(rot, -offsetx, offsety)).rot(entity.rotation - 90);
tile.drawy() + tr2.y + Angles.trnsy(rot, -offsetx, offsety), entity.rotation - 90);
}
};

View File

@@ -346,10 +346,10 @@ public class TurretBullets extends BulletList implements ContentList{
float w = 11f, h = 13f;
Draw.color(Palette.bulletYellowBack);
Draw.rect("shell-back", b.x, b.y, w, h).rot(b.angle() + 90);
Draw.rect("shell-back", b.x, b.y, w, h, b.angle() + 90);
Draw.color(Palette.bulletYellow);
Draw.rect("shell", b.x, b.y, w, h).rot(b.angle() + 90);
Draw.rect("shell", b.x, b.y, w, h, b.angle() + 90);
Draw.reset();
}

View File

@@ -1,5 +1,6 @@
package io.anuke.mindustry.content.fx;
import io.anuke.arc.Core;
import io.anuke.arc.entities.Effects.Effect;
import io.anuke.arc.graphics.Color;
import io.anuke.arc.graphics.g2d.Draw;
@@ -108,10 +109,9 @@ public class ShootFx extends FxList implements ContentList{
float len = (2f + e.finpow() * 6f) * i;
float lr = rot + e.fin() * 30f * i;
Draw.rect("white",
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
Fill.rect(e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
1f, 2f).rot(rot + e.fin() * 50f * i);
1f, 2f, rot + e.fin() * 50f * i);
Draw.color();
});
@@ -122,10 +122,10 @@ public class ShootFx extends FxList implements ContentList{
for(int i : Mathf.signs){
float len = (2f + e.finpow() * 10f) * i;
float lr = rot + e.fin() * 20f * i;
Draw.rect("casing",
Draw.rect(Core.atlas.find("casing"),
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
2f, 3f).rot(rot);
2f, 3f, rot);
}
Draw.color(Color.LIGHT_GRAY, Color.GRAY, e.fin());
@@ -145,11 +145,11 @@ public class ShootFx extends FxList implements ContentList{
for(int i : Mathf.signs){
float len = (4f + e.finpow() * 8f) * i;
float lr = rot + Mathf.randomSeedRange(e.id + i + 6, 20f * e.fin()) * i;
Draw.rect("casing",
Draw.rect(Core.atlas.find("casing"),
e.x + Angles.trnsx(lr, len) + Mathf.randomSeedRange(e.id + i + 7, 3f * e.fin()),
e.y + Angles.trnsy(lr, len) + Mathf.randomSeedRange(e.id + i + 8, 3f * e.fin()),
2.5f, 4f)
.rot(rot + e.fin() * 30f * i + Mathf.randomSeedRange(e.id + i + 9, 40f * e.fin()));
2.5f, 4f,
rot + e.fin() * 30f * i + Mathf.randomSeedRange(e.id + i + 9, 40f * e.fin()));
}
Draw.color(Color.LIGHT_GRAY);