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

Arc compat

This commit is contained in:
Anuken 2020-04-14 20:29:59 -04:00
parent c717084cb9
commit 51226d6c88
7 changed files with 71 additions and 8 deletions

View File

@ -185,7 +185,7 @@ public class Renderer implements ApplicationListener{
effectBuffer.resize(graphics.getWidth(), graphics.getHeight());
}
Draw.proj(camera.projection());
Draw.proj(camera);
beginFx();

View File

@ -228,6 +228,11 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
return Time.delta() * timeScale;
}
/** Efficiency * delta. */
public float edelta(){
return efficiency() * delta();
}
/** Base efficiency. If this entity has non-buffered power, returns the power %, otherwise returns 1. */
public float efficiency(){
return power != null && (block.consumes.has(ConsumeType.power) && !block.consumes.getPower().buffered) ? power.status : 1f;

View File

@ -157,7 +157,7 @@ public class BlockRenderer implements Disposable{
shadows.end();
shadowEvents.clear();
Draw.proj(camera.projection());
Draw.proj(camera);
}
float ww = world.width() * tilesize, wh = world.height() * tilesize;

View File

@ -119,7 +119,7 @@ public class FloorRenderer implements Disposable{
return;
}
cbatch.setProjection(Core.camera.projection());
cbatch.setProjection(Core.camera.mat);
cbatch.beginDraw();
Gl.enable(Gl.blend);
@ -185,7 +185,7 @@ public class FloorRenderer implements Disposable{
}
private void cacheChunkLayer(int cx, int cy, Chunk chunk, CacheLayer layer){
SpriteBatch current = Core.batch;
Batch current = Core.batch;
Core.batch = cbatch;
//begin a new cache

View File

@ -180,7 +180,7 @@ public class MenuRenderer implements Disposable{
Draw.color();
shadows.end();
SpriteBatch prev = Core.batch;
Batch prev = Core.batch;
Core.batch = batch = new CacheBatch(new SpriteCache(width * height * 6, false));
batch.beginCache();
@ -214,8 +214,8 @@ public class MenuRenderer implements Disposable{
mat.set(Draw.proj());
Draw.flush();
Draw.proj(camera.projection());
batch.setProjection(camera.projection());
Draw.proj(camera);
batch.setProjection(camera.mat);
batch.beginDraw();
batch.drawCache(cacheFloor);
batch.endDraw();

View File

@ -0,0 +1,58 @@
package mindustry.world.blocks.distribution;
import arc.math.geom.*;
import arc.util.ArcAnnotate.*;
import mindustry.gen.*;
import mindustry.graphics.*;
import mindustry.world.*;
public class MassConveyor extends Block{
public float moveTime = 70f;
public MassConveyor(String name){
super(name);
layer = Layer.overlay;
size = 3;
}
public class MassConveyorEntity extends TileEntity{
public Conveyable item;
public float progress;
public @Nullable Tilec next;
@Override
public void onProximityUpdate(){
super.onProximityUpdate();
next = front();
//next block must be aligned and of the same size
if(next.block().size != size || x + Geometry.d4[rotation()].x * size != next.tileX() || y + Geometry.d4[rotation()].y * size != next.tileY()){
next = null;
}
}
@Override
public void updateTile(){
progress += edelta();
if(progress >= moveTime){
//todo step
progress = 0;
}
}
@Override
public void draw(){
super.draw();
}
@Override
public void drawLayer(){
}
}
public interface Conveyable{
void drawConvey(float x, float y, float rotation);
}
}

View File

@ -1,3 +1,3 @@
org.gradle.daemon=true
org.gradle.jvmargs=-Xms256m -Xmx1024m
archash=3d5a2312ef867b76d996aacb9a00870899775b5e
archash=0dc4ad593d0b24c48dab44fdd4f39f2fd105fb60