diff --git a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id index c4b7e106a9..b8859b727b 100644 --- a/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id +++ b/build/cocos2d_libs.xcodeproj/project.pbxproj.REMOVED.git-id @@ -1 +1 @@ -99ea8c15ffe770eb2acd216155c34866bbd4a645 \ No newline at end of file +91c2f471146ed7285ab1d0f093185ffbbd06896c \ No newline at end of file diff --git a/cocos/2d/platform/ios/CCApplication.h b/cocos/2d/platform/ios/CCApplication.h index 843a5d5b99..b2a9ad8d95 100644 --- a/cocos/2d/platform/ios/CCApplication.h +++ b/cocos/2d/platform/ios/CCApplication.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __CC_APPLICATION_IOS_H__ #define __CC_APPLICATION_IOS_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #include "platform/CCCommon.h" #include "platform/CCApplicationProtocol.h" @@ -90,4 +93,6 @@ protected: NS_CC_END +#endif // CC_PLATFORM_IOS + #endif // end of __CC_APPLICATION_IOS_H__ diff --git a/cocos/2d/platform/ios/CCApplication.mm b/cocos/2d/platform/ios/CCApplication.mm index 14b07975ca..a6bb3b201a 100644 --- a/cocos/2d/platform/ios/CCApplication.mm +++ b/cocos/2d/platform/ios/CCApplication.mm @@ -25,6 +25,8 @@ #import "CCApplication.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #import #import "CCGeometry.h" @@ -152,3 +154,5 @@ void Application::applicationScreenSizeChanged(int newWidth, int newHeight) { } NS_CC_END + +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/ios/CCCommon.mm b/cocos/2d/platform/ios/CCCommon.mm index 28d0dd0e22..83012c3569 100644 --- a/cocos/2d/platform/ios/CCCommon.mm +++ b/cocos/2d/platform/ios/CCCommon.mm @@ -23,6 +23,9 @@ THE SOFTWARE. ****************************************************************************/ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #include "platform/CCCommon.h" #include @@ -54,3 +57,5 @@ void LuaLog(const char * format) } NS_CC_END + +#endif // CC_PLATFORM_IOS \ No newline at end of file diff --git a/cocos/2d/platform/ios/CCDevice.mm b/cocos/2d/platform/ios/CCDevice.mm index a80efef136..cbf04d092f 100644 --- a/cocos/2d/platform/ios/CCDevice.mm +++ b/cocos/2d/platform/ios/CCDevice.mm @@ -22,6 +22,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ + + +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #include "CCDevice.h" #include "ccTypes.h" #include "CCEventDispatcher.h" @@ -174,3 +179,5 @@ void Device::setAccelerometerInterval(float interval) NS_CC_END + +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/ios/CCEAGLView.h b/cocos/2d/platform/ios/CCEAGLView.h index 7a8f9c54d8..6f4e72e178 100644 --- a/cocos/2d/platform/ios/CCEAGLView.h +++ b/cocos/2d/platform/ios/CCEAGLView.h @@ -61,6 +61,9 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. */ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #import #import #import @@ -155,3 +158,5 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. -(void) doAnimationWhenKeyboardMoveWithDuration:(float) duration distance:(float) dis; -(void) doAnimationWhenAnotherEditBeClicked; @end + +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/ios/CCEAGLView.mm b/cocos/2d/platform/ios/CCEAGLView.mm index d656742af9..bde7f822ac 100644 --- a/cocos/2d/platform/ios/CCEAGLView.mm +++ b/cocos/2d/platform/ios/CCEAGLView.mm @@ -61,6 +61,9 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. */ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #import #import "CCEGLView.h" #import "CCEAGLView.h" @@ -922,3 +925,5 @@ static CCEAGLView *__view = 0; } @end + +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/ios/CCEGLView.h b/cocos/2d/platform/ios/CCEGLView.h index 47e1e1b0c6..83ce928908 100644 --- a/cocos/2d/platform/ios/CCEGLView.h +++ b/cocos/2d/platform/ios/CCEGLView.h @@ -26,6 +26,9 @@ #ifndef __CC_EGLVIEW_IPHONE_H__ #define __CC_EGLVIEW_IPHONE_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #include "CCObject.h" #include "platform/CCCommon.h" #include "platform/CCEGLViewProtocol.h" @@ -59,4 +62,6 @@ protected: NS_CC_END +#endif // CC_PLATFORM_IOS + #endif // end of __CC_EGLVIEW_IPHONE_H__ diff --git a/cocos/2d/platform/ios/CCEGLView.mm b/cocos/2d/platform/ios/CCEGLView.mm index 1b6844a754..7e5ffd23ae 100644 --- a/cocos/2d/platform/ios/CCEGLView.mm +++ b/cocos/2d/platform/ios/CCEGLView.mm @@ -22,6 +22,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ + +#include "CCPlatformConfig.h" + +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #include "CCEAGLView.h" #include "CCDirectorCaller.h" #include "CCEGLView.h" @@ -125,6 +130,7 @@ void EGLView::setIMEKeyboardState(bool bOpen) } } - NS_CC_END +#endif // CC_PLATFOR_IOS + diff --git a/cocos/2d/platform/ios/CCES2Renderer.h b/cocos/2d/platform/ios/CCES2Renderer.h index 1c25466fe4..5cd1fe47db 100644 --- a/cocos/2d/platform/ios/CCES2Renderer.h +++ b/cocos/2d/platform/ios/CCES2Renderer.h @@ -27,6 +27,10 @@ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. + +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #import "CCPlatformMacros.h" #import "CCESRenderer.h" #import @@ -76,4 +80,4 @@ @end - +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/ios/CCES2Renderer.m b/cocos/2d/platform/ios/CCES2Renderer.m index 3f3a226e82..4c687c2d38 100644 --- a/cocos/2d/platform/ios/CCES2Renderer.m +++ b/cocos/2d/platform/ios/CCES2Renderer.m @@ -28,8 +28,11 @@ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. -#import "CCPlatformMacros.h" #import "CCES2Renderer.h" + +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + +#import "CCPlatformMacros.h" #import "OpenGL_Internal.h" #if !defined(COCOS2D_DEBUG) || COCOS2D_DEBUG == 0 @@ -251,3 +254,5 @@ @end +#endif // CC_PLATFORM_IOS + diff --git a/cocos/2d/platform/ios/CCESRenderer.h b/cocos/2d/platform/ios/CCESRenderer.h index e35ea686e1..dd331a49d5 100644 --- a/cocos/2d/platform/ios/CCESRenderer.h +++ b/cocos/2d/platform/ios/CCESRenderer.h @@ -27,6 +27,10 @@ // Only compile this code on iOS. These files should NOT be included on your Mac project. // But in case they are included, it won't be compiled. + +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #include "CCPlatformMacros.h" #import @@ -48,3 +52,4 @@ - (unsigned int) msaaColorBuffer; @end +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/ios/CCGL.h b/cocos/2d/platform/ios/CCGL.h index 6104a7fcfd..6b306950c3 100644 --- a/cocos/2d/platform/ios/CCGL.h +++ b/cocos/2d/platform/ios/CCGL.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __PLATFORM_IOS_CCGL_H__ #define __PLATFORM_IOS_CCGL_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #define glClearDepth glClearDepthf #define glDeleteVertexArrays glDeleteVertexArraysOES #define glGenVertexArrays glGenVertexArraysOES @@ -39,5 +42,7 @@ THE SOFTWARE. #include #include +#endif // CC_PLATFORM_IOS #endif // __PLATFORM_IOS_CCGL_H__ + diff --git a/cocos/2d/platform/ios/CCImage.mm b/cocos/2d/platform/ios/CCImage.mm index 5ad55ce594..4d5ba92fe9 100644 --- a/cocos/2d/platform/ios/CCImage.mm +++ b/cocos/2d/platform/ios/CCImage.mm @@ -22,6 +22,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ + +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #include "CCImageCommon_cpp.h" #import "CCImage.h" @@ -468,3 +472,5 @@ bool Image::saveToFile(const std::string& filename, bool isToRGB) NS_CC_END +#endif // CC_PLATFORM_IOS + diff --git a/cocos/2d/platform/ios/CCPlatformDefine.h b/cocos/2d/platform/ios/CCPlatformDefine.h index 02f7c89eba..e6538ef662 100644 --- a/cocos/2d/platform/ios/CCPlatformDefine.h +++ b/cocos/2d/platform/ios/CCPlatformDefine.h @@ -25,6 +25,9 @@ THE SOFTWARE. #ifndef __CCPLATFORMDEFINE_H__ #define __CCPLATFORMDEFINE_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #include #define CC_DLL @@ -44,5 +47,6 @@ THE SOFTWARE. #endif +#endif // CC_PLATFORM_IOS #endif /* __CCPLATFORMDEFINE_H__*/ diff --git a/cocos/2d/platform/ios/CCStdC.h b/cocos/2d/platform/ios/CCStdC.h index 804abebceb..af440f0e6e 100644 --- a/cocos/2d/platform/ios/CCStdC.h +++ b/cocos/2d/platform/ios/CCStdC.h @@ -26,6 +26,9 @@ THE SOFTWARE. #ifndef __CC_STD_C_H__ #define __CC_STD_C_H__ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #include "CCPlatformMacros.h" #include #include @@ -45,4 +48,5 @@ THE SOFTWARE. #define MAX(x,y) (((x) < (y)) ? (y) : (x)) #endif // MAX +#endif // CC_PLATFORM_IOS #endif // __CC_STD_C_H__ diff --git a/cocos/2d/platform/ios/OpenGL_Internal.h b/cocos/2d/platform/ios/OpenGL_Internal.h index 9bc7a1860f..a0022582a8 100644 --- a/cocos/2d/platform/ios/OpenGL_Internal.h +++ b/cocos/2d/platform/ios/OpenGL_Internal.h @@ -61,6 +61,9 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. */ +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + /* Generic error reporting */ #define REPORT_ERROR(__FORMAT__, ...) printf("%s: %s\n", __FUNCTION__, [[NSString stringWithFormat:__FORMAT__, __VA_ARGS__] UTF8String]) @@ -79,3 +82,5 @@ Copyright (C) 2008 Apple Inc. All Rights Reserved. #endif #define TEST_DELEGATE_METHOD_BIT(__BIT__) (self->__DELEGATE_METHODS_IVAR__ & (1 << __BIT__)) #define SET_DELEGATE_METHOD_BIT(__BIT__, __NAME__) { if([self->__DELEGATE_IVAR__ respondsToSelector:@selector(__NAME__)]) self->__DELEGATE_METHODS_IVAR__ |= (1 << __BIT__); else self->__DELEGATE_METHODS_IVAR__ &= ~(1 << __BIT__); } + +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.h b/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.h index 972843302c..49ef7c1276 100644 --- a/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.h +++ b/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.h @@ -23,6 +23,10 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ + +#include "CCPlatformConfig.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + #import // when compiling to ARM (iPhone device), hide everything and use system defaults @@ -73,4 +77,6 @@ THE SOFTWARE. @end -#endif +#endif // !TARGET_CPU_ARM + +#endif // CC_PLATFORM_IOS diff --git a/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.m b/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.m index 0a93a263e9..5056ce9522 100644 --- a/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.m +++ b/cocos/2d/platform/ios/Simulation/AccelerometerSimulation.m @@ -26,6 +26,8 @@ THE SOFTWARE. #import "AccelerometerSimulation.h" +#if CC_TARGET_PLATFORM == CC_PLATFORM_IOS + // when compiling to ARM (iPhone device), hide everything and use system defaults // if you wish to use simulation mode even on the device, remove the #if/#endif #if !TARGET_CPU_ARM @@ -263,4 +265,6 @@ static CCAccelerometerSimulation *sharedAccelerometer = NULL; } @end -#endif +#endif // !TARGET_CPU_ARM + +#endif // CC_PLATFORM_IOS