Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Sheikah45 committed Jul 15, 2024
1 parent 78e4862 commit f082a8a
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
22 changes: 11 additions & 11 deletions shared/src/main/java/com/faforever/neroxis/mask/FloatMask.java
Original file line number Diff line number Diff line change
Expand Up @@ -979,17 +979,17 @@ private FloatMask applyWithOffset(FloatMask other, BiIntFloatConsumer action, in
int smallerSize = StrictMath.min(size, otherSize);
int biggerSize = StrictMath.max(size, otherSize);
if (smallerSize == otherSize) {
Map<Integer, Integer> coordinateXMap = getShiftedCoordinateMap(xOffset, center, wrapEdges,
otherSize, size);
Map<Integer, Integer> coordinateYMap = getShiftedCoordinateMap(yOffset, center, wrapEdges,
otherSize, size);
other.apply((x, y) -> {
int shiftX = coordinateXMap.get(x);
int shiftY = coordinateYMap.get(y);
if (inBounds(shiftX, shiftY, size)) {
action.accept(shiftX, shiftY, other.getPrimitive(x, y));
}
});
Map<Integer, Integer> coordinateXMap = getShiftedCoordinateMap(xOffset, center, wrapEdges,
otherSize, size);
Map<Integer, Integer> coordinateYMap = getShiftedCoordinateMap(yOffset, center, wrapEdges,
otherSize, size);
other.apply((x, y) -> {
int shiftX = coordinateXMap.get(x);
int shiftY = coordinateYMap.get(y);
if (inBounds(shiftX, shiftY, size)) {
action.accept(shiftX, shiftY, other.getPrimitive(x, y));
}
});
} else {
Map<Integer, Integer> coordinateXMap = getShiftedCoordinateMap(xOffset, center, wrapEdges, size,
otherSize);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
import com.faforever.neroxis.util.vector.Vector2;

@SuppressWarnings({"unchecked", "UnusedReturnValue", "unused"})
public abstract sealed class OperationsMask<T, U extends OperationsMask<T, U>> extends Mask<T, U> permits ComparableMask, VectorMask {
public abstract sealed class OperationsMask<T, U extends OperationsMask<T, U>> extends Mask<T, U> permits
ComparableMask,
VectorMask {
protected OperationsMask(int size, Long seed, SymmetrySettings symmetrySettings, String name, boolean parallel) {
super(size, seed, symmetrySettings, name, parallel);
}
Expand Down

0 comments on commit f082a8a

Please sign in to comment.