Hi Nikolaus,

I've reviewed your change but the changes are buggy.  The code your
changed is to:

        osg::StateSet* stateset = NULL;
        // Need full path for unique key in local texture cache.
        std::string pathname =
osgDB::findDataFile(filename,document.getOptions());
        if (pathname.empty())
        {
            // allow the aplication to react on missing texture via
ReadFileCallback
            stateset = readTexture(filename,document);
            if( !stateset)
            {
                osg::notify(osg::WARN) << "Can't find texture (" <<
index << ") " << filename << std::endl;
                return;
            }
        }
        else
        {
            // Is texture in local cache?
            osg::StateSet* stateset =
flt::Registry::instance()->getTextureFromLocalCache(pathname);
        }

        // Read file if not in cache.
        if (!stateset)
        {
            stateset = readTexture(pathname,document);

            // Add to texture cache.
            
flt::Registry::instance()->addTextureToLocalCache(pathname,stateset);
        }

        // Add to texture pool.
        TexturePool* tp = document.getOrCreateTexturePool();
        (*tp)[index] = stateset;
    }

I'll leave this reader to spot the newly introduced bugs of which
there are two :-)

I haven't worked out a decent way to code this problem yet, have lots
of other submissions to churn through so I'll get on with these.

Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to