mirror of https://github.com/axmolengine/axmol.git
fixed #587
This commit is contained in:
parent
f9cfaa1a5d
commit
5db1719302
|
@ -32,6 +32,17 @@ A convience macro to iterate over a CCArray using. It is faster than the "fast e
|
|||
@since v0.99.4
|
||||
*/
|
||||
|
||||
/*
|
||||
In cocos2d-iphone 1.0.0, This macro have been update to like this:
|
||||
|
||||
#define CCARRAY_FOREACH(__array__, __object__) \
|
||||
if (__array__ && __array__->data->num > 0) \
|
||||
for(id *__arr__ = __array__->data->arr, *end = __array__->data->arr + __array__->data->num-1; \
|
||||
__arr__ <= end && ((__object__ = *__arr__) != nil || true); \
|
||||
__arr__++)
|
||||
|
||||
I found that it's not work in C++. So it keep what it's look like in version 1.0.0-rc3. ---By Bin
|
||||
*/
|
||||
#define CCARRAY_FOREACH(__array__, __object__) \
|
||||
if (__array__ && __array__->data->num > 0) \
|
||||
for(CCObject** arr = __array__->data->arr, **end = __array__->data->arr + __array__->data->num-1; \
|
||||
|
|
|
@ -29,6 +29,8 @@ namespace cocos2d {
|
|||
|
||||
unsigned char alphabet[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
||||
|
||||
int _base64Decode( unsigned char *input, unsigned int input_len, unsigned char *output, unsigned int *output_len );
|
||||
|
||||
int _base64Decode( unsigned char *input, unsigned int input_len, unsigned char *output, unsigned int *output_len )
|
||||
{
|
||||
static char inalphabet[256], decoder[256];
|
||||
|
|
|
@ -339,17 +339,13 @@ static inline void ccCArrayFree(ccCArray *arr)
|
|||
/** Doubles C array capacity */
|
||||
static inline void ccCArrayDoubleCapacity(ccCArray *arr)
|
||||
{
|
||||
arr->max *= 2;
|
||||
arr->arr = (void**) realloc(arr->arr, arr->max * sizeof(void*));
|
||||
ccArrayDoubleCapacity((ccArray*)arr);
|
||||
}
|
||||
|
||||
/** Increases array capacity such that max >= num + extra. */
|
||||
static inline void ccCArrayEnsureExtraCapacity(ccCArray *arr, unsigned int extra)
|
||||
{
|
||||
while (arr->max < arr->num + extra)
|
||||
{
|
||||
ccCArrayDoubleCapacity(arr);
|
||||
}
|
||||
ccArrayEnsureExtraCapacity((ccArray*)arr,extra);
|
||||
}
|
||||
|
||||
/** Returns index of first occurence of value, NSNotFound if value not found. */
|
||||
|
|
|
@ -30,6 +30,9 @@ THE SOFTWARE.
|
|||
|
||||
namespace cocos2d {
|
||||
|
||||
void tgaLoadRLEImageData(FILE *file, tImageTGA *info);
|
||||
void tgaFlipImage( tImageTGA *info );
|
||||
|
||||
// load the image header field from stream
|
||||
bool tgaLoadHeader(unsigned char* Buffer, unsigned long bufSize, tImageTGA *psInfo)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue