diff --git a/changes.txt b/changes.txt index facdb1c2..caba1abc 100644 --- a/changes.txt +++ b/changes.txt @@ -1,5 +1,9 @@ Changes in version 1.4 (... 2007) + - Fixed CSoftwareTexture2::getOriginalSize, reported by CaptainPants. Added a + new method CSoftwareTexture2::getMaxSize to return the size of the largest + mipmap, which is used by texelarea instead of getOriginalSize. + - Changed parameter order of addArrowMesh and added default parameters such that it's enough to set the color (or even just the name). diff --git a/source/Irrlicht/CSoftwareDriver2.cpp b/source/Irrlicht/CSoftwareDriver2.cpp index 633f3f72..0e20ee0e 100644 --- a/source/Irrlicht/CSoftwareDriver2.cpp +++ b/source/Irrlicht/CSoftwareDriver2.cpp @@ -802,7 +802,7 @@ inline f32 CSoftwareDriver2::texelarea ( const s4DVertex *v, int tex ) const z = x0*y1 - x1*y0; - const core::dimension2d &d = Texmap[tex].Texture->getOriginalSize(); + const core::dimension2d &d = Texmap[tex].Texture->getMaxSize(); z *= d.Height; z *= d.Width; return z; @@ -829,7 +829,7 @@ inline f32 CSoftwareDriver2::texelarea2 ( const s4DVertex **v, s32 tex ) const (v[1]->Tex[tex].y - v[0]->Tex[tex].y ) ; - const core::dimension2d &d = Texmap[tex].Texture->getOriginalSize(); + const core::dimension2d &d = Texmap[tex].Texture->getMaxSize(); z *= d.Height; z *= d.Width; return z; diff --git a/source/Irrlicht/CSoftwareTexture2.h b/source/Irrlicht/CSoftwareTexture2.h index 9bae3680..8fb9b896 100644 --- a/source/Irrlicht/CSoftwareTexture2.h +++ b/source/Irrlicht/CSoftwareTexture2.h @@ -42,9 +42,15 @@ public: //! Returns original size of the texture. virtual const core::dimension2d& getOriginalSize() + { + //return MipMap[0]->getDimension(); + return OrigSize; + } + + //! Returns the size of the largest mipmap. + const core::dimension2d& getMaxSize() { return MipMap[0]->getDimension(); - //return OrigSize; } //! Returns (=size) of the texture.