Fully ported to support Cocos2D v2.1 with no deprecation compiler warnings.