how to covert cocos2d to cocos2d-x?

@ // disable default states
CC_DISABLE_DEFAULT_GL_STATES();

// handle blending
BOOL doBlend;
doBlend = self.source.hasTransparentColors;

BOOL doBlendFunc;
doBlendFunc = (blendFunc_.src = CC_BLEND_DST);

if (!doBlend) {
glDisable(GL_BLEND);
} else if (doBlendFunc) {
glBlendFunc(blendFunc*.src, blendFunc*.dst);
}

// transform
CGAffineTransform transform;
transform = CGAffineTransformIdentity;
transform = CGAffineTransformConcat(transform, CGAffineTransformMakeScale(1.0f, –1.0f));
transform = CGAffineTransformConcat(transform, CGAffineTransformMakeTranslation(0.0f, self.contentSize.height));
transform = CGAffineTransformConcat(transform, CGAffineTransformMakeScale(CC_CONTENT_SCALE_FACTOR(), CC_CONTENT_SCALE_FACTOR()));
transform = CGAffineTransformConcat(transform, self.nodeToWorldTransform);

// matrix
VGfloat matrix[9] = {
transform.a, transform.c, transform.tx, // a, c, tx
transform.b, transform.d, transform.ty, // b, d, ty
0, 0, 1, // 0, 0, 1
};
vgLoadMatrix(matrix);

// draw
[self.source draw];

// clear the transform used for drawing the swf
glLoadIdentity();

// apply the transform used for drawing children
[self transformAncestors];

// enable blending
if (!doBlend) {
glEnable(GL_BLEND);
} else if (doBlendFunc) {
glBlendFunc(CC_BLEND_SRC, CC_BLEND_DST);
}

// enable default states
CC_ENABLE_DEFAULT_GL_STATES();@

I want to covert cocos2d code to cocos2d-x , what this function can be replaced in cocos2d-x?
please help me ….Thanks

A lot of it is the same. I’ve been converting many Objective-C functions to C*+ between Cocos2d and Cocos2d-x.
I am guessing that this method is in a subclass of CCNode?
[self transformAncestors];
becomes
this->transformAncestors();
I believe that CCAffineTransform replaces CGAffineTransform in the usage you have above.
My process has been to outline the class in C*+ with empty methods, get the .h and .cpp files ready.

I move the Objective-C code into the .cpp files and comment it out. Moving through line by line, I convert to C++.

Look at this project a lot for clues about the function mapping between Cocos2d and Cocos2d-x

\cocos2d-2.0-x-2.0.4\samples\TestCpp\Classes

Wish I could be more help!