mirror of https://github.com/axmolengine/axmol.git
Merge pull request #4171 from dumganhar/jsb-64bit-fix
[ci skip]Jsb 64bit fix
This commit is contained in:
commit
d3cf36ba37
|
@ -1 +1 @@
|
|||
30ca6c02884f9bc20405b3e657b444c0153bead7
|
||||
a70914e0a87ee8ced4d662bd6038fc955e77f6ca
|
|
@ -203,7 +203,7 @@ Sequence* Sequence::create(Array* arrayOfActions)
|
|||
Sequence* pRet = NULL;
|
||||
do
|
||||
{
|
||||
unsigned int count = arrayOfActions->count();
|
||||
long count = arrayOfActions->count();
|
||||
CC_BREAK_IF(count == 0);
|
||||
|
||||
FiniteTimeAction* prev = static_cast<FiniteTimeAction*>(arrayOfActions->getObjectAtIndex(0));
|
||||
|
@ -576,7 +576,7 @@ Spawn* Spawn::create(Array *arrayOfActions)
|
|||
Spawn* pRet = NULL;
|
||||
do
|
||||
{
|
||||
unsigned int count = arrayOfActions->count();
|
||||
long count = arrayOfActions->count();
|
||||
CC_BREAK_IF(count == 0);
|
||||
FiniteTimeAction* prev = static_cast<FiniteTimeAction*>(arrayOfActions->getObjectAtIndex(0));
|
||||
if (count > 1)
|
||||
|
@ -2100,7 +2100,7 @@ void Animate::update(float t)
|
|||
}
|
||||
|
||||
Array* frames = _animation->getFrames();
|
||||
int numberOfFrames = frames->count();
|
||||
long numberOfFrames = frames->count();
|
||||
SpriteFrame *frameToDisplay = NULL;
|
||||
|
||||
for( int i=_nextFrame; i < numberOfFrames; i++ ) {
|
||||
|
|
|
@ -327,7 +327,7 @@ Action* ActionManager::getActionByTag(int tag, const Object *target) const
|
|||
|
||||
// XXX: Passing "const O *" instead of "const O&" because HASH_FIND_IT requries the address of a pointer
|
||||
// and, it is not possible to get the address of a reference
|
||||
unsigned int ActionManager::getNumberOfRunningActionsInTarget(const Object *target) const
|
||||
long ActionManager::getNumberOfRunningActionsInTarget(const Object *target) const
|
||||
{
|
||||
tHashElement *element = NULL;
|
||||
HASH_FIND_PTR(_targets, &target, element);
|
||||
|
|
|
@ -102,7 +102,7 @@ public:
|
|||
* - If you are running 1 Sequence of 7 actions, it will return 1.
|
||||
* - If you are running 7 Sequences of 2 actions, it will return 7.
|
||||
*/
|
||||
unsigned int getNumberOfRunningActionsInTarget(const Object *target) const;
|
||||
long getNumberOfRunningActionsInTarget(const Object *target) const;
|
||||
|
||||
/** @deprecated use getNumberOfRunningActionsInTarget() instead */
|
||||
CC_DEPRECATED_ATTRIBUTE inline unsigned int numberOfRunningActionsInTarget(Object *target) const { return getNumberOfRunningActionsInTarget(target); }
|
||||
|
|
|
@ -245,12 +245,12 @@ TextureAtlas * AtlasNode::getTextureAtlas() const
|
|||
return _textureAtlas;
|
||||
}
|
||||
|
||||
unsigned int AtlasNode::getQuadsToDraw() const
|
||||
long AtlasNode::getQuadsToDraw() const
|
||||
{
|
||||
return _quadsToDraw;
|
||||
}
|
||||
|
||||
void AtlasNode::setQuadsToDraw(unsigned int uQuadsToDraw)
|
||||
void AtlasNode::setQuadsToDraw(long uQuadsToDraw)
|
||||
{
|
||||
_quadsToDraw = uQuadsToDraw;
|
||||
}
|
||||
|
|
|
@ -77,8 +77,8 @@ public:
|
|||
void setTextureAtlas(TextureAtlas* textureAtlas);
|
||||
TextureAtlas* getTextureAtlas() const;
|
||||
|
||||
void setQuadsToDraw(unsigned int quadsToDraw);
|
||||
unsigned int getQuadsToDraw() const;
|
||||
void setQuadsToDraw(long quadsToDraw);
|
||||
long getQuadsToDraw() const;
|
||||
|
||||
|
||||
// Overrides
|
||||
|
|
|
@ -72,12 +72,12 @@ TextureAtlas::~TextureAtlas()
|
|||
#endif
|
||||
}
|
||||
|
||||
int TextureAtlas::getTotalQuads() const
|
||||
long TextureAtlas::getTotalQuads() const
|
||||
{
|
||||
return _totalQuads;
|
||||
}
|
||||
|
||||
int TextureAtlas::getCapacity() const
|
||||
long TextureAtlas::getCapacity() const
|
||||
{
|
||||
return _capacity;
|
||||
}
|
||||
|
@ -216,7 +216,7 @@ void TextureAtlas::listenBackToForeground(Object *obj)
|
|||
|
||||
const char* TextureAtlas::description() const
|
||||
{
|
||||
return String::createWithFormat("<TextureAtlas | totalQuads = %u>", _totalQuads)->getCString();
|
||||
return String::createWithFormat("<TextureAtlas | totalQuads = %ld>", _totalQuads)->getCString();
|
||||
}
|
||||
|
||||
|
||||
|
@ -357,7 +357,7 @@ void TextureAtlas::insertQuads(V3F_C4B_T2F_Quad* quads, long index, long amount)
|
|||
CCASSERT( _totalQuads <= _capacity, "invalid totalQuads");
|
||||
|
||||
// issue #575. index can be > totalQuads
|
||||
int remaining = (_totalQuads-1) - index - amount;
|
||||
long remaining = (_totalQuads-1) - index - amount;
|
||||
|
||||
// last object doesn't need to be moved
|
||||
if( remaining > 0)
|
||||
|
@ -367,9 +367,9 @@ void TextureAtlas::insertQuads(V3F_C4B_T2F_Quad* quads, long index, long amount)
|
|||
}
|
||||
|
||||
|
||||
int max = index + amount;
|
||||
long max = index + amount;
|
||||
int j = 0;
|
||||
for (int i = index; i < max ; i++)
|
||||
for (long i = index; i < max ; i++)
|
||||
{
|
||||
_quads[index] = quads[j];
|
||||
index++;
|
||||
|
@ -390,9 +390,9 @@ void TextureAtlas::insertQuadFromIndex(long oldIndex, long newIndex)
|
|||
}
|
||||
// because it is ambiguous in iphone, so we implement abs ourselves
|
||||
// unsigned int howMany = abs( oldIndex - newIndex);
|
||||
int howMany = (oldIndex - newIndex) > 0 ? (oldIndex - newIndex) : (newIndex - oldIndex);
|
||||
int dst = oldIndex;
|
||||
int src = oldIndex + 1;
|
||||
long howMany = (oldIndex - newIndex) > 0 ? (oldIndex - newIndex) : (newIndex - oldIndex);
|
||||
long dst = oldIndex;
|
||||
long src = oldIndex + 1;
|
||||
if( oldIndex > newIndex)
|
||||
{
|
||||
dst = newIndex+1;
|
||||
|
@ -412,7 +412,7 @@ void TextureAtlas::removeQuadAtIndex(long index)
|
|||
{
|
||||
CCASSERT( index>=0 && index<_totalQuads, "removeQuadAtIndex: Invalid index");
|
||||
|
||||
int remaining = (_totalQuads-1) - index;
|
||||
long remaining = (_totalQuads-1) - index;
|
||||
|
||||
// last object doesn't need to be moved
|
||||
if( remaining )
|
||||
|
@ -431,7 +431,7 @@ void TextureAtlas::removeQuadsAtIndex(long index, long amount)
|
|||
{
|
||||
CCASSERT(index>=0 && amount>=0 && index+amount<=_totalQuads, "removeQuadAtIndex: index + amount out of bounds");
|
||||
|
||||
int remaining = (_totalQuads) - (index + amount);
|
||||
long remaining = (_totalQuads) - (index + amount);
|
||||
|
||||
_totalQuads -= amount;
|
||||
|
||||
|
@ -456,7 +456,7 @@ bool TextureAtlas::resizeCapacity(long newCapacity)
|
|||
{
|
||||
return true;
|
||||
}
|
||||
int oldCapactiy = _capacity;
|
||||
long oldCapactiy = _capacity;
|
||||
// update capacity and totolQuads
|
||||
_totalQuads = MIN(_totalQuads, newCapacity);
|
||||
_capacity = newCapacity;
|
||||
|
@ -575,8 +575,8 @@ void TextureAtlas::fillWithEmptyQuadsFromIndex(long index, long amount)
|
|||
V3F_C4B_T2F_Quad quad;
|
||||
memset(&quad, 0, sizeof(quad));
|
||||
|
||||
int to = index + amount;
|
||||
for (int i = index ; i < to ; i++)
|
||||
long to = index + amount;
|
||||
for (long i = index ; i < to ; i++)
|
||||
{
|
||||
_quads[i] = quad;
|
||||
}
|
||||
|
|
|
@ -197,10 +197,10 @@ public:
|
|||
const char* description() const;
|
||||
|
||||
/** Gets the quantity of quads that are going to be drawn */
|
||||
int getTotalQuads() const;
|
||||
long getTotalQuads() const;
|
||||
|
||||
/** Gets the quantity of quads that can be stored with the current texture atlas size */
|
||||
int getCapacity() const;
|
||||
long getCapacity() const;
|
||||
|
||||
/** Gets the texture of the texture atlas */
|
||||
Texture2D* getTexture() const;
|
||||
|
@ -231,9 +231,9 @@ protected:
|
|||
GLuint _buffersVBO[2]; //0: vertex 1: indices
|
||||
bool _dirty; //indicates whether or not the array buffer of the VBO needs to be updated
|
||||
/** quantity of quads that are going to be drawn */
|
||||
int _totalQuads;
|
||||
long _totalQuads;
|
||||
/** quantity of quads that can be stored with the current texture atlas size */
|
||||
int _capacity;
|
||||
long _capacity;
|
||||
/** Texture of the texture atlas */
|
||||
Texture2D* _texture;
|
||||
/** Quads that are going to be rendered */
|
||||
|
|
|
@ -450,7 +450,7 @@ void TextureCache::dumpCachedTextureInfo() const
|
|||
Texture2D* tex = it->second;
|
||||
unsigned int bpp = tex->getBitsPerPixelForFormat();
|
||||
// Each texture takes up width * height * bytesPerPixel bytes.
|
||||
unsigned int bytes = tex->getPixelsWide() * tex->getPixelsHigh() * bpp / 8;
|
||||
long bytes = tex->getPixelsWide() * tex->getPixelsHigh() * bpp / 8;
|
||||
totalBytes += bytes;
|
||||
count++;
|
||||
log("cocos2d: \"%s\" rc=%lu id=%lu %lu x %lu @ %ld bpp => %lu KB",
|
||||
|
|
|
@ -9,7 +9,6 @@ LOCAL_MODULE_FILENAME := libcocos2dxjsb
|
|||
LOCAL_SRC_FILES := ScriptingCore.cpp \
|
||||
cocos2d_specifics.cpp \
|
||||
js_manual_conversions.cpp \
|
||||
cocosjs_manual_conversions.cpp \
|
||||
js_bindings_core.cpp \
|
||||
js_bindings_opengl.cpp \
|
||||
jsb_opengl_functions.cpp \
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -17,6 +17,7 @@
|
|||
#include "jsapi.h"
|
||||
#include "jsfriendapi.h"
|
||||
#include "spidermonkey_specifics.h"
|
||||
#include "js_manual_conversions.h"
|
||||
|
||||
void js_log(const char *format, ...);
|
||||
|
||||
|
@ -204,45 +205,6 @@ public:
|
|||
int handleKeypadEvent(void* data);
|
||||
};
|
||||
|
||||
// some utility functions
|
||||
// to native
|
||||
JSBool jsval_to_int32( JSContext *cx, jsval vp, int32_t *ret );
|
||||
JSBool jsval_to_uint32( JSContext *cx, jsval vp, uint32_t *ret );
|
||||
JSBool jsval_to_uint16( JSContext *cx, jsval vp, uint16_t *ret );
|
||||
JSBool jsval_to_long_long(JSContext *cx, jsval v, long long* ret);
|
||||
JSBool jsval_to_std_string(JSContext *cx, jsval v, std::string* ret);
|
||||
JSBool jsval_to_ccpoint(JSContext *cx, jsval v, Point* ret);
|
||||
JSBool jsval_to_ccrect(JSContext *cx, jsval v, Rect* ret);
|
||||
JSBool jsval_to_ccsize(JSContext *cx, jsval v, Size* ret);
|
||||
JSBool jsval_to_cccolor4b(JSContext *cx, jsval v, Color4B* ret);
|
||||
JSBool jsval_to_cccolor4f(JSContext *cx, jsval v, Color4F* ret);
|
||||
JSBool jsval_to_cccolor3b(JSContext *cx, jsval v, Color3B* ret);
|
||||
JSBool jsval_to_ccarray_of_CCPoint(JSContext* cx, jsval v, Point **points, int *numPoints);
|
||||
JSBool jsval_to_ccarray(JSContext* cx, jsval v, Array** ret);
|
||||
JSBool jsval_to_ccdictionary(JSContext* cx, jsval v, Dictionary** ret);
|
||||
JSBool jsval_to_ccacceleration(JSContext* cx,jsval v, Acceleration* ret);
|
||||
JSBool jsvals_variadic_to_ccarray( JSContext *cx, jsval *vp, int argc, Array** ret);
|
||||
JSBool jsval_to_ccaffinetransform(JSContext* cx, jsval v, AffineTransform* ret);
|
||||
JSBool jsval_to_FontDefinition( JSContext *cx, jsval vp, FontDefinition* ret );
|
||||
|
||||
// from native
|
||||
jsval int32_to_jsval( JSContext *cx, int32_t l);
|
||||
jsval uint32_to_jsval( JSContext *cx, uint32_t number );
|
||||
jsval long_long_to_jsval(JSContext* cx, long long v);
|
||||
jsval std_string_to_jsval(JSContext* cx, const std::string& v);
|
||||
jsval c_string_to_jsval(JSContext* cx, const char* v, size_t length = -1);
|
||||
jsval ccpoint_to_jsval(JSContext* cx, const Point& v);
|
||||
jsval ccrect_to_jsval(JSContext* cx, const Rect& v);
|
||||
jsval ccsize_to_jsval(JSContext* cx, const Size& v);
|
||||
jsval cccolor4b_to_jsval(JSContext* cx, const Color4B& v);
|
||||
jsval cccolor4f_to_jsval(JSContext* cx, const Color4F& v);
|
||||
jsval cccolor3b_to_jsval(JSContext* cx, const Color3B& v);
|
||||
jsval ccdictionary_to_jsval(JSContext* cx, Dictionary *dict);
|
||||
jsval ccarray_to_jsval(JSContext* cx, Array *arr);
|
||||
jsval ccacceleration_to_jsval(JSContext* cx, const Acceleration& v);
|
||||
jsval ccaffinetransform_to_jsval(JSContext* cx, const AffineTransform& t);
|
||||
jsval FontDefinition_to_jsval(JSContext* cx, const FontDefinition& t);
|
||||
|
||||
JSObject* NewGlobalObject(JSContext* cx, bool debug = false);
|
||||
|
||||
// just a simple utility to avoid mem leaking when using JSString
|
||||
|
|
|
@ -1 +1 @@
|
|||
6558be4f421be9227dc4fabf1b682d479825bd18
|
||||
2a8f07a22574900290f772ad5a580ef9fc57a9b8
|
|
@ -1 +1 @@
|
|||
1c5eb9cd58c82de77374cdfa5c9ff647cc8b2f02
|
||||
ac3eca550f3b923d03d042ed63edf3b66cc183b7
|
|
@ -27,7 +27,6 @@
|
|||
#define __js_bindings_chipmunk_manual
|
||||
|
||||
#include "js_bindings_config.h"
|
||||
#include "cocosjs_manual_conversions.h"
|
||||
#include "js_manual_conversions.h"
|
||||
#include "ScriptingCore.h"
|
||||
#ifdef JSB_INCLUDE_CHIPMUNK
|
||||
|
|
|
@ -1,134 +0,0 @@
|
|||
#include "jsapi.h"
|
||||
#include "jsfriendapi.h"
|
||||
#include "ScriptingCore.h"
|
||||
#include "js_bindings_config.h"
|
||||
#include "cocosjs_manual_conversions.h"
|
||||
|
||||
#define JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES
|
||||
|
||||
using namespace cocos2d;
|
||||
|
||||
JSBool jsval_to_CCPoint( JSContext *cx, jsval vp, Point *ret )
|
||||
{
|
||||
#ifdef JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES
|
||||
|
||||
JSObject *jsobj;
|
||||
if( ! JS_ValueToObject( cx, vp, &jsobj ) )
|
||||
return JS_FALSE;
|
||||
|
||||
JSB_PRECONDITION( jsobj, "Not a valid JS object");
|
||||
|
||||
JS::RootedValue valx(cx);
|
||||
JS::RootedValue valy(cx);
|
||||
JSBool ok = JS_TRUE;
|
||||
ok &= JS_GetProperty(cx, jsobj, "x", &valx);
|
||||
ok &= JS_GetProperty(cx, jsobj, "y", &valy);
|
||||
|
||||
if( ! ok )
|
||||
return JS_FALSE;
|
||||
|
||||
double x, y;
|
||||
ok &= JS_ValueToNumber(cx, valx, &x);
|
||||
ok &= JS_ValueToNumber(cx, valy, &y);
|
||||
|
||||
if( ! ok )
|
||||
return JS_FALSE;
|
||||
|
||||
ret->x = x;
|
||||
ret->y = y;
|
||||
|
||||
return JS_TRUE;
|
||||
|
||||
#else // #! JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES
|
||||
|
||||
JSObject *tmp_arg;
|
||||
if( ! JS_ValueToObject( cx, vp, &tmp_arg ) )
|
||||
return JS_FALSE;
|
||||
|
||||
JSB_PRECONDITION( tmp_arg && JS_IsTypedArrayObject( tmp_arg, cx ), "Not a TypedArray object");
|
||||
|
||||
JSB_PRECONDITION( JS_GetTypedArrayByteLength( tmp_arg, cx ) == sizeof(cpVect), "Invalid length");
|
||||
|
||||
*ret = *(Point*)JS_GetArrayBufferViewData( tmp_arg, cx );
|
||||
|
||||
return JS_TRUE;
|
||||
#endif // #! JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES
|
||||
}
|
||||
|
||||
|
||||
JSBool jsval_to_CGPoint( JSContext *cx, jsval vp, cpVect *ret )
|
||||
{
|
||||
#ifdef JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES
|
||||
|
||||
JSObject *jsobj;
|
||||
if( ! JS_ValueToObject( cx, vp, &jsobj ) )
|
||||
return JS_FALSE;
|
||||
|
||||
JSB_PRECONDITION( jsobj, "Not a valid JS object");
|
||||
|
||||
JS::RootedValue valx(cx);
|
||||
JS::RootedValue valy(cx);
|
||||
JSBool ok = JS_TRUE;
|
||||
ok &= JS_GetProperty(cx, jsobj, "x", &valx);
|
||||
ok &= JS_GetProperty(cx, jsobj, "y", &valy);
|
||||
|
||||
if( ! ok )
|
||||
return JS_FALSE;
|
||||
|
||||
double x, y;
|
||||
ok &= JS_ValueToNumber(cx, valx, &x);
|
||||
ok &= JS_ValueToNumber(cx, valy, &y);
|
||||
|
||||
if( ! ok )
|
||||
return JS_FALSE;
|
||||
|
||||
ret->x = x;
|
||||
ret->y = y;
|
||||
|
||||
return JS_TRUE;
|
||||
|
||||
#else // #! JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES
|
||||
|
||||
JSObject *tmp_arg;
|
||||
if( ! JS_ValueToObject( cx, vp, &tmp_arg ) )
|
||||
return JS_FALSE;
|
||||
|
||||
JSB_PRECONDITION( tmp_arg && JS_IsTypedArrayObject( tmp_arg, cx ), "Not a TypedArray object");
|
||||
|
||||
JSB_PRECONDITION( JS_GetTypedArrayByteLength( tmp_arg, cx ) == sizeof(cpVect), "Invalid length");
|
||||
|
||||
*ret = *(cpVect*)JS_GetArrayBufferViewData( tmp_arg, cx );
|
||||
|
||||
return JS_TRUE;
|
||||
#endif // #! JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES
|
||||
}
|
||||
|
||||
|
||||
jsval CGPoint_to_jsval( JSContext *cx, cpVect p)
|
||||
{
|
||||
|
||||
#ifdef JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES
|
||||
|
||||
JSObject *object = JS_NewObject(cx, NULL, NULL, NULL );
|
||||
if (!object)
|
||||
return JSVAL_VOID;
|
||||
|
||||
if (!JS_DefineProperty(cx, object, "x", DOUBLE_TO_JSVAL(p.x), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) ||
|
||||
!JS_DefineProperty(cx, object, "y", DOUBLE_TO_JSVAL(p.y), NULL, NULL, JSPROP_ENUMERATE | JSPROP_PERMANENT) )
|
||||
return JSVAL_VOID;
|
||||
|
||||
return OBJECT_TO_JSVAL(object);
|
||||
|
||||
#else // JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES
|
||||
|
||||
#ifdef __LP64__
|
||||
JSObject *typedArray = JS_NewFloat64Array( cx, 2 );
|
||||
#else
|
||||
JSObject *typedArray = JS_NewFloat32Array( cx, 2 );
|
||||
#endif
|
||||
|
||||
cpVect *buffer = (cpVect*)JS_GetArrayBufferViewData(typedArray, cx );
|
||||
*buffer = p;
|
||||
return OBJECT_TO_JSVAL(typedArray);
|
||||
#endif // ! JSB_COMPATIBLE_WITH_COCOS2D_HTML5_BASIC_TYPES
|
||||
}
|
|
@ -1,24 +0,0 @@
|
|||
#ifndef __COCOSJS_MANUAL_CONVERSIONS_H__
|
||||
#define __COCOSJS_MANUAL_CONVERSIONS_H__
|
||||
|
||||
#include "chipmunk.h"
|
||||
#include "cocos2d.h"
|
||||
#include "js_manual_conversions.h"
|
||||
|
||||
//#ifdef __cplusplus
|
||||
//extern "C" {
|
||||
//#endif
|
||||
|
||||
JSBool jsval_to_CGPoint( JSContext *cx, jsval vp, cpVect *out );
|
||||
jsval CGPoint_to_jsval( JSContext *cx, cpVect p );
|
||||
|
||||
|
||||
//#ifdef __cplusplus
|
||||
//}
|
||||
//#endif
|
||||
|
||||
#define cpVect_to_jsval CGPoint_to_jsval
|
||||
#define jsval_to_cpVect jsval_to_CGPoint
|
||||
|
||||
#endif /* __COCOSJS_MANUAL_CONVERSIONS_H__ */
|
||||
|
File diff suppressed because it is too large
Load Diff
|
@ -7,37 +7,70 @@
|
|||
|
||||
#include "jsapi.h"
|
||||
#include "js_bindings_core.h"
|
||||
|
||||
//#ifdef __cplusplus
|
||||
//extern "C" {
|
||||
//#endif
|
||||
#include "cocos2d.h"
|
||||
|
||||
extern JSBool jsval_to_opaque( JSContext *cx, jsval vp, void **out );
|
||||
extern JSBool jsval_to_int( JSContext *cx, jsval vp, int *out);
|
||||
extern JSBool jsval_to_uint( JSContext *cx, jsval vp, unsigned int *out);
|
||||
extern JSBool jsval_to_long( JSContext *cx, jsval vp, long *out);
|
||||
extern JSBool jsval_to_longlong( JSContext *cx, jsval vp, long long *out);
|
||||
extern jsval opaque_to_jsval( JSContext *cx, void* opaque);
|
||||
extern jsval c_class_to_jsval( JSContext *cx, void* handle, JSObject* object, JSClass *klass, const char* class_name);
|
||||
extern JSBool jsval_to_c_class( JSContext *cx, jsval vp, void **out_native, struct jsb_c_proxy_s **out_proxy);
|
||||
extern jsval int_to_jsval( JSContext *cx, int number );
|
||||
extern jsval uint_to_jsval( JSContext *cx, unsigned int number );
|
||||
extern jsval long_to_jsval( JSContext *cx, long number );
|
||||
extern jsval longlong_to_jsval( JSContext *cx, long long number );
|
||||
/** converts a jsval (JS string) into a char */
|
||||
extern JSBool jsval_to_charptr( JSContext *cx, jsval vp, const char **out);
|
||||
|
||||
extern jsval opaque_to_jsval( JSContext *cx, void* opaque);
|
||||
extern jsval c_class_to_jsval( JSContext *cx, void* handle, JSObject* object, JSClass *klass, const char* class_name);
|
||||
extern jsval long_to_jsval( JSContext *cx, long number );
|
||||
extern jsval longlong_to_jsval( JSContext *cx, long long number );
|
||||
|
||||
/* Converts a char ptr into a jsval (using JS string) */
|
||||
extern jsval charptr_to_jsval( JSContext *cx, const char *str);
|
||||
|
||||
extern JSBool JSB_jsval_to_int32( JSContext *cx, jsval vp, int32_t *outval );
|
||||
extern JSBool JSB_jsval_to_uint32( JSContext *cx, jsval vp, uint32_t *outval);
|
||||
extern JSBool JSB_jsval_typedarray_to_dataptr( JSContext *cx, jsval vp, GLsizei *count, void **data, JSArrayBufferViewType t);
|
||||
extern JSBool JSB_get_arraybufferview_dataptr( JSContext *cx, jsval vp, GLsizei *count, GLvoid **data );
|
||||
extern JSBool JSB_jsval_to_uint16( JSContext *cx, jsval vp, uint16_t *outval );
|
||||
|
||||
//#ifdef __cplusplus
|
||||
//}
|
||||
//#endif
|
||||
// some utility functions
|
||||
// to native
|
||||
JSBool jsval_to_int32( JSContext *cx, jsval vp, int32_t *ret );
|
||||
JSBool jsval_to_uint32( JSContext *cx, jsval vp, uint32_t *ret );
|
||||
JSBool jsval_to_uint16( JSContext *cx, jsval vp, uint16_t *ret );
|
||||
JSBool jsval_to_long_long(JSContext *cx, jsval v, long long* ret);
|
||||
JSBool jsval_to_std_string(JSContext *cx, jsval v, std::string* ret);
|
||||
JSBool jsval_to_ccpoint(JSContext *cx, jsval v, cocos2d::Point* ret);
|
||||
JSBool jsval_to_ccrect(JSContext *cx, jsval v, cocos2d::Rect* ret);
|
||||
JSBool jsval_to_ccsize(JSContext *cx, jsval v, cocos2d::Size* ret);
|
||||
JSBool jsval_to_cccolor4b(JSContext *cx, jsval v, cocos2d::Color4B* ret);
|
||||
JSBool jsval_to_cccolor4f(JSContext *cx, jsval v, cocos2d::Color4F* ret);
|
||||
JSBool jsval_to_cccolor3b(JSContext *cx, jsval v, cocos2d::Color3B* ret);
|
||||
JSBool jsval_to_ccarray_of_CCPoint(JSContext* cx, jsval v, cocos2d::Point **points, int *numPoints);
|
||||
JSBool jsval_to_ccarray(JSContext* cx, jsval v, cocos2d::Array** ret);
|
||||
JSBool jsval_to_ccdictionary(JSContext* cx, jsval v, cocos2d::Dictionary** ret);
|
||||
JSBool jsval_to_ccacceleration(JSContext* cx,jsval v, cocos2d::Acceleration* ret);
|
||||
JSBool jsvals_variadic_to_ccarray( JSContext *cx, jsval *vp, int argc, cocos2d::Array** ret);
|
||||
JSBool jsval_to_ccaffinetransform(JSContext* cx, jsval v, cocos2d::AffineTransform* ret);
|
||||
JSBool jsval_to_FontDefinition( JSContext *cx, jsval vp, cocos2d::FontDefinition* ret );
|
||||
|
||||
// from native
|
||||
jsval int32_to_jsval( JSContext *cx, int32_t l);
|
||||
jsval uint32_to_jsval( JSContext *cx, uint32_t number );
|
||||
jsval long_long_to_jsval(JSContext* cx, long long v);
|
||||
jsval std_string_to_jsval(JSContext* cx, const std::string& v);
|
||||
jsval c_string_to_jsval(JSContext* cx, const char* v, size_t length = -1);
|
||||
jsval ccpoint_to_jsval(JSContext* cx, const cocos2d::Point& v);
|
||||
jsval ccrect_to_jsval(JSContext* cx, const cocos2d::Rect& v);
|
||||
jsval ccsize_to_jsval(JSContext* cx, const cocos2d::Size& v);
|
||||
jsval cccolor4b_to_jsval(JSContext* cx, const cocos2d::Color4B& v);
|
||||
jsval cccolor4f_to_jsval(JSContext* cx, const cocos2d::Color4F& v);
|
||||
jsval cccolor3b_to_jsval(JSContext* cx, const cocos2d::Color3B& v);
|
||||
jsval ccdictionary_to_jsval(JSContext* cx, cocos2d::Dictionary *dict);
|
||||
jsval ccarray_to_jsval(JSContext* cx, cocos2d::Array *arr);
|
||||
jsval ccacceleration_to_jsval(JSContext* cx, const cocos2d::Acceleration& v);
|
||||
jsval ccaffinetransform_to_jsval(JSContext* cx, const cocos2d::AffineTransform& t);
|
||||
jsval FontDefinition_to_jsval(JSContext* cx, const cocos2d::FontDefinition& t);
|
||||
|
||||
JSBool jsval_to_CGPoint( JSContext *cx, jsval vp, cpVect *out );
|
||||
jsval CGPoint_to_jsval( JSContext *cx, cpVect p );
|
||||
|
||||
#define cpVect_to_jsval CGPoint_to_jsval
|
||||
#define jsval_to_cpVect jsval_to_CGPoint
|
||||
|
||||
#endif /* __JS_MANUAL_CONVERSIONS_H__ */
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -31,7 +31,6 @@
|
|||
|
||||
#include "jsb_opengl_manual.h"
|
||||
#include "js_manual_conversions.h"
|
||||
#include "cocosjs_manual_conversions.h"
|
||||
#include "js_bindings_core.h"
|
||||
#include "jsb_opengl_functions.h"
|
||||
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
<ItemGroup>
|
||||
<ClCompile Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_auto.cpp" />
|
||||
<ClCompile Include="..\cocos2d_specifics.cpp" />
|
||||
<ClCompile Include="..\cocosjs_manual_conversions.cpp" />
|
||||
<ClCompile Include="..\jsb_opengl_functions.cpp" />
|
||||
<ClCompile Include="..\jsb_opengl_manual.cpp" />
|
||||
<ClCompile Include="..\jsb_opengl_registration.cpp" />
|
||||
|
@ -25,7 +24,6 @@
|
|||
<ItemGroup>
|
||||
<ClInclude Include="..\..\..\auto-generated\js-bindings\jsb_cocos2dx_auto.hpp" />
|
||||
<ClInclude Include="..\cocos2d_specifics.hpp" />
|
||||
<ClInclude Include="..\cocosjs_manual_conversions.h" />
|
||||
<ClInclude Include="..\jsb_helper.h" />
|
||||
<ClInclude Include="..\jsb_opengl_functions.h" />
|
||||
<ClInclude Include="..\jsb_opengl_manual.h" />
|
||||
|
|
|
@ -17,9 +17,6 @@
|
|||
<ClCompile Include="..\cocos2d_specifics.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\cocosjs_manual_conversions.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="..\js_bindings_core.cpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClCompile>
|
||||
|
@ -49,9 +46,6 @@
|
|||
<ClInclude Include="..\cocos2d_specifics.hpp">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\cocosjs_manual_conversions.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\js_bindings_config.h">
|
||||
<Filter>manual</Filter>
|
||||
</ClInclude>
|
||||
|
|
|
@ -14,6 +14,10 @@ var cc = cc || {};
|
|||
cc.AnimationCache.destroyInstance();
|
||||
};
|
||||
|
||||
cc.TextureCache.getInstance = function() {
|
||||
return cc.Director.getInstance().getTextureCache();
|
||||
};
|
||||
|
||||
// Deprecated member functions
|
||||
cc.Action.prototype.copy = function() {
|
||||
logW("cc.Action.copy", "cc.Action.clone");
|
||||
|
|
|
@ -214,7 +214,7 @@ void AssetsManager::downloadAndUncompress()
|
|||
_isDownloading = false;
|
||||
}
|
||||
|
||||
void AssetsManager::update(float delta)
|
||||
void AssetsManager::update()
|
||||
{
|
||||
if (_isDownloading) return;
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ public:
|
|||
/* @brief Download new package if there is a new version, and uncompress downloaded zip file.
|
||||
* Ofcourse it will set search path that stores downloaded files.
|
||||
*/
|
||||
virtual void update(float delta) override;
|
||||
virtual void update();
|
||||
|
||||
/* @brief Gets url of package.
|
||||
*/
|
||||
|
|
|
@ -1 +1 @@
|
|||
Subproject commit a94373655409f756b33d8a58cc798dcb00be257c
|
||||
Subproject commit 9797d4403207848f431d5b6456632cc966d84b0d
|
Loading…
Reference in New Issue