mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-13 09:17:28 +07:00
Arc compat
This commit is contained in:
@ -185,7 +185,7 @@ public class Renderer implements ApplicationListener{
|
|||||||
effectBuffer.resize(graphics.getWidth(), graphics.getHeight());
|
effectBuffer.resize(graphics.getWidth(), graphics.getHeight());
|
||||||
}
|
}
|
||||||
|
|
||||||
Draw.proj(camera.projection());
|
Draw.proj(camera);
|
||||||
|
|
||||||
beginFx();
|
beginFx();
|
||||||
|
|
||||||
|
@ -228,6 +228,11 @@ abstract class TileComp implements Posc, Teamc, Healthc, Tilec, Timerc, QuadTree
|
|||||||
return Time.delta() * timeScale;
|
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. */
|
/** Base efficiency. If this entity has non-buffered power, returns the power %, otherwise returns 1. */
|
||||||
public float efficiency(){
|
public float efficiency(){
|
||||||
return power != null && (block.consumes.has(ConsumeType.power) && !block.consumes.getPower().buffered) ? power.status : 1f;
|
return power != null && (block.consumes.has(ConsumeType.power) && !block.consumes.getPower().buffered) ? power.status : 1f;
|
||||||
|
@ -157,7 +157,7 @@ public class BlockRenderer implements Disposable{
|
|||||||
shadows.end();
|
shadows.end();
|
||||||
shadowEvents.clear();
|
shadowEvents.clear();
|
||||||
|
|
||||||
Draw.proj(camera.projection());
|
Draw.proj(camera);
|
||||||
}
|
}
|
||||||
|
|
||||||
float ww = world.width() * tilesize, wh = world.height() * tilesize;
|
float ww = world.width() * tilesize, wh = world.height() * tilesize;
|
||||||
|
@ -119,7 +119,7 @@ public class FloorRenderer implements Disposable{
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
cbatch.setProjection(Core.camera.projection());
|
cbatch.setProjection(Core.camera.mat);
|
||||||
cbatch.beginDraw();
|
cbatch.beginDraw();
|
||||||
|
|
||||||
Gl.enable(Gl.blend);
|
Gl.enable(Gl.blend);
|
||||||
@ -185,7 +185,7 @@ public class FloorRenderer implements Disposable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void cacheChunkLayer(int cx, int cy, Chunk chunk, CacheLayer layer){
|
private void cacheChunkLayer(int cx, int cy, Chunk chunk, CacheLayer layer){
|
||||||
SpriteBatch current = Core.batch;
|
Batch current = Core.batch;
|
||||||
Core.batch = cbatch;
|
Core.batch = cbatch;
|
||||||
|
|
||||||
//begin a new cache
|
//begin a new cache
|
||||||
|
@ -180,7 +180,7 @@ public class MenuRenderer implements Disposable{
|
|||||||
Draw.color();
|
Draw.color();
|
||||||
shadows.end();
|
shadows.end();
|
||||||
|
|
||||||
SpriteBatch prev = Core.batch;
|
Batch prev = Core.batch;
|
||||||
|
|
||||||
Core.batch = batch = new CacheBatch(new SpriteCache(width * height * 6, false));
|
Core.batch = batch = new CacheBatch(new SpriteCache(width * height * 6, false));
|
||||||
batch.beginCache();
|
batch.beginCache();
|
||||||
@ -214,8 +214,8 @@ public class MenuRenderer implements Disposable{
|
|||||||
|
|
||||||
mat.set(Draw.proj());
|
mat.set(Draw.proj());
|
||||||
Draw.flush();
|
Draw.flush();
|
||||||
Draw.proj(camera.projection());
|
Draw.proj(camera);
|
||||||
batch.setProjection(camera.projection());
|
batch.setProjection(camera.mat);
|
||||||
batch.beginDraw();
|
batch.beginDraw();
|
||||||
batch.drawCache(cacheFloor);
|
batch.drawCache(cacheFloor);
|
||||||
batch.endDraw();
|
batch.endDraw();
|
||||||
|
@ -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);
|
||||||
|
}
|
||||||
|
}
|
@ -1,3 +1,3 @@
|
|||||||
org.gradle.daemon=true
|
org.gradle.daemon=true
|
||||||
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
org.gradle.jvmargs=-Xms256m -Xmx1024m
|
||||||
archash=3d5a2312ef867b76d996aacb9a00870899775b5e
|
archash=0dc4ad593d0b24c48dab44fdd4f39f2fd105fb60
|
||||||
|
Reference in New Issue
Block a user