Fixed warning when trying to find a srgb format for a Depth format.

define_list_fix
Nehon 10 years ago
parent 9256f2e4d4
commit b0db53b5d6
  1. 2
      jme3-core/src/main/java/com/jme3/renderer/opengl/TextureUtil.java

@ -90,6 +90,8 @@ final class TextureUtil {
} }
public GLImageFormat getImageFormatWithError(Format fmt, boolean isSrgb) { public GLImageFormat getImageFormatWithError(Format fmt, boolean isSrgb) {
//if the passed format is one kind of depth there isno point in getting the srgb format;
isSrgb = isSrgb && fmt != Format.Depth && fmt != Format.Depth16 && fmt != Format.Depth24 && fmt != Format.Depth24Stencil8 && fmt != Format.Depth32 && fmt != Format.Depth32F;
GLImageFormat glFmt = getImageFormat(fmt, isSrgb); GLImageFormat glFmt = getImageFormat(fmt, isSrgb);
if (glFmt == null && isSrgb) { if (glFmt == null && isSrgb) {
glFmt = getImageFormat(fmt, false); glFmt = getImageFormat(fmt, false);

Loading…
Cancel
Save