mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-04 10:32:39 +08:00
Fix supportsNPOT and ignore contentSize in Texture.initWithData
This commit is contained in:
@@ -244,7 +244,7 @@ cc.configuration = /** @lends cc.configuration# */{
|
||||
this._supportsPVRTC = this.checkForGLExtension("GL_IMG_texture_compression_pvrtc");
|
||||
locValueDict["gl.supports_PVRTC"] = this._supportsPVRTC;
|
||||
|
||||
this._supportsNPOT = false; //true;
|
||||
this._supportsNPOT = true;
|
||||
locValueDict["gl.supports_NPOT"] = this._supportsNPOT;
|
||||
|
||||
this._supportsBGRA8888 = this.checkForGLExtension("GL_IMG_texture_format_BGRA888");
|
||||
|
||||
@@ -352,7 +352,7 @@ var Texture2D = cc.Class(/** @lends cc.Texture2D# */{
|
||||
* @param {Number} pixelFormat
|
||||
* @param {Number} pixelsWidth
|
||||
* @param {Number} pixelsHeight
|
||||
* @param {Size} contentSize
|
||||
* @param {Size} contentSize contentSize is deprecated and ignored
|
||||
* @return {Boolean}
|
||||
*/
|
||||
initWithData: function (data, pixelFormat, pixelsWidth, pixelsHeight, contentSize) {
|
||||
@@ -860,8 +860,8 @@ game.once(game.EVENT_RENDERER_INITED, function () {
|
||||
opts.width = pixelsWidth;
|
||||
opts.height = pixelsHeight;
|
||||
this.update(opts);
|
||||
this.width = contentSize.width;
|
||||
this.height = contentSize.height;
|
||||
this.width = pixelsWidth;
|
||||
this.height = pixelsHeight;
|
||||
this.loaded = true;
|
||||
this.emit("load");
|
||||
return true;
|
||||
|
||||
@@ -172,7 +172,7 @@ proto.initWithWidthAndHeight = function(width, height, format, depthStencilForma
|
||||
if (!node._texture)
|
||||
return false;
|
||||
|
||||
locTexture.initWithData(data, node._pixelFormat, powW, powH, cc.size(width, height));
|
||||
locTexture.initWithData(data, node._pixelFormat, powW, powH);
|
||||
//free( data );
|
||||
|
||||
var oldRBO = gl.getParameter(gl.RENDERBUFFER_BINDING);
|
||||
@@ -181,7 +181,7 @@ proto.initWithWidthAndHeight = function(width, height, format, depthStencilForma
|
||||
this._textureCopy = new cc.Texture2D();
|
||||
if (!this._textureCopy)
|
||||
return false;
|
||||
this._textureCopy.initWithData(data, node._pixelFormat, powW, powH, cc.size(width, height));
|
||||
this._textureCopy.initWithData(data, node._pixelFormat, powW, powH);
|
||||
}
|
||||
|
||||
// generate FBO
|
||||
|
||||
Reference in New Issue
Block a user