Commit Graph

27 Commits

Author SHA1 Message Date
samuele3 3edeba5001 Merge branch 'develop' of git://github.com/cocos2d/cocos2d-x into bug_fix 2014-03-05 09:52:37 +08:00
samuele3 53851151d9 fix:TimerScriptHandler can’t do anything in the `cancel` function 2014-03-05 09:51:57 +08:00
bmanGH d0f8dbd4be Fix Timer::cancel always call Director::getInstance()->getScheduler() even in another Scheduler; 2014-03-03 19:12:59 +08:00
James Chen 757425c54b issue #4165: Scheduler::scheduleCallback -> Scheduler::schedule, Scheduler::scheduleSelector -> Scheduler::schedule. APIs are clear for c++ developers now. 2014-03-03 11:00:30 +08:00
James Chen dceb047ba6 TimerTargetCallback::initWithLambda -> TimerTargetCallback::initWithCallback. 2014-03-02 18:43:17 +08:00
James Chen e6d2c4ec73 Refactors Scheduler class.
* Timer is an abstract class now.
* Adds three new timers ( `TimerTargetSelector`, `TimerTargetCallback`, `TimerScriptHandler`) which are inherited from Timer.
* Adds new API 'scheduleCallback` / `unscheduleCallbackForKey', and callback's target could be any classes since we're using `void*` to identify target.
* `Scheduler::scheduleCallback` use `std::function`, therefore, it supports passing `lambda`, `member_function` and `global_function`.
* The old selector API is still kept since it's very useful when schedule callback is a member function, it doesn't need a `key` to identify the callback function. (+1 squashed commit)
* Adds relevant test cases.
2014-03-01 14:09:09 +08:00
Dhilan007 387bd544bf closed issue#4123:fixed thread deadlock if new functions are added in callback. 2014-02-24 21:08:05 +08:00
James Chen 0d8846d876 closed #4097: Adds a macro to disable inserting script binding relevant codes. 2014-02-20 16:40:46 +08:00
James Chen e3d14608df issue #4058: Uses 'void*' instead of 'Ref*' as target of Scheduler. Any class could response scheduler callback now. 2014-02-20 14:11:47 +08:00
James Chen 2c5f791e03 issue #4058: Scheduler:: scheduleUpdateForTarget is a template function now. And it works perfect. 2014-02-20 11:57:04 +08:00
James Chen 5e6130c92c issue #4058: Get rid of Object ,rename it to Ref. 2014-02-20 10:53:49 +08:00
walzer 64af0de648 update copyrights for 2014, in cocos/2d/ folder 2014-01-07 11:25:07 +08:00
Ricardo Quesada 59fee6b8d2 replaces std::for_each with for()
replaces `std::for_each` with C++11 `for( : )`
2013-12-19 13:34:41 -08:00
boyu0 e07c4ffec1 Change NULL to nullptr, edit hungarian notation. 2013-12-18 17:47:20 +08:00
James Chen d16fa07661 Removes Vector<T>::forEach, please use std::for_each instead. The same as Vector<T>::sort. 2013-12-17 17:45:29 +08:00
minggo 1e9c763b40 use ssize_t for index and capacity 2013-12-12 14:48:26 +08:00
James Chen cc567a3077 issue #2790: Vector::remove —> Vector::erase. 2013-12-11 18:08:06 +08:00
boyu0 083a0eea2a Remove all std::move in function returns. 2013-12-10 16:06:05 +08:00
James Chen 6b0589679b issue #2790: Vector<SchedulerScriptHandlerEntry*> instead of CCArray* in CCScheduler 2013-12-07 14:25:24 +08:00
James Chen 6cd573fa7f issue #2790: Deprecates CCSet. 2013-12-06 18:16:58 +08:00
Ricardo Quesada 73321199b9 Console: commands receives the char*
The char* is passed in case the commands
need to sub-parse the arguments.
Very useful for QA.
For example, the could create a command called "click", and the command could
receive arguments.
2013-12-04 21:51:08 -08:00
Ricardo Quesada 2f1dffe46b Adds performFunctionInCocos2dThread
... in Scheduler
2013-11-26 16:58:14 -08:00
minggo 982a23af3d fix some hungarial 2013-11-16 21:08:00 +08:00
James Chen 55cf30b7c8 HASH_FIND_INT —> HASH_FIND_PTR for CCAcitonManager.cpp and CCScheduler.cpp. 2013-11-11 14:36:43 +08:00
boyu0 6c1144ee79 issue #2770: fix some warning 2013-11-11 12:49:38 +08:00
minggo 95acb1b9e3 issue #2905: helloworld build ok on android 2013-10-14 14:01:00 +08:00
minggo 4313c46e93 issue #2905:adjust folder structure 2013-10-12 11:22:05 +08:00