code:
############################################################################
#
#   Makefile for building : Lib_Cocos2d_Arm_Wophone.TMK3
#   Created by TMK3_V2.3, please do not modify.
#
#############################################################################

TO_PROJECT_ROOT = ../../../PRJ_TG3
OUTPUT_FILENAME =  libCocos2dStatic.a

include $(TO_PROJECT_ROOT)/MakeInclude/Makefile_Base_StaticLib.ARM
include $(TO_PROJECT_ROOT)/MakeInclude/Makefile_TOPS_Def.ARM

DEFINES += -DCC_UNDER_WOPHONE \
          -D__TG3_PURE_DLL__ \
          -DUSE_FILE32API
INCLUDE_PATH += -I../ \
               -I../platform \
               -I../include -I$(TO_PROJECT_ROOT)/Include/ThirdParty/libxml2 \
               -I$(TO_PROJECT_ROOT)/Include/ThirdParty/iconv \
               -I$(TO_PROJECT_ROOT)/Include/ThirdParty/libpng \
               -I$(TO_PROJECT_ROOT)/Include/ThirdParty/libjpeg

OBJECTS_DIR = ./Debug-ARM
DESTDIR = $(TO_PROJECT_ROOT)/$(BIN_OUTPUT_DIR)
TARGET = $(DESTDIR)/$(OUTPUT_FILENAME)

DEL_FILE = rm -f
MKDIR = mkdir -p

first: all

OBJECTS = \
	$(OBJECTS_DIR)/CCCamera.o \
	$(OBJECTS_DIR)/CCConfiguration.o \
	$(OBJECTS_DIR)/CCDirector.o \
	$(OBJECTS_DIR)/CCDrawingPrimitives.o \
	$(OBJECTS_DIR)/CCScheduler.o \
	$(OBJECTS_DIR)/cocos2d.o \
	$(OBJECTS_DIR)/CCAction.o \
	$(OBJECTS_DIR)/CCActionCamera.o \
	$(OBJECTS_DIR)/CCActionEase.o \
	$(OBJECTS_DIR)/CCActionGrid.o \
	$(OBJECTS_DIR)/CCActionGrid3D.o \
	$(OBJECTS_DIR)/CCActionInstant.o \
	$(OBJECTS_DIR)/CCActionInterval.o \
	$(OBJECTS_DIR)/CCActionManager.o \
	$(OBJECTS_DIR)/CCActionPageTurn3D.o \
	$(OBJECTS_DIR)/CCActionProgressTimer.o \
	$(OBJECTS_DIR)/CCActionTiledGrid.o \
	$(OBJECTS_DIR)/CCAtlasNode.o \
	$(OBJECTS_DIR)/CCNode.o \
	$(OBJECTS_DIR)/CCAffineTransform.o \
	$(OBJECTS_DIR)/CCAutoreleasePool.o \
	$(OBJECTS_DIR)/CCData.o \
	$(OBJECTS_DIR)/CCGeometry.o \
	$(OBJECTS_DIR)/CCNS.o \
	$(OBJECTS_DIR)/CCObject.o \
	$(OBJECTS_DIR)/CCSet.o \
	$(OBJECTS_DIR)/CCZone.o \
	$(OBJECTS_DIR)/CCGrabber.o \
	$(OBJECTS_DIR)/CCGrid.o \
	$(OBJECTS_DIR)/CCKeypadDelegate.o \
	$(OBJECTS_DIR)/CCKeypadDispatcher.o \
	$(OBJECTS_DIR)/CCLabelAtlas.o \
	$(OBJECTS_DIR)/CCLabelBMFont.o \
	$(OBJECTS_DIR)/CCLabelTTF.o \
	$(OBJECTS_DIR)/CCLayer.o \
	$(OBJECTS_DIR)/CCScene.o \
	$(OBJECTS_DIR)/CCTransition.o \
	$(OBJECTS_DIR)/CCTransitionPageTurn.o \
	$(OBJECTS_DIR)/CCTransitionRadial.o \
	$(OBJECTS_DIR)/CCMenu.o \
	$(OBJECTS_DIR)/CCMenuItem.o \
	$(OBJECTS_DIR)/CCMotionStreak.o \
	$(OBJECTS_DIR)/CCProgressTimer.o \
	$(OBJECTS_DIR)/CCRenderTexture.o \
	$(OBJECTS_DIR)/CCRibbon.o \
	$(OBJECTS_DIR)/CCParticleExamples.o \
	$(OBJECTS_DIR)/CCParticleSystem.o \
	$(OBJECTS_DIR)/CCParticleSystemPoint.o \
	$(OBJECTS_DIR)/CCParticleSystemQuad.o \
	$(OBJECTS_DIR)/CCCommon.o \
	$(OBJECTS_DIR)/CCFileUtils.o \
	$(OBJECTS_DIR)/CCGL.o \
	$(OBJECTS_DIR)/CCImage.o \
	$(OBJECTS_DIR)/CCSAXParser.o \
	$(OBJECTS_DIR)/CCStdC.o \
	$(OBJECTS_DIR)/CCThread.o \
	$(OBJECTS_DIR)/platform.o \
	$(OBJECTS_DIR)/CCLock.o \
	$(OBJECTS_DIR)/CCAccelerometer_wophone.o \
	$(OBJECTS_DIR)/CCApplication_wophone.o \
	$(OBJECTS_DIR)/CCEGLView_wophone.o \
	$(OBJECTS_DIR)/CCScriptSupport.o \
	$(OBJECTS_DIR)/CCAnimation.o \
	$(OBJECTS_DIR)/CCAnimationCache.o \
	$(OBJECTS_DIR)/CCSprite.o \
	$(OBJECTS_DIR)/CCSpriteBatchNode.o \
	$(OBJECTS_DIR)/CCSpriteFrame.o \
	$(OBJECTS_DIR)/CCSpriteFrameCache.o \
	$(OBJECTS_DIR)/base64.o \
	$(OBJECTS_DIR)/CCArray.o \
	$(OBJECTS_DIR)/CCPointExtension.o \
	$(OBJECTS_DIR)/CCProfiling.o \
	$(OBJECTS_DIR)/CCUserDefault.o \
	$(OBJECTS_DIR)/ccUtils.o \
	$(OBJECTS_DIR)/TransformUtils.o \
	$(OBJECTS_DIR)/TGAlib.o \
	$(OBJECTS_DIR)/ioapi.o \
	$(OBJECTS_DIR)/unzip.o \
	$(OBJECTS_DIR)/ZipUtils.o \
	$(OBJECTS_DIR)/CCIMEDispatcher.o \
	$(OBJECTS_DIR)/CCTextFieldTTF.o \
	$(OBJECTS_DIR)/CCTexture2D.o \
	$(OBJECTS_DIR)/CCTextureAtlas.o \
	$(OBJECTS_DIR)/CCTextureCache.o \
	$(OBJECTS_DIR)/CCTexturePVR.o \
	$(OBJECTS_DIR)/CCParallaxNode.o \
	$(OBJECTS_DIR)/CCTileMapAtlas.o \
	$(OBJECTS_DIR)/CCTMXLayer.o \
	$(OBJECTS_DIR)/CCTMXObjectGroup.o \
	$(OBJECTS_DIR)/CCTMXTiledMap.o \
	$(OBJECTS_DIR)/CCTMXXMLParser.o \
	$(OBJECTS_DIR)/CCTouchDispatcher.o \
	$(OBJECTS_DIR)/CCTouchHandler.o

ADD_OBJECTS +=

$(OBJECTS_DIR) :
	$(MKDIR) $(OBJECTS_DIR)

$(DESTDIR) :
	$(MKDIR) $(DESTDIR)

all : $(OBJECTS_DIR) $(DESTDIR) $(TARGET)

$(TARGET) : $(OBJECTS)
	$(LINK) $(LINK_FLAGS) -o $(TARGET) $(SYS_OBJECTS) $(OBJECTS) $(ADD_OBJECTS) $(LIBS) $(SYS_LIBS)

clean :
	-$(DEL_FILE) $(OBJECTS)
	-$(DEL_FILE) $(TARGET)

$(OBJECTS_DIR)/CCCamera.o : ../CCCamera.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCCamera.o ../CCCamera.cpp

$(OBJECTS_DIR)/CCConfiguration.o : ../CCConfiguration.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCConfiguration.o ../CCConfiguration.cpp

$(OBJECTS_DIR)/CCDirector.o : ../CCDirector.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCDirector.o ../CCDirector.cpp

$(OBJECTS_DIR)/CCDrawingPrimitives.o : ../CCDrawingPrimitives.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCDrawingPrimitives.o ../CCDrawingPrimitives.cpp

$(OBJECTS_DIR)/CCScheduler.o : ../CCScheduler.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCScheduler.o ../CCScheduler.cpp

$(OBJECTS_DIR)/cocos2d.o : ../cocos2d.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/cocos2d.o ../cocos2d.cpp

$(OBJECTS_DIR)/CCAction.o : ../actions/CCAction.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCAction.o ../actions/CCAction.cpp

$(OBJECTS_DIR)/CCActionCamera.o : ../actions/CCActionCamera.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCActionCamera.o ../actions/CCActionCamera.cpp

$(OBJECTS_DIR)/CCActionEase.o : ../actions/CCActionEase.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCActionEase.o ../actions/CCActionEase.cpp

$(OBJECTS_DIR)/CCActionGrid.o : ../actions/CCActionGrid.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCActionGrid.o ../actions/CCActionGrid.cpp

$(OBJECTS_DIR)/CCActionGrid3D.o : ../actions/CCActionGrid3D.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCActionGrid3D.o ../actions/CCActionGrid3D.cpp

$(OBJECTS_DIR)/CCActionInstant.o : ../actions/CCActionInstant.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCActionInstant.o ../actions/CCActionInstant.cpp

$(OBJECTS_DIR)/CCActionInterval.o : ../actions/CCActionInterval.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCActionInterval.o ../actions/CCActionInterval.cpp

$(OBJECTS_DIR)/CCActionManager.o : ../actions/CCActionManager.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCActionManager.o ../actions/CCActionManager.cpp

$(OBJECTS_DIR)/CCActionPageTurn3D.o : ../actions/CCActionPageTurn3D.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCActionPageTurn3D.o ../actions/CCActionPageTurn3D.cpp

$(OBJECTS_DIR)/CCActionProgressTimer.o : ../actions/CCActionProgressTimer.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCActionProgressTimer.o ../actions/CCActionProgressTimer.cpp

$(OBJECTS_DIR)/CCActionTiledGrid.o : ../actions/CCActionTiledGrid.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCActionTiledGrid.o ../actions/CCActionTiledGrid.cpp

$(OBJECTS_DIR)/CCAtlasNode.o : ../base_nodes/CCAtlasNode.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCAtlasNode.o ../base_nodes/CCAtlasNode.cpp

$(OBJECTS_DIR)/CCNode.o : ../base_nodes/CCNode.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCNode.o ../base_nodes/CCNode.cpp

$(OBJECTS_DIR)/CCAffineTransform.o : ../cocoa/CCAffineTransform.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCAffineTransform.o ../cocoa/CCAffineTransform.cpp

$(OBJECTS_DIR)/CCAutoreleasePool.o : ../cocoa/CCAutoreleasePool.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCAutoreleasePool.o ../cocoa/CCAutoreleasePool.cpp

$(OBJECTS_DIR)/CCData.o : ../cocoa/CCData.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCData.o ../cocoa/CCData.cpp

$(OBJECTS_DIR)/CCGeometry.o : ../cocoa/CCGeometry.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCGeometry.o ../cocoa/CCGeometry.cpp

$(OBJECTS_DIR)/CCNS.o : ../cocoa/CCNS.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCNS.o ../cocoa/CCNS.cpp

$(OBJECTS_DIR)/CCObject.o : ../cocoa/CCObject.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCObject.o ../cocoa/CCObject.cpp

$(OBJECTS_DIR)/CCSet.o : ../cocoa/CCSet.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCSet.o ../cocoa/CCSet.cpp

$(OBJECTS_DIR)/CCZone.o : ../cocoa/CCZone.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCZone.o ../cocoa/CCZone.cpp

$(OBJECTS_DIR)/CCGrabber.o : ../effects/CCGrabber.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCGrabber.o ../effects/CCGrabber.cpp

$(OBJECTS_DIR)/CCGrid.o : ../effects/CCGrid.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCGrid.o ../effects/CCGrid.cpp

$(OBJECTS_DIR)/CCKeypadDelegate.o : ../keypad_dispatcher/CCKeypadDelegate.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCKeypadDelegate.o ../keypad_dispatcher/CCKeypadDelegate.cpp

$(OBJECTS_DIR)/CCKeypadDispatcher.o : ../keypad_dispatcher/CCKeypadDispatcher.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCKeypadDispatcher.o ../keypad_dispatcher/CCKeypadDispatcher.cpp

