mirror of https://github.com/axmolengine/axmol.git
fix compiling errors
This commit is contained in:
parent
4c9771ba3c
commit
2549804dec
|
@ -106,38 +106,38 @@ static void executeJSFunctionFromReservedSpot(JSContext *cx, JSObject *obj,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void getTouchesFuncName(TouchEvent::EventCode eventCode, std::string &funcName)
|
static void getTouchesFuncName(EventTouch::EventCode eventCode, std::string &funcName)
|
||||||
{
|
{
|
||||||
switch(eventCode)
|
switch(eventCode)
|
||||||
{
|
{
|
||||||
case TouchEvent::EventCode::BEGAN:
|
case EventTouch::EventCode::BEGAN:
|
||||||
funcName = "onTouchesBegan";
|
funcName = "onTouchesBegan";
|
||||||
break;
|
break;
|
||||||
case TouchEvent::EventCode::ENDED:
|
case EventTouch::EventCode::ENDED:
|
||||||
funcName = "onTouchesEnded";
|
funcName = "onTouchesEnded";
|
||||||
break;
|
break;
|
||||||
case TouchEvent::EventCode::MOVED:
|
case EventTouch::EventCode::MOVED:
|
||||||
funcName = "onTouchesMoved";
|
funcName = "onTouchesMoved";
|
||||||
break;
|
break;
|
||||||
case TouchEvent::EventCode::CANCELLED:
|
case EventTouch::EventCode::CANCELLED:
|
||||||
funcName = "onTouchesCancelled";
|
funcName = "onTouchesCancelled";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void getTouchFuncName(TouchEvent::EventCode eventCode, std::string &funcName)
|
static void getTouchFuncName(EventTouch::EventCode eventCode, std::string &funcName)
|
||||||
{
|
{
|
||||||
switch(eventCode) {
|
switch(eventCode) {
|
||||||
case TouchEvent::EventCode::BEGAN:
|
case EventTouch::EventCode::BEGAN:
|
||||||
funcName = "onTouchBegan";
|
funcName = "onTouchBegan";
|
||||||
break;
|
break;
|
||||||
case TouchEvent::EventCode::ENDED:
|
case EventTouch::EventCode::ENDED:
|
||||||
funcName = "onTouchEnded";
|
funcName = "onTouchEnded";
|
||||||
break;
|
break;
|
||||||
case TouchEvent::EventCode::MOVED:
|
case EventTouch::EventCode::MOVED:
|
||||||
funcName = "onTouchMoved";
|
funcName = "onTouchMoved";
|
||||||
break;
|
break;
|
||||||
case TouchEvent::EventCode::CANCELLED:
|
case EventTouch::EventCode::CANCELLED:
|
||||||
funcName = "onTouchCancelled";
|
funcName = "onTouchCancelled";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -839,7 +839,7 @@ int ScriptingCore::handleTouchesEvent(void* data)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
Layer* pLayer = static_cast<Layer*>(touchesScriptData->nativeObject);
|
Layer* pLayer = static_cast<Layer*>(touchesScriptData->nativeObject);
|
||||||
TouchEvent::EventCode eventType = touchesScriptData->actionType;
|
EventTouch::EventCode eventType = touchesScriptData->actionType;
|
||||||
const std::vector<Touch*>& touches = touchesScriptData->touches;
|
const std::vector<Touch*>& touches = touchesScriptData->touches;
|
||||||
|
|
||||||
std::string funcName = "";
|
std::string funcName = "";
|
||||||
|
@ -884,7 +884,7 @@ int ScriptingCore::handleTouchEvent(void* data)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
Layer* pLayer = static_cast<Layer*>(touchScriptData->nativeObject);
|
Layer* pLayer = static_cast<Layer*>(touchScriptData->nativeObject);
|
||||||
TouchEvent::EventCode eventType = touchScriptData->actionType;
|
EventTouch::EventCode eventType = touchScriptData->actionType;
|
||||||
Touch *pTouch = touchScriptData->touch;
|
Touch *pTouch = touchScriptData->touch;
|
||||||
|
|
||||||
|
|
||||||
|
@ -980,7 +980,7 @@ int ScriptingCore::handleKeypadEvent(void* data)
|
||||||
if (NULL == keypadScriptData->nativeObject)
|
if (NULL == keypadScriptData->nativeObject)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
KeyboardEvent::KeyCode action = keypadScriptData->actionType;
|
EventKeyboard::KeyCode action = keypadScriptData->actionType;
|
||||||
|
|
||||||
js_proxy_t * p = jsb_get_native_proxy(keypadScriptData->nativeObject);
|
js_proxy_t * p = jsb_get_native_proxy(keypadScriptData->nativeObject);
|
||||||
|
|
||||||
|
@ -989,7 +989,7 @@ int ScriptingCore::handleKeypadEvent(void* data)
|
||||||
JSBool ret = JS_FALSE;
|
JSBool ret = JS_FALSE;
|
||||||
switch(action)
|
switch(action)
|
||||||
{
|
{
|
||||||
case KeyboardEvent::KeyCode::KEY_BACKSPACE:
|
case EventKeyboard::KeyCode::KEY_BACKSPACE:
|
||||||
ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), "onBackClicked");
|
ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), "onBackClicked");
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
|
@ -1000,7 +1000,7 @@ int ScriptingCore::handleKeypadEvent(void* data)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case KeyboardEvent::KeyCode::KEY_MENU:
|
case EventKeyboard::KeyCode::KEY_MENU:
|
||||||
ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), "onMenuClicked");
|
ret = executeFunctionWithOwner(OBJECT_TO_JSVAL(p->obj), "onMenuClicked");
|
||||||
if (!ret)
|
if (!ret)
|
||||||
{
|
{
|
||||||
|
@ -1021,7 +1021,7 @@ int ScriptingCore::handleKeypadEvent(void* data)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ScriptingCore::executeCustomTouchesEvent(TouchEvent::EventCode eventType,
|
int ScriptingCore::executeCustomTouchesEvent(EventTouch::EventCode eventType,
|
||||||
const std::vector<Touch*>& touches, JSObject *obj)
|
const std::vector<Touch*>& touches, JSObject *obj)
|
||||||
{
|
{
|
||||||
jsval retval;
|
jsval retval;
|
||||||
|
@ -1055,7 +1055,7 @@ int ScriptingCore::executeCustomTouchesEvent(TouchEvent::EventCode eventType,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ScriptingCore::executeCustomTouchEvent(TouchEvent::EventCode eventType,
|
int ScriptingCore::executeCustomTouchEvent(EventTouch::EventCode eventType,
|
||||||
Touch *pTouch, JSObject *obj)
|
Touch *pTouch, JSObject *obj)
|
||||||
{
|
{
|
||||||
jsval retval;
|
jsval retval;
|
||||||
|
@ -1074,7 +1074,7 @@ int ScriptingCore::executeCustomTouchEvent(TouchEvent::EventCode eventType,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int ScriptingCore::executeCustomTouchEvent(TouchEvent::EventCode eventType,
|
int ScriptingCore::executeCustomTouchEvent(EventTouch::EventCode eventType,
|
||||||
Touch *pTouch, JSObject *obj,
|
Touch *pTouch, JSObject *obj,
|
||||||
jsval &retval)
|
jsval &retval)
|
||||||
{
|
{
|
||||||
|
|
|
@ -140,11 +140,11 @@ public:
|
||||||
static void removeAllRoots(JSContext *cx);
|
static void removeAllRoots(JSContext *cx);
|
||||||
|
|
||||||
|
|
||||||
int executeCustomTouchEvent(TouchEvent::EventCode eventType,
|
int executeCustomTouchEvent(EventTouch::EventCode eventType,
|
||||||
Touch *pTouch, JSObject *obj, jsval &retval);
|
Touch *pTouch, JSObject *obj, jsval &retval);
|
||||||
int executeCustomTouchEvent(TouchEvent::EventCode eventType,
|
int executeCustomTouchEvent(EventTouch::EventCode eventType,
|
||||||
Touch *pTouch, JSObject *obj);
|
Touch *pTouch, JSObject *obj);
|
||||||
int executeCustomTouchesEvent(TouchEvent::EventCode eventType,
|
int executeCustomTouchesEvent(EventTouch::EventCode eventType,
|
||||||
const std::vector<Touch*>& touches, JSObject *obj);
|
const std::vector<Touch*>& touches, JSObject *obj);
|
||||||
/**
|
/**
|
||||||
* @return the global context
|
* @return the global context
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
7756f6d4cf4b992057e4f9b619a10021af30cd11
|
b88df18e2512b5111debda3991f51c2e72a2e5da
|
|
@ -218,7 +218,7 @@ private:
|
||||||
typedef std::pair<JSObject*, JSTouchDelegate*> TouchDelegatePair;
|
typedef std::pair<JSObject*, JSTouchDelegate*> TouchDelegatePair;
|
||||||
static TouchDelegateMap sTouchDelegateMap;
|
static TouchDelegateMap sTouchDelegateMap;
|
||||||
bool _needUnroot;
|
bool _needUnroot;
|
||||||
TouchEventListener* _touchListener;
|
EventListenerTouch* _touchListener;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -400,14 +400,14 @@ int LuaEngine::handleKeypadEvent(void* data)
|
||||||
if (0 == handler)
|
if (0 == handler)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
KeyboardEvent::KeyCode action = keypadScriptData->actionType;
|
EventKeyboard::KeyCode action = keypadScriptData->actionType;
|
||||||
|
|
||||||
switch(action)
|
switch(action)
|
||||||
{
|
{
|
||||||
case KeyboardEvent::KeyCode::KEY_BACKSPACE:
|
case EventKeyboard::KeyCode::KEY_BACKSPACE:
|
||||||
_stack->pushString("backClicked");
|
_stack->pushString("backClicked");
|
||||||
break;
|
break;
|
||||||
case KeyboardEvent::KeyCode::KEY_MENU:
|
case EventKeyboard::KeyCode::KEY_MENU:
|
||||||
_stack->pushString("menuClicked");
|
_stack->pushString("menuClicked");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -484,19 +484,19 @@ int LuaEngine::handleTouchEvent(void* data)
|
||||||
|
|
||||||
switch (touchScriptData->actionType)
|
switch (touchScriptData->actionType)
|
||||||
{
|
{
|
||||||
case TouchEvent::EventCode::BEGAN:
|
case EventTouch::EventCode::BEGAN:
|
||||||
_stack->pushString("began");
|
_stack->pushString("began");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TouchEvent::EventCode::MOVED:
|
case EventTouch::EventCode::MOVED:
|
||||||
_stack->pushString("moved");
|
_stack->pushString("moved");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TouchEvent::EventCode::ENDED:
|
case EventTouch::EventCode::ENDED:
|
||||||
_stack->pushString("ended");
|
_stack->pushString("ended");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TouchEvent::EventCode::CANCELLED:
|
case EventTouch::EventCode::CANCELLED:
|
||||||
_stack->pushString("cancelled");
|
_stack->pushString("cancelled");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -533,19 +533,19 @@ int LuaEngine::handleTouchesEvent(void* data)
|
||||||
|
|
||||||
switch (touchesScriptData->actionType)
|
switch (touchesScriptData->actionType)
|
||||||
{
|
{
|
||||||
case TouchEvent::EventCode::BEGAN:
|
case EventTouch::EventCode::BEGAN:
|
||||||
_stack->pushString("began");
|
_stack->pushString("began");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TouchEvent::EventCode::MOVED:
|
case EventTouch::EventCode::MOVED:
|
||||||
_stack->pushString("moved");
|
_stack->pushString("moved");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TouchEvent::EventCode::ENDED:
|
case EventTouch::EventCode::ENDED:
|
||||||
_stack->pushString("ended");
|
_stack->pushString("ended");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case TouchEvent::EventCode::CANCELLED:
|
case EventTouch::EventCode::CANCELLED:
|
||||||
_stack->pushString("cancelled");
|
_stack->pushString("cancelled");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue