Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ObjectLoader continues to be broken with cached images #7276

Merged
merged 1 commit into from
Oct 3, 2015

Conversation

makc
Copy link
Contributor

@makc makc commented Oct 3, 2015

see here new manager is created for image loader, but here it is never notified and so its onLoad is never called.

for those who will come from google, r71 / r72 patch code:

        var originalLoad = THREE.ImageLoader.prototype.load;
        THREE.ImageLoader.prototype.load = function ( url, onLoad, onProgress, onError ) {
            var scope = this;
            var cached = THREE.Cache.get( url );
            if ( cached !== undefined ) {
                scope.manager.itemStart( url );
                if ( onLoad ) {
                    setTimeout( function () {
                        onLoad( cached );
                        scope.manager.itemEnd( url );
                    }, 0 );
                } else {
                    scope.manager.itemEnd( url );
                }
                return cached;
            }
            return originalLoad.call( this, url, onLoad, onProgress, onError );
        }

@mrdoob
Copy link
Owner

mrdoob commented Oct 3, 2015

Ops... Good catch!

mrdoob added a commit that referenced this pull request Oct 3, 2015
ObjectLoader continues to be broken with cached images
@mrdoob mrdoob merged commit 1976f57 into mrdoob:dev Oct 3, 2015
@mrdoob
Copy link
Owner

mrdoob commented Oct 3, 2015

Thanks!

@makc makc deleted the patch-1 branch October 3, 2015 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants