Fixed up- scaling (thanks to Tom Robert Bryntesen)
This commit is contained in:
parent
08fc228d2c
commit
d3f675581f
|
@ -247,8 +247,17 @@ public class MipMap extends Util {
|
|||
// store weighted pixel
|
||||
dst = (iy * widthOut + ix) * components;
|
||||
|
||||
for (k = 0; k < components; k++) {
|
||||
tempout[dst++] = c[k] / readPix;
|
||||
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++) {
|
||||
tempout[dst++] = c[k] / readPix;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue