cocos2d / cocos2d-x-for-xna

port cocos2d-x into c# based on XNA
124 stars 49 forks source link

CCRenderTexture uses w=1 and h=1 #14

Closed totallyevil closed 12 years ago

totallyevil commented 12 years ago

Forum topic: http://www.cocos2d-x.org/boards/17/topics/12760

CCRenderTexture.cs line 97 and 98:

w = (int)CCDirector.sharedDirector().ContentScaleFactor;
h = (int)CCDirector.sharedDirector().ContentScaleFactor;

oops. This leaves you with w=1 and h=1 which results in an OutOfMemoryException if you try to create a Texture2D during the CrossFadeTransition (which I am implementing now).

This should read: w = (int)CCDirector.sharedDirector().ContentScaleFactor * w;
h = (int)CCDirector.sharedDirector().ContentScaleFactor * h;