diff --git a/cocos2dx/include/cocos2d.h b/cocos2dx/include/cocos2d.h index de8cdcf09f..053a1330ad 100755 --- a/cocos2dx/include/cocos2d.h +++ b/cocos2dx/include/cocos2d.h @@ -199,6 +199,14 @@ THE SOFTWARE. #include "platform/nacl/CCStdC.h" #endif // CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID +#if (CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN) + #include "platform/emscripten/CCAccelerometer.h" + #include "platform/emscripten/CCApplication.h" + #include "platform/emscripten/CCEGLView.h" + #include "platform/emscripten/CCGL.h" + #include "platform/emscripten/CCStdC.h" +#endif // CC_TARGET_PLATFORM == CC_PLATFORM_EMSCRIPTEN + // script_support #include "script_support/CCScriptSupport.h" diff --git a/cocos2dx/platform/CCApplicationProtocol.h b/cocos2dx/platform/CCApplicationProtocol.h index e0ef105085..eae06267c3 100644 --- a/cocos2dx/platform/CCApplicationProtocol.h +++ b/cocos2dx/platform/CCApplicationProtocol.h @@ -13,6 +13,7 @@ enum TargetPlatform kTargetIpad, kTargetBlackBerry, kTargetNaCl, + kTargetEmscripten }; /** diff --git a/cocos2dx/platform/CCPlatformConfig.h b/cocos2dx/platform/CCPlatformConfig.h index 342148b4d2..1f1b7d51b6 100644 --- a/cocos2dx/platform/CCPlatformConfig.h +++ b/cocos2dx/platform/CCPlatformConfig.h @@ -44,6 +44,7 @@ Config of cocos2d-x project, per target platform. #define CC_PLATFORM_BLACKBERRY 7 #define CC_PLATFORM_MAC 8 #define CC_PLATFORM_NACL 9 +#define CC_PLATFORM_EMSCRIPTEN 10 // Determine target platform by compile environment macro. #define CC_TARGET_PLATFORM CC_PLATFORM_UNKNOWN @@ -102,6 +103,11 @@ Config of cocos2d-x project, per target platform. #define CC_TARGET_PLATFORM CC_PLATFORM_NACL #endif +// Emscripten +#if defined(EMSCRIPTEN) + #undef CC_TARGET_PLATFORM + #define CC_TARGET_PLATFORM CC_PLATFORM_EMSCRIPTEN +#endif ////////////////////////////////////////////////////////////////////////// // post configure