mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-07-20 04:37:31 +07:00
Fixed some block renderer and editor crashes
This commit is contained in:
@ -246,6 +246,10 @@ public class BlockRenderer{
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cacheChunk(int cx, int cy, boolean floor){
|
void cacheChunk(int cx, int cy, boolean floor){
|
||||||
|
if(cbatch == null){
|
||||||
|
createBatch();
|
||||||
|
}
|
||||||
|
|
||||||
cbatch.begin();
|
cbatch.begin();
|
||||||
Graphics.useBatch(cbatch);
|
Graphics.useBatch(cbatch);
|
||||||
|
|
||||||
@ -268,6 +272,10 @@ public class BlockRenderer{
|
|||||||
|
|
||||||
public void clearTiles(){
|
public void clearTiles(){
|
||||||
cache = null;
|
cache = null;
|
||||||
|
createBatch();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void createBatch(){
|
||||||
if(cbatch != null)
|
if(cbatch != null)
|
||||||
cbatch.dispose();
|
cbatch.dispose();
|
||||||
cbatch = new CacheBatch(Vars.world.width() * Vars.world.height() * 4);
|
cbatch = new CacheBatch(Vars.world.width() * Vars.world.height() * 4);
|
||||||
|
@ -17,11 +17,11 @@ public class DrawOperation implements Disposable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void undo() {
|
public void undo() {
|
||||||
pixmap.drawPixmap(from, 0, 0);
|
if(from != null) pixmap.drawPixmap(from, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void redo() {
|
public void redo() {
|
||||||
pixmap.drawPixmap(to, 0, 0);
|
if(to != null) pixmap.drawPixmap(to, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Reference in New Issue
Block a user