From 19435a22f4e2f69f70f2d6a200a8298b82cfdbeb Mon Sep 17 00:00:00 2001 From: cutealien Date: Wed, 16 Sep 2015 21:11:30 +0000 Subject: [PATCH] - Fix: CGUIImage no longer scales wrong when working with textures which don't have the original image size. - Fix CSoftwareTexture2 calculation for OriginalSize of ITexture. It had returned the changed texture size instead of the original one. git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5138 dfc29bdd-3216-0410-991c-e03cc46cb475 --- changes.txt | 2 ++ source/Irrlicht/CGUIImage.cpp | 2 +- source/Irrlicht/CSoftwareTexture2.cpp | 5 ++--- tests/tests-last-passed-at.txt | 8 ++++---- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/changes.txt b/changes.txt index 05d926b8..d195c67e 100644 --- a/changes.txt +++ b/changes.txt @@ -1,6 +1,8 @@ -------------------------- Changes in 1.9 (not yet released) +- Fix: CGUIImage no longer scales wrong when working with textures which don't have the original image size. +- Fix CSoftwareTexture2 calculation for OriginalSize of ITexture. It was returning the changed texture size instead of the original one before. - Fix skinned meshes not playing their last frame. Also clarified animation documentation to describe current behavior more exactly. - Add IWriteFile::flush interface (thx @ JLouisB for the patch). - CLightSceneNode::updateAbsolutePosition does now light recalculations. This is to fix using animators with lights. diff --git a/source/Irrlicht/CGUIImage.cpp b/source/Irrlicht/CGUIImage.cpp index 674da164..40057756 100644 --- a/source/Irrlicht/CGUIImage.cpp +++ b/source/Irrlicht/CGUIImage.cpp @@ -81,7 +81,7 @@ void CGUIImage::draw() core::rect sourceRect(SourceRect); if (sourceRect.getWidth() == 0 || sourceRect.getHeight() == 0) { - sourceRect = core::rect(core::dimension2di(Texture->getOriginalSize())); + sourceRect = core::rect(core::dimension2di(Texture->getSize())); } if (ScaleImage) diff --git a/source/Irrlicht/CSoftwareTexture2.cpp b/source/Irrlicht/CSoftwareTexture2.cpp index b8ba7130..28711660 100644 --- a/source/Irrlicht/CSoftwareTexture2.cpp +++ b/source/Irrlicht/CSoftwareTexture2.cpp @@ -32,7 +32,7 @@ CSoftwareTexture2::CSoftwareTexture2(IImage* image, const io::path& name, DriverType = EDT_BURNINGSVIDEO; ColorFormat = BURNINGSHADER_COLOR_FORMAT; IsRenderTarget = (Flags & IS_RENDERTARGET) != 0; - + memset32 ( MipMap, 0, sizeof ( MipMap ) ); if (image) @@ -76,7 +76,6 @@ CSoftwareTexture2::CSoftwareTexture2(IImage* image, const io::path& name, BURNINGSHADER_COLOR_FORMAT ); - OriginalSize = optSize; os::Printer::log ( buf, ELL_WARNING ); MipMap[0] = new CImage(BURNINGSHADER_COLOR_FORMAT, optSize); @@ -125,7 +124,7 @@ void CSoftwareTexture2::regenerateMipMapLevels(void* mipmapData) } core::dimension2d newSize; - core::dimension2d origSize = OriginalSize; + core::dimension2d origSize = Size; for (i=1; i < SOFTWARE_DRIVER_2_MIPMAPPING_MAX; ++i) { diff --git a/tests/tests-last-passed-at.txt b/tests/tests-last-passed-at.txt index 09c90efd..7ad3baf6 100644 --- a/tests/tests-last-passed-at.txt +++ b/tests/tests-last-passed-at.txt @@ -1,4 +1,4 @@ -Tests finished. 1 test of 1 passed. -Compiled as DEBUG -Test suite pass at GMT Sun Apr 19 19:36:40 2015 - +Tests finished. 1 test of 1 passed. +Compiled as DEBUG +Test suite pass at GMT Wed Sep 16 21:05:42 2015 +