mirror of https://github.com/axmolengine/axmol.git
use precompile macro to cantrol if enable lua support
This commit is contained in:
parent
dedbd638d3
commit
a8b6b850de
|
@ -43,4 +43,4 @@ Dynamics/b2WorldCallbacks.cpp
|
|||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/..
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
|
|
@ -5,6 +5,7 @@ LOCAL_MODULE := cocosdenshion
|
|||
LOCAL_SRC_FILES := SimpleAudioEngine.cpp \
|
||||
jni/SimpleAudioEngineJni.cpp
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/../include \
|
||||
$(LOCAL_PATH)/../../cocos2dx
|
||||
|
||||
include $(BUILD_STATIC_LIBRARY)
|
|
@ -1,4 +1,5 @@
|
|||
#include "SimpleAudioEngineJni.h"
|
||||
#include "platform/android/Cocos2dJni.h"
|
||||
#include <android/log.h>
|
||||
|
||||
#define LOG_TAG "libSimpleAudioEngine"
|
||||
|
@ -7,17 +8,9 @@
|
|||
|
||||
extern "C"
|
||||
{
|
||||
static JavaVM *gJavaVM = 0;
|
||||
static jclass classOfCocos2dxActivity = 0;
|
||||
JNIEnv *env = 0;
|
||||
|
||||
jint JNI_OnLoad(JavaVM *vm, void *reserved)
|
||||
{
|
||||
gJavaVM = vm;
|
||||
|
||||
return JNI_VERSION_1_4;
|
||||
}
|
||||
|
||||
static jmethodID getMethodID(const char *methodName, const char *paramCode)
|
||||
{
|
||||
jmethodID ret = 0;
|
||||
|
|
|
@ -85,7 +85,7 @@ bool AppDelegate::applicationDidFinishLaunching()
|
|||
|
||||
|
||||
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_ANDROID)
|
||||
// CCLuaScriptModule::sharedLuaScriptModule()->executeScriptFile("/sdcard/hello.lua");
|
||||
|
|
|
@ -22,6 +22,10 @@ do
|
|||
fi
|
||||
done
|
||||
|
||||
# to enable lua
|
||||
ENABLE_LUA=true
|
||||
export ENABLE_LUA
|
||||
|
||||
# build
|
||||
pushd $ANDROID_NDK_ROOT
|
||||
./ndk-build -C $HELLOWORLD_ROOT $*
|
||||
|
|
|
@ -35,4 +35,4 @@ src/cpVect.c
|
|||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/include/chipmunk
|
||||
LOCAL_CFLAGS := -std=c99
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
include $(BUILD_STATIC_LIBRARY)
|
||||
|
|
|
@ -96,11 +96,18 @@ tileMap_parallax_nodes/CCTMXTiledMap.cpp \
|
|||
tileMap_parallax_nodes/CCTMXXMLParser.cpp \
|
||||
tileMap_parallax_nodes/CCTileMapAtlas.cpp \
|
||||
touch_dispatcher/CCTouchDispatcher.cpp \
|
||||
touch_dispatcher/CCTouchHandler.cpp \
|
||||
Ndscript/CCLuaSrcipt.cpp \
|
||||
Ndscript/LuaCocos2d.cpp \
|
||||
NdControls/NdCxList.cpp \
|
||||
NdControls/NdCxListItem.cpp
|
||||
touch_dispatcher/CCTouchHandler.cpp
|
||||
|
||||
ifeq ($(ENABLE_LUA), true)
|
||||
LOCAL_SRC_FILES += Ndscript/CCLuaSrcipt.cpp \
|
||||
Ndscript/LuaCocos2d.cpp \
|
||||
NdControls/NdCxList.cpp \
|
||||
NdControls/NdCxListItem.cpp
|
||||
|
||||
LOCAL_CFLAGS := -DENABLE_LUA -DUSE_FILE32API
|
||||
else
|
||||
LOCAL_CFLAGS := -DUSE_FILE32API
|
||||
endif
|
||||
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/ \
|
||||
|
|
|
@ -188,7 +188,7 @@ void CCDirector::drawScene(void)
|
|||
//tick before glClear: issue #533
|
||||
if (! m_bPaused)
|
||||
{
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
if (m_luatick.size())
|
||||
{
|
||||
schedule_SCHEDULE(NULL, NULL, m_fDeltaTime, m_luatick);
|
||||
|
@ -889,7 +889,7 @@ void CCDirector::setDeviceOrientation(ccDeviceOrientation kDeviceOrientation)
|
|||
}
|
||||
|
||||
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
void CCDirector::registerTick(const char* szfn)
|
||||
{
|
||||
if (szfn == NULL || strlen(szfn) == 0)
|
||||
|
|
|
@ -85,7 +85,7 @@ CCTimer* CCTimer::timerWithTarget(SelectorProtocol *pTarget, SEL_SCHEDULE pfnSel
|
|||
|
||||
return pTimer;
|
||||
}
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCTimer* CCTimer::timerWithScript(SelectorProtocol* pTarget, const char* szFuncName, ccTime fSeconds)
|
||||
{
|
||||
CCTimer *pTimer = new CCTimer();
|
||||
|
@ -146,7 +146,7 @@ void CCTimer::update(ccTime dt)
|
|||
(m_pTarget->*m_pfnSelector)(m_fElapsed);
|
||||
m_fElapsed = 0;
|
||||
}
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
else if (m_scriptFunc.size())
|
||||
{
|
||||
schedule_SCHEDULE(m_pTarget, m_pfnSelector, m_fElapsed, m_scriptFunc);
|
||||
|
@ -237,7 +237,7 @@ void CCScheduler::unscheduleAllTimers()
|
|||
{
|
||||
assert(false);
|
||||
}
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
void CCScheduler::scheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol *pTarget, float fInterval, bool bPaused, const char* szScriptFunc)
|
||||
#else
|
||||
void CCScheduler::scheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol *pTarget, float fInterval, bool bPaused)
|
||||
|
@ -276,7 +276,7 @@ void CCScheduler::scheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol *p
|
|||
for (unsigned int i = 0; i < pElement->timers->num; ++i)
|
||||
{
|
||||
CCTimer *timer = (CCTimer*)pElement->timers->arr[i];
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
if ((timer->m_pfnSelector &&pfnSelector == timer->m_pfnSelector)
|
||||
|| (szScriptFunc && timer->isScriptFuncExist(szScriptFunc)))
|
||||
{
|
||||
|
@ -299,7 +299,7 @@ void CCScheduler::scheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol *p
|
|||
}
|
||||
|
||||
CCTimer *pTimer = new CCTimer();
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
if (szScriptFunc)
|
||||
{
|
||||
pTimer->initWithScript(pTarget, szScriptFunc, fInterval);
|
||||
|
@ -315,14 +315,14 @@ void CCScheduler::scheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol *p
|
|||
ccArrayAppendObject(pElement->timers, pTimer);
|
||||
pTimer->release();
|
||||
}
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
void CCScheduler::unscheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol *pTarget, const char* szScriptFunc)
|
||||
#else
|
||||
void CCScheduler::unscheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol *pTarget)
|
||||
#endif
|
||||
{
|
||||
// explicity handle nil arguments when removing an object
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
if (pTarget == 0 || (pfnSelector == 0 && szScriptFunc == 0))
|
||||
{
|
||||
return;
|
||||
|
@ -346,7 +346,7 @@ void CCScheduler::unscheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol
|
|||
{
|
||||
CCTimer *pTimer = (CCTimer*)(pElement->timers->arr[i]);
|
||||
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
if ((pTimer->m_pfnSelector&& pfnSelector == pTimer->m_pfnSelector) ||
|
||||
pTimer->isScriptFuncExist(szScriptFunc))
|
||||
#else
|
||||
|
@ -631,7 +631,7 @@ void CCScheduler::tick(ccTime dt)
|
|||
{
|
||||
if (! pEntry->paused)
|
||||
{
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
if (pEntry->target->m_scriptFunc[ccSEL_Update].size())
|
||||
{
|
||||
schedule_SCHEDULE(NULL, NULL, dt, pEntry->target->m_scriptFunc[ccSEL_Update]);
|
||||
|
@ -651,7 +651,7 @@ void CCScheduler::tick(ccTime dt)
|
|||
{
|
||||
if (! pEntry->paused)
|
||||
{
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
if (pEntry->target->m_scriptFunc[ccSEL_Update].size())
|
||||
{
|
||||
schedule_SCHEDULE(NULL, NULL,dt, pEntry->target->m_scriptFunc[ccSEL_Update]);
|
||||
|
@ -672,7 +672,7 @@ void CCScheduler::tick(ccTime dt)
|
|||
{
|
||||
if (! pEntry->paused)
|
||||
{
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
if (pEntry->target->m_scriptFunc[ccSEL_Update].size())
|
||||
{
|
||||
schedule_SCHEDULE(NULL, NULL,dt, pEntry->target->m_scriptFunc[ccSEL_Update]);
|
||||
|
|
|
@ -200,7 +200,7 @@ namespace NdCxControl
|
|||
item_click_listener_->onClick(
|
||||
inner_panel_->getChildren()->indexOfObject(sel_item_), sel_item_);
|
||||
}
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
else if (m_scriptSeletor.size())
|
||||
{
|
||||
CCLuaScriptModule::sharedLuaScriptModule()->executeListItem(m_scriptSeletor,
|
||||
|
@ -423,11 +423,11 @@ namespace NdCxControl
|
|||
{
|
||||
item_click_listener_ = NULL;
|
||||
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
m_scriptSeletor.clear();
|
||||
#endif
|
||||
}
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
void NdCxList::registerItemClickListener(const char* szSeletor)
|
||||
{
|
||||
if (szSeletor)
|
||||
|
|
|
@ -58,7 +58,7 @@ namespace NdCxControl
|
|||
|
||||
virtual void registerItemClickListener(NdCxListItemClickListener *listener);
|
||||
virtual void unregisterItemClickListener(void);
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
virtual void registerItemClickListener(const char* szSeletor);
|
||||
#endif
|
||||
|
||||
|
@ -100,7 +100,7 @@ namespace NdCxControl
|
|||
ccColor3B sel_item_end_color_;
|
||||
|
||||
NdCxListItemClickListener *item_click_listener_;
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
std::string m_scriptSeletor;
|
||||
#endif
|
||||
};
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
#include "CCLuaSrcipt.h"
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
|
||||
extern "C" {
|
||||
#include "lualib.h"
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define _CCLUASRCIPT_H
|
||||
#include "ccConfig.h"
|
||||
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
#include "CCCommon.h"
|
||||
#include "CCObject.h"
|
||||
#include <string>
|
||||
|
|
|
@ -1 +1 @@
|
|||
1ea7cd7e5760f4a41c7e1215e9fd2be41ddb5644
|
||||
1139f1b8e60225b4e38fae58ee8da9c24e27d8c9
|
|
@ -1,7 +1,7 @@
|
|||
#ifndef LUACOCOS2D_H
|
||||
#define LUACOCOS2D_H
|
||||
#include "cocos2d.h"
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
#include <stdio.h>
|
||||
#include "lua.h"
|
||||
#include "CCKeypadDispatcher.h"
|
||||
|
|
|
@ -266,7 +266,7 @@ namespace cocos2d {
|
|||
|
||||
return pCallFunc;
|
||||
}
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCCallFunc * CCCallFunc::actionWithLua(const char * pszfunc)
|
||||
{
|
||||
if (pszfunc)
|
||||
|
@ -327,7 +327,7 @@ namespace cocos2d {
|
|||
}
|
||||
void CCCallFunc::execute()
|
||||
{
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
schedule_CallFunc(m_pSelectorTarget, m_pCallFunc, m_pLuaCallFun);
|
||||
#else
|
||||
if(m_pCallFunc)
|
||||
|
@ -341,7 +341,7 @@ namespace cocos2d {
|
|||
//
|
||||
void CCCallFuncN::execute()
|
||||
{
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
schedule_CallFuncN(m_pSelectorTarget, m_pCallFuncN, m_pTarget, m_pLuaCallFun);
|
||||
#else
|
||||
if(m_pCallFuncN)
|
||||
|
@ -361,7 +361,7 @@ namespace cocos2d {
|
|||
CC_SAFE_DELETE(pRet);
|
||||
return NULL;
|
||||
}
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCCallFuncN * CCCallFuncN::actionWithLua(const char * pszfunc)
|
||||
{
|
||||
|
||||
|
@ -415,7 +415,7 @@ namespace cocos2d {
|
|||
CC_SAFE_DELETE(pRet);
|
||||
return NULL;
|
||||
}
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCCallFuncND * CCCallFuncND::actionWithLua(const char * pszfunc)
|
||||
{
|
||||
if (pszfunc)
|
||||
|
@ -460,7 +460,7 @@ namespace cocos2d {
|
|||
|
||||
void CCCallFuncND::execute()
|
||||
{
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
schedule_CallFuncND(m_pSelectorTarget,m_pCallFuncND, m_pTarget, m_pData, m_pLuaCallFun);
|
||||
#else
|
||||
if(m_pCallFuncND)
|
||||
|
@ -485,7 +485,7 @@ namespace cocos2d {
|
|||
|
||||
void CCCallFuncO::execute()
|
||||
{
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
schedule_CallFuncO(m_pSelectorTarget, m_pCallFuncO, m_pObject, m_pLuaCallFun);
|
||||
#else
|
||||
if(m_pCallFuncO)
|
||||
|
@ -505,7 +505,7 @@ namespace cocos2d {
|
|||
CC_SAFE_DELETE(pRet);
|
||||
return NULL;
|
||||
}
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCCallFuncO * CCCallFuncO::actionWithLua(const char * pszfunc)
|
||||
{
|
||||
if (pszfunc)
|
||||
|
|
|
@ -933,7 +933,7 @@ void CCNode::unschedule(SEL_SCHEDULE selector)
|
|||
|
||||
CCScheduler::sharedScheduler()->unscheduleSelector(selector, this);
|
||||
}
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
void CCNode::schedule(const char* selector)
|
||||
{
|
||||
if (selector == NULL || strlen(selector) == 0)
|
||||
|
@ -1121,7 +1121,7 @@ CCPoint CCNode::convertTouchToNodeSpaceAR(CCTouch *touch)
|
|||
point = CCDirector::sharedDirector()->convertToGL(point);
|
||||
return this->convertToNodeSpaceAR(point);
|
||||
}
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
bool CCNode::registerScriptSelector(const char* szType, const char* szSeletor)
|
||||
{
|
||||
return SelectorProtocol::registerScriptSelector(szType, szSeletor);
|
||||
|
|
|
@ -191,7 +191,7 @@ namespace cocos2d {
|
|||
|
||||
typedef void (SelectorProtocol::*SEL_CallFunc)();
|
||||
*/
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
static CCCallFunc * actionWithLua(const char * pszfunc);
|
||||
virtual bool initWithLua(const char* pszfn);
|
||||
#endif
|
||||
|
@ -205,7 +205,7 @@ namespace cocos2d {
|
|||
|
||||
protected:
|
||||
SelectorProtocol* m_pSelectorTarget;
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
std::string m_pLuaCallFun;
|
||||
#endif
|
||||
union
|
||||
|
@ -235,7 +235,7 @@ namespace cocos2d {
|
|||
|
||||
typedef void (SelectorProtocol::*SEL_CallFuncN)(CCNode*);
|
||||
*/
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
static CCCallFuncN * actionWithLua(const char * pszfunc);
|
||||
#endif
|
||||
virtual bool initWithTarget(SelectorProtocol* pSelectorTarget, SEL_CallFuncN selector);
|
||||
|
@ -255,7 +255,7 @@ namespace cocos2d {
|
|||
|
||||
/** creates the action with the callback and the data to pass as an argument */
|
||||
static CCCallFuncND * actionWithTarget(SelectorProtocol* pSelectorTarget, SEL_CallFuncND selector, void* d);
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
static CCCallFuncND * actionWithLua(const char * pszfunc);
|
||||
#endif
|
||||
/** initializes the action with the callback and the data to pass as an argument */
|
||||
|
@ -288,7 +288,7 @@ namespace cocos2d {
|
|||
|
||||
typedef void (SelectorProtocol::*SEL_CallFuncO)(CCObject*);
|
||||
*/
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
static CCCallFuncO * actionWithLua(const char * pszfunc);
|
||||
#endif
|
||||
virtual bool initWithTarget(SelectorProtocol* pSelectorTarget, SEL_CallFuncO selector, CCObject* pObject);
|
||||
|
|
|
@ -34,7 +34,7 @@ THE SOFTWARE.
|
|||
#include "CCGeometry.h"
|
||||
#include "CCEGLView.h"
|
||||
#include "CCGL.h"
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
#include <string>
|
||||
#endif
|
||||
namespace cocos2d {
|
||||
|
@ -313,7 +313,7 @@ public:
|
|||
/** Ends the execution, releases the running scene.
|
||||
It doesn't remove the OpenGL view from its parent. You have to do it manually.
|
||||
*/
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
inline void endToLua(void){end();}
|
||||
#endif
|
||||
void end(void);
|
||||
|
@ -430,7 +430,7 @@ public:
|
|||
/** detach the cocos2d view from the view/window */
|
||||
bool detach(void);
|
||||
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
std::string m_luatick;
|
||||
void registerTick(const char* szfn);
|
||||
#endif
|
||||
|
|
|
@ -226,7 +226,7 @@ public:
|
|||
/** creates a CCMultiplexLayer with one or more layers using a variable argument list. */
|
||||
static CCMultiplexLayer * layerWithLayers(CCLayer* layer, ... );
|
||||
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
static CCMultiplexLayer * layerWithLayer(CCLayer* layer);
|
||||
void addLayer(CCLayer* layer);
|
||||
bool initWithLayer(CCLayer* layer);
|
||||
|
|
|
@ -57,7 +57,7 @@ namespace cocos2d{
|
|||
virtual ~CCMenu(){}
|
||||
/** creates a CCMenu with it's items */
|
||||
static CCMenu* menuWithItems(CCMenuItem* item, ...);
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
static CCMenu*menuWithItem(CCMenuItem* item);
|
||||
#endif
|
||||
/** initializes a CCMenu with it's items */
|
||||
|
|
|
@ -69,7 +69,7 @@ namespace cocos2d{
|
|||
virtual void selected();
|
||||
/** The item was unselected */
|
||||
virtual void unselected();
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
virtual void registerMenuHandler(const char* fn);
|
||||
std::string m_strScriptFunc;
|
||||
#endif
|
||||
|
|
|
@ -325,7 +325,7 @@ public:
|
|||
return m_array.rbegin();
|
||||
}
|
||||
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCMutableArrayIterator endToLua(void)
|
||||
{
|
||||
return m_array.end();
|
||||
|
|
|
@ -182,7 +182,7 @@ public:
|
|||
return pObject;
|
||||
}
|
||||
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
void endToLua()
|
||||
{
|
||||
end();
|
||||
|
|
|
@ -453,7 +453,7 @@ namespace cocos2d {
|
|||
/*
|
||||
ad for lua script
|
||||
*/
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
void schedule(const char* selector);
|
||||
void schedule(const char* selector, ccTime interval);
|
||||
void unschedule(const char* selector);
|
||||
|
@ -533,7 +533,7 @@ namespace cocos2d {
|
|||
@since v0.7.1
|
||||
*/
|
||||
CCPoint convertTouchToNodeSpaceAR(CCTouch * touch);
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
bool registerScriptSelector(const char* szType, const char* szSeletor);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public:
|
|||
void beginWithClear(float r, float g, float b, float a);
|
||||
|
||||
/** ends grabbing */
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
inline void endToLua(){ end();};
|
||||
#endif
|
||||
void end();
|
||||
|
|
|
@ -61,7 +61,7 @@ public:
|
|||
/** Allocates a timer with a target, a selector and an interval in seconds. */
|
||||
static CCTimer* timerWithTarget(SelectorProtocol *pTarget, SEL_SCHEDULE pfnSelector, ccTime fSeconds);
|
||||
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
//CCTimer init from Script
|
||||
static CCTimer* timerWithScript(SelectorProtocol* pTarget, const char* szFuncName, ccTime fSeconds);
|
||||
bool initWithScript(SelectorProtocol* pTarget, const char* szFuncName, ccTime fSeconds);
|
||||
|
@ -123,7 +123,7 @@ public:
|
|||
|
||||
@since v0.99.3
|
||||
*/
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
void scheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol *pTarget, ccTime fInterval, bool bPaused, const char* szScriptFunc = NULL);
|
||||
#else
|
||||
void scheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol *pTarget, ccTime fInterval, bool bPaused);
|
||||
|
@ -139,7 +139,7 @@ public:
|
|||
If you want to unschedule the "update", use unscheudleUpdateForTarget.
|
||||
@since v0.99.3
|
||||
*/
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
void unscheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol *pTarget, const char* szScriptFunc = NULL);
|
||||
#else
|
||||
void unscheduleSelector(SEL_SCHEDULE pfnSelector, SelectorProtocol *pTarget);
|
||||
|
|
|
@ -28,7 +28,7 @@ THE SOFTWARE.
|
|||
|
||||
#include "CCObject.h"
|
||||
#include "ccConfig.h"
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
#include "CCMutableDictionary.h"
|
||||
#include "CCString.h"
|
||||
#include "../Ndscript/CCLuaSrcipt.h"
|
||||
|
@ -51,7 +51,7 @@ class CC_DLL CCTouchDelegate
|
|||
{
|
||||
protected:
|
||||
ccTouchDelegateFlag m_eTouchDelegateType;
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCMutableDictionary<int, cocos2d::CCString*> *m_pEventDictionary;
|
||||
#endif
|
||||
public:
|
||||
|
@ -76,7 +76,7 @@ public:
|
|||
virtual void ccTouchesEnded(CCSet *pTouches, CCEvent *pEvent) {}
|
||||
virtual void ccTouchesCancelled(CCSet *pTouches, CCEvent *pEvent) {}
|
||||
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
//use for lua register event
|
||||
/*
|
||||
szEventName must be one of follow value
|
||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
|||
#include "CCObject.h"
|
||||
#include <string>
|
||||
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
#include "../Ndscript/CCLuaSrcipt.h"
|
||||
#endif
|
||||
|
||||
|
@ -38,7 +38,7 @@ namespace cocos2d {
|
|||
class CCNode;
|
||||
class CCEvent;
|
||||
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
enum ccScriptFuncType
|
||||
{
|
||||
ccSEL_Update,
|
||||
|
@ -85,7 +85,7 @@ public:
|
|||
}
|
||||
};
|
||||
#endif
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
class CC_DLL SelectorProtocol:public CCScriptSelector
|
||||
#else
|
||||
class CC_DLL SelectorProtocol
|
||||
|
@ -139,7 +139,7 @@ inline void schedule_SCHEDULE(SelectorProtocol* pSel,SEL_SCHEDULE pfn, ccTime cc
|
|||
}
|
||||
else
|
||||
{
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCLuaScriptModule::sharedLuaScriptModule()->executeSchedule(strluafnc, cc);
|
||||
#endif
|
||||
|
||||
|
@ -154,7 +154,7 @@ inline void schedule_CallFunc(SelectorProtocol* pSel,SEL_CallFunc pfn, std::stri
|
|||
}
|
||||
else
|
||||
{
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCLuaScriptModule::sharedLuaScriptModule()->executeCallFunc(strluafnc);
|
||||
#endif
|
||||
|
||||
|
@ -168,7 +168,7 @@ inline void schedule_CallFuncN(SelectorProtocol* pSel,SEL_CallFuncN pfn, CCNode*
|
|||
}
|
||||
else
|
||||
{
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCLuaScriptModule::sharedLuaScriptModule()->executeCallFuncN(strluafnc, pNode);
|
||||
#endif
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ inline void schedule_CallFuncND(SelectorProtocol* pSel,SEL_CallFuncND pfn, CCNod
|
|||
}
|
||||
else
|
||||
{
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCLuaScriptModule::sharedLuaScriptModule()->executeCallFuncND(strluafnc, pNode, pdata);
|
||||
#endif
|
||||
}
|
||||
|
@ -196,7 +196,7 @@ inline void schedule_MenuHandler(SelectorProtocol* pSel,SEL_MenuHandler pfn, CCO
|
|||
}
|
||||
else
|
||||
{
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCLuaScriptModule::sharedLuaScriptModule()->executeMenuHandler(strluafnc.c_str(), pobj);
|
||||
#endif
|
||||
}
|
||||
|
@ -215,7 +215,7 @@ inline void schedule_EventHandler(SelectorProtocol* pSel,SEL_EventHandler pfn, C
|
|||
}
|
||||
else
|
||||
{
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCLuaScriptModule::sharedLuaScriptModule()->executeEventHandler(strluafnc, pEvent);
|
||||
#endif
|
||||
|
||||
|
|
|
@ -602,7 +602,7 @@ CCMultiplexLayer * CCMultiplexLayer::layerWithLayers(CCLayer * layer, ...)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCMultiplexLayer * CCMultiplexLayer::layerWithLayer(CCLayer* layer)
|
||||
{
|
||||
CCMultiplexLayer * pMultiplexLayer = new CCMultiplexLayer();
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace cocos2d{
|
|||
return NULL;
|
||||
}
|
||||
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCMenu* CCMenu::menuWithItem(CCMenuItem* item)
|
||||
{
|
||||
return menuWithItems(item, NULL);
|
||||
|
|
|
@ -29,7 +29,7 @@ THE SOFTWARE.
|
|||
#include "CCSprite.h"
|
||||
#include "CCLabelAtlas.h"
|
||||
#include "CCLabelTTF.h"
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
#include "CCTouchDispatcher.h"
|
||||
#endif
|
||||
#include <stdarg.h>
|
||||
|
@ -66,7 +66,7 @@ namespace cocos2d{
|
|||
m_bIsSelected = false;
|
||||
return true;
|
||||
}
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
void CCMenuItem::registerMenuHandler(const char* fn)
|
||||
{
|
||||
if (fn && strlen(fn))
|
||||
|
@ -92,7 +92,7 @@ namespace cocos2d{
|
|||
{
|
||||
(m_pListener->*m_pfnSelector)(this);
|
||||
}
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
else if(m_strScriptFunc.size())
|
||||
{
|
||||
schedule_MenuHandler(m_pListener, m_pfnSelector, this, m_strScriptFunc);
|
||||
|
|
|
@ -37,7 +37,7 @@ static const int kMaxLogLen = 255;
|
|||
*/
|
||||
void CC_DLL CCLog(const char * pszFormat, ...);
|
||||
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
inline void CC_DLL CCLuaLog(const char * pszFormat)
|
||||
{
|
||||
CCLog(pszFormat);
|
||||
|
|
|
@ -277,7 +277,7 @@ void CCTouchDispatcher::touches(CCSet *pTouches, CCEvent *pEvent, unsigned int u
|
|||
bool bClaimed = false;
|
||||
if (uIndex == ccTouchBegan)
|
||||
{
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCString*pLuaFn = pHandler->getDelegate()->getLuaEvent(ccTouchBegan);
|
||||
if (pLuaFn)
|
||||
{
|
||||
|
@ -300,7 +300,7 @@ void CCTouchDispatcher::touches(CCSet *pTouches, CCEvent *pEvent, unsigned int u
|
|||
{
|
||||
// moved ended cancelled
|
||||
bClaimed = true;
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCString*pLuaFn = pHandler->getDelegate()->getLuaEvent(sHelper.m_type);
|
||||
|
||||
switch (sHelper.m_type)
|
||||
|
@ -384,7 +384,7 @@ void CCTouchDispatcher::touches(CCSet *pTouches, CCEvent *pEvent, unsigned int u
|
|||
{
|
||||
break;
|
||||
}
|
||||
#if CC_ENABLE_LUA
|
||||
#ifdef ENABLE_LUA
|
||||
CCString*pLuaTouchesfn = pHandler->getDelegate()->getLuaEvent(sHelper.m_type);
|
||||
if (pLuaTouchesfn)
|
||||
{
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
APP_STL := stlport_static
|
||||
APP_ABI := armeabi armeabi-v7a
|
||||
|
||||
APP_MODULES := cocos2d cocosdenshion chipmunk box2d tests
|
||||
APP_MODULES := tests
|
||||
|
|
|
@ -81,26 +81,34 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/../../../../cocos2dx \
|
|||
$(LOCAL_PATH)/../../../.. \
|
||||
$(LOCAL_PATH)/../../.. \
|
||||
$(LOCAL_PATH)/../../../../chipmunk/include/chipmunk \
|
||||
$(LOCAL_PATH)/../../../../CocosDenshion/include
|
||||
$(LOCAL_PATH)/../../../../CocosDenshion/include
|
||||
|
||||
# it is used for ndk-r4
|
||||
# if you build with nkd-r4, uncomment it
|
||||
# LOCAL_LDLIBS := -L$(LOCAL_PATH)/../../libs/armeabi \
|
||||
# -lGLESv1_CM \
|
||||
# -lcocos2d -lcocosdenshion -llog \
|
||||
# -lbox2d -lchipmunk \
|
||||
# -L$(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries -lcurl
|
||||
# LOCAL_LDLIBS := -lGLESv1_CM \
|
||||
# -llog \
|
||||
# -lz
|
||||
# -L$(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries -lcurl \
|
||||
# -lpng \
|
||||
# -lxml2 \
|
||||
# -ljpeg \
|
||||
# -lskia
|
||||
|
||||
|
||||
# it is used for ndk-r5
|
||||
# if you build with ndk-r4, comment it
|
||||
# because the new Windows toolchain doesn't support Cygwin's drive
|
||||
# mapping (i.e /cygdrive/c/ instead of C:/)
|
||||
LOCAL_LDLIBS := -L$(call host-path, $(LOCAL_PATH)/../../libs/armeabi) \
|
||||
-lGLESv1_CM \
|
||||
-lcocos2d -llog -lcocosdenshion \
|
||||
-lbox2d -lchipmunk \
|
||||
-L$(call host-path, $(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries) -lcurl
|
||||
LOCAL_LDLIBS := -lGLESv1_CM \
|
||||
-llog \
|
||||
-lz \
|
||||
-L$(call host-path, $(LOCAL_PATH)/../../../../cocos2dx/platform/third_party/android/libraries) -lcurl \
|
||||
-lpng \
|
||||
-lxml2 \
|
||||
-ljpeg \
|
||||
-lskia
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := libcocos2d libcocosdenshion libbox2d libchipmunk
|
||||
|
||||
include $(BUILD_SHARED_LIBRARY)
|
||||
|
||||
|
|
Loading…
Reference in New Issue