Nothing interesting

This commit is contained in:
Anuken
2019-07-02 22:38:25 -04:00
parent 62e310a776
commit 79dc116e6a
10 changed files with 1697 additions and 1703 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 712 B

After

Width:  |  Height:  |  Size: 712 B

File diff suppressed because it is too large Load Diff

Binary file not shown.

Before

Width:  |  Height:  |  Size: 860 KiB

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 151 KiB

After

Width:  |  Height:  |  Size: 254 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 233 KiB

After

Width:  |  Height:  |  Size: 276 KiB

View File

@ -163,9 +163,9 @@ public class Renderer implements ApplicationListener{
blocks.floor.drawFloor();
drawAndInterpolate(groundEffectGroup, e -> e instanceof BelowLiquidTrait);
drawAndInterpolate(puddleGroup);
drawAndInterpolate(groundEffectGroup, e -> !(e instanceof BelowLiquidTrait));
draw(groundEffectGroup, e -> e instanceof BelowLiquidTrait);
draw(puddleGroup);
draw(groundEffectGroup, e -> !(e instanceof BelowLiquidTrait));
blocks.processBlocks();
@ -196,11 +196,11 @@ public class Renderer implements ApplicationListener{
drawAllTeams(true);
drawAndInterpolate(bulletGroup);
drawAndInterpolate(effectGroup);
draw(bulletGroup);
draw(effectGroup);
overlays.drawBottom();
drawAndInterpolate(playerGroup, p -> true, Player::drawBuildRequests);
draw(playerGroup, p -> true, Player::drawBuildRequests);
if(Entities.countInBounds(shieldGroup) > 0){
if(settings.getBool("animatedshields")){
@ -223,7 +223,7 @@ public class Renderer implements ApplicationListener{
overlays.drawTop();
drawAndInterpolate(playerGroup, p -> !p.isDead() && !p.isLocal, Player::drawName);
draw(playerGroup, p -> !p.isDead() && !p.isLocal, Player::drawName);
Draw.color();
Draw.flush();
@ -240,12 +240,12 @@ public class Renderer implements ApplicationListener{
for(EntityGroup<? extends BaseUnit> group : unitGroups){
if(!group.isEmpty()){
drawAndInterpolate(group, unit -> !unit.isDead(), draw::accept);
draw(group, unit -> !unit.isDead(), draw::accept);
}
}
if(!playerGroup.isEmpty()){
drawAndInterpolate(playerGroup, unit -> !unit.isDead(), draw::accept);
draw(playerGroup, unit -> !unit.isDead(), draw::accept);
}
Draw.color();
@ -257,12 +257,12 @@ public class Renderer implements ApplicationListener{
for(EntityGroup<? extends BaseUnit> group : unitGroups){
if(!group.isEmpty()){
drawAndInterpolate(group, unit -> unit.isFlying() && !unit.isDead(), baseUnit -> baseUnit.drawShadow(trnsX, trnsY));
draw(group, unit -> unit.isFlying() && !unit.isDead(), baseUnit -> baseUnit.drawShadow(trnsX, trnsY));
}
}
if(!playerGroup.isEmpty()){
drawAndInterpolate(playerGroup, unit -> unit.isFlying() && !unit.isDead(), player -> player.drawShadow(trnsX, trnsY));
draw(playerGroup, unit -> unit.isFlying() && !unit.isDead(), player -> player.drawShadow(trnsX, trnsY));
}
Draw.color();
@ -275,27 +275,27 @@ public class Renderer implements ApplicationListener{
if(group.count(p -> p.isFlying() == flying) +
playerGroup.count(p -> p.isFlying() == flying && p.getTeam() == team) == 0 && flying) continue;
drawAndInterpolate(unitGroups[team.ordinal()], u -> u.isFlying() == flying && !u.isDead(), Unit::drawUnder);
drawAndInterpolate(playerGroup, p -> p.isFlying() == flying && p.getTeam() == team && !p.isDead(), Unit::drawUnder);
draw(unitGroups[team.ordinal()], u -> u.isFlying() == flying && !u.isDead(), Unit::drawUnder);
draw(playerGroup, p -> p.isFlying() == flying && p.getTeam() == team && !p.isDead(), Unit::drawUnder);
drawAndInterpolate(unitGroups[team.ordinal()], u -> u.isFlying() == flying && !u.isDead(), Unit::drawAll);
drawAndInterpolate(playerGroup, p -> p.isFlying() == flying && p.getTeam() == team, Unit::drawAll);
draw(unitGroups[team.ordinal()], u -> u.isFlying() == flying && !u.isDead(), Unit::drawAll);
draw(playerGroup, p -> p.isFlying() == flying && p.getTeam() == team, Unit::drawAll);
blocks.drawTeamBlocks(Layer.turret, team);
drawAndInterpolate(unitGroups[team.ordinal()], u -> u.isFlying() == flying && !u.isDead(), Unit::drawOver);
drawAndInterpolate(playerGroup, p -> p.isFlying() == flying && p.getTeam() == team, Unit::drawOver);
draw(unitGroups[team.ordinal()], u -> u.isFlying() == flying && !u.isDead(), Unit::drawOver);
draw(playerGroup, p -> p.isFlying() == flying && p.getTeam() == team, Unit::drawOver);
}
}
public <T extends DrawTrait> void drawAndInterpolate(EntityGroup<T> group){
drawAndInterpolate(group, t -> true, DrawTrait::draw);
public <T extends DrawTrait> void draw(EntityGroup<T> group){
draw(group, t -> true, DrawTrait::draw);
}
public <T extends DrawTrait> void drawAndInterpolate(EntityGroup<T> group, Predicate<T> toDraw){
drawAndInterpolate(group, toDraw, DrawTrait::draw);
public <T extends DrawTrait> void draw(EntityGroup<T> group, Predicate<T> toDraw){
draw(group, toDraw, DrawTrait::draw);
}
public <T extends DrawTrait> void drawAndInterpolate(EntityGroup<T> group, Predicate<T> toDraw, Consumer<T> drawer){
public <T extends DrawTrait> void draw(EntityGroup<T> group, Predicate<T> toDraw, Consumer<T> drawer){
Entities.draw(group, toDraw, drawer);
}

View File

@ -22,6 +22,7 @@ public class MenuRenderer implements Disposable{
private Matrix3 mat = new Matrix3();
private FrameBuffer shadows;
private CacheBatch batch;
private Texture texture = new Texture("sprites/backgrounds/background-1.png");
public MenuRenderer(){
Time.mark();
@ -130,30 +131,36 @@ public class MenuRenderer implements Disposable{
}
public void render(){
float scaling = 4f;
camera.position.set(width * tilesize/2f, height * tilesize/2f);
camera.resize(Core.graphics.getWidth() / scaling,
Core.graphics.getHeight() /scaling);
mat.set(Draw.proj());
Draw.flush();
Draw.proj(camera.projection());
batch.setProjection(camera.projection());
batch.beginDraw();
batch.drawCache(cacheFloor);
batch.endDraw();
Draw.rect(Draw.wrap(shadows.getTexture()),
width * tilesize/2f - 4f, height * tilesize/2f - 4f,
width * tilesize, -height * tilesize);
Draw.flush();
batch.beginDraw();
batch.drawCache(cacheWall);
batch.endDraw();
Draw.proj(mat);
Draw.color(0f, 0f, 0f, darkness);
Fill.crect(0, 0, Core.graphics.getWidth(), Core.graphics.getHeight());
Draw.color();
float scale = 1f;
Draw.rect(Draw.wrap(texture), Core.graphics.getWidth()/2f, Core.graphics.getHeight()/2f, 2048 * scale, 2048 * scale);
if(false){
float scaling = 4f;
camera.position.set(width * tilesize / 2f, height * tilesize / 2f);
camera.resize(Core.graphics.getWidth() / scaling,
Core.graphics.getHeight() / scaling);
mat.set(Draw.proj());
Draw.flush();
Draw.proj(camera.projection());
batch.setProjection(camera.projection());
batch.beginDraw();
batch.drawCache(cacheFloor);
batch.endDraw();
Draw.rect(Draw.wrap(shadows.getTexture()),
width * tilesize / 2f - 4f, height * tilesize / 2f - 4f,
width * tilesize, -height * tilesize);
Draw.flush();
batch.beginDraw();
batch.drawCache(cacheWall);
batch.endDraw();
Draw.proj(mat);
Draw.color(0f, 0f, 0f, darkness);
Fill.crect(0, 0, Core.graphics.getWidth(), Core.graphics.getHeight());
Draw.color();
}
}
@Override

View File

@ -55,7 +55,7 @@ public class Pixelator implements Disposable{
Draw.rect(Draw.wrap(buffer.getTexture()), Core.camera.position.x, Core.camera.position.y, Core.camera.width, -Core.camera.height);
Draw.blend();
renderer.drawAndInterpolate(playerGroup, p -> !p.isDead() && !p.isLocal, Player::drawName);
renderer.draw(playerGroup, p -> !p.isDead() && !p.isLocal, Player::drawName);
Core.camera.position.set(px, py);
Core.settings.put("animatedwater", hadWater);

View File

@ -1,6 +1,7 @@
package io.anuke.mindustry.io;
import io.anuke.arc.collection.*;
import io.anuke.arc.util.Log;
import io.anuke.arc.util.Time;
import io.anuke.arc.util.io.CounterInputStream;
import io.anuke.mindustry.entities.Entities;
@ -240,6 +241,8 @@ public abstract class SaveVersion extends SaveFileReader{
readChunk(stream, true, in -> {
byte typeid = in.readByte();
byte version = in.readByte();
Log.info(typeid);
SaveTrait trait = (SaveTrait)TypeTrait.getTypeByID(typeid).get();
trait.readSave(in, version);
});

View File

@ -115,7 +115,7 @@ public class HudFragment extends Fragment{
int index = 0;
for(Element elem : children){
int fi = index++;
parent.add(elem);
parent.addChild(elem);
elem.visible(() -> {
if(fi < 4){
elem.setSize(size);
@ -214,9 +214,7 @@ public class HudFragment extends Fragment{
float[] position = {0, 0};
t.row();
t.addImageTextButton("$editor.removeunit", "icon-quit", "toggle", iconsize, () -> {
}).fillX().update(b -> {
t.addImageTextButton("$editor.removeunit", "icon-quit", "toggle", iconsize, () -> {}).fillX().update(b -> {
boolean[] found = {false};
if(b.isChecked()){
Element e = Core.scene.hit(Core.input.mouseX(), Core.input.mouseY(), true);