2013-07-17 14:44:28 +08:00
|
|
|
|
|
|
|
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID || CC_TARGET_PLATFORM == CC_PLATFORM_WIN32)
|
|
|
|
|
2013-06-06 22:29:02 +08:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
#include "tolua_fix.h"
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
#include "Lua_web_socket.h"
|
|
|
|
#include "cocos2d.h"
|
2013-06-07 10:12:01 +08:00
|
|
|
#include "CCLuaStack.h"
|
|
|
|
#include "CCLuaValue.h"
|
|
|
|
#include "CCLuaEngine.h"
|
2013-07-17 10:15:25 +08:00
|
|
|
#include "LuaScriptHandlerMgr.h"
|
2013-06-06 22:29:02 +08:00
|
|
|
|
|
|
|
using namespace cocos2d;
|
|
|
|
using namespace cocos2d::extension;
|
|
|
|
|
2013-06-07 10:12:01 +08:00
|
|
|
|
|
|
|
static int SendBinaryMessageToLua(int nHandler,const unsigned char* pTable,int nLength)
|
|
|
|
{
|
|
|
|
if (NULL == pTable || nHandler <= 0) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-07-22 17:24:54 +08:00
|
|
|
if (NULL == ScriptEngineManager::getInstance()->getScriptEngine()) {
|
2013-06-07 10:12:01 +08:00
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
2013-07-22 13:42:58 +08:00
|
|
|
LuaStack *pStack = LuaEngine::getInstance()->getLuaStack();
|
2013-06-07 10:12:01 +08:00
|
|
|
if (NULL == pStack) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
lua_State *tolua_s = pStack->getLuaState();
|
|
|
|
if (NULL == tolua_s) {
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
int nRet = 0;
|
2013-06-20 14:33:59 +08:00
|
|
|
LuaValueArray array;
|
2013-06-07 10:12:01 +08:00
|
|
|
for (int i = 0 ; i < nLength; i++) {
|
2013-06-20 14:33:59 +08:00
|
|
|
LuaValue value = LuaValue::intValue(pTable[i]);
|
2013-06-07 10:12:01 +08:00
|
|
|
array.push_back(value);
|
|
|
|
}
|
|
|
|
|
2013-06-20 14:33:59 +08:00
|
|
|
pStack->pushLuaValueArray(array);
|
2013-06-07 10:12:01 +08:00
|
|
|
nRet = pStack->executeFunctionByHandler(nHandler, 1);
|
|
|
|
pStack->clean();
|
|
|
|
return nRet;
|
|
|
|
}
|
|
|
|
|
2013-07-17 10:15:25 +08:00
|
|
|
|
|
|
|
|
|
|
|
LuaWebSocket::~LuaWebSocket()
|
2013-06-06 22:29:02 +08:00
|
|
|
{
|
2013-07-17 10:15:25 +08:00
|
|
|
ScriptHandlerMgr::getInstance()->removeObjectAllHandlers((void*)this);
|
|
|
|
}
|
|
|
|
|
|
|
|
void LuaWebSocket::onOpen(WebSocket* ws)
|
|
|
|
{
|
|
|
|
LuaWebSocket* luaWs = dynamic_cast<LuaWebSocket*>(ws);
|
|
|
|
if (NULL != luaWs) {
|
2013-09-04 22:17:26 +08:00
|
|
|
int nHandler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this,ScriptHandlerMgr::HandlerType::WEBSOCKET_OPEN);
|
2013-07-17 10:15:25 +08:00
|
|
|
if (0 != nHandler) {
|
|
|
|
CommonScriptData data(nHandler,"");
|
|
|
|
ScriptEvent event(kCommonEvent,(void*)&data);
|
2013-07-22 17:24:54 +08:00
|
|
|
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
2013-06-07 10:12:01 +08:00
|
|
|
}
|
|
|
|
}
|
2013-07-17 10:15:25 +08:00
|
|
|
}
|
2013-06-06 22:29:02 +08:00
|
|
|
|
2013-07-17 10:15:25 +08:00
|
|
|
void LuaWebSocket::onMessage(WebSocket* ws, const WebSocket::Data& data)
|
|
|
|
{
|
|
|
|
LuaWebSocket* luaWs = dynamic_cast<LuaWebSocket*>(ws);
|
|
|
|
if (NULL != luaWs) {
|
|
|
|
if (data.isBinary) {
|
2013-09-04 22:17:26 +08:00
|
|
|
int nHandler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this,ScriptHandlerMgr::HandlerType::WEBSOCKET_MESSAGE);
|
2013-07-02 15:23:51 +08:00
|
|
|
if (0 != nHandler) {
|
2013-07-17 10:15:25 +08:00
|
|
|
SendBinaryMessageToLua(nHandler, (const unsigned char*)data.bytes, data.len);
|
2013-06-06 22:29:02 +08:00
|
|
|
}
|
|
|
|
}
|
2013-07-17 10:15:25 +08:00
|
|
|
else{
|
2013-06-07 10:12:01 +08:00
|
|
|
|
2013-09-04 22:17:26 +08:00
|
|
|
int nHandler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this,ScriptHandlerMgr::HandlerType::WEBSOCKET_MESSAGE);
|
2013-07-17 10:15:25 +08:00
|
|
|
if (0 != nHandler) {
|
2013-07-04 15:44:42 +08:00
|
|
|
CommonScriptData commonData(nHandler,data.bytes);
|
2013-07-02 15:23:51 +08:00
|
|
|
ScriptEvent event(kCommonEvent,(void*)&commonData);
|
2013-07-22 17:24:54 +08:00
|
|
|
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
2013-06-06 22:29:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-07-17 10:15:25 +08:00
|
|
|
}
|
2013-06-06 22:29:02 +08:00
|
|
|
|
2013-07-17 10:15:25 +08:00
|
|
|
void LuaWebSocket::onClose(WebSocket* ws)
|
|
|
|
{
|
|
|
|
LuaWebSocket* luaWs = dynamic_cast<LuaWebSocket*>(ws);
|
|
|
|
if (NULL != luaWs) {
|
2013-09-04 22:17:26 +08:00
|
|
|
int nHandler = ScriptHandlerMgr::getInstance()->getObjectHandler((void*)this,ScriptHandlerMgr::HandlerType::WEBSOCKET_CLOSE);
|
2013-07-17 10:15:25 +08:00
|
|
|
if (0 != nHandler)
|
|
|
|
{
|
|
|
|
CommonScriptData data(nHandler,"");
|
|
|
|
ScriptEvent event(kCommonEvent,(void*)&data);
|
2013-07-22 17:24:54 +08:00
|
|
|
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
2013-06-06 22:29:02 +08:00
|
|
|
}
|
|
|
|
}
|
2013-07-17 10:15:25 +08:00
|
|
|
}
|
2013-06-06 22:29:02 +08:00
|
|
|
|
2013-07-17 10:15:25 +08:00
|
|
|
void LuaWebSocket::onError(WebSocket* ws, const WebSocket::ErrorCode& error)
|
|
|
|
{
|
|
|
|
LuaWebSocket* luaWs = dynamic_cast<LuaWebSocket*>(ws);
|
|
|
|
if (NULL != luaWs) {
|
|
|
|
int nHandler = 0;//luaWs->getScriptHandler(LuaWebSocket::kWebSocketScriptHandlerError);
|
|
|
|
if (0 != nHandler)
|
|
|
|
{
|
|
|
|
CommonScriptData data(nHandler,"");
|
|
|
|
ScriptEvent event(kCommonEvent,(void*)&data);
|
2013-07-22 17:24:54 +08:00
|
|
|
ScriptEngineManager::getInstance()->getScriptEngine()->sendEvent(&event);
|
2013-06-06 22:29:02 +08:00
|
|
|
}
|
|
|
|
}
|
2013-07-17 10:15:25 +08:00
|
|
|
}
|
|
|
|
|
2013-06-07 10:12:01 +08:00
|
|
|
|
2013-06-06 22:29:02 +08:00
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
static int tolua_collect_WebSocket (lua_State* tolua_S)
|
|
|
|
{
|
2013-06-07 14:57:36 +08:00
|
|
|
LuaWebSocket* self = (LuaWebSocket*) tolua_tousertype(tolua_S,1,0);
|
2013-06-06 22:29:02 +08:00
|
|
|
Mtolua_delete(self);
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
/* function to release collected object via destructor */
|
|
|
|
static void tolua_reg_Web_Socket_type(lua_State* tolua_S)
|
|
|
|
{
|
|
|
|
tolua_usertype(tolua_S, "WebSocket");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* method: create of class WebSocket */
|
|
|
|
#ifndef TOLUA_DISABLE_tolua_Cocos2d_WebSocket_create00
|
|
|
|
static int tolua_Cocos2d_WebSocket_create00(lua_State* tolua_S)
|
|
|
|
{
|
|
|
|
#ifndef TOLUA_RELEASE
|
|
|
|
tolua_Error tolua_err;
|
|
|
|
if (
|
|
|
|
!tolua_isusertable(tolua_S,1,"WebSocket",0,&tolua_err) ||
|
|
|
|
!tolua_isstring(tolua_S,2,0,&tolua_err) ||
|
|
|
|
!tolua_isnoobj(tolua_S,3,&tolua_err)
|
|
|
|
)
|
|
|
|
goto tolua_lerror;
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
const char* urlName = ((const char*) tolua_tostring(tolua_S,2,0));
|
2013-06-07 14:57:36 +08:00
|
|
|
LuaWebSocket *wSocket = new LuaWebSocket();
|
2013-06-07 10:12:01 +08:00
|
|
|
wSocket->init(*wSocket, urlName);
|
2013-06-06 22:29:02 +08:00
|
|
|
tolua_pushusertype(tolua_S,(void*)wSocket,"WebSocket");
|
2013-06-07 14:57:36 +08:00
|
|
|
tolua_register_gc(tolua_S,lua_gettop(tolua_S));
|
2013-06-06 22:29:02 +08:00
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
#ifndef TOLUA_RELEASE
|
|
|
|
tolua_lerror:
|
|
|
|
tolua_error(tolua_S,"#ferror in function 'create'.",&tolua_err);
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#endif //#ifndef TOLUA_DISABLE
|
|
|
|
|
|
|
|
/* method: createByAProtocol of class WebSocket */
|
|
|
|
#ifndef TOLUA_DISABLE_tolua_Cocos2d_WebSocket_createByAProtocol00
|
|
|
|
static int tolua_Cocos2d_WebSocket_createByAProtocol00(lua_State* tolua_S)
|
|
|
|
{
|
|
|
|
#ifndef TOLUA_RELEASE
|
|
|
|
tolua_Error tolua_err;
|
|
|
|
if (
|
|
|
|
!tolua_isusertable(tolua_S,1,"WebSocket",0,&tolua_err) ||
|
|
|
|
!tolua_isstring(tolua_S,2,0,&tolua_err) ||
|
|
|
|
!tolua_isstring(tolua_S,3,0,&tolua_err) ||
|
|
|
|
!tolua_isnoobj(tolua_S,4,&tolua_err)
|
|
|
|
)
|
|
|
|
goto tolua_lerror;
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
const char *urlName = ((const char*) tolua_tostring(tolua_S,2,0));
|
|
|
|
const char *protocol = ((const char*) tolua_tostring(tolua_S,3,0));
|
|
|
|
std::vector<std::string> protocols;
|
|
|
|
protocols.push_back(protocol);
|
2013-06-07 14:57:36 +08:00
|
|
|
LuaWebSocket *wSocket = new LuaWebSocket();
|
2013-06-07 10:12:01 +08:00
|
|
|
wSocket->init(*wSocket, urlName,&protocols);
|
2013-06-06 22:29:02 +08:00
|
|
|
tolua_pushusertype(tolua_S,(void*)wSocket,"WebSocket");
|
2013-06-07 14:57:36 +08:00
|
|
|
tolua_register_gc(tolua_S,lua_gettop(tolua_S));
|
2013-06-06 22:29:02 +08:00
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
#ifndef TOLUA_RELEASE
|
|
|
|
tolua_lerror:
|
|
|
|
tolua_error(tolua_S,"#ferror in function 'createByAProtocol'.",&tolua_err);
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#endif //#ifndef TOLUA_DISABLE
|
|
|
|
|
|
|
|
/* method: createByAProtocol of class WebSocket */
|
|
|
|
#ifndef TOLUA_DISABLE_tolua_Cocos2d_WebSocket_createByProtocolArray00
|
|
|
|
static int tolua_Cocos2d_WebSocket_createByProtocolArray00(lua_State* tolua_S)
|
|
|
|
{
|
|
|
|
#ifndef TOLUA_RELEASE
|
|
|
|
tolua_Error tolua_err;
|
|
|
|
if (
|
|
|
|
!tolua_isusertable(tolua_S,1,"WebSocket",0,&tolua_err) ||
|
|
|
|
!tolua_isstring(tolua_S,2,0,&tolua_err) ||
|
|
|
|
!tolua_isusertable(tolua_S,3,"CCArray",0,&tolua_err) ||
|
|
|
|
!tolua_isnoobj(tolua_S,4,&tolua_err)
|
|
|
|
)
|
|
|
|
goto tolua_lerror;
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
{
|
|
|
|
const char *urlName = ((const char*) tolua_tostring(tolua_S,2,0));
|
2013-06-20 14:33:59 +08:00
|
|
|
Array* protocolArray = ((Array*) tolua_tousertype(tolua_S,3,0));
|
2013-06-06 22:29:02 +08:00
|
|
|
std::vector<std::string> protocols;
|
|
|
|
if (NULL != protocolArray) {
|
2013-06-20 14:33:59 +08:00
|
|
|
Object* pObj = NULL;
|
2013-06-06 22:29:02 +08:00
|
|
|
CCARRAY_FOREACH(protocolArray, pObj)
|
|
|
|
{
|
2013-07-09 14:29:51 +08:00
|
|
|
String* pStr = static_cast<String*>(pObj);
|
2013-06-06 22:29:02 +08:00
|
|
|
if (NULL != pStr) {
|
|
|
|
protocols.push_back(pStr->getCString());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2013-06-07 14:57:36 +08:00
|
|
|
LuaWebSocket *wSocket = new LuaWebSocket();
|
2013-06-07 10:12:01 +08:00
|
|
|
wSocket->init(*wSocket, urlName,&protocols);
|
2013-06-06 22:29:02 +08:00
|
|
|
tolua_pushusertype(tolua_S,(void*)wSocket,"WebSocket");
|
2013-06-07 14:57:36 +08:00
|
|
|
tolua_register_gc(tolua_S,lua_gettop(tolua_S));
|
2013-06-06 22:29:02 +08:00
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
#ifndef TOLUA_RELEASE
|
|
|
|
tolua_lerror:
|
|
|
|
tolua_error(tolua_S,"#ferror in function 'createByProtocolArray'.",&tolua_err);
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#endif //#ifndef TOLUA_DISABLE
|
|
|
|
|
|
|
|
/* method: getReadyState of class WebSocket */
|
|
|
|
#ifndef TOLUA_DISABLE_tolua_Cocos2d_WebSocket_getReadyState00
|
|
|
|
static int tolua_Cocos2d_WebSocket_getReadyState00(lua_State* tolua_S)
|
|
|
|
{
|
|
|
|
#ifndef TOLUA_RELEASE
|
|
|
|
tolua_Error tolua_err;
|
|
|
|
if (
|
|
|
|
!tolua_isusertype(tolua_S,1,"WebSocket",0,&tolua_err) ||
|
|
|
|
!tolua_isnoobj(tolua_S,2,&tolua_err)
|
|
|
|
)
|
|
|
|
goto tolua_lerror;
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
{
|
2013-06-07 14:57:36 +08:00
|
|
|
LuaWebSocket *self = (LuaWebSocket*)tolua_tousertype(tolua_S,1,0);
|
2013-06-06 22:29:02 +08:00
|
|
|
int tolua_ret = -1;
|
|
|
|
if (NULL != self) {
|
2013-07-26 22:15:30 +08:00
|
|
|
tolua_ret = (int)self->getReadyState();
|
2013-06-06 22:29:02 +08:00
|
|
|
}
|
|
|
|
tolua_pushnumber(tolua_S,(lua_Number)tolua_ret);
|
|
|
|
}
|
|
|
|
return 1;
|
|
|
|
#ifndef TOLUA_RELEASE
|
|
|
|
tolua_lerror:
|
|
|
|
tolua_error(tolua_S,"#ferror in function 'getReadyState'.",&tolua_err);
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#endif //#ifndef TOLUA_DISABLE
|
|
|
|
|
|
|
|
|
|
|
|
/* method: close of class WebSocket */
|
|
|
|
#ifndef TOLUA_DISABLE_tolua_Cocos2d_WebSocket_close00
|
|
|
|
static int tolua_Cocos2d_WebSocket_close00(lua_State* tolua_S)
|
|
|
|
{
|
|
|
|
#ifndef TOLUA_RELEASE
|
|
|
|
tolua_Error tolua_err;
|
|
|
|
if (
|
|
|
|
!tolua_isusertype(tolua_S,1,"WebSocket",0,&tolua_err) ||
|
|
|
|
!tolua_isnoobj(tolua_S,2,&tolua_err)
|
|
|
|
)
|
|
|
|
goto tolua_lerror;
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
{
|
2013-06-07 14:57:36 +08:00
|
|
|
LuaWebSocket* self = (LuaWebSocket*) tolua_tousertype(tolua_S,1,0);
|
2013-06-06 22:29:02 +08:00
|
|
|
if (NULL != self ) {
|
|
|
|
self->close();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
#ifndef TOLUA_RELEASE
|
|
|
|
tolua_lerror:
|
|
|
|
tolua_error(tolua_S,"#ferror in function 'getReadyState'.",&tolua_err);
|
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#endif //#ifndef TOLUA_DISABLE
|
|
|
|
|
2013-07-26 22:50:45 +08:00
|
|
|
/* method: sendString of class WebSocket */
|
|
|
|
#ifndef TOLUA_DISABLE_tolua_Cocos2d_WebSocket_sendString00
|
|
|
|
static int tolua_Cocos2d_WebSocket_sendString00(lua_State* tolua_S)
|
2013-06-06 22:29:02 +08:00
|
|
|
{
|
|
|
|
#ifndef TOLUA_RELEASE
|
|
|
|
tolua_Error tolua_err;
|
|
|
|
if (
|
2013-07-26 22:50:45 +08:00
|
|
|
!tolua_isusertype(tolua_S, 1, "WebSocket", 0, &tolua_err) ||
|
|
|
|
!tolua_isstring(tolua_S, 2, 0, &tolua_err) ||
|
|
|
|
!tolua_isnoobj(tolua_S, 3, &tolua_err)
|
2013-06-06 22:29:02 +08:00
|
|
|
)
|
|
|
|
goto tolua_lerror;
|
|
|
|
else
|
|
|
|
#endif
|
|
|
|
{
|
2013-06-07 14:57:36 +08:00
|
|
|
LuaWebSocket* self = (LuaWebSocket*) tolua_tousertype(tolua_S,1,0);
|
2013-07-24 15:33:37 +08:00
|
|
|
size_t size = 0;
|
|
|
|
const char* data = (const char*) lua_tolstring(tolua_S, 2, &size);
|
2013-07-26 22:56:42 +08:00
|
|
|
if ( NULL == data)
|
|
|
|
return 0;
|
|
|
|
|
2013-07-26 22:50:45 +08:00
|
|
|
if (strlen(data) != size)
|
2013-07-26 22:56:42 +08:00
|
|
|
{
|
|
|
|
self->send((const unsigned char*)data, size);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
self->send(data);
|
2013-06-06 22:29:02 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
#ifndef TOLUA_RELEASE
|
|
|
|
tolua_lerror:
|
2013-07-26 22:50:45 +08:00
|
|
|
tolua_error(tolua_S,"#ferror in function 'sendString'.",&tolua_err);
|
2013-06-06 22:29:02 +08:00
|
|
|
return 0;
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
#endif //#ifndef TOLUA_DISABLE
|
|
|
|
|
2013-07-26 22:50:45 +08:00
|
|
|
|
2013-06-06 22:29:02 +08:00
|
|
|
TOLUA_API int tolua_web_socket_open(lua_State* tolua_S){
|
|
|
|
tolua_open(tolua_S);
|
|
|
|
tolua_reg_Web_Socket_type(tolua_S);
|
|
|
|
tolua_module(tolua_S,NULL,0);
|
|
|
|
tolua_beginmodule(tolua_S,NULL);
|
|
|
|
#ifdef __cplusplus
|
|
|
|
tolua_cclass(tolua_S,"WebSocket","WebSocket","",tolua_collect_WebSocket);
|
|
|
|
#else
|
|
|
|
tolua_cclass(tolua_S,"WebSocket","WebSocket","",NULL);
|
|
|
|
#endif
|
|
|
|
tolua_beginmodule(tolua_S,"WebSocket");
|
|
|
|
tolua_function(tolua_S, "create", tolua_Cocos2d_WebSocket_create00);
|
|
|
|
tolua_function(tolua_S, "createByAProtocol", tolua_Cocos2d_WebSocket_createByAProtocol00);
|
|
|
|
tolua_function(tolua_S, "createByProtocolArray", tolua_Cocos2d_WebSocket_createByProtocolArray00);
|
|
|
|
tolua_function(tolua_S, "getReadyState", tolua_Cocos2d_WebSocket_getReadyState00);
|
|
|
|
tolua_function(tolua_S, "close", tolua_Cocos2d_WebSocket_close00);
|
2013-07-26 22:50:45 +08:00
|
|
|
tolua_function(tolua_S, "sendString", tolua_Cocos2d_WebSocket_sendString00);
|
2013-06-06 22:29:02 +08:00
|
|
|
tolua_endmodule(tolua_S);
|
|
|
|
tolua_endmodule(tolua_S);
|
|
|
|
return 1;
|
|
|
|
}
|
2013-07-17 14:44:28 +08:00
|
|
|
|
|
|
|
#endif//(CC_TARGET_PLATFORM == CC_PLATFORM_IOS ...
|