mirror of
https://github.com/shadowfacts/lwjgl2-arm64.git
synced 2026-03-26 07:04:49 +01:00
Fixed up- scaling (thanks to Tom Robert Bryntesen)
This commit is contained in:
parent
08fc228d2c
commit
d3f675581f
|
|
@ -247,9 +247,18 @@ 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 a new issue