diff --git a/CHANGELOG.REMOVED.git-id b/CHANGELOG.REMOVED.git-id index 45fe9fdf87..5ca6d51e19 100644 --- a/CHANGELOG.REMOVED.git-id +++ b/CHANGELOG.REMOVED.git-id @@ -1 +1 @@ -780fb6720d1919356d3fac951ed0f86cfb85c6bd \ No newline at end of file +727d9ca089cf00365014b23ae2cf63341316ba7d \ No newline at end of file diff --git a/cocos/physics/CCPhysicsContact.cpp b/cocos/physics/CCPhysicsContact.cpp index 0f5967f9a7..f1ea5d5478 100644 --- a/cocos/physics/CCPhysicsContact.cpp +++ b/cocos/physics/CCPhysicsContact.cpp @@ -44,11 +44,11 @@ PhysicsContact::PhysicsContact() , _eventCode(EventCode::NONE) , _info(nullptr) , _notificationEnable(true) -, _begin(false) , _result(true) , _data(nullptr) , _contactInfo(nullptr) , _contactData(nullptr) +, _preContactData(nullptr) { } @@ -57,6 +57,7 @@ PhysicsContact::~PhysicsContact() { CC_SAFE_DELETE(_info); CC_SAFE_DELETE(_contactData); + CC_SAFE_DELETE(_preContactData); } PhysicsContact* PhysicsContact::construct(PhysicsShape* a, PhysicsShape* b) @@ -96,7 +97,8 @@ void PhysicsContact::generateContactData() } cpArbiter* arb = static_cast(_contactInfo); - CC_SAFE_DELETE(_contactData); + CC_SAFE_DELETE(_preContactData); + _preContactData = _contactData; _contactData = new PhysicsContactData(); _contactData->count = cpArbiterGetCount(arb); for (int i=0; i<_contactData->count && igetShapeA(), contact->getShapeB())) { - contact->_begin = true; contact->generateContactData(); ret = onContactBegin(*contact); } @@ -232,8 +231,7 @@ void EventListenerPhysicsContact::onEvent(EventCustom* event) if (onContactPreSolve != nullptr && hitTest(contact->getShapeA(), contact->getShapeB())) { - PhysicsContactPreSolve solve(contact->_begin ? nullptr : contact->_contactData, contact->_contactInfo); - contact->_begin = false; + PhysicsContactPreSolve solve(contact->_contactInfo); contact->generateContactData(); ret = onContactPreSolve(*contact, solve); diff --git a/cocos/physics/CCPhysicsContact.h b/cocos/physics/CCPhysicsContact.h index c6b574fca8..2ead410803 100644 --- a/cocos/physics/CCPhysicsContact.h +++ b/cocos/physics/CCPhysicsContact.h @@ -78,6 +78,8 @@ public: inline PhysicsShape* getShapeB() const { return _shapeB; } /** get contact data */ inline const PhysicsContactData* getContactData() const { return _contactData; } + /** get previous contact data */ + inline const PhysicsContactData* getPreContactData() const { return _preContactData; } /** get data. */ inline void* getData() const { return _data; } /** @@ -112,12 +114,12 @@ private: EventCode _eventCode; PhysicsContactInfo* _info; bool _notificationEnable; - bool _begin; bool _result; void* _data; void* _contactInfo; PhysicsContactData* _contactData; + PhysicsContactData* _preContactData; friend class EventListenerPhysicsContact; friend class PhysicsWorldCallback; @@ -146,14 +148,10 @@ public: void ignore(); private: - PhysicsContactPreSolve(PhysicsContactData* data, void* contactInfo); + PhysicsContactPreSolve(void* contactInfo); ~PhysicsContactPreSolve(); private: - float _elasticity; - float _friction; - Point _surfaceVelocity; - PhysicsContactData* _preContactData; void* _contactInfo; friend class EventListenerPhysicsContact; diff --git a/cocos/scripting/lua-bindings/auto/api/PhysicsContact.lua b/cocos/scripting/lua-bindings/auto/api/PhysicsContact.lua index ae4cd514c0..5bbe33c633 100644 --- a/cocos/scripting/lua-bindings/auto/api/PhysicsContact.lua +++ b/cocos/scripting/lua-bindings/auto/api/PhysicsContact.lua @@ -11,6 +11,11 @@ -- @param self -- @return PhysicsContact::EventCode#PhysicsContact::EventCode ret (return value: cc.PhysicsContact::EventCode) +-------------------------------- +-- @function [parent=#PhysicsContact] getPreContactData +-- @param self +-- @return PhysicsContactData#PhysicsContactData ret (return value: cc.PhysicsContactData) + -------------------------------- -- @function [parent=#PhysicsContact] getShapeA -- @param self diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp.REMOVED.git-id b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp.REMOVED.git-id index fc065ab321..d8a7787694 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp.REMOVED.git-id +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.cpp.REMOVED.git-id @@ -1 +1 @@ -6f6bb7571ab92f9757a753c243a5061fd64a3fbd \ No newline at end of file +9ee0235aac42ea657853d56947716b3fc8fee2c2 \ No newline at end of file diff --git a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.hpp b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.hpp index 3f9e257c26..58175d4bf4 100644 --- a/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.hpp +++ b/cocos/scripting/lua-bindings/auto/lua_cocos2dx_physics_auto.hpp @@ -261,6 +261,7 @@ int register_all_cocos2dx_physics(lua_State* tolua_S); + #endif // __cocos2dx_physics_h__ diff --git a/setup.py b/setup.py index 45d275b6b6..11f90fe908 100755 --- a/setup.py +++ b/setup.py @@ -277,26 +277,6 @@ class SetEnvVar(object): else: return False - def _is_ant_exists(self): - - try: - os.environ[ANT_ROOT] - return True - except Exception: - pass - - ant_found = False - commands = ['ant', '-version'] - child = subprocess.Popen(commands, stdout=subprocess.PIPE) - for line in child.stdout: - if 'Ant' in line: - ant_found = True - break - - child.wait() - - return ant_found - def _is_ant_root_valid(self, ant_root): ant_path = '' @@ -391,7 +371,7 @@ class SetEnvVar(object): print "" print '-> Looking for ANT_ROOT envrironment variable...', ant_root_added = False - ant_found = self._is_ant_exists() + ant_found = self._find_environment_variable(ANT_ROOT) if not ant_root and not ant_found: print 'NOT FOUND' @@ -427,7 +407,12 @@ class SetEnvVar(object): if ant_root_added: print '\tANT_ROOT was added into %s' % target else: - print '\nCOCOS_CONSOLE_ROOT was already added. Edit "%s" for manual changes' % target + print '\nCOCOS_CONSOLE_ROOT was already added. Edit "%s" for manual changes' % target + + if self._isWindows(): + print '\nPlease restart the terminal to make added system variables take effect' + else: + print '\nPlease execute command: "source %s" to make added system variables take effect' % target if __name__ == '__main__': parser = OptionParser() diff --git a/tools/jenkins-scripts/job-comment-trigger.py b/tools/jenkins-scripts/job-comment-trigger.py index bd478d4386..5d1bfd1493 100644 --- a/tools/jenkins-scripts/job-comment-trigger.py +++ b/tools/jenkins-scripts/job-comment-trigger.py @@ -14,6 +14,12 @@ def main(): #parse to json obj payload = json.loads(payload_str) + issue = payload['issue'] + #get pull number + pr_num = issue['number'] + print 'pr_num:' + str(pr_num) + payload_forword = {"number":pr_num} + comment = payload['comment'] #get comment body comment_body = comment['body'] @@ -23,12 +29,6 @@ def main(): if result is None: print 'skip build for pull request #' + str(pr_num) return(0) - - issue = payload['issue'] - #get pull number - pr_num = issue['number'] - print 'pr_num:' + str(pr_num) - payload_forword = {"number":pr_num} #build for pull request action 'open' and 'synchronize', skip 'close' action = issue['state']