From 28954fddd0b7b7995a7734ba4f4c5aebee549e5b Mon Sep 17 00:00:00 2001 From: CaryZheng Date: Fri, 30 May 2014 00:23:58 +0800 Subject: [PATCH 1/8] Simplify BlendFunc operator< judgement --- cocos/base/ccTypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/base/ccTypes.h b/cocos/base/ccTypes.h index f447c4de5b..9e9f789da3 100644 --- a/cocos/base/ccTypes.h +++ b/cocos/base/ccTypes.h @@ -328,7 +328,7 @@ struct BlendFunc bool operator<(const BlendFunc &a) const { - return src < a.src || (src < a.src && dst < a.dst); + return src < a.src; } }; From 3b99c5ea429443e5211d00d3f0d953be04b9e05b Mon Sep 17 00:00:00 2001 From: CaryZheng Date: Fri, 30 May 2014 17:57:27 +0800 Subject: [PATCH 2/8] Modify BlendFunc operator< judgement --- cocos/base/ccTypes.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cocos/base/ccTypes.h b/cocos/base/ccTypes.h index 9e9f789da3..a8d5f62d96 100644 --- a/cocos/base/ccTypes.h +++ b/cocos/base/ccTypes.h @@ -328,7 +328,7 @@ struct BlendFunc bool operator<(const BlendFunc &a) const { - return src < a.src; + return src < a.src || (src == a.src && dst < a.dst); } }; From 5f74b8568d8a05e1dcaf3cb8bed02ba952cadb88 Mon Sep 17 00:00:00 2001 From: Anton Sokolchenko Date: Thu, 5 Jun 2014 16:54:00 +0300 Subject: [PATCH 3/8] Fix CCImage to be compatible with UNIX2003 Without this wrapper I get errors below. Mac Os X 10.9.3 Xcode 6 beta(the same problem also exists in Xcode 5) I found a solution at http://stackoverflow.com/questions/8732393/code-coverage-with-xcode-4-2-missing-files and added one more wrapping function. Undefined symbols for architecture i386: "_fwrite$UNIX2003", referenced from: _unixErrorHandler in libcocos2dx iOS.a(tif_unix.o) _unixWarningHandler in libcocos2dx iOS.a(tif_unix.o) _empty_output_buffer in libcocos2dx iOS.a(jdatadst.o) _term_destination in libcocos2dx iOS.a(jdatadst.o) _Fax3PrintDir in libcocos2dx iOS.a(tif_fax3.o) _PredictorPrintDir in libcocos2dx iOS.a(tif_predict.o) "_strerror$UNIX2003", referenced from: _TIFFOpen in libcocos2dx iOS.a(tif_unix.o) ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation) --- cocos/platform/CCImage.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/cocos/platform/CCImage.cpp b/cocos/platform/CCImage.cpp index 44de338ef4..e6f972b9e5 100644 --- a/cocos/platform/CCImage.cpp +++ b/cocos/platform/CCImage.cpp @@ -39,6 +39,22 @@ THE SOFTWARE. extern "C" { +#ifndef __ENABLE_COMPATIBILITY_WITH_UNIX_2003__ +#define __ENABLE_COMPATIBILITY_WITH_UNIX_2003__ +#include + FILE *fopen$UNIX2003( const char *filename, const char *mode ) + { + return fopen(filename, mode); + } + size_t fwrite$UNIX2003( const void *a, size_t b, size_t c, FILE *d ) + { + return fwrite(a, b, c, d); + } + char *strerror$UNIX2003( int errnum ) + { + return strerror(errnum); + } +#endif #include "png.h" #include "tiffio.h" #include "base/etc1.h" From 770d5e91b7bee711d2670841d9397fbbfe2df539 Mon Sep 17 00:00:00 2001 From: Anton Sokolchenko Date: Thu, 5 Jun 2014 18:02:45 +0300 Subject: [PATCH 4/8] Update CCImage.cpp --- cocos/platform/CCImage.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cocos/platform/CCImage.cpp b/cocos/platform/CCImage.cpp index e6f972b9e5..91bd8162f9 100644 --- a/cocos/platform/CCImage.cpp +++ b/cocos/platform/CCImage.cpp @@ -39,6 +39,7 @@ THE SOFTWARE. extern "C" { +#if defined(__APPLE__) || defined(__unix) #ifndef __ENABLE_COMPATIBILITY_WITH_UNIX_2003__ #define __ENABLE_COMPATIBILITY_WITH_UNIX_2003__ #include @@ -55,6 +56,7 @@ extern "C" return strerror(errnum); } #endif +#endif #include "png.h" #include "tiffio.h" #include "base/etc1.h" From bbff18c96fab057325eaf578b09709edd5a4d235 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 6 Jun 2014 12:09:39 +0800 Subject: [PATCH 5/8] add some comment --- cocos/platform/CCImage.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cocos/platform/CCImage.cpp b/cocos/platform/CCImage.cpp index 91bd8162f9..f4c8604b3a 100644 --- a/cocos/platform/CCImage.cpp +++ b/cocos/platform/CCImage.cpp @@ -39,6 +39,8 @@ THE SOFTWARE. extern "C" { + // To resolve link error when building 32bits with Xcode 6. + // More information please refer to the discussion in https://github.com/cocos2d/cocos2d-x/pull/6986 #if defined(__APPLE__) || defined(__unix) #ifndef __ENABLE_COMPATIBILITY_WITH_UNIX_2003__ #define __ENABLE_COMPATIBILITY_WITH_UNIX_2003__ From e0238c107ee9eaa029fc89ae8fecece18c450c89 Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 6 Jun 2014 13:41:40 +0800 Subject: [PATCH 6/8] [ci skip] --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index d5966bd062..87878879da 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -14,6 +14,7 @@ cocos2d-x-3.2 ??? [FIX] Lua-binding: compiling error on release mode [FIX] Lua-binding: Add xxtea encrypt support [FIX] Node: setPhysicsBody() can not work correctly if it is added to a Node + [FIX] Other: link error with Xcode 6 when building with 32-bit architecture [FIX] Repeat: will run one more over in rare situations [FIX] Scale9Sprite: support culling [FIX] Schedule: schedulePerFrame() can not be called twice From bd00e171903ac5d7bd688a1c79de0c666842531f Mon Sep 17 00:00:00 2001 From: minggo Date: Fri, 6 Jun 2014 13:47:38 +0800 Subject: [PATCH 7/8] [ci skip] --- AUTHORS | 1 + 1 file changed, 1 insertion(+) diff --git a/AUTHORS b/AUTHORS index 040ce80f71..ee3900d46f 100644 --- a/AUTHORS +++ b/AUTHORS @@ -831,6 +831,7 @@ Developers: Fixed incompatible pointer conversion in external/chipmunk/src/cpArray.c Fixed memory leak in 'Image' Fixed loosing precision when using 'recv' in 'Console' + Fixed link error with Xcode 6 when building with 32-bit architecture ololomax Fixed a potential crash in SceneReader::createNodeWithSceneFile From fd4e23343231bb37244da46542b0099a6342dddc Mon Sep 17 00:00:00 2001 From: Dhilan007 Date: Fri, 6 Jun 2014 15:41:17 +0800 Subject: [PATCH 8/8] fixed WP8 project:compile error,missing files,wrong file path. --- cocos/ui/UILayout.h | 7 +++++- cocos/ui/proj.wp8/libGUI.vcxproj | 2 ++ cocos/ui/proj.wp8/libGUI.vcxproj.filters | 6 +++++ .../HelloCppComponent.vcxproj | 22 +++++++++---------- .../HelloCppComponent.vcxproj.filters | 22 +++++++++---------- 5 files changed, 36 insertions(+), 23 deletions(-) diff --git a/cocos/ui/UILayout.h b/cocos/ui/UILayout.h index 01f24405ed..6c77939185 100644 --- a/cocos/ui/UILayout.h +++ b/cocos/ui/UILayout.h @@ -56,7 +56,12 @@ public: * @js NA * @lua NA */ - +#if (CC_TARGET_PLATFORM == CC_PLATFORM_WP8) || (CC_TARGET_PLATFORM == CC_PLATFORM_WINRT) +#ifdef RELATIVE +#undef RELATIVE +#endif +#endif + class Layout : public Widget, public LayoutProtocol { diff --git a/cocos/ui/proj.wp8/libGUI.vcxproj b/cocos/ui/proj.wp8/libGUI.vcxproj index 55f544b422..8d1c2be4b0 100644 --- a/cocos/ui/proj.wp8/libGUI.vcxproj +++ b/cocos/ui/proj.wp8/libGUI.vcxproj @@ -186,6 +186,7 @@ + @@ -210,6 +211,7 @@ + \ No newline at end of file diff --git a/cocos/ui/proj.wp8/libGUI.vcxproj.filters b/cocos/ui/proj.wp8/libGUI.vcxproj.filters index 9a791f39e7..e0a50c8764 100644 --- a/cocos/ui/proj.wp8/libGUI.vcxproj.filters +++ b/cocos/ui/proj.wp8/libGUI.vcxproj.filters @@ -84,6 +84,9 @@ Layouts + + Layouts + @@ -152,5 +155,8 @@ Layouts + + Layouts + \ No newline at end of file diff --git a/templates/cpp-template-default/proj.wp8-xaml/HelloCppComponent/HelloCppComponent.vcxproj b/templates/cpp-template-default/proj.wp8-xaml/HelloCppComponent/HelloCppComponent.vcxproj index 04098c2456..bedb6cbb2c 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/HelloCppComponent/HelloCppComponent.vcxproj +++ b/templates/cpp-template-default/proj.wp8-xaml/HelloCppComponent/HelloCppComponent.vcxproj @@ -203,11 +203,11 @@ - - - - - + + + + + @@ -218,12 +218,12 @@ - - - - - - + + + + + + diff --git a/templates/cpp-template-default/proj.wp8-xaml/HelloCppComponent/HelloCppComponent.vcxproj.filters b/templates/cpp-template-default/proj.wp8-xaml/HelloCppComponent/HelloCppComponent.vcxproj.filters index f742759eaf..645eb00360 100644 --- a/templates/cpp-template-default/proj.wp8-xaml/HelloCppComponent/HelloCppComponent.vcxproj.filters +++ b/templates/cpp-template-default/proj.wp8-xaml/HelloCppComponent/HelloCppComponent.vcxproj.filters @@ -1,11 +1,11 @@  - - - - - + + + + + Classes @@ -15,12 +15,12 @@ - - - - - - + + + + + + Classes