Fix render-sorting so it works like intended

This commit is contained in:
Blue (Lukas Rieger) 2019-11-15 20:18:17 +01:00
parent 9b59483cbe
commit fafc5c4a47
2 changed files with 18 additions and 8 deletions

View File

@ -73,12 +73,17 @@ public RenderManager(World world, TileRenderer tileRenderer, Collection<Vector2i
if (v1Dist < v2Dist) return -1;
if (v1Dist > v2Dist) return 1;
if (v1SortGridPos.getY() < v2SortGridPos.getY()) return -1;
if (v1SortGridPos.getY() > v2SortGridPos.getY()) return 1;
if (v1SortGridPos.getX() < v2SortGridPos.getX()) return -1;
if (v1SortGridPos.getX() > v2SortGridPos.getX()) return 1;
}
if (v1.getY() < v1.getY()) return -1;
if (v1.getY() > v1.getY()) return 1;
if (v1.getX() < v1.getX()) return -1;
if (v1.getX() > v1.getX()) return 1;
if (v1.getY() < v2.getY()) return -1;
if (v1.getY() > v2.getY()) return 1;
if (v1.getX() < v2.getX()) return -1;
if (v1.getX() > v2.getX()) return 1;
return 0;
});

View File

@ -52,12 +52,17 @@ public void optimizeQueue() {
if (v1Dist < v2Dist) return -1;
if (v1Dist > v2Dist) return 1;
if (v1SortGridPos.getY() < v2SortGridPos.getY()) return -1;
if (v1SortGridPos.getY() > v2SortGridPos.getY()) return 1;
if (v1SortGridPos.getX() < v2SortGridPos.getX()) return -1;
if (v1SortGridPos.getX() > v2SortGridPos.getX()) return 1;
}
if (v1.getY() < v1.getY()) return -1;
if (v1.getY() > v1.getY()) return 1;
if (v1.getX() < v1.getX()) return -1;
if (v1.getX() > v1.getX()) return 1;
if (v1.getY() < v2.getY()) return -1;
if (v1.getY() > v2.getY()) return 1;
if (v1.getX() < v2.getX()) return -1;
if (v1.getX() > v2.getX()) return 1;
return 0;
});