Horde3D
http://horde3d.org/forums/

Bug with loading mipmaps of non-sq textures (w/ Fix)
http://horde3d.org/forums/viewtopic.php?f=3&t=767
Page 1 of 1

Author:  Dark_Kilauea [ 03.06.2009, 17:34 ]
Post subject:  Bug with loading mipmaps of non-sq textures (w/ Fix)

There is a bug within the DDS loader for the Texture resource. When a non-square texture is used (something like 1024x512 will do it), during mipmap loading, the smaller dimension will be reduced to 0, causing OpenGL to throw an INVALID_OPERATION error. Below I have a small fix that prevents this problem.

In egTextures.cpp, line 326 replace:
Code:
pixels += mipSize;
width >>= 1;
height >>= 1;

with:
Code:
pixels += mipSize;
width >>= 1;
if(width < 1) width = 1;
height >>= 1;
if(height < 1) height = 1;

Author:  marciano [ 07.06.2009, 09:56 ]
Post subject:  Re: Bug with loading mipmaps of non-sq textures (w/ Fix)

Thanks, this is fixed now.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/