Skip to content

Commit

Permalink
fix D8 SpatialItem neighbor detection plus add working gradient :D
Browse files Browse the repository at this point in the history
  • Loading branch information
svencc committed Mar 11, 2024
1 parent 4060833 commit 377494d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ private int calculateForestFragment(

if (treeDensity < forestDensityThreshold) {
return mapScheme.getBaseColorForestBackground();
} else if (treeDensity >= forestDensityThreshold && surroundingForestNeighbourSpaces >= 5) {
} else if (treeDensity >= forestDensityThreshold && surroundingForestNeighbourSpaces >= 8) {
return mapScheme.getBaseColorForest();
} else {
return colorCalculator.modifyTransparency(mapScheme.getBaseColorForest(), surroundingForestNeighbourSpaces * 0.1);
return colorCalculator.modifyTransparency(mapScheme.getBaseColorForest(), (surroundingForestNeighbourSpaces + 1) * 0.125);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,11 +80,20 @@ private int calculateStructureFragment(

if (StructureDensity < structureDensityThreshold) {
return mapScheme.getBaseColorStructureBackground();
} else if (StructureDensity >= structureDensityThreshold && surroundingStructureNeighbourSpaces >= 5) {
} else if (StructureDensity >= structureDensityThreshold && surroundingStructureNeighbourSpaces >= 8) {
return mapScheme.getBaseColorStructure();
} else {
return colorCalculator.modifyTransparency(mapScheme.getBaseColorStructure(), surroundingStructureNeighbourSpaces * 0.1);
return colorCalculator.modifyTransparency(mapScheme.getBaseColorStructure(), surroundingStructureNeighbourSpaces * 0.125);
}

// if (StructureDensity < structureDensityThreshold) {
// return mapScheme.getBaseColorStructureBackground();
// } else if (StructureDensity >= structureDensityThreshold && surroundingStructureNeighbourSpaces >= 3) {
// return mapScheme.getBaseColorStructure();
// } else {
// int transparencyFactor = 0x04;
// return colorCalculator.setTransparency(mapScheme.getBaseColorStructure(), (surroundingStructureNeighbourSpaces + 1) * transparencyFactor);
// }
}

}

0 comments on commit 377494d

Please sign in to comment.