Commit dee929e0 authored by hybrid's avatar hybrid

Fix the RTT POT sizes, which were now usually too small.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1617 dfc29bdd-3216-0410-991c-e03cc46cb475
parent a8912664
...@@ -30,7 +30,7 @@ namespace video ...@@ -30,7 +30,7 @@ namespace video
{ {
//! rendertarget constructor //! rendertarget constructor
CD3D9Texture::CD3D9Texture(CD3D9Driver* driver, core::dimension2d<s32> size, const char* name) CD3D9Texture::CD3D9Texture(CD3D9Driver* driver, const core::dimension2d<s32>& size, const char* name)
: ITexture(name), Texture(0), RTTSurface(0), Driver(driver), : ITexture(name), Texture(0), RTTSurface(0), Driver(driver),
TextureSize(size), ImageSize(size), Pitch(0), TextureSize(size), ImageSize(size), Pitch(0),
HasMipMaps(false), HardwareMipMaps(false), IsRenderTarget(true) HasMipMaps(false), HardwareMipMaps(false), IsRenderTarget(true)
...@@ -112,13 +112,9 @@ void CD3D9Texture::createRenderTarget() ...@@ -112,13 +112,9 @@ void CD3D9Texture::createRenderTarget()
if(!Driver->queryFeature(EVDF_TEXTURE_NPOT)) if(!Driver->queryFeature(EVDF_TEXTURE_NPOT))
{ {
TextureSize.Width = getTextureSizeFromSurfaceSize(TextureSize.Width); TextureSize.Width = getTextureSizeFromSurfaceSize(TextureSize.Width);
if (TextureSize.Width>1) // remove when larger RTTs are supported
TextureSize.Width >>= 1;
TextureSize.Height = getTextureSizeFromSurfaceSize(TextureSize.Height); TextureSize.Height = getTextureSizeFromSurfaceSize(TextureSize.Height);
if (TextureSize.Height>1) // remove when larger RTTs are supported if (TextureSize != ImageSize)
TextureSize.Height >>= 1; os::Printer::log("RenderTarget size has to be a power of two", ELL_INFORMATION);
os::Printer::log("RenderTarget size has to be a power of 2",ELL_WARNING);
} }
// get backbuffer format to create the render target in the // get backbuffer format to create the render target in the
......
...@@ -30,7 +30,7 @@ public: ...@@ -30,7 +30,7 @@ public:
u32 flags, const char* name); u32 flags, const char* name);
//! rendertarget constructor //! rendertarget constructor
CD3D9Texture(CD3D9Driver* driver, core::dimension2d<s32> size, const char* name); CD3D9Texture(CD3D9Driver* driver, const core::dimension2d<s32>& size, const char* name);
//! destructor //! destructor
virtual ~CD3D9Texture(); virtual ~CD3D9Texture();
......
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