From b0db53b5d62013b4551150d9d1ff9b7122e30c85 Mon Sep 17 00:00:00 2001 From: Nehon Date: Tue, 14 Jul 2015 09:41:55 +0200 Subject: [PATCH] Fixed warning when trying to find a srgb format for a Depth format. --- .../src/main/java/com/jme3/renderer/opengl/TextureUtil.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jme3-core/src/main/java/com/jme3/renderer/opengl/TextureUtil.java b/jme3-core/src/main/java/com/jme3/renderer/opengl/TextureUtil.java index a2f21ceaa..fb6032393 100644 --- a/jme3-core/src/main/java/com/jme3/renderer/opengl/TextureUtil.java +++ b/jme3-core/src/main/java/com/jme3/renderer/opengl/TextureUtil.java @@ -90,9 +90,11 @@ final class TextureUtil { } 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); if (glFmt == null && isSrgb) { - glFmt = getImageFormat(fmt, false); + glFmt = getImageFormat(fmt, false); logger.log(Level.WARNING, "No sRGB format available for ''{0}''. Failling back to linear.", fmt); } if (glFmt == null) {