DDSLoader: fix loading 16-bit images (as exported by PVRTexTool)

experimental
shadowislord 10 years ago
parent badefdf4e4
commit 629c007cd4
  1. 8
      jme3-core/src/plugins/java/com/jme3/texture/plugins/DDSLoader.java

@ -327,10 +327,18 @@ public class DDSLoader implements AssetLoader {
if (is(pfFlags, DDPF_RGB)) { if (is(pfFlags, DDPF_RGB)) {
if (is(pfFlags, DDPF_ALPHAPIXELS)) { if (is(pfFlags, DDPF_ALPHAPIXELS)) {
if (bpp == 16) {
pixelFormat = Format.RGB5A1;
} else {
pixelFormat = Format.RGBA8; pixelFormat = Format.RGBA8;
}
} else {
if (bpp == 16) {
pixelFormat = Format.RGB565;
} else { } else {
pixelFormat = Format.RGB8; pixelFormat = Format.RGB8;
} }
}
} else if (is(pfFlags, DDPF_GRAYSCALE) && is(pfFlags, DDPF_ALPHAPIXELS)) { } else if (is(pfFlags, DDPF_GRAYSCALE) && is(pfFlags, DDPF_ALPHAPIXELS)) {
switch (bpp) { switch (bpp) {
case 16: case 16:

Loading…
Cancel
Save