Fixed blocks UV

This commit is contained in:
MihailRis
2023-11-12 14:03:31 +03:00
parent 33b61fb499
commit 8161d84e36
2 changed files with 6 additions and 4 deletions
+4 -2
View File
@@ -59,8 +59,10 @@ ImageData* add_atlas_margins(ImageData* image, int grid_size) {
if (srcdata[((soy+ly) * srcwidth + sox + lx) * 4 + 3]) {
for (int c = 0; c < 3; c++) {
int val = srcdata[((soy+ly) * srcwidth + sox + lx) * 4 + c];
dstdata[((doy+ly) * dstwidth + dox + lx + 1) * 4 + c] = val;
dstdata[((doy+ly + 1) * dstwidth + dox + lx) * 4 + c] = val;
if (dstdata[((doy+ly) * dstwidth + dox + lx + 1) * 4 + 3] == 0)
dstdata[((doy+ly) * dstwidth + dox + lx + 1) * 4 + c] = val;
if (dstdata[((doy+ly + 1) * dstwidth + dox + lx) * 4 + 3] == 0)
dstdata[((doy+ly + 1) * dstwidth + dox + lx) * 4 + c] = val;
}
}
}