mirror of https://github.com/axmolengine/axmol.git
Merge branch 'develop' of https://github.com/chuanweizhang2013/cocos2d-x into develop
This commit is contained in:
commit
2094d4cbfd
|
@ -1 +1 @@
|
||||||
780fb6720d1919356d3fac951ed0f86cfb85c6bd
|
727d9ca089cf00365014b23ae2cf63341316ba7d
|
|
@ -44,11 +44,11 @@ PhysicsContact::PhysicsContact()
|
||||||
, _eventCode(EventCode::NONE)
|
, _eventCode(EventCode::NONE)
|
||||||
, _info(nullptr)
|
, _info(nullptr)
|
||||||
, _notificationEnable(true)
|
, _notificationEnable(true)
|
||||||
, _begin(false)
|
|
||||||
, _result(true)
|
, _result(true)
|
||||||
, _data(nullptr)
|
, _data(nullptr)
|
||||||
, _contactInfo(nullptr)
|
, _contactInfo(nullptr)
|
||||||
, _contactData(nullptr)
|
, _contactData(nullptr)
|
||||||
|
, _preContactData(nullptr)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -57,6 +57,7 @@ PhysicsContact::~PhysicsContact()
|
||||||
{
|
{
|
||||||
CC_SAFE_DELETE(_info);
|
CC_SAFE_DELETE(_info);
|
||||||
CC_SAFE_DELETE(_contactData);
|
CC_SAFE_DELETE(_contactData);
|
||||||
|
CC_SAFE_DELETE(_preContactData);
|
||||||
}
|
}
|
||||||
|
|
||||||
PhysicsContact* PhysicsContact::construct(PhysicsShape* a, PhysicsShape* b)
|
PhysicsContact* PhysicsContact::construct(PhysicsShape* a, PhysicsShape* b)
|
||||||
|
@ -96,7 +97,8 @@ void PhysicsContact::generateContactData()
|
||||||
}
|
}
|
||||||
|
|
||||||
cpArbiter* arb = static_cast<cpArbiter*>(_contactInfo);
|
cpArbiter* arb = static_cast<cpArbiter*>(_contactInfo);
|
||||||
CC_SAFE_DELETE(_contactData);
|
CC_SAFE_DELETE(_preContactData);
|
||||||
|
_preContactData = _contactData;
|
||||||
_contactData = new PhysicsContactData();
|
_contactData = new PhysicsContactData();
|
||||||
_contactData->count = cpArbiterGetCount(arb);
|
_contactData->count = cpArbiterGetCount(arb);
|
||||||
for (int i=0; i<_contactData->count && i<PhysicsContactData::POINT_MAX; ++i)
|
for (int i=0; i<_contactData->count && i<PhysicsContactData::POINT_MAX; ++i)
|
||||||
|
@ -108,15 +110,13 @@ void PhysicsContact::generateContactData()
|
||||||
}
|
}
|
||||||
|
|
||||||
// PhysicsContactPreSolve implementation
|
// PhysicsContactPreSolve implementation
|
||||||
PhysicsContactPreSolve::PhysicsContactPreSolve(PhysicsContactData* data, void* contactInfo)
|
PhysicsContactPreSolve::PhysicsContactPreSolve(void* contactInfo)
|
||||||
: _preContactData(data)
|
: _contactInfo(contactInfo)
|
||||||
, _contactInfo(contactInfo)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
PhysicsContactPreSolve::~PhysicsContactPreSolve()
|
PhysicsContactPreSolve::~PhysicsContactPreSolve()
|
||||||
{
|
{
|
||||||
CC_SAFE_DELETE(_preContactData);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
float PhysicsContactPreSolve::getRestitution() const
|
float PhysicsContactPreSolve::getRestitution() const
|
||||||
|
@ -217,7 +217,6 @@ void EventListenerPhysicsContact::onEvent(EventCustom* event)
|
||||||
if (onContactBegin != nullptr
|
if (onContactBegin != nullptr
|
||||||
&& hitTest(contact->getShapeA(), contact->getShapeB()))
|
&& hitTest(contact->getShapeA(), contact->getShapeB()))
|
||||||
{
|
{
|
||||||
contact->_begin = true;
|
|
||||||
contact->generateContactData();
|
contact->generateContactData();
|
||||||
ret = onContactBegin(*contact);
|
ret = onContactBegin(*contact);
|
||||||
}
|
}
|
||||||
|
@ -232,8 +231,7 @@ void EventListenerPhysicsContact::onEvent(EventCustom* event)
|
||||||
if (onContactPreSolve != nullptr
|
if (onContactPreSolve != nullptr
|
||||||
&& hitTest(contact->getShapeA(), contact->getShapeB()))
|
&& hitTest(contact->getShapeA(), contact->getShapeB()))
|
||||||
{
|
{
|
||||||
PhysicsContactPreSolve solve(contact->_begin ? nullptr : contact->_contactData, contact->_contactInfo);
|
PhysicsContactPreSolve solve(contact->_contactInfo);
|
||||||
contact->_begin = false;
|
|
||||||
contact->generateContactData();
|
contact->generateContactData();
|
||||||
|
|
||||||
ret = onContactPreSolve(*contact, solve);
|
ret = onContactPreSolve(*contact, solve);
|
||||||
|
|
|
@ -78,6 +78,8 @@ public:
|
||||||
inline PhysicsShape* getShapeB() const { return _shapeB; }
|
inline PhysicsShape* getShapeB() const { return _shapeB; }
|
||||||
/** get contact data */
|
/** get contact data */
|
||||||
inline const PhysicsContactData* getContactData() const { return _contactData; }
|
inline const PhysicsContactData* getContactData() const { return _contactData; }
|
||||||
|
/** get previous contact data */
|
||||||
|
inline const PhysicsContactData* getPreContactData() const { return _preContactData; }
|
||||||
/** get data. */
|
/** get data. */
|
||||||
inline void* getData() const { return _data; }
|
inline void* getData() const { return _data; }
|
||||||
/**
|
/**
|
||||||
|
@ -112,12 +114,12 @@ private:
|
||||||
EventCode _eventCode;
|
EventCode _eventCode;
|
||||||
PhysicsContactInfo* _info;
|
PhysicsContactInfo* _info;
|
||||||
bool _notificationEnable;
|
bool _notificationEnable;
|
||||||
bool _begin;
|
|
||||||
bool _result;
|
bool _result;
|
||||||
|
|
||||||
void* _data;
|
void* _data;
|
||||||
void* _contactInfo;
|
void* _contactInfo;
|
||||||
PhysicsContactData* _contactData;
|
PhysicsContactData* _contactData;
|
||||||
|
PhysicsContactData* _preContactData;
|
||||||
|
|
||||||
friend class EventListenerPhysicsContact;
|
friend class EventListenerPhysicsContact;
|
||||||
friend class PhysicsWorldCallback;
|
friend class PhysicsWorldCallback;
|
||||||
|
@ -146,14 +148,10 @@ public:
|
||||||
void ignore();
|
void ignore();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PhysicsContactPreSolve(PhysicsContactData* data, void* contactInfo);
|
PhysicsContactPreSolve(void* contactInfo);
|
||||||
~PhysicsContactPreSolve();
|
~PhysicsContactPreSolve();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
float _elasticity;
|
|
||||||
float _friction;
|
|
||||||
Point _surfaceVelocity;
|
|
||||||
PhysicsContactData* _preContactData;
|
|
||||||
void* _contactInfo;
|
void* _contactInfo;
|
||||||
|
|
||||||
friend class EventListenerPhysicsContact;
|
friend class EventListenerPhysicsContact;
|
||||||
|
|
|
@ -11,6 +11,11 @@
|
||||||
-- @param self
|
-- @param self
|
||||||
-- @return PhysicsContact::EventCode#PhysicsContact::EventCode ret (return value: cc.PhysicsContact::EventCode)
|
-- @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
|
-- @function [parent=#PhysicsContact] getShapeA
|
||||||
-- @param self
|
-- @param self
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
6f6bb7571ab92f9757a753c243a5061fd64a3fbd
|
9ee0235aac42ea657853d56947716b3fc8fee2c2
|
|
@ -261,6 +261,7 @@ int register_all_cocos2dx_physics(lua_State* tolua_S);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // __cocos2dx_physics_h__
|
#endif // __cocos2dx_physics_h__
|
||||||
|
|
29
setup.py
29
setup.py
|
@ -277,26 +277,6 @@ class SetEnvVar(object):
|
||||||
else:
|
else:
|
||||||
return False
|
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):
|
def _is_ant_root_valid(self, ant_root):
|
||||||
|
|
||||||
ant_path = ''
|
ant_path = ''
|
||||||
|
@ -391,7 +371,7 @@ class SetEnvVar(object):
|
||||||
print ""
|
print ""
|
||||||
print '-> Looking for ANT_ROOT envrironment variable...',
|
print '-> Looking for ANT_ROOT envrironment variable...',
|
||||||
ant_root_added = False
|
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:
|
if not ant_root and not ant_found:
|
||||||
print 'NOT FOUND'
|
print 'NOT FOUND'
|
||||||
|
@ -427,7 +407,12 @@ class SetEnvVar(object):
|
||||||
if ant_root_added:
|
if ant_root_added:
|
||||||
print '\tANT_ROOT was added into %s' % target
|
print '\tANT_ROOT was added into %s' % target
|
||||||
else:
|
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__':
|
if __name__ == '__main__':
|
||||||
parser = OptionParser()
|
parser = OptionParser()
|
||||||
|
|
|
@ -14,6 +14,12 @@ def main():
|
||||||
#parse to json obj
|
#parse to json obj
|
||||||
payload = json.loads(payload_str)
|
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']
|
comment = payload['comment']
|
||||||
#get comment body
|
#get comment body
|
||||||
comment_body = comment['body']
|
comment_body = comment['body']
|
||||||
|
@ -23,12 +29,6 @@ def main():
|
||||||
if result is None:
|
if result is None:
|
||||||
print 'skip build for pull request #' + str(pr_num)
|
print 'skip build for pull request #' + str(pr_num)
|
||||||
return(0)
|
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'
|
#build for pull request action 'open' and 'synchronize', skip 'close'
|
||||||
action = issue['state']
|
action = issue['state']
|
||||||
|
|
Loading…
Reference in New Issue