cocos2d / cocos2d-x-for-xna

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

CCTileGrid3D uses frame buffer dims for vertex calculations #22

Closed totallyevil closed 12 years ago

totallyevil commented 12 years ago

CCTileGrid3D uses the power of 2 dimensions of the capture buffer to calculate the vertex positions of the transition vertices used in some of the transitions.

CCTransitionSplitCols is affected by this. When the transition starts, the scale of the transit-to image is scaled to the power of 2 size (512 x 1024 instead of 480 x 800). This causes a distortion of the transited scene and ends with the target scene's scale distorted.

totallyevil commented 12 years ago

I think this is something that I introduced in my changes to CCTexture2D to get the pixel space defined correctly in the texture.

totallyevil commented 12 years ago

haha:

    public bool initPremultipliedATextureWithImage(Texture2D texture, int POTWide, int POTHigh)
    {

warning "to set pixelFormat,alpha"

        texture2D = texture;
        m_tContentSize.width = texture2D.Width;
        m_tContentSize.height = texture2D.Height;

On Android and iOS, I can't make a Texture2D with a non Power-of-two width and height.

totallyevil commented 12 years ago

Fixed in 0.1.3a