From f75f6c2b64907a4c456bd5faefc9c7eaad458d42 Mon Sep 17 00:00:00 2001 From: Mat Hopwood Date: Thu, 6 Dec 2012 14:00:08 +0000 Subject: [PATCH 1/4] Mac OS Marmalade fixes Fixed compile issues on Mac OS --- .../third_party/marmalade/freetype.mkf | 330 +++++++++--------- cocos2dx/textures/CCTexturePVR.cpp | 18 +- 2 files changed, 174 insertions(+), 174 deletions(-) diff --git a/cocos2dx/platform/third_party/marmalade/freetype.mkf b/cocos2dx/platform/third_party/marmalade/freetype.mkf index c369d13d5c..8d347bbc53 100644 --- a/cocos2dx/platform/third_party/marmalade/freetype.mkf +++ b/cocos2dx/platform/third_party/marmalade/freetype.mkf @@ -1,165 +1,165 @@ -includepaths -{ - "h" - "./freetype/include" -} -options -{ - strict=0 -} - -if {{ defined __APPLE__ }} -{ - define FT_CONFIG_OPTION_NO_ASSEMBLER - define DARWIN_NO_CARBON -} - -files -{ - [src/autofit] - ("./freetype/src/autofit") - autofit.c - - [src/base] - ("./freetype/src/base") - ftbase.c - ftbbox.c - ftbdf.c - ftbitmap.c - ftcid.c - ftfstype.c - ftgasp.c - ftglyph.c - ftgxval.c - ftinit.c - ftlcdfil.c - ftmm.c - ftotval.c - ftpatent.c - ftpfr.c - ftstroke.c - ftsynth.c - ftsystem.c - fttype1.c - ftwinfnt.c - - [src/bdf] - ("./freetype/src/bdf") - bdf.c - - [src/cache] - ("./freetype/src/cache") - ftcache.c - - [src/cff] - ("./freetype/src/cff") - cff.c - - [src/cid] - ("./freetype/src/cid") - type1cid.c - - [src/gzip] - ("./freetype/src/gzip") - ftgzip.c - - [src/lzw] - ("./freetype/src/lzw") - ftlzw.c - - [src/pcf] - ("./freetype/src/pcf") - pcf.c - - [src/pfr] - ("./freetype/src/pfr") - pfr.c - - [src/psaux] - ("./freetype/src/psaux") - psaux.c - - [src/pshinter] - ("./freetype/src/pshinter") - pshinter.c - - [src/psnames] - ("./freetype/src/psnames") - psmodule.c - - [src/raster] - ("./freetype/src/raster") - raster.c - - [src/sfntr] - ("./freetype/src/sfnt") - sfnt.c - - [src/smooth] - ("./freetype/src/smooth") - smooth.c - - [src/truetype] - ("./freetype/src/truetype") - truetype.c - - [src/type1] - ("./freetype/src/type1") - type1.c - - [src/type42] - ("./freetype/src/type42") - type42.c - - [src/winfonts] - ("./freetype/src/winfonts") - winfnt.c - - [include] - ("./freetype/include") - ft2build.h - freetype/config/ftconfig.h - freetype/config/ftheader.h - freetype/config/ftmodule.h - freetype/config/ftoption.h - freetype/config/ftstdlib.h - freetype/freetype.h - freetype/ftbbox.h - freetype/ftbdf.h - freetype/ftbitmap.h - freetype/ftcache.h - freetype/ftcid.h - freetype/fterrdef.h - freetype/fterrors.h - freetype/ftgasp.h - freetype/ftglyph.h - freetype/ftgxval.h - freetype/ftgzip.h - freetype/ftimage.h - freetype/ftincrem.h - freetype/ftlcdfil.h - freetype/ftlist.h - freetype/ftlzw.h - freetype/ftmac.h - freetype/ftmm.h - freetype/ftmodapi.h - freetype/ftmoderr.h - freetype/ftotval.h - freetype/ftoutln.h - freetype/ftpfr.h - freetype/ftrender.h - freetype/ftsizes.h - freetype/ftsnames.h - freetype/ftstroke.h - freetype/ftsynth.h - freetype/ftsystem.h - freetype/fttrigon.h - freetype/fttypes.h - freetype/ftwinfnt.h - freetype/ftxf86.h - freetype/t1tables.h - freetype/ttnameid.h - freetype/tttables.h - freetype/tttags.h - freetype/ttunpat.h -} +includepaths +{ + "h" + "./freetype/include" +} +options +{ + strict=0 +} + +if {{ sys.platform == 'darwin' }} +{ + define FT_CONFIG_OPTION_NO_ASSEMBLER + define DARWIN_NO_CARBON +} + +files +{ + [src/autofit] + ("./freetype/src/autofit") + autofit.c + + [src/base] + ("./freetype/src/base") + ftbase.c + ftbbox.c + ftbdf.c + ftbitmap.c + ftcid.c + ftfstype.c + ftgasp.c + ftglyph.c + ftgxval.c + ftinit.c + ftlcdfil.c + ftmm.c + ftotval.c + ftpatent.c + ftpfr.c + ftstroke.c + ftsynth.c + ftsystem.c + fttype1.c + ftwinfnt.c + + [src/bdf] + ("./freetype/src/bdf") + bdf.c + + [src/cache] + ("./freetype/src/cache") + ftcache.c + + [src/cff] + ("./freetype/src/cff") + cff.c + + [src/cid] + ("./freetype/src/cid") + type1cid.c + + [src/gzip] + ("./freetype/src/gzip") + ftgzip.c + + [src/lzw] + ("./freetype/src/lzw") + ftlzw.c + + [src/pcf] + ("./freetype/src/pcf") + pcf.c + + [src/pfr] + ("./freetype/src/pfr") + pfr.c + + [src/psaux] + ("./freetype/src/psaux") + psaux.c + + [src/pshinter] + ("./freetype/src/pshinter") + pshinter.c + + [src/psnames] + ("./freetype/src/psnames") + psmodule.c + + [src/raster] + ("./freetype/src/raster") + raster.c + + [src/sfntr] + ("./freetype/src/sfnt") + sfnt.c + + [src/smooth] + ("./freetype/src/smooth") + smooth.c + + [src/truetype] + ("./freetype/src/truetype") + truetype.c + + [src/type1] + ("./freetype/src/type1") + type1.c + + [src/type42] + ("./freetype/src/type42") + type42.c + + [src/winfonts] + ("./freetype/src/winfonts") + winfnt.c + + [include] + ("./freetype/include") + ft2build.h + freetype/config/ftconfig.h + freetype/config/ftheader.h + freetype/config/ftmodule.h + freetype/config/ftoption.h + freetype/config/ftstdlib.h + freetype/freetype.h + freetype/ftbbox.h + freetype/ftbdf.h + freetype/ftbitmap.h + freetype/ftcache.h + freetype/ftcid.h + freetype/fterrdef.h + freetype/fterrors.h + freetype/ftgasp.h + freetype/ftglyph.h + freetype/ftgxval.h + freetype/ftgzip.h + freetype/ftimage.h + freetype/ftincrem.h + freetype/ftlcdfil.h + freetype/ftlist.h + freetype/ftlzw.h + freetype/ftmac.h + freetype/ftmm.h + freetype/ftmodapi.h + freetype/ftmoderr.h + freetype/ftotval.h + freetype/ftoutln.h + freetype/ftpfr.h + freetype/ftrender.h + freetype/ftsizes.h + freetype/ftsnames.h + freetype/ftstroke.h + freetype/ftsynth.h + freetype/ftsystem.h + freetype/fttrigon.h + freetype/fttypes.h + freetype/ftwinfnt.h + freetype/ftxf86.h + freetype/t1tables.h + freetype/ttnameid.h + freetype/tttables.h + freetype/tttags.h + freetype/ttunpat.h +} diff --git a/cocos2dx/textures/CCTexturePVR.cpp b/cocos2dx/textures/CCTexturePVR.cpp index 3cd36ef356..4b17e78a04 100644 --- a/cocos2dx/textures/CCTexturePVR.cpp +++ b/cocos2dx/textures/CCTexturePVR.cpp @@ -122,15 +122,15 @@ typedef enum { kPVR3TexturePixelFormat_PVRTC_4BPP_RGBA = 3, /* supported channel type formats */ - kPVR3TexturePixelFormat_BGRA_8888 = 0x0808080861726762, - kPVR3TexturePixelFormat_RGBA_8888 = 0x0808080861626772, - kPVR3TexturePixelFormat_RGBA_4444 = 0x0404040461626772, - kPVR3TexturePixelFormat_RGBA_5551 = 0x0105050561626772, - kPVR3TexturePixelFormat_RGB_565 = 0x0005060500626772, - kPVR3TexturePixelFormat_RGB_888 = 0x0008080800626772, - kPVR3TexturePixelFormat_A_8 = 0x0000000800000061, - kPVR3TexturePixelFormat_L_8 = 0x000000080000006c, - kPVR3TexturePixelFormat_LA_88 = 0x000008080000616c, + kPVR3TexturePixelFormat_BGRA_8888 = 0x0808080861726762ULL, + kPVR3TexturePixelFormat_RGBA_8888 = 0x0808080861626772ULL, + kPVR3TexturePixelFormat_RGBA_4444 = 0x0404040461626772ULL, + kPVR3TexturePixelFormat_RGBA_5551 = 0x0105050561626772ULL, + kPVR3TexturePixelFormat_RGB_565 = 0x0005060500626772ULL, + kPVR3TexturePixelFormat_RGB_888 = 0x0008080800626772ULL, + kPVR3TexturePixelFormat_A_8 = 0x0000000800000061ULL, + kPVR3TexturePixelFormat_L_8 = 0x000000080000006cULL, + kPVR3TexturePixelFormat_LA_88 = 0x000008080000616cULL, } ccPVR3TexturePixelFormat; From 062179c497e1ee9d9c41beaf2d0a872792162164 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 10 Dec 2012 10:22:06 +0800 Subject: [PATCH 2/4] fixed #1604: The enum values in ccPVR3TexturePixelFormat are truncated to 32bit --- cocos2dx/textures/CCTexturePVR.cpp | 32 ++++++++++++++---------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/cocos2dx/textures/CCTexturePVR.cpp b/cocos2dx/textures/CCTexturePVR.cpp index 4b17e78a04..be4e8a0d4c 100644 --- a/cocos2dx/textures/CCTexturePVR.cpp +++ b/cocos2dx/textures/CCTexturePVR.cpp @@ -114,24 +114,22 @@ typedef enum } ccPVR2TexturePixelFormat; // v3 -typedef enum { - /* supported predefined formats */ - kPVR3TexturePixelFormat_PVRTC_2BPP_RGB = 0, - kPVR3TexturePixelFormat_PVRTC_2BPP_RGBA = 1, - kPVR3TexturePixelFormat_PVRTC_4BPP_RGB = 2, - kPVR3TexturePixelFormat_PVRTC_4BPP_RGBA = 3, +/* supported predefined formats */ +#define kPVR3TexturePixelFormat_PVRTC_2BPP_RGB 0 +#define kPVR3TexturePixelFormat_PVRTC_2BPP_RGBA 1 +#define kPVR3TexturePixelFormat_PVRTC_4BPP_RGB 2 +#define kPVR3TexturePixelFormat_PVRTC_4BPP_RGBA 3 - /* supported channel type formats */ - kPVR3TexturePixelFormat_BGRA_8888 = 0x0808080861726762ULL, - kPVR3TexturePixelFormat_RGBA_8888 = 0x0808080861626772ULL, - kPVR3TexturePixelFormat_RGBA_4444 = 0x0404040461626772ULL, - kPVR3TexturePixelFormat_RGBA_5551 = 0x0105050561626772ULL, - kPVR3TexturePixelFormat_RGB_565 = 0x0005060500626772ULL, - kPVR3TexturePixelFormat_RGB_888 = 0x0008080800626772ULL, - kPVR3TexturePixelFormat_A_8 = 0x0000000800000061ULL, - kPVR3TexturePixelFormat_L_8 = 0x000000080000006cULL, - kPVR3TexturePixelFormat_LA_88 = 0x000008080000616cULL, -} ccPVR3TexturePixelFormat; +/* supported channel type formats */ +#define kPVR3TexturePixelFormat_BGRA_8888 0x0808080861726762ULL +#define kPVR3TexturePixelFormat_RGBA_8888 0x0808080861626772ULL +#define kPVR3TexturePixelFormat_RGBA_4444 0x0404040461626772ULL +#define kPVR3TexturePixelFormat_RGBA_5551 0x0105050561626772ULL +#define kPVR3TexturePixelFormat_RGB_565 0x0005060500626772ULL +#define kPVR3TexturePixelFormat_RGB_888 0x0008080800626772ULL +#define kPVR3TexturePixelFormat_A_8 0x0000000800000061ULL +#define kPVR3TexturePixelFormat_L_8 0x000000080000006cULL +#define kPVR3TexturePixelFormat_LA_88 0x000008080000616cULL // v2 From 73dd652604d0f72031cbbb17c6c39ed57f46b104 Mon Sep 17 00:00:00 2001 From: James Chen Date: Mon, 10 Dec 2012 11:10:11 +0800 Subject: [PATCH 3/4] fixed #1605: Crash occurs when adding just one action to CCSequence. --- cocos2dx/actions/CCActionInterval.cpp | 26 ++++++++++++++++++-------- cocos2dx/actions/CCActionInterval.h | 2 +- 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/cocos2dx/actions/CCActionInterval.cpp b/cocos2dx/actions/CCActionInterval.cpp index a2e4868c4f..9c7b6de699 100644 --- a/cocos2dx/actions/CCActionInterval.cpp +++ b/cocos2dx/actions/CCActionInterval.cpp @@ -161,14 +161,14 @@ CCFiniteTimeAction* CCSequence::create(CCFiniteTimeAction *pAction1, ...) va_list params; va_start(params, pAction1); - CCFiniteTimeAction *pRet = CCSequence::create(pAction1, params); + CCFiniteTimeAction *pRet = CCSequence::createWithVariableList(pAction1, params); va_end(params); return pRet; } -CCFiniteTimeAction* CCSequence::create(CCFiniteTimeAction *pAction1, va_list args) +CCFiniteTimeAction* CCSequence::createWithVariableList(CCFiniteTimeAction *pAction1, va_list args) { CCFiniteTimeAction *pNow; CCFiniteTimeAction *pPrev = pAction1; @@ -191,14 +191,24 @@ CCFiniteTimeAction* CCSequence::create(CCFiniteTimeAction *pAction1, va_list arg CCFiniteTimeAction* CCSequence::create(CCArray* arrayOfActions) { - CCFiniteTimeAction* prev = (CCFiniteTimeAction*)arrayOfActions->objectAtIndex(0); - - for (unsigned int i = 1; i < arrayOfActions->count(); ++i) + CCFiniteTimeAction* pRet = NULL; + do { - prev = createWithTwoActions(prev, (CCFiniteTimeAction*)arrayOfActions->objectAtIndex(i)); - } + unsigned int count = arrayOfActions->count(); + CC_BREAK_IF(count == 0); - return prev; + CCFiniteTimeAction* prev = (CCFiniteTimeAction*)arrayOfActions->objectAtIndex(0); + + if (count > 1) + { + for (unsigned int i = 1; i < count; ++i) + { + prev = createWithTwoActions(prev, (CCFiniteTimeAction*)arrayOfActions->objectAtIndex(i)); + } + } + pRet = prev; + }while (0); + return pRet; } bool CCSequence::initWithTwoActions(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo) diff --git a/cocos2dx/actions/CCActionInterval.h b/cocos2dx/actions/CCActionInterval.h index 7e3921b172..62cceed820 100644 --- a/cocos2dx/actions/CCActionInterval.h +++ b/cocos2dx/actions/CCActionInterval.h @@ -114,7 +114,7 @@ public: /** helper constructor to create an array of sequenceable actions given an array */ static CCFiniteTimeAction* create(CCArray *arrayOfActions); /** helper constructor to create an array of sequence-able actions */ - static CCFiniteTimeAction* create(CCFiniteTimeAction *pAction1, va_list args); + static CCFiniteTimeAction* createWithVariableList(CCFiniteTimeAction *pAction1, va_list args); /** creates the action */ static CCSequence* createWithTwoActions(CCFiniteTimeAction *pActionOne, CCFiniteTimeAction *pActionTwo); From d5533fcf1556e6442813b162c04c908009ce2c27 Mon Sep 17 00:00:00 2001 From: minggo Date: Mon, 10 Dec 2012 11:30:07 +0800 Subject: [PATCH 4/4] fix a type information in CCBAnimationManager --- extensions/CCBReader/CCBAnimationManager.cpp | 2 +- tools/cxx-generator | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/CCBReader/CCBAnimationManager.cpp b/extensions/CCBReader/CCBAnimationManager.cpp index f6d5f9c495..98f47ad62c 100644 --- a/extensions/CCBReader/CCBAnimationManager.cpp +++ b/extensions/CCBReader/CCBAnimationManager.cpp @@ -421,7 +421,7 @@ void CCBAnimationManager::setAnimatedProperty(const char *pPropName, CCNode *pNo else if (strcmp(pPropName, "color") == 0) { ccColor3BWapper *color = (ccColor3BWapper*)pValue; - ((CCSprite*)pNode)->setColor(color->getColor()); + (dynamic_cast(pNode))->setColor(color->getColor()); } else if (strcmp(pPropName, "visible") == 0) { diff --git a/tools/cxx-generator b/tools/cxx-generator index ab8a6c0823..e4761d02b3 160000 --- a/tools/cxx-generator +++ b/tools/cxx-generator @@ -1 +1 @@ -Subproject commit ab8a6c0823d396f4d1e2cfb5de2314da653c657f +Subproject commit e4761d02b363515a293adb637fd8ab4a99db9722