From 0a8044a3ab8aa16f6cac3b27b83959e7e57f2df9 Mon Sep 17 00:00:00 2001 From: bitplane Date: Sun, 8 Jul 2007 14:02:45 +0000 Subject: [PATCH] fixed getOriginalSize in textures in Burning's renderer. Had to add a new method to get the size of the largest mipmap (getMaxSize), as the texelarea functions needed this value. git-svn-id: http://svn.code.sf.net/p/irrlicht/code/trunk@769 dfc29bdd-3216-0410-991c-e03cc46cb475 --- changes.txt | 4 ++++ source/Irrlicht/CSoftwareDriver2.cpp | 4 ++-- source/Irrlicht/CSoftwareTexture2.h | 8 +++++++- 3 files changed, 13 insertions(+), 3 deletions(-) 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.