Commit 5ae6b730 authored by Andrey Filippov's avatar Andrey Filippov

Refactored texture processing steps

parent 0b00f0ae
......@@ -391,6 +391,25 @@ public class TileNeibs{
for (int i = 0; i < tiles.length; i++) tiles[i] = !itiles[i];
}
public boolean [] getEdgeSelection(
int shrink, // grow tile selection by 1 over non-background tiles 1: 4 directions, 2 - 8 directions, 3 - 8 by 1, 4 by 1 more
boolean [] tiles,
boolean [] prohibit)
{
boolean [] etiles = new boolean [tiles.length];
for (int i = 0; i < tiles.length; i++) etiles[i] = !tiles[i];
growSelection(
shrink, // grow tile selection by 1 over non-background tiles 1: 4 directions, 2 - 8 directions, 3 - 8 by 1, 4 by 1 more
etiles,
prohibit);
for (int i = 0; i < tiles.length; i++) etiles[i] &= tiles[i];
return etiles;
}
public void growSelection(
int grow, // grow tile selection by 1 over non-background tiles 1: 4 directions, 2 - 8 directions, 3 - 8 by 1, 4 by 1 more
boolean [] tiles,
......@@ -630,7 +649,7 @@ public class TileNeibs{
}
return enum_clust_ordered;
}
public int getMax(
public static int getMax(
int [] data)
{
int mx = data[0];
......
......@@ -5662,7 +5662,7 @@ public class TilePlanes {
grown_sel, // boolean [] tiles,
false); // boolean ordered)
int num_clusters = tileNeibs.getMax(
int num_clusters = TileNeibs.getMax(
clusters); // int [] data)
if (num_clusters > 1){
boolean [] dbg_grown_sel =grown_sel.clone();
......@@ -5699,7 +5699,7 @@ public class TilePlanes {
clusters = tileNeibs.enumerateClusters(
grown_sel, // boolean [] tiles,
false); // boolean ordered)
num_clusters = tileNeibs.getMax(
num_clusters = TileNeibs.getMax(
clusters);
if (num_clusters > 1){
boolean [][] cluster_sels = new boolean [num_clusters][selections[np].length];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment