mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-02 16:52:43 +08:00
Fix other issues to make simple sprite running
This commit is contained in:
@@ -57,10 +57,6 @@ function loadImage (item, callback) {
|
||||
tex.url = rawUrl;
|
||||
tex.initWithElement(item.content);
|
||||
tex.handleLoadedTexture();
|
||||
if (cc._renderType === cc.game.RENDER_TYPE_WEBGL) {
|
||||
// Image element no longer needed
|
||||
misc.imagePool.put(item.content);
|
||||
}
|
||||
return tex;
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
const renderer = require('../renderer');
|
||||
|
||||
var __BrowserGetter = {
|
||||
init: function(){
|
||||
this.html = document.getElementsByTagName("html")[0];
|
||||
@@ -764,13 +766,7 @@ var View = cc._Class.extend({
|
||||
cc.winSize.width = director._winSizeInPoints.width;
|
||||
cc.winSize.height = director._winSizeInPoints.height;
|
||||
|
||||
if (cc._renderType === cc.game.RENDER_TYPE_WEBGL) {
|
||||
// reset director's member variables to fit visible rect
|
||||
director.setGLDefaultValues();
|
||||
}
|
||||
else if (cc._renderType === cc.game.RENDER_TYPE_CANVAS) {
|
||||
cc.renderer._allNeedDraw = true;
|
||||
}
|
||||
renderer.updateCameraViewport();
|
||||
|
||||
this._originalScaleX = this._scaleX;
|
||||
this._originalScaleY = this._scaleY;
|
||||
|
||||
@@ -78,9 +78,13 @@ module.exports = {
|
||||
});
|
||||
},
|
||||
|
||||
render () {
|
||||
updateCameraViewport () {
|
||||
this._camera._rect.w = this.canvas.width;
|
||||
this._camera._rect.h = this.canvas.height;
|
||||
this._camera.setViewport();
|
||||
},
|
||||
|
||||
render () {
|
||||
this._forward.render(this._camera, this.scene);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user