[FIX] testjs

This commit is contained in:
pengfei tong 2012-08-02 16:23:31 +08:00
parent c82c8412a8
commit a37fd743e0
26 changed files with 81 additions and 75 deletions

View File

@ -19,8 +19,8 @@ endif
DEFINES = -DLINUX
OBJECTS = ../Linux/FmodAudioPlayer.o \
../Linux/SimpleAudioEngine.o \
OBJECTS = ../linux/FmodAudioPlayer.o \
../linux/SimpleAudioEngine.o \
STATICLIBS =

View File

@ -134,7 +134,7 @@ public:
* @return A CCString pointer which is an autorelease object pointer,
* it means that you needn't do a release operation unless you retain it.
*/
static CCString* create(const unsigned char* pData, unsigned long nLen);
static CCString* createWithData(const unsigned char* pData, unsigned long nLen);
/** create a string with a file,
* @return A CCString pointer which is an autorelease object pointer,

View File

@ -79,7 +79,6 @@ THE SOFTWARE.
#include "ccConfig.h"
#include "ccMacros.h"
#include "ccTypes.h"
#include "cocos2dExt.h"
// kazmath
#include "kazmath/include/kazmath/kazmath.h"
@ -152,11 +151,11 @@ THE SOFTWARE.
#endif // CC_TARGET_PLATFROM == CC_PLATFORM_WIN32
#if (CC_TARGET_PLATFORM == CC_PLATFORM_LINUX)
#include "platform/Linux/CCAccelerometer.h"
#include "platform/Linux/CCApplication.h"
#include "platform/Linux/CCEGLView.h"
#include "platform/Linux/CCGL.h"
#include "platform/Linux/CCStdC.h"
#include "platform/linux/CCAccelerometer.h"
#include "platform/linux/CCApplication.h"
#include "platform/linux/CCEGLView.h"
#include "platform/linux/CCGL.h"
#include "platform/linux/CCStdC.h"
#endif // CC_TARGET_PLATFROM == CC_PLATFORM_LINUX
@ -195,12 +194,12 @@ THE SOFTWARE.
#include "textures/CCTexturePVR.h"
// tileMap_parallax_nodes
#include "tileMap_parallax_nodes/CCParallaxNode.h"
#include "tileMap_parallax_nodes/CCTMXLayer.h"
#include "tileMap_parallax_nodes/CCTMXObjectGroup.h"
#include "tileMap_parallax_nodes/CCTMXTiledMap.h"
#include "tileMap_parallax_nodes/CCTMXXMLParser.h"
#include "tileMap_parallax_nodes/CCTileMapAtlas.h"
#include "tilemap_parallax_nodes/CCParallaxNode.h"
#include "tilemap_parallax_nodes/CCTMXLayer.h"
#include "tilemap_parallax_nodes/CCTMXObjectGroup.h"
#include "tilemap_parallax_nodes/CCTMXTiledMap.h"
#include "tilemap_parallax_nodes/CCTMXXMLParser.h"
#include "tilemap_parallax_nodes/CCTileMapAtlas.h"
// touch_dispatcher
#include "touch_dispatcher/CCTouch.h"

View File

@ -13,8 +13,11 @@ INCLUDES = -I.. \
-I../include \
-I../kazmath/include \
-I../platform \
-I../extensions \
-I../platform/Linux \
-I../../extensions \
-I../../extensions/CCBReader \
-I../../extensions/GUI/CCControlExtension \
-I../../extensions/GUI/CCControlExtension \
-I../platform/linux/ \
-I../platform/third_party/linux/glew-1.7.0/glew-1.7.0/include/ \
-I../platform/third_party/linux/libxml2 \
-I../platform/third_party/linux/libpng \
@ -77,12 +80,12 @@ OBJECTS = ../actions/CCAction.o \
../platform/CCThread.o \
../platform/platform.o \
../platform/CCEGLViewProtocol.o \
../platform/Linux/CCStdC.o \
../platform/Linux/CCFileUtils.o \
../platform/Linux/CCCommon.o \
../platform/Linux/CCApplication.o \
../platform/Linux/CCEGLView.o \
../platform/Linux/CCImage.o \
../platform/linux/CCStdC.o \
../platform/linux/CCFileUtils.o \
../platform/linux/CCCommon.o \
../platform/linux/CCApplication.o \
../platform/linux/CCEGLView.o \
../platform/linux/CCImage.o \
../script_support/CCScriptSupport.o \
../sprite_nodes/CCAnimation.o \
../sprite_nodes/CCAnimationCache.o \
@ -97,6 +100,7 @@ OBJECTS = ../actions/CCAction.o \
../support/base64.o \
../support/ccUtils.o \
../support/CCVertex.o \
../support/CCNotificationCenter.o \
../support/image_support/TGAlib.o \
../support/zip_support/ZipUtils.o \
../support/zip_support/ioapi.o \
@ -108,52 +112,49 @@ OBJECTS = ../actions/CCAction.o \
../textures/CCTextureAtlas.o \
../textures/CCTextureCache.o \
../textures/CCTexturePVR.o \
../tileMap_parallax_nodes/CCParallaxNode.o \
../tileMap_parallax_nodes/CCTMXLayer.o \
../tileMap_parallax_nodes/CCTMXObjectGroup.o \
../tileMap_parallax_nodes/CCTMXTiledMap.o \
../tileMap_parallax_nodes/CCTMXXMLParser.o \
../tileMap_parallax_nodes/CCTileMapAtlas.o \
../tilemap_parallax_nodes/CCParallaxNode.o \
../tilemap_parallax_nodes/CCTMXLayer.o \
../tilemap_parallax_nodes/CCTMXObjectGroup.o \
../tilemap_parallax_nodes/CCTMXTiledMap.o \
../tilemap_parallax_nodes/CCTMXXMLParser.o \
../tilemap_parallax_nodes/CCTileMapAtlas.o \
../touch_dispatcher/CCTouchDispatcher.o \
../touch_dispatcher/CCTouchHandler.o \
../touch_dispatcher/CCTouch.o \
../shaders/CCGLProgram.o \
../shaders/ccGLStateCache.o \
../shaders/CCShaderCache.o \
../shaders/ccShaders.o \
../extensions/CCBReader/CCBFileLoader.o \
../extensions/CCBReader/CCMenuItemImageLoader.o \
../extensions/CCBReader/CCBReader.o \
../extensions/CCBReader/CCMenuItemLoader.o \
../extensions/CCBReader/CCControlButtonLoader.o \
../extensions/CCBReader/CCNodeLoader.o \
../extensions/CCBReader/CCControlLoader.o \
../extensions/CCBReader/CCNodeLoaderLibrary.o \
../extensions/CCBReader/CCLabelBMFontLoader.o \
../extensions/CCBReader/CCParticleSystemQuadLoader.o \
../extensions/CCBReader/CCLabelTTFLoader.o \
../extensions/CCBReader/CCScale9SpriteLoader.o \
../extensions/CCBReader/CCLayerColorLoader.o \
../extensions/CCBReader/CCScrollViewLoader.o \
../extensions/CCBReader/CCLayerGradientLoader.o \
../extensions/CCBReader/CCSpriteLoader.o \
../extensions/CCBReader/CCLayerLoader.o \
../extensions/CCListView/CCListViewCell.o \
../extensions/CCListView/CCListView.o \
../extensions/CCScrollView/CCScrollView.o \
../extensions/CCControlExtension/CCControlButton.o \
../extensions/CCControlExtension/CCControlColourPicker.o \
../extensions/CCControlExtension/CCControl.o \
../extensions/CCControlExtension/CCControlHuePicker.o \
../extensions/CCControlExtension/CCControlSaturationBrightnessPicker.o \
../extensions/CCControlExtension/CCControlSlider.o \
../extensions/CCControlExtension/CCControlSwitch.o \
../extensions/CCControlExtension/CCControlUtils.o \
../extensions/CCControlExtension/CCInvocation.o \
../extensions/CCControlExtension/CCMenuPassive.o \
../extensions/CCControlExtension/CCScale9Sprite.o \
../extensions/CCControlExtension/CCSpacer.o \
../extensions/CCNotificationCenter/CCNotificationCenter.o \
../extensions/CCTextureWatcher/CCTextureWatcher.o \
../../extensions/CCBReader/CCBFileLoader.o \
../../extensions/CCBReader/CCMenuItemImageLoader.o \
../../extensions/CCBReader/CCBReader.o \
../../extensions/CCBReader/CCMenuItemLoader.o \
../../extensions/CCBReader/CCControlButtonLoader.o \
../../extensions/CCBReader/CCNodeLoader.o \
../../extensions/CCBReader/CCControlLoader.o \
../../extensions/CCBReader/CCNodeLoaderLibrary.o \
../../extensions/CCBReader/CCLabelBMFontLoader.o \
../../extensions/CCBReader/CCParticleSystemQuadLoader.o \
../../extensions/CCBReader/CCLabelTTFLoader.o \
../../extensions/CCBReader/CCScale9SpriteLoader.o \
../../extensions/CCBReader/CCLayerColorLoader.o \
../../extensions/CCBReader/CCScrollViewLoader.o \
../../extensions/CCBReader/CCLayerGradientLoader.o \
../../extensions/CCBReader/CCSpriteLoader.o \
../../extensions/CCBReader/CCLayerLoader.o \
../../extensions/GUI/CCScrollView/CCScrollView.o \
../../extensions/GUI/CCControlExtension/CCControlButton.o \
../../extensions/GUI/CCControlExtension/CCControlColourPicker.o \
../../extensions/GUI/CCControlExtension/CCControl.o \
../../extensions/GUI/CCControlExtension/CCControlHuePicker.o \
../../extensions/GUI/CCControlExtension/CCControlSaturationBrightnessPicker.o \
../../extensions/GUI/CCControlExtension/CCControlSlider.o \
../../extensions/GUI/CCControlExtension/CCControlSwitch.o \
../../extensions/GUI/CCControlExtension/CCControlUtils.o \
../../extensions/GUI/CCControlExtension/CCInvocation.o \
../../extensions/GUI/CCControlExtension/CCMenuPassive.o \
../../extensions/GUI/CCControlExtension/CCScale9Sprite.o \
../../extensions/GUI/CCControlExtension/CCSpacer.o \
../kazmath/src/aabb.o \
../kazmath/src/plane.o \
../kazmath/src/vec2.o \
@ -173,6 +174,9 @@ OBJECTS = ../actions/CCAction.o \
../CCDrawingPrimitives.o \
../CCScheduler.o \
../cocos2d.o
# ../../extensions/CCListView/CCListViewCell.o \
# ../../extensions/CCListView/CCListView.o \
# ../../extensions/GUI/CCTextureWatcher/CCTextureWatcher.o \
LBITS := $(shell getconf LONG_BIT)
ifeq ($(LBITS),64)

View File

@ -73,7 +73,7 @@ cp $COCOS2DX20_TRUNK/CocosDenshion/proj.linux/libcocosdenshion.so $OUTPUT_DEBUG
make -C $COCOS2DX20_TRUNK/samples/TestCpp/proj.linux
check_make_result
make -C $COCOS2DX20_TRUNK/samples/HelloCpp/Linux
make -C $COCOS2DX20_TRUNK/samples/HelloCpp/proj.linux
check_make_result
make -C $COCOS2DX20_TRUNK/samples/TestJavascript/proj.linux
check_make_result

View File

@ -1,6 +1,6 @@
CC = gcc
CXX = g++
TARGET = HelloWorld
TARGET = HelloCpp
CCFLAGS = -Wall -g -O2
CXXFLAGS = -Wall -g -O2
VISIBILITY =
@ -14,7 +14,7 @@ INCLUDES = -I../ \
-I$(COCOS2DX_PATH)/cocoa \
-I$(COCOS2DX_PATH)/include \
-I$(COCOS2DX_PATH)/platform \
-I$(COCOS2DX_PATH)/platform/Linux \
-I$(COCOS2DX_PATH)/platform/linux \
-I$(COCOS2DX_PATH)/platform/third_party/linux/glew-1.7.0/glew-1.7.0/include/ \
-I$(COCOS2DX_PATH)/kazmath/include \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libxml2 \

View File

@ -17,11 +17,13 @@ INCLUDES = -I../ \
-I$(COCOS2DX_PATH)/include \
-I$(COCOS2DX_PATH)/kazmath/include \
-I$(COCOS2DX_PATH)/platform \
-I$(COCOS2DX_PATH)/platform/Linux \
-I$(COCOS2DX_PATH)/platform/linux \
-I$(COCOS2DX_PATH)/platform/third_party/linux/glew-1.7.0/glew-1.7.0/include/ \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libxml2 \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libjpeg \
-I../../../CocosDenshion/include \
-I../../../extensions/ \
-I../../../external/ \
-I../../../external/chipmunk/include/chipmunk \
@ -111,7 +113,7 @@ OBJECTS = ../Classes/AccelerometerTest/AccelerometerTest.o \
../Classes/ZwoptexTest/ZwoptexTest.o \
../Classes/controller.o \
../Classes/testBasic.o \
../AppDelegate.o \
../Classes/AppDelegate.o \
./main.o

View File

@ -1,6 +1,6 @@
#include "main.h"
#include "cocos2d.h"
#include "../AppDelegate.h"
#include "../Classes/AppDelegate.h"
USING_NS_CC;
int main(int argc, char **argv) {

View File

@ -15,24 +15,24 @@ INCLUDES = -I../ \
-I$(COCOS2DX_PATH) \
-I$(COCOS2DX_PATH)/cocoa \
-I$(COCOS2DX_PATH)/include \
-I$(COCOS2DX_PATH)/platform \
-I$(COCOS2DX_PATH)/platform/linux \
-I$(COCOS2DX_PATH)/platform/third_party/linux \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libfreetype2 \
-I$(COCOS2DX_PATH)/platform \
-I$(COCOS2DX_PATH)/platform/Linux \
-I$(COCOS2DX_PATH)/platform/third_party/linux/glew-1.7.0/glew-1.7.0/include/ \
-I$(COCOS2DX_PATH)/kazmath/include \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libxml2 \
-I$(COCOS2DX_PATH)/platform/third_party/linux/libjpeg \
-I$(COCOS2DX_PATH)/kazmath/include \
DEFINES = -DLINUX
OBJECTS = ./main.o \
../Classes/AppDelegate.o \
$(JSBINDING_PATH)/ScriptingCore.o \
$(JSBINDING_PATH)/cocos2d_generated.o \
$(JSBINDING_PATH)/cocos2d_manual_bindings.o \
$(JSBINDING_PATH)/cocos_denshion_generated.o \
$(JSBINDING_PATH)/ScriptingCore.o \
../Classes/AppDelegate.o \
# ../Classes/simple_class.o \
# ../Classes/simple_native_generated.o

View File

@ -225,7 +225,8 @@ JSBool S_CCLabelTTF::jsinitWithString(JSContext *cx, uint32_t argc, jsval *vp) {
char *narg0 = JS_EncodeString(cx, arg0);
CCSize* narg1; JSGET_PTRSHELL(CCSize, narg1, arg1);
char *narg3 = JS_EncodeString(cx, arg3);
bool ret = self->initWithString(narg0, *narg1, (CCTextAlignment)arg2, narg3, arg4);
// bool ret = self->initWithString(narg0, *narg1, (CCTextAlignment)arg2, narg3, arg4);
bool ret = self->initWithString(narg0, narg3, arg4, *narg1, (CCTextAlignment)arg2);
JS_SET_RVAL(cx, vp, BOOLEAN_TO_JSVAL(ret));
return JS_TRUE;