issue #2430:fix conflict

This commit is contained in:
minggo 2013-07-25 21:37:12 +08:00
commit 4d7ac6c800
32 changed files with 564 additions and 191 deletions

View File

@ -171,8 +171,8 @@ LOCAL_WHOLE_STATIC_LIBRARIES += cocos_libtiff_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_libwebp_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_libwebp_static
# define the macro to compile through support/zip_support/ioapi.c # define the macro to compile through support/zip_support/ioapi.c
LOCAL_CFLAGS := -Wno-psabi -Wno-deprecated-declarations -DUSE_FILE32API LOCAL_CFLAGS := -Wno-psabi -DUSE_FILE32API
LOCAL_EXPORT_CFLAGS := -Wno-psabi -Wno-deprecated-declarations -DUSE_FILE32API LOCAL_EXPORT_CFLAGS := -Wno-psabi -DUSE_FILE32API
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)

View File

@ -29,6 +29,13 @@
#include "sprite_nodes/CCSprite.h" #include "sprite_nodes/CCSprite.h"
#include "script_support/CCScriptSupport.h" #include "script_support/CCScriptSupport.h"
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif _MSC_VER >= 1400 //vs 2005 or higher
#pragma warning (push)
#pragma warning (disable: 4996)
#endif
NS_CC_BEGIN NS_CC_BEGIN
// //
// InstantAction // InstantAction
@ -476,13 +483,10 @@ CallFuncN * CallFuncN::clone() const
// //
// CallFuncND // CallFuncND
// //
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
#pragma warning (push) __CCCallFuncND * __CCCallFuncND::create(Object* selectorTarget, SEL_CallFuncND selector, void* d)
#pragma warning (disable: 4996)
#endif
CCCallFuncND * CCCallFuncND::create(Object* selectorTarget, SEL_CallFuncND selector, void* d)
{ {
CCCallFuncND* pRet = new CCCallFuncND(); __CCCallFuncND* pRet = new __CCCallFuncND();
if (pRet && pRet->initWithTarget(selectorTarget, selector, d)) { if (pRet && pRet->initWithTarget(selectorTarget, selector, d)) {
pRet->autorelease(); pRet->autorelease();
@ -493,7 +497,7 @@ CCCallFuncND * CCCallFuncND::create(Object* selectorTarget, SEL_CallFuncND selec
return NULL; return NULL;
} }
bool CCCallFuncND::initWithTarget(Object* selectorTarget, SEL_CallFuncND selector, void* d) bool __CCCallFuncND::initWithTarget(Object* selectorTarget, SEL_CallFuncND selector, void* d)
{ {
if (CallFunc::initWithTarget(selectorTarget)) if (CallFunc::initWithTarget(selectorTarget))
{ {
@ -505,7 +509,7 @@ bool CCCallFuncND::initWithTarget(Object* selectorTarget, SEL_CallFuncND selecto
return false; return false;
} }
void CCCallFuncND::execute() void __CCCallFuncND::execute()
{ {
if (_callFuncND) if (_callFuncND)
{ {
@ -513,10 +517,10 @@ void CCCallFuncND::execute()
} }
} }
CCCallFuncND * CCCallFuncND::clone() const __CCCallFuncND * __CCCallFuncND::clone() const
{ {
// no copy constructor // no copy constructor
auto a = new CCCallFuncND(); auto a = new __CCCallFuncND();
if( _selectorTarget) if( _selectorTarget)
{ {
@ -530,26 +534,26 @@ CCCallFuncND * CCCallFuncND::clone() const
// //
// CallFuncO // CallFuncO
// //
CCCallFuncO::CCCallFuncO() : __CCCallFuncO::__CCCallFuncO() :
_object(NULL) _object(NULL)
{ {
} }
CCCallFuncO::~CCCallFuncO() __CCCallFuncO::~__CCCallFuncO()
{ {
CC_SAFE_RELEASE(_object); CC_SAFE_RELEASE(_object);
} }
void CCCallFuncO::execute() void __CCCallFuncO::execute()
{ {
if (_callFuncO) { if (_callFuncO) {
(_selectorTarget->*_callFuncO)(_object); (_selectorTarget->*_callFuncO)(_object);
} }
} }
CCCallFuncO * CCCallFuncO::create(Object* selectorTarget, SEL_CallFuncO selector, Object* object) __CCCallFuncO * __CCCallFuncO::create(Object* selectorTarget, SEL_CallFuncO selector, Object* object)
{ {
CCCallFuncO *pRet = new CCCallFuncO(); __CCCallFuncO *pRet = new __CCCallFuncO();
if (pRet && pRet->initWithTarget(selectorTarget, selector, object)) { if (pRet && pRet->initWithTarget(selectorTarget, selector, object)) {
pRet->autorelease(); pRet->autorelease();
@ -560,7 +564,7 @@ CCCallFuncO * CCCallFuncO::create(Object* selectorTarget, SEL_CallFuncO selector
return NULL; return NULL;
} }
bool CCCallFuncO::initWithTarget(Object* selectorTarget, SEL_CallFuncO selector, Object* object) bool __CCCallFuncO::initWithTarget(Object* selectorTarget, SEL_CallFuncO selector, Object* object)
{ {
if (CallFunc::initWithTarget(selectorTarget)) if (CallFunc::initWithTarget(selectorTarget))
{ {
@ -574,10 +578,10 @@ bool CCCallFuncO::initWithTarget(Object* selectorTarget, SEL_CallFuncO selector,
return false; return false;
} }
CCCallFuncO * CCCallFuncO::clone() const __CCCallFuncO * __CCCallFuncO::clone() const
{ {
// no copy constructor // no copy constructor
auto a = new CCCallFuncO(); auto a = new __CCCallFuncO();
if( _selectorTarget) if( _selectorTarget)
{ {
@ -588,12 +592,12 @@ CCCallFuncO * CCCallFuncO::clone() const
return a; return a;
} }
Object* CCCallFuncO::getObject() const Object* __CCCallFuncO::getObject() const
{ {
return _object; return _object;
} }
void CCCallFuncO::setObject(Object* obj) void __CCCallFuncO::setObject(Object* obj)
{ {
if (obj != _object) if (obj != _object)
{ {
@ -603,8 +607,10 @@ void CCCallFuncO::setObject(Object* obj)
} }
} }
#if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) NS_CC_END
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#pragma GCC diagnostic warning "-Wdeprecated-declarations"
#elif _MSC_VER >= 1400 //vs 2005 or higher
#pragma warning (pop) #pragma warning (pop)
#endif #endif
NS_CC_END

View File

@ -347,24 +347,26 @@ protected:
* ND means: Node and Data. Data is void *, so it could be anything. * ND means: Node and Data. Data is void *, so it could be anything.
*/ */
class CC_DLL CC_DEPRECATED_ATTRIBUTE CCCallFuncND : public CallFunc class CC_DLL __CCCallFuncND : public CallFunc
{ {
public: public:
/** creates the action with the callback and the data to pass as an argument */ /** creates the action with the callback and the data to pass as an argument */
static CCCallFuncND * create(Object* selectorTarget, SEL_CallFuncND selector, void* d); CC_DEPRECATED_ATTRIBUTE static __CCCallFuncND * create(Object* selectorTarget, SEL_CallFuncND selector, void* d);
virtual long getClassTypeInfo() { virtual long getClassTypeInfo() {
static const long id = cocos2d::getHashCodeByString(typeid(cocos2d::CallFunc).name()); static const long id = cocos2d::getHashCodeByString(typeid(cocos2d::CallFunc).name());
return id; return id;
} }
protected:
/** initializes the action with the callback and the data to pass as an argument */ /** initializes the action with the callback and the data to pass as an argument */
bool initWithTarget(Object* selectorTarget, SEL_CallFuncND selector, void* d); bool initWithTarget(Object* selectorTarget, SEL_CallFuncND selector, void* d);
public:
// //
// Overrides // Overrides
// //
virtual CCCallFuncND* clone() const override; virtual __CCCallFuncND* clone() const override;
virtual void execute() override; virtual void execute() override;
protected: protected:
@ -380,33 +382,35 @@ protected:
@since v0.99.5 @since v0.99.5
*/ */
class CC_DLL CC_DEPRECATED_ATTRIBUTE CCCallFuncO : public CallFunc, public TypeInfo class CC_DLL __CCCallFuncO : public CallFunc, public TypeInfo
{ {
public: public:
/** creates the action with the callback /** creates the action with the callback
typedef void (Object::*SEL_CallFuncO)(Object*); typedef void (Object::*SEL_CallFuncO)(Object*);
*/ */
static CCCallFuncO * create(Object* selectorTarget, SEL_CallFuncO selector, Object* object); CC_DEPRECATED_ATTRIBUTE static __CCCallFuncO * create(Object* selectorTarget, SEL_CallFuncO selector, Object* object);
CCCallFuncO(); __CCCallFuncO();
virtual ~CCCallFuncO(); virtual ~__CCCallFuncO();
/** initializes the action with the callback
typedef void (Object::*SEL_CallFuncO)(Object*);
*/
bool initWithTarget(Object* selectorTarget, SEL_CallFuncO selector, Object* object);
virtual long getClassTypeInfo() { virtual long getClassTypeInfo() {
static const long id = cocos2d::getHashCodeByString(typeid(cocos2d::CallFunc).name()); static const long id = cocos2d::getHashCodeByString(typeid(cocos2d::CallFunc).name());
return id; return id;
} }
protected:
/** initializes the action with the callback
typedef void (Object::*SEL_CallFuncO)(Object*);
*/
bool initWithTarget(Object* selectorTarget, SEL_CallFuncO selector, Object* object);
public:
// //
// Overrides // Overrides
// //
virtual CCCallFuncO* clone() const override; virtual __CCCallFuncO* clone() const override;
virtual void execute() override; virtual void execute() override;
Object* getObject() const; Object* getObject() const;

View File

@ -636,6 +636,8 @@ CC_DEPRECATED_ATTRIBUTE typedef FlipY CCFlipY;
CC_DEPRECATED_ATTRIBUTE typedef Place CCPlace; CC_DEPRECATED_ATTRIBUTE typedef Place CCPlace;
CC_DEPRECATED_ATTRIBUTE typedef CallFunc CCCallFunc; CC_DEPRECATED_ATTRIBUTE typedef CallFunc CCCallFunc;
CC_DEPRECATED_ATTRIBUTE typedef CallFuncN CCCallFuncN; CC_DEPRECATED_ATTRIBUTE typedef CallFuncN CCCallFuncN;
CC_DEPRECATED_ATTRIBUTE typedef __CCCallFuncND CCCallFuncND;
CC_DEPRECATED_ATTRIBUTE typedef __CCCallFuncO CCCallFuncO;
CC_DEPRECATED_ATTRIBUTE typedef GridAction CCGridAction; CC_DEPRECATED_ATTRIBUTE typedef GridAction CCGridAction;
CC_DEPRECATED_ATTRIBUTE typedef Grid3DAction CCGrid3DAction; CC_DEPRECATED_ATTRIBUTE typedef Grid3DAction CCGrid3DAction;
CC_DEPRECATED_ATTRIBUTE typedef TiledGrid3DAction CCTiledGrid3DAction; CC_DEPRECATED_ATTRIBUTE typedef TiledGrid3DAction CCTiledGrid3DAction;

View File

@ -237,7 +237,7 @@ void Layer::didAccelerate(Acceleration* pAccelerationValue)
{ {
CC_UNUSED_PARAM(pAccelerationValue); CC_UNUSED_PARAM(pAccelerationValue);
if(kScriptTypeNone == _scriptType) if(kScriptTypeNone != _scriptType)
{ {
BasicScriptData data(this,(void*)pAccelerationValue); BasicScriptData data(this,(void*)pAccelerationValue);
ScriptEvent event(kAccelerometerEvent,&data); ScriptEvent event(kAccelerometerEvent,&data);

View File

@ -33,6 +33,13 @@ THE SOFTWARE.
#include <stdarg.h> #include <stdarg.h>
#include <cstring> #include <cstring>
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
#elif _MSC_VER >= 1400 //vs 2005 or higher
#pragma warning (push)
#pragma warning (disable: 4996)
#endif
NS_CC_BEGIN NS_CC_BEGIN
static unsigned int _globalFontSize = kItemSize; static unsigned int _globalFontSize = kItemSize;
@ -986,3 +993,9 @@ MenuItem* MenuItemToggle::getSelectedItem()
} }
NS_CC_END NS_CC_END
#if defined(__GNUC__) && ((__GNUC__ >= 4) || ((__GNUC__ == 3) && (__GNUC_MINOR__ >= 1)))
#pragma GCC diagnostic warning "-Wdeprecated-declarations"
#elif _MSC_VER >= 1400 //vs 2005 or higher
#pragma warning (pop)
#endif

View File

@ -785,7 +785,7 @@ void VolatileTexture::reloadAllTextures()
if (std::string::npos != lowerCase.find(".pvr")) if (std::string::npos != lowerCase.find(".pvr"))
{ {
Texture2D::PixelFormat oldPixelFormat = Texture2D::defaultAlphaPixelFormat(); Texture2D::PixelFormat oldPixelFormat = Texture2D::getDefaultAlphaPixelFormat();
Texture2D::setDefaultAlphaPixelFormat(vt->_pixelFormat); Texture2D::setDefaultAlphaPixelFormat(vt->_pixelFormat);
vt->_texture->initWithPVRFile(vt->_fileName.c_str()); vt->_texture->initWithPVRFile(vt->_fileName.c_str());
@ -799,7 +799,7 @@ void VolatileTexture::reloadAllTextures()
if (pImage && pImage->initWithImageData((void*)pBuffer, nSize, vt->_fmtImage)) if (pImage && pImage->initWithImageData((void*)pBuffer, nSize, vt->_fmtImage))
{ {
Texture2D::PixelFormat oldPixelFormat = Texture2D::defaultAlphaPixelFormat(); Texture2D::PixelFormat oldPixelFormat = Texture2D::getDefaultAlphaPixelFormat();
Texture2D::setDefaultAlphaPixelFormat(vt->_pixelFormat); Texture2D::setDefaultAlphaPixelFormat(vt->_pixelFormat);
vt->_texture->initWithImage(pImage); vt->_texture->initWithImage(pImage);
Texture2D::setDefaultAlphaPixelFormat(oldPixelFormat); Texture2D::setDefaultAlphaPixelFormat(oldPixelFormat);

View File

@ -186,7 +186,7 @@ void TMXLayer::setupTiles()
} }
// TMXLayer - Properties // TMXLayer - Properties
String* TMXLayer::getPropertyNamed(const char *propertyName) const String* TMXLayer::getProperty(const char *propertyName) const
{ {
return static_cast<String*>(_properties->objectForKey(propertyName)); return static_cast<String*>(_properties->objectForKey(propertyName));
} }
@ -195,14 +195,14 @@ void TMXLayer::parseInternalProperties()
{ {
// if cc_vertex=automatic, then tiles will be rendered using vertexz // if cc_vertex=automatic, then tiles will be rendered using vertexz
String *vertexz = getPropertyNamed("cc_vertexz"); String *vertexz = getProperty("cc_vertexz");
if (vertexz) if (vertexz)
{ {
// If "automatic" is on, then parse the "cc_alpha_func" too // If "automatic" is on, then parse the "cc_alpha_func" too
if (vertexz->_string == "automatic") if (vertexz->_string == "automatic")
{ {
_useAutomaticVertexZ = true; _useAutomaticVertexZ = true;
String *alphaFuncVal = getPropertyNamed("cc_alpha_func"); String *alphaFuncVal = getProperty("cc_alpha_func");
float alphaFuncValue = 0.0f; float alphaFuncValue = 0.0f;
if (alphaFuncVal != NULL) if (alphaFuncVal != NULL)
{ {

View File

@ -130,8 +130,8 @@ public:
CC_DEPRECATED_ATTRIBUTE Point positionAt(const Point& tileCoordinate) { return getPositionAt(tileCoordinate); }; CC_DEPRECATED_ATTRIBUTE Point positionAt(const Point& tileCoordinate) { return getPositionAt(tileCoordinate); };
/** return the value for the specific property name */ /** return the value for the specific property name */
String* getPropertyNamed(const char *propertyName) const; String* getProperty(const char *propertyName) const;
CC_DEPRECATED_ATTRIBUTE String* propertyNamed(const char *propertyName) const { return getPropertyNamed(propertyName); }; CC_DEPRECATED_ATTRIBUTE String* propertyNamed(const char *propertyName) const { return getProperty(propertyName); };
/** Creates the tiles */ /** Creates the tiles */
void setupTiles(); void setupTiles();

View File

@ -47,7 +47,7 @@ TMXObjectGroup::~TMXObjectGroup()
CC_SAFE_RELEASE(_properties); CC_SAFE_RELEASE(_properties);
} }
Dictionary* TMXObjectGroup::getObjectNamed(const char *objectName) const Dictionary* TMXObjectGroup::getObject(const char *objectName) const
{ {
if (_objects && _objects->count() > 0) if (_objects && _objects->count() > 0)
{ {
@ -66,7 +66,7 @@ Dictionary* TMXObjectGroup::getObjectNamed(const char *objectName) const
return NULL; return NULL;
} }
String* TMXObjectGroup::getPropertyNamed(const char* propertyName) const String* TMXObjectGroup::getProperty(const char* propertyName) const
{ {
return static_cast<String*>(_properties->objectForKey(propertyName)); return static_cast<String*>(_properties->objectForKey(propertyName));
} }

View File

@ -52,16 +52,16 @@ public:
inline void setGroupName(const char *groupName){ _groupName = groupName; } inline void setGroupName(const char *groupName){ _groupName = groupName; }
/** return the value for the specific property name */ /** return the value for the specific property name */
String* getPropertyNamed(const char* propertyName) const; String* getProperty(const char* propertyName) const;
CC_DEPRECATED_ATTRIBUTE String *propertyNamed(const char* propertyName) const { return getPropertyNamed(propertyName); }; CC_DEPRECATED_ATTRIBUTE String *propertyNamed(const char* propertyName) const { return getProperty(propertyName); };
/** return the dictionary for the specific object name. /** return the dictionary for the specific object name.
It will return the 1st object found on the array for the given name. It will return the 1st object found on the array for the given name.
*/ */
Dictionary* getObjectNamed(const char *objectName) const; Dictionary* getObject(const char *objectName) const;
CC_DEPRECATED_ATTRIBUTE Dictionary* objectNamed(const char *objectName) const { return getObjectNamed(objectName); }; CC_DEPRECATED_ATTRIBUTE Dictionary* objectNamed(const char *objectName) const { return getObject(objectName); };
/** Gets the offset position of child objects */ /** Gets the offset position of child objects */
inline const Point& getPositionOffset() const { return _positionOffset; }; inline const Point& getPositionOffset() const { return _positionOffset; };

View File

@ -61,16 +61,16 @@ bool AppDelegate::applicationDidFinishLaunching()
void AppDelegate::applicationDidEnterBackground() void AppDelegate::applicationDidEnterBackground()
{ {
Director::getInstance()->stopAnimation(); Director::getInstance()->stopAnimation();
SimpleAudioEngine::sharedEngine()->pauseBackgroundMusic(); SimpleAudioEngine::getInstance()->pauseBackgroundMusic();
SimpleAudioEngine::sharedEngine()->pauseAllEffects(); SimpleAudioEngine::getInstance()->pauseAllEffects();
} }
// this function will be called when the app is active again // this function will be called when the app is active again
void AppDelegate::applicationWillEnterForeground() void AppDelegate::applicationWillEnterForeground()
{ {
Director::getInstance()->startAnimation(); Director::getInstance()->startAnimation();
SimpleAudioEngine::sharedEngine()->resumeBackgroundMusic(); SimpleAudioEngine::getInstance()->resumeBackgroundMusic();
SimpleAudioEngine::sharedEngine()->resumeAllEffects(); SimpleAudioEngine::getInstance()->resumeAllEffects();
} }
UpdateLayer::UpdateLayer() UpdateLayer::UpdateLayer()
@ -149,16 +149,16 @@ bool UpdateLayer::init()
pItemEnter = MenuItemFont::create("enter", CC_CALLBACK_1(UpdateLayer::enter, this)); pItemEnter = MenuItemFont::create("enter", CC_CALLBACK_1(UpdateLayer::enter, this));
pItemUpdate = MenuItemFont::create("update", CC_CALLBACK_1(UpdateLayer::update, this)); pItemUpdate = MenuItemFont::create("update", CC_CALLBACK_1(UpdateLayer::update, this));
pItemEnter->setPosition(ccp(size.width/2, size.height/2 + 50)); pItemEnter->setPosition(Point(size.width/2, size.height/2 + 50));
pItemReset->setPosition(ccp(size.width/2, size.height/2)); pItemReset->setPosition(Point(size.width/2, size.height/2));
pItemUpdate->setPosition(ccp(size.width/2, size.height/2 - 50)); pItemUpdate->setPosition(Point(size.width/2, size.height/2 - 50));
Menu *menu = Menu::create(pItemUpdate, pItemEnter, pItemReset, NULL); Menu *menu = Menu::create(pItemUpdate, pItemEnter, pItemReset, NULL);
menu->setPosition(ccp(0,0)); menu->setPosition(Point(0,0));
addChild(menu); addChild(menu);
pProgressLabel = LabelTTF::create("", "Arial", 20); pProgressLabel = LabelTTF::create("", "Arial", 20);
pProgressLabel->setPosition(ccp(100, 50)); pProgressLabel->setPosition(Point(100, 50));
addChild(pProgressLabel); addChild(pProgressLabel);
return true; return true;

View File

@ -51,7 +51,7 @@ fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# ... use paths relative to current directory # ... use paths relative to current directory
COCOS2DX_ROOT="../../../../" COCOS2DX_ROOT="$DIR/../../../.."
APP_ROOT="$DIR/.." APP_ROOT="$DIR/.."
APP_ANDROID_ROOT="$DIR" APP_ANDROID_ROOT="$DIR"
BINDINGS_JS_ROOT="$APP_ROOT/../../../scripting/javascript/bindings/js" BINDINGS_JS_ROOT="$APP_ROOT/../../../scripting/javascript/bindings/js"

View File

@ -21,7 +21,7 @@ AppDelegate::AppDelegate()
AppDelegate::~AppDelegate() AppDelegate::~AppDelegate()
{ {
ScriptEngineManager::purgeSharedManager(); ScriptEngineManager::destroyInstance();
} }
bool AppDelegate::applicationDidFinishLaunching() bool AppDelegate::applicationDidFinishLaunching()

View File

@ -21,7 +21,7 @@ AppDelegate::AppDelegate()
AppDelegate::~AppDelegate() AppDelegate::~AppDelegate()
{ {
ScriptEngineManager::purgeSharedManager(); ScriptEngineManager::destroyInstance();
} }
bool AppDelegate::applicationDidFinishLaunching() bool AppDelegate::applicationDidFinishLaunching()

View File

@ -35,7 +35,7 @@ bool AppDelegate::applicationDidFinishLaunching()
pDirector->setAnimationInterval(1.0 / 60); pDirector->setAnimationInterval(1.0 / 60);
// register lua engine // register lua engine
LuaEngine* pEngine = LuaEngine::defaultEngine(); LuaEngine* pEngine = LuaEngine::getInstance();
ScriptEngineManager::getInstance()->setScriptEngine(pEngine); ScriptEngineManager::getInstance()->setScriptEngine(pEngine);
std::string path = FileUtils::getInstance()->fullPathForFilename("hello.lua"); std::string path = FileUtils::getInstance()->fullPathForFilename("hello.lua");

View File

@ -47,11 +47,11 @@ bool AppDelegate::applicationDidFinishLaunching()
EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionFixedHeight); EGLView::getInstance()->setDesignResolutionSize(designSize.width, designSize.height, kResolutionFixedHeight);
// register lua engine // register lua engine
LuaEngine* pEngine = LuaEngine::defaultEngine(); LuaEngine* pEngine = LuaEngine::getInstance();
ScriptEngineManager::getInstance()->setScriptEngine(pEngine); ScriptEngineManager::getInstance()->setScriptEngine(pEngine);
std::vector<std::string> searchPaths = pFileUtils->getSearchPaths(); std::vector<std::string> searchPaths = pFileUtils->getSearchPaths();
searchPaths.push_back("cocosbuilderRes"); searchPaths.insert(searchPaths.begin(), "cocosbuilderRes");
#if CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY #if CC_TARGET_PLATFORM == CC_PLATFORM_BLACKBERRY
searchPaths.push_back("TestCppResources"); searchPaths.push_back("TestCppResources");

View File

@ -39,9 +39,7 @@ LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \
$(LOCAL_PATH)/generated $(LOCAL_PATH)/generated
LOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static LOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos2dx_static
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
LOCAL_WHOLE_STATIC_LIBRARIES += chipmunk_static
LOCAL_LDLIBS := -landroid LOCAL_LDLIBS := -landroid
LOCAL_LDLIBS += -llog LOCAL_LDLIBS += -llog
@ -49,6 +47,4 @@ LOCAL_LDLIBS += -llog
include $(BUILD_STATIC_LIBRARY) include $(BUILD_STATIC_LIBRARY)
$(call import-module,scripting/javascript/spidermonkey-android) $(call import-module,scripting/javascript/spidermonkey-android)
$(call import-module,cocos2dx)
$(call import-module,extensions) $(call import-module,extensions)
$(call import-module,external/chipmunk)

View File

@ -80,6 +80,16 @@ static std::map<int,int> ports_sockets;
// name ~> globals // name ~> globals
static std::map<std::string, js::RootedObject*> globals; static std::map<std::string, js::RootedObject*> globals;
static void ReportException(JSContext *cx)
{
if (JS_IsExceptionPending(cx)) {
if (!JS_ReportPendingException(cx)) {
JS_ClearPendingException(cx);
}
}
}
static void executeJSFunctionFromReservedSpot(JSContext *cx, JSObject *obj, static void executeJSFunctionFromReservedSpot(JSContext *cx, JSObject *obj,
jsval &dataVal, jsval &retval) { jsval &dataVal, jsval &retval) {
@ -487,7 +497,7 @@ JSBool ScriptingCore::runScript(const char *path, JSObject* global, JSContext* c
JS::CompileOptions options(cx); JS::CompileOptions options(cx);
options.setUTF8(true).setFileAndLine(fullPath.c_str(), 1); options.setUTF8(true).setFileAndLine(fullPath.c_str(), 1);
// a) check js file first // a) check jsc file first
std::string byteCodePath = RemoveFileExt(std::string(path)) + BYTE_CODE_FILE_EXT; std::string byteCodePath = RemoveFileExt(std::string(path)) + BYTE_CODE_FILE_EXT;
unsigned long length = 0; unsigned long length = 0;
void *data = futil->getFileData(byteCodePath.c_str(), void *data = futil->getFileData(byteCodePath.c_str(),
@ -499,6 +509,9 @@ JSBool ScriptingCore::runScript(const char *path, JSObject* global, JSContext* c
// b) no jsc file, check js file // b) no jsc file, check js file
if (!script) { if (!script) {
/* Clear any pending exception from previous failed decoding. */
ReportException(cx);
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID) #if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
String* content = String::createWithContentsOfFile(path); String* content = String::createWithContentsOfFile(path);
if (content) { if (content) {

View File

@ -273,7 +273,7 @@ JSBool js_cocos2dx_CCBReader_createSceneWithNodeGraphFromFile(JSContext *cx, uin
JSBool js_CocosBuilder_create(JSContext *cx, uint32_t argc, jsval *vp) JSBool js_CocosBuilder_create(JSContext *cx, uint32_t argc, jsval *vp)
{ {
NodeLoaderLibrary * ccNodeLoaderLibrary = NodeLoaderLibrary::sharedNodeLoaderLibrary(); NodeLoaderLibrary * ccNodeLoaderLibrary = NodeLoaderLibrary::getInstance();
ccNodeLoaderLibrary->registerNodeLoader("", JSLayerLoader::loader()); ccNodeLoaderLibrary->registerNodeLoader("", JSLayerLoader::loader());

View File

@ -125,9 +125,9 @@
</PrecompiledHeader> </PrecompiledHeader>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..;$(ProjectDir)..\..\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\extensions\LocalStorage;$(ProjectDir)..\..\..\..\extensions\network;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..;$(ProjectDir)..\..\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\extensions\LocalStorage;$(ProjectDir)..\..\..\..\extensions\network;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4068;4101;4800;4251;4996;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings> <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild> <MinimalRebuild>false</MinimalRebuild>
</ClCompile> </ClCompile>
@ -148,9 +148,9 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\sqlite3\libraries\win32\*.*" "$(O
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..;$(ProjectDir)..\..\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\extensions\LocalStorage;$(ProjectDir)..\..\..\..\extensions\network;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..;$(ProjectDir)..\..\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\extensions\LocalStorage;$(ProjectDir)..\..\..\..\extensions\network;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4068;4101;4800;4251;4996;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings> <DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile> </ClCompile>
<Link> <Link>

View File

@ -27,7 +27,7 @@
CCBReader* CCBProxy::createCCBReader() CCBReader* CCBProxy::createCCBReader()
{ {
NodeLoaderLibrary *ccNodeLoaderLibrary = NodeLoaderLibrary::sharedNodeLoaderLibrary(); NodeLoaderLibrary *ccNodeLoaderLibrary = NodeLoaderLibrary::getInstance();
ccNodeLoaderLibrary->registerNodeLoader("", CCBLayerLoader::loader()); ccNodeLoaderLibrary->registerNodeLoader("", CCBLayerLoader::loader());

View File

@ -1 +1 @@
5210edb9a769444bc7bc28122935940e03dd6ab0 bfb95e6faa9b59a5045353dffbae4d7cad7d6655

View File

@ -63,7 +63,7 @@
<ClCompile> <ClCompile>
<Optimization>Disabled</Optimization> <Optimization>Disabled</Optimization>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\extensions\network;$(ProjectDir)..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\tolua;$(ProjectDir)..\luajit\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\extensions\network;$(ProjectDir)..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\tolua;$(ProjectDir)..\luajit\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;COCOS2D_DEBUG=1;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<MinimalRebuild>false</MinimalRebuild> <MinimalRebuild>false</MinimalRebuild>
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks> <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
<RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
@ -75,7 +75,7 @@
</PrecompiledHeaderOutputFile> </PrecompiledHeaderOutputFile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>EditAndContinue</DebugInformationFormat> <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
<DisableSpecificWarnings>4996;4800;4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings> <DisableSpecificWarnings>4800;4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile> </ClCompile>
<Lib> <Lib>
@ -95,7 +95,7 @@ xcopy /Y /Q "$(ProjectDir)..\luajit\win32\*.*" "$(OutDir)"</Command>
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
<IntrinsicFunctions>true</IntrinsicFunctions> <IntrinsicFunctions>true</IntrinsicFunctions>
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\extensions\network;$(ProjectDir)..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\tolua;$(ProjectDir)..\luajit\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\extensions\network;$(ProjectDir)..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\tolua;$(ProjectDir)..\luajit\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBLUA_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBLUA_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<FunctionLevelLinking>true</FunctionLevelLinking> <FunctionLevelLinking>true</FunctionLevelLinking>
<PrecompiledHeader> <PrecompiledHeader>
@ -106,7 +106,7 @@ xcopy /Y /Q "$(ProjectDir)..\luajit\win32\*.*" "$(OutDir)"</Command>
</PrecompiledHeaderOutputFile> </PrecompiledHeaderOutputFile>
<WarningLevel>Level3</WarningLevel> <WarningLevel>Level3</WarningLevel>
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat> <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
<DisableSpecificWarnings>4996;4800;4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings> <DisableSpecificWarnings>4800;4267;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile> </ClCompile>
<Lib> <Lib>

View File

@ -1,13 +1,9 @@
--tip
local function deprecatedTip(old_name,new_name) local function deprecatedTip(old_name,new_name)
print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********") print("\n********** \n"..old_name.." was deprecated please use ".. new_name .. " instead.\n**********")
end end
local function addHandleOfControlEvent(self,func,controlEvent)
deprecatedTip("addHandleOfControlEvent","registerControlEventHandler")
self:registerControlEventHandler(func,controlEvent)
end
rawset(CCControl,"addHandleOfControlEvent",addHandleOfControlEvent)
--functions of _G will be deprecated begin
local function ccpLineIntersect(a,b,c,d,s,t) local function ccpLineIntersect(a,b,c,d,s,t)
deprecatedTip("ccpLineIntersect","CCPoint:isLineIntersect") deprecatedTip("ccpLineIntersect","CCPoint:isLineIntersect")
return CCPoint:isLineIntersect(a,b,c,d,s,t) return CCPoint:isLineIntersect(a,b,c,d,s,t)
@ -93,7 +89,6 @@ local function ccpRPerp(pt)
end end
rawset(_G,"ccpRPerp",ccpRPerp) rawset(_G,"ccpRPerp",ccpRPerp)
--no test
local function ccpProject(pt1,pt2) local function ccpProject(pt1,pt2)
deprecatedTip("ccpProject","CCPoint:project") deprecatedTip("ccpProject","CCPoint:project")
return pt1:project(pt2) return pt1:project(pt2)
@ -215,238 +210,579 @@ local function ccpIntersectPoint(pt1,pt2,pt3,pt4)
end end
rawset(_G,"ccpIntersectPoint",ccpIntersectPoint) rawset(_G,"ccpIntersectPoint",ccpIntersectPoint)
local function ccc3(r,g,b)
deprecatedTip("ccc3(r,g,b)","ccColor3B(r,g,b)")
return ccColor3B(r,g,b)
end
rawset(_G,"ccc3",ccc3)
local function sharedOpenGLView() local function ccc4(r,g,b,a)
deprecatedTip("ccc4(r,g,b,a)","Color4B(r,g,b,a)")
return Color4B(r,g,b,a)
end
rawset(_G,"ccc4",ccc4)
local function ccc4FFromccc3B(color3B)
deprecatedTip("ccc4FFromccc3B(color3B)","Color4F(color3B.r / 255.0,color3B.g / 255.0,color3B.b / 255.0,1.0)")
return Color4F(color3B.r/255.0, color3B.g/255.0, color3B.b/255.0, 1.0)
end
rawset(_G,"ccc4FFromccc3B",ccc4FFromccc3B)
local function ccc4f(r,g,b,a)
deprecatedTip("ccc4f(r,g,b,a)","Color4F(r,g,b,a)")
return Color4F(r,g,b,a)
end
rawset(_G,"ccc4f",ccc4f)
local function ccc4FFromccc4B(color4B)
deprecatedTip("ccc4FFromccc4B(color4B)","Color4F(color4B.r/255.0, color4B.g/255.0, color4B.b/255.0, color4B.a/255.0)")
return Color4F(color4B.r/255.0, color4B.g/255.0, color4B.b/255.0, color4B.a/255.0)
end
rawset(_G,"ccc4FFromccc4B",ccc4FFromccc4B)
local function ccc4FEqual(a,b)
deprecatedTip("ccc4FEqual(a,b)","a:equals(b)")
return a:equals(b)
end
rawset(_G,"ccc4FEqual",ccc4FEqual)
local function vertex2(x,y)
deprecatedTip("vertex2(x,y)","Vertex2F(x,y)")
return Vertex2F(x,y)
end
rawset(_G,"vertex2",vertex2)
local function vertex3(x,y,z)
deprecatedTip("vertex3(x,y,z)","Vertex3F(x,y,z)")
return Vertex3F(x,y,z)
end
rawset(_G,"vertex3",vertex3)
local function tex2(u,v)
deprecatedTip("tex2(u,v)","Tex2F(u,v)")
return Tex2F(u,v)
end
rawset(_G,"tex2",tex2)
local function ccc4BFromccc4F(color4F)
deprecatedTip("ccc4BFromccc4F(color4F)","Color4B(color4F.r * 255.0, color4F.g * 255.0, color4F.b * 255.0, color4B.a * 255.0)")
return Color4B(color4F.r * 255.0, color4F.g * 255.0, color4F.b * 255.0, color4B.a * 255.0)
end
rawset(_G,"ccc4BFromccc4F",ccc4BFromccc4F)
local function ccColor3BDeprecated()
deprecatedTip("ccColor3B","Color3B")
return Color3B
end
_G["ccColor3B"] = ccColor3BDeprecated()
local function ccColor4BDeprecated()
deprecatedTip("ccColor4B","Color4B")
return Color4B
end
_G["ccColor4B"] = ccColor4BDeprecated()
local function ccColor4FDeprecated()
deprecatedTip("ccColor4F","Color4F")
return Color4F
end
_G["ccColor4F"] = ccColor4FDeprecated()
local function ccVertex2FDeprecated()
deprecatedTip("ccVertex2F","Vertex2F")
return Vertex2F
end
_G["ccVertex2F"] = ccVertex2FDeprecated()
local function ccVertex3FDeprecated()
deprecatedTip("ccVertex3F","Vertex3F")
return Vertex3F
end
_G["ccVertex3F"] = ccVertex3FDeprecated()
local function ccTex2FDeprecated()
deprecatedTip("ccTex2F","Tex2F")
return Tex2F
end
_G["ccTex2F"] = ccTex2FDeprecated()
local function ccPointSpriteDeprecated()
deprecatedTip("ccPointSprite","PointSprite")
return PointSprite
end
_G["ccPointSprite"] = ccPointSpriteDeprecated()
local function ccQuad2Deprecated()
deprecatedTip("ccQuad2","Quad2")
return Quad2
end
_G["ccQuad2"] = ccQuad2Deprecated()
local function ccQuad3Deprecated()
deprecatedTip("ccQuad3","Quad3")
return Quad3
end
_G["ccQuad3"] = ccQuad3Deprecated()
local function ccV2FC4BT2FDeprecated()
deprecatedTip("ccV2F_C4B_T2F","V2F_C4B_T2F")
return V2F_C4B_T2F
end
_G["ccV2F_C4B_T2F"] = ccV2FC4BT2FDeprecated()
local function ccV2FC4FT2FDeprecated()
deprecatedTip("ccV2F_C4F_T2F","V2F_C4F_T2F")
return V2F_C4F_T2F
end
_G["ccV2F_C4F_T2F"] = ccV2FC4FT2FDeprecated()
local function ccV3FC4BT2FDeprecated()
deprecatedTip("ccV3F_C4B_T2F","V3F_C4B_T2F")
return V3F_C4B_T2F
end
_G["ccV3F_C4B_T2F"] = ccV3FC4BT2FDeprecated()
local function ccV2FC4BT2FQuadDeprecated()
deprecatedTip("ccV2F_C4B_T2F_Quad","V2F_C4B_T2F_Quad")
return V2F_C4B_T2F_Quad
end
_G["ccV2F_C4B_T2F_Quad"] = ccV2FC4BT2FQuadDeprecated()
local function ccV3FC4BT2FQuadDeprecated()
deprecatedTip("ccV3F_C4B_T2F_Quad","V3F_C4B_T2F_Quad")
return V3F_C4B_T2F_Quad
end
_G["ccV3F_C4B_T2F_Quad"] = ccV3FC4BT2FQuadDeprecated()
local function ccV2FC4FT2FQuadDeprecated()
deprecatedTip("ccV2F_C4F_T2F_Quad","V2F_C4F_T2F_Quad")
return V2F_C4F_T2F_Quad
end
_G["ccV2F_C4F_T2F_Quad"] = ccV2FC4FT2FQuadDeprecated()
local function ccBlendFuncDeprecated()
deprecatedTip("ccBlendFunc","BlendFunc")
return BlendFunc
end
_G["ccBlendFunc"] = ccBlendFuncDeprecated()
local function ccT2FQuadDeprecated()
deprecatedTip("ccT2F_Quad","T2F_Quad")
return T2F_Quad
end
_G["ccT2F_Quad"] = ccT2FQuadDeprecated()
local function ccAnimationFrameDataDeprecated()
deprecatedTip("ccAnimationFrameData","AnimationFrameData")
return AnimationFrameData
end
_G["ccAnimationFrameData"] = ccAnimationFrameDataDeprecated()
local function CCCallFuncNDeprecated( )
deprecatedTip("CCCallFuncN","CCCallFunc")
return CCCallFunc
end
_G["CCCallFuncN"] = CCCallFuncNDeprecated()
--functions of _G will be deprecated end
local color = ccColor4B()
local r = color.r
--functions of CCControl will be deprecated end
local CCControlDeprecated = { }
function CCControlDeprecated.addHandleOfControlEvent(self,func,controlEvent)
deprecatedTip("addHandleOfControlEvent","registerControlEventHandler")
print("come in addHandleOfControlEvent")
self:registerControlEventHandler(func,controlEvent)
end
rawset(CCControl,"addHandleOfControlEvent",CCControlDeprecated.addHandleOfControlEvent)
--functions of CCControl will be deprecated end
--functions of CCEGLView will be deprecated end
local CCEGLViewDeprecated = { }
function CCEGLViewDeprecated.sharedOpenGLView()
deprecatedTip("CCEGLView:sharedOpenGLView","CCEGLView:getInstance") deprecatedTip("CCEGLView:sharedOpenGLView","CCEGLView:getInstance")
return CCEGLView:getInstance() return CCEGLView:getInstance()
end end
rawset(CCEGLView,"sharedOpenGLView",sharedOpenGLView) rawset(CCEGLView,"sharedOpenGLView",CCEGLViewDeprecated.sharedOpenGLView)
--functions of CCFileUtils will be deprecated end
local function sharedFileUtils()
--functions of CCFileUtils will be deprecated end
local CCFileUtilsDeprecated = { }
function CCFileUtilsDeprecated.sharedFileUtils()
deprecatedTip("CCFileUtils:sharedFileUtils","CCFileUtils:getInstance") deprecatedTip("CCFileUtils:sharedFileUtils","CCFileUtils:getInstance")
return CCFileUtils:getInstance() return CCFileUtils:getInstance()
end end
rawset(CCFileUtils,"sharedFileUtils",sharedFileUtils) rawset(CCFileUtils,"sharedFileUtils",CCFileUtilsDeprecated.sharedFileUtils)
local function purgeFileUtils() function CCFileUtilsDeprecated.purgeFileUtils()
deprecatedTip("CCFileUtils:purgeFileUtils","CCFileUtils:destroyInstance") deprecatedTip("CCFileUtils:purgeFileUtils","CCFileUtils:destroyInstance")
return CCFileUtils:destroyInstance() return CCFileUtils:destroyInstance()
end end
rawset(CCFileUtils,"purgeFileUtils",purgeFileUtils) rawset(CCFileUtils,"purgeFileUtils",CCFileUtilsDeprecated.purgeFileUtils)
--functions of CCFileUtils will be deprecated end
local function sharedApplication()
--functions of CCApplication will be deprecated end
local CCApplicationDeprecated = { }
function CCApplicationDeprecated.sharedApplication()
deprecatedTip("CCApplication:sharedApplication","CCApplication:getInstance") deprecatedTip("CCApplication:sharedApplication","CCApplication:getInstance")
return CCApplication:getInstance() return CCApplication:getInstance()
end end
rawset(CCApplication,"sharedApplication",sharedApplication) rawset(CCApplication,"sharedApplication",CCApplicationDeprecated.sharedApplication)
--functions of CCApplication will be deprecated end
local function sharedDirector()
--functions of CCDirector will be deprecated end
local CCDirectorDeprecated = { }
function CCDirectorDeprecated.sharedDirector()
deprecatedTip("CCDirector:sharedDirector","CCDirector:getInstance") deprecatedTip("CCDirector:sharedDirector","CCDirector:getInstance")
return CCDirector:getInstance() return CCDirector:getInstance()
end end
rawset(CCDirector,"sharedDirector",sharedDirector) rawset(CCDirector,"sharedDirector",CCDirectorDeprecated.sharedDirector)
--functions of CCDirector will be deprecated end
local function sharedUserDefault()
--functions of CCUserDefault will be deprecated end
local CCUserDefaultDeprecated = { }
function CCUserDefaultDeprecated.sharedUserDefault()
deprecatedTip("CCUserDefault:sharedUserDefault","CCUserDefault:getInstance") deprecatedTip("CCUserDefault:sharedUserDefault","CCUserDefault:getInstance")
return CCUserDefault:getInstance() return CCUserDefault:getInstance()
end end
rawset(CCUserDefault,"sharedUserDefault",sharedUserDefault) rawset(CCUserDefault,"sharedUserDefault",CCUserDefaultDeprecated.sharedUserDefault)
local function purgeSharedUserDefault() function CCUserDefaultDeprecated.purgeSharedUserDefault()
deprecatedTip("CCUserDefault:purgeSharedUserDefault","CCUserDefault:destroyInstance") deprecatedTip("CCUserDefault:purgeSharedUserDefault","CCUserDefault:destroyInstance")
return CCUserDefault:destroyInstance() return CCUserDefault:destroyInstance()
end end
rawset(CCUserDefault,"purgeSharedUserDefault",purgeSharedUserDefault) rawset(CCUserDefault,"purgeSharedUserDefault",CCUserDefaultDeprecated.purgeSharedUserDefault)
--functions of CCUserDefault will be deprecated end
local function sharedNotificationCenter() --functions of CCNotificationCenter will be deprecated end
local CCNotificationCenterDeprecated = { }
function CCNotificationCenterDeprecated.sharedNotificationCenter()
deprecatedTip("CCNotificationCenter:sharedNotificationCenter","CCNotificationCenter:getInstance") deprecatedTip("CCNotificationCenter:sharedNotificationCenter","CCNotificationCenter:getInstance")
return CCNotificationCenter:getInstance() return CCNotificationCenter:getInstance()
end end
rawset(CCNotificationCenter,"sharedNotificationCenter",sharedNotificationCenter) rawset(CCNotificationCenter,"sharedNotificationCenter",CCNotificationCenterDeprecated.sharedNotificationCenter)
local function purgeNotificationCenter() function CCNotificationCenterDeprecated.purgeNotificationCenter()
deprecatedTip("CCNotificationCenter:purgeNotificationCenter","CCNotificationCenter:destroyInstance") deprecatedTip("CCNotificationCenter:purgeNotificationCenter","CCNotificationCenter:destroyInstance")
return CCNotificationCenter:destroyInstance() return CCNotificationCenter:destroyInstance()
end end
rawset(CCNotificationCenter,"purgeNotificationCenter",purgeNotificationCenter) rawset(CCNotificationCenter,"purgeNotificationCenter",CCNotificationCenterDeprecated.purgeNotificationCenter)
--functions of CCNotificationCenter will be deprecated end
local function sharedTextureCache()
--functions of CCTextureCache will be deprecated begin
local CCTextureCacheDeprecated = { }
function CCTextureCacheDeprecated.sharedTextureCache()
deprecatedTip("CCTextureCache:sharedTextureCache","CCTextureCache:getInstance") deprecatedTip("CCTextureCache:sharedTextureCache","CCTextureCache:getInstance")
return CCTextureCache:getInstance() return CCTextureCache:getInstance()
end end
rawset(CCTextureCache,"sharedTextureCache",sharedTextureCache) rawset(CCTextureCache,"sharedTextureCache",CCTextureCacheDeprecated.sharedTextureCache)
local function purgeSharedTextureCache() function CCTextureCacheDeprecated.purgeSharedTextureCache()
deprecatedTip("CCTextureCache:purgeSharedTextureCache","CCTextureCache:destroyInstance") deprecatedTip("CCTextureCache:purgeSharedTextureCache","CCTextureCache:destroyInstance")
return CCTextureCache:destroyInstance() return CCTextureCache:destroyInstance()
end end
rawset(CCTextureCache,"purgeSharedTextureCache",purgeSharedTextureCache) rawset(CCTextureCache,"purgeSharedTextureCache",CCTextureCacheDeprecated.purgeSharedTextureCache)
--functions of CCTextureCache will be deprecated end
local function sharedSpriteFrameCache()
deprecatedTip("CCSpriteFrameCache:sharedSpriteFrameCache","CCSpriteFrameCache:getInstance")
return CCSpriteFrameCache:getInstance()
end
rawset(CCSpriteFrameCache,"sharedSpriteFrameCache",sharedSpriteFrameCache)
local function purgeSharedSpriteFrameCache() --functions of CCGrid3DAction will be deprecated begin
deprecatedTip("CCSpriteFrameCache:purgeSharedSpriteFrameCache","CCSpriteFrameCache:destroyInstance") local CCGrid3DActionDeprecated = { }
return CCSpriteFrameCache:destroyInstance() function CCGrid3DActionDeprecated.vertex(self,pt)
end
rawset(CCSpriteFrameCache,"purgeSharedSpriteFrameCache",purgeSharedSpriteFrameCache)
local function vertex(self,pt)
deprecatedTip("vertex","CCGrid3DAction:getVertex") deprecatedTip("vertex","CCGrid3DAction:getVertex")
return self:getVertex(pt) return self:getVertex(pt)
end end
rawset(CCGrid3DAction,"vertex",vertex) rawset(CCGrid3DAction,"vertex",CCGrid3DActionDeprecated.vertex)
local function originalVertex(self,pt) function CCGrid3DActionDeprecated.originalVertex(self,pt)
deprecatedTip("originalVertex","CCGrid3DAction:getOriginalVertex") deprecatedTip("originalVertex","CCGrid3DAction:getOriginalVertex")
return self:getOriginalVertex(pt) return self:getOriginalVertex(pt)
end end
rawset(CCGrid3DAction,"originalVertex",originalVertex) rawset(CCGrid3DAction,"originalVertex",CCGrid3DActionDeprecated.originalVertex)
--functions of CCGrid3DAction will be deprecated end
local function tile(self,pt)
--functions of CCTiledGrid3DAction will be deprecated begin
local CCTiledGrid3DActionDeprecated = { }
function CCTiledGrid3DActionDeprecated.tile(self,pt)
deprecatedTip("tile","CCTiledGrid3DAction:getTile") deprecatedTip("tile","CCTiledGrid3DAction:getTile")
return self:getTile(pt) return self:getTile(pt)
end end
rawset(CCTiledGrid3DAction,"tile",tile) rawset(CCTiledGrid3DAction,"tile",CCTiledGrid3DActionDeprecated.tile)
local function originalTile(self,pt) function CCTiledGrid3DActionDeprecated.originalTile(self,pt)
deprecatedTip("originalTile","CCTiledGrid3DAction:getOriginalTile") deprecatedTip("originalTile","CCTiledGrid3DAction:getOriginalTile")
return self:getOriginalTile(pt) return self:getOriginalTile(pt)
end end
rawset(CCTiledGrid3DAction,"originalTile",originalTile) rawset(CCTiledGrid3DAction,"originalTile",CCTiledGrid3DActionDeprecated.originalTile)
--functions of CCTiledGrid3DAction will be deprecated end
local function sharedAnimationCache()
--functions of CCAnimationCache will be deprecated begin
local CCAnimationCacheDeprecated = { }
function CCAnimationCacheDeprecated.sharedAnimationCache()
deprecatedTip("CCAnimationCache:sharedAnimationCache","CCAnimationCache:getInstance") deprecatedTip("CCAnimationCache:sharedAnimationCache","CCAnimationCache:getInstance")
return CCAnimationCache:getInstance() return CCAnimationCache:getInstance()
end end
rawset(CCAnimationCache,"sharedAnimationCache",sharedAnimationCache) rawset(CCAnimationCache,"sharedAnimationCache",CCAnimationCacheDeprecated.sharedAnimationCache)
local function purgeSharedAnimationCache() function CCAnimationCacheDeprecated.purgeSharedAnimationCache()
deprecatedTip("CCAnimationCache:purgeSharedAnimationCache","CCAnimationCache:destroyInstance") deprecatedTip("CCAnimationCache:purgeSharedAnimationCache","CCAnimationCache:destroyInstance")
return CCAnimationCache:destroyInstance() return CCAnimationCache:destroyInstance()
end end
rawset(CCAnimationCache,"purgeSharedAnimationCache",purgeSharedAnimationCache) rawset(CCAnimationCache,"purgeSharedAnimationCache",CCAnimationCacheDeprecated.purgeSharedAnimationCache)
--functions of CCAnimationCache will be deprecated end
local function boundingBox(self)
--functions of CCNode will be deprecated begin
local CCNodeDeprecated = { }
function CCNodeDeprecated.boundingBox(self)
deprecatedTip("CCNode:boundingBox","CCNode:getBoundingBox") deprecatedTip("CCNode:boundingBox","CCNode:getBoundingBox")
return self:getBoundingBox() return self:getBoundingBox()
end end
rawset(CCNode,"boundingBox",boundingBox) rawset(CCNode,"boundingBox",CCNodeDeprecated.boundingBox)
local function numberOfRunningActions(self) function CCNodeDeprecated.numberOfRunningActions(self)
deprecatedTip("CCNode:numberOfRunningActions","CCNode:getNumberOfRunningActions") deprecatedTip("CCNode:numberOfRunningActions","CCNode:getNumberOfRunningActions")
return self:getNumberOfRunningActions() return self:getNumberOfRunningActions()
end end
rawset(CCNode,"numberOfRunningActions",numberOfRunningActions) rawset(CCNode,"numberOfRunningActions",CCNodeDeprecated.numberOfRunningActions)
--functions of CCNode will be deprecated end
local function stringForFormat(self)
--functions of CCTexture2D will be deprecated begin
local CCTexture2DDeprecated = { }
function CCTexture2DDeprecated.stringForFormat(self)
deprecatedTip("Texture2D:stringForFormat","Texture2D:getStringForFormat") deprecatedTip("Texture2D:stringForFormat","Texture2D:getStringForFormat")
return self:getStringForFormat() return self:getStringForFormat()
end end
rawset(CCTexture2D,"stringForFormat",stringForFormat) rawset(CCTexture2D,"stringForFormat",CCTexture2DDeprecated.stringForFormat)
local function bitsPerPixelForFormat(self) function CCTexture2DDeprecated.bitsPerPixelForFormat(self)
deprecatedTip("Texture2D:bitsPerPixelForFormat","Texture2D:getBitsPerPixelForFormat") deprecatedTip("Texture2D:bitsPerPixelForFormat","Texture2D:getBitsPerPixelForFormat")
return self:getBitsPerPixelForFormat() return self:getBitsPerPixelForFormat()
end end
rawset(CCTexture2D,"bitsPerPixelForFormat",bitsPerPixelForFormat) rawset(CCTexture2D,"bitsPerPixelForFormat",CCTexture2DDeprecated.bitsPerPixelForFormat)
local function bitsPerPixelForFormat(self,pixelFormat) function CCTexture2DDeprecated.bitsPerPixelForFormat(self,pixelFormat)
deprecatedTip("Texture2D:bitsPerPixelForFormat","Texture2D:getBitsPerPixelForFormat") deprecatedTip("Texture2D:bitsPerPixelForFormat","Texture2D:getBitsPerPixelForFormat")
return self:getBitsPerPixelForFormat(pixelFormat) return self:getBitsPerPixelForFormat(pixelFormat)
end end
rawset(CCTexture2D,"bitsPerPixelForFormat",bitsPerPixelForFormat) rawset(CCTexture2D,"bitsPerPixelForFormat",CCTexture2DDeprecated.bitsPerPixelForFormat)
local function defaultAlphaPixelFormat(self) function CCTexture2DDeprecated.defaultAlphaPixelFormat(self)
deprecatedTip("Texture2D:defaultAlphaPixelFormat","Texture2D:getDefaultAlphaPixelFormat") deprecatedTip("Texture2D:defaultAlphaPixelFormat","Texture2D:getDefaultAlphaPixelFormat")
return self:getDefaultAlphaPixelFormat() return self:getDefaultAlphaPixelFormat()
end end
rawset(CCTexture2D,"defaultAlphaPixelFormat",defaultAlphaPixelFormat) rawset(CCTexture2D,"defaultAlphaPixelFormat",CCTexture2DDeprecated.defaultAlphaPixelFormat)
--functions of CCTexture2D will be deprecated end
local function spriteFrameByName(self,szName)
--functions of CCSpriteFrameCache will be deprecated begin
local CCSpriteFrameCacheDeprecated = { }
function CCSpriteFrameCacheDeprecated.spriteFrameByName(self,szName)
deprecatedTip("CCSpriteFrameCache:spriteFrameByName","CCSpriteFrameCache:getSpriteFrameByName") deprecatedTip("CCSpriteFrameCache:spriteFrameByName","CCSpriteFrameCache:getSpriteFrameByName")
return self:getSpriteFrameByName(szName) return self:getSpriteFrameByName(szName)
end end
rawset(CCSpriteFrameCache,"spriteFrameByName",spriteFrameByName) rawset(CCSpriteFrameCache,"spriteFrameByName",CCSpriteFrameCacheDeprecated.spriteFrameByName)
local function timerWithScriptHandler(handler,seconds) function CCSpriteFrameCacheDeprecated.sharedSpriteFrameCache()
deprecatedTip("CCSpriteFrameCache:sharedSpriteFrameCache","CCSpriteFrameCache:getInstance")
return CCSpriteFrameCache:getInstance()
end
rawset(CCSpriteFrameCache,"sharedSpriteFrameCache",CCSpriteFrameCacheDeprecated.sharedSpriteFrameCache)
function CCSpriteFrameCacheDeprecated.purgeSharedSpriteFrameCache()
deprecatedTip("CCSpriteFrameCache:purgeSharedSpriteFrameCache","CCSpriteFrameCache:destroyInstance")
return CCSpriteFrameCache:destroyInstance()
end
rawset(CCSpriteFrameCache,"purgeSharedSpriteFrameCache",CCSpriteFrameCacheDeprecated.purgeSharedSpriteFrameCache)
--functions of CCSpriteFrameCache will be deprecated end
--functions of CCTimer will be deprecated begin
local CCTimerDeprecated = { }
function CCTimerDeprecated.timerWithScriptHandler(handler,seconds)
deprecatedTip("CCTimer:timerWithScriptHandler","CCTimer:createWithScriptHandler") deprecatedTip("CCTimer:timerWithScriptHandler","CCTimer:createWithScriptHandler")
return CCTimer:createWithScriptHandler(handler,seconds) return CCTimer:createWithScriptHandler(handler,seconds)
end end
rawset(CCTimer,"timerWithScriptHandler",timerWithScriptHandler) rawset(CCTimer,"timerWithScriptHandler",CCTimerDeprecated.timerWithScriptHandler)
local function numberOfRunningActionsInTarget(self,target) function CCTimerDeprecated.numberOfRunningActionsInTarget(self,target)
deprecatedTip("CCActionManager:numberOfRunningActionsInTarget","CCActionManager:getNumberOfRunningActionsInTarget") deprecatedTip("CCActionManager:numberOfRunningActionsInTarget","CCActionManager:getNumberOfRunningActionsInTarget")
return self:getNumberOfRunningActionsInTarget(target) return self:getNumberOfRunningActionsInTarget(target)
end end
rawset(CCTimer,"numberOfRunningActionsInTarget",numberOfRunningActionsInTarget) rawset(CCTimer,"numberOfRunningActionsInTarget",CCTimerDeprecated.numberOfRunningActionsInTarget)
--functions of CCTimer will be deprecated end
local function fontSize()
--functions of CCMenuItemFont will be deprecated begin
local CCMenuItemFontDeprecated = { }
function CCMenuItemFontDeprecated.fontSize()
deprecatedTip("CCMenuItemFont:fontSize","CCMenuItemFont:getFontSize") deprecatedTip("CCMenuItemFont:fontSize","CCMenuItemFont:getFontSize")
return CCMenuItemFont:getFontSize() return CCMenuItemFont:getFontSize()
end end
rawset(CCMenuItemFont,"fontSize",fontSize) rawset(CCMenuItemFont,"fontSize",CCMenuItemFontDeprecated.fontSize)
local function fontName() function CCMenuItemFontDeprecated.fontName()
deprecatedTip("CCMenuItemFont:fontName","CCMenuItemFont:getFontName") deprecatedTip("CCMenuItemFont:fontName","CCMenuItemFont:getFontName")
return CCMenuItemFont:getFontName() return CCMenuItemFont:getFontName()
end end
rawset(CCMenuItemFont,"fontName",fontName) rawset(CCMenuItemFont,"fontName",CCMenuItemFontDeprecated.fontName)
local function fontSizeObj(self) function CCMenuItemFontDeprecated.fontSizeObj(self)
deprecatedTip("CCMenuItemFont:fontSizeObj","CCMenuItemFont:getFontSizeObj") deprecatedTip("CCMenuItemFont:fontSizeObj","CCMenuItemFont:getFontSizeObj")
return self:getFontSizeObj() return self:getFontSizeObj()
end end
rawset(CCMenuItemFont,"fontSizeObj",fontSizeObj) rawset(CCMenuItemFont,"fontSizeObj",CCMenuItemFontDeprecated.fontSizeObj)
local function fontNameObj(self) function CCMenuItemFontDeprecated.fontNameObj(self)
deprecatedTip("CCMenuItemFont:fontNameObj","CCMenuItemFont:getFontNameObj") deprecatedTip("CCMenuItemFont:fontNameObj","CCMenuItemFont:getFontNameObj")
return self:getFontNameObj() return self:getFontNameObj()
end end
rawset(CCMenuItemFont,"fontNameObj",fontNameObj) rawset(CCMenuItemFont,"fontNameObj",CCMenuItemFontDeprecated.fontNameObj)
--functions of CCMenuItemFont will be deprecated end
local function selectedItem(self)
--functions of CCMenuItemToggle will be deprecated begin
local CCMenuItemToggleDeprecated = { }
function CCMenuItemToggleDeprecated.selectedItem(self)
deprecatedTip("CCMenuItemToggle:selectedItem","CCMenuItemToggle:getSelectedItem") deprecatedTip("CCMenuItemToggle:selectedItem","CCMenuItemToggle:getSelectedItem")
return self:getSelectedItem() return self:getSelectedItem()
end end
rawset(CCMenuItemToggle,"selectedItem",selectedItem) rawset(CCMenuItemToggle,"selectedItem",CCMenuItemToggleDeprecated.selectedItem)
--functions of CCMenuItemToggle will be deprecated end
local function tileAt(self,pos)
--functions of CCTileMapAtlas will be deprecated begin
local CCTileMapAtlasDeprecated = { }
function CCTileMapAtlasDeprecated.tileAt(self,pos)
deprecatedTip("CCTileMapAtlas:tileAt","CCTileMapAtlas:getTileAt") deprecatedTip("CCTileMapAtlas:tileAt","CCTileMapAtlas:getTileAt")
return self:getTileAt(pos) return self:getTileAt(pos)
end end
rawset(CCTileMapAtlas,"tileAt",tileAt) rawset(CCTileMapAtlas,"tileAt",CCTileMapAtlasDeprecated.tileAt)
--functions of CCTileMapAtlas will be deprecated end
local function tileAt(self,tileCoordinate)
--functions of CCTMXLayer will be deprecated begin
local CCTMXLayerDeprecated = { }
function CCTMXLayerDeprecated.tileAt(self,tileCoordinate)
deprecatedTip("CCTMXLayer:tileAt","CCTMXLayer:getTileAt") deprecatedTip("CCTMXLayer:tileAt","CCTMXLayer:getTileAt")
return self:getTileAt(tileCoordinate) return self:getTileAt(tileCoordinate)
end end
rawset(CCTMXLayer,"tileAt",tileAt) rawset(CCTMXLayer,"tileAt",CCTMXLayerDeprecated.tileAt)
local function tileGIDAt(self,tileCoordinate) function CCTMXLayerDeprecated.tileGIDAt(self,tileCoordinate)
deprecatedTip("CCTMXLayer:tileGIDAt","CCTMXLayer:getTileGIDAt") deprecatedTip("CCTMXLayer:tileGIDAt","CCTMXLayer:getTileGIDAt")
return self:getTileGIDAt(tileCoordinate) return self:getTileGIDAt(tileCoordinate)
end end
rawset(CCTMXLayer,"tileGIDAt",tileGIDAt) rawset(CCTMXLayer,"tileGIDAt",CCTMXLayerDeprecated.tileGIDAt)
local function positionAt(self,tileCoordinate) function CCTMXLayerDeprecated.positionAt(self,tileCoordinate)
deprecatedTip("CCTMXLayer:positionAt","CCTMXLayer:getPositionAt") deprecatedTip("CCTMXLayer:positionAt","CCTMXLayer:getPositionAt")
return self:getPositionAt(tileCoordinate) return self:getPositionAt(tileCoordinate)
end end
rawset(CCTMXLayer,"positionAt",positionAt) rawset(CCTMXLayer,"positionAt",CCTMXLayerDeprecated.positionAt)
local function propertyNamed(self,propertyName) function CCTMXLayerDeprecated.propertyNamed(self,propertyName)
deprecatedTip("CCTMXLayer:propertyNamed","CCTMXLayer:getPropertyNamed") deprecatedTip("CCTMXLayer:propertyNamed","CCTMXLayer:getProperty")
return self:getPropertyNamed(propertyName) return self:getProperty(propertyName)
end end
rawset(CCTMXLayer,"propertyNamed",propertyNamed) rawset(CCTMXLayer,"propertyNamed",CCTMXLayerDeprecated.propertyNamed)
--functions of CCTMXLayer will be deprecated end
local function sharedEngine()
--functions of SimpleAudioEngine will be deprecated begin
local SimpleAudioEngineDeprecated = { }
function SimpleAudioEngineDeprecated.sharedEngine()
deprecatedTip("SimpleAudioEngine:sharedEngine","SimpleAudioEngine:getInstance") deprecatedTip("SimpleAudioEngine:sharedEngine","SimpleAudioEngine:getInstance")
return SimpleAudioEngine:getInstance() return SimpleAudioEngine:getInstance()
end end
rawset(SimpleAudioEngine,"sharedEngine",sharedEngine) rawset(SimpleAudioEngine,"sharedEngine",SimpleAudioEngineDeprecated.sharedEngine)
--functions of SimpleAudioEngine will be deprecated end
--functions of WebSocket will be deprecated begin
local WebSocketDeprecated = { }
function WebSocketDeprecated.sendBinaryMsg(self,table,size)
deprecatedTip("sendBinaryMsg","sendBinaryStringMsg")
local strMsg = string.char(unpack(table))
return self:sendBinaryStringMsg(strMsg)
end
rawset(WebSocket,"sendBinaryMsg",WebSocketDeprecated.sendBinaryMsg)
--functions of WebSocket will be deprecated end
--functions of CCTMXTiledMap will be deprecated begin
local CCTMXTiledMapDeprecated = { }
function CCTMXTiledMapDeprecated.layerNamed(self,layerName)
deprecatedTip("CCTMXTiledMap:layerNamed","CCTMXTiledMap:getLayer")
return self:getLayer(layerName)
end
rawset(CCTMXTiledMap,"layerNamed", CCTMXTiledMapDeprecated.layerNamed)
function CCTMXTiledMapDeprecated.propertyNamed(self,propertyName)
deprecatedTip("CCTMXTiledMap:propertyNamed","CCTMXTiledMap:getProperty")
return self:getProperty(propertyName)
end
rawset(CCTMXTiledMap,"propertyNamed", CCTMXTiledMapDeprecated.propertyNamed )
function CCTMXTiledMapDeprecated.propertiesForGID(self,GID)
deprecatedTip("CCTMXTiledMap:propertiesForGID","CCTMXTiledMap:getPropertiesForGID")
return self:getPropertiesForGID(GID)
end
rawset(CCTMXTiledMap,"propertiesForGID", CCTMXTiledMapDeprecated.propertiesForGID)
function CCTMXTiledMapDeprecated.objectGroupNamed(self,groupName)
deprecatedTip("CCTMXTiledMap:objectGroupNamed","CCTMXTiledMap:getObjectGroup")
return self:getObjectGroup(groupName)
end
rawset(CCTMXTiledMap,"objectGroupNamed", CCTMXTiledMapDeprecated.objectGroupNamed)
--functions of CCTMXTiledMap will be deprecated end
--functions of CCTMXMapInfo will be deprecated begin
local CCTMXMapInfoDeprecated = { }
function CCTMXMapInfoDeprecated.getStoringCharacters(self)
deprecatedTip("CCTMXMapInfo:getStoringCharacters","CCTMXMapInfo:isStoringCharacters")
return self:isStoringCharacters()
end
rawset(CCTMXMapInfo,"getStoringCharacters", CCTMXMapInfoDeprecated.getStoringCharacters)
function CCTMXMapInfoDeprecated.formatWithTMXFile(infoTable,tmxFile)
deprecatedTip("CCTMXMapInfo:formatWithTMXFile","CCTMXMapInfo:create")
return CCTMXMapInfo:create(tmxFile)
end
rawset(CCTMXMapInfo,"formatWithTMXFile", CCTMXMapInfoDeprecated.formatWithTMXFile)
function CCTMXMapInfoDeprecated.formatWithXML(infoTable,tmxString,resourcePath)
deprecatedTip("CCTMXMapInfo:formatWithXML","TMXMapInfo:createWithXML")
return CCTMXMapInfo:createWithXML(tmxString,resourcePath)
end
rawset(CCTMXMapInfo,"formatWithXML", CCTMXMapInfoDeprecated.formatWithXML)
--functions of CCTMXMapInfo will be deprecated end
--functions of CCTMXObject will be deprecated begin
local CCTMXObjectGroupDeprecated = { }
function CCTMXObjectGroupDeprecated.propertyNamed(self,propertyName)
deprecatedTip("CCTMXObjectGroup:propertyNamed","CCTMXObjectGroup:getProperty")
return self:getProperty(propertyName)
end
rawset(CCTMXObjectGroup,"propertyNamed", CCTMXObjectGroupDeprecated.propertyNamed)
function CCTMXObjectGroupDeprecated.objectNamed(self, objectName)
deprecatedTip("CCTMXObjectGroup:objectNamed","CCTMXObjectGroup:getObjectNamed")
return self:getObjectNamed(objectName)
end
rawset(CCTMXObjectGroup,"objectNamed", CCTMXObjectGroupDeprecated.objectNamed)
--functions of CCTMXObject will be deprecated end

View File

@ -13,6 +13,7 @@ class CCAction : public CCObject
int getTag(void); int getTag(void);
void setTag(int nTag); void setTag(int nTag);
CCAction* clone(); CCAction* clone();
CCObject* copy();
}; };
class CCFiniteTimeAction : public CCAction class CCFiniteTimeAction : public CCAction

View File

@ -36,6 +36,7 @@ class CCAnimation : public CCObject
float getDuration(); float getDuration();
CCAnimation* clone(); CCAnimation* clone();
CCObject* copy();
CCArray* getFrames(); CCArray* getFrames();
void setFrames(CCArray* pFrames); void setFrames(CCArray* pFrames);

View File

@ -27,7 +27,7 @@ class CCTMXLayer : public CCSpriteBatchNode
void setTileGID(unsigned int gid, const CCPoint& tileCoordinate, ccTMXTileFlags flags); void setTileGID(unsigned int gid, const CCPoint& tileCoordinate, ccTMXTileFlags flags);
void removeTileAt(CCPoint tileCoordinate); void removeTileAt(CCPoint tileCoordinate);
CCPoint getPositionAt(CCPoint tileCoordinate); CCPoint getPositionAt(CCPoint tileCoordinate);
CCString *getPropertyNamed(const char *propertyName) const; CCString* getProperty(const char *propertyName) const;
void setupTiles(); void setupTiles();
void setLayerName(const char *layerName); void setLayerName(const char *layerName);

View File

@ -13,7 +13,7 @@ class CCTMXObjectGroup : public CCObject
void setGroupName(const char *groupName); void setGroupName(const char *groupName);
const char* getGroupName(); const char* getGroupName();
CCString *propertyNamed(const char* propertyName); CCString* getProperty(const char* propertyName);
CCDictionary* objectNamed(const char *objectName); CCDictionary* getObject(const char *objectName);
}; };

View File

@ -26,10 +26,10 @@ class CCTMXTiledMap : public CCNode
void setProperties(CCDictionary* pval); void setProperties(CCDictionary* pval);
CCDictionary* getProperties(); CCDictionary* getProperties();
CCTMXLayer* layerNamed(const char *layerName); CCTMXLayer* getLayer(const char *layerName);
CCTMXObjectGroup* objectGroupNamed(const char *groupName); CCTMXObjectGroup* getObjectGroup(const char *groupName);
CCString *propertyNamed(const char *propertyName); CCString* getProperty(const char *propertyName);
CCDictionary *propertiesForGID(int GID); CCDictionary* getPropertiesForGID(int GID);
static CCTMXTiledMap * create(const char *tmxFile); static CCTMXTiledMap * create(const char *tmxFile);
static CCTMXTiledMap* createWithXML(const char* tmxString, const char* resourcePath); static CCTMXTiledMap* createWithXML(const char* tmxString, const char* resourcePath);

View File

@ -55,7 +55,7 @@ class CCTMXMapInfo : public CCObject
void setLayerAttribs(int val); void setLayerAttribs(int val);
int getLayerAttribs(); int getLayerAttribs();
void setStoringCharacters(bool val); void setStoringCharacters(bool val);
bool getStoringCharacters(); bool isStoringCharacters() const;
void setProperties(CCDictionary* pval); void setProperties(CCDictionary* pval);
CCDictionary* getProperties(); CCDictionary* getProperties();
void setTileProperties(CCDictionary* tileProperties); void setTileProperties(CCDictionary* tileProperties);
@ -71,6 +71,6 @@ class CCTMXMapInfo : public CCObject
bool parseXMLFile(const char *xmlFilename); bool parseXMLFile(const char *xmlFilename);
bool parseXMLString(const char *xmlString); bool parseXMLString(const char *xmlString);
static CCTMXMapInfo * formatWithTMXFile(const char *tmxFile); static CCTMXMapInfo* create(const char *tmxFile);
static CCTMXMapInfo * formatWithXML(const char *tmxString, const char* resourcePath); static CCTMXMapInfo* createWithXML(const char* tmxString, const char* resourcePath);
}; };

View File

@ -52,6 +52,7 @@ struct Color4B
struct Color4F struct Color4F
{ {
Color4F(void); Color4F(void);
Color4F(GLfloat _r, GLfloat _g, GLfloat _b, GLfloat _a);
Color4F(const Color3B &color3B); Color4F(const Color3B &color3B);
Color4F(const Color4B &color4B); Color4F(const Color4B &color4B);
bool equals(const Color4F &other); bool equals(const Color4F &other);