Various crash fixes
This commit is contained in:
@@ -86,11 +86,10 @@ public class Renderer extends RendererModule{
|
|||||||
entity.data = data;
|
entity.data = data;
|
||||||
entity.id ++;
|
entity.id ++;
|
||||||
entity.set(x, y);
|
entity.set(x, y);
|
||||||
effectGroup.add(entity);
|
|
||||||
|
|
||||||
if(data instanceof BaseEntity){
|
if(data instanceof BaseEntity){
|
||||||
entity.setParent((BaseEntity)data);
|
entity.setParent((BaseEntity)data);
|
||||||
}
|
}
|
||||||
|
threads.runGraphics(() -> effectGroup.add(entity));
|
||||||
}else{
|
}else{
|
||||||
GroundEffectEntity entity = Pools.obtain(GroundEffectEntity.class);
|
GroundEffectEntity entity = Pools.obtain(GroundEffectEntity.class);
|
||||||
entity.effect = effect;
|
entity.effect = effect;
|
||||||
@@ -99,7 +98,7 @@ public class Renderer extends RendererModule{
|
|||||||
entity.id ++;
|
entity.id ++;
|
||||||
entity.data = data;
|
entity.data = data;
|
||||||
entity.set(x, y);
|
entity.set(x, y);
|
||||||
groundEffectGroup.add(entity);
|
threads.runGraphics(() -> groundEffectGroup.add(entity));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -71,7 +71,9 @@ public class BlockRenderer{
|
|||||||
Block block = tile.block();
|
Block block = tile.block();
|
||||||
|
|
||||||
if(!expanded && block != Blocks.air && world.isAccessible(worldx, worldy)){
|
if(!expanded && block != Blocks.air && world.isAccessible(worldx, worldy)){
|
||||||
block.drawShadow(tile);
|
synchronized (Tile.tileSetLock) {
|
||||||
|
block.drawShadow(tile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(!(block instanceof StaticBlock)){
|
if(!(block instanceof StaticBlock)){
|
||||||
@@ -130,12 +132,14 @@ public class BlockRenderer{
|
|||||||
layerBegins(req.layer);
|
layerBegins(req.layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(req.layer == Layer.block){
|
synchronized (Tile.tileSetLock) {
|
||||||
block.draw(req.tile);
|
if (req.layer == Layer.block) {
|
||||||
}else if(req.layer == block.layer){
|
block.draw(req.tile);
|
||||||
block.drawLayer(req.tile);
|
} else if (req.layer == block.layer) {
|
||||||
}else if(req.layer == block.layer2){
|
block.drawLayer(req.tile);
|
||||||
block.drawLayer2(req.tile);
|
} else if (req.layer == block.layer2) {
|
||||||
|
block.drawLayer2(req.tile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lastLayer = req.layer;
|
lastLayer = req.layer;
|
||||||
|
|||||||
@@ -94,6 +94,8 @@ public class MinimapRenderer implements Disposable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public TextureRegion getRegion() {
|
public TextureRegion getRegion() {
|
||||||
|
if(texture == null) return null;
|
||||||
|
|
||||||
int sz = Mathf.clamp(baseSize * zoom, baseSize, Math.min(world.width(), world.height()));
|
int sz = Mathf.clamp(baseSize * zoom, baseSize, Math.min(world.width(), world.height()));
|
||||||
float dx = (Core.camera.position.x / tilesize);
|
float dx = (Core.camera.position.x / tilesize);
|
||||||
float dy = (Core.camera.position.y / tilesize);
|
float dy = (Core.camera.position.y / tilesize);
|
||||||
|
|||||||
@@ -50,7 +50,10 @@ public class OverlayRenderer {
|
|||||||
//draw config selected block
|
//draw config selected block
|
||||||
if(input.frag.config.isShown()){
|
if(input.frag.config.isShown()){
|
||||||
Tile tile = input.frag.config.getSelectedTile();
|
Tile tile = input.frag.config.getSelectedTile();
|
||||||
tile.block().drawConfigure(tile);
|
|
||||||
|
synchronized (Tile.tileSetLock) {
|
||||||
|
tile.block().drawConfigure(tile);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
input.drawTop();
|
input.drawTop();
|
||||||
@@ -132,7 +135,9 @@ public class OverlayRenderer {
|
|||||||
drawbars.run();
|
drawbars.run();
|
||||||
}
|
}
|
||||||
|
|
||||||
target.block().drawSelect(target);
|
synchronized (Tile.tileSetLock) {
|
||||||
|
target.block().drawSelect(target);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -37,8 +37,6 @@ public class Minimap extends Table {
|
|||||||
|
|
||||||
renderer.fog().getTexture().setFilter(TextureFilter.Nearest, TextureFilter.Nearest);
|
renderer.fog().getTexture().setFilter(TextureFilter.Nearest, TextureFilter.Nearest);
|
||||||
|
|
||||||
//draw.getRegion().setV(draw.getRegion().getV2());
|
|
||||||
//draw.getRegion().setV2(v);
|
|
||||||
draw.getRegion().setTexture(renderer.fog().getTexture());
|
draw.getRegion().setTexture(renderer.fog().getTexture());
|
||||||
draw.getRegion().setV(1f - draw.getRegion().getV());
|
draw.getRegion().setV(1f - draw.getRegion().getV());
|
||||||
draw.getRegion().setV2(1f - draw.getRegion().getV2());
|
draw.getRegion().setV2(1f - draw.getRegion().getV2());
|
||||||
|
|||||||
@@ -55,6 +55,9 @@ public class Drill extends Block{
|
|||||||
protected boolean drawRim = false;
|
protected boolean drawRim = false;
|
||||||
|
|
||||||
protected Color heatColor = Color.valueOf("ff5512");
|
protected Color heatColor = Color.valueOf("ff5512");
|
||||||
|
protected TextureRegion rimRegion;
|
||||||
|
protected TextureRegion rotatorRegion;
|
||||||
|
protected TextureRegion topRegion;
|
||||||
|
|
||||||
public Drill(String name) {
|
public Drill(String name) {
|
||||||
super(name);
|
super(name);
|
||||||
@@ -68,6 +71,14 @@ public class Drill extends Block{
|
|||||||
hasItems = true;
|
hasItems = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void load() {
|
||||||
|
super.load();
|
||||||
|
rimRegion = Draw.region(name + "-rim");
|
||||||
|
rotatorRegion = Draw.region(name + "-rotator");
|
||||||
|
topRegion = Draw.region(name + "-top");
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(Tile tile) {
|
public void draw(Tile tile) {
|
||||||
float s = 0.3f;
|
float s = 0.3f;
|
||||||
@@ -81,14 +92,14 @@ public class Drill extends Block{
|
|||||||
Graphics.setAdditiveBlending();
|
Graphics.setAdditiveBlending();
|
||||||
Draw.color(heatColor);
|
Draw.color(heatColor);
|
||||||
Draw.alpha(entity.warmup * ts * (1f-s + Mathf.absin(Timers.time(), 3f, s)));
|
Draw.alpha(entity.warmup * ts * (1f-s + Mathf.absin(Timers.time(), 3f, s)));
|
||||||
Draw.rect(name + "-rim", tile.drawx(), tile.drawy());
|
Draw.rect(rimRegion, tile.drawx(), tile.drawy());
|
||||||
Draw.color();
|
Draw.color();
|
||||||
Graphics.setNormalBlending();
|
Graphics.setNormalBlending();
|
||||||
}
|
}
|
||||||
|
|
||||||
Draw.rect(name + "-rotator", tile.drawx(), tile.drawy(), entity.drillTime * rotateSpeed);
|
Draw.rect(rotatorRegion, tile.drawx(), tile.drawy(), entity.drillTime * rotateSpeed);
|
||||||
|
|
||||||
Draw.rect(name + "-top", tile.drawx(), tile.drawy());
|
Draw.rect(topRegion, tile.drawx(), tile.drawy());
|
||||||
|
|
||||||
if(!isMultiblock() && isValid(tile)) {
|
if(!isMultiblock() && isValid(tile)) {
|
||||||
Draw.color(tile.floor().drops.item.color);
|
Draw.color(tile.floor().drops.item.color);
|
||||||
|
|||||||
Reference in New Issue
Block a user