From f1351610d8cf79327dfb064f9e6fe70883a1dd14 Mon Sep 17 00:00:00 2001 From: YuLei Liao Date: Tue, 29 Nov 2011 12:35:48 +0800 Subject: [PATCH] * merge CCLuaSupport to CCLuaEngine --- cocos2dx/CCLuaSupport.cpp | 47 ---------------------------- cocos2dx/include/CCLuaSupport.h | 54 --------------------------------- 2 files changed, 101 deletions(-) delete mode 100644 cocos2dx/CCLuaSupport.cpp delete mode 100644 cocos2dx/include/CCLuaSupport.h diff --git a/cocos2dx/CCLuaSupport.cpp b/cocos2dx/CCLuaSupport.cpp deleted file mode 100644 index dfbc19f05e..0000000000 --- a/cocos2dx/CCLuaSupport.cpp +++ /dev/null @@ -1,47 +0,0 @@ - -#include "CCLuaSupport.h" -#include "CCArray.h" -#include "CCTimer.h" -#include "LuaEngine.h" - -using namespace cocos2d; - -CCSchedulerFuncEntry* CCSchedulerFuncEntry::entryWithRefID(int refID, ccTime fInterval, bool bPaused) -{ - CCSchedulerFuncEntry* entry = new CCSchedulerFuncEntry(); - entry->initWithRefID(refID, fInterval, bPaused); - entry->autorelease(); - return entry; -} - - -bool CCSchedulerFuncEntry::initWithRefID(int refID, ccTime fInterval, bool bPaused) -{ - LuaEngine::sharedEngine()->retainRefID(refID); - m_timer = new CCTimer(); - m_timer->initWithScriptFunc(refID, fInterval); - m_timer->autorelease(); - m_timer->retain(); - m_refID = refID; - m_paused = bPaused; - return true; -} - -CCSchedulerFuncEntry::CCSchedulerFuncEntry(void) -: m_timer(NULL) -, m_refID(0) -, m_paused(true) -, m_isMarkDeleted(false) -{ - static int handleCount = 0; - ++handleCount; - m_handle = handleCount; -} - -CCSchedulerFuncEntry::~CCSchedulerFuncEntry(void) -{ - m_timer->release(); - LuaEngine::sharedEngine()->releaseRefID(m_refID); -// CCLOG("CCSchedulerFuncEntry::~CCSchedulerFuncEntry() - remove script entry, handle: %d, refid: %d", -// m_handle, m_refID); -} diff --git a/cocos2dx/include/CCLuaSupport.h b/cocos2dx/include/CCLuaSupport.h deleted file mode 100644 index 24366d9095..0000000000 --- a/cocos2dx/include/CCLuaSupport.h +++ /dev/null @@ -1,54 +0,0 @@ - -#ifndef __CC_LUA_SUPPORT_ -#define __CC_LUA_SUPPORT_ - -#include "CCObject.h" -#include "ccTypes.h" - -namespace cocos2d -{ - class CCTimer; - - class CCSchedulerFuncEntry : public CCObject - { - public: - static CCSchedulerFuncEntry* entryWithRefID(int refID, ccTime fInterval, bool bPaused); - ~CCSchedulerFuncEntry(void); - - inline CCTimer* getTimer(void) { - return m_timer; - } - - inline bool isPaused(void) { - return m_paused; - } - - inline int getRefID(void) { - return m_refID; - } - - inline int getHandle(void) { - return m_handle; - } - - void markDeleted(void) { - m_isMarkDeleted = true; - } - - bool isMarkDeleted(void) { - return m_isMarkDeleted; - } - - private: - CCSchedulerFuncEntry(void); - bool initWithRefID(int refID, ccTime fInterval, bool bPaused); - - CCTimer* m_timer; - bool m_paused; - int m_refID; - int m_handle; - bool m_isMarkDeleted; - }; -} - -#endif // __CC_LUA_SUPPORT_