- map<string, osg::ref_ptr<osg::Texture2D> >::iterator _tex_cache_iter;
- _tex_cache_iter = _tex_cache.find(fname);
- if (_tex_cache_iter == _tex_cache.end())
- {
- osg::Texture2D* texture = SGLoadTexture2D(fname, _wrapu, _wrapv,
- mipmap ? -1 : 0);
- texture->setMaxAnisotropy( SGTextureFilterListener::getFilter());
- state->setTextureAttributeAndModes(0, texture);
- _tex_cache[fname] = texture;
- }
- else
- {
- state->setTextureAttributeAndModes(0, _tex_cache_iter->second.get());
- // cout << "Cache hit: " << fname << endl;
- }
+ osg::Texture2D* texture = SGLoadTexture2D(fname, 0, _wrapu, _wrapv,
+ mipmap ? -1 : 0);
+ texture->setMaxAnisotropy( SGGetTextureFilter());
+ state->setTextureAttributeAndModes(0, texture);
+