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 @@ ...@@ -9,15 +9,12 @@
#include "SoftwareDriver2_helper.h" #include "SoftwareDriver2_helper.h"
#include "CSoftwareTexture2.h" #include "CSoftwareTexture2.h"
#include "os.h" #include "os.h"
#include "CImageWriterBMP.h"
namespace irr namespace irr
{ {
namespace video namespace video
{ {
IImageWriter* createImageWriterBMP();
//! constructor //! constructor
CSoftwareTexture2::CSoftwareTexture2(IImage* image, const char* name, bool generateMipLevels, bool isRenderTarget) CSoftwareTexture2::CSoftwareTexture2(IImage* image, const char* name, bool generateMipLevels, bool isRenderTarget)
: ITexture(name), MipMapLOD(0), HasMipMaps(generateMipLevels), IsRenderTarget(isRenderTarget) : ITexture(name), MipMapLOD(0), HasMipMaps(generateMipLevels), IsRenderTarget(isRenderTarget)
...@@ -34,12 +31,10 @@ CSoftwareTexture2::CSoftwareTexture2(IImage* image, const char* name, bool gener ...@@ -34,12 +31,10 @@ CSoftwareTexture2::CSoftwareTexture2(IImage* image, const char* name, bool gener
if (image) if (image)
{ {
core::dimension2d<s32> optSize;
OrigSize = image->getDimension(); OrigSize = image->getDimension();
optSize.Width = getTextureSizeFromSurfaceSize(OrigSize.Width); core::dimension2d<s32> optSize(
optSize.Height = getTextureSizeFromSurfaceSize(OrigSize.Height); OrigSize.getOptimalSize(true, false, false));
if ( OrigSize == optSize ) if ( OrigSize == optSize )
{ {
...@@ -74,22 +69,6 @@ CSoftwareTexture2::~CSoftwareTexture2() ...@@ -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 //! Regenerates the mip map levels of the texture. Useful after locking and
//! modifying the texture //! modifying the texture
void CSoftwareTexture2::regenerateMipMapLevels() void CSoftwareTexture2::regenerateMipMapLevels()
......
...@@ -114,10 +114,6 @@ public: ...@@ -114,10 +114,6 @@ public:
} }
private: 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; core::dimension2d<s32> OrigSize;
CImage * MipMap[SOFTWARE_DRIVER_2_MIPMAPPING_MAX]; 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