Commit ced47d4e authored by hybrid's avatar hybrid

Removed BMP_Writer reference from softwaretexture2. Changed texture size check...

Removed BMP_Writer reference from softwaretexture2. Changed texture size check to use the new dimension2d function.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1783 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 4a4c48ac
......@@ -9,15 +9,12 @@
#include "SoftwareDriver2_helper.h"
#include "CSoftwareTexture2.h"
#include "os.h"
#include "CImageWriterBMP.h"
namespace irr
{
namespace video
{
IImageWriter* createImageWriterBMP();
//! constructor
CSoftwareTexture2::CSoftwareTexture2(IImage* image, const char* name, bool generateMipLevels, bool isRenderTarget)
: ITexture(name), MipMapLOD(0), HasMipMaps(generateMipLevels), IsRenderTarget(isRenderTarget)
......@@ -34,12 +31,10 @@ CSoftwareTexture2::CSoftwareTexture2(IImage* image, const char* name, bool gener
if (image)
{
core::dimension2d<s32> optSize;
OrigSize = image->getDimension();
optSize.Width = getTextureSizeFromSurfaceSize(OrigSize.Width);
optSize.Height = getTextureSizeFromSurfaceSize(OrigSize.Height);
core::dimension2d<s32> optSize(
OrigSize.getOptimalSize(true, false, false));
if ( OrigSize == optSize )
{
......@@ -74,22 +69,6 @@ CSoftwareTexture2::~CSoftwareTexture2()
}
//! returns the size of a texture which would be the optimize size for rendering it
s32 CSoftwareTexture2::getTextureSizeFromSurfaceSize(s32 size) const
{
s32 ts = 0x01;
while(ts < size)
ts <<= 1;
if ( ts > size )
ts >>= 1;
//ts = core::s32_min ( ts, 256 );
return ts;
}
//! Regenerates the mip map levels of the texture. Useful after locking and
//! modifying the texture
void CSoftwareTexture2::regenerateMipMapLevels()
......
......@@ -114,10 +114,6 @@ public:
}
private:
//! returns the size of a texture which would be the optimize size for rendering it
s32 getTextureSizeFromSurfaceSize(s32 size) const;
core::dimension2d<s32> OrigSize;
CImage * MipMap[SOFTWARE_DRIVER_2_MIPMAPPING_MAX];
......
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