fixed brush drawing across chunk borders
This commit is contained in:
@@ -113,28 +113,26 @@ public class Level {
|
||||
iteratorX = chunkResX + startPtX + iteratorX;
|
||||
ptX = startPtX + iteratorX;
|
||||
|
||||
// right of chunk
|
||||
} else if (startPtX + iteratorX >= chunkResX) {
|
||||
chunkX++;
|
||||
ptX = startPtX + iteratorX - chunkResX;
|
||||
} else {
|
||||
ptX = startPtX + iteratorX;
|
||||
}
|
||||
|
||||
if (startPtX + iteratorX >= chunkResX) {
|
||||
chunkX++;
|
||||
ptX = startPtX + iteratorX - chunkResX;
|
||||
}
|
||||
int chunkY = y/chunkResY;
|
||||
|
||||
// above chunk
|
||||
if (startPtY + iteratorY < 0) {
|
||||
chunkY--;
|
||||
ptY = chunkResY + (startPtY + iteratorY);
|
||||
|
||||
// left of chunk
|
||||
} else if (startPtY + iteratorY >= chunkResY) {
|
||||
chunkY++;
|
||||
ptY = iteratorY % chunkResY;
|
||||
} else {
|
||||
ptY = startPtY + iteratorY;
|
||||
}
|
||||
if (startPtY + iteratorY >= chunkResY) {
|
||||
chunkY++;
|
||||
ptY = startPtY + iteratorY - chunkResY;
|
||||
}
|
||||
|
||||
// ignore everything outside
|
||||
if (chunkX < 0) continue;
|
||||
|
||||
Reference in New Issue
Block a user