$(OBJECTS_DIR)/CCLabelAtlas.o : ../label_nodes/CCLabelAtlas.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCLabelAtlas.o ../label_nodes/CCLabelAtlas.cpp

$(OBJECTS_DIR)/CCLabelBMFont.o : ../label_nodes/CCLabelBMFont.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCLabelBMFont.o ../label_nodes/CCLabelBMFont.cpp

$(OBJECTS_DIR)/CCLabelTTF.o : ../label_nodes/CCLabelTTF.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCLabelTTF.o ../label_nodes/CCLabelTTF.cpp

$(OBJECTS_DIR)/CCLayer.o : ../layers_scenes_transitions_nodes/CCLayer.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCLayer.o ../layers_scenes_transitions_nodes/CCLayer.cpp

$(OBJECTS_DIR)/CCScene.o : ../layers_scenes_transitions_nodes/CCScene.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCScene.o ../layers_scenes_transitions_nodes/CCScene.cpp

$(OBJECTS_DIR)/CCTransition.o : ../layers_scenes_transitions_nodes/CCTransition.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCTransition.o ../layers_scenes_transitions_nodes/CCTransition.cpp

$(OBJECTS_DIR)/CCTransitionPageTurn.o : ../layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCTransitionPageTurn.o ../layers_scenes_transitions_nodes/CCTransitionPageTurn.cpp

$(OBJECTS_DIR)/CCTransitionRadial.o : ../layers_scenes_transitions_nodes/CCTransitionRadial.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCTransitionRadial.o ../layers_scenes_transitions_nodes/CCTransitionRadial.cpp

$(OBJECTS_DIR)/CCMenu.o : ../menu_nodes/CCMenu.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCMenu.o ../menu_nodes/CCMenu.cpp

$(OBJECTS_DIR)/CCMenuItem.o : ../menu_nodes/CCMenuItem.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCMenuItem.o ../menu_nodes/CCMenuItem.cpp

$(OBJECTS_DIR)/CCMotionStreak.o : ../misc_nodes/CCMotionStreak.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCMotionStreak.o ../misc_nodes/CCMotionStreak.cpp

$(OBJECTS_DIR)/CCProgressTimer.o : ../misc_nodes/CCProgressTimer.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCProgressTimer.o ../misc_nodes/CCProgressTimer.cpp

$(OBJECTS_DIR)/CCRenderTexture.o : ../misc_nodes/CCRenderTexture.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCRenderTexture.o ../misc_nodes/CCRenderTexture.cpp

$(OBJECTS_DIR)/CCRibbon.o : ../misc_nodes/CCRibbon.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCRibbon.o ../misc_nodes/CCRibbon.cpp

$(OBJECTS_DIR)/CCParticleExamples.o : ../particle_nodes/CCParticleExamples.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCParticleExamples.o ../particle_nodes/CCParticleExamples.cpp

$(OBJECTS_DIR)/CCParticleSystem.o : ../particle_nodes/CCParticleSystem.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCParticleSystem.o ../particle_nodes/CCParticleSystem.cpp

$(OBJECTS_DIR)/CCParticleSystemPoint.o : ../particle_nodes/CCParticleSystemPoint.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCParticleSystemPoint.o ../particle_nodes/CCParticleSystemPoint.cpp

$(OBJECTS_DIR)/CCParticleSystemQuad.o : ../particle_nodes/CCParticleSystemQuad.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCParticleSystemQuad.o ../particle_nodes/CCParticleSystemQuad.cpp

$(OBJECTS_DIR)/CCCommon.o : ../platform/CCCommon.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCCommon.o ../platform/CCCommon.cpp

$(OBJECTS_DIR)/CCFileUtils.o : ../platform/CCFileUtils.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCFileUtils.o ../platform/CCFileUtils.cpp

$(OBJECTS_DIR)/CCGL.o : ../platform/CCGL.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCGL.o ../platform/CCGL.cpp

$(OBJECTS_DIR)/CCImage.o : ../platform/CCImage.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCImage.o ../platform/CCImage.cpp

$(OBJECTS_DIR)/CCSAXParser.o : ../platform/CCSAXParser.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCSAXParser.o ../platform/CCSAXParser.cpp

$(OBJECTS_DIR)/CCStdC.o : ../platform/CCStdC.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCStdC.o ../platform/CCStdC.cpp

$(OBJECTS_DIR)/CCThread.o : ../platform/CCThread.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCThread.o ../platform/CCThread.cpp

$(OBJECTS_DIR)/platform.o : ../platform/platform.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/platform.o ../platform/platform.cpp

$(OBJECTS_DIR)/CCLock.o : ../platform/ios/CCLock.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCLock.o ../platform/ios/CCLock.cpp

$(OBJECTS_DIR)/CCAccelerometer_wophone.o : ../platform/wophone/CCAccelerometer_wophone.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCAccelerometer_wophone.o ../platform/wophone/CCAccelerometer_wophone.cpp

$(OBJECTS_DIR)/CCApplication_wophone.o : ../platform/wophone/CCApplication_wophone.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCApplication_wophone.o ../platform/wophone/CCApplication_wophone.cpp

$(OBJECTS_DIR)/CCEGLView_wophone.o : ../platform/wophone/CCEGLView_wophone.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCEGLView_wophone.o ../platform/wophone/CCEGLView_wophone.cpp

$(OBJECTS_DIR)/CCScriptSupport.o : ../script_support/CCScriptSupport.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCScriptSupport.o ../script_support/CCScriptSupport.cpp

$(OBJECTS_DIR)/CCAnimation.o : ../sprite_nodes/CCAnimation.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCAnimation.o ../sprite_nodes/CCAnimation.cpp

$(OBJECTS_DIR)/CCAnimationCache.o : ../sprite_nodes/CCAnimationCache.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCAnimationCache.o ../sprite_nodes/CCAnimationCache.cpp

$(OBJECTS_DIR)/CCSprite.o : ../sprite_nodes/CCSprite.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCSprite.o ../sprite_nodes/CCSprite.cpp

$(OBJECTS_DIR)/CCSpriteBatchNode.o : ../sprite_nodes/CCSpriteBatchNode.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCSpriteBatchNode.o ../sprite_nodes/CCSpriteBatchNode.cpp

$(OBJECTS_DIR)/CCSpriteFrame.o : ../sprite_nodes/CCSpriteFrame.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCSpriteFrame.o ../sprite_nodes/CCSpriteFrame.cpp

$(OBJECTS_DIR)/CCSpriteFrameCache.o : ../sprite_nodes/CCSpriteFrameCache.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCSpriteFrameCache.o ../sprite_nodes/CCSpriteFrameCache.cpp

$(OBJECTS_DIR)/base64.o : ../support/base64.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/base64.o ../support/base64.cpp

$(OBJECTS_DIR)/CCArray.o : ../support/CCArray.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCArray.o ../support/CCArray.cpp

$(OBJECTS_DIR)/CCPointExtension.o : ../support/CCPointExtension.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCPointExtension.o ../support/CCPointExtension.cpp

$(OBJECTS_DIR)/CCProfiling.o : ../support/CCProfiling.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCProfiling.o ../support/CCProfiling.cpp

$(OBJECTS_DIR)/CCUserDefault.o : ../support/CCUserDefault.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCUserDefault.o ../support/CCUserDefault.cpp

$(OBJECTS_DIR)/ccUtils.o : ../support/ccUtils.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/ccUtils.o ../support/ccUtils.cpp

$(OBJECTS_DIR)/TransformUtils.o : ../support/TransformUtils.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/TransformUtils.o ../support/TransformUtils.cpp

$(OBJECTS_DIR)/TGAlib.o : ../support/image_support/TGAlib.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/TGAlib.o ../support/image_support/TGAlib.cpp

$(OBJECTS_DIR)/ioapi.o : ../support/zip_support/ioapi.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/ioapi.o ../support/zip_support/ioapi.cpp

$(OBJECTS_DIR)/unzip.o : ../support/zip_support/unzip.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/unzip.o ../support/zip_support/unzip.cpp

$(OBJECTS_DIR)/ZipUtils.o : ../support/zip_support/ZipUtils.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/ZipUtils.o ../support/zip_support/ZipUtils.cpp

$(OBJECTS_DIR)/CCIMEDispatcher.o : ../text_input_node/CCIMEDispatcher.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCIMEDispatcher.o ../text_input_node/CCIMEDispatcher.cpp

$(OBJECTS_DIR)/CCTextFieldTTF.o : ../text_input_node/CCTextFieldTTF.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCTextFieldTTF.o ../text_input_node/CCTextFieldTTF.cpp

$(OBJECTS_DIR)/CCTexture2D.o : ../textures/CCTexture2D.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCTexture2D.o ../textures/CCTexture2D.cpp

$(OBJECTS_DIR)/CCTextureAtlas.o : ../textures/CCTextureAtlas.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCTextureAtlas.o ../textures/CCTextureAtlas.cpp

$(OBJECTS_DIR)/CCTextureCache.o : ../textures/CCTextureCache.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCTextureCache.o ../textures/CCTextureCache.cpp

$(OBJECTS_DIR)/CCTexturePVR.o : ../textures/CCTexturePVR.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCTexturePVR.o ../textures/CCTexturePVR.cpp

$(OBJECTS_DIR)/CCParallaxNode.o : ../tileMap_parallax_nodes/CCParallaxNode.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCParallaxNode.o ../tileMap_parallax_nodes/CCParallaxNode.cpp

$(OBJECTS_DIR)/CCTileMapAtlas.o : ../tileMap_parallax_nodes/CCTileMapAtlas.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCTileMapAtlas.o ../tileMap_parallax_nodes/CCTileMapAtlas.cpp

$(OBJECTS_DIR)/CCTMXLayer.o : ../tileMap_parallax_nodes/CCTMXLayer.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCTMXLayer.o ../tileMap_parallax_nodes/CCTMXLayer.cpp

$(OBJECTS_DIR)/CCTMXObjectGroup.o : ../tileMap_parallax_nodes/CCTMXObjectGroup.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCTMXObjectGroup.o ../tileMap_parallax_nodes/CCTMXObjectGroup.cpp

$(OBJECTS_DIR)/CCTMXTiledMap.o : ../tileMap_parallax_nodes/CCTMXTiledMap.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCTMXTiledMap.o ../tileMap_parallax_nodes/CCTMXTiledMap.cpp

$(OBJECTS_DIR)/CCTMXXMLParser.o : ../tileMap_parallax_nodes/CCTMXXMLParser.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCTMXXMLParser.o ../tileMap_parallax_nodes/CCTMXXMLParser.cpp

$(OBJECTS_DIR)/CCTouchDispatcher.o : ../touch_dispatcher/CCTouchDispatcher.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCTouchDispatcher.o ../touch_dispatcher/CCTouchDispatcher.cpp

$(OBJECTS_DIR)/CCTouchHandler.o : ../touch_dispatcher/CCTouchHandler.cpp
	$(CXX) -c $(CXX_FLAGS) $(INCLUDE_PATH) $(LAST_INCLUDE_PATH) -o $(OBJECTS_DIR)/CCTouchHandler.o ../touch_dispatcher/CCTouchHandler.cpp


code:
;
; TG3 Makefile Auto Create Script
;
; ˵����
;   1.�ڵȺ���߲�Ҫ�пո�
;   2.���е�·����ʹ��"/"���ָ�
;   3.���е��ļ����������пո�
;   4.ֻ�ܶԵ�ǰĿ¼������Ŀ¼�µ�.c��.cpp����Makefile

;��TMK3�ļ�Ŀ¼λ�õ���Ŀ��Ŀ¼֮���ת������֧�ֶ����������ж���������һ��Ϊ׼
;�� ./$(TO_PROJECT_ROOT)/ ������Ŀ�ĸ�Ŀ¼
TO_PROJECT_ROOT=../../PRJ_TG3

;���Ŀ������֣���֧�ֶ����������ж���������һ��Ϊ׼
OUTPUT_FILENAME= libcocos2d.so

;������������TMK3�ļ������ļ��ͱ��ļ�һ�𹹳�MakeFile������
;������Գ�����TMK3�ļ��ڵ�����ط������Ѿ����ڵ����������
;ע�⣺���֧�־���·�������ǿ���ʹ��$(TO_PROJECT_ROOT)�����ļ���
;TOPS��׼Ӧ�ã�������̬���
INCLUDE_TMK3=$(TO_PROJECT_ROOT)/MakeInclude/TG3_APP_Arm.TMK3

