Added incomplete procedural map generator

This commit is contained in:
Anuken
2018-06-20 16:16:59 -04:00
parent 2884e4b847
commit 23d621e9c7
10 changed files with 96 additions and 15 deletions

View File

@@ -220,7 +220,7 @@ public class FloorRenderer {
Timers.mark();
int chunksx = world.width() / chunksize, chunksy = world.height() / chunksize;
int chunksx = Mathf.ceil((float)world.width() / chunksize), chunksy = Mathf.ceil((float)world.height() / chunksize);
cache = new Chunk[chunksx][chunksy];
cbatch = new CacheBatch(world.width()*world.height()*4*4);

View File

@@ -1,6 +1,7 @@
package io.anuke.mindustry.graphics;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Pixmap.Format;
import com.badlogic.gdx.graphics.Texture;
@@ -34,6 +35,7 @@ public class MinimapRenderer implements Disposable{
private TextureRegion region;
private Rectangle rect = new Rectangle();
private Rectangle clipRect = new Rectangle();
private Color tmpColor = new Color();
private int zoom = 4;
public MinimapRenderer(){
@@ -138,6 +140,11 @@ public class MinimapRenderer implements Disposable{
private int colorFor(Tile tile){
int color = tile.breakable() ? tile.target().getTeam().intColor : ColorMapper.getColor(tile.block());
if(color == 0) color = ColorMapper.getColor(tile.floor());
if(tile.cliffs != 0){
tmpColor.set(color);
tmpColor.mul(1.5f, 1.5f, 1.5f, 1f);
color = Color.rgba8888(tmpColor);
}
return color;
}