building-the-game icon indicating copy to clipboard operation
building-the-game copied to clipboard

code sequence wrong?

Open JianMeng opened this issue 12 years ago • 0 comments

The bellow in gl-util.js file code maybe wrong.

loadedCallback(self);
if(self.callback) { self.callback(self.texture); }

right one should be :

if(self.callback) { self.callback(self.texture); }
loadedCallback(self);

The reason for this is that loadTexture in the following code will change the callback and texture of itself.

function releaseTextureImageLoader(til) {
    var req;
    if(pendingTextureRequests.length) {
        req = pendingTextureRequests.shift();
        til.loadTexture(req.gl, req.src, req.texture, req.callback);
    } else {
        textureImageCache[cacheTop++] = til;
    }
}

JianMeng avatar Sep 14 '12 16:09 JianMeng