From: frohlich Date: Sun, 12 Nov 2006 07:28:59 +0000 (+0000) Subject: Modified Files: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=51bb2974bca27be3c9e68fb88953dabd097248f6;p=simgear.git Modified Files: model.cxx: Leave it to osg when to do mipmapping. --- diff --git a/simgear/scene/model/model.cxx b/simgear/scene/model/model.cxx index e72554f4..acc8a1f8 100644 --- a/simgear/scene/model/model.cxx +++ b/simgear/scene/model/model.cxx @@ -37,18 +37,6 @@ SG_USING_STD(vector); SG_USING_STD(set); -static inline -int nMipMaps(int s) -{ - s = s >> 2; - int n = 0; - do { - ++n; - s = s >> 1; - } while(s); - return n; -} - // Little helper class that holds an extra reference to a // loaded 3d model. // Since we clone all structural nodes from our 3d models, @@ -154,15 +142,6 @@ public: int s = image->s(); int t = image->t(); - - int mipmaplevels = 0; - if (s < t) { - mipmaplevels = nMipMaps(s); - } else { - mipmaplevels = nMipMaps(t); - } - texture->setNumMipmapLevels(mipmaplevels); - if (s <= t && 32 <= s) { texture->setInternalFormatMode(mFormatMode); } else if (t < s && 32 <= t) { @@ -344,8 +323,7 @@ public: static SGReadCallbackInstaller readCallbackInstaller; osg::Texture2D* -SGLoadTexture2D(const std::string& path, bool wrapu, bool wrapv, - int mipmaplevels) +SGLoadTexture2D(const std::string& path, bool wrapu, bool wrapv, int) { osg::Image* image = osgDB::readImageFile(path); osg::Texture2D* texture = new osg::Texture2D; @@ -363,15 +341,6 @@ SGLoadTexture2D(const std::string& path, bool wrapu, bool wrapv, int s = image->s(); int t = image->t(); - if (mipmaplevels < 0) { - if (s < t) { - mipmaplevels = nMipMaps(s); - } else { - mipmaplevels = nMipMaps(t); - } - } - texture->setNumMipmapLevels(mipmaplevels); - // OSGFIXME: guard with a flag if (osg::Texture::getExtensions(0, true)->isTextureCompressionARBSupported()) { if (s <= t && 32 <= s) {