Commit c3bc2fc4 authored by hybrid's avatar hybrid

Use helper method instead of local one.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1679 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 3ac05145
......@@ -124,14 +124,7 @@ void COpenGLTexture::getImageData(IImage* image)
return;
}
core::dimension2d<s32> nImageSize;
if (Driver->queryFeature(EVDF_TEXTURE_NPOT))
nImageSize=ImageSize;
else
{
nImageSize.Width = getTextureSizeFromSurfaceSize(ImageSize.Width);
nImageSize.Height = getTextureSizeFromSurfaceSize(ImageSize.Height);
}
const core::dimension2d<s32> nImageSize=ImageSize.getOptimalSize(!Driver->queryFeature(EVDF_TEXTURE_NPOT));
ECOLOR_FORMAT destFormat = getBestColorFormat(image->getColorFormat());
if (ImageSize==nImageSize)
......@@ -232,17 +225,6 @@ void COpenGLTexture::copyTexture(bool newTexture)
}
//! returns the size of a texture which would be the optimal size for rendering it
inline s32 COpenGLTexture::getTextureSizeFromSurfaceSize(s32 size) const
{
s32 ts = 0x01;
while(ts < size)
ts <<= 1;
return ts;
}
//! lock function
void* COpenGLTexture::lock(bool readOnly)
{
......
......@@ -114,9 +114,6 @@ protected:
//! \param: newTexture is true if method is called from a newly created texture for the first time. Otherwise call with false to improve memory handling.
void copyTexture(bool newTexture=true);
//! returns the size of a texture which would be optimal for rendering
inline s32 getTextureSizeFromSurfaceSize(s32 size) const;
core::dimension2d<s32> ImageSize;
COpenGLDriver* Driver;
IImage* Image;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment