mirror of https://github.com/axmolengine/axmol.git
Merge branch 'develop' of https://github.com/cocos2d/cocos2d-x into iss2433-lua-bindings-generator
Conflicts: scripting/lua/cocos2dx_support/generated/lua_cocos2dx_auto.cpp scripting/lua/cocos2dx_support/generated/lua_cocos2dx_auto.hpp scripting/lua/cocos2dx_support/generated/lua_cocos2dx_auto_api.js
This commit is contained in:
commit
1dabab2ca5
|
@ -89,6 +89,7 @@ projects/
|
|||
tools/tojs/user.cfg
|
||||
# ... userconf.ini generated if running from tools/tojs
|
||||
tools/tojs/userconf.ini
|
||||
tools/tolua/userconf.ini
|
||||
# ... userconf.ini generated if running from tools/jenkins_scripts/mac/android/
|
||||
tools/jenkins_scripts/mac/android/userconf.ini
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
path = tools/bindings-generator
|
||||
url = git://github.com/cocos2d/bindings-generator.git
|
||||
[submodule "scripting/javascript/bindings/generated"]
|
||||
path = scripting/javascript/bindings/generated
|
||||
path = scripting/auto-generated
|
||||
url = git://github.com/folecr/cocos2dx-autogen-bindings.git
|
||||
[submodule "samples/Javascript/Shared"]
|
||||
path = samples/Javascript/Shared
|
||||
|
|
|
@ -1 +1 @@
|
|||
027d1d69c91552623e04c46fd002c5976c4bb40c
|
||||
dcaf07070ad651b671d721564b6d1aa99ea03d0b
|
|
@ -24,8 +24,13 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
#include "cocoa/CCString.h"
|
||||
|
||||
#include "CCNode.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "cocoa/CCString.h"
|
||||
#include "support/data_support/ccCArray.h"
|
||||
#include "support/TransformUtils.h"
|
||||
#include "CCCamera.h"
|
||||
#include "effects/CCGrid.h"
|
||||
|
@ -35,6 +40,7 @@ THE SOFTWARE.
|
|||
#include "actions/CCActionManager.h"
|
||||
#include "script_support/CCScriptSupport.h"
|
||||
#include "shaders/CCGLProgram.h"
|
||||
|
||||
// externals
|
||||
#include "kazmath/GL/matrix.h"
|
||||
#include "support/component/CCComponent.h"
|
||||
|
@ -63,9 +69,9 @@ Node::Node(void)
|
|||
, _anchorPointInPoints(Point::ZERO)
|
||||
, _anchorPoint(Point::ZERO)
|
||||
, _contentSize(Size::ZERO)
|
||||
, _additionalTransform(AffineTransformMakeIdentity())
|
||||
, _transform(AffineTransformMakeIdentity())
|
||||
, _inverse(AffineTransformMakeIdentity())
|
||||
, _additionalTransform(AffineTransform::IDENTITY)
|
||||
, _transform(AffineTransform::IDENTITY)
|
||||
, _inverse(AffineTransform::IDENTITY)
|
||||
, _additionalTransformDirty(false)
|
||||
, _transformDirty(true)
|
||||
, _inverseDirty(true)
|
||||
|
@ -607,10 +613,14 @@ void Node::removeChild(Node* child, bool cleanup /* = true */)
|
|||
return;
|
||||
}
|
||||
|
||||
if ( _children->containsObject(child) )
|
||||
{
|
||||
this->detachChild(child,cleanup);
|
||||
}
|
||||
// if ( _children->containsObject(child) )
|
||||
// {
|
||||
// this->detachChild(child,cleanup);
|
||||
// }
|
||||
|
||||
int index = _children->getIndexOfObject(child);
|
||||
if( index != CC_INVALID_INDEX )
|
||||
this->detachChild( child, index, cleanup );
|
||||
}
|
||||
|
||||
void Node::removeChildByTag(int tag, bool cleanup/* = true */)
|
||||
|
@ -668,7 +678,7 @@ void Node::removeAllChildrenWithCleanup(bool cleanup)
|
|||
|
||||
}
|
||||
|
||||
void Node::detachChild(Node *child, bool doCleanup)
|
||||
void Node::detachChild(Node *child, int childIndex, bool doCleanup)
|
||||
{
|
||||
// IMPORTANT:
|
||||
// -1st do onExit
|
||||
|
@ -689,7 +699,7 @@ void Node::detachChild(Node *child, bool doCleanup)
|
|||
// set parent nil at the end
|
||||
child->setParent(NULL);
|
||||
|
||||
_children->removeObject(child);
|
||||
_children->removeObjectAtIndex(childIndex);
|
||||
}
|
||||
|
||||
|
||||
|
@ -709,8 +719,33 @@ void Node::reorderChild(Node *child, int zOrder)
|
|||
child->_setZOrder(zOrder);
|
||||
}
|
||||
|
||||
#if CC_USE_ARRAY_VECTOR
|
||||
static bool objectComparisonLess(const RCPtr<Object>& pp1, const RCPtr<Object>& pp2)
|
||||
{
|
||||
Object *p1 = static_cast<Object*>(pp1);
|
||||
Object *p2 = static_cast<Object*>(pp2);
|
||||
Node *n1 = static_cast<Node*>(p1);
|
||||
Node *n2 = static_cast<Node*>(p2);
|
||||
|
||||
return( n1->getZOrder() < n2->getZOrder() ||
|
||||
( n1->getZOrder() == n2->getZOrder() && n1->getOrderOfArrival() < n2->getOrderOfArrival() )
|
||||
);
|
||||
}
|
||||
#else
|
||||
static bool objectComparisonLess(Object* p1, Object* p2)
|
||||
{
|
||||
Node *n1 = static_cast<Node*>(p1);
|
||||
Node *n2 = static_cast<Node*>(p2);
|
||||
|
||||
return( n1->getZOrder() < n2->getZOrder() ||
|
||||
( n1->getZOrder() == n2->getZOrder() && n1->getOrderOfArrival() < n2->getOrderOfArrival() )
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
void Node::sortAllChildren()
|
||||
{
|
||||
#if 0
|
||||
if (_reorderChildDirty)
|
||||
{
|
||||
int i,j,length = _children->count();
|
||||
|
@ -737,6 +772,12 @@ void Node::sortAllChildren()
|
|||
|
||||
_reorderChildDirty = false;
|
||||
}
|
||||
#else
|
||||
if( _reorderChildDirty ) {
|
||||
std::sort( std::begin(*_children), std::end(*_children), objectComparisonLess );
|
||||
_reorderChildDirty = false;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -1296,7 +1296,7 @@ public:
|
|||
virtual void removeAllComponents();
|
||||
/// @} end of component functions
|
||||
|
||||
private:
|
||||
protected:
|
||||
/// lazy allocs
|
||||
void childrenAlloc(void);
|
||||
|
||||
|
@ -1304,12 +1304,12 @@ private:
|
|||
void insertChild(Node* child, int z);
|
||||
|
||||
/// Removes a child, call child->onExit(), do cleanup, remove it from children array.
|
||||
void detachChild(Node *child, bool doCleanup);
|
||||
void detachChild(Node *child, int index, bool doCleanup);
|
||||
|
||||
/// Convert cocos2d coordinates to UI windows coordinate.
|
||||
Point convertToWindowSpace(const Point& nodePoint) const;
|
||||
|
||||
protected:
|
||||
|
||||
float _rotationX; ///< rotation angle on x-axis
|
||||
float _rotationY; ///< rotation angle on y-axis
|
||||
|
||||
|
|
|
@ -60,7 +60,7 @@ AffineTransform AffineTransformMakeIdentity()
|
|||
}
|
||||
|
||||
extern const AffineTransform AffineTransformIdentity = AffineTransformMakeIdentity();
|
||||
|
||||
const AffineTransform AffineTransform::IDENTITY = AffineTransformMakeIdentity();
|
||||
|
||||
Rect RectApplyAffineTransform(const Rect& rect, const AffineTransform& anAffineTransform)
|
||||
{
|
||||
|
|
|
@ -31,8 +31,10 @@ THE SOFTWARE.
|
|||
NS_CC_BEGIN
|
||||
|
||||
struct AffineTransform {
|
||||
float a, b, c, d;
|
||||
float tx, ty;
|
||||
float a, b, c, d;
|
||||
float tx, ty;
|
||||
|
||||
static const AffineTransform IDENTITY;
|
||||
};
|
||||
|
||||
CC_DLL AffineTransform __CCAffineTransformMake(float a, float b, float c, float d, float tx, float ty);
|
||||
|
|
|
@ -42,17 +42,11 @@ Array::Array()
|
|||
init();
|
||||
}
|
||||
|
||||
Array::Array(unsigned int capacity)
|
||||
: data(NULL)
|
||||
{
|
||||
initWithCapacity(capacity);
|
||||
}
|
||||
|
||||
Array* Array::create()
|
||||
{
|
||||
Array* array = new Array();
|
||||
|
||||
if (array && array->init())
|
||||
if (array && array->initWithCapacity(7))
|
||||
{
|
||||
array->autorelease();
|
||||
}
|
||||
|
@ -111,7 +105,7 @@ Array* Array::createWithArray(Array* otherArray)
|
|||
return otherArray->clone();
|
||||
}
|
||||
|
||||
Array* Array::createWithCapacity(unsigned int capacity)
|
||||
Array* Array::createWithCapacity(int capacity)
|
||||
{
|
||||
Array* array = new Array();
|
||||
|
||||
|
@ -132,7 +126,7 @@ Array* Array::createWithContentsOfFile(const char* fileName)
|
|||
Array* ret = Array::createWithContentsOfFileThreadSafe(fileName);
|
||||
if (ret != nullptr)
|
||||
{
|
||||
pRet->autorelease();
|
||||
ret->autorelease();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
@ -144,12 +138,12 @@ Array* Array::createWithContentsOfFileThreadSafe(const char* fileName)
|
|||
|
||||
bool Array::init()
|
||||
{
|
||||
return initWithCapacity(10);
|
||||
return initWithCapacity(7);
|
||||
}
|
||||
|
||||
bool Array::initWithObject(Object* object)
|
||||
{
|
||||
bool ret = initWithCapacity(1);
|
||||
bool ret = initWithCapacity(7);
|
||||
if (ret)
|
||||
{
|
||||
addObject(object);
|
||||
|
@ -186,7 +180,7 @@ bool Array::initWithObjects(Object* object, ...)
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool Array::initWithCapacity(unsigned int capacity)
|
||||
bool Array::initWithCapacity(int capacity)
|
||||
{
|
||||
data.reserve(capacity);
|
||||
return true;
|
||||
|
@ -240,7 +234,7 @@ bool Array::containsObject(Object* object) const
|
|||
|
||||
bool Array::isEqualToArray(Array* otherArray)
|
||||
{
|
||||
for (unsigned int i = 0; i< this->count(); i++)
|
||||
for (int i = 0; i< this->count(); i++)
|
||||
{
|
||||
if (!this->getObjectAtIndex(i)->isEqual(otherArray->getObjectAtIndex(i)))
|
||||
{
|
||||
|
@ -278,18 +272,10 @@ void Array::removeLastObject(bool releaseObj)
|
|||
|
||||
void Array::removeObject(Object* object, bool releaseObj /* ignored */)
|
||||
{
|
||||
auto it = data.begin();
|
||||
for (; it != data.end(); ++it)
|
||||
{
|
||||
if (it->get() == object)
|
||||
{
|
||||
data.erase(it);
|
||||
break;
|
||||
}
|
||||
}
|
||||
data.erase( std::remove( data.begin(), data.end(), object ) );
|
||||
}
|
||||
|
||||
void Array::removeObjectAtIndex(unsigned int index, bool releaseObj /* ignored */)
|
||||
void Array::removeObjectAtIndex(int index, bool releaseObj /* ignored */)
|
||||
{
|
||||
auto obj = data[index];
|
||||
data.erase( data.begin() + index );
|
||||
|
@ -305,7 +291,7 @@ void Array::removeAllObjects()
|
|||
data.erase(std::begin(data), std::end(data));
|
||||
}
|
||||
|
||||
void Array::fastRemoveObjectAtIndex(unsigned int index)
|
||||
void Array::fastRemoveObjectAtIndex(int index)
|
||||
{
|
||||
removeObjectAtIndex(index);
|
||||
}
|
||||
|
@ -325,12 +311,12 @@ void Array::exchangeObject(Object* object1, Object* object2)
|
|||
std::swap( data[idx1], data[idx2] );
|
||||
}
|
||||
|
||||
void Array::exchangeObjectAtIndex(unsigned int index1, unsigned int index2)
|
||||
void Array::exchangeObjectAtIndex(int index1, int index2)
|
||||
{
|
||||
std::swap( data[index1], data[index2] );
|
||||
}
|
||||
|
||||
void Array::replaceObjectAtIndex(unsigned int index, Object* object, bool releaseObject /* ignored */)
|
||||
void Array::replaceObjectAtIndex(int index, Object* object, bool releaseObject /* ignored */)
|
||||
{
|
||||
data[index] = object;
|
||||
}
|
||||
|
@ -399,7 +385,7 @@ Array* Array::create()
|
|||
{
|
||||
Array* array = new Array();
|
||||
|
||||
if (array && array->init())
|
||||
if (array && array->initWithCapacity(7))
|
||||
{
|
||||
array->autorelease();
|
||||
}
|
||||
|
@ -458,7 +444,7 @@ Array* Array::createWithArray(Array* otherArray)
|
|||
return otherArray->clone();
|
||||
}
|
||||
|
||||
Array* Array::createWithCapacity(unsigned int capacity)
|
||||
Array* Array::createWithCapacity(int capacity)
|
||||
{
|
||||
Array* array = new Array();
|
||||
|
||||
|
@ -493,14 +479,14 @@ bool Array::init()
|
|||
{
|
||||
CCASSERT(!data, "Array cannot be re-initialized");
|
||||
|
||||
return initWithCapacity(1);
|
||||
return initWithCapacity(7);
|
||||
}
|
||||
|
||||
bool Array::initWithObject(Object* object)
|
||||
{
|
||||
CCASSERT(!data, "Array cannot be re-initialized");
|
||||
|
||||
bool ret = initWithCapacity(1);
|
||||
bool ret = initWithCapacity(7);
|
||||
if (ret)
|
||||
{
|
||||
addObject(object);
|
||||
|
@ -539,7 +525,7 @@ bool Array::initWithObjects(Object* object, ...)
|
|||
return ret;
|
||||
}
|
||||
|
||||
bool Array::initWithCapacity(unsigned int capacity)
|
||||
bool Array::initWithCapacity(int capacity)
|
||||
{
|
||||
CCASSERT(!data, "Array cannot be re-initialized");
|
||||
|
||||
|
@ -592,7 +578,7 @@ bool Array::containsObject(Object* object) const
|
|||
|
||||
bool Array::isEqualToArray(Array* otherArray)
|
||||
{
|
||||
for (unsigned int i = 0; i< this->count(); i++)
|
||||
for (int i = 0; i< this->count(); i++)
|
||||
{
|
||||
if (!this->getObjectAtIndex(i)->isEqual(otherArray->getObjectAtIndex(i)))
|
||||
{
|
||||
|
@ -643,7 +629,7 @@ void Array::removeObject(Object* object, bool releaseObj/* = true*/)
|
|||
ccArrayRemoveObject(data, object, releaseObj);
|
||||
}
|
||||
|
||||
void Array::removeObjectAtIndex(unsigned int index, bool releaseObj)
|
||||
void Array::removeObjectAtIndex(int index, bool releaseObj)
|
||||
{
|
||||
ccArrayRemoveObjectAtIndex(data, index, releaseObj);
|
||||
}
|
||||
|
@ -658,7 +644,7 @@ void Array::removeAllObjects()
|
|||
ccArrayRemoveAllObjects(data);
|
||||
}
|
||||
|
||||
void Array::fastRemoveObjectAtIndex(unsigned int index)
|
||||
void Array::fastRemoveObjectAtIndex(int index)
|
||||
{
|
||||
ccArrayFastRemoveObjectAtIndex(data, index);
|
||||
}
|
||||
|
@ -670,13 +656,13 @@ void Array::fastRemoveObject(Object* object)
|
|||
|
||||
void Array::exchangeObject(Object* object1, Object* object2)
|
||||
{
|
||||
unsigned int index1 = ccArrayGetIndexOfObject(data, object1);
|
||||
int index1 = ccArrayGetIndexOfObject(data, object1);
|
||||
if (index1 == UINT_MAX)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
unsigned int index2 = ccArrayGetIndexOfObject(data, object2);
|
||||
int index2 = ccArrayGetIndexOfObject(data, object2);
|
||||
if (index2 == UINT_MAX)
|
||||
{
|
||||
return;
|
||||
|
@ -685,12 +671,12 @@ void Array::exchangeObject(Object* object1, Object* object2)
|
|||
ccArraySwapObjectsAtIndexes(data, index1, index2);
|
||||
}
|
||||
|
||||
void Array::exchangeObjectAtIndex(unsigned int index1, unsigned int index2)
|
||||
void Array::exchangeObjectAtIndex(int index1, int index2)
|
||||
{
|
||||
ccArraySwapObjectsAtIndexes(data, index1, index2);
|
||||
}
|
||||
|
||||
void Array::replaceObjectAtIndex(unsigned int index, Object* object, bool releaseObject/* = true*/)
|
||||
void Array::replaceObjectAtIndex(int index, Object* object, bool releaseObject/* = true*/)
|
||||
{
|
||||
ccArrayInsertObjectAtIndex(data, object, index);
|
||||
ccArrayRemoveObjectAtIndex(data, index+1);
|
||||
|
@ -702,7 +688,7 @@ void Array::reverseObjects()
|
|||
{
|
||||
// floorf(), since in the case of an even number, the number of swaps stays the same
|
||||
int count = (int) floorf(data->num/2.f);
|
||||
unsigned int maxIndex = data->num - 1;
|
||||
int maxIndex = data->num - 1;
|
||||
|
||||
for (int i = 0; i < count ; i++)
|
||||
{
|
||||
|
|
|
@ -241,7 +241,7 @@ public:
|
|||
/** Create an array with one object */
|
||||
static Array* createWithObject(Object* object);
|
||||
/** Create an array with a default capacity */
|
||||
static Array* createWithCapacity(unsigned int capacity);
|
||||
static Array* createWithCapacity(int capacity);
|
||||
/** Create an array with from an existing array */
|
||||
static Array* createWithArray(Array* otherArray);
|
||||
/**
|
||||
|
@ -266,14 +266,14 @@ public:
|
|||
/** Initializes an array with some objects */
|
||||
bool initWithObjects(Object* object, ...) CC_REQUIRES_NULL_TERMINATION;
|
||||
/** Initializes an array with capacity */
|
||||
bool initWithCapacity(unsigned int capacity);
|
||||
bool initWithCapacity(int capacity);
|
||||
/** Initializes an array with an existing array */
|
||||
bool initWithArray(Array* otherArray);
|
||||
|
||||
// Querying an Array
|
||||
|
||||
/** Returns element count of the array */
|
||||
unsigned int count() const
|
||||
int count() const
|
||||
{
|
||||
#if CC_USE_ARRAY_VECTOR
|
||||
return data.size();
|
||||
|
@ -282,7 +282,7 @@ public:
|
|||
#endif
|
||||
}
|
||||
/** Returns capacity of the array */
|
||||
unsigned int capacity() const
|
||||
int capacity() const
|
||||
{
|
||||
#if CC_USE_ARRAY_VECTOR
|
||||
return data.capacity();
|
||||
|
@ -363,7 +363,7 @@ public:
|
|||
/** Remove a certain object */
|
||||
void removeObject(Object* object, bool releaseObj = true);
|
||||
/** Remove an element with a certain index */
|
||||
void removeObjectAtIndex(unsigned int index, bool releaseObj = true);
|
||||
void removeObjectAtIndex(int index, bool releaseObj = true);
|
||||
/** Remove all elements */
|
||||
void removeObjectsInArray(Array* otherArray);
|
||||
/** Remove all objects */
|
||||
|
@ -371,17 +371,17 @@ public:
|
|||
/** Fast way to remove a certain object */
|
||||
void fastRemoveObject(Object* object);
|
||||
/** Fast way to remove an element with a certain index */
|
||||
void fastRemoveObjectAtIndex(unsigned int index);
|
||||
void fastRemoveObjectAtIndex(int index);
|
||||
|
||||
// Rearranging Content
|
||||
|
||||
/** Swap two elements */
|
||||
void exchangeObject(Object* object1, Object* object2);
|
||||
/** Swap two elements with certain indexes */
|
||||
void exchangeObjectAtIndex(unsigned int index1, unsigned int index2);
|
||||
void exchangeObjectAtIndex(int index1, int index2);
|
||||
|
||||
/** Replace object at index with another object. */
|
||||
void replaceObjectAtIndex(unsigned int index, Object* object, bool releaseObject = true);
|
||||
void replaceObjectAtIndex(int index, Object* object, bool releaseObject = true);
|
||||
|
||||
/** Revers the array */
|
||||
void reverseObjects();
|
||||
|
|
|
@ -116,6 +116,42 @@ Point Point::rotateByAngle(const Point& pivot, float angle) const
|
|||
return pivot + (*this - pivot).rotate(Point::forAngle(angle));
|
||||
}
|
||||
|
||||
bool Point::isOneDemensionSegmentOverlap(float A, float B, float C, float D, float *S, float *E)
|
||||
{
|
||||
float ABmin = MIN(A, B);
|
||||
float ABmax = MAX(A, B);
|
||||
float CDmin = MIN(C, D);
|
||||
float CDmax = MAX(C, D);
|
||||
|
||||
if (ABmax < CDmin || CDmax < ABmin)
|
||||
{
|
||||
// ABmin->ABmax->CDmin->CDmax or CDmin->CDmax->ABmin->ABmax
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ABmin >= CDmin && ABmin <= CDmax)
|
||||
{
|
||||
// CDmin->ABmin->CDmax->ABmax or CDmin->ABmin->ABmax->CDmax
|
||||
if (S != nullptr) *S = ABmin;
|
||||
if (E != nullptr) *E = CDmax < ABmax ? CDmax : ABmax;
|
||||
}
|
||||
else if (ABmax >= CDmin && ABmax <= CDmax)
|
||||
{
|
||||
// ABmin->CDmin->ABmax->CDmax
|
||||
if (S != nullptr) *S = CDmin;
|
||||
if (E != nullptr) *E = ABmax;
|
||||
}
|
||||
else
|
||||
{
|
||||
// ABmin->CDmin->CDmax->ABmax
|
||||
if (S != nullptr) *S = CDmin;
|
||||
if (E != nullptr) *E = CDmax;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
bool Point::isLineIntersect(const Point& A, const Point& B,
|
||||
const Point& C, const Point& D,
|
||||
float *S, float *T)
|
||||
|
@ -125,49 +161,83 @@ bool Point::isLineIntersect(const Point& A, const Point& B,
|
|||
{
|
||||
return false;
|
||||
}
|
||||
const float BAx = B.x - A.x;
|
||||
const float BAy = B.y - A.y;
|
||||
const float DCx = D.x - C.x;
|
||||
const float DCy = D.y - C.y;
|
||||
const float ACx = A.x - C.x;
|
||||
const float ACy = A.y - C.y;
|
||||
|
||||
const float denom = DCy*BAx - DCx*BAy;
|
||||
|
||||
*S = DCx*ACy - DCy*ACx;
|
||||
*T = BAx*ACy - BAy*ACx;
|
||||
const float denom = crossProduct2Vector(A, B, C, D);
|
||||
|
||||
if (denom == 0)
|
||||
{
|
||||
if (*S == 0 || *T == 0)
|
||||
{
|
||||
// Lines incident
|
||||
return true;
|
||||
}
|
||||
// Lines parallel and not incident
|
||||
// Lines parallel or overlap
|
||||
return false;
|
||||
}
|
||||
|
||||
*S = *S / denom;
|
||||
*T = *T / denom;
|
||||
|
||||
// Point of intersection
|
||||
// CGPoint P;
|
||||
// P.x = A.x + *S * (B.x - A.x);
|
||||
// P.y = A.y + *S * (B.y - A.y);
|
||||
if (S != nullptr) *S = crossProduct2Vector(C, D, C, A) / denom;
|
||||
if (T != nullptr) *T = crossProduct2Vector(A, B, C, A) / denom;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Point::isLineParallel(const Point& A, const Point& B,
|
||||
const Point& C, const Point& D)
|
||||
{
|
||||
// FAIL: Line undefined
|
||||
if ( (A.x==B.x && A.y==B.y) || (C.x==D.x && C.y==D.y) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (crossProduct2Vector(A, B, C, D) == 0)
|
||||
{
|
||||
// line overlap
|
||||
if (crossProduct2Vector(C, D, C, A) == 0 || crossProduct2Vector(A, B, C, A) == 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Point::isLineOverlap(const Point& A, const Point& B,
|
||||
const Point& C, const Point& D)
|
||||
{
|
||||
// FAIL: Line undefined
|
||||
if ( (A.x==B.x && A.y==B.y) || (C.x==D.x && C.y==D.y) )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if (crossProduct2Vector(A, B, C, D) == 0 &&
|
||||
(crossProduct2Vector(C, D, C, A) == 0 || crossProduct2Vector(A, B, C, A) == 0))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Point::isSegmentOverlap(const Point& A, const Point& B, const Point& C, const Point& D, Point* S, Point* E)
|
||||
{
|
||||
|
||||
if (isLineOverlap(A, B, C, D))
|
||||
{
|
||||
return isOneDemensionSegmentOverlap(A.x, B.x, C.x, D.x, &S->x, &E->x) &&
|
||||
isOneDemensionSegmentOverlap(A.y, B.y, C.y, D.y, &S->y, &E->y);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Point::isSegmentIntersect(const Point& A, const Point& B, const Point& C, const Point& D)
|
||||
{
|
||||
float S, T;
|
||||
|
||||
if (isLineIntersect(A, B, C, D, &S, &T )&&
|
||||
(S >= 0.0f && S <= 1.0f && T >= 0.0f && T <= 1.0f))
|
||||
(S >= 0.0f && S <= 1.0f && T >= 0.0f && T <= 1.0f))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -262,7 +262,29 @@ public:
|
|||
*/
|
||||
static bool isLineIntersect(const Point& A, const Point& B,
|
||||
const Point& C, const Point& D,
|
||||
float *S, float *T);
|
||||
float *S = nullptr, float *T = nullptr);
|
||||
|
||||
/*
|
||||
returns true if Line A-B overlap with segment C-D
|
||||
@since v3.0
|
||||
*/
|
||||
static bool isLineOverlap(const Point& A, const Point& B,
|
||||
const Point& C, const Point& D);
|
||||
|
||||
/*
|
||||
returns true if Line A-B parallel with segment C-D
|
||||
@since v3.0
|
||||
*/
|
||||
static bool isLineParallel(const Point& A, const Point& B,
|
||||
const Point& C, const Point& D);
|
||||
|
||||
/*
|
||||
returns true if Segment A-B overlap with segment C-D
|
||||
@since v3.0
|
||||
*/
|
||||
static bool isSegmentOverlap(const Point& A, const Point& B,
|
||||
const Point& C, const Point& D,
|
||||
Point* S = nullptr, Point* E = nullptr);
|
||||
|
||||
/*
|
||||
returns true if Segment A-B intersects with segment C-D
|
||||
|
@ -277,6 +299,13 @@ public:
|
|||
static Point getIntersectPoint(const Point& A, const Point& B, const Point& C, const Point& D);
|
||||
|
||||
static const Point ZERO;
|
||||
|
||||
private:
|
||||
// returns true if segment A-B intersects with segment C-D. S->E is the ovderlap part
|
||||
static bool isOneDemensionSegmentOverlap(float A, float B, float C, float D, float *S, float * E);
|
||||
|
||||
// cross procuct of 2 vector. A->B X C->D
|
||||
static float crossProduct2Vector(const Point& A, const Point& B, const Point& C, const Point& D) { return (D.y - C.y) * (B.x - A.x) - (D.x - C.x) * (B.y - A.y); }
|
||||
};
|
||||
|
||||
class CC_DLL Size
|
||||
|
|
|
@ -64,24 +64,6 @@ Object::~Object()
|
|||
}
|
||||
}
|
||||
|
||||
void Object::release()
|
||||
{
|
||||
CCASSERT(_reference > 0, "reference count should greater than 0");
|
||||
--_reference;
|
||||
|
||||
if (_reference == 0)
|
||||
{
|
||||
delete this;
|
||||
}
|
||||
}
|
||||
|
||||
void Object::retain()
|
||||
{
|
||||
CCASSERT(_reference > 0, "reference count should greater than 0");
|
||||
|
||||
++_reference;
|
||||
}
|
||||
|
||||
Object* Object::autorelease()
|
||||
{
|
||||
PoolManager::sharedPoolManager()->addObject(this);
|
||||
|
|
|
@ -26,6 +26,7 @@ THE SOFTWARE.
|
|||
#define __CCOBJECT_H__
|
||||
|
||||
#include "cocoa/CCDataVisitor.h"
|
||||
#include "ccMacros.h"
|
||||
|
||||
#ifdef EMSCRIPTEN
|
||||
#include <GLES2/gl2.h>
|
||||
|
@ -93,7 +94,14 @@ public:
|
|||
*
|
||||
* @see retain, autorelease
|
||||
*/
|
||||
void release();
|
||||
inline void release()
|
||||
{
|
||||
CCASSERT(_reference > 0, "reference count should greater than 0");
|
||||
--_reference;
|
||||
|
||||
if (_reference == 0)
|
||||
delete this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Retains the ownership.
|
||||
|
@ -102,7 +110,11 @@ public:
|
|||
*
|
||||
* @see release, autorelease
|
||||
*/
|
||||
void retain();
|
||||
inline void retain()
|
||||
{
|
||||
CCASSERT(_reference > 0, "reference count should greater than 0");
|
||||
++_reference;
|
||||
}
|
||||
|
||||
/**
|
||||
* Release the ownership sometime soon automatically.
|
||||
|
|
|
@ -1073,6 +1073,19 @@ void LayerMultiplex::addLayer(Layer* layer)
|
|||
_layers->addObject(layer);
|
||||
}
|
||||
|
||||
bool LayerMultiplex::init()
|
||||
{
|
||||
if (Layer::init())
|
||||
{
|
||||
_layers = Array::create();
|
||||
_layers->retain();
|
||||
|
||||
_enabledLayer = 0;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool LayerMultiplex::initWithLayers(Layer *layer, va_list params)
|
||||
{
|
||||
if (Layer::init())
|
||||
|
|
|
@ -374,6 +374,7 @@ public:
|
|||
LayerMultiplex();
|
||||
virtual ~LayerMultiplex();
|
||||
|
||||
virtual bool init();
|
||||
/** initializes a MultiplexLayer with one or more layers using a variable argument list. */
|
||||
bool initWithLayers(Layer* layer, va_list params);
|
||||
|
||||
|
|
|
@ -786,7 +786,14 @@ void FileUtils::loadFilenameLookupDictionaryFromFile(const char* filename)
|
|||
|
||||
std::string FileUtils::getFullPathForDirectoryAndFilename(const std::string& strDirectory, const std::string& strFilename)
|
||||
{
|
||||
std::string ret = strDirectory+strFilename;
|
||||
// get directory+filename, safely adding '/' as necessary
|
||||
std::string ret = strDirectory;
|
||||
if (strDirectory.size() && strDirectory[strDirectory.size()-1] != '/'){
|
||||
ret += '/';
|
||||
}
|
||||
ret += strFilename;
|
||||
|
||||
// if the file doesn't exist, return an empty string
|
||||
if (!isFileExist(ret)) {
|
||||
ret = "";
|
||||
}
|
||||
|
|
|
@ -7,21 +7,19 @@ LOCAL_MODULE := cocos2dxandroid_static
|
|||
LOCAL_MODULE_FILENAME := libcocos2dandroid
|
||||
|
||||
LOCAL_SRC_FILES := \
|
||||
CCDevice.cpp \
|
||||
CCEGLView.cpp \
|
||||
CCAccelerometer.cpp \
|
||||
CCApplication.cpp \
|
||||
CCCommon.cpp \
|
||||
CCDevice.cpp \
|
||||
CCEGLView.cpp \
|
||||
CCFileUtilsAndroid.cpp \
|
||||
CCImage.cpp \
|
||||
nativeactivity.cpp \
|
||||
jni/DPIJni.cpp \
|
||||
jni/IMEJni.cpp \
|
||||
jni/Java_org_cocos2dx_lib_Cocos2dxBitmap.cpp \
|
||||
jni/Java_org_cocos2dx_lib_Cocos2dxHelper.cpp \
|
||||
jni/Java_org_cocos2dx_lib_Cocos2dxAccelerometer.cpp \
|
||||
jni/JniHelper.cpp \
|
||||
jni/IMEJni.cpp \
|
||||
jni/TouchesJni.cpp \
|
||||
jni/DPIJni.cpp
|
||||
jni/JniHelper.cpp
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
|
||||
|
||||
|
|
|
@ -1,109 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2013 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
package org.cocos2dx.lib;
|
||||
|
||||
import java.io.FileInputStream;
|
||||
import java.io.InputStream;
|
||||
import java.nio.ByteBuffer;
|
||||
import java.nio.ByteOrder;
|
||||
|
||||
import android.content.Context;
|
||||
import android.content.res.AssetManager;
|
||||
import android.opengl.ETC1Util;
|
||||
import android.util.Log;
|
||||
|
||||
public class Cocos2dxETCLoader {
|
||||
private static final String ASSETS_PATH = "assets/";
|
||||
private static Context context;
|
||||
|
||||
public static boolean loadTexture(String filePath) {
|
||||
if (! ETC1Util.isETC1Supported()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (filePath.length() == 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Create ETC1Texture
|
||||
InputStream inputStream = null;
|
||||
ETC1Util.ETC1Texture texture = null;
|
||||
AssetManager assetManager = null;
|
||||
try {
|
||||
if (filePath.charAt(0) == '/') {
|
||||
// absolute path
|
||||
inputStream = new FileInputStream(filePath);
|
||||
} else {
|
||||
// remove prefix: "assets/"
|
||||
if (filePath.startsWith(ASSETS_PATH)) {
|
||||
filePath = filePath.substring(ASSETS_PATH.length());
|
||||
}
|
||||
assetManager = context.getAssets();
|
||||
inputStream = assetManager.open(filePath);
|
||||
}
|
||||
|
||||
texture = ETC1Util.createTexture(inputStream);
|
||||
inputStream.close();
|
||||
} catch (Exception e) {
|
||||
Log.d("Cocos2dx", "Unable to create texture for " + filePath);
|
||||
|
||||
texture = null;
|
||||
}
|
||||
|
||||
if (texture != null) {
|
||||
boolean ret = true;
|
||||
|
||||
try {
|
||||
final int width = texture.getWidth();
|
||||
final int height = texture.getHeight();
|
||||
final int length = texture.getData().remaining();
|
||||
|
||||
final byte[] data = new byte[length];
|
||||
final ByteBuffer buf = ByteBuffer.wrap(data);
|
||||
buf.order(ByteOrder.nativeOrder());
|
||||
buf.put(texture.getData());
|
||||
|
||||
nativeSetTextureInfo(width,
|
||||
height,
|
||||
data,
|
||||
length);
|
||||
} catch (Exception e)
|
||||
{
|
||||
Log.d("invoke native function error", e.toString());
|
||||
ret = false;
|
||||
}
|
||||
|
||||
return ret;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public static void setContext(Context context) {
|
||||
Cocos2dxETCLoader.context = context;
|
||||
}
|
||||
|
||||
private static native void nativeSetTextureInfo(final int width, final int height, final byte[] data,
|
||||
final int dataLength);
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
#include "cocoa/CCGeometry.h"
|
||||
#include "platform/android/CCAccelerometer.h"
|
||||
#include "../CCEGLView.h"
|
||||
#include "JniHelper.h"
|
||||
#include <jni.h>
|
||||
#include "CCDirector.h"
|
||||
|
||||
using namespace cocos2d;
|
||||
|
||||
extern "C" {
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxAccelerometer_onSensorChanged(JNIEnv* env, jobject thiz, jfloat x, jfloat y, jfloat z, jlong timeStamp) {
|
||||
}
|
||||
}
|
|
@ -1,90 +0,0 @@
|
|||
/****************************************************************************
|
||||
Copyright (c) 2010 cocos2d-x.org
|
||||
|
||||
http://www.cocos2d-x.org
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
#include "cocoa/CCSet.h"
|
||||
#include "CCDirector.h"
|
||||
#include "keypad_dispatcher/CCKeypadDispatcher.h"
|
||||
#include "touch_dispatcher/CCTouch.h"
|
||||
#include "../CCEGLView.h"
|
||||
#include "touch_dispatcher/CCTouchDispatcher.h"
|
||||
|
||||
#include <android/log.h>
|
||||
#include <jni.h>
|
||||
|
||||
using namespace cocos2d;
|
||||
|
||||
extern "C" {
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesBegin(JNIEnv * env, jobject thiz, jint id, jfloat x, jfloat y) {
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesBegin(1, &id, &x, &y);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesEnd(JNIEnv * env, jobject thiz, jint id, jfloat x, jfloat y) {
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesEnd(1, &id, &x, &y);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesMove(JNIEnv * env, jobject thiz, jintArray ids, jfloatArray xs, jfloatArray ys) {
|
||||
int size = env->GetArrayLength(ids);
|
||||
jint id[size];
|
||||
jfloat x[size];
|
||||
jfloat y[size];
|
||||
|
||||
env->GetIntArrayRegion(ids, 0, size, id);
|
||||
env->GetFloatArrayRegion(xs, 0, size, x);
|
||||
env->GetFloatArrayRegion(ys, 0, size, y);
|
||||
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesMove(size, id, x, y);
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeTouchesCancel(JNIEnv * env, jobject thiz, jintArray ids, jfloatArray xs, jfloatArray ys) {
|
||||
int size = env->GetArrayLength(ids);
|
||||
jint id[size];
|
||||
jfloat x[size];
|
||||
jfloat y[size];
|
||||
|
||||
env->GetIntArrayRegion(ids, 0, size, id);
|
||||
env->GetFloatArrayRegion(xs, 0, size, x);
|
||||
env->GetFloatArrayRegion(ys, 0, size, y);
|
||||
|
||||
cocos2d::Director::getInstance()->getOpenGLView()->handleTouchesCancel(size, id, x, y);
|
||||
}
|
||||
|
||||
#define KEYCODE_BACK 0x04
|
||||
#define KEYCODE_MENU 0x52
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_org_cocos2dx_lib_Cocos2dxRenderer_nativeKeyDown(JNIEnv * env, jobject thiz, jint keyCode) {
|
||||
Director* pDirector = Director::getInstance();
|
||||
switch (keyCode) {
|
||||
case KEYCODE_BACK:
|
||||
if (pDirector->getKeypadDispatcher()->dispatchKeypadMSG(kTypeBackClicked))
|
||||
return JNI_TRUE;
|
||||
break;
|
||||
case KEYCODE_MENU:
|
||||
if (pDirector->getKeypadDispatcher()->dispatchKeypadMSG(kTypeMenuClicked))
|
||||
return JNI_TRUE;
|
||||
break;
|
||||
default:
|
||||
return JNI_FALSE;
|
||||
}
|
||||
return JNI_FALSE;
|
||||
}
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -24,7 +24,11 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
****************************************************************************/
|
||||
|
||||
#include "CCSpriteBatchNode.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "ccConfig.h"
|
||||
#include "CCSprite.h"
|
||||
#include "effects/CCGrid.h"
|
||||
|
@ -241,11 +245,36 @@ void SpriteBatchNode::removeAllChildrenWithCleanup(bool bCleanup)
|
|||
_textureAtlas->removeAllQuads();
|
||||
}
|
||||
|
||||
#if CC_USE_ARRAY_VECTOR
|
||||
static bool objectComparisonLess(const RCPtr<Object>& pp1, const RCPtr<Object>& pp2)
|
||||
{
|
||||
Object *p1 = static_cast<Object*>(pp1);
|
||||
Object *p2 = static_cast<Object*>(pp2);
|
||||
Node *n1 = static_cast<Node*>(p1);
|
||||
Node *n2 = static_cast<Node*>(p2);
|
||||
|
||||
return( n1->getZOrder() < n2->getZOrder() ||
|
||||
( n1->getZOrder() == n2->getZOrder() && n1->getOrderOfArrival() < n2->getOrderOfArrival() )
|
||||
);
|
||||
}
|
||||
#else
|
||||
static bool objectComparisonLess(Object* p1, Object* p2)
|
||||
{
|
||||
Node *n1 = static_cast<Node*>(p1);
|
||||
Node *n2 = static_cast<Node*>(p2);
|
||||
|
||||
return( n1->getZOrder() < n2->getZOrder() ||
|
||||
( n1->getZOrder() == n2->getZOrder() && n1->getOrderOfArrival() < n2->getOrderOfArrival() )
|
||||
);
|
||||
}
|
||||
#endif
|
||||
|
||||
//override sortAllChildren
|
||||
void SpriteBatchNode::sortAllChildren()
|
||||
{
|
||||
if (_reorderChildDirty)
|
||||
{
|
||||
#if 0
|
||||
int i = 0,j = 0,length = _children->count();
|
||||
|
||||
// insertion sort
|
||||
|
@ -267,6 +296,9 @@ void SpriteBatchNode::sortAllChildren()
|
|||
}
|
||||
_children->fastSetObject(tempI, j+1);
|
||||
}
|
||||
#else
|
||||
std::sort(std::begin(*_children), std::end(*_children), objectComparisonLess);
|
||||
#endif
|
||||
|
||||
//sorted now check all children
|
||||
if (_children->count() > 0)
|
||||
|
@ -622,17 +654,17 @@ void SpriteBatchNode::removeSpriteFromAtlas(Sprite *sprite)
|
|||
// Cleanup sprite. It might be reused (issue #569)
|
||||
sprite->setBatchNode(NULL);
|
||||
|
||||
unsigned int uIndex = _descendants->getIndexOfObject(sprite);
|
||||
if (uIndex != UINT_MAX)
|
||||
int index = _descendants->getIndexOfObject(sprite);
|
||||
if (index != UINT_MAX)
|
||||
{
|
||||
_descendants->removeObjectAtIndex(uIndex);
|
||||
_descendants->removeObjectAtIndex(index);
|
||||
|
||||
// update all sprites beyond this one
|
||||
unsigned int count = _descendants->count();
|
||||
int count = _descendants->count();
|
||||
|
||||
for(; uIndex < count; ++uIndex)
|
||||
for(; index < count; ++index)
|
||||
{
|
||||
Sprite* s = (Sprite*)(_descendants->getObjectAtIndex(uIndex));
|
||||
Sprite* s = static_cast<Sprite*>(_descendants->getObjectAtIndex(index));
|
||||
s->setAtlasIndex( s->getAtlasIndex() - 1 );
|
||||
}
|
||||
}
|
||||
|
@ -641,10 +673,10 @@ void SpriteBatchNode::removeSpriteFromAtlas(Sprite *sprite)
|
|||
Array *children = sprite->getChildren();
|
||||
if (children && children->count() > 0)
|
||||
{
|
||||
Object* pObject = NULL;
|
||||
CCARRAY_FOREACH(children, pObject)
|
||||
Object* object = NULL;
|
||||
CCARRAY_FOREACH(children, object)
|
||||
{
|
||||
Sprite* child = static_cast<Sprite*>(pObject);
|
||||
Sprite* child = static_cast<Sprite*>(object);
|
||||
if (child)
|
||||
{
|
||||
removeSpriteFromAtlas(child);
|
||||
|
|
|
@ -209,8 +209,6 @@ void SpriteFrameCache::addSpriteFramesWithFile(const char *pszPlist, Texture2D *
|
|||
Dictionary *dict = Dictionary::createWithContentsOfFileThreadSafe(fullPath.c_str());
|
||||
|
||||
addSpriteFramesWithDictionary(dict, pobTexture);
|
||||
|
||||
dict->release();
|
||||
}
|
||||
|
||||
void SpriteFrameCache::addSpriteFramesWithFile(const char* plist, const char* textureFileName)
|
||||
|
@ -239,7 +237,7 @@ void SpriteFrameCache::addSpriteFramesWithFile(const char *pszPlist)
|
|||
|
||||
string texturePath("");
|
||||
|
||||
Dictionary* metadataDict = (Dictionary*)dict->objectForKey("metadata");
|
||||
Dictionary* metadataDict = static_cast<Dictionary*>( dict->objectForKey("metadata") );
|
||||
if (metadataDict)
|
||||
{
|
||||
// try to read texture file name from meta data
|
||||
|
@ -277,10 +275,7 @@ void SpriteFrameCache::addSpriteFramesWithFile(const char *pszPlist)
|
|||
{
|
||||
CCLOG("cocos2d: SpriteFrameCache: Couldn't load texture");
|
||||
}
|
||||
|
||||
dict->release();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void SpriteFrameCache::addSpriteFrame(SpriteFrame *pobFrame, const char *pszFrameName)
|
||||
|
@ -356,8 +351,6 @@ void SpriteFrameCache::removeSpriteFramesFromFile(const char* plist)
|
|||
{
|
||||
_loadedFileNames->erase(ret);
|
||||
}
|
||||
|
||||
dict->release();
|
||||
}
|
||||
|
||||
void SpriteFrameCache::removeSpriteFramesFromDictionary(Dictionary* dictionary)
|
||||
|
|
|
@ -28,11 +28,13 @@ THE SOFTWARE.
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
const int CC_INVALID_INDEX = -1;
|
||||
|
||||
/** Allocates and initializes a new array with specified capacity */
|
||||
ccArray* ccArrayNew(unsigned int capacity)
|
||||
ccArray* ccArrayNew(int capacity)
|
||||
{
|
||||
if (capacity == 0)
|
||||
capacity = 1;
|
||||
capacity = 7;
|
||||
|
||||
ccArray *arr = (ccArray*)malloc( sizeof(ccArray) );
|
||||
arr->num = 0;
|
||||
|
@ -66,17 +68,21 @@ void ccArrayDoubleCapacity(ccArray *arr)
|
|||
arr->arr = newArr;
|
||||
}
|
||||
|
||||
void ccArrayEnsureExtraCapacity(ccArray *arr, unsigned int extra)
|
||||
void ccArrayEnsureExtraCapacity(ccArray *arr, int extra)
|
||||
{
|
||||
while (arr->max < arr->num + extra)
|
||||
{
|
||||
// CCLOG("cocos2d: ccCArray: resizing ccArray capacity from [%lu] to [%lu].",
|
||||
// (long) arr->max,
|
||||
// (long) arr->max*2);
|
||||
|
||||
ccArrayDoubleCapacity(arr);
|
||||
}
|
||||
}
|
||||
|
||||
void ccArrayShrink(ccArray *arr)
|
||||
{
|
||||
unsigned int newSize = 0;
|
||||
int newSize = 0;
|
||||
|
||||
//only resize when necessary
|
||||
if (arr->max > arr->num && !(arr->num==0 && arr->max==1))
|
||||
|
@ -98,13 +104,14 @@ void ccArrayShrink(ccArray *arr)
|
|||
}
|
||||
|
||||
/** Returns index of first occurrence of object, CC_INVALID_INDEX if object not found. */
|
||||
unsigned int ccArrayGetIndexOfObject(ccArray *arr, Object* object)
|
||||
int ccArrayGetIndexOfObject(ccArray *arr, Object* object)
|
||||
{
|
||||
const unsigned int arrNum = arr->num;
|
||||
const int arrNum = arr->num;
|
||||
Object** ptr = arr->arr;
|
||||
for(unsigned int i = 0; i < arrNum; ++i, ++ptr)
|
||||
for(int i = 0; i < arrNum; ++i, ++ptr)
|
||||
{
|
||||
if( *ptr == object ) return i;
|
||||
if( *ptr == object )
|
||||
return i;
|
||||
}
|
||||
|
||||
return CC_INVALID_INDEX;
|
||||
|
@ -136,7 +143,7 @@ void ccArrayAppendObjectWithResize(ccArray *arr, Object* object)
|
|||
enough capacity. */
|
||||
void ccArrayAppendArray(ccArray *arr, ccArray *plusArr)
|
||||
{
|
||||
for(unsigned int i = 0; i < plusArr->num; i++)
|
||||
for(int i = 0; i < plusArr->num; i++)
|
||||
{
|
||||
ccArrayAppendObject(arr, plusArr->arr[i]);
|
||||
}
|
||||
|
@ -150,14 +157,14 @@ void ccArrayAppendArrayWithResize(ccArray *arr, ccArray *plusArr)
|
|||
}
|
||||
|
||||
/** Inserts an object at index */
|
||||
void ccArrayInsertObjectAtIndex(ccArray *arr, Object* object, unsigned int index)
|
||||
void ccArrayInsertObjectAtIndex(ccArray *arr, Object* object, int index)
|
||||
{
|
||||
CCASSERT(index<=arr->num, "Invalid index. Out of bounds");
|
||||
CCASSERT(object != NULL, "Invalid parameter!");
|
||||
|
||||
ccArrayEnsureExtraCapacity(arr, 1);
|
||||
|
||||
unsigned int remaining = arr->num - index;
|
||||
int remaining = arr->num - index;
|
||||
if( remaining > 0)
|
||||
{
|
||||
memmove((void *)&arr->arr[index+1], (void *)&arr->arr[index], sizeof(Object*) * remaining );
|
||||
|
@ -169,10 +176,10 @@ void ccArrayInsertObjectAtIndex(ccArray *arr, Object* object, unsigned int index
|
|||
}
|
||||
|
||||
/** Swaps two objects */
|
||||
void ccArraySwapObjectsAtIndexes(ccArray *arr, unsigned int index1, unsigned int index2)
|
||||
void ccArraySwapObjectsAtIndexes(ccArray *arr, int index1, int index2)
|
||||
{
|
||||
CCASSERT(index1 < arr->num, "(1) Invalid index. Out of bounds");
|
||||
CCASSERT(index2 < arr->num, "(2) Invalid index. Out of bounds");
|
||||
CCASSERT(index1>=0 && index1 < arr->num, "(1) Invalid index. Out of bounds");
|
||||
CCASSERT(index2>=0 && index2 < arr->num, "(2) Invalid index. Out of bounds");
|
||||
|
||||
Object* object1 = arr->arr[index1];
|
||||
|
||||
|
@ -191,9 +198,9 @@ void ccArrayRemoveAllObjects(ccArray *arr)
|
|||
|
||||
/** Removes object at specified index and pushes back all subsequent objects.
|
||||
Behavior undefined if index outside [0, num-1]. */
|
||||
void ccArrayRemoveObjectAtIndex(ccArray *arr, unsigned int index, bool bReleaseObj/* = true*/)
|
||||
void ccArrayRemoveObjectAtIndex(ccArray *arr, int index, bool bReleaseObj/* = true*/)
|
||||
{
|
||||
CCASSERT(arr && arr->num > 0 && index < arr->num, "Invalid index. Out of bounds");
|
||||
CCASSERT(arr && arr->num > 0 && index>=0 && index < arr->num, "Invalid index. Out of bounds");
|
||||
if (bReleaseObj)
|
||||
{
|
||||
CC_SAFE_RELEASE(arr->arr[index]);
|
||||
|
@ -201,7 +208,7 @@ void ccArrayRemoveObjectAtIndex(ccArray *arr, unsigned int index, bool bReleaseO
|
|||
|
||||
arr->num--;
|
||||
|
||||
unsigned int remaining = arr->num - index;
|
||||
int remaining = arr->num - index;
|
||||
if(remaining>0)
|
||||
{
|
||||
memmove((void *)&arr->arr[index], (void *)&arr->arr[index+1], remaining * sizeof(Object*));
|
||||
|
@ -211,16 +218,16 @@ void ccArrayRemoveObjectAtIndex(ccArray *arr, unsigned int index, bool bReleaseO
|
|||
/** Removes object at specified index and fills the gap with the last object,
|
||||
thereby avoiding the need to push back subsequent objects.
|
||||
Behavior undefined if index outside [0, num-1]. */
|
||||
void ccArrayFastRemoveObjectAtIndex(ccArray *arr, unsigned int index)
|
||||
void ccArrayFastRemoveObjectAtIndex(ccArray *arr, int index)
|
||||
{
|
||||
CC_SAFE_RELEASE(arr->arr[index]);
|
||||
unsigned int last = --arr->num;
|
||||
int last = --arr->num;
|
||||
arr->arr[index] = arr->arr[last];
|
||||
}
|
||||
|
||||
void ccArrayFastRemoveObject(ccArray *arr, Object* object)
|
||||
{
|
||||
unsigned int index = ccArrayGetIndexOfObject(arr, object);
|
||||
int index = ccArrayGetIndexOfObject(arr, object);
|
||||
if (index != CC_INVALID_INDEX)
|
||||
{
|
||||
ccArrayFastRemoveObjectAtIndex(arr, index);
|
||||
|
@ -231,7 +238,7 @@ void ccArrayFastRemoveObject(ccArray *arr, Object* object)
|
|||
found the function has no effect. */
|
||||
void ccArrayRemoveObject(ccArray *arr, Object* object, bool bReleaseObj/* = true*/)
|
||||
{
|
||||
unsigned int index = ccArrayGetIndexOfObject(arr, object);
|
||||
int index = ccArrayGetIndexOfObject(arr, object);
|
||||
if (index != CC_INVALID_INDEX)
|
||||
{
|
||||
ccArrayRemoveObjectAtIndex(arr, index, bReleaseObj);
|
||||
|
@ -242,7 +249,7 @@ void ccArrayRemoveObject(ccArray *arr, Object* object, bool bReleaseObj/* = true
|
|||
first matching instance in arr will be removed. */
|
||||
void ccArrayRemoveArray(ccArray *arr, ccArray *minusArr)
|
||||
{
|
||||
for(unsigned int i = 0; i < minusArr->num; i++)
|
||||
for(int i = 0; i < minusArr->num; i++)
|
||||
{
|
||||
ccArrayRemoveObject(arr, minusArr->arr[i]);
|
||||
}
|
||||
|
@ -252,8 +259,8 @@ void ccArrayRemoveArray(ccArray *arr, ccArray *minusArr)
|
|||
matching instances in arr will be removed. */
|
||||
void ccArrayFullRemoveArray(ccArray *arr, ccArray *minusArr)
|
||||
{
|
||||
unsigned int back = 0;
|
||||
unsigned int i = 0;
|
||||
int back = 0;
|
||||
int i = 0;
|
||||
|
||||
for( i = 0; i < arr->num; i++)
|
||||
{
|
||||
|
@ -275,11 +282,11 @@ void ccArrayFullRemoveArray(ccArray *arr, ccArray *minusArr)
|
|||
// #pragma mark ccCArray for Values (c structures)
|
||||
|
||||
/** Allocates and initializes a new C array with specified capacity */
|
||||
ccCArray* ccCArrayNew(unsigned int capacity)
|
||||
ccCArray* ccCArrayNew(int capacity)
|
||||
{
|
||||
if (capacity == 0)
|
||||
{
|
||||
capacity = 1;
|
||||
capacity = 7;
|
||||
}
|
||||
|
||||
ccCArray *arr = (ccCArray*)malloc( sizeof(ccCArray) );
|
||||
|
@ -310,19 +317,18 @@ void ccCArrayDoubleCapacity(ccCArray *arr)
|
|||
}
|
||||
|
||||
/** Increases array capacity such that max >= num + extra. */
|
||||
void ccCArrayEnsureExtraCapacity(ccCArray *arr, unsigned int extra)
|
||||
void ccCArrayEnsureExtraCapacity(ccCArray *arr, int extra)
|
||||
{
|
||||
ccArrayEnsureExtraCapacity((ccArray*)arr,extra);
|
||||
}
|
||||
|
||||
/** Returns index of first occurrence of value, CC_INVALID_INDEX if value not found. */
|
||||
unsigned int ccCArrayGetIndexOfValue(ccCArray *arr, void* value)
|
||||
int ccCArrayGetIndexOfValue(ccCArray *arr, void* value)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for( i = 0; i < arr->num; i++)
|
||||
for( int i = 0; i < arr->num; i++)
|
||||
{
|
||||
if( arr->arr[i] == value ) return i;
|
||||
if( arr->arr[i] == value )
|
||||
return i;
|
||||
}
|
||||
return CC_INVALID_INDEX;
|
||||
}
|
||||
|
@ -334,11 +340,11 @@ bool ccCArrayContainsValue(ccCArray *arr, void* value)
|
|||
}
|
||||
|
||||
/** Inserts a value at a certain position. Behavior undefined if array doesn't have enough capacity */
|
||||
void ccCArrayInsertValueAtIndex( ccCArray *arr, void* value, unsigned int index)
|
||||
void ccCArrayInsertValueAtIndex( ccCArray *arr, void* value, int index)
|
||||
{
|
||||
CCASSERT( index < arr->max, "ccCArrayInsertValueAtIndex: invalid index");
|
||||
|
||||
unsigned int remaining = arr->num - index;
|
||||
int remaining = arr->num - index;
|
||||
// make sure it has enough capacity
|
||||
if (arr->num + 1 == arr->max)
|
||||
{
|
||||
|
@ -379,9 +385,7 @@ void ccCArrayAppendValueWithResize(ccCArray *arr, void* value)
|
|||
enough capacity. */
|
||||
void ccCArrayAppendArray(ccCArray *arr, ccCArray *plusArr)
|
||||
{
|
||||
unsigned int i;
|
||||
|
||||
for( i = 0; i < plusArr->num; i++)
|
||||
for( int i = 0; i < plusArr->num; i++)
|
||||
{
|
||||
ccCArrayAppendValue(arr, plusArr->arr[i]);
|
||||
}
|
||||
|
@ -404,11 +408,9 @@ void ccCArrayRemoveAllValues(ccCArray *arr)
|
|||
Behavior undefined if index outside [0, num-1].
|
||||
@since v0.99.4
|
||||
*/
|
||||
void ccCArrayRemoveValueAtIndex(ccCArray *arr, unsigned int index)
|
||||
void ccCArrayRemoveValueAtIndex(ccCArray *arr, int index)
|
||||
{
|
||||
unsigned int last;
|
||||
|
||||
for( last = --arr->num; index < last; index++)
|
||||
for( int last = --arr->num; index < last; index++)
|
||||
{
|
||||
arr->arr[index] = arr->arr[index + 1];
|
||||
}
|
||||
|
@ -419,9 +421,9 @@ void ccCArrayRemoveValueAtIndex(ccCArray *arr, unsigned int index)
|
|||
Behavior undefined if index outside [0, num-1].
|
||||
@since v0.99.4
|
||||
*/
|
||||
void ccCArrayFastRemoveValueAtIndex(ccCArray *arr, unsigned int index)
|
||||
void ccCArrayFastRemoveValueAtIndex(ccCArray *arr, int index)
|
||||
{
|
||||
unsigned int last = --arr->num;
|
||||
int last = --arr->num;
|
||||
arr->arr[index] = arr->arr[last];
|
||||
}
|
||||
|
||||
|
@ -430,7 +432,7 @@ void ccCArrayFastRemoveValueAtIndex(ccCArray *arr, unsigned int index)
|
|||
*/
|
||||
void ccCArrayRemoveValue(ccCArray *arr, void* value)
|
||||
{
|
||||
unsigned int index = ccCArrayGetIndexOfValue(arr, value);
|
||||
int index = ccCArrayGetIndexOfValue(arr, value);
|
||||
if (index != CC_INVALID_INDEX)
|
||||
{
|
||||
ccCArrayRemoveValueAtIndex(arr, index);
|
||||
|
@ -442,7 +444,7 @@ void ccCArrayRemoveValue(ccCArray *arr, void* value)
|
|||
*/
|
||||
void ccCArrayRemoveArray(ccCArray *arr, ccCArray *minusArr)
|
||||
{
|
||||
for(unsigned int i = 0; i < minusArr->num; i++)
|
||||
for(int i = 0; i < minusArr->num; i++)
|
||||
{
|
||||
ccCArrayRemoveValue(arr, minusArr->arr[i]);
|
||||
}
|
||||
|
@ -453,9 +455,9 @@ void ccCArrayRemoveArray(ccCArray *arr, ccCArray *minusArr)
|
|||
*/
|
||||
void ccCArrayFullRemoveArray(ccCArray *arr, ccCArray *minusArr)
|
||||
{
|
||||
unsigned int back = 0;
|
||||
int back = 0;
|
||||
|
||||
for(unsigned int i = 0; i < arr->num; i++)
|
||||
for(int i = 0; i < arr->num; i++)
|
||||
{
|
||||
if( ccCArrayContainsValue(minusArr, arr->arr[i]) )
|
||||
{
|
||||
|
|
|
@ -51,20 +51,20 @@ THE SOFTWARE.
|
|||
|
||||
NS_CC_BEGIN
|
||||
|
||||
#define CC_INVALID_INDEX 0xffffffff
|
||||
extern const int CC_INVALID_INDEX;
|
||||
|
||||
// Easy integration
|
||||
#define CCARRAYDATA_FOREACH(__array__, __object__) \
|
||||
__object__=__array__->arr[0]; for(unsigned int i=0, num=__array__->num; i<num; i++, __object__=__array__->arr[i]) \
|
||||
__object__=__array__->arr[0]; for(int i=0, num=__array__->num; i<num; i++, __object__=__array__->arr[i]) \
|
||||
|
||||
|
||||
typedef struct _ccArray {
|
||||
unsigned int num, max;
|
||||
int num, max;
|
||||
Object** arr;
|
||||
} ccArray;
|
||||
|
||||
/** Allocates and initializes a new array with specified capacity */
|
||||
ccArray* ccArrayNew(unsigned int capacity);
|
||||
ccArray* ccArrayNew(int capacity);
|
||||
|
||||
/** Frees array after removing all remaining objects. Silently ignores nil arr. */
|
||||
void ccArrayFree(ccArray*& arr);
|
||||
|
@ -73,13 +73,13 @@ void ccArrayFree(ccArray*& arr);
|
|||
void ccArrayDoubleCapacity(ccArray *arr);
|
||||
|
||||
/** Increases array capacity such that max >= num + extra. */
|
||||
void ccArrayEnsureExtraCapacity(ccArray *arr, unsigned int extra);
|
||||
void ccArrayEnsureExtraCapacity(ccArray *arr, int extra);
|
||||
|
||||
/** shrinks the array so the memory footprint corresponds with the number of items */
|
||||
void ccArrayShrink(ccArray *arr);
|
||||
|
||||
/** Returns index of first occurrence of object, NSNotFound if object not found. */
|
||||
unsigned int ccArrayGetIndexOfObject(ccArray *arr, Object* object);
|
||||
int ccArrayGetIndexOfObject(ccArray *arr, Object* object);
|
||||
|
||||
/** Returns a Boolean value that indicates whether object is present in array. */
|
||||
bool ccArrayContainsObject(ccArray *arr, Object* object);
|
||||
|
@ -98,22 +98,22 @@ void ccArrayAppendArray(ccArray *arr, ccArray *plusArr);
|
|||
void ccArrayAppendArrayWithResize(ccArray *arr, ccArray *plusArr);
|
||||
|
||||
/** Inserts an object at index */
|
||||
void ccArrayInsertObjectAtIndex(ccArray *arr, Object* object, unsigned int index);
|
||||
void ccArrayInsertObjectAtIndex(ccArray *arr, Object* object, int index);
|
||||
|
||||
/** Swaps two objects */
|
||||
void ccArraySwapObjectsAtIndexes(ccArray *arr, unsigned int index1, unsigned int index2);
|
||||
void ccArraySwapObjectsAtIndexes(ccArray *arr, int index1, int index2);
|
||||
|
||||
/** Removes all objects from arr */
|
||||
void ccArrayRemoveAllObjects(ccArray *arr);
|
||||
|
||||
/** Removes object at specified index and pushes back all subsequent objects.
|
||||
Behavior undefined if index outside [0, num-1]. */
|
||||
void ccArrayRemoveObjectAtIndex(ccArray *arr, unsigned int index, bool bReleaseObj = true);
|
||||
void ccArrayRemoveObjectAtIndex(ccArray *arr, int index, bool bReleaseObj = true);
|
||||
|
||||
/** Removes object at specified index and fills the gap with the last object,
|
||||
thereby avoiding the need to push back subsequent objects.
|
||||
Behavior undefined if index outside [0, num-1]. */
|
||||
void ccArrayFastRemoveObjectAtIndex(ccArray *arr, unsigned int index);
|
||||
void ccArrayFastRemoveObjectAtIndex(ccArray *arr, int index);
|
||||
|
||||
void ccArrayFastRemoveObject(ccArray *arr, Object* object);
|
||||
|
||||
|
@ -133,12 +133,12 @@ void ccArrayFullRemoveArray(ccArray *arr, ccArray *minusArr);
|
|||
// #pragma mark ccCArray for Values (c structures)
|
||||
|
||||
typedef struct _ccCArray {
|
||||
unsigned int num, max;
|
||||
int num, max;
|
||||
void** arr;
|
||||
} ccCArray;
|
||||
|
||||
/** Allocates and initializes a new C array with specified capacity */
|
||||
ccCArray* ccCArrayNew(unsigned int capacity);
|
||||
ccCArray* ccCArrayNew(int capacity);
|
||||
|
||||
/** Frees C array after removing all remaining values. Silently ignores nil arr. */
|
||||
void ccCArrayFree(ccCArray *arr);
|
||||
|
@ -147,16 +147,16 @@ void ccCArrayFree(ccCArray *arr);
|
|||
void ccCArrayDoubleCapacity(ccCArray *arr);
|
||||
|
||||
/** Increases array capacity such that max >= num + extra. */
|
||||
void ccCArrayEnsureExtraCapacity(ccCArray *arr, unsigned int extra);
|
||||
void ccCArrayEnsureExtraCapacity(ccCArray *arr, int extra);
|
||||
|
||||
/** Returns index of first occurrence of value, NSNotFound if value not found. */
|
||||
unsigned int ccCArrayGetIndexOfValue(ccCArray *arr, void* value);
|
||||
int ccCArrayGetIndexOfValue(ccCArray *arr, void* value);
|
||||
|
||||
/** Returns a Boolean value that indicates whether value is present in the C array. */
|
||||
bool ccCArrayContainsValue(ccCArray *arr, void* value);
|
||||
|
||||
/** Inserts a value at a certain position. Behavior undefined if array doesn't have enough capacity */
|
||||
void ccCArrayInsertValueAtIndex( ccCArray *arr, void* value, unsigned int index);
|
||||
void ccCArrayInsertValueAtIndex( ccCArray *arr, void* value, int index);
|
||||
|
||||
/** Appends an value. Behavior undefined if array doesn't have enough capacity. */
|
||||
void ccCArrayAppendValue(ccCArray *arr, void* value);
|
||||
|
@ -178,14 +178,14 @@ void ccCArrayRemoveAllValues(ccCArray *arr);
|
|||
Behavior undefined if index outside [0, num-1].
|
||||
@since v0.99.4
|
||||
*/
|
||||
void ccCArrayRemoveValueAtIndex(ccCArray *arr, unsigned int index);
|
||||
void ccCArrayRemoveValueAtIndex(ccCArray *arr, int index);
|
||||
|
||||
/** Removes value at specified index and fills the gap with the last value,
|
||||
thereby avoiding the need to push back subsequent values.
|
||||
Behavior undefined if index outside [0, num-1].
|
||||
@since v0.99.4
|
||||
*/
|
||||
void ccCArrayFastRemoveValueAtIndex(ccCArray *arr, unsigned int index);
|
||||
void ccCArrayFastRemoveValueAtIndex(ccCArray *arr, int index);
|
||||
|
||||
/** Searches for the first occurrence of value and removes it. If value is not found the function has no effect.
|
||||
@since v0.99.4
|
||||
|
|
|
@ -225,7 +225,7 @@ bool Scale9Sprite::updateWithBatchNode(SpriteBatchNode* batchnode, Rect rect, bo
|
|||
if (!rotated) {
|
||||
// log("!rotated");
|
||||
|
||||
AffineTransform t = AffineTransformMakeIdentity();
|
||||
AffineTransform t = AffineTransform::IDENTITY;
|
||||
t = AffineTransformTranslate(t, rect.origin.x, rect.origin.y);
|
||||
|
||||
centerbounds = RectApplyAffineTransform(centerbounds, t);
|
||||
|
@ -288,7 +288,7 @@ bool Scale9Sprite::updateWithBatchNode(SpriteBatchNode* batchnode, Rect rect, bo
|
|||
// in the spritesheet
|
||||
// log("rotated");
|
||||
|
||||
AffineTransform t = AffineTransformMakeIdentity();
|
||||
AffineTransform t = AffineTransform::IDENTITY;
|
||||
|
||||
Rect rotatedcenterbounds = centerbounds;
|
||||
Rect rotatedrightbottombounds = rightbottombounds;
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#include "cocos2d.h"
|
||||
#include "SimpleAudioEngine.h"
|
||||
#include "ScriptingCore.h"
|
||||
#include "generated/jsb_cocos2dx_auto.hpp"
|
||||
#include "generated/jsb_cocos2dx_extension_auto.hpp"
|
||||
#include "jsb_cocos2dx_auto.hpp"
|
||||
#include "jsb_cocos2dx_extension_auto.hpp"
|
||||
#include "cocos2d_specifics.hpp"
|
||||
#include "js_bindings_chipmunk_registration.h"
|
||||
#include "js_bindings_system_registration.h"
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#include "cocos2d.h"
|
||||
#include "SimpleAudioEngine.h"
|
||||
#include "ScriptingCore.h"
|
||||
#include "generated/jsb_cocos2dx_auto.hpp"
|
||||
#include "generated/jsb_cocos2dx_extension_auto.hpp"
|
||||
#include "jsb_cocos2dx_auto.hpp"
|
||||
#include "jsb_cocos2dx_extension_auto.hpp"
|
||||
#include "cocos2d_specifics.hpp"
|
||||
#include "js_bindings_chipmunk_registration.h"
|
||||
#include "js_bindings_system_registration.h"
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include "cocos2d.h"
|
||||
#include "SimpleAudioEngine.h"
|
||||
#include "ScriptingCore.h"
|
||||
#include "generated/jsb_cocos2dx_auto.hpp"
|
||||
#include "jsb_cocos2dx_auto.hpp"
|
||||
#include "cocos2d_specifics.hpp"
|
||||
|
||||
#if (CC_TARGET_PLATFORM != CC_PLATFORM_WIN32)
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_JAVASCRIPT=1 -std=c++11
|
||||
APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 -DCC_ENABLE_CHIPMUNK_INTEGRATION=1
|
||||
|
||||
# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
|
||||
# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;DEBUG;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
|
@ -131,7 +131,7 @@ xcopy "$(ProjectDir)..\Resources" "$(OutDir)\AssetsManagerTestRes\" /e /Y</Comma
|
|||
<ProxyFileName>res_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExceptionHandling>
|
||||
</ExceptionHandling>
|
||||
|
|
|
@ -1,2 +1,5 @@
|
|||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11
|
||||
|
||||
# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
|
||||
# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11
|
||||
APP_ABI := armeabi x86
|
||||
APP_OPTIM := debug
|
||||
|
||||
# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
|
||||
# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix
|
||||
|
|
|
@ -419,7 +419,7 @@ void HoleDemo::setup()
|
|||
|
||||
_outerClipper = ClippingNode::create();
|
||||
_outerClipper->retain();
|
||||
AffineTransform tranform = AffineTransformMakeIdentity();
|
||||
AffineTransform tranform = AffineTransform::IDENTITY;
|
||||
tranform = AffineTransformScale(tranform, target->getScale(), target->getScale());
|
||||
|
||||
_outerClipper->setContentSize( SizeApplyAffineTransform(target->getContentSize(), tranform));
|
||||
|
|
|
@ -39,8 +39,10 @@ static std::function<NodeChildrenMainScene*()> createFunctions[] =
|
|||
CL(CallFuncsSpriteSheetCMacro),
|
||||
|
||||
CL(AddSpriteSheet),
|
||||
CL(GetSpriteSheet),
|
||||
CL(RemoveSpriteSheet),
|
||||
CL(ReorderSpriteSheet),
|
||||
CL(SortAllChildrenSpriteSheet),
|
||||
};
|
||||
|
||||
#define MAX_LAYER (sizeof(createFunctions) / sizeof(createFunctions[0]))
|
||||
|
@ -381,9 +383,15 @@ void CallFuncsSpriteSheetForEach::update(float dt)
|
|||
|
||||
CC_PROFILER_START(this->profilerName());
|
||||
|
||||
#if CC_USE_ARRAY_VECTOR
|
||||
std::for_each(std::begin(*children), std::end(*children), [](const RCPtr<Object>& obj) {
|
||||
static_cast<Node*>( static_cast<Object*>(obj) )->getPosition();
|
||||
});
|
||||
#else
|
||||
std::for_each(std::begin(*children), std::end(*children), [](Object* obj) {
|
||||
static_cast<Node*>(obj)->getPosition();
|
||||
});
|
||||
#endif
|
||||
|
||||
CC_PROFILER_STOP(this->profilerName());
|
||||
}
|
||||
|
@ -509,14 +517,13 @@ void AddSpriteSheet::update(float dt)
|
|||
|
||||
if( totalToAdd > 0 )
|
||||
{
|
||||
auto sprites = Array::createWithCapacity(totalToAdd);
|
||||
Sprite **sprites = new Sprite*[totalToAdd];
|
||||
int *zs = new int[totalToAdd];
|
||||
|
||||
// Don't include the sprite creation time and random as part of the profiling
|
||||
for(int i=0; i<totalToAdd; i++)
|
||||
{
|
||||
auto sprite = Sprite::createWithTexture(batchNode->getTexture(), Rect(0,0,32,32));
|
||||
sprites->addObject(sprite);
|
||||
sprites[i] = Sprite::createWithTexture(batchNode->getTexture(), Rect(0,0,32,32));
|
||||
zs[i] = CCRANDOM_MINUS1_1() * 50;
|
||||
}
|
||||
|
||||
|
@ -525,7 +532,7 @@ void AddSpriteSheet::update(float dt)
|
|||
|
||||
for( int i=0; i < totalToAdd;i++ )
|
||||
{
|
||||
batchNode->addChild((Node*) (sprites->getObjectAtIndex(i)), zs[i], kTagBase+i);
|
||||
batchNode->addChild( sprites[i], zs[i], kTagBase+i);
|
||||
}
|
||||
|
||||
batchNode->sortAllChildren();
|
||||
|
@ -535,16 +542,17 @@ void AddSpriteSheet::update(float dt)
|
|||
// remove them
|
||||
for( int i=0;i < totalToAdd;i++)
|
||||
{
|
||||
batchNode->removeChildByTag(kTagBase+i, true);
|
||||
batchNode->removeChild( sprites[i], true);
|
||||
}
|
||||
|
||||
delete [] sprites;
|
||||
delete [] zs;
|
||||
}
|
||||
}
|
||||
|
||||
std::string AddSpriteSheet::title()
|
||||
{
|
||||
return "D - Add to spritesheet";
|
||||
return "F - Add to spritesheet";
|
||||
}
|
||||
|
||||
std::string AddSpriteSheet::subtitle()
|
||||
|
@ -557,6 +565,72 @@ const char* AddSpriteSheet::profilerName()
|
|||
return "add sprites";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// GetSpriteSheet
|
||||
//
|
||||
////////////////////////////////////////////////////////
|
||||
void GetSpriteSheet::update(float dt)
|
||||
{
|
||||
// reset seed
|
||||
//srandom(0);
|
||||
|
||||
// 15 percent
|
||||
int totalToAdd = currentQuantityOfNodes * 0.15f;
|
||||
|
||||
if( totalToAdd > 0 )
|
||||
{
|
||||
Sprite **sprites = new Sprite*[totalToAdd];
|
||||
int *zs = new int[totalToAdd];
|
||||
|
||||
// Don't include the sprite creation time and random as part of the profiling
|
||||
for(int i=0; i<totalToAdd; i++)
|
||||
{
|
||||
sprites[i] = Sprite::createWithTexture(batchNode->getTexture(), Rect(0,0,32,32));
|
||||
zs[i] = CCRANDOM_MINUS1_1() * 50;
|
||||
}
|
||||
|
||||
for( int i=0; i < totalToAdd;i++ )
|
||||
{
|
||||
batchNode->addChild( sprites[i], zs[i], kTagBase+i);
|
||||
}
|
||||
|
||||
batchNode->sortAllChildren();
|
||||
|
||||
CC_PROFILER_START( this->profilerName() );
|
||||
for( int i=0; i < totalToAdd;i++ )
|
||||
{
|
||||
batchNode->getChildByTag(kTagBase+1);
|
||||
}
|
||||
CC_PROFILER_STOP(this->profilerName());
|
||||
|
||||
// remove them
|
||||
for( int i=0;i < totalToAdd;i++)
|
||||
{
|
||||
batchNode->removeChild( sprites[i], true);
|
||||
}
|
||||
|
||||
delete [] sprites;
|
||||
delete [] zs;
|
||||
}
|
||||
}
|
||||
|
||||
std::string GetSpriteSheet::title()
|
||||
{
|
||||
return "G - getChildByTag from spritesheet";
|
||||
}
|
||||
|
||||
std::string GetSpriteSheet::subtitle()
|
||||
{
|
||||
return "Get sprites using getChildByTag(). See console";
|
||||
}
|
||||
|
||||
const char* GetSpriteSheet::profilerName()
|
||||
{
|
||||
return "get sprites";
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// RemoveSpriteSheet
|
||||
|
@ -571,36 +645,35 @@ void RemoveSpriteSheet::update(float dt)
|
|||
|
||||
if( totalToAdd > 0 )
|
||||
{
|
||||
auto sprites = Array::createWithCapacity(totalToAdd);
|
||||
Sprite **sprites = new Sprite*[totalToAdd];
|
||||
|
||||
// Don't include the sprite creation time as part of the profiling
|
||||
for(int i=0;i<totalToAdd;i++)
|
||||
{
|
||||
auto sprite = Sprite::createWithTexture(batchNode->getTexture(), Rect(0,0,32,32));
|
||||
sprites->addObject(sprite);
|
||||
sprites[i] = Sprite::createWithTexture(batchNode->getTexture(), Rect(0,0,32,32));
|
||||
}
|
||||
|
||||
// add them with random Z (very important!)
|
||||
for( int i=0; i < totalToAdd;i++ )
|
||||
{
|
||||
batchNode->addChild((Node*) (sprites->getObjectAtIndex(i)), CCRANDOM_MINUS1_1() * 50, kTagBase+i);
|
||||
batchNode->addChild( sprites[i], CCRANDOM_MINUS1_1() * 50, kTagBase+i);
|
||||
}
|
||||
|
||||
// remove them
|
||||
CC_PROFILER_START( this->profilerName() );
|
||||
|
||||
for( int i=0;i < totalToAdd;i++)
|
||||
{
|
||||
batchNode->removeChildByTag(kTagBase+i, true);
|
||||
batchNode->removeChild( sprites[i], true);
|
||||
}
|
||||
|
||||
CC_PROFILER_STOP( this->profilerName() );
|
||||
|
||||
delete [] sprites;
|
||||
}
|
||||
}
|
||||
|
||||
std::string RemoveSpriteSheet::title()
|
||||
{
|
||||
return "E - Del from spritesheet";
|
||||
return "H - Del from spritesheet";
|
||||
}
|
||||
|
||||
std::string RemoveSpriteSheet::subtitle()
|
||||
|
@ -627,46 +700,43 @@ void ReorderSpriteSheet::update(float dt)
|
|||
|
||||
if( totalToAdd > 0 )
|
||||
{
|
||||
auto sprites = Array::createWithCapacity(totalToAdd);
|
||||
Sprite **sprites = new Sprite*[totalToAdd];
|
||||
|
||||
// Don't include the sprite creation time as part of the profiling
|
||||
for(int i=0; i<totalToAdd; i++)
|
||||
{
|
||||
auto sprite = Sprite::createWithTexture(batchNode->getTexture(), Rect(0,0,32,32));
|
||||
sprites->addObject(sprite);
|
||||
sprites[i] = Sprite::createWithTexture(batchNode->getTexture(), Rect(0,0,32,32));
|
||||
}
|
||||
|
||||
// add them with random Z (very important!)
|
||||
for( int i=0; i < totalToAdd;i++ )
|
||||
{
|
||||
batchNode->addChild((Node*) (sprites->getObjectAtIndex(i)), CCRANDOM_MINUS1_1() * 50, kTagBase+i);
|
||||
batchNode->addChild( sprites[i], CCRANDOM_MINUS1_1() * 50, kTagBase+i);
|
||||
}
|
||||
|
||||
batchNode->sortAllChildren();
|
||||
|
||||
// reorder them
|
||||
CC_PROFILER_START( this->profilerName() );
|
||||
|
||||
for( int i=0;i < totalToAdd;i++)
|
||||
{
|
||||
auto node = (Node*) (batchNode->getChildren()->getObjectAtIndex(i));
|
||||
batchNode->reorderChild(node, CCRANDOM_MINUS1_1() * 50);
|
||||
batchNode->reorderChild(sprites[i], CCRANDOM_MINUS1_1() * 50);
|
||||
}
|
||||
|
||||
batchNode->sortAllChildren();
|
||||
CC_PROFILER_STOP( this->profilerName() );
|
||||
|
||||
// remove them
|
||||
for( int i=0;i < totalToAdd;i++)
|
||||
{
|
||||
batchNode->removeChildByTag(kTagBase+i, true);
|
||||
batchNode->removeChild( sprites[i], true);
|
||||
}
|
||||
|
||||
delete [] sprites;
|
||||
}
|
||||
}
|
||||
|
||||
std::string ReorderSpriteSheet::title()
|
||||
{
|
||||
return "F - Reorder from spritesheet";
|
||||
return "I - Reorder from spritesheet";
|
||||
}
|
||||
|
||||
std::string ReorderSpriteSheet::subtitle()
|
||||
|
@ -679,6 +749,71 @@ const char* ReorderSpriteSheet::profilerName()
|
|||
return "reorder sprites";
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////
|
||||
//
|
||||
// SortAllChildrenSpriteSheet
|
||||
//
|
||||
////////////////////////////////////////////////////////
|
||||
void SortAllChildrenSpriteSheet::update(float dt)
|
||||
{
|
||||
//srandom(0);
|
||||
|
||||
// 15 percent
|
||||
int totalToAdd = currentQuantityOfNodes * 0.15f;
|
||||
|
||||
if( totalToAdd > 0 )
|
||||
{
|
||||
Sprite **sprites = new Sprite*[totalToAdd];
|
||||
|
||||
// Don't include the sprite's creation time as part of the profiling
|
||||
for(int i=0; i<totalToAdd; i++)
|
||||
{
|
||||
sprites[i] = Sprite::createWithTexture(batchNode->getTexture(), Rect(0,0,32,32));
|
||||
}
|
||||
|
||||
// add them with random Z (very important!)
|
||||
for( int i=0; i < totalToAdd;i++ )
|
||||
{
|
||||
batchNode->addChild( sprites[i], CCRANDOM_MINUS1_1() * 50, kTagBase+i);
|
||||
}
|
||||
|
||||
batchNode->sortAllChildren();
|
||||
|
||||
// reorder them
|
||||
for( int i=0;i < totalToAdd;i++)
|
||||
{
|
||||
batchNode->reorderChild(sprites[i], CCRANDOM_MINUS1_1() * 50);
|
||||
}
|
||||
|
||||
CC_PROFILER_START( this->profilerName() );
|
||||
batchNode->sortAllChildren();
|
||||
CC_PROFILER_STOP( this->profilerName() );
|
||||
|
||||
// remove them
|
||||
for( int i=0;i < totalToAdd;i++)
|
||||
{
|
||||
batchNode->removeChild( sprites[i], true);
|
||||
}
|
||||
|
||||
delete [] sprites;
|
||||
}
|
||||
}
|
||||
|
||||
std::string SortAllChildrenSpriteSheet::title()
|
||||
{
|
||||
return "J - Sort All Children from spritesheet";
|
||||
}
|
||||
|
||||
std::string SortAllChildrenSpriteSheet::subtitle()
|
||||
{
|
||||
return "Calls sortOfChildren(). See console";
|
||||
}
|
||||
|
||||
const char* SortAllChildrenSpriteSheet::profilerName()
|
||||
{
|
||||
return "sort all children";
|
||||
}
|
||||
|
||||
void runNodeChildrenTest()
|
||||
{
|
||||
auto scene = createFunctions[g_curCase]();
|
||||
|
|
|
@ -128,6 +128,16 @@ public:
|
|||
virtual const char* profilerName();
|
||||
};
|
||||
|
||||
class GetSpriteSheet : public AddRemoveSpriteSheet
|
||||
{
|
||||
public:
|
||||
virtual void update(float dt);
|
||||
|
||||
virtual std::string title();
|
||||
virtual std::string subtitle();
|
||||
virtual const char* profilerName();
|
||||
};
|
||||
|
||||
class RemoveSpriteSheet : public AddRemoveSpriteSheet
|
||||
{
|
||||
public:
|
||||
|
@ -148,6 +158,16 @@ public:
|
|||
virtual const char* profilerName();
|
||||
};
|
||||
|
||||
class SortAllChildrenSpriteSheet : public AddRemoveSpriteSheet
|
||||
{
|
||||
public:
|
||||
virtual void update(float dt);
|
||||
|
||||
virtual std::string title();
|
||||
virtual std::string subtitle();
|
||||
virtual const char* profilerName();
|
||||
};
|
||||
|
||||
void runNodeChildrenTest();
|
||||
|
||||
#endif // __PERFORMANCE_NODE_CHILDREN_TEST_H__
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1 -std=c++11
|
||||
APP_OPTIM := debug
|
||||
APP_ABI := armeabi
|
||||
|
||||
# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
|
||||
# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9
|
||||
APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix
|
||||
|
|
|
@ -653,8 +653,8 @@
|
|||
<listOptionValue builtIn="false" value="idn"/>
|
||||
<listOptionValue builtIn="false" value="box2d"/>
|
||||
<listOptionValue builtIn="false" value="chipmunk"/>
|
||||
<listOptionValue builtIn="false" value="websockets"/>
|
||||
<listOptionValue builtIn="false" value="sqlite3"/>
|
||||
<listOptionValue builtIn="false" value="websockets"/>
|
||||
</option>
|
||||
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.1522207769" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
|
||||
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
#include "cocos2d.h"
|
||||
#include "SimpleAudioEngine.h"
|
||||
#include "ScriptingCore.h"
|
||||
#include "generated/jsb_cocos2dx_auto.hpp"
|
||||
#include "generated/jsb_cocos2dx_extension_auto.hpp"
|
||||
#include "jsb_cocos2dx_auto.hpp"
|
||||
#include "jsb_cocos2dx_extension_auto.hpp"
|
||||
#include "jsb_cocos2dx_extension_manual.h"
|
||||
#include "cocos2d_specifics.hpp"
|
||||
#include "js_bindings_ccbreader.h"
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_JAVASCRIPT=1 -std=c++11
|
||||
APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 -DCC_ENABLE_CHIPMUNK_INTEGRATION=1
|
||||
|
||||
# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
|
||||
# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9
|
||||
APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;_DEBUG;DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
|
@ -131,7 +131,7 @@ xcopy "$(ProjectDir)..\..\Shared\games\CocosDragonJS\Published files Android" "$
|
|||
<ProxyFileName>testjs_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_JAVASCRIPT=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExceptionHandling>
|
||||
</ExceptionHandling>
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#include "cocos2d.h"
|
||||
#include "SimpleAudioEngine.h"
|
||||
#include "ScriptingCore.h"
|
||||
#include "generated/jsb_cocos2dx_auto.hpp"
|
||||
#include "generated/jsb_cocos2dx_extension_auto.hpp"
|
||||
#include "jsb_cocos2dx_auto.hpp"
|
||||
#include "jsb_cocos2dx_extension_auto.hpp"
|
||||
#include "jsb_cocos2dx_extension_manual.h"
|
||||
#include "cocos2d_specifics.hpp"
|
||||
#include "js_bindings_ccbreader.h"
|
||||
|
|
|
@ -1,4 +1,7 @@
|
|||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_JAVASCRIPT=1 -std=c++11
|
||||
APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 -DCC_ENABLE_CHIPMUNK_INTEGRATION=1
|
||||
|
||||
# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
|
||||
# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9
|
||||
APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;_DEBUG;DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
|
@ -131,7 +131,7 @@ xcopy "$(ProjectDir)..\..\Shared\games\CrystalCraze\Published-Android" "$(OutDir
|
|||
<ProxyFileName>testjs_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;CC_ENABLE_CHIPMUNK_INTEGRATION=1;COCOS2D_JAVASCRIPT=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExceptionHandling>
|
||||
</ExceptionHandling>
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#include "cocos2d.h"
|
||||
#include "SimpleAudioEngine.h"
|
||||
#include "ScriptingCore.h"
|
||||
#include "generated/jsb_cocos2dx_auto.hpp"
|
||||
#include "generated/jsb_cocos2dx_extension_auto.hpp"
|
||||
#include "jsb_cocos2dx_auto.hpp"
|
||||
#include "jsb_cocos2dx_extension_auto.hpp"
|
||||
#include "jsb_cocos2dx_extension_manual.h"
|
||||
#include "cocos2d_specifics.hpp"
|
||||
#include "js_bindings_ccbreader.h"
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_JAVASCRIPT= -std=c++11
|
||||
APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 -DCC_ENABLE_CHIPMUNK_INTEGRATION=1
|
||||
|
||||
# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
|
||||
# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9
|
||||
APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>.;..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>.;..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;_DEBUG;DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
|
@ -129,7 +129,7 @@ xcopy "$(ProjectDir)..\..\Shared\games\MoonWarriors" "$(OutDir)\MoonWarriorsRes\
|
|||
<ProxyFileName>testjs_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>.;..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>.;..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExceptionHandling>
|
||||
</ExceptionHandling>
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#include "cocos2d.h"
|
||||
#include "SimpleAudioEngine.h"
|
||||
#include "ScriptingCore.h"
|
||||
#include "generated/jsb_cocos2dx_auto.hpp"
|
||||
#include "generated/jsb_cocos2dx_extension_auto.hpp"
|
||||
#include "jsb_cocos2dx_auto.hpp"
|
||||
#include "jsb_cocos2dx_extension_auto.hpp"
|
||||
#include "jsb_cocos2dx_extension_manual.h"
|
||||
#include "cocos2d_specifics.hpp"
|
||||
#include "js_bindings_chipmunk_registration.h"
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_JAVASCRIPT=1 -std=c++11
|
||||
APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 -DCC_ENABLE_CHIPMUNK_INTEGRATION=1
|
||||
|
||||
# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
|
||||
# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9
|
||||
APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;DEBUG;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
|
@ -132,7 +132,7 @@ xcopy "$(ProjectDir)..\..\Shared\tests" "$(OutDir)\TestJavascriptRes\" /e /Y</Co
|
|||
<ProxyFileName>testjs_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExceptionHandling>
|
||||
</ExceptionHandling>
|
||||
|
|
|
@ -3,8 +3,8 @@
|
|||
#include "cocos2d.h"
|
||||
#include "SimpleAudioEngine.h"
|
||||
#include "ScriptingCore.h"
|
||||
#include "generated/jsb_cocos2dx_auto.hpp"
|
||||
#include "generated/jsb_cocos2dx_extension_auto.hpp"
|
||||
#include "jsb_cocos2dx_auto.hpp"
|
||||
#include "jsb_cocos2dx_extension_auto.hpp"
|
||||
#include "jsb_cocos2dx_extension_manual.h"
|
||||
#include "cocos2d_specifics.hpp"
|
||||
#include "js_bindings_chipmunk_registration.h"
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_JAVASCRIPT=1 -std=c++11
|
||||
APP_CPPFLAGS += -DCOCOS2D_DEBUG=1 -DCC_ENABLE_CHIPMUNK_INTEGRATION=1
|
||||
|
||||
# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
|
||||
# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9
|
||||
APP_CPPFLAGS := -frtti -DCC_ENABLE_CHIPMUNK_INTEGRATION=1 -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;_DEBUG;DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
|
@ -131,7 +131,7 @@ xcopy "$(ProjectDir)..\..\Shared\games\WatermelonWithMe" "$(OutDir)\WatermelonWi
|
|||
<ProxyFileName>testjs_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExceptionHandling>
|
||||
</ExceptionHandling>
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11
|
||||
|
||||
# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
|
||||
# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix
|
||||
|
||||
APP_CPPFLAGS += -fexceptions
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\..\extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\auto-generated\lua-bindings;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\..\extensions;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;_DEBUG;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
|
@ -119,7 +119,7 @@
|
|||
<ProxyFileName>HelloLua_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\auto-generated\lua-bindings;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;NDEBUG;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExceptionHandling>
|
||||
</ExceptionHandling>
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
APP_STL := gnustl_static
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11
|
||||
|
||||
# add -Wno-literal-suffix to avoid warning: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
|
||||
# in NDK_ROOT/arch-arm/usr/include/sys/cdefs_elf.h:35:28: when using ndk-r9
|
||||
APP_CPPFLAGS := -frtti -DCOCOS2D_DEBUG=1 -std=c++11 -Wno-literal-suffix
|
||||
|
||||
APP_CPPFLAGS += -fexceptions
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\external;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\auto-generated\lua-bindings;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\external;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
@ -113,7 +113,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\libwebsockets\win32\lib\*.*" "$(O
|
|||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\external;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\..\scripting\auto-generated\lua-bindings;$(ProjectDir)..\..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\external;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
|
|
@ -1 +1 @@
|
|||
38fdf944c7eb64841cc23feed33ac9ffd83bfd3a
|
||||
27494a13c3cc6a7f31b43439297899a79bda0a02
|
|
@ -23,8 +23,8 @@ LOCAL_SRC_FILES := ScriptingCore.cpp \
|
|||
jsb_opengl_functions.cpp \
|
||||
jsb_opengl_manual.cpp \
|
||||
jsb_opengl_registration.cpp \
|
||||
generated/jsb_cocos2dx_auto.cpp \
|
||||
generated/jsb_cocos2dx_extension_auto.cpp \
|
||||
../../auto-generated/js-bindings/jsb_cocos2dx_auto.cpp \
|
||||
../../auto-generated/js-bindings/jsb_cocos2dx_extension_auto.cpp \
|
||||
XMLHTTPRequest.cpp \
|
||||
jsb_websocket.cpp
|
||||
|
||||
|
@ -33,10 +33,11 @@ LOCAL_CFLAGS := -DCOCOS2D_JAVASCRIPT
|
|||
LOCAL_EXPORT_CFLAGS := -DCOCOS2D_JAVASCRIPT
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH) \
|
||||
$(LOCAL_PATH)/../../../CocosDenshion/include
|
||||
$(LOCAL_PATH)/../../../CocosDenshion/include \
|
||||
$(LOCAL_PATH)/../../auto-generated/js-bindings
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH) \
|
||||
$(LOCAL_PATH)/generated
|
||||
$(LOCAL_PATH)/../../auto-generated/js-bindings
|
||||
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := spidermonkey_static
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES += cocos_extension_static
|
||||
|
|
|
@ -1 +1 @@
|
|||
d4944c285d6219a01aa06f326168ae67d08b9cb0
|
||||
1a67569d3ade0153cccbfa71ca5ac5355d03fbd4
|
|
@ -11,10 +11,10 @@
|
|||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_auto.cpp" />
|
||||
<ClCompile Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_extension_auto.cpp" />
|
||||
<ClCompile Include="..\cocos2d_specifics.cpp" />
|
||||
<ClCompile Include="..\cocosjs_manual_conversions.cpp" />
|
||||
<ClCompile Include="..\generated\jsb_cocos2dx_auto.cpp" />
|
||||
<ClCompile Include="..\generated\jsb_cocos2dx_extension_auto.cpp" />
|
||||
<ClCompile Include="..\jsb_cocos2dx_extension_manual.cpp" />
|
||||
<ClCompile Include="..\jsb_opengl_functions.cpp" />
|
||||
<ClCompile Include="..\jsb_opengl_manual.cpp" />
|
||||
|
@ -34,10 +34,10 @@
|
|||
<ClCompile Include="..\XMLHTTPRequest.cpp" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_auto.hpp" />
|
||||
<ClInclude Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_extension_auto.hpp" />
|
||||
<ClInclude Include="..\cocos2d_specifics.hpp" />
|
||||
<ClInclude Include="..\cocosjs_manual_conversions.h" />
|
||||
<ClInclude Include="..\generated\jsb_cocos2dx_auto.hpp" />
|
||||
<ClInclude Include="..\generated\jsb_cocos2dx_extension_auto.hpp" />
|
||||
<ClInclude Include="..\jsb_cocos2dx_extension_manual.h" />
|
||||
<ClInclude Include="..\jsb_helper.h" />
|
||||
<ClInclude Include="..\jsb_opengl_functions.h" />
|
||||
|
@ -63,8 +63,8 @@
|
|||
<ClInclude Include="..\XMLHTTPRequest.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\generated\jsb_cocos2dx_auto_api.js" />
|
||||
<None Include="..\generated\jsb_cocos2dx_extension_auto_api.js" />
|
||||
<None Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_auto_api.js" />
|
||||
<None Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_extension_auto_api.js" />
|
||||
<None Include="..\js\jsb.js" />
|
||||
<None Include="..\js\jsb_chipmunk.js" />
|
||||
<None Include="..\js\jsb_cocos2d.js" />
|
||||
|
@ -126,7 +126,7 @@
|
|||
<WarningLevel>Level3</WarningLevel>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;_LIB;DEBUG;COCOS2D_DEBUG=1;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..;$(ProjectDir)..\..\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\extensions\LocalStorage;$(ProjectDir)..\..\..\..\extensions\network;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..;$(ProjectDir)..\..\spidermonkey-win32\include;$(ProjectDir)..\..\..\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\extensions\LocalStorage;$(ProjectDir)..\..\..\..\extensions\network;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
|
@ -149,7 +149,7 @@ xcopy /Y /Q "$(ProjectDir)..\..\..\..\external\sqlite3\libraries\win32\*.*" "$(O
|
|||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;NDEBUG;_LIB;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..;$(ProjectDir)..\..\spidermonkey-win32\include;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\extensions\LocalStorage;$(ProjectDir)..\..\..\..\extensions\network;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\..\cocos2dx;$(ProjectDir)..\..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\..\CocosDenshion\include;$(ProjectDir)..;$(ProjectDir)..\..\spidermonkey-win32\include;$(ProjectDir)..\..\..\auto-generated\js-bindings;$(ProjectDir)..\..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\..\..\..\extensions;$(ProjectDir)..\..\..\..\extensions\LocalStorage;$(ProjectDir)..\..\..\..\extensions\network;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<DisableSpecificWarnings>4068;4101;4800;4251;4244;%(DisableSpecificWarnings)</DisableSpecificWarnings>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
</ClCompile>
|
||||
|
|
|
@ -50,12 +50,6 @@
|
|||
<ClCompile Include="..\js_bindings_system_registration.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\generated\jsb_cocos2dx_auto.cpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\generated\jsb_cocos2dx_extension_auto.cpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\jsb_cocos2dx_extension_manual.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
|
@ -77,6 +71,12 @@
|
|||
<ClCompile Include="..\jsb_websocket.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_auto.cpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_extension_auto.cpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\cocos2d_specifics.hpp">
|
||||
|
@ -130,12 +130,6 @@
|
|||
<ClInclude Include="..\js_bindings_system_registration.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\generated\jsb_cocos2dx_auto.hpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\generated\jsb_cocos2dx_extension_auto.hpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\jsb_cocos2dx_extension_manual.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
|
@ -160,14 +154,14 @@
|
|||
<ClInclude Include="..\jsb_helper.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_auto.hpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_extension_auto.hpp">
|
||||
<Filter>generated</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\generated\jsb_cocos2dx_extension_auto_api.js">
|
||||
<Filter>generated</Filter>
|
||||
</None>
|
||||
<None Include="..\generated\jsb_cocos2dx_auto_api.js">
|
||||
<Filter>generated</Filter>
|
||||
</None>
|
||||
<None Include="..\js\jsb.js">
|
||||
<Filter>js</Filter>
|
||||
</None>
|
||||
|
@ -195,5 +189,11 @@
|
|||
<None Include="..\js\main.debug.js">
|
||||
<Filter>js</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_auto_api.js">
|
||||
<Filter>generated</Filter>
|
||||
</None>
|
||||
<None Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_extension_auto_api.js">
|
||||
<Filter>generated</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -32,7 +32,6 @@ extern "C" {
|
|||
#include "tolua_fix.h"
|
||||
}
|
||||
|
||||
#include "LuaCocos2d.h"
|
||||
#include "Cocos2dxLuaLoader.h"
|
||||
|
||||
#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS || CC_TARGET_PLATFORM == CC_PLATFORM_MAC)
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
b301dd3607b8b0142ecf3fc016dd7dad2aa86094
|
|
@ -1,14 +0,0 @@
|
|||
#ifndef __LUACOCOS2D_H_
|
||||
#define __LUACOCOS2D_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "tolua++.h"
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
TOLUA_API int tolua_Cocos2d_open(lua_State* tolua_S);
|
||||
|
||||
#endif // __LUACOCOS2D_H_
|
|
@ -1 +0,0 @@
|
|||
4e23e7721dd23b8489519fc2a157d788816ce2a6
|
File diff suppressed because it is too large
Load Diff
|
@ -1 +0,0 @@
|
|||
3f25cfd8abdf3c402c85820be60a0ec78c8ff190
|
|
@ -1 +0,0 @@
|
|||
0389c415199783d5bbcc1ee8882cc01220bc37f6
|
|
@ -1,406 +0,0 @@
|
|||
#ifndef __cocos2dx_extension_h__
|
||||
#define __cocos2dx_extension_h__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
#include "tolua++.h"
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
int register_all_cocos2dx_extension(lua_State* tolua_S);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
#endif // __cocos2dx_extension_h__
|
File diff suppressed because it is too large
Load Diff
|
@ -10,7 +10,6 @@ LOCAL_SRC_FILES := ../cocos2dx_support/CCLuaBridge.cpp \
|
|||
../cocos2dx_support/CCLuaStack.cpp \
|
||||
../cocos2dx_support/CCLuaValue.cpp \
|
||||
../cocos2dx_support/Cocos2dxLuaLoader.cpp \
|
||||
../cocos2dx_support/LuaCocos2d.cpp \
|
||||
../cocos2dx_support/CCBProxy.cpp \
|
||||
../cocos2dx_support/Lua_extensions_CCB.cpp \
|
||||
../cocos2dx_support/Lua_web_socket.cpp \
|
||||
|
@ -18,8 +17,8 @@ LOCAL_SRC_FILES := ../cocos2dx_support/CCLuaBridge.cpp \
|
|||
../cocos2dx_support/LuaScrollView.cpp \
|
||||
../cocos2dx_support/LuaScriptHandlerMgr.cpp \
|
||||
../cocos2dx_support/LuaBasicConversions.cpp \
|
||||
../cocos2dx_support/generated/lua_cocos2dx_auto.cpp \
|
||||
../cocos2dx_support/generated/lua_cocos2dx_extension_auto.cpp \
|
||||
../../auto-generated/lua-bindings/lua_cocos2dx_auto.cpp \
|
||||
../../auto-generated/lua-bindings/lua_cocos2dx_extension_auto.cpp \
|
||||
../cocos2dx_support/lua_cocos2dx_manual.cpp \
|
||||
../cocos2dx_support/lua_cocos2dx_extension_manual.cpp \
|
||||
../cocos2dx_support/lua_cocos2dx_deprecated.cpp \
|
||||
|
@ -29,12 +28,13 @@ LOCAL_SRC_FILES := ../cocos2dx_support/CCLuaBridge.cpp \
|
|||
../tolua/tolua_push.c \
|
||||
../tolua/tolua_to.c \
|
||||
../cocos2dx_support/tolua_fix.c
|
||||
|
||||
|
||||
LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)/../luajit/include \
|
||||
$(LOCAL_PATH)/../tolua \
|
||||
$(LOCAL_PATH)/../cocos2dx_support
|
||||
|
||||
|
||||
$(LOCAL_PATH)/../cocos2dx_support \
|
||||
$(LOCAL_PATH)/../../auto-generated/lua-bindings
|
||||
|
||||
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/ \
|
||||
$(LOCAL_PATH)/../luajit/include \
|
||||
$(LOCAL_PATH)/../tolua \
|
||||
|
@ -46,7 +46,7 @@ LOCAL_C_INCLUDES := $(LOCAL_PATH)/ \
|
|||
$(LOCAL_PATH)/../../../CocosDenshion/include \
|
||||
$(LOCAL_PATH)/../../../extensions \
|
||||
$(LOCAL_PATH)/../cocos2dx_support \
|
||||
$(LOCAL_PATH)/../cocos2dx_support/generated
|
||||
$(LOCAL_PATH)/../../auto-generated/lua-bindings
|
||||
|
||||
|
||||
LOCAL_WHOLE_STATIC_LIBRARIES := luajit_static
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
TARGET = liblua.so
|
||||
|
||||
INCLUDES += -I.. -I../lua -I../tolua -I../cocos2dx_support -I../cocos2dx_support/generated \
|
||||
INCLUDES += -I.. -I../lua -I../tolua -I../cocos2dx_support -I../../auto-generated/lua-bindings \
|
||||
-I../Classes -I../../../CocosDenshion/include -I../../../extensions
|
||||
|
||||
SOURCES = ../lua/lapi.o \
|
||||
SOURCES = ../lua/lapi.c \
|
||||
../lua/lauxlib.c \
|
||||
../lua/lbaselib.c \
|
||||
../lua/lcode.c \
|
||||
|
@ -39,20 +39,19 @@ SOURCES = ../lua/lapi.o \
|
|||
../tolua/tolua_push.c \
|
||||
../tolua/tolua_to.c \
|
||||
../cocos2dx_support/tolua_fix.c \
|
||||
../../auto-generated/lua-bindings/lua_cocos2dx_auto.cpp \
|
||||
../../auto-generated/lua-bindings/lua_cocos2dx_extension_auto.cpp \
|
||||
../cocos2dx_support/CCLuaBridge.cpp \
|
||||
../cocos2dx_support/CCLuaEngine.cpp \
|
||||
../cocos2dx_support/CCLuaStack.cpp \
|
||||
../cocos2dx_support/CCLuaValue.cpp \
|
||||
../cocos2dx_support/Cocos2dxLuaLoader.cpp \
|
||||
../cocos2dx_support/LuaCocos2d.cpp \
|
||||
../cocos2dx_support/CCBProxy.cpp \
|
||||
../cocos2dx_support/Lua_extensions_CCB.cpp \
|
||||
../cocos2dx_support/LuaOpengl.cpp \
|
||||
../cocos2dx_support/LuaScrollView.cpp \
|
||||
../cocos2dx_support/LuaScriptHandlerMgr.cpp \
|
||||
../cocos2dx_support/LuaBasicConversions.cpp \
|
||||
../cocos2dx_support/generated/lua_cocos2dx_auto.cpp \
|
||||
../cocos2dx_support/generated/lua_cocos2dx_extension_auto.cpp \
|
||||
../cocos2dx_support/lua_cocos2dx_manual.cpp \
|
||||
../cocos2dx_support/lua_cocos2dx_extension_manual.cpp \
|
||||
../cocos2dx_support/lua_cocos2dx_deprecated.cpp
|
||||
|
@ -67,6 +66,10 @@ $(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST)
|
|||
@mkdir -p $(@D)
|
||||
$(CXX) $(CXXFLAGS) $(OBJECTS) -shared -o $@ $(SHAREDLIBS) $(STATICLIBS)
|
||||
|
||||
$(OBJ_DIR)/%.o: ../../%.cpp $(CORE_MAKEFILE_LIST)
|
||||
@mkdir -p $(@D)
|
||||
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
|
||||
|
||||
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
|
||||
@mkdir -p $(@D)
|
||||
$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
TARGET = liblua.so
|
||||
|
||||
INCLUDES += -I.. -I../lua -I../tolua -I../cocos2dx_support -I../cocos2dx_support/generated \
|
||||
INCLUDES += -I.. -I../lua -I../tolua -I../cocos2dx_support -I../../auto-generated/lua-bindings \
|
||||
-I../Classes -I../../../CocosDenshion/include -I../../../extensions -I../../../external/chipmunk/include/chipmunk
|
||||
|
||||
SOURCES = ../lua/lapi.o \
|
||||
SOURCES = ../lua/lapi.c \
|
||||
../lua/lauxlib.c \
|
||||
../lua/lbaselib.c \
|
||||
../lua/lcode.c \
|
||||
|
@ -39,24 +39,24 @@ SOURCES = ../lua/lapi.o \
|
|||
../tolua/tolua_push.c \
|
||||
../tolua/tolua_to.c \
|
||||
../cocos2dx_support/tolua_fix.c \
|
||||
../../auto-generated/lua-bindings/lua_cocos2dx_auto.cpp \
|
||||
../../auto-generated/lua-bindings/lua_cocos2dx_extension_auto.cpp \
|
||||
../cocos2dx_support/CCLuaBridge.cpp \
|
||||
../cocos2dx_support/CCLuaEngine.cpp \
|
||||
../cocos2dx_support/CCLuaStack.cpp \
|
||||
../cocos2dx_support/CCLuaValue.cpp \
|
||||
../cocos2dx_support/Cocos2dxLuaLoader.cpp \
|
||||
../cocos2dx_support/LuaCocos2d.cpp \
|
||||
../cocos2dx_support/CCBProxy.cpp \
|
||||
../cocos2dx_support/Lua_extensions_CCB.cpp \
|
||||
../cocos2dx_support/LuaOpengl.cpp \
|
||||
../cocos2dx_support/LuaScrollView.cpp \
|
||||
../cocos2dx_support/LuaScriptHandlerMgr.cpp \
|
||||
../cocos2dx_support/LuaBasicConversions.cpp \
|
||||
../cocos2dx_support/generated/lua_cocos2dx_auto.cpp \
|
||||
../cocos2dx_support/generated/lua_cocos2dx_extension_auto.cpp \
|
||||
../cocos2dx_support/lua_cocos2dx_manual.cpp \
|
||||
../cocos2dx_support/lua_cocos2dx_extension_manual.cpp \
|
||||
../cocos2dx_support/lua_cocos2dx_deprecated.cpp
|
||||
|
||||
|
||||
include ../../../cocos2dx/proj.linux/cocos2dx.mk
|
||||
|
||||
TARGET := $(LIB_DIR)/$(TARGET)
|
||||
|
@ -68,6 +68,10 @@ $(TARGET): $(OBJECTS) $(CORE_MAKEFILE_LIST)
|
|||
@mkdir -p $(@D)
|
||||
$(LOG_LINK)$(CXX) $(CXXFLAGS) $(OBJECTS) -shared -o $@ $(SHAREDLIBS) $(STATICLIBS)
|
||||
|
||||
$(OBJ_DIR)/%.o: ../../%.cpp $(CORE_MAKEFILE_LIST)
|
||||
@mkdir -p $(@D)
|
||||
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
|
||||
|
||||
$(OBJ_DIR)/%.o: ../%.cpp $(CORE_MAKEFILE_LIST)
|
||||
@mkdir -p $(@D)
|
||||
$(LOG_CXX)$(CXX) $(CXXFLAGS) $(INCLUDES) $(DEFINES) -c $< -o $@
|
||||
|
|
|
@ -62,7 +62,7 @@
|
|||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\extensions\network;$(ProjectDir)..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\tolua;$(ProjectDir)..\luajit\include;$(ProjectDir)..\cocos2dx_support\generated;$(ProjectDir)..\cocos2dx_support;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\extensions\network;$(ProjectDir)..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\tolua;$(ProjectDir)..\luajit\include;$(ProjectDir)..\..\auto-generated\lua-bindings;$(ProjectDir)..\cocos2dx_support;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;_DEBUG;COCOS2D_DEBUG=1;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
|
@ -94,7 +94,7 @@ xcopy /Y /Q "$(ProjectDir)..\luajit\win32\*.*" "$(OutDir)"</Command>
|
|||
<ClCompile>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\extensions\network;$(ProjectDir)..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\tolua;$(ProjectDir)..\luajit\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\pthread;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\extensions\network;$(ProjectDir)..\..\..\external\libwebsockets\win32\include;$(ProjectDir)..\tolua;$(ProjectDir)..\luajit\include;$(ProjectDir)..\..\auto-generated\lua-bindings;$(ProjectDir)..\cocos2dx_support;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;LIBLUA_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
|
||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||
|
@ -122,19 +122,19 @@ xcopy /Y /Q "$(ProjectDir)..\luajit\win32\*.*" "$(OutDir)"</Command>
|
|||
</PreBuildEvent>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_auto.cpp" />
|
||||
<ClCompile Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_extension_auto.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\CCBProxy.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\CCLuaBridge.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\CCLuaEngine.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\CCLuaStack.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\CCLuaValue.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\Cocos2dxLuaLoader.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\generated\lua_cocos2dx_auto.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\generated\lua_cocos2dx_extension_auto.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\LuaBasicConversions.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\LuaCocos2d.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\LuaOpengl.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\LuaScriptHandlerMgr.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\LuaScrollView.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\lua_cocos2dx_deprecated.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\lua_cocos2dx_extension_manual.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\lua_cocos2dx_manual.cpp" />
|
||||
<ClCompile Include="..\cocos2dx_support\Lua_extensions_CCB.cpp" />
|
||||
|
@ -147,19 +147,19 @@ xcopy /Y /Q "$(ProjectDir)..\luajit\win32\*.*" "$(OutDir)"</Command>
|
|||
<ClCompile Include="..\tolua\tolua_to.c" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_auto.hpp" />
|
||||
<ClInclude Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_extension_auto.hpp" />
|
||||
<ClInclude Include="..\cocos2dx_support\CCBProxy.h" />
|
||||
<ClInclude Include="..\cocos2dx_support\CCLuaBridge.h" />
|
||||
<ClInclude Include="..\cocos2dx_support\CCLuaEngine.h" />
|
||||
<ClInclude Include="..\cocos2dx_support\CCLuaStack.h" />
|
||||
<ClInclude Include="..\cocos2dx_support\CCLuaValue.h" />
|
||||
<ClInclude Include="..\cocos2dx_support\Cocos2dxLuaLoader.h" />
|
||||
<ClInclude Include="..\cocos2dx_support\generated\lua_cocos2dx_auto.hpp" />
|
||||
<ClInclude Include="..\cocos2dx_support\generated\lua_cocos2dx_extension_auto.hpp" />
|
||||
<ClInclude Include="..\cocos2dx_support\LuaBasicConversions.h" />
|
||||
<ClInclude Include="..\cocos2dx_support\LuaCocos2d.h" />
|
||||
<ClInclude Include="..\cocos2dx_support\LuaOpengl.h" />
|
||||
<ClInclude Include="..\cocos2dx_support\LuaScriptHandlerMgr.h" />
|
||||
<ClInclude Include="..\cocos2dx_support\LuaScrollView.h" />
|
||||
<ClInclude Include="..\cocos2dx_support\lua_cocos2dx_deprecated.h" />
|
||||
<ClInclude Include="..\cocos2dx_support\lua_cocos2dx_extension_manual.h" />
|
||||
<ClInclude Include="..\cocos2dx_support\lua_cocos2dx_manual.hpp" />
|
||||
<ClInclude Include="..\cocos2dx_support\Lua_extensions_CCB.h" />
|
||||
|
@ -172,6 +172,10 @@ xcopy /Y /Q "$(ProjectDir)..\luajit\win32\*.*" "$(OutDir)"</Command>
|
|||
<ClInclude Include="..\tolua\tolua++.h" />
|
||||
<ClInclude Include="..\tolua\tolua_event.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_auto_api.js" />
|
||||
<None Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_extension_auto_api.js" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
|
|
|
@ -39,9 +39,6 @@
|
|||
<ClCompile Include="..\cocos2dx_support\Cocos2dxLuaLoader.cpp">
|
||||
<Filter>cocos2dx_support</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\cocos2dx_support\LuaCocos2d.cpp">
|
||||
<Filter>cocos2dx_support</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\cocos2dx_support\tolua_fix.c">
|
||||
<Filter>cocos2dx_support</Filter>
|
||||
</ClCompile>
|
||||
|
@ -81,12 +78,15 @@
|
|||
<ClCompile Include="..\cocos2dx_support\LuaBasicConversions.cpp">
|
||||
<Filter>cocos2dx_support</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\cocos2dx_support\generated\lua_cocos2dx_auto.cpp">
|
||||
<ClCompile Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_auto.cpp">
|
||||
<Filter>cocos2dx_support\generated</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\cocos2dx_support\generated\lua_cocos2dx_extension_auto.cpp">
|
||||
<ClCompile Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_extension_auto.cpp">
|
||||
<Filter>cocos2dx_support\generated</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\cocos2dx_support\lua_cocos2dx_deprecated.cpp">
|
||||
<Filter>cocos2dx_support</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="..\tolua\tolua++.h">
|
||||
|
@ -101,9 +101,6 @@
|
|||
<ClInclude Include="..\cocos2dx_support\Cocos2dxLuaLoader.h">
|
||||
<Filter>cocos2dx_support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\cocos2dx_support\LuaCocos2d.h">
|
||||
<Filter>cocos2dx_support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\cocos2dx_support\tolua_fix.h">
|
||||
<Filter>cocos2dx_support</Filter>
|
||||
</ClInclude>
|
||||
|
@ -155,11 +152,22 @@
|
|||
<ClInclude Include="..\cocos2dx_support\LuaBasicConversions.h">
|
||||
<Filter>cocos2dx_support</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\cocos2dx_support\generated\lua_cocos2dx_auto.hpp">
|
||||
<ClInclude Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_auto.hpp">
|
||||
<Filter>cocos2dx_support\generated</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\cocos2dx_support\generated\lua_cocos2dx_extension_auto.hpp">
|
||||
<ClInclude Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_extension_auto.hpp">
|
||||
<Filter>cocos2dx_support\generated</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\cocos2dx_support\lua_cocos2dx_deprecated.h">
|
||||
<Filter>cocos2dx_support</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_auto_api.js">
|
||||
<Filter>cocos2dx_support\generated</Filter>
|
||||
</None>
|
||||
<None Include="..\..\auto-generated\lua-bindings\lua_cocos2dx_extension_auto_api.js">
|
||||
<Filter>cocos2dx_support\generated</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -3,8 +3,8 @@
|
|||
#include "cocos2d.h"
|
||||
#include "SimpleAudioEngine.h"
|
||||
#include "ScriptingCore.h"
|
||||
#include "generated/jsb_cocos2dx_auto.hpp"
|
||||
#include "generated/jsb_cocos2dx_extension_auto.hpp"
|
||||
#include "jsb_cocos2dx_auto.hpp"
|
||||
#include "jsb_cocos2dx_extension_auto.hpp"
|
||||
#include "jsb_cocos2dx_extension_manual.h"
|
||||
#include "cocos2d_specifics.hpp"
|
||||
#include "js_bindings_chipmunk_registration.h"
|
||||
|
|
|
@ -683,6 +683,7 @@
|
|||
"$(SRCROOT)/../../../cocos2dx/platform/ios",
|
||||
"$(SRCROOT)/../../../external/chipmunk/include/chipmunk",
|
||||
"$(SRCROOT)/../../../scripting/javascript/spidermonkey-ios/include",
|
||||
"$(SRCROOT)/../../../scripting/auto-generated/js-bindings",
|
||||
"$(SRCROOT)/../../../scripting/javascript/bindings",
|
||||
"$(SRCROOT)/../../../extensions",
|
||||
);
|
||||
|
@ -732,6 +733,7 @@
|
|||
"$(SRCROOT)/../../../cocos2dx/platform/ios",
|
||||
"$(SRCROOT)/../../../external/chipmunk/include/chipmunk",
|
||||
"$(SRCROOT)/../../../scripting/javascript/spidermonkey-ios/include",
|
||||
"$(SRCROOT)/../../../scripting/auto-generated/js-bindings",
|
||||
"$(SRCROOT)/../../../scripting/javascript/bindings",
|
||||
"$(SRCROOT)/../../../extensions",
|
||||
);
|
||||
|
|
|
@ -77,7 +77,7 @@
|
|||
</Midl>
|
||||
<ClCompile>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;DEBUG;_DEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_DEBUG=1;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<MinimalRebuild>false</MinimalRebuild>
|
||||
<BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
|
||||
|
@ -131,7 +131,7 @@ xcopy "$(ProjectDir)..\Resources" "$(OutDir)\HelloJavascriptRes\" /e /Y</Command
|
|||
<ProxyFileName>game_p.c</ProxyFileName>
|
||||
</Midl>
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\scripting\javascript\spidermonkey-win32\include;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\extensions;$(ProjectDir)..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\scripting\javascript\bindings;$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>WIN32;_WINDOWS;STRICT;NDEBUG;XP_WIN;JS_HAVE___INTN;JS_INTPTR_TYPE=int;COCOS2D_JAVASCRIPT=1;CC_ENABLE_CHIPMUNK_INTEGRATION=1;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<ExceptionHandling>
|
||||
</ExceptionHandling>
|
||||
|
|
|
@ -34,6 +34,7 @@
|
|||
1AC3623816D47C5C000847F2 /* land.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AC3622C16D47C5C000847F2 /* land.png */; };
|
||||
1AC3623916D47C5C000847F2 /* menu1.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AC3622D16D47C5C000847F2 /* menu1.png */; };
|
||||
1AC3623A16D47C5C000847F2 /* menu2.png in Resources */ = {isa = PBXBuildFile; fileRef = 1AC3622E16D47C5C000847F2 /* menu2.png */; };
|
||||
1ADB273817CCA0C200634B5E /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ADB273717CCA0C200634B5E /* Cocos2d.lua */; };
|
||||
1AF4C3F21786633E00122817 /* libchipmunk iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3DF1786631700122817 /* libchipmunk iOS.a */; };
|
||||
1AF4C3F31786633E00122817 /* libcocos2dx iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3DB1786631700122817 /* libcocos2dx iOS.a */; };
|
||||
1AF4C3F41786633E00122817 /* libcocos2dx-extensions iOS.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AF4C3DD1786631700122817 /* libcocos2dx-extensions iOS.a */; };
|
||||
|
@ -218,6 +219,7 @@
|
|||
1AC3622C16D47C5C000847F2 /* land.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = land.png; path = ../Resources/land.png; sourceTree = "<group>"; };
|
||||
1AC3622D16D47C5C000847F2 /* menu1.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = menu1.png; path = ../Resources/menu1.png; sourceTree = "<group>"; };
|
||||
1AC3622E16D47C5C000847F2 /* menu2.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; name = menu2.png; path = ../Resources/menu2.png; sourceTree = "<group>"; };
|
||||
1ADB273717CCA0C200634B5E /* Cocos2d.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = Cocos2d.lua; path = ../../../scripting/lua/script/Cocos2d.lua; sourceTree = "<group>"; };
|
||||
1AF4C3B8178662A500122817 /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = "<group>"; };
|
||||
1AF4C3B91786631600122817 /* cocos2d_libs.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; name = cocos2d_libs.xcodeproj; path = ../../../cocos2d_libs.xcodeproj; sourceTree = "<group>"; };
|
||||
1AF4C402178663F200122817 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; };
|
||||
|
@ -270,6 +272,7 @@
|
|||
children = (
|
||||
1A0227A517A3AA3500B867AD /* AudioEngine.lua */,
|
||||
1A0227A617A3AA3500B867AD /* CCBReaderLoad.lua */,
|
||||
1ADB273717CCA0C200634B5E /* Cocos2d.lua */,
|
||||
1A0227A717A3AA3500B867AD /* Cocos2dConstants.lua */,
|
||||
1A0227A817A3AA3500B867AD /* Deprecated.lua */,
|
||||
1A0227A917A3AA3500B867AD /* DrawPrimitives.lua */,
|
||||
|
@ -575,6 +578,7 @@
|
|||
1A0227B017A3AA3500B867AD /* DrawPrimitives.lua in Resources */,
|
||||
1A0227B117A3AA3500B867AD /* Opengl.lua in Resources */,
|
||||
1A0227B217A3AA3500B867AD /* OpenglConstants.lua in Resources */,
|
||||
1ADB273817CCA0C200634B5E /* Cocos2d.lua in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
@ -715,6 +719,7 @@
|
|||
"\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"",
|
||||
"\"$(SRCROOT)/../../../scripting/lua/tolua\"",
|
||||
"\"$(SRCROOT)/../../../scripting/lua/luajit/include\"",
|
||||
"\"$(SRCROOT)/../../../scripting/auto-generated/lua-bindings\"",
|
||||
"\"$(SRCROOT)/../../../scripting/lua/cocos2dx_support\"",
|
||||
"\"$(SRCROOT)/../../../cocos2dx/platform/ios\"",
|
||||
"\"$(SRCROOT)/../../../cocos2dx/include\"",
|
||||
|
@ -765,6 +770,7 @@
|
|||
"\"$(SRCROOT)/../../../cocos2dx/kazmath/include\"",
|
||||
"\"$(SRCROOT)/../../../scripting/lua/tolua\"",
|
||||
"\"$(SRCROOT)/../../../scripting/lua/luajit/include\"",
|
||||
"\"$(SRCROOT)/../../../scripting/auto-generated/lua-bindings\"",
|
||||
"\"$(SRCROOT)/../../../scripting/lua/cocos2dx_support\"",
|
||||
"\"$(SRCROOT)/../../../cocos2dx/platform/ios\"",
|
||||
"\"$(SRCROOT)/../../../cocos2dx/include\"",
|
||||
|
|
|
@ -46,6 +46,7 @@
|
|||
15A02F7517A64DFB0035E92B /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 15A02F6F17A64DFB0035E92B /* main.m */; };
|
||||
15A02F7B17A64E2A0035E92B /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 15A02F7717A64E2A0035E92B /* InfoPlist.strings */; };
|
||||
15A02F7C17A64E2A0035E92B /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 15A02F7917A64E2A0035E92B /* MainMenu.xib */; };
|
||||
1ADB273B17CCA0F500634B5E /* Cocos2d.lua in Resources */ = {isa = PBXBuildFile; fileRef = 1ADB273A17CCA0F500634B5E /* Cocos2d.lua */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
|
@ -224,6 +225,7 @@
|
|||
15A02F7A17A64E2A0035E92B /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = MainMenu.xib; sourceTree = "<group>"; };
|
||||
15A02F7D17A64EF30035E92B /* Prefix.pch */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Prefix.pch; sourceTree = "<group>"; };
|
||||
15A02FAA17A65D810035E92B /* OpenAL.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = OpenAL.framework; path = System/Library/Frameworks/OpenAL.framework; sourceTree = SDKROOT; };
|
||||
1ADB273A17CCA0F500634B5E /* Cocos2d.lua */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = Cocos2d.lua; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
|
@ -256,6 +258,7 @@
|
|||
children = (
|
||||
1501825217A74F8000E674E5 /* AudioEngine.lua */,
|
||||
1501825317A74F8000E674E5 /* CCBReaderLoad.lua */,
|
||||
1ADB273A17CCA0F500634B5E /* Cocos2d.lua */,
|
||||
1501825417A74F8000E674E5 /* Cocos2dConstants.lua */,
|
||||
1501825517A74F8000E674E5 /* Deprecated.lua */,
|
||||
1501825617A74F8000E674E5 /* DrawPrimitives.lua */,
|
||||
|
@ -561,6 +564,7 @@
|
|||
1501825D17A74F8000E674E5 /* DrawPrimitives.lua in Resources */,
|
||||
1501825E17A74F8000E674E5 /* Opengl.lua in Resources */,
|
||||
1501825F17A74F8000E674E5 /* OpenglConstants.lua in Resources */,
|
||||
1ADB273B17CCA0F500634B5E /* Cocos2d.lua in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<ClCompile>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\external;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\CocosDenshion\include;$(ProjectDir)..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\scripting\lua\lua;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<AdditionalIncludeDirectories>$(ProjectDir)..\Classes;$(ProjectDir)..\..\..\scripting\auto-generated\js-bindings;$(ProjectDir)..\..\..\scripting\lua\cocos2dx_support;$(ProjectDir)..\..\..\scripting\lua\lua;$(ProjectDir)..\..\..\scripting\lua\tolua;$(ProjectDir)..\..\..\scripting\lua\src;$(ProjectDir)..\..\..\cocos2dx;$(ProjectDir)..\..\..\cocos2dx\include;$(ProjectDir)..\..\..\cocos2dx\kazmath\include;$(ProjectDir)..\..\..\cocos2dx\platform\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32;$(ProjectDir)..\..\..\cocos2dx\platform\third_party\win32\OGLES;$(ProjectDir)..\..\..\external;$(ProjectDir)..\..\..\external\chipmunk\include\chipmunk;$(ProjectDir)..\..\..\CocosDenshion\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PrecompiledHeader>
|
||||
</PrecompiledHeader>
|
||||
<WarningLevel>Level3</WarningLevel>
|
||||
|
|
|
@ -21,4 +21,8 @@
|
|||
'mkfile' : 'external/chipmunk/Android.mk',
|
||||
'pathes' : ("external/chipmunk/",),
|
||||
},
|
||||
{
|
||||
'mkfile' : 'cocos2dx/platform/android/Android.mk',
|
||||
'pathes' : ('cocos2dx/platform/android/',),
|
||||
},
|
||||
]
|
|
@ -0,0 +1,15 @@
|
|||
prefix=/usr/local
|
||||
EXEC_FILES=git-archive-all
|
||||
|
||||
all:
|
||||
@echo "usage: make install"
|
||||
@echo " make uninstall"
|
||||
|
||||
install:
|
||||
install -d -m 0755 $(prefix)/bin
|
||||
install -m 0755 $(EXEC_FILES) $(prefix)/bin
|
||||
|
||||
uninstall:
|
||||
test -d $(prefix)/bin && \
|
||||
cd $(prefix)/bin && \
|
||||
rm -f ${EXEC_FILES}
|
|
@ -0,0 +1,21 @@
|
|||
Creates archive from the current state using `git ls-files --cached --full-name --no-empty-directory`. Supports for any level of submodules tree. Files from submodules are extracted using the same command.
|
||||
|
||||
*License:* MIT
|
||||
|
||||
*Usage:* `git-archive-all [-v] [--prefix PREFIX] [--no-exclude] [--force-submodules] [--dry-run] OUTPUT_FILE`
|
||||
|
||||
*Options:*
|
||||
|
||||
**--version** Show program's version number and exit.
|
||||
|
||||
**-h, --help** Show this help message and exit.
|
||||
|
||||
**--prefix=PREFIX** Prepend PREFIX to each filename in the archive. OUTPUT_FILE name is used by default to avoid tarbomb.
|
||||
|
||||
**--force-submodules** Force a `git submodule init && git submodule update` at each level before iterating submodules
|
||||
|
||||
**-v, --verbose** Enable verbose mode.
|
||||
|
||||
**--no-exclude** Don't read .gitattributes files for patterns containing export-ignore attributes.
|
||||
|
||||
**--dry-run** Don't actually archive anything, just show what would be done.
|
|
@ -0,0 +1,464 @@
|
|||
#! /usr/bin/env python
|
||||
# coding=utf-8
|
||||
|
||||
from __future__ import print_function
|
||||
from __future__ import unicode_literals
|
||||
|
||||
__version__ = "1.7"
|
||||
|
||||
import sys
|
||||
from os import path, extsep
|
||||
from subprocess import Popen, PIPE, CalledProcessError
|
||||
|
||||
|
||||
class GitArchiver(object):
|
||||
"""
|
||||
GitArchiver
|
||||
|
||||
Scan a git repository and export all tracked files, and submodules.
|
||||
Checks for .gitattributes files in each directory and uses 'export-ignore'
|
||||
pattern entries for ignore files in the archive.
|
||||
|
||||
Automatically detects output format extension: zip, tar, bz2, or gz.
|
||||
"""
|
||||
|
||||
def __init__(self, prefix='', verbose=False, exclude=True, force_sub=False, extra=None, main_repo_abspath=None):
|
||||
"""
|
||||
@type prefix: string
|
||||
@param prefix: Prefix used to prepend all paths in the resulting archive.
|
||||
|
||||
@type verbose: bool
|
||||
@param verbose: Determines verbosity of the output (stdout).
|
||||
|
||||
@type exclude: bool
|
||||
@param exclude: Determines whether archiver should follow rules specified in .gitattributes files.
|
||||
Defaults to True.
|
||||
|
||||
@type force_sub: bool
|
||||
@param force_sub: Determines whether submodules are initialized and updated before archiving.
|
||||
Defaults to False
|
||||
|
||||
@type extra: list
|
||||
@param extra: List of extra paths to include in the resulting archive.
|
||||
|
||||
@type main_repo_abspath: string
|
||||
@param main_repo_abspath: Absolute path to the main repository (or one of subdirectories).
|
||||
If None, current cwd is used.
|
||||
If given path is path to a subdirectory (but not a submodule directory!)
|
||||
it will be replaced with abspath to toplevel directory of the repository.
|
||||
"""
|
||||
if extra is None:
|
||||
extra = []
|
||||
|
||||
if main_repo_abspath is None:
|
||||
main_repo_abspath = path.abspath('')
|
||||
elif not path.isabs(main_repo_abspath):
|
||||
raise ValueError("You MUST pass absolute path to the main git repository.")
|
||||
|
||||
# Raises an exception if there is no repo under main_repo_abspath.
|
||||
try:
|
||||
self.run_shell("[ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1", main_repo_abspath)
|
||||
except Exception as e:
|
||||
raise ValueError("Not a git repository (or any of the parent directories).".format(path=main_repo_abspath))
|
||||
|
||||
# Detect toplevel directory of the repo.
|
||||
main_repo_abspath = path.abspath(self.read_git_shell('git rev-parse --show-toplevel', main_repo_abspath).rstrip())
|
||||
|
||||
self.prefix = prefix
|
||||
self.verbose = verbose
|
||||
self.exclude = exclude
|
||||
self.extra = extra
|
||||
self.force_sub = force_sub
|
||||
self.main_repo_abspath = main_repo_abspath
|
||||
|
||||
def create(self, output_path, dry_run=False, output_format=None):
|
||||
"""
|
||||
Creates the archive, written to the given output_file_path
|
||||
|
||||
Type of the archive is determined either by extension of output_file_path or by the format argument.
|
||||
Supported formats are: gz, zip, bz2, tar, tgz
|
||||
|
||||
@type output_path: string
|
||||
@param output_path: Output file path.
|
||||
|
||||
@type dry_run: bool
|
||||
@param dry_run: Determines whether create should do nothing but print what it would archive.
|
||||
|
||||
@type output_format: string
|
||||
@param output_format: Determines format of the output archive.
|
||||
If None, format is determined from extension of output_file_path.
|
||||
"""
|
||||
if output_format is None:
|
||||
file_name, file_ext = path.splitext(output_path)
|
||||
output_format = file_ext[len(extsep):].lower()
|
||||
|
||||
if output_format == 'zip':
|
||||
from zipfile import ZipFile, ZIP_DEFLATED
|
||||
|
||||
if not dry_run:
|
||||
archive = ZipFile(path.abspath(output_path), 'w')
|
||||
add = lambda file_path, file_name: archive.write(file_path, path.join(self.prefix, file_name), ZIP_DEFLATED)
|
||||
elif output_format in ['tar', 'bz2', 'gz', 'tgz']:
|
||||
import tarfile
|
||||
|
||||
if output_format == 'tar':
|
||||
t_mode = 'w'
|
||||
elif output_format == 'tgz':
|
||||
t_mode = 'w:gz'
|
||||
else:
|
||||
t_mode = 'w:{f}'.format(f=output_format)
|
||||
|
||||
if not dry_run:
|
||||
archive = tarfile.open(path.abspath(output_path), t_mode)
|
||||
add = lambda file_path, file_name: archive.add(file_path, path.join(self.prefix, file_name))
|
||||
else:
|
||||
raise RuntimeError("Unknown format: {f}".format(f=output_format))
|
||||
|
||||
for file_path in self.extra:
|
||||
if not dry_run:
|
||||
if self.verbose:
|
||||
print("Compressing {f} => {a}...".format(f=file_path,
|
||||
a=path.join(self.prefix, file_path)))
|
||||
add(file_path, file_path)
|
||||
else:
|
||||
print("{f} => {a}".format(f=file_path,
|
||||
a=path.join(self.prefix, file_path)))
|
||||
|
||||
for file_path in self.list_files():
|
||||
if not dry_run:
|
||||
if self.verbose:
|
||||
print("Compressing {f} => {a}...".format(f=path.join(self.main_repo_abspath, file_path),
|
||||
a=path.join(self.prefix, file_path)))
|
||||
add(path.join(self.main_repo_abspath, file_path), file_path)
|
||||
else:
|
||||
print("{f} => {a}".format(f=path.join(self.main_repo_abspath, file_path),
|
||||
a=path.join(self.prefix, file_path)))
|
||||
|
||||
if not dry_run:
|
||||
archive.close()
|
||||
|
||||
def get_path_components(self, repo_abspath, abspath):
|
||||
"""
|
||||
Splits given abspath into components until repo_abspath is reached.
|
||||
|
||||
E.g. if repo_abspath is '/Documents/Hobby/ParaView/' and abspath is
|
||||
'/Documents/Hobby/ParaView/Catalyst/Editions/Base/', function will return:
|
||||
['.', 'Catalyst', 'Editions', 'Base']
|
||||
|
||||
First element is always '.' (concrete symbol depends on OS).
|
||||
|
||||
@type repo_abspath: string
|
||||
@param repo_abspath: Absolute path to the git repository.
|
||||
|
||||
@type abspath: string
|
||||
@param abspath: Absolute path to within repo_abspath.
|
||||
|
||||
@rtype: list
|
||||
@return: List of path components.
|
||||
"""
|
||||
components = []
|
||||
|
||||
while not path.samefile(abspath, repo_abspath):
|
||||
abspath, tail = path.split(abspath)
|
||||
|
||||
if len(tail):
|
||||
components.insert(0, tail)
|
||||
|
||||
components.insert(0, path.relpath(repo_abspath, repo_abspath))
|
||||
return components
|
||||
|
||||
def get_exclude_patterns(self, repo_abspath, repo_file_paths):
|
||||
"""
|
||||
Returns exclude patterns for a given repo. It looks for .gitattributes files in repo_file_paths.
|
||||
|
||||
Resulting dictionary will contain exclude patterns per path (relative to the repo_abspath).
|
||||
E.g. {('.', 'Catalyst', 'Editions', 'Base'), ['Foo*', '*Bar']}
|
||||
|
||||
@type repo_abspath: string
|
||||
@param repo_abspath: Absolute path to the git repository.
|
||||
|
||||
@type repo_file_paths: list
|
||||
@param repo_file_paths: List of paths relative to the repo_abspath that are under git control.
|
||||
|
||||
@rtype: dict
|
||||
@return: Dictionary representing exclude patterns.
|
||||
Keys are tuples of strings. Values are lists of strings.
|
||||
Returns None if self.exclude is not set.
|
||||
"""
|
||||
if not self.exclude:
|
||||
return None
|
||||
|
||||
def read_attributes(attributes_abspath):
|
||||
patterns = []
|
||||
if path.isfile(attributes_abspath):
|
||||
attributes = open(attributes_abspath, 'r').readlines()
|
||||
patterns = []
|
||||
for line in attributes:
|
||||
tokens = line.strip().split()
|
||||
if "export-ignore" in tokens[1:]:
|
||||
patterns.append(tokens[0])
|
||||
return patterns
|
||||
|
||||
exclude_patterns = {(): []}
|
||||
|
||||
# There may be no gitattributes.
|
||||
try:
|
||||
global_attributes_abspath = self.read_shell("git config --get core.attributesfile", repo_abspath).rstrip()
|
||||
exclude_patterns[()] = read_attributes(global_attributes_abspath)
|
||||
except:
|
||||
# And valid to not have them.
|
||||
pass
|
||||
|
||||
for attributes_abspath in [path.join(repo_abspath, f) for f in repo_file_paths if f.endswith(".gitattributes")]:
|
||||
# Each .gitattributes affects only files within its directory.
|
||||
key = tuple(self.get_path_components(repo_abspath, path.dirname(attributes_abspath)))
|
||||
exclude_patterns[key] = read_attributes(attributes_abspath)
|
||||
|
||||
local_attributes_abspath = path.join(repo_abspath, ".git", "info", "attributes")
|
||||
key = tuple(self.get_path_components(repo_abspath, repo_abspath))
|
||||
|
||||
if key in exclude_patterns:
|
||||
exclude_patterns[key].extend(read_attributes(local_attributes_abspath))
|
||||
else:
|
||||
exclude_patterns[key] = read_attributes(local_attributes_abspath)
|
||||
|
||||
return exclude_patterns
|
||||
|
||||
def is_file_excluded(self, repo_abspath, repo_file_path, exclude_patterns):
|
||||
"""
|
||||
Checks whether file at a given path is excluded.
|
||||
|
||||
@type repo_abspath: string
|
||||
@param repo_abspath: Absolute path to the git repository.
|
||||
|
||||
@type repo_file_path: string
|
||||
@param repo_file_path: Path to a file within repo_abspath.
|
||||
|
||||
@type exclude_patterns: dict
|
||||
@param exclude_patterns: Exclude patterns with format specified for get_exclude_patterns.
|
||||
|
||||
@rtype: bool
|
||||
@return: True if file should be excluded. Otherwise False.
|
||||
"""
|
||||
if exclude_patterns is None or not len(exclude_patterns):
|
||||
return False
|
||||
|
||||
from fnmatch import fnmatch
|
||||
|
||||
file_name = path.basename(repo_file_path)
|
||||
components = self.get_path_components(repo_abspath, path.join(repo_abspath, path.dirname(repo_file_path)))
|
||||
|
||||
is_excluded = False
|
||||
# We should check all patterns specified in intermediate directories to the given file.
|
||||
# At the end we should also check for the global patterns (key '()' or empty tuple).
|
||||
while not is_excluded:
|
||||
key = tuple(components)
|
||||
if key in exclude_patterns:
|
||||
patterns = exclude_patterns[key]
|
||||
for p in patterns:
|
||||
if fnmatch(file_name, p) or fnmatch(repo_file_path, p):
|
||||
if self.verbose:
|
||||
print("Exclude pattern matched {pattern}: {path}".format(pattern=p, path=repo_file_path))
|
||||
is_excluded = True
|
||||
|
||||
if not len(components):
|
||||
break
|
||||
|
||||
components.pop()
|
||||
|
||||
return is_excluded
|
||||
|
||||
def list_files(self, repo_path=''):
|
||||
"""
|
||||
An iterator method that yields a file path relative to main_repo_abspath
|
||||
for each file that should be included in the archive.
|
||||
Skips those that match the exclusion patterns found in
|
||||
any discovered .gitattributes files along the way.
|
||||
|
||||
Recurs into submodules as well.
|
||||
|
||||
@type repo_path: string
|
||||
@param repo_path: Path to the git submodule repository within the main git repository.
|
||||
|
||||
@rtype: iterator
|
||||
@return: Iterator to traverse files under git control relative to main_repo_abspath.
|
||||
"""
|
||||
repo_abspath = path.join(self.main_repo_abspath, repo_path)
|
||||
repo_file_paths = self.read_git_shell("git ls-files --cached --full-name --no-empty-directory", repo_abspath).splitlines()
|
||||
exclude_patterns = self.get_exclude_patterns(repo_abspath, repo_file_paths)
|
||||
|
||||
for repo_file_path in repo_file_paths:
|
||||
# Git puts path in quotes if file path has unicode characters.
|
||||
repo_file_path = repo_file_path.strip('"') # file path relative to current repo
|
||||
file_name = path.basename(repo_file_path)
|
||||
|
||||
# Only list symlinks and files that don't start with git.
|
||||
if (not path.islink(repo_file_path) and path.isdir(repo_file_path)):
|
||||
continue
|
||||
|
||||
main_repo_file_path = path.join(repo_path, repo_file_path) # file path relative to the main repo
|
||||
|
||||
if self.is_file_excluded(repo_abspath, repo_file_path, exclude_patterns):
|
||||
continue
|
||||
|
||||
# Yield both repo_file_path and main_repo_file_path to preserve structure of the repo.
|
||||
yield main_repo_file_path
|
||||
|
||||
if self.force_sub:
|
||||
self.run_shell("git submodule init", repo_abspath)
|
||||
self.run_shell("git submodule update", repo_abspath)
|
||||
|
||||
# List files of every submodule.
|
||||
for submodule_path in self.read_shell("git submodule --quiet foreach 'pwd'", repo_abspath).splitlines():
|
||||
# In order to get output path we need to exclude repository path from submodule_path.
|
||||
submodule_path = path.relpath(submodule_path, self.main_repo_abspath)
|
||||
for file_path in self.list_files(submodule_path):
|
||||
yield file_path
|
||||
|
||||
@staticmethod
|
||||
def run_shell(cmd, cwd=None):
|
||||
"""
|
||||
Runs shell command.
|
||||
|
||||
@type cmd: string
|
||||
@param cmd: Command to be executed.
|
||||
|
||||
@type cwd: string
|
||||
@param cwd: Working directory.
|
||||
|
||||
@rtype: int
|
||||
@return: Return code of the command.
|
||||
|
||||
@raise CalledProcessError: Raises exception if return code of the command is non-zero.
|
||||
"""
|
||||
p = Popen(cmd, shell=True, cwd=cwd)
|
||||
p.wait()
|
||||
|
||||
if p.returncode:
|
||||
raise CalledProcessError(returncode=p.returncode, cmd=cmd)
|
||||
|
||||
return p.returncode
|
||||
|
||||
@staticmethod
|
||||
def read_shell(cmd, cwd=None, encoding='utf-8'):
|
||||
"""
|
||||
Runs shell command and reads output.
|
||||
|
||||
@type cmd: string
|
||||
@param cmd: Command to be executed.
|
||||
|
||||
@type cwd: string
|
||||
@param cwd: Working directory.
|
||||
|
||||
@type encoding: string
|
||||
@param encoding: Encoding used to decode bytes returned by Popen into string.
|
||||
|
||||
@rtype: string
|
||||
@return: Output of the command.
|
||||
|
||||
@raise CalledProcessError: Raises exception if return code of the command is non-zero.
|
||||
"""
|
||||
p = Popen(cmd, shell=True, stdout=PIPE, cwd=cwd)
|
||||
output, _ = p.communicate()
|
||||
output = output.decode(encoding)
|
||||
|
||||
if p.returncode:
|
||||
raise CalledProcessError(returncode=p.returncode, cmd=cmd, output=output)
|
||||
|
||||
return output
|
||||
|
||||
@staticmethod
|
||||
def read_git_shell(cmd, cwd=None):
|
||||
"""
|
||||
Runs git shell command, reads output and decodes it into unicode string
|
||||
|
||||
@type cmd: string
|
||||
@param cmd: Command to be executed.
|
||||
|
||||
@type cwd: string
|
||||
@param cwd: Working directory.
|
||||
|
||||
@rtype: string
|
||||
@return: Output of the command.
|
||||
|
||||
@raise CalledProcessError: Raises exception if return code of the command is non-zero.
|
||||
"""
|
||||
p = Popen(cmd, shell=True, stdout=PIPE, cwd=cwd)
|
||||
output, _ = p.communicate()
|
||||
output = output.decode('unicode_escape').encode('raw_unicode_escape').decode('utf-8')
|
||||
|
||||
if p.returncode:
|
||||
raise CalledProcessError(returncode=p.returncode, cmd=cmd, output=output)
|
||||
|
||||
return output
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
from optparse import OptionParser
|
||||
|
||||
parser = OptionParser(usage="usage: %prog [-v] [--prefix PREFIX] [--no-exclude] [--force-submodules] [--dry-run] OUTPUT_FILE",
|
||||
version="%prog {version}".format(version=__version__))
|
||||
|
||||
parser.add_option('--prefix',
|
||||
type='string',
|
||||
dest='prefix',
|
||||
default='',
|
||||
help="Prepend PREFIX to each filename in the archive. OUTPUT_FILE name is used by default to avoid tarbomb.")
|
||||
|
||||
parser.add_option('-v', '--verbose',
|
||||
action='store_true',
|
||||
dest='verbose',
|
||||
help='Enable verbose mode.')
|
||||
|
||||
parser.add_option('--no-exclude',
|
||||
action='store_false',
|
||||
dest='exclude',
|
||||
default=True,
|
||||
help="Don't read .gitattributes files for patterns containing export-ignore attrib.")
|
||||
|
||||
parser.add_option('--force-submodules',
|
||||
action='store_true',
|
||||
dest='force_sub',
|
||||
help="Force a git submodule init && git submodule update at each level before iterating submodules.")
|
||||
|
||||
parser.add_option('--extra',
|
||||
action='append',
|
||||
dest='extra',
|
||||
default=[],
|
||||
help="Any additional files to include in the archive.")
|
||||
parser.add_option('--dry-run',
|
||||
action='store_true',
|
||||
dest='dry_run',
|
||||
help="Don't actually archive anything, just show what would be done.")
|
||||
|
||||
options, args = parser.parse_args()
|
||||
|
||||
if len(args) != 1:
|
||||
parser.error("You must specify exactly one output file")
|
||||
|
||||
output_file_path = args[0]
|
||||
|
||||
if path.isdir(output_file_path):
|
||||
parser.error("You cannot use directory as output")
|
||||
|
||||
# avoid tarbomb
|
||||
if options.prefix:
|
||||
options.prefix = path.join(options.prefix, '')
|
||||
else:
|
||||
import re
|
||||
|
||||
output_name = path.basename(output_file_path)
|
||||
output_name = re.sub('(\.zip|\.tar|\.tgz|\.gz|\.bz2|\.tar\.gz|\.tar\.bz2)$', '', output_name) or "Archive"
|
||||
options.prefix = path.join(output_name, '')
|
||||
|
||||
try:
|
||||
archiver = GitArchiver(options.prefix,
|
||||
options.verbose,
|
||||
options.exclude,
|
||||
options.force_sub,
|
||||
options.extra)
|
||||
archiver.create(output_file_path, options.dry_run)
|
||||
except Exception as e:
|
||||
parser.exit(2, "{exception}\n".format(exception=e))
|
||||
|
||||
sys.exit(0)
|
|
@ -71,6 +71,10 @@ def checkParams():
|
|||
context["src_project_name"] = "HelloJavascript"
|
||||
context["src_package_name"] = "org.cocos2dx.hellojavascript"
|
||||
context["src_project_path"] = os.path.join(template_dir, "multi-platform-js")
|
||||
else:
|
||||
print ("Your language parameter doesn\'t exist." \
|
||||
"Check correct language option\'s parameter")
|
||||
sys.exit()
|
||||
platforms_list = PLATFORMS.get(context["language"], [])
|
||||
return context, platforms_list
|
||||
# end of checkParams(context) function
|
||||
|
|
|
@ -80,7 +80,7 @@ echo ---
|
|||
# Generate bindings for cocos2dx
|
||||
echo "Generating bindings for cocos2dx..."
|
||||
set -x
|
||||
LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx.ini -s cocos2d-x -t spidermonkey -o ${COCOS2DX_ROOT}/scripting/javascript/bindings/generated -n jsb_cocos2dx_auto
|
||||
LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx.ini -s cocos2d-x -t spidermonkey -o ${COCOS2DX_ROOT}/scripting/auto-generated/js-bindings -n jsb_cocos2dx_auto
|
||||
|
||||
echo "Generating bindings for cocos2dx_extension..."
|
||||
LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_extension.ini -s cocos2dx_extension -t spidermonkey -o ${COCOS2DX_ROOT}/scripting/javascript/bindings/generated -n jsb_cocos2dx_extension_auto
|
||||
LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_extension.ini -s cocos2dx_extension -t spidermonkey -o ${COCOS2DX_ROOT}/scripting/auto-generated/js-bindings -n jsb_cocos2dx_extension_auto
|
||||
|
|
|
@ -80,7 +80,7 @@ echo ---
|
|||
# Generate bindings for cocos2dx
|
||||
echo "Generating bindings for cocos2dx..."
|
||||
set -x
|
||||
LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx.ini -s cocos2d-x -t lua -o ${COCOS2DX_ROOT}/scripting/lua/cocos2dx_support/generated -n lua_cocos2dx_auto
|
||||
LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx.ini -s cocos2d-x -t lua -o ${COCOS2DX_ROOT}/scripting/auto-generated/lua-bindings -n lua_cocos2dx_auto
|
||||
|
||||
echo "Generating bindings for cocos2dx_extension..."
|
||||
LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_extension.ini -s cocos2dx_extension -t lua -o ${COCOS2DX_ROOT}/scripting/lua/cocos2dx_support/generated -n lua_cocos2dx_extension_auto
|
||||
LD_LIBRARY_PATH=${CLANG_ROOT}/lib $PYTHON_BIN ${CXX_GENERATOR_ROOT}/generator.py ${TO_JS_ROOT}/cocos2dx_extension.ini -s cocos2dx_extension -t lua -o ${COCOS2DX_ROOT}/scripting/auto-generated/lua-bindings -n lua_cocos2dx_extension_auto
|
||||
|
|
|
@ -1,7 +0,0 @@
|
|||
[DEFAULT]
|
||||
androidndkdir=/Users/cocos2d/MyWork/android/android-ndk-r8e
|
||||
clangllvmdir=/Users/cocos2d/bin/clang+llvm-3.3
|
||||
cocosdir=/Users/cocos2d/MyWork/cocos2d-x
|
||||
cxxgeneratordir=/Users/cocos2d/MyWork/cocos2d-x/tools/bindings-generator
|
||||
extra_flags=
|
||||
|
|
@ -103,6 +103,8 @@ elif [ "$PLATFORM"x = "linux"x ]; then
|
|||
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-4.7 90 --slave /usr/bin/g++ g++ /usr/bin/g++-4.7
|
||||
g++ --version
|
||||
bash $COCOS2DX_ROOT/install-deps-linux.sh
|
||||
install_android_ndk
|
||||
install_llvm
|
||||
elif [ "$PLATFORM"x = "nacl"x ]; then
|
||||
install_nacl_sdk
|
||||
elif [ "$PLATFORM"x = "android"x ]; then
|
||||
|
@ -110,6 +112,7 @@ elif [ "$PLATFORM"x = "android"x ]; then
|
|||
install_llvm
|
||||
elif [ "$PLATFORM"x = "emscripten"x ]; then
|
||||
sudo rm -rf /dev/shm && sudo ln -s /run/shm /dev/shm
|
||||
install_android_ndk
|
||||
install_llvm_3_2
|
||||
elif [ "$PLATFORM"x = "ios"x ]; then
|
||||
install_android_ndk
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Generate JS bindings for Cocos2D-X
|
||||
# Generate JS and Lua bindings for Cocos2D-X
|
||||
# ... using Android NDK system headers
|
||||
# ... and automatically update submodule references
|
||||
# ... and push these changes to remote repos
|
||||
|
@ -8,7 +8,7 @@
|
|||
# Dependencies
|
||||
#
|
||||
# For bindings generator:
|
||||
# (see ../../../tojs/genbindings.sh
|
||||
# (see ../../../tojs/genbindings.sh and ../../../tolua/genbindings.sh
|
||||
# ... for the defaults used if the environment is not customized)
|
||||
#
|
||||
# * $PYTHON_BIN
|
||||
|
@ -19,7 +19,8 @@
|
|||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
COCOS2DX_ROOT="$DIR"/../..
|
||||
TOJS_ROOT=$COCOS2DX_ROOT/tools/tojs
|
||||
GENERATED_WORKTREE="$COCOS2DX_ROOT"/scripting/javascript/bindings/generated
|
||||
TOLUA_ROOT=$COCOS2DX_ROOT/tools/tolua
|
||||
GENERATED_WORKTREE="$COCOS2DX_ROOT"/scripting/auto-generated
|
||||
COMMITTAG="[AUTO]"
|
||||
|
||||
# Exit on error
|
||||
|
@ -42,10 +43,21 @@ else
|
|||
sudo apt-get --force-yes --yes install python-yaml python-cheetah
|
||||
fi
|
||||
|
||||
if [ "$GEN_JSB"x != "YES"x ]; then
|
||||
generate_bindings_glue_codes()
|
||||
{
|
||||
echo "Create auto-generated jsbinding glue codes."
|
||||
pushd "$TOJS_ROOT"
|
||||
./genbindings.sh
|
||||
popd
|
||||
|
||||
echo "Create auto-generated luabinding glue codes."
|
||||
pushd "$TOLUA_ROOT"
|
||||
./genbindings.sh
|
||||
popd
|
||||
}
|
||||
|
||||
if [ "$GEN_JSB"x != "YES"x ]; then
|
||||
generate_bindings_glue_codes
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
@ -55,11 +67,11 @@ git config user.email ${GH_EMAIL}
|
|||
git config user.name ${GH_USER}
|
||||
popd
|
||||
|
||||
# Update submodule of auto-gen JSBinding repo.
|
||||
# Update submodule of auto-gen Binding repo.
|
||||
pushd "$GENERATED_WORKTREE"
|
||||
|
||||
git checkout -B master
|
||||
#Set git user for the submodule of 'scripting/javascript/bindings/generated'
|
||||
echo "Set git user for the submodule of ${GENERATED_WORKTREE}"
|
||||
git config user.email ${GH_EMAIL}
|
||||
git config user.name ${GH_USER}
|
||||
#Set remotes
|
||||
|
@ -67,16 +79,14 @@ git remote add upstream https://${GH_USER}:${GH_PASSWORD}@github.com/folecr/coco
|
|||
|
||||
echo "Delete all directories and files except '.git' and 'README'."
|
||||
ls -a | grep -E -v ^\[.\]\{1,2\}$ | grep -E -v ^\.git$ | grep -E -v ^README$ | xargs -I{} rm -rf {}
|
||||
echo "Show files in scripting/javascript/bindings/generated folder."
|
||||
echo "Show files in ${GENERATED_WORKTREE} folder."
|
||||
ls -a
|
||||
popd
|
||||
|
||||
|
||||
|
||||
# 1. Generate JS bindings
|
||||
pushd "$TOJS_ROOT"
|
||||
./genbindings.sh
|
||||
popd
|
||||
generate_bindings_glue_codes
|
||||
|
||||
echo
|
||||
echo Bindings generated successfully
|
||||
|
@ -98,7 +108,7 @@ echo Using "$ELAPSEDSECS" in the branch names for pseudo-uniqueness
|
|||
GENERATED_BRANCH=autogeneratedbindings_"$ELAPSEDSECS"
|
||||
|
||||
|
||||
# 2. In JSBindings repo, Check if there are any files that are different from the index
|
||||
# 2. In Bindings repo, Check if there are any files that are different from the index
|
||||
|
||||
pushd "$GENERATED_WORKTREE"
|
||||
|
||||
|
@ -130,13 +140,13 @@ fi
|
|||
# Exit on error
|
||||
set -e
|
||||
|
||||
# 3. In JSBindings repo, Check out a branch named "autogeneratedbindings" and commit the auto generated bindings to it
|
||||
# 3. In Bindings repo, Check out a branch named "autogeneratedbindings" and commit the auto generated bindings to it
|
||||
git checkout -b "$GENERATED_BRANCH"
|
||||
git add --verbose .
|
||||
git add --verbose -u .
|
||||
git commit --verbose -m "$COMMITTAG : autogenerated bindings"
|
||||
|
||||
# 4. In JSBindings repo, Push the commit with generated bindings to "master" of the auto generated bindings repository
|
||||
# 4. In Bindings repo, Push the commit with generated bindings to "master" of the auto generated bindings repository
|
||||
git push -fq upstream "$GENERATED_BRANCH":${TRAVIS_BRANCH}_${ELAPSEDSECS} 2> /dev/null
|
||||
|
||||
popd
|
||||
|
@ -148,7 +158,7 @@ pushd "${DIR}"
|
|||
|
||||
# 5. In Cocos2D-X repo, Checkout a branch named "updategeneratedsubmodule" Update the submodule reference to point to the commit with generated bindings
|
||||
cd "${COCOS2DX_ROOT}"
|
||||
git add scripting/javascript/bindings/generated
|
||||
git add ${GENERATED_WORKTREE}
|
||||
git checkout -b "$COCOS_BRANCH"
|
||||
git commit -m "$COMMITTAG : updating submodule reference to latest autogenerated bindings"
|
||||
#Set remotes
|
||||
|
|
|
@ -41,8 +41,8 @@ if [ "$GEN_JSB"x = "YES"x ]; then
|
|||
elif [ "$PLATFORM"x = "android"x ]; then
|
||||
export NDK_ROOT=$HOME/bin/android-ndk
|
||||
|
||||
# Generate jsbinding glue codes
|
||||
echo "Generating jsbindings glue codes ..."
|
||||
# Generate binding glue codes
|
||||
echo "Generating bindings glue codes ..."
|
||||
cd $COCOS2DX_ROOT/tools/travis-scripts
|
||||
./generate-jsbindings.sh
|
||||
|
||||
|
@ -83,9 +83,19 @@ elif [ "$PLATFORM"x = "nacl"x ]; then
|
|||
cd $COCOS2DX_ROOT
|
||||
make -j4
|
||||
elif [ "$PLATFORM"x = "linux"x ]; then
|
||||
# Generate binding glue codes
|
||||
echo "Generating bindings glue codes ..."
|
||||
cd $COCOS2DX_ROOT/tools/travis-scripts
|
||||
./generate-jsbindings.sh
|
||||
|
||||
cd $COCOS2DX_ROOT
|
||||
make -j4
|
||||
elif [ "$PLATFORM"x = "emscripten"x ]; then
|
||||
# Generate binding glue codes
|
||||
echo "Generating bindings glue codes ..."
|
||||
cd $COCOS2DX_ROOT/tools/travis-scripts
|
||||
./generate-jsbindings.sh
|
||||
|
||||
cd $COCOS2DX_ROOT
|
||||
export PYTHON=/usr/bin/python
|
||||
export LLVM=$HOME/bin/clang+llvm-3.2/bin
|
||||
|
|
Loading…
Reference in New Issue