Fixed up- scaling (thanks to Tom Robert Bryntesen)
This commit is contained in:
parent
08fc228d2c
commit
d3f675581f
|
@ -247,11 +247,20 @@ public class MipMap extends Util {
|
||||||
// store weighted pixel
|
// store weighted pixel
|
||||||
dst = (iy * widthOut + ix) * components;
|
dst = (iy * widthOut + ix) * components;
|
||||||
|
|
||||||
|
if (readPix == 0) {
|
||||||
|
// Image is sized up, caused by non power of two texture as input
|
||||||
|
src = (y0 * widthIn + x0) * components;
|
||||||
|
for (int ic = 0; ic < components; ic++) {
|
||||||
|
tempout[dst++] = tempin[src + ic];
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// sized down
|
||||||
for (k = 0; k < components; k++) {
|
for (k = 0; k < components; k++) {
|
||||||
tempout[dst++] = c[k] / readPix;
|
tempout[dst++] = c[k] / readPix;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// Convert temp output
|
// Convert temp output
|
||||||
|
|
Loading…
Reference in New Issue