Mobile improvements
This commit is contained in:
@@ -834,7 +834,9 @@ public class MapEditorDialog extends Dialog implements Disposable{
|
||||
|
||||
if(i == 0) editor.drawBlock = block;
|
||||
|
||||
if(++i % 6 == 0){
|
||||
int cols = mobile ? 4 : 6;
|
||||
|
||||
if(++i % cols == 0){
|
||||
blockSelection.row();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,7 +67,10 @@ public class MapRenderer implements Disposable{
|
||||
|
||||
Draw.flush();
|
||||
|
||||
renderer.blocks.floor.checkChanges();
|
||||
//don't process terrain updates every frame (helps with lag on low end devices)
|
||||
boolean doUpdate = Core.graphics.getFrameId() % 2 == 0;
|
||||
|
||||
if(doUpdate) renderer.blocks.floor.checkChanges();
|
||||
|
||||
boolean prev = renderer.animateWater;
|
||||
renderer.animateWater = false;
|
||||
@@ -84,7 +87,7 @@ public class MapRenderer implements Disposable{
|
||||
//scissors are always enabled because this is drawn clipped in UI, make sure they don't interfere with drawing shadow events
|
||||
Gl.disable(Gl.scissorTest);
|
||||
|
||||
renderer.blocks.processShadows();
|
||||
if(doUpdate) renderer.blocks.processShadows();
|
||||
|
||||
Gl.enable(Gl.scissorTest);
|
||||
|
||||
@@ -102,8 +105,10 @@ public class MapRenderer implements Disposable{
|
||||
|
||||
if(chunks == null) return;
|
||||
|
||||
recacheChunks.each(i -> recacheChunk(Point2.x(i), Point2.y(i)));
|
||||
recacheChunks.clear();
|
||||
if(doUpdate){
|
||||
recacheChunks.each(i -> recacheChunk(Point2.x(i), Point2.y(i)));
|
||||
recacheChunks.clear();
|
||||
}
|
||||
|
||||
shader.bind();
|
||||
shader.setUniformMatrix4("u_projTrans", Core.camera.mat);
|
||||
|
||||
@@ -11,6 +11,7 @@ import arc.scene.*;
|
||||
import arc.scene.event.*;
|
||||
import arc.scene.ui.layout.*;
|
||||
import arc.util.*;
|
||||
import mindustry.*;
|
||||
import mindustry.graphics.*;
|
||||
import mindustry.input.*;
|
||||
import mindustry.ui.*;
|
||||
@@ -18,7 +19,7 @@ import mindustry.ui.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
public class MapView extends Element implements GestureListener{
|
||||
EditorTool tool = EditorTool.pencil;
|
||||
EditorTool tool = Vars.mobile ? EditorTool.zoom : EditorTool.pencil;
|
||||
private float offsetx, offsety;
|
||||
private float zoom = 1f;
|
||||
private boolean grid = false;
|
||||
|
||||
Reference in New Issue
Block a user