From d57842bec5fd88daad9c8e63c51cdfbf6580b1f8 Mon Sep 17 00:00:00 2001 From: folecr Date: Thu, 27 Sep 2012 13:16:04 -0700 Subject: [PATCH 1/3] Generate bindings for CocosDenshion's SimpleAudioEngine * Bindings configured to rename SimpleAudioEngine to AudioEngine --- tools/tojs/cocos2dx.ini | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/tools/tojs/cocos2dx.ini b/tools/tojs/cocos2dx.ini index 415ebcb4fe..f444f2336b 100644 --- a/tools/tojs/cocos2dx.ini +++ b/tools/tojs/cocos2dx.ini @@ -22,11 +22,11 @@ cxxgenerator_headers = -I%(cxxgeneratordir)s/targets/spidermonkey/common extra_arguments = %(android_headers)s %(clang_headers)s %(cxxgenerator_headers)s %(cocos_headers)s %(android_flags)s %(clang_flags)s %(cocos_flags)s # what headers to parse -headers = %(cocosdir)s/cocos2dx/include/cocos2d.h +headers = %(cocosdir)s/cocos2dx/include/cocos2d.h %(cocosdir)s/CocosDenshion/include/SimpleAudioEngine.h # what classes to produce code for. You can use regular expressions here. When testing the regular # expression, it will be enclosed in "^$", like this: "^CCMenu*$". -classes = CCSprite.* CCScene CCNode CCDirector CCLayer.* CCMenu.* CCTouch CC.*Action.* CCMove.* CCRotate.* CCBlink.* CCTint.* CCSequence CCRepeat.* CCFade.* CCEase.* CCScale.* CCTransition.* CCSpawn CCSequence CCAnimat.* CCFlip.* CCDelay.* CCSkew.* CCJump.* CCPlace.* CCShow.* CCProgress.* CCPointArray CCToggleVisibility.* CCHide CCParticle.* CCLabel.* CCAtlas.* CCTextureCache.* CCTexture2D CCCardinal.* CCCatmullRom.* CCParallaxNode CCTileMap.* CCTMX.* CCCallFunc CCRenderTexture CCGridAction CCGrid3DAction CCShaky3D CCWaves3D CCFlipX3D CCFlipY3D CCSpeed CCActionManager CCSet +classes = CCSprite.* CCScene CCNode CCDirector CCLayer.* CCMenu.* CCTouch CC.*Action.* CCMove.* CCRotate.* CCBlink.* CCTint.* CCSequence CCRepeat.* CCFade.* CCEase.* CCScale.* CCTransition.* CCSpawn CCSequence CCAnimat.* CCFlip.* CCDelay.* CCSkew.* CCJump.* CCPlace.* CCShow.* CCProgress.* CCPointArray CCToggleVisibility.* CCHide CCParticle.* CCLabel.* CCAtlas.* CCTextureCache.* CCTexture2D CCCardinal.* CCCatmullRom.* CCParallaxNode CCTileMap.* CCTMX.* CCCallFunc CCRenderTexture CCGridAction CCGrid3DAction CCShaky3D CCWaves3D CCFlipX3D CCFlipY3D CCSpeed CCActionManager CCSet SimpleAudioEngine # what should we skip? in the format ClassName::[function function] # ClassName is a regular expression, but will be used like this: "^ClassName$" functions are also @@ -93,7 +93,8 @@ rename_functions = CCDirector::[sharedDirector=getInstance], CCMenuItem::[setEnabled=setIsEnabled], CCAnimation::[addSpriteFrameWithFileName=addSpriteFrameWithFilename], CCAnimationCache::[sharedAnimationCache=getInstance addAnimationsWithFile=addAnimations animationByName=getAnimation], - CCLayerGradient::[initWithColor=init] + CCLayerGradient::[initWithColor=init], + SimpleAudioEngine::[sharedEngine=getInstance] rename_classes = CCParticleSystemQuad::CCParticleSystem @@ -101,10 +102,10 @@ rename_classes = CCParticleSystemQuad::CCParticleSystem remove_prefix = CC # objects for which there will be no "parent" lookup -base_objects = CCNode CCDirector +base_objects = CCNode CCDirector SimpleAudioEngine # classes that create no constructor # CCSet is special and we will use a hand-written constructor -abstract_classes = CCDirector CCSpriteFrameCache CCTransitionEaseScene CCSet +abstract_classes = CCDirector CCSpriteFrameCache CCTransitionEaseScene CCSet SimpleAudioEngine -rename_classes = +rename_classes = SimpleAudioEngine::AudioEngine From f1aff597a2f14a03c89f18f284977d6f254f25ce Mon Sep 17 00:00:00 2001 From: folecr Date: Thu, 27 Sep 2012 13:23:08 -0700 Subject: [PATCH 2/3] Update makefile to include CocosDenshion --- scripting/javascript/bindings/Android.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripting/javascript/bindings/Android.mk b/scripting/javascript/bindings/Android.mk index 790f0369d3..2e5b995758 100644 --- a/scripting/javascript/bindings/Android.mk +++ b/scripting/javascript/bindings/Android.mk @@ -19,7 +19,8 @@ LOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT LOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT -LOCAL_C_INCLUDES := $(LOCAL_PATH) +LOCAL_C_INCLUDES := $(LOCAL_PATH) \ + $(LOCAL_PATH)/../../../CocosDenshion/include LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \ $(LOCAL_PATH)/generated From 5859260b25c22c93ec1dbc67f6ac9ee7cb527aef Mon Sep 17 00:00:00 2001 From: folecr Date: Thu, 27 Sep 2012 13:37:44 -0700 Subject: [PATCH 3/3] Update to latest generated bindings --- scripting/javascript/bindings/generated | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripting/javascript/bindings/generated b/scripting/javascript/bindings/generated index 2d18305596..85f20e3fb7 160000 --- a/scripting/javascript/bindings/generated +++ b/scripting/javascript/bindings/generated @@ -1 +1 @@ -Subproject commit 2d18305596b4da4b260bb2fd6d5ed8e878d0b129 +Subproject commit 85f20e3fb720d58dbb24fe6ba404af697d6d72cf