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: svn://svn.code.sf.net/p/irrlicht/code/trunk@769 dfc29bdd-3216-0410-991c-e03cc46cb475
master
bitplane 2007-07-08 14:02:45 +00:00
parent 9cd0eca1ce
commit 569d6d8988
3 changed files with 13 additions and 3 deletions

View File

@ -1,5 +1,9 @@
Changes in version 1.4 (... 2007) 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 - Changed parameter order of addArrowMesh and added default parameters such
that it's enough to set the color (or even just the name). that it's enough to set the color (or even just the name).

View File

@ -802,7 +802,7 @@ inline f32 CSoftwareDriver2::texelarea ( const s4DVertex *v, int tex ) const
z = x0*y1 - x1*y0; z = x0*y1 - x1*y0;
const core::dimension2d<s32> &d = Texmap[tex].Texture->getOriginalSize(); const core::dimension2d<s32> &d = Texmap[tex].Texture->getMaxSize();
z *= d.Height; z *= d.Height;
z *= d.Width; z *= d.Width;
return z; 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 ) (v[1]->Tex[tex].y - v[0]->Tex[tex].y )
; ;
const core::dimension2d<s32> &d = Texmap[tex].Texture->getOriginalSize(); const core::dimension2d<s32> &d = Texmap[tex].Texture->getMaxSize();
z *= d.Height; z *= d.Height;
z *= d.Width; z *= d.Width;
return z; return z;

View File

@ -42,9 +42,15 @@ public:
//! Returns original size of the texture. //! Returns original size of the texture.
virtual const core::dimension2d<s32>& getOriginalSize() virtual const core::dimension2d<s32>& getOriginalSize()
{
//return MipMap[0]->getDimension();
return OrigSize;
}
//! Returns the size of the largest mipmap.
const core::dimension2d<s32>& getMaxSize()
{ {
return MipMap[0]->getDimension(); return MipMap[0]->getDimension();
//return OrigSize;
} }
//! Returns (=size) of the texture. //! Returns (=size) of the texture.