* Allow loading non-square power-of-2 textures without resize

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@8470 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..rd 13 years ago
parent 130283914e
commit afbf8ad69d
  1. 3
      engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglGL1Renderer.java
  2. 3
      engine/src/lwjgl-ogl/com/jme3/renderer/lwjgl/LwjglRenderer.java

@ -743,8 +743,7 @@ public class LwjglGL1Renderer implements GL1Renderer {
if (!GLContext.getCapabilities().GL_ARB_texture_non_power_of_two) {
if (img.getWidth() != 0 && img.getHeight() != 0) {
if (!FastMath.isPowerOfTwo(img.getWidth())
|| !FastMath.isPowerOfTwo(img.getHeight())
|| img.getWidth() != img.getHeight()) {
|| !FastMath.isPowerOfTwo(img.getHeight())) {
// Resize texture to Power-of-2 size
MipMapGenerator.resizeToPowerOf2(img);

@ -1871,8 +1871,7 @@ public class LwjglRenderer implements Renderer {
if (img.getWidth() != 0 && img.getHeight() != 0) {
if (!FastMath.isPowerOfTwo(img.getWidth())
|| !FastMath.isPowerOfTwo(img.getHeight())
|| img.getWidth() != img.getHeight()) {
|| !FastMath.isPowerOfTwo(img.getHeight())) {
// logger.log(Level.WARNING, "Encountered NPOT texture {0}, "
// + "it might not display correctly.", img);

Loading…
Cancel
Save