;Ԥ���崮������MakeFile��ʱ��ֱ�ӷ���MakeFile��ǰ��
;��ʽ��PRE_DEFINE=STRING������MakeFile��ʱ��"PRE_DEFINE="��������з�ע�ͷ������ַ��������MakeFileǰ��
;���磺PRE_DEFINE=AAA=BBB�������AAA=BBB��MakeFile��
;����ʹ�ö��PRE_DEFINE����Ҳ����ʹ��PRE_DEFINE1��PRE_DEFINE2�ȷ�ʽ��MakeFile�����ݳ���˳��(�������ִ�С)����
;PRE_DEFINE=USE_IMAGEKIT=1	;ʹ�� ImageToolKit �⣬��ʱ���ɵ� Makefile ���Զ������йص�LIB
;PRE_DEFINE=USE_ICU=1				;ʹ�� ICU �⣬��ʱ���ɵ� Makefile ���Զ������йص�LIB
;PRE_DEFINE=USE_MTAPI=1			;ʹ�� MTAPI �⣬��ʱ���ɵ� Makefile ���Զ������йص�LIB

;C��C++Ԥ����꣬����ʹ�ö��DEFINES����Ҳ����ʹ��DEFINES1��DEFINES2�ȷ�ʽ��MakeFile�����ݳ���˳��(�������ִ�С)����
DEFINES=-DCC_UNDER_WOPHONE		;��������Ӧ�õ��Զ���ꡣע�⣺ITOPS�Լ������趨����Զ��������ʴ������������Ӧ���Լ����еĶ��弴��
DEFINES=-D__TG3_PURE_DLL__		;���ɵ��Ǵ���̬�⣨��˼�ǣ�����TOPSӦ�ã���������TCOM�����
DEFINES=-DUSE_FILE32API				;��ȡ zip �ļ���Ҫ�˺�
;DEFINES=-D__TCOM_SUPPORT__		;���ɵ���TCOM�����ע�⣺TOPSӦ��Ҳ����ͬʱ��TCOM�����

;����·��������ʹ�ö��INCLUDE_PATH����Ҳ����ʹ��INCLUDE_PATH1��INCLUDE_PATH2�ȷ�ʽ��MakeFile�����ݳ���˳��(�������ִ�С)����
;Ӧ�ö���İ���·����ע�⣺ITOPS�Լ�������·�������Զ��������ʴ������������Ӧ���Լ����е�·������
INCLUDE_PATH=-I../ -I../include  -I../platform
INCLUDE_PATH=-I$(TO_PROJECT_ROOT)/Include/ThirdParty/libxml2
INCLUDE_PATH=-I$(TO_PROJECT_ROOT)/Include/ThirdParty/iconv
INCLUDE_PATH=-I$(TO_PROJECT_ROOT)/Include/ThirdParty/libpng
INCLUDE_PATH=-I$(TO_PROJECT_ROOT)/Include/ThirdParty/libjpeg

;���ӵĿ��ļ�������ʹ�ö��LIBS����Ҳ����ʹ��LIBS1��LIBS2�ȷ�ʽ��MakeFile�����ݳ���˳��(�������ִ�С)����
;Ӧ�ö�������ӿ⡣ע�⣺ITOPS�Լ���������Զ����������ҿ����·��Ҳ�Ѿ��������ʴ������������Ӧ���Լ����еĿ�����ּ���
LIBS= -lTG3_EGL -lTG3_GLESv1_CM -lTG3_GLESv2 -lz -lxml2 -lpng14 -lImageToolKit -ljpeg

;ǿ�ư����ļ������֣�����ʹ��ͨ�����һ��Ҫʹ����Ի��߾���·��
;����Ҫ��ʹ�����·��������ļ�֮��ʹ�á�|���ָ�
;ǿ�ư����ļ�ָ���ǲ��ڱ��ļ��м������ļ����µ�.c��.cpp��.o�ļ�
;����ʹ�ö��INCLUDEFILE����Ҳ����ʹ��INCLUDEFILE1��INCLUDEFILE2�ȷ�ʽ��MakeFile�����ݳ���˳��(�������ִ�С)����
INCLUDEFILE=

;ǿ���ų��ļ�������ʹ��ͨ�����һ��Ҫʹ�����·��
;����ļ�֮��ʹ�á�|���ָ���·��������"./"��"../"��ʼ
;ֻ�ܶ�.c��.cpp�ļ������ų�
;���Ҫ�ų���Ŀ¼���ļ�ҲҪ����"./"
;����ʹ�ö��EXCLUDEFILE����Ҳ����ʹ��EXCLUDEFILE1��EXCLUDEFILE2�ȷ�ʽ��MakeFile�����ݳ���˳��(�������ִ�С)����
EXCLUDEFILE= ./textures/CCPVRTexture.cpp
EXCLUDEFILE= ./platform/wophone/NewDeleteOp.cpp
EXCLUDEFILE= ./platform/wophone/CCImage_wophone.cpp
EXCLUDEFILE= ./platform/wophone/CCThread_wophone.cpp
EXCLUDEFILE= ./platform/wophone/CCFileUtils_wophone.cpp
EXCLUDEFILE= ./platform/win32/
EXCLUDEFILE= ./platform/android/
EXCLUDEFILE= ./platform/iphone/
EXCLUDEFILE= ./platform/mac/
EXCLUDEFILE= ./platform/airplay/
EXCLUDEFILE= ./platform/third_party/

license: mit


code:
<?xml version="1.0" encoding="gb2312"?>
<VisualStudioProject
	ProjectType="Visual C++"
	Version="9.00"
	Name="cocos2d"
	ProjectGUID="{6AC43F51-A036-4653-B910-BDDC346D15E7}"
	RootNamespace="cocos2d-wophone"
	Keyword="woPhoneProj"
	TargetFrameworkVersion="196613"
	>
	<Platforms>
		<Platform
			Name="Win32"
		/>
	</Platforms>
	<ToolFiles>
	</ToolFiles>
	<Configurations>
		<Configuration
			Name="Debug|Win32"
			OutputDirectory="../../../PRJ_TG3/LIB/Win32Lib"
			IntermediateDirectory="Debug"
			ConfigurationType="2"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="0"
				AdditionalIncludeDirectories="..\..\..\PRJ_TG3\Include\ThirdParty\iconv;..\..\..\PRJ_TG3\Include\ThirdParty\zlib;..\..\..\PRJ_TG3\Include\ThirdParty\libpng;..\..\..\PRJ_TG3\Include\ThirdParty\libjpeg;..\..\..\PRJ_TG3\Include\ThirdParty\libxml2;..\include;..\..\..\PRJ_TG3\Include;..\..\..\PRJ_TG3\Include\MTAPI;..\..\..\PRJ_TG3\Include\OpenGL;..\..\..\PRJ_TG3\Include\TCOM;..\..\..\PRJ_TG3\TG3\Include;..\..\..\PRJ_TG3\TG3\TG3_Implement;..\..\..\PRJ_TG3\EOS_SYS;..\..\..\PRJ_TG3\Common\SoftSupport;..\..\..\PRJ_TG3\Common\ICU\Include;..\;..\..\cocos2dx\platform"
				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_TRANZDA_VM_;SS_MAKEDLL;__TG3_PURE_DLL__;_USE_MATH_DEFINES"
				MinimalRebuild="true"
				BasicRuntimeChecks="3"
				RuntimeLibrary="3"
				StructMemberAlignment="3"
				TreatWChar_tAsBuiltInType="false"
				UsePrecompiledHeader="0"
				WarningLevel="3"
				DebugInformationFormat="4"
				DisableSpecificWarnings="4996"
				ForcedIncludeFiles=""
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				AdditionalDependencies="WS2_32.Lib EosConfig.lib SoftSupport.lib TG3_DLL.lib libEGL.lib libTG3_EGL.lib libgles_cm.lib libxml2.lib zlib.lib libpng14-imp.lib ImageToolKit_d.lib libjpeg.lib"
				OutputFile="$(OutDir)/libcocos2d.dll"
				LinkIncremental="2"
				AdditionalLibraryDirectories="../../../PRJ_TG3/Common/ICU/lib;../../../PRJ_TG3/Mtapi/Win32/lib;../../../PRJ_TG3/LIB/Win32Lib;../../../PRJ_TG3/Common/SoftSupport"
				GenerateDebugInformation="true"
				GenerateMapFile="true"
				MapExports="true"
				SubSystem="1"
				RandomizedBaseAddress="1"
				DataExecutionPrevention="0"
				ImportLibrary="$(OutDir)/libcocos2d.lib"
				TargetMachine="1"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
		<Configuration
			Name="Release|Win32"
			OutputDirectory="$(ConfigurationName)"
			IntermediateDirectory="$(ConfigurationName)"
			ConfigurationType="1"
			>
			<Tool
				Name="VCPreBuildEventTool"
			/>
			<Tool
				Name="VCCustomBuildTool"
			/>
			<Tool
				Name="VCXMLDataGeneratorTool"
			/>
			<Tool
				Name="VCWebServiceProxyGeneratorTool"
			/>
			<Tool
				Name="VCMIDLTool"
			/>
			<Tool
				Name="VCCLCompilerTool"
				Optimization="0"
				AdditionalIncludeDirectories="..\include;..\..\cocos2dx\platform;..\..\..\PRJ_TG3\Include;..\..\..\PRJ_TG3\Include\MTAPI;..\..\..\PRJ_TG3\Include\ThirdParty;..\..\..\PRJ_TG3\Include\TCOM;..\..\..\PRJ_TG3\TG3\Include;..\..\..\PRJ_TG3\TG3\TG3_Implement;..\..\..\PRJ_TG3\EOS_SYS;..\..\..\PRJ_TG3\Common\SoftSupport;..\..\..\PRJ_TG3\Common\ICU\Include"
				PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;_TRANZDA_VM_;SS_MAKEDLL"
				MinimalRebuild="true"
				BasicRuntimeChecks="3"
				RuntimeLibrary="3"
				StructMemberAlignment="3"
				TreatWChar_tAsBuiltInType="false"
				UsePrecompiledHeader="0"
				WarningLevel="3"
				DebugInformationFormat="4"
				ForcedIncludeFiles=""
			/>
			<Tool
				Name="VCManagedResourceCompilerTool"
			/>
			<Tool
				Name="VCResourceCompilerTool"
			/>
			<Tool
				Name="VCPreLinkEventTool"
			/>
			<Tool
				Name="VCLinkerTool"
				AdditionalDependencies="WS2_32.Lib EosConfig.lib SoftSupport.lib TG3_DLL.lib"
				OutputFile="$(OutDir)/cocos2dx.dll"
				LinkIncremental="2"
				AdditionalLibraryDirectories="../../../PRJ_TG3/Common/ICU/lib;../../../PRJ_TG3/Mtapi/Win32/lib;../../../PRJ_TG3/LIB/Win32Lib;../../../PRJ_TG3/Common/SoftSupport"
				GenerateDebugInformation="true"
				GenerateMapFile="true"
				MapExports="true"
				SubSystem="1"
				RandomizedBaseAddress="1"
				DataExecutionPrevention="0"
				ImportLibrary="$(OutDir)/cocos2dx.lib"
				TargetMachine="1"
			/>
			<Tool
				Name="VCALinkTool"
			/>
			<Tool
				Name="VCManifestTool"
			/>
			<Tool
				Name="VCXDCMakeTool"
			/>
			<Tool
				Name="VCBscMakeTool"
			/>
			<Tool
				Name="VCFxCopTool"
			/>
			<Tool
				Name="VCAppVerifierTool"
			/>
			<Tool
				Name="VCPostBuildEventTool"
			/>
		</Configuration>
	</Configurations>
	<References>
	</References>
	<Files>
		<Filter
			Name="actions"
			>
			<File
				RelativePath="..\actions\CCAction.cpp"
				>
			</File>
			<File
				RelativePath="..\actions\CCActionCamera.cpp"
				>
			</File>
			<File
				RelativePath="..\actions\CCActionEase.cpp"
				>
			</File>
			<File
				RelativePath="..\actions\CCActionGrid.cpp"
				>
			</File>
			<File
				RelativePath="..\actions\CCActionGrid3D.cpp"
				>
			</File>
			<File
				RelativePath="..\actions\CCActionInstant.cpp"
				>
			</File>
			<File
				RelativePath="..\actions\CCActionInterval.cpp"
				>
			</File>
			<File
				RelativePath="..\actions\CCActionManager.cpp"
				>
			</File>
			<File
				RelativePath="..\actions\CCActionPageTurn3D.cpp"
				>
			</File>
			<File
				RelativePath="..\actions\CCActionProgressTimer.cpp"
				>
			</File>
			<File
				RelativePath="..\actions\CCActionTiledGrid.cpp"
				>
			</File>
		</Filter>
		<Filter
			Name="base_nodes"
			>
			<File
				RelativePath="..\base_nodes\CCAtlasNode.cpp"
				>
			</File>
			<File
				RelativePath="..\base_nodes\CCNode.cpp"
				>
			</File>
		</Filter>
		<Filter
			Name="effects"
			>
			<File
				RelativePath="..\effects\CCGrabber.cpp"
				>
			</File>
			<File
				RelativePath="..\effects\CCGrabber.h"
				>
			</File>
			<File
				RelativePath="..\effects\CCGrid.cpp"
				>
			</File>
			<File
				RelativePath="..\effects\CCGrid.h"
				>
			</File>
		</Filter>
		<Filter
			Name="include"
			>
			<File
				RelativePath="..\include\CCAccelerometer.h"
				>
			</File>
			<File
				RelativePath="..\include\CCAccelerometerDelegate.h"
				>
			</File>
			<File
				RelativePath="..\include\CCAction.h"
				>
			</File>
			<File
				RelativePath="..\include\CCActionCamera.h"
				>
			</File>
			<File
				RelativePath="..\include\CCActionEase.h"
				>
			</File>
			<File
				RelativePath="..\include\CCActionGrid.h"
				>
			</File>
			<File
				RelativePath="..\include\CCActionGrid3D.h"
				>
			</File>
			<File
				RelativePath="..\include\CCActionInstant.h"
				>
			</File>
			<File
				RelativePath="..\include\CCActionInterval.h"
				>
			</File>
			<File
				RelativePath="..\include\CCActionManager.h"
				>
			</File>
			<File
				RelativePath="..\include\CCActionPageTurn3D.h"
				>
			</File>
			<File
				RelativePath="..\include\CCActionProgressTimer.h"
				>
			</File>
			<File
				RelativePath="..\include\CCActionTiledGrid.h"
				>
			</File>
			<File
				RelativePath="..\include\CCAffineTransform.h"
				>
			</File>
			<File
				RelativePath="..\include\CCAnimation.h"
				>
			</File>
			<File
				RelativePath="..\include\CCAnimationCache.h"
				>
			</File>
			<File
				RelativePath="..\include\CCApplication.h"
				>
			</File>
			<File
				RelativePath="..\include\CCArray.h"
				>
			</File>
			<File
				RelativePath="..\include\CCAtlasNode.h"
				>
			</File>
			<File
				RelativePath="..\include\CCAutoreleasePool.h"
				>
			</File>
			<File
				RelativePath="..\include\CCCamera.h"
				>
			</File>
			<File
				RelativePath="..\include\ccConfig.h"
				>
			</File>
			<File
				RelativePath="..\include\CCData.h"
				>
			</File>
			<File
				RelativePath="..\include\CCDirector.h"
				>
			</File>
			<File
				RelativePath="..\include\CCDrawingPrimitives.h"
				>
			</File>
			<File
				RelativePath="..\include\CCEGLView.h"
				>
			</File>
			<File
				RelativePath="..\include\CCGeometry.h"
				>
			</File>
			<File
				RelativePath="..\include\CCGL.h"
				>
			</File>
			<File
				RelativePath="..\include\CCIMEDelegate.h"
				>
			</File>
			<File
				RelativePath="..\include\CCIMEDispatcher.h"
				>
			</File>
			<File
				RelativePath="..\include\CCKeypadDelegate.h"
				>
			</File>
			<File
				RelativePath="..\include\CCKeypadDispatcher.h"
				>
			</File>
			<File
				RelativePath="..\include\CCLabelAtlas.h"
				>
			</File>
			<File
				RelativePath="..\include\CCLabelBMFont.h"
				>
			</File>
			<File
				RelativePath="..\include\CCLabelTTF.h"
				>
			</File>
			<File
				RelativePath="..\include\CCLayer.h"
				>
			</File>
			<File
				RelativePath="..\include\ccMacros.h"
				>
			</File>
			<File
				RelativePath="..\include\CCMenu.h"
				>
			</File>
			<File
				RelativePath="..\include\CCMenuItem.h"
				>
			</File>
			<File
				RelativePath="..\include\CCMotionStreak.h"
				>
			</File>
			<File
				RelativePath="..\include\CCMutableArray.h"
				>
			</File>
			<File
				RelativePath="..\include\CCMutableDictionary.h"
				>
			</File>
			<File
				RelativePath="..\include\CCNode.h"
				>
			</File>
			<File
				RelativePath="..\include\CCObject.h"
				>
			</File>
			<File
				RelativePath="..\include\CCParallaxNode.h"
				>
			</File>
			<File
				RelativePath="..\include\CCParticleExamples.h"
				>
			</File>
			<File
				RelativePath="..\include\CCParticleSystem.h"
				>
			</File>
			<File
				RelativePath="..\include\CCParticleSystemPoint.h"
				>
			</File>
			<File
				RelativePath="..\include\CCParticleSystemQuad.h"
				>
			</File>
			<File
				RelativePath="..\include\CCPointExtension.h"
				>
			</File>
			<File
				RelativePath="..\include\CCProgressTimer.h"
				>
			</File>
			<File
				RelativePath="..\include\CCProtocols.h"
				>
			</File>
			<File
				RelativePath="..\include\CCPVRTexture.h"
				>
			</File>
			<File
				RelativePath="..\include\CCRenderTexture.h"
				>
			</File>
			<File
				RelativePath="..\include\CCRibbon.h"
				>
			</File>
			<File
				RelativePath="..\include\CCScene.h"
				>
			</File>
			<File
				RelativePath="..\include\CCScheduler.h"
				>
			</File>
			<File
				RelativePath="..\include\CCScriptSupport.h"
				>
			</File>
			<File
				RelativePath="..\include\CCSet.h"
				>
			</File>
			<File
				RelativePath="..\include\CCSprite.h"
				>
			</File>
			<File
				RelativePath="..\include\CCSpriteBatchNode.h"
				>
			</File>
			<File
				RelativePath="..\include\CCSpriteFrame.h"
				>
			</File>
			<File
				RelativePath="..\include\CCSpriteFrameCache.h"
				>
			</File>
			<File
				RelativePath="..\include\CCString.h"
				>
			</File>
			<File
				RelativePath="..\include\CCTextFieldTTF.h"
				>
			</File>
			<File
				RelativePath="..\include\CCTexture2D.h"
				>
			</File>
			<File
				RelativePath="..\include\CCTextureAtlas.h"
				>
			</File>
			<File
				RelativePath="..\include\CCTextureCache.h"
				>
			</File>
			<File
				RelativePath="..\include\CCTileMapAtlas.h"
				>
			</File>
			<File
				RelativePath="..\include\CCTMXLayer.h"
				>
			</File>
			<File
				RelativePath="..\include\CCTMXObjectGroup.h"
				>
			</File>
			<File
				RelativePath="..\include\CCTMXTiledMap.h"
				>
			</File>
			<File
				RelativePath="..\include\CCTMXXMLParser.h"
				>
			</File>
			<File
				RelativePath="..\include\CCTouch.h"
				>
			</File>
			<File
				RelativePath="..\include\CCTouchDelegateProtocol.h"
				>
			</File>
			<File
				RelativePath="..\include\CCTouchDispatcher.h"
				>
			</File>
			<File
				RelativePath="..\include\CCTransition.h"
				>
			</File>
			<File
				RelativePath="..\include\CCTransitionPageTurn.h"
				>
			</File>
			<File
				RelativePath="..\include\CCTransitionRadial.h"
				>
			</File>
			<File
				RelativePath="..\include\ccTypes.h"
				>
			</File>
			<File
				RelativePath="..\include\CCUserDefault.h"
				>
			</File>
			<File
				RelativePath="..\include\CCZone.h"
				>
			</File>
			<File
				RelativePath="..\include\cocos2d.h"
				>
			</File>
			<File
				RelativePath="..\include\selector_protocol.h"
				>
			</File>
		</Filter>
		<Filter
			Name="label_nodes"
			>
			<File
				RelativePath="..\label_nodes\CCLabelAtlas.cpp"
				>
			</File>
			<File
				RelativePath="..\label_nodes\CCLabelBMFont.cpp"
				>
			</File>
			<File
				RelativePath="..\label_nodes\CCLabelTTF.cpp"
				>
			</File>
		</Filter>
		<Filter
			Name="layers_scenes_transition_nodes"
			>
			<File
				RelativePath="..\layers_scenes_transitions_nodes\CCLayer.cpp"
				>
			</File>
			<File
				RelativePath="..\layers_scenes_transitions_nodes\CCScene.cpp"
				>
			</File>
			<File
				RelativePath="..\layers_scenes_transitions_nodes\CCTransition.cpp"
				>
			</File>
			<File
				RelativePath="..\layers_scenes_transitions_nodes\CCTransitionPageTurn.cpp"
				>
			</File>
			<File
				RelativePath="..\layers_scenes_transitions_nodes\CCTransitionRadial.cpp"
				>
			</File>
		</Filter>
		<Filter
			Name="menu_nodes"
			>
			<File
				RelativePath="..\menu_nodes\CCMenu.cpp"
				>
			</File>
			<File
				RelativePath="..\menu_nodes\CCMenuItem.cpp"
				>
			</File>
		</Filter>
		<Filter
			Name="misc_nodes"
			>
			<File
				RelativePath="..\misc_nodes\CCMotionStreak.cpp"
				>
			</File>
			<File
				RelativePath="..\misc_nodes\CCProgressTimer.cpp"
				>
			</File>
			<File
				RelativePath="..\misc_nodes\CCRenderTexture.cpp"
				>
			</File>
			<File
				RelativePath="..\misc_nodes\CCRibbon.cpp"
				>
			</File>
		</Filter>
		<Filter
			Name="particle_nodes"
			>
			<File
				RelativePath="..\particle_nodes\CCParticleExamples.cpp"
				>
			</File>
			<File
				RelativePath="..\particle_nodes\CCParticleSystem.cpp"
				>
			</File>
			<File
				RelativePath="..\particle_nodes\CCParticleSystemPoint.cpp"
				>
			</File>
			<File
				RelativePath="..\particle_nodes\CCParticleSystemQuad.cpp"
				>
			</File>
		</Filter>
		<Filter
			Name="sprite_nodes"
			>
			<File
				RelativePath="..\sprite_nodes\CCAnimation.cpp"
				>
			</File>
			<File
				RelativePath="..\sprite_nodes\CCAnimationCache.cpp"
				>
			</File>
			<File
				RelativePath="..\sprite_nodes\CCSprite.cpp"
				>
			</File>
			<File
				RelativePath="..\sprite_nodes\CCSpriteBatchNode.cpp"
				>
			</File>
			<File
				RelativePath="..\sprite_nodes\CCSpriteFrame.cpp"
				>
			</File>
			<File
				RelativePath="..\sprite_nodes\CCSpriteFrameCache.cpp"
				>
			</File>
		</Filter>
		<Filter
			Name="support"
			>
			<File
				RelativePath="..\support\base64.cpp"
				>
			</File>
			<File
				RelativePath="..\support\base64.h"
				>
			</File>
			<File
				RelativePath="..\support\CCArray.cpp"
				>
			</File>
			<File
				RelativePath="..\support\CCPointExtension.cpp"
				>
			</File>
			<File
				RelativePath="..\support\CCProfiling.cpp"
				>
			</File>
			<File
				RelativePath="..\support\CCProfiling.h"
				>
			</File>
			<File
				RelativePath="..\support\CCUserDefault.cpp"
				>
			</File>
			<File
				RelativePath="..\support\ccUtils.cpp"
				>
			</File>
			<File
				RelativePath="..\support\ccUtils.h"
				>
			</File>
			<File
				RelativePath="..\support\TransformUtils.cpp"
				>
			</File>
			<File
				RelativePath="..\support\TransformUtils.h"
				>
			</File>
			<Filter
				Name="data_support"
				>
				<File
					RelativePath="..\support\data_support\ccCArray.h"
					>
				</File>
				<File
					RelativePath="..\support\data_support\uthash.h"
					>
				</File>
				<File
					RelativePath="..\support\data_support\utlist.h"
					>
				</File>
			</Filter>
			<Filter
				Name="image_support"
				>
				<File
					RelativePath="..\support\image_support\TGAlib.cpp"
					>
				</File>
				<File
					RelativePath="..\support\image_support\TGAlib.h"
					>
				</File>
			</Filter>
			<Filter
				Name="zip_support"
				>
				<File
					RelativePath="..\support\zip_support\ioapi.cpp"
					>
				</File>
				<File
					RelativePath="..\support\zip_support\ioapi.h"
					>
				</File>
				<File
					RelativePath="..\support\zip_support\unzip.cpp"
					>
				</File>
				<File
					RelativePath="..\support\zip_support\unzip.h"
					>
				</File>
				<File
					RelativePath="..\support\zip_support\ZipUtils.cpp"
					>
				</File>
				<File
					RelativePath="..\support\zip_support\ZipUtils.h"
					>
				</File>
			</Filter>
		</Filter>
		<Filter
			Name="textures"
			>
			<File
				RelativePath="..\textures\CCTexture2D.cpp"
				>
			</File>
			<File
				RelativePath="..\textures\CCTextureAtlas.cpp"
				>
			</File>
			<File
				RelativePath="..\textures\CCTextureCache.cpp"
				>
			</File>
			<File
				RelativePath="..\textures\CCTexturePVR.cpp"
				>
			</File>
		</Filter>
		<Filter
			Name="tileMap_parallax_nodes"
			>
			<File
				RelativePath="..\tileMap_parallax_nodes\CCParallaxNode.cpp"
				>
			</File>
			<File
				RelativePath="..\tileMap_parallax_nodes\CCTileMapAtlas.cpp"
				>
			</File>
			<File
				RelativePath="..\tileMap_parallax_nodes\CCTMXLayer.cpp"
				>
			</File>
			<File
				RelativePath="..\tileMap_parallax_nodes\CCTMXObjectGroup.cpp"
				>
			</File>
			<File
				RelativePath="..\tileMap_parallax_nodes\CCTMXTiledMap.cpp"
				>
			</File>
			<File
				RelativePath="..\tileMap_parallax_nodes\CCTMXXMLParser.cpp"
				>
			</File>
		</Filter>
		<Filter
			Name="touch_dispatcher"
			>
			<File
				RelativePath="..\touch_dispatcher\CCTouchDispatcher.cpp"
				>
			</File>
			<File
				RelativePath="..\touch_dispatcher\CCTouchHandler.cpp"
				>
			</File>
			<File
				RelativePath="..\touch_dispatcher\CCTouchHandler.h"
				>
			</File>
		</Filter>
		<Filter
			Name="cocoa"
			>
			<File
				RelativePath="..\cocoa\CCAffineTransform.cpp"
				>
			</File>
			<File
				RelativePath="..\cocoa\CCAutoreleasePool.cpp"
				>
			</File>
			<File
				RelativePath="..\cocoa\CCData.cpp"
				>
			</File>
			<File
				RelativePath="..\cocoa\CCGeometry.cpp"
				>
			</File>
			<File
				RelativePath="..\cocoa\CCNS.cpp"
				>
			</File>
			<File
				RelativePath="..\cocoa\CCNS.h"
				>
			</File>
			<File
				RelativePath="..\cocoa\CCObject.cpp"
				>
			</File>
			<File
				RelativePath="..\cocoa\CCSet.cpp"
				>
			</File>
			<File
				RelativePath="..\cocoa\CCZone.cpp"
				>
			</File>
		</Filter>
		<Filter
			Name="platform"
			>
			<File
				RelativePath="..\platform\CCAccelerometer_platform.h"
				>
			</File>
			<File
				RelativePath="..\platform\CCApplication_platform.h"
				>
			</File>
			<File
				RelativePath="..\platform\CCArchOptimalParticleSystem.h"
				>
			</File>
			<File
				RelativePath="..\platform\CCCommon.cpp"
				>
			</File>
			<File
				RelativePath="..\platform\CCCommon.h"
				>
			</File>
			<File
				RelativePath="..\platform\CCEGLView_platform.h"
				>
			</File>
			<File
				RelativePath="..\platform\CCFileUtils.cpp"
				>
			</File>
			<File
				RelativePath="..\platform\CCFileUtils.h"
				>
			</File>
			<File
				RelativePath="..\platform\CCGL.cpp"
				>
			</File>
			<File
				RelativePath="..\platform\CCGL.h"
				>
			</File>
			<File
				RelativePath="..\platform\CCImage.cpp"
				>
			</File>
			<File
				RelativePath="..\platform\CCImage.h"
				>
			</File>
			<File
				RelativePath="..\platform\CCLibxml2.h"
				>
			</File>
			<File
				RelativePath="..\platform\CCPlatformConfig.h"
				>
			</File>
			<File
				RelativePath="..\platform\CCPlatformMacros.h"
				>
			</File>
			<File
				RelativePath="..\platform\CCSAXParser.cpp"
				>
			</File>
			<File
				RelativePath="..\platform\CCSAXParser.h"
				>
			</File>
			<File
				RelativePath="..\platform\CCStdC.cpp"
				>
			</File>
			<File
				RelativePath="..\platform\CCStdC.h"
				>
			</File>
			<File
				RelativePath="..\platform\CCThread.cpp"
				>
			</File>
			<File
				RelativePath="..\platform\CCThread.h"
				>
			</File>
			<File
				RelativePath="..\platform\platform.cpp"
				>
			</File>
			<File
				RelativePath="..\platform\platform.h"
				>
			</File>
			<Filter
				Name="wophone"
				>
				<File
					RelativePath="..\platform\wophone\CCAccelerometer_wophone.cpp"
					>
				</File>
				<File
					RelativePath="..\platform\wophone\CCAccelerometer_wophone.h"
					>
				</File>
				<File
					RelativePath="..\platform\wophone\CCApplication_wophone.cpp"
					>
				</File>
				<File
					RelativePath="..\platform\wophone\CCApplication_wophone.h"
					>
				</File>
				<File
					RelativePath="..\platform\wophone\CCEGLView_wophone.cpp"
					>
				</File>
				<File
					RelativePath="..\platform\wophone\CCEGLView_wophone.h"
					>
				</File>
				<File
					RelativePath="..\platform\wophone\NewDeleteOp.cpp"
					>
				</File>
			</Filter>
		</Filter>
		<Filter
			Name="makefile"
			>
			<File
				RelativePath=".\cocos2d-wophone.TMK3"
				>
			</File>
			<File
				RelativePath=".\Makefile-dynamic.ARM"
				>
			</File>
			<File
				RelativePath=".\Makefile.ARM"
				>
			</File>
		</Filter>
		<Filter
			Name="keypad_dispatcher"
			>
			<File
				RelativePath="..\keypad_dispatcher\CCKeypadDelegate.cpp"
				>
			</File>
			<File
				RelativePath="..\keypad_dispatcher\CCKeypadDispatcher.cpp"
				>
			</File>
		</Filter>
		<Filter
			Name="test_input_node"
			>
			<File
				RelativePath="..\text_input_node\CCIMEDispatcher.cpp"
				>
			</File>
			<File
				RelativePath="..\text_input_node\CCTextFieldTTF.cpp"
				>
			</File>
		</Filter>
		<Filter
			Name="script_support"
			>
			<File
				RelativePath="..\script_support\CCScriptSupport.cpp"
				>
			</File>
		</Filter>
		<File
			RelativePath="..\CCCamera.cpp"
			>
		</File>
		<File
			RelativePath="..\CCConfiguration.cpp"
			>
		</File>
		<File
			RelativePath="..\CCConfiguration.h"
			>
		</File>
		<File
			RelativePath="..\CCDirector.cpp"
			>
		</File>
		<File
			RelativePath="..\CCDrawingPrimitives.cpp"
			>
		</File>
		<File
			RelativePath="..\CCScheduler.cpp"
			>
		</File>
		<File
			RelativePath="..\cocos2d.cpp"
			>
		</File>
	</Files>
	<Globals>
	</Globals>
</VisualStudioProject>


code:
/****************************************************************************
Copyright (c) 2010-2011 cocos2d-x.org

http://www.cocos2d-x.org

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/

#include "CCScriptSupport.h"
#include "CCScheduler.h"

NS_CC_BEGIN

CCSchedulerScriptHandlerEntry* CCSchedulerScriptHandlerEntry::entryWithHandler(int nHandler, ccTime fInterval, bool bPaused)
{
    CCSchedulerScriptHandlerEntry* pEntry = new CCSchedulerScriptHandlerEntry();
    pEntry->initWithHandler(nHandler, fInterval, bPaused);
    pEntry->autorelease();
    return pEntry;
}

bool CCSchedulerScriptHandlerEntry::initWithHandler(int nHandler, ccTime fInterval, bool bPaused)
{
    m_pTimer = new CCTimer();
    m_pTimer->initWithScriptHandler(nHandler, fInterval);
    m_pTimer->autorelease();
    m_pTimer->retain();
    m_nHandler = nHandler;
    m_bPaused = bPaused;
    LUALOG("[LUA] ADD script schedule: %d, entryID: %d", m_nHandler, m_nEntryID);
    return true;
}

CCSchedulerScriptHandlerEntry::CCSchedulerScriptHandlerEntry(void)
: m_pTimer(NULL)
, m_nHandler(0)
, m_bPaused(true)
, m_bMarkedForDeletion(false)
{
    static int nEntryCount = 0;
    m_nEntryID = ++nEntryCount;
}

CCSchedulerScriptHandlerEntry::~CCSchedulerScriptHandlerEntry(void)
{
    m_pTimer->release();
    CCScriptEngineManager::sharedManager()->getScriptEngine()->removeLuaHandler(m_nHandler);
    LUALOG("[LUA] DEL script schedule %d, entryID: %d", m_nHandler, m_nEntryID);
}

// ----------------------------

CCTouchScriptHandlerEntry* CCTouchScriptHandlerEntry::entryWithHandler(int nHandler, bool bIsMultiTouches, int nPriority, bool bSwallowsTouches)
{
    CCTouchScriptHandlerEntry* pEntry = new CCTouchScriptHandlerEntry();
    pEntry->initWithHandler(nHandler, bIsMultiTouches, nPriority, bSwallowsTouches);
    pEntry->autorelease();
    return pEntry;
}

CCTouchScriptHandlerEntry::CCTouchScriptHandlerEntry(void)
: m_nHandler(0)
, m_bIsMultiTouches(false)
, m_nPriority(0)
, m_bSwallowsTouches(false)
{
}

CCTouchScriptHandlerEntry::~CCTouchScriptHandlerEntry(void)
{
    CCScriptEngineManager::sharedManager()->getScriptEngine()->removeLuaHandler(m_nHandler);
    LUALOG("[LUA] Remove touch event handler: %d", m_nHandler);
}

bool CCTouchScriptHandlerEntry::initWithHandler(int nHandler, bool bIsMultiTouches, int nPriority, bool bSwallowsTouches)
{
    m_nHandler = nHandler;
    m_bIsMultiTouches = bIsMultiTouches;
    m_nPriority = nPriority;
    m_bSwallowsTouches = bSwallowsTouches;

    return true;
}

// ----------------------------

static CCScriptEngineManager* s_pSharedScriptEngineManager = NULL;

CCScriptEngineManager::~CCScriptEngineManager(void)
{
    removeScriptEngine();
}

void CCScriptEngineManager::setScriptEngine(CCScriptEngineProtocol *pScriptEngine)
{
    removeScriptEngine();
	m_pScriptEngine = pScriptEngine;
    m_pScriptEngine->retain();
}

void CCScriptEngineManager::removeScriptEngine(void)
{
    if (m_pScriptEngine)
    {
        m_pScriptEngine->release();
        m_pScriptEngine = NULL;
    }
}

CCScriptEngineManager* CCScriptEngineManager::sharedManager(void)
{
    if (!s_pSharedScriptEngineManager)
    {
        s_pSharedScriptEngineManager = new CCScriptEngineManager();
    }
    return s_pSharedScriptEngineManager;
}

void CCScriptEngineManager::purgeSharedManager(void)
{
    if (s_pSharedScriptEngineManager)
    {
        delete s_pSharedScriptEngineManager;
        s_pSharedScriptEngineManager = NULL;
    }
}

NS_CC_END;


code:
/****************************************************************************
Copyright (c) 2010-2011 cocos2d-x.org
Copyright (c) 2008-2010 Ricardo Quesada
Copyright (c) 2011      Zynga Inc.

http://www.cocos2d-x.org

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCAnimation.h"
#include "CCTextureCache.h"
#include "CCTexture2D.h"
#include "ccMacros.h"
#include "CCSpriteFrame.h"

namespace cocos2d
{
	// implementation of CCAnimation

	CCAnimation* CCAnimation::animation()
	{
		CCAnimation *pAnimation = new CCAnimation();
		pAnimation->init();
		pAnimation->autorelease();

		return pAnimation;
	}

	bool CCAnimation::init()
	{
		return initWithFrames(NULL, 0);
	}

	CCAnimation* CCAnimation::animationWithFrames(CCMutableArray<CCSpriteFrame*> *frames)
	{
		CCAnimation *pAnimation = new CCAnimation();
		pAnimation->initWithFrames(frames);
		pAnimation->autorelease();

		return pAnimation;
	}

	CCAnimation* CCAnimation::animationWithFrames(CCMutableArray<CCSpriteFrame*> *frames, float delay)
	{
		CCAnimation *pAnimation = new CCAnimation();
		pAnimation->initWithFrames(frames, delay);
		pAnimation->autorelease();

		return pAnimation;
	}

	bool CCAnimation::initWithFrames(CCMutableArray<CCSpriteFrame*> *pFrames, float delay)
	{
        m_fDelay = delay;
		m_pobFrames = CCMutableArray<CCSpriteFrame*>::arrayWithArray(pFrames);
        m_pobFrames->retain();

		return true;
	}

	bool CCAnimation::initWithFrames(CCMutableArray<CCSpriteFrame*> *pFrames)
	{
        return initWithFrames(pFrames, 0);
	}

	CCAnimation::~CCAnimation(void)
	{
		CCLOGINFO("cocos2d, deallocing %p", this);
		// [name_ release];
		m_nameStr.clear();
		CC_SAFE_RELEASE(m_pobFrames);
	}

	void CCAnimation::addFrame(CCSpriteFrame *pFrame)
	{
		m_pobFrames->addObject(pFrame);
	}

	void CCAnimation::addFrameWithFileName(const char *pszFileName)
	{
		CCTexture2D *pTexture = CCTextureCache::sharedTextureCache()->addImage(pszFileName);
		CCRect rect = CCRectZero;
		rect.size = pTexture->getContentSize();
		CCSpriteFrame *pFrame = CCSpriteFrame::frameWithTexture(pTexture, rect);
		m_pobFrames->addObject(pFrame);
	}

	void CCAnimation::addFrameWithTexture(CCTexture2D *pobTexture, const CCRect& rect)
	{
		CCSpriteFrame *pFrame = CCSpriteFrame::frameWithTexture(pobTexture, rect);
		m_pobFrames->addObject(pFrame);
	}
}


code:
/****************************************************************************
Copyright (c) 2010-2011 cocos2d-x.org
Copyright (c) 2010      Ricardo Quesada
Copyright (c) 2011      Zynga Inc.

http://www.cocos2d-x.org

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/
#include "CCAnimationCache.h"
#include "ccMacros.h"
#include "CCAnimation.h"
#include "CCSpriteFrame.h"

namespace cocos2d
{
	CCAnimationCache* CCAnimationCache::s_pSharedAnimationCache = NULL;

	CCAnimationCache* CCAnimationCache::sharedAnimationCache(void)
	{
        if (! s_pSharedAnimationCache)
		{
			s_pSharedAnimationCache = new CCAnimationCache();
			s_pSharedAnimationCache->init();
		}

		return s_pSharedAnimationCache;
	}

	void CCAnimationCache::purgeSharedAnimationCache(void)
	{
        CC_SAFE_RELEASE_NULL(s_pSharedAnimationCache);
	}

	bool CCAnimationCache::init()
	{
		m_pAnimations = new CCMutableDictionary<std::string, CCAnimation*>();
		return true;
	}

	CCAnimationCache::CCAnimationCache()
    : m_pAnimations(NULL)
	{
	}

	CCAnimationCache::~CCAnimationCache()
	{
		CCLOGINFO("cocos2d: deallocing %p", this);
		CC_SAFE_RELEASE(m_pAnimations);
	}

	void CCAnimationCache::addAnimation(CCAnimation *animation, const char * name)
	{
		m_pAnimations->setObject(animation, std::string(name));
	}

	void CCAnimationCache::removeAnimationByName(const char* name)
	{
        if (! name)
		{
			return;
		}

		m_pAnimations->removeObjectForKey(std::string(name));
	}

	CCAnimation* CCAnimationCache::animationByName(const char* name)
	{
		return m_pAnimations->objectForKey(std::string(name));
	}
}


code:
/****************************************************************************
Copyright (c) 2010-2011 cocos2d-x.org
Copyright (c) 2008-2010 Ricardo Quesada
Copyright (c) 2011      Zynga Inc.

http://www.cocos2d-x.org

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
****************************************************************************/

#include "CCSpriteBatchNode.h"
#include "CCAnimation.h"
#include "CCAnimationCache.h"
#include "ccConfig.h"
#include "CCSprite.h"
#include "CCSpriteFrame.h"
#include "CCSpriteFrameCache.h"
#include "CCTextureCache.h"
#include "CCPointExtension.h"
#include "CCDrawingPrimitives.h"
#include "CCGeometry.h"
#include "CCTexture2D.h"
#include "CCAffineTransform.h"
#include "CCDirector.h"

#include <string.h>

using namespace std;
namespace   cocos2d {

#if CC_SPRITEBATCHNODE_RENDER_SUBPIXEL
#define RENDER_IN_SUBPIXEL
#else
#define RENDER_IN_SUBPIXEL(__A__) ( (int)(__A__))
#endif

// XXX: Optmization
struct transformValues_ {
	CCPoint pos;		// position x and y
	CCPoint	scale;		// scale x and y
	float	rotation;
    CCPoint skew;		// skew x and y
	CCPoint ap;			// anchor point in pixels
	bool    visible;
};

CCSprite* CCSprite::spriteWithBatchNode(CCSpriteBatchNode *batchNode, const CCRect& rect)
{
	CCSprite *pobSprite = new CCSprite();
	if (pobSprite && pobSprite->initWithBatchNode(batchNode, rect))
	{
        pobSprite->autorelease();
        return pobSprite;
    }
    CC_SAFE_DELETE(pobSprite);
	return NULL;
}

bool CCSprite::initWithBatchNode(CCSpriteBatchNode *batchNode, const CCRect& rect)
{
	if (initWithTexture(batchNode->getTexture(), rect))
    {
	    useBatchNode(batchNode);
        return true;
    }
	return false;
}

bool CCSprite::initWithBatchNodeRectInPixels(CCSpriteBatchNode *batchNode, const CCRect& rect)
{
	if (initWithTexture(batchNode->getTexture()))
    {
	    setTextureRectInPixels(rect, false, rect.size);
	    useBatchNode(batchNode);
        return true;
    }
	return false;
}

CCSprite* CCSprite::spriteWithTexture(CCTexture2D *pTexture)
{
	CCSprite *pobSprite = new CCSprite();
	if (pobSprite && pobSprite->initWithTexture(pTexture))
    {
	    pobSprite->autorelease();
        return pobSprite;
    }
    CC_SAFE_DELETE(pobSprite);
	return NULL;
}

CCSprite* CCSprite::spriteWithTexture(CCTexture2D *pTexture, const CCRect& rect)
{
    CCSprite *pobSprite = new CCSprite();
	if (pobSprite && pobSprite->initWithTexture(pTexture, rect))
    {
	    pobSprite->autorelease();
        return pobSprite;
    }
    CC_SAFE_DELETE(pobSprite);
	return NULL;
}

CCSprite* CCSprite::spriteWithTexture(CCTexture2D *pTexture, const CCRect& rect, const CCPoint& offset)
{
    CC_UNUSED_PARAM(pTexture);
    CC_UNUSED_PARAM(rect);
    CC_UNUSED_PARAM(offset);
	// not implement
	CCAssert(0, "");
	return NULL;
}

CCSprite* CCSprite::spriteWithFile(const char *pszFileName)
{
    CCSprite *pobSprite = new CCSprite();
    if (pobSprite && pobSprite->initWithFile(pszFileName))
    {
        pobSprite->autorelease();
        return pobSprite;
    }
    CC_SAFE_DELETE(pobSprite);
	return NULL;
}

CCSprite* CCSprite::spriteWithFile(const char *pszFileName, const CCRect& rect)
{
    CCSprite *pobSprite = new CCSprite();
	if (pobSprite && pobSprite->initWithFile(pszFileName, rect))
    {
	    pobSprite->autorelease();
        return pobSprite;
    }
    CC_SAFE_DELETE(pobSprite);
	return NULL;
}

CCSprite* CCSprite::spriteWithSpriteFrame(CCSpriteFrame *pSpriteFrame)
{
    CCSprite *pobSprite = new CCSprite();
    if (pobSprite && pobSprite->initWithSpriteFrame(pSpriteFrame))
    {
	    pobSprite->autorelease();
        return pobSprite;
    }
    CC_SAFE_DELETE(pobSprite);
	return NULL;
}

CCSprite* CCSprite::spriteWithSpriteFrameName(const char *pszSpriteFrameName)
{
	CCSpriteFrame *pFrame = CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(pszSpriteFrameName);

    char msg[256] = {0};
    sprintf(msg, "Invalid spriteFrameName: %s", pszSpriteFrameName);
    CCAssert(pFrame != NULL, msg);
	return spriteWithSpriteFrame(pFrame);
}

bool CCSprite::init(void)
{
	m_bDirty = m_bRecursiveDirty = false;

	// by default use "Self Render".
	// if the sprite is added to an batchnode, then it will automatically switch to "SpriteSheet Render"
    useSelfRender();

	m_bOpacityModifyRGB = true;
	m_nOpacity = 255;
	m_sColor = m_sColorUnmodified = ccWHITE;

	m_sBlendFunc.src = CC_BLEND_SRC;
	m_sBlendFunc.dst = CC_BLEND_DST;

	// update texture (calls updateBlendFunc)
	setTexture(NULL);

	// clean the Quad
	memset(&m_sQuad, 0, sizeof(m_sQuad));

	m_bFlipX = m_bFlipY = false;

	// default transform anchor: center
	setAnchorPoint(ccp(0.5f, 0.5f));

	// zwoptex default values
    m_obOffsetPositionInPixels = CCPointZero;

	m_eHonorParentTransform = CC_HONOR_PARENT_TRANSFORM_ALL;
	m_bHasChildren = false;

	// Atlas: Color
	ccColor4B tmpColor = { 255, 255, 255, 255 };
	m_sQuad.bl.colors = tmpColor;
	m_sQuad.br.colors = tmpColor;
	m_sQuad.tl.colors = tmpColor;
	m_sQuad.tr.colors = tmpColor;

	// Atlas: Vertex

	// updated in "useSelfRender"

	// Atlas: TexCoords
	setTextureRectInPixels(CCRectZero, false, CCSizeZero);

	return true;
}

bool CCSprite::initWithTexture(CCTexture2D *pTexture, const CCRect& rect)
{
	CCAssert(pTexture != NULL, "");
	// IMPORTANT: [self init] and not [super init];
	init();
	setTexture(pTexture);
	setTextureRect(rect);

	return true;
}

bool CCSprite::initWithTexture(CCTexture2D *pTexture)
{
	CCAssert(pTexture != NULL, "");

	CCRect rect = CCRectZero;
	rect.size = pTexture->getContentSize();

	return initWithTexture(pTexture, rect);
}

bool CCSprite::initWithFile(const char *pszFilename)
{
	CCAssert(pszFilename != NULL, "");

	CCTexture2D *pTexture = CCTextureCache::sharedTextureCache()->addImage(pszFilename);
	if (pTexture)
	{
		CCRect rect = CCRectZero;
		rect.size = pTexture->getContentSize();
		return initWithTexture(pTexture, rect);
	}

	// don't release here.
	// when load texture failed, it's better to get a "transparent" sprite then a crashed program
	// this->release();
	return false;
}

bool CCSprite::initWithFile(const char *pszFilename, const CCRect& rect)
{
	CCAssert(pszFilename != NULL, "");

	CCTexture2D *pTexture = CCTextureCache::sharedTextureCache()->addImage(pszFilename);
	if (pTexture)
	{
		return initWithTexture(pTexture, rect);
	}

	// don't release here.
	// when load texture failed, it's better to get a "transparent" sprite then a crashed program
	// this->release();
	return false;
}

bool CCSprite::initWithSpriteFrame(CCSpriteFrame *pSpriteFrame)
{
	CCAssert(pSpriteFrame != NULL, "");

	bool bRet = initWithTexture(pSpriteFrame->getTexture(), pSpriteFrame->getRect());
	setDisplayFrame(pSpriteFrame);

	return bRet;
}

bool CCSprite::initWithSpriteFrameName(const char *pszSpriteFrameName)
{
	CCAssert(pszSpriteFrameName != NULL, "");

	CCSpriteFrame *pFrame = CCSpriteFrameCache::sharedSpriteFrameCache()->spriteFrameByName(pszSpriteFrameName);
	return initWithSpriteFrame(pFrame);
}

// XXX: deprecated
/*
CCSprite* CCSprite::initWithCGImage(CGImageRef pImage)
{
	// todo
	// because it is deprecated, so we do not impelment it

	return NULL;
}
*/

/*
CCSprite* CCSprite::initWithCGImage(CGImageRef pImage, const char *pszKey)
{
	CCAssert(pImage != NULL);

	// XXX: possible bug. See issue #349. New API should be added
	CCTexture2D *pTexture = CCTextureCache::sharedTextureCache()->addCGImage(pImage, pszKey);

	const CCSize& size = pTexture->getContentSize();
	CCRect rect = CCRectMake(0 ,0, size.width, size.height);

	return initWithTexture(texture, rect);
}
*/

CCSprite::CCSprite(void)
: m_pobTexture(NULL)
{
}

CCSprite::~CCSprite(void)
{
	CC_SAFE_RELEASE(m_pobTexture);
}

void CCSprite::useSelfRender(void)
{
    m_uAtlasIndex = CCSpriteIndexNotInitialized;
	m_bUsesBatchNode = false;
	m_pobTextureAtlas = NULL;
    m_pobBatchNode = NULL;
	m_bDirty = m_bRecursiveDirty = false;

	float x1 = 0 + m_obOffsetPositionInPixels.x;
	float y1 = 0 + m_obOffsetPositionInPixels.y;
	float x2 = x1 + m_obRectInPixels.size.width;
	float y2 = y1 + m_obRectInPixels.size.height;
	m_sQuad.bl.vertices = vertex3(x1, y1, 0);
	m_sQuad.br.vertices = vertex3(x2, y1, 0);
	m_sQuad.tl.vertices = vertex3(x1, y2, 0);
	m_sQuad.tr.vertices = vertex3(x2, y2, 0);
}

void CCSprite::useBatchNode(CCSpriteBatchNode *batchNode)
{
    m_bUsesBatchNode = true;
	m_pobTextureAtlas = batchNode->getTextureAtlas(); // weak ref
    m_pobBatchNode = batchNode;
}

void CCSprite::setTextureRect(const CCRect& rect)
{
	CCRect rectInPixels = CC_RECT_POINTS_TO_PIXELS(rect);
	setTextureRectInPixels(rectInPixels, false, rectInPixels.size);
}

void CCSprite::setTextureRectInPixels(const CCRect& rect, bool rotated, const CCSize& size)
{
	m_obRectInPixels = rect;
	m_obRect = CC_RECT_PIXELS_TO_POINTS(rect);
	m_bRectRotated = rotated;

	setContentSizeInPixels(size);
	updateTextureCoords(m_obRectInPixels);

	CCPoint relativeOffsetInPixels = m_obUnflippedOffsetPositionFromCenter;

	// issue #732
	if (m_bFlipX)
	{
		relativeOffsetInPixels.x = -relativeOffsetInPixels.x;
	}
	if (m_bFlipY)
	{
		relativeOffsetInPixels.y = -relativeOffsetInPixels.y;
	}

	m_obOffsetPositionInPixels.x = relativeOffsetInPixels.x + (m_tContentSizeInPixels.width - m_obRectInPixels.size.width) / 2;
	m_obOffsetPositionInPixels.y = relativeOffsetInPixels.y + (m_tContentSizeInPixels.height - m_obRectInPixels.size.height) / 2;

	// rendering using batch node
	if (m_bUsesBatchNode)
	{
		// update dirty_, don't update recursiveDirty_
		m_bDirty = true;
	}
	else
	{
		// self rendering

		// Atlas: Vertex
		float x1 = 0 + m_obOffsetPositionInPixels.x;
		float y1 = 0 + m_obOffsetPositionInPixels.y;
		float x2 = x1 + m_obRectInPixels.size.width;
		float y2 = y1 + m_obRectInPixels.size.height;

		// Don't update Z.
		m_sQuad.bl.vertices = vertex3(x1, y1, 0);
		m_sQuad.br.vertices = vertex3(x2, y1, 0);
		m_sQuad.tl.vertices = vertex3(x1, y2, 0);
		m_sQuad.tr.vertices = vertex3(x2, y2, 0);
	}
}

void CCSprite::updateTextureCoords(const CCRect& rect)
{
	CCTexture2D *tex = m_bUsesBatchNode ? m_pobTextureAtlas->getTexture() : m_pobTexture;
	if (! tex)
	{
		return;
	}

	float atlasWidth = (float)tex->getPixelsWide();
	float atlasHeight = (float)tex->getPixelsHigh();

	float left, right, top, bottom;

	if (m_bRectRotated)
	{
#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
		left	= (2*rect.origin.x+1)/(2*atlasWidth);
		right	= left+(rect.size.height*2-2)/(2*atlasWidth);
		top		= (2*rect.origin.y+1)/(2*atlasHeight);
		bottom	= top+(rect.size.width*2-2)/(2*atlasHeight);
#else
		left	= rect.origin.x/atlasWidth;
		right	= left+(rect.size.height/atlasWidth);
		top		= rect.origin.y/atlasHeight;
		bottom	= top+(rect.size.width/atlasHeight);
#endif // CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL

		if (m_bFlipX)
		{
			CC_SWAP(top, bottom, float);
		}

		if (m_bFlipY)
		{
			CC_SWAP(left, right, float);
		}

		m_sQuad.bl.texCoords.u = left;
		m_sQuad.bl.texCoords.v = top;
		m_sQuad.br.texCoords.u = left;
		m_sQuad.br.texCoords.v = bottom;
		m_sQuad.tl.texCoords.u = right;
		m_sQuad.tl.texCoords.v = top;
		m_sQuad.tr.texCoords.u = right;
		m_sQuad.tr.texCoords.v = bottom;
	}
	else
	{
#if CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL
		left	= (2*rect.origin.x+1)/(2*atlasWidth);
		right	= left + (rect.size.width*2-2)/(2*atlasWidth);
		top		= (2*rect.origin.y+1)/(2*atlasHeight);
		bottom	= top + (rect.size.height*2-2)/(2*atlasHeight);
#else
		left	= rect.origin.x/atlasWidth;
		right	= left + rect.size.width/atlasWidth;
		top		= rect.origin.y/atlasHeight;
		bottom	= top + rect.size.height/atlasHeight;
#endif // ! CC_FIX_ARTIFACTS_BY_STRECHING_TEXEL

		if(m_bFlipX)
		{
			CC_SWAP(left,right,float);
		}

		if(m_bFlipY)
		{
			CC_SWAP(top,bottom,float);
		}

		m_sQuad.bl.texCoords.u = left;
		m_sQuad.bl.texCoords.v = bottom;
		m_sQuad.br.texCoords.u = right;
		m_sQuad.br.texCoords.v = bottom;
		m_sQuad.tl.texCoords.u = left;
		m_sQuad.tl.texCoords.v = top;
		m_sQuad.tr.texCoords.u = right;
		m_sQuad.tr.texCoords.v = top;
	}
}

void CCSprite::updateTransform(void)
{
	CCAssert(m_bUsesBatchNode, "");

	// optimization. Quick return if not dirty
	if (! m_bDirty)
	{
		return;
	}

	CCAffineTransform matrix;

	// Optimization: if it is not visible, then do nothing
	if (! m_bIsVisible)
	{
		m_sQuad.br.vertices = m_sQuad.tl.vertices = m_sQuad.tr.vertices = m_sQuad.bl.vertices = vertex3(0,0,0);
		m_pobTextureAtlas->updateQuad(&m_sQuad, m_uAtlasIndex);
		m_bDirty = m_bRecursiveDirty = false;
		return;
	}

	// Optimization: If parent is batchnode, or parent is nil
	// build Affine transform manually
	if (! m_pParent || m_pParent == m_pobBatchNode)
	{
		float radians = -CC_DEGREES_TO_RADIANS(m_fRotation);
		float c = cosf(radians);
		float s = sinf(radians);

        matrix = CCAffineTransformMake(c * m_fScaleX, s * m_fScaleX,
			-s * m_fScaleY, c * m_fScaleY,
			m_tPositionInPixels.x, m_tPositionInPixels.y);
        if( m_fSkewX || m_fSkewY )
        {
            CCAffineTransform skewMatrix = CCAffineTransformMake(1.0f, tanf(CC_DEGREES_TO_RADIANS(m_fSkewY)),
                tanf(CC_DEGREES_TO_RADIANS(m_fSkewX)), 1.0f,
                0.0f, 0.0f);
            matrix = CCAffineTransformConcat(skewMatrix, matrix);
        }
		matrix = CCAffineTransformTranslate(matrix, -m_tAnchorPointInPixels.x, -m_tAnchorPointInPixels.y);
	} else // parent_ != batchNode_
	{
		// else do affine transformation according to the HonorParentTransform
		matrix = CCAffineTransformIdentity;
		ccHonorParentTransform prevHonor = CC_HONOR_PARENT_TRANSFORM_ALL;

		for (CCNode *p = this; p && p != m_pobBatchNode; p = p->getParent())
		{
			// Might happen. Issue #1053
			// how to implement, we can not use dynamic
			// CCAssert( [p isKindOfClass:[CCSprite class]], @"CCSprite should be a CCSprite subclass. Probably you initialized an sprite with a batchnode, but you didn't add it to the batch node." );
			struct transformValues_ tv;
			((CCSprite*)p)->getTransformValues(&tv);

			// If any of the parents are not visible, then don't draw this node
			if (! tv.visible)
			{
				m_sQuad.br.vertices = m_sQuad.tl.vertices = m_sQuad.tr.vertices = m_sQuad.bl.vertices = vertex3(0,0,0);
				m_pobTextureAtlas->updateQuad(&m_sQuad, m_uAtlasIndex);
				m_bDirty = m_bRecursiveDirty = false;

				return;
			}

			CCAffineTransform newMatrix = CCAffineTransformIdentity;

			// 2nd: Translate, Skew, Rotate, Scale
			if( prevHonor & CC_HONOR_PARENT_TRANSFORM_TRANSLATE )
			{
				newMatrix = CCAffineTransformTranslate(newMatrix, tv.pos.x, tv.pos.y);
			}

			if( prevHonor & CC_HONOR_PARENT_TRANSFORM_ROTATE )
			{
				newMatrix = CCAffineTransformRotate(newMatrix, -CC_DEGREES_TO_RADIANS(tv.rotation));
			}

            if ( prevHonor & CC_HONOR_PARENT_TRANSFORM_SKEW )
            {
                CCAffineTransform skew = CCAffineTransformMake(1.0f, tanf(CC_DEGREES_TO_RADIANS(tv.skew.y)), tanf(CC_DEGREES_TO_RADIANS(tv.skew.x)), 1.0f, 0.0f, 0.0f);
                // apply the skew to the transform
                newMatrix = CCAffineTransformConcat(skew, newMatrix);
            }

			if( prevHonor & CC_HONOR_PARENT_TRANSFORM_SCALE )
			{
				newMatrix = CCAffineTransformScale(newMatrix, tv.scale.x, tv.scale.y);
			}

			// 3rd: Translate anchor point
			newMatrix = CCAffineTransformTranslate(newMatrix, -tv.ap.x, -tv.ap.y);

			// 4th: Matrix multiplication
			matrix = CCAffineTransformConcat( matrix, newMatrix);

			prevHonor = ((CCSprite*)p)->getHonorParentTransform();
		}
	}

	//
	// calculate the Quad based on the Affine Matrix
	//
	CCSize size = m_obRectInPixels.size;

	float x1 = m_obOffsetPositionInPixels.x;
	float y1 = m_obOffsetPositionInPixels.y;

	float x2 = x1 + size.width;
	float y2 = y1 + size.height;
    float x = matrix.tx;
	float y = matrix.ty;

	float cr = matrix.a;
	float sr = matrix.b;
	float cr2 = matrix.d;
	float sr2 = -matrix.c;
	float ax = x1 * cr - y1 * sr2 + x;
	float ay = x1 * sr + y1 * cr2 + y;

	float bx = x2 * cr - y1 * sr2 + x;
	float by = x2 * sr + y1 * cr2 + y;

	float cx = x2 * cr - y2 * sr2 + x;
	float cy = x2 * sr + y2 * cr2 + y;

	float dx = x1 * cr - y2 * sr2 + x;
	float dy = x1 * sr + y2 * cr2 + y;

	m_sQuad.bl.vertices = vertex3((float)RENDER_IN_SUBPIXEL(ax), (float)RENDER_IN_SUBPIXEL(ay), m_fVertexZ);
	m_sQuad.br.vertices = vertex3((float)RENDER_IN_SUBPIXEL(bx), (float)RENDER_IN_SUBPIXEL(by), m_fVertexZ);
	m_sQuad.tl.vertices = vertex3((float)RENDER_IN_SUBPIXEL(dx), (float)RENDER_IN_SUBPIXEL(dy), m_fVertexZ);
	m_sQuad.tr.vertices = vertex3((float)RENDER_IN_SUBPIXEL(cx), (float)RENDER_IN_SUBPIXEL(cy), m_fVertexZ);

	m_pobTextureAtlas->updateQuad(&m_sQuad, m_uAtlasIndex);
	m_bDirty = m_bRecursiveDirty = false;
}

// XXX: Optimization: instead of calling 5 times the parent sprite to obtain: position, scale.x, scale.y, anchorpoint and rotation,
// this fuction return the 5 values in 1 single call
void CCSprite::getTransformValues(struct transformValues_ *tv)
{
	tv->pos = m_tPositionInPixels;
	tv->scale.x = m_fScaleX;
	tv->scale.y = m_fScaleY;
	tv->rotation = m_fRotation;
    tv->skew.x	 = m_fSkewX;
    tv->skew.y	 = m_fSkewY;
	tv->ap = m_tAnchorPointInPixels;
	tv->visible = m_bIsVisible;
}

// draw

void CCSprite::draw(void)
{
	CCNode::draw();

	CCAssert(! m_bUsesBatchNode, "");

	// Default GL states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY
	// Needed states: GL_TEXTURE_2D, GL_VERTEX_ARRAY, GL_COLOR_ARRAY, GL_TEXTURE_COORD_ARRAY
	// Unneeded states: -
	bool newBlend = m_sBlendFunc.src != CC_BLEND_SRC || m_sBlendFunc.dst != CC_BLEND_DST;
	if (newBlend)
	{
		glBlendFunc(m_sBlendFunc.src, m_sBlendFunc.dst);
	}

#define kQuadSize sizeof(m_sQuad.bl)
    if (m_pobTexture)
    {
        glBindTexture(GL_TEXTURE_2D, m_pobTexture->getName());
    }
    else
    {
        glBindTexture(GL_TEXTURE_2D, 0);
    }

	long offset = (long)&m_sQuad;

	// vertex
	int diff = offsetof(ccV3F_C4B_T2F, vertices);
	glVertexPointer(3, GL_FLOAT, kQuadSize, (void*)(offset + diff));

	// color
	diff = offsetof( ccV3F_C4B_T2F, colors);
	glColorPointer(4, GL_UNSIGNED_BYTE, kQuadSize, (void*)(offset + diff));

	// tex coords
	diff = offsetof( ccV3F_C4B_T2F, texCoords);
	glTexCoordPointer(2, GL_FLOAT, kQuadSize, (void*)(offset + diff));

	glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);

	if( newBlend )
	{
		glBlendFunc(CC_BLEND_SRC, CC_BLEND_DST);
	}

#if CC_SPRITE_DEBUG_DRAW == 1
    // draw bounding box
    CCSize s = m_tContentSize;
    CCPoint vertices[4] = {
        ccp(0,0), ccp(s.width,0),
        ccp(s.width,s.height), ccp(0,s.height)
    };
    ccDrawPoly(vertices, 4, true);
#elif CC_SPRITE_DEBUG_DRAW == 2
    // draw texture box
    const CCSize& s = m_obRect.size;
    const CCPoint& offsetPix = getOffsetPositionInPixels();
    CCPoint vertices[4] = {
        ccp(offsetPix.x,offsetPix.y), ccp(offsetPix.x+s.width,offsetPix.y),
        ccp(offsetPix.x+s.width,offsetPix.y+s.height), ccp(offsetPix.x,offsetPix.y+s.height)
    };
    ccDrawPoly(vertices, 4, true);
#endif // CC_SPRITE_DEBUG_DRAW
}

// CCNode overrides

void CCSprite::addChild(CCNode* pChild)
{
	CCNode::addChild(pChild);
}

void CCSprite::addChild(CCNode *pChild, int zOrder)
{
	CCNode::addChild(pChild, zOrder);
}

void CCSprite::addChild(CCNode *pChild, int zOrder, int tag)
{
	CCAssert(pChild != NULL, "");
	CCNode::addChild(pChild, zOrder, tag);

	if (m_bUsesBatchNode)
	{
		CCAssert(((CCSprite*)pChild)->getTexture()->getName() == m_pobTextureAtlas->getTexture()->getName(), "");
		unsigned int index = m_pobBatchNode->atlasIndexForChild((CCSprite*)(pChild), zOrder);
		m_pobBatchNode->insertChild((CCSprite*)(pChild), index);
	}

	m_bHasChildren = true;
}

void CCSprite::reorderChild(CCNode *pChild, int zOrder)
{
    CCAssert(pChild != NULL, "");
	CCAssert(m_pChildren->containsObject(pChild), "");

	if (zOrder == pChild->getZOrder())
	{
		return;
	}

	if (m_bUsesBatchNode)
	{
		// XXX: Instead of removing/adding, it is more efficient to reorder manually
		pChild->retain();
		removeChild(pChild, false);
		addChild(pChild, zOrder);
		pChild->release();
	}
	else
	{
		CCNode::reorderChild(pChild, zOrder);
	}
}

void CCSprite::removeChild(CCNode *pChild, bool bCleanup)
{
	if (m_bUsesBatchNode)
	{
		m_pobBatchNode->removeSpriteFromAtlas((CCSprite*)(pChild));
	}

	CCNode::removeChild(pChild, bCleanup);

}

void CCSprite::removeAllChildrenWithCleanup(bool bCleanup)
{
	if (m_bUsesBatchNode)
	{
        CCObject* pObject = NULL;
        CCARRAY_FOREACH(m_pChildren, pObject)
        {
            CCSprite* pChild = dynamic_cast<CCSprite*>(pObject);
            if (pChild)
            {
                m_pobBatchNode->removeSpriteFromAtlas(pChild);
            }
        }
	}

	CCNode::removeAllChildrenWithCleanup(bCleanup);

	m_bHasChildren = false;
}

//
// CCNode property overloads
// used only when parent is CCSpriteBatchNode
//

void CCSprite::setDirtyRecursively(bool bValue)
{
	m_bDirty = m_bRecursiveDirty = bValue;
	// recursively set dirty
	if (m_bHasChildren)
	{
        CCObject* pObject = NULL;
        CCARRAY_FOREACH(m_pChildren, pObject)
        {
            CCSprite* pChild = dynamic_cast<CCSprite*>(pObject);
            if (pChild)
            {
                pChild->setDirtyRecursively(true);
            }
        }
	}
}

// XXX HACK: optimization
#define SET_DIRTY_RECURSIVELY() {									\
					if (m_bUsesBatchNode && ! m_bRecursiveDirty) {	\
						m_bDirty = m_bRecursiveDirty = true;				\
						if ( m_bHasChildren)							\
							setDirtyRecursively(true);			\
						}											\
					}

void CCSprite::setPosition(const CCPoint& pos)
{
	CCNode::setPosition(pos);
    SET_DIRTY_RECURSIVELY();
}

void CCSprite::setPositionInPixels(const CCPoint& pos)
{
	CCNode::setPositionInPixels(pos);
	SET_DIRTY_RECURSIVELY();
}

void CCSprite::setRotation(float fRotation)
{
	CCNode::setRotation(fRotation);
	SET_DIRTY_RECURSIVELY();
}

void CCSprite::setSkewX(float sx)
{
    CCNode::setSkewX(sx);
    SET_DIRTY_RECURSIVELY();
}

void CCSprite::setSkewY(float sy)
{
    CCNode::setSkewY(sy);
    SET_DIRTY_RECURSIVELY();
}

void CCSprite::setScaleX(float fScaleX)
{
	CCNode::setScaleX(fScaleX);
	SET_DIRTY_RECURSIVELY();
}

void CCSprite::setScaleY(float fScaleY)
{
	CCNode::setScaleY(fScaleY);
	SET_DIRTY_RECURSIVELY();
}

void CCSprite::setScale(float fScale)
{
	CCNode::setScale(fScale);
	SET_DIRTY_RECURSIVELY();
}

void CCSprite::setVertexZ(float fVertexZ)
{
	CCNode::setVertexZ(fVertexZ);
	SET_DIRTY_RECURSIVELY();
}

void CCSprite::setAnchorPoint(const CCPoint& anchor)
{
	CCNode::setAnchorPoint(anchor);
	SET_DIRTY_RECURSIVELY();
}

void CCSprite::setIsRelativeAnchorPoint(bool bRelative)
{
	CCAssert(! m_bUsesBatchNode, "");
	CCNode::setIsRelativeAnchorPoint(bRelative);
}

void CCSprite::setIsVisible(bool bVisible)
{
	CCNode::setIsVisible(bVisible);
	SET_DIRTY_RECURSIVELY();
}

void CCSprite::setFlipX(bool bFlipX)
{
	if (m_bFlipX != bFlipX)
	{
		m_bFlipX = bFlipX;
		setTextureRectInPixels(m_obRectInPixels, m_bRectRotated, m_tContentSizeInPixels);
	}
}

bool CCSprite::isFlipX(void)
{
	return m_bFlipX;
}

void CCSprite::setFlipY(bool bFlipY)
{
	if (m_bFlipY != bFlipY)
	{
		m_bFlipY = bFlipY;
		setTextureRectInPixels(m_obRectInPixels, m_bRectRotated, m_tContentSizeInPixels);
	}
}

bool CCSprite::isFlipY(void)
{
	return m_bFlipY;
}

//
// RGBA protocol
//

void CCSprite::updateColor(void)
{
	ccColor4B color4 = { m_sColor.r, m_sColor.g, m_sColor.b, m_nOpacity };

	m_sQuad.bl.colors = color4;
	m_sQuad.br.colors = color4;
	m_sQuad.tl.colors = color4;
	m_sQuad.tr.colors = color4;

	// renders using Sprite Manager
	if (m_bUsesBatchNode)
	{
		if (m_uAtlasIndex != CCSpriteIndexNotInitialized)
		{
			m_pobTextureAtlas->updateQuad(&m_sQuad, m_uAtlasIndex);
		}
		else
		{
			// no need to set it recursively
			// update dirty_, don't update recursiveDirty_
			m_bDirty = true;
		}
	}

	// self render
	// do nothing
}

GLubyte CCSprite::getOpacity(void)
{
	return m_nOpacity;
}

void CCSprite::setOpacity(GLubyte opacity)
{
	m_nOpacity = opacity;

	// special opacity for premultiplied textures
	if (m_bOpacityModifyRGB)
	{
		setColor(m_sColorUnmodified);
	}

	updateColor();
}

const ccColor3B& CCSprite::getColor(void)
{
	if (m_bOpacityModifyRGB)
	{
		return m_sColorUnmodified;
	}

	return m_sColor;
}

void CCSprite::setColor(const ccColor3B& color3)
{
    m_sColor = m_sColorUnmodified = color3;

	if (m_bOpacityModifyRGB)
	{
		m_sColor.r = color3.r * m_nOpacity/255;
		m_sColor.g = color3.g * m_nOpacity/255;
		m_sColor.b = color3.b * m_nOpacity/255;
	}

	updateColor();
}

void CCSprite::setIsOpacityModifyRGB(bool bValue)
{
	ccColor3B oldColor = m_sColor;
	m_bOpacityModifyRGB = bValue;
	m_sColor = oldColor;
}

bool CCSprite::getIsOpacityModifyRGB(void)
{
	return m_bOpacityModifyRGB;
}

// Frames

void CCSprite::setDisplayFrame(CCSpriteFrame *pNewFrame)
{
	m_obUnflippedOffsetPositionFromCenter = pNewFrame->getOffsetInPixels();

	CCTexture2D *pNewTexture = pNewFrame->getTexture();
	// update texture before updating texture rect
    if (pNewTexture != m_pobTexture)
    {
        setTexture(pNewTexture);
    }

	// update rect
	m_bRectRotated = pNewFrame->isRotated();
	setTextureRectInPixels(pNewFrame->getRectInPixels(), pNewFrame->isRotated(), pNewFrame->getOriginalSizeInPixels());
}

void CCSprite::setDisplayFrameWithAnimationName(const char *animationName, int frameIndex)
{
	CCAssert(animationName, "");

	CCAnimation *a = CCAnimationCache::sharedAnimationCache()->animationByName(animationName);

	CCAssert(a, "");

	CCSpriteFrame *frame = a->getFrames()->getObjectAtIndex(frameIndex);

	CCAssert(frame, "");

	setDisplayFrame(frame);
}

bool CCSprite::isFrameDisplayed(CCSpriteFrame *pFrame)
{
	CCRect r = pFrame->getRect();

	return (CCRect::CCRectEqualToRect(r, m_obRect) &&
		pFrame->getTexture()->getName() == m_pobTexture->getName());
}

CCSpriteFrame* CCSprite::displayedFrame(void)
{
	return CCSpriteFrame::frameWithTexture(m_pobTexture,
                                           m_obRectInPixels,
                                           m_bRectRotated,
                                           m_obUnflippedOffsetPositionFromCenter,
                                           m_tContentSizeInPixels);
}

// Texture protocol

void CCSprite::updateBlendFunc(void)
{
	CCAssert (! m_bUsesBatchNode, "CCSprite: updateBlendFunc doesn't work when the sprite is rendered using a CCSpriteSheet");

	// it's possible to have an untextured sprite
	if (! m_pobTexture || ! m_pobTexture->getHasPremultipliedAlpha())
	{
		m_sBlendFunc.src = GL_SRC_ALPHA;
		m_sBlendFunc.dst = GL_ONE_MINUS_SRC_ALPHA;
		setIsOpacityModifyRGB(false);
	}
	else
	{
		m_sBlendFunc.src = CC_BLEND_SRC;
		m_sBlendFunc.dst = CC_BLEND_DST;
		setIsOpacityModifyRGB(true);
	}
}

void CCSprite::setTexture(CCTexture2D *texture)
{
	// CCSprite: setTexture doesn't work when the sprite is rendered using a CCSpriteSheet
	CCAssert(! m_bUsesBatchNode, "setTexture doesn't work when the sprite is rendered using a CCSpriteSheet");

	// we can not use RTTI, so we do not known the type of object
	// accept texture==nil as argument
	/*CCAssert((! texture) || dynamic_cast<CCTexture2D*>(texture));*/

	CC_SAFE_RELEASE(m_pobTexture);

	m_pobTexture = texture;
	if (texture)
	{
	    texture->retain();
	}

	updateBlendFunc();
}

CCTexture2D* CCSprite::getTexture(void)
{
	return m_pobTexture;
}
}//namespace   cocos2d