Memory optimizations, multithreading fixes, uCore updated

This commit is contained in:
Anuken
2018-06-05 14:03:08 -04:00
parent c5ed0afb4e
commit 917e2e40fb
87 changed files with 1018 additions and 752 deletions

View File

@@ -25,6 +25,7 @@ import io.anuke.mindustry.type.Recipe;
import io.anuke.mindustry.world.Block;
import io.anuke.mindustry.world.Tile;
import io.anuke.ucore.core.*;
import io.anuke.ucore.entities.Entities;
import io.anuke.ucore.graphics.Draw;
import io.anuke.ucore.graphics.Lines;
import io.anuke.ucore.scene.Group;
@@ -80,16 +81,18 @@ public class AndroidInput extends InputHandler implements GestureListener{
/**Check and assign targets for a specific position.*/
void checkTargets(float x, float y){
Unit unit = Units.getClosestEnemy(player.getTeam(), x, y, 20f, u -> true);
synchronized (Entities.entityLock) {
Unit unit = Units.getClosestEnemy(player.getTeam(), x, y, 20f, u -> true);
if(unit != null){
player.target = unit;
}else{
Tile tile = world.tileWorld(x, y);
if(tile != null) tile = tile.target();
if (unit != null) {
player.target = unit;
} else {
Tile tile = world.tileWorld(x, y);
if (tile != null) tile = tile.target();
if(tile != null && state.teams.areEnemies(player.getTeam(), tile.getTeam())){
player.target = tile.entity;
if (tile != null && state.teams.areEnemies(player.getTeam(), tile.getTeam())) {
player.target = tile.entity;
}
}
}
}

View File

@@ -16,7 +16,7 @@ public class DefaultKeybinds {
for(String section : sections) {
KeyBinds.defaultSection(section, DeviceType.keyboard,
new Category("General"),
new Category("General"),
"move_x", new Axis(Input.A, Input.D),
"move_y", new Axis(Input.S, Input.W),
"select", Input.MOUSE_LEFT,
@@ -25,6 +25,7 @@ public class DefaultKeybinds {
"rotate_alt", new Axis(Input.R, Input.E),
"rotate", new Axis(Input.SCROLL),
"dash", Input.SHIFT_LEFT,
"drop_unit", Input.SHIFT_LEFT,
new Category("View"),
"zoom_hold", Input.CONTROL_LEFT,
"zoom", new Axis(Input.SCROLL),
@@ -45,7 +46,7 @@ public class DefaultKeybinds {
);
KeyBinds.defaultSection(section, DeviceType.controller,
new Category("General"),
new Category("General"),
"move_x", new Axis(Input.CONTROLLER_L_STICK_HORIZONTAL_AXIS),
"move_y", new Axis(Input.CONTROLLER_L_STICK_VERTICAL_AXIS),
"cursor_x", new Axis(Input.CONTROLLER_R_STICK_HORIZONTAL_AXIS),