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

View File

@ -22,6 +22,7 @@ public class MenuRenderer implements Disposable{
private Matrix3 mat = new Matrix3(); private Matrix3 mat = new Matrix3();
private FrameBuffer shadows; private FrameBuffer shadows;
private CacheBatch batch; private CacheBatch batch;
private Texture texture = new Texture("sprites/backgrounds/background-1.png");
public MenuRenderer(){ public MenuRenderer(){
Time.mark(); Time.mark();
@ -130,10 +131,15 @@ public class MenuRenderer implements Disposable{
} }
public void render(){ public void render(){
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; float scaling = 4f;
camera.position.set(width * tilesize/2f, height * tilesize/2f); camera.position.set(width * tilesize / 2f, height * tilesize / 2f);
camera.resize(Core.graphics.getWidth() / scaling, camera.resize(Core.graphics.getWidth() / scaling,
Core.graphics.getHeight() /scaling); Core.graphics.getHeight() / scaling);
mat.set(Draw.proj()); mat.set(Draw.proj());
Draw.flush(); Draw.flush();
@ -143,7 +149,7 @@ public class MenuRenderer implements Disposable{
batch.drawCache(cacheFloor); batch.drawCache(cacheFloor);
batch.endDraw(); batch.endDraw();
Draw.rect(Draw.wrap(shadows.getTexture()), Draw.rect(Draw.wrap(shadows.getTexture()),
width * tilesize/2f - 4f, height * tilesize/2f - 4f, width * tilesize / 2f - 4f, height * tilesize / 2f - 4f,
width * tilesize, -height * tilesize); width * tilesize, -height * tilesize);
Draw.flush(); Draw.flush();
batch.beginDraw(); batch.beginDraw();
@ -155,6 +161,7 @@ public class MenuRenderer implements Disposable{
Fill.crect(0, 0, Core.graphics.getWidth(), Core.graphics.getHeight()); Fill.crect(0, 0, Core.graphics.getWidth(), Core.graphics.getHeight());
Draw.color(); Draw.color();
} }
}
@Override @Override
public void dispose(){ public void dispose(){

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.rect(Draw.wrap(buffer.getTexture()), Core.camera.position.x, Core.camera.position.y, Core.camera.width, -Core.camera.height);
Draw.blend(); 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.camera.position.set(px, py);
Core.settings.put("animatedwater", hadWater); Core.settings.put("animatedwater", hadWater);

View File

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

View File

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