Code Monkey home page Code Monkey logo

engine-native's Introduction

Cocos native engine for Cocos Creator v2.x

Build Status

It is based on cocos2d-x[version 3.9], but remove 3D and other features. It works on iOS, Android, macOS and Windows.

For Cocos Creator v3.5+, native engine have been merged into engine repository


The major change:

  • Remove 3D features

    • Sprite3D
    • Skybox
    • Terrain
    • Light
    • Navmesh
    • Physics3D
    • BillBoard
    • Animate3D
    • Bundle3D
    • MeshSkin
    • etc..
  • Only support iOS, macOS, Android and Windows.

  • Remove support for LUA script

  • Remove deprecated classes and functions

  • Remove Camera

  • Remove Physics integration

  • Using FastTileMap instead of TileMap

  • Remove C++ implementations of CocoStudio parser

  • Remove C++ implementations of CocosBuilder parser

  • Remove AssetsManager, AssetsManagerEX

  • Remove Allocator

  • Remove AutoPolygon

  • Remove support for WebP, S3TC, ATITC

  • Remove support for game controller

  • Improved robustness and many bugs have been fixed

Git user attention

  1. Clone the repo from GitHub.

    $ git clone https://github.com/cocos-creator/engine-native.git
    $ cd engine-native
    $ npm install
    
  2. After cloning the repo, please execute gulp init to download and install dependencies.

    $ gulp init
    
  3. Build simulator

    $ gulp gen-simulator
    $ gulp update-simulator-config
    

    If you need to debug the simulator on macOS, you should sign the "./simulator/mac/simulator.app" by using codesign after build, or manually build the simulator project ("./tools/simulator/frameworks/runtime-src/proj.ios_mac/simulator.xcodeproj") in Xcode and enable Signing.

Contributing to the Project

The engine code is open sourced under the License. We welcome participation!

engine-native's People

Contributors

2youyou2 avatar bofeng-song avatar caryliu1999 avatar cocos-robot avatar cocosrobot avatar colincollins avatar dabingnn avatar drelaptop avatar holycanvas avatar hylthink avatar jareguo avatar knoxhuang avatar minggo avatar mmyduckx avatar nantas avatar pandamicro avatar patricejiang avatar pppro avatar sunnylanwanjun avatar timlyeee avatar w-mtzing avatar wdzhangchukong avatar wenhailin avatar wuzhiming avatar xianyinchen avatar xmliaowx avatar yangws avatar yongminghuang avatar zhefengzhang avatar zilongshanren avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

engine-native's Issues

1.6.0 关于setLocalZOrder的bug

在web平台测试了下 setLocalZOrder方法是正常作用的, 但是在模拟器和原生平台上, 在同一个父节点下的不同子节点 a、b、c 、d 调用setLocalZOrder 设置a层级为 1 ,b层级为2,c层级为3,d层级为4. 然后将d节点隐藏 会导致a节点渲染在 b、c节点之上。 显示上就是a节点遮盖了b、c节点。
在1.5.1上测试 原生和h5 模拟器都是正常的。。。

Potential Crash in JSB_WebSocketDelegate::onMessage

0 JavaScriptCore _llint_slow_path_put_by_id + 364
1 JavaScriptCore _llint_slow_path_put_by_id + 80
2 JavaScriptCore _llint_entry + 12112
3 JavaScriptCore _vmEntryToJavaScript + 272
4 JavaScriptCore JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 136
5 JavaScriptCore JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 400
6 JavaScriptCore JSC::callSetter(JSC::ExecState*, JSC::JSValue, JSC::JSValue, JSC::JSValue, JSC::ECMAMode) + 244
7 JavaScriptCore JSC::JSObject::putInlineSlow(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&) + 804
8 JavaScriptCore _llint_slow_path_put_by_id + 820
9 JavaScriptCore _llint_entry + 12112
10 JavaScriptCore _llint_entry + 26896
11 JavaScriptCore _llint_entry + 26896
12 JavaScriptCore _llint_entry + 26896
13 JavaScriptCore _llint_entry + 26896
14 JavaScriptCore _llint_entry + 28096
15 JavaScriptCore _llint_entry + 26896
16 JavaScriptCore _llint_entry + 28096
17 JavaScriptCore _llint_entry + 26896
18 JavaScriptCore _vmEntryToJavaScript + 272
19 JavaScriptCore JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 136
20 JavaScriptCore JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 400
21 JavaScriptCore JSC::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 168
22 JavaScriptCore JSObjectCallAsFunction + 368
23 ahzh-mobile se::Object::call(std::__1::vector<se::Value, std::__1::allocatorse::Value > const&, se::Object*, se::Value*) + 152
24 ahzh-mobile JSB_WebSocketDelegate::onMessage(cocos2d::network::WebSocket*, cocos2d::network::WebSocket::Data const&) + 808
25 ahzh-mobile -[WebSocketImpl webSocket:didReceiveMessageWithData:] + 184
26 ahzh-mobile ___43-[SRWebSocket _handleFrameWithData:opCode:]_block_invoke.317 + 84
27 libdispatch.dylib __dispatch_call_block_and_release + 24
28 libdispatch.dylib __dispatch_client_callout + 16
29 libdispatch.dylib __dispatch_main_queue_callback_4CF$VARIANT$mp + 1016
30 CoreFoundation _CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 12
31 CoreFoundation ___CFRunLoopRun + 2012
32 CoreFoundation CFRunLoopRunSpecific + 436
33 GraphicsServices GSEventRunModal + 100
34 UIKit UIApplicationMain + 208
35 ahzh-mobile main (main.m:8)
36 libdyld.dylib _start + 4

How to build libjs_static.a by myself?

I'm try to build game by using ndk clang with modified version of build_android.py and Application.mk, which use APP_STL := c++_static instead of gnu_stl.

But libjs_static.a seems built by gcc and gnu_stl which produce some errors like
C:/proj/cocos_creator_test/build/jsb-default/frameworks/cocos2d-x/external/android/armeabi/libjs_static.a(jscntxt.o)(.text+0xb8c): error: undefined reference to 'std::ios_base::ios_base()' during linking.

So my question is how can I build libjs_static.a from source? Then I could use clang and c++_static to build my own libjs_static.a.

Thanks

sp.Skeleton can't remove completeListener by setCompleteListener(null)

cocos creator 1.8

in jsb_spine.js

sp.SkeletonAnimation.prototype.setCompleteListener = function (listener) {
    this._compeleteListener = listener;
    this.setCompleteListenerNative(function (trackEntry) {
        var loopCount = Math.floor(trackEntry.trackTime / trackEntry.animationEnd);
        this._compeleteListener(trackEntry, loopCount);
    });
};

if arg listener is null, function setCompleteListenerNative should pass null too.

Simulator not found in cocos2d-x path

I'm not sure if this is an issue or bug but I downloaded the latest version of cocos2d-x-lite and then saw this message in the Preference of Cocos Creator.

screen shot 2016-06-10 at 9 23 35 pm

Bug 1.3.2 安卓上 cc.game.restart()报错

4:36.458 3448 3464 D cocos2d-x debug info: Cocos2d-JS v3.13
11-28 18:44:38.453 3448 3464 E cocos js error:: /data/user/0/com.baiyou.dkd/files/blackjack-remote-asset/src/jsb_polyfill.js line:28901 msg:TypeError: cc.director.getScheduler(...)._schedule is not a function
11-28 18:44:38.454 3448 3464 D cocos2d-x debug info: Evaluating main.js failed (evaluatedOK == JS_FALSE)

内存释放

我想在APP应用里加入游戏的场景,我想在页面返回的时候释放内存,试了几种办法,都不行。请问有什么正确的方法呢?
[CCDirectorCaller destroy];
cocos2d::Director::getInstance()->getTextureCache()->removeAllTextures();
cocos2d::Director::getInstance()->end();
cocos2d::Director::getInstance()->mainLoop();
cocos2d::PoolManager::getInstance()->getCurrentPool()->clear();

TTF text wrap algorithm is not accurate

  1. set a string to a label with none overflow
  2. get the content size of this string and set the content size to this string
  3. change the overflow of this string to clamp

Observed behavior:

  1. the label will wrap text

Expected behavior:

  1. the label shouldn't wrap text.

Google security Warning

引擎使用cocos统计的话,会导致google预发布报告的一个警告,
Your app is using device identifiers (IMEI, MAC address, Build Serial, etc.) and sending identifier data to a remote network address.

This issue is commonly (but not only) found in apps using an outdated Advertising SDK.

To stop receiving this warning, try updating or changing any SDKs or code in your app that may be using device identifiers.

Sending device identifiers is not a best practice for most use-cases and if you're using this identifier for advertising purposes, this may be a violation of Google Play policies and can affect your app’s visibility on the Play Store. To get recommendations on how your app can use identifiers, learn about unique identifier best practices.

libcocosanalytics.jar中有不少读取硬件信息的代码,
(TelephonyManager)paramContext.getSystemService("phone")).getDeviceId()
(WifiManager)paramContext.getSystemService("wifi")).getConnectionInfo().getMacAddress();
统计如今已经不建议直接使用这种硬件信息来指定唯一标识了

jsb_prepare.js 存在性能问题

在cocos/scripting/js-bindings/script/jsb_prepare.js中的

jsb.registerNativeRef = function (owner, target) {
    if (owner && target && owner !== target) {
        var refs = owner.__nativeRefs;
        if (!refs) {
            refs = owner.__nativeRefs = [];
        }
        var index = refs.indexOf(target);
        if (index === -1) {
            owner.__nativeRefs.push(target);
        }
    }
};

jsb.unregisterNativeRef = function (owner, target) {
    if (owner && target && owner !== target) {
        var refs = owner.__nativeRefs;
        if (!refs) {
            return;
        }
        var index = refs.indexOf(target);
        if (index !== -1) {
            owner.__nativeRefs.splice(index, 1);
        }
    }
};

当子结点很多时,再往里面插入结点,refs.indexOf会遍历子结点,这个会引起性能问题。
有可能改为字典关联(dict)的方式么?

Potential Crash in ScriptingCore::handleActionEvent

0 JavaScriptCore _llint_slow_path_get_by_id + 3924
1 JavaScriptCore _llint_slow_path_get_by_id + 80
2 JavaScriptCore _llint_entry + 10612
3 JavaScriptCore _vmEntryToJavaScript + 272
4 JavaScriptCore JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 136
5 JavaScriptCore JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 400
6 JavaScriptCore JSC::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 168
7 JavaScriptCore JSObjectCallAsFunction + 368
8 ahzh-mobile se::Object::call(std::__1::vector<se::Value, std::__1::allocatorse::Value > const&, se::Object*, se::Value*) + 152
9 ahzh-mobile ScriptingCore::handleActionEvent(void*) + 296
10 ahzh-mobile ScriptingCore::sendEvent(cocos2d::ScriptEvent*) + 84
11 ahzh-mobile cocos2d::ScriptEngineManager::sendActionEventToJS(cocos2d::Action*, int, void*) + 80
12 ahzh-mobile cocos2d::Sequence::update(float) + 420
13 ahzh-mobile cocos2d::Sequence::update(float) + 388
14 ahzh-mobile cocos2d::ActionInterval::step(float) + 136
15 ahzh-mobile cocos2d::RepeatForever::step(float) + 36
16 ahzh-mobile cocos2d::ActionManager::update(float) + 156
17 ahzh-mobile std::__1::function<void (float)>::operator()(float) const + 40
18 ahzh-mobile cocos2d::Scheduler::update(float) + 100
19 ahzh-mobile cocos2d::Director::drawScene() + 72
20 ahzh-mobile cocos2d::Director::mainLoop() + 56
21 QuartzCore CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 672
22 QuartzCore display_timer_callback(__CFMachPort*, void*, long, void*) + 240
23 CoreFoundation ___CFMachPortPerform + 188
24 CoreFoundation _CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 56
25 CoreFoundation ___CFRunLoopDoSource1 + 440
26 CoreFoundation ___CFRunLoopRun + 2196
27 CoreFoundation CFRunLoopRunSpecific + 436
28 GraphicsServices GSEventRunModal + 100
29 UIKit UIApplicationMain + 236
30 ahzh-mobile main (main.m:8)
31 libdyld.dylib _start + 4

Native New Renderer for Cocos Creator 2.0

  • Remove cc.TextureCache, add asynchronous native method for loading textures.
  • Support to run engine JS scripts without packing them. That will be easier for debugging.
    • Resolve typeof bug in JavaScriptCore

getTypedArrayData returns failure for empty buffers

https://github.com/cocos-creator/cocos2d-x-lite/blob/d625446a2d4830d08c1c702d2da9c4e8ca2c4340/cocos/scripting/js-bindings/jswrapper/jsc/Object.cpp#L1044

^ This returns true only if there is data. Considering the function prototype and description I have the length pointer to know if and how much data I have (or if I don't have); I would expect to return false when it FAILS not when it makes arbitrary decisions about how much data I should pass from js. An empty buffer is perfectly valid, this is a breaking change for js bindings.

        /**
         *  @brief Gets backing store of a typed array object.
         *  @param[out] ptr A temporary pointer to the backing store of a JavaScript Typed Array object.
         *  @param[out] length The byte length of a JavaScript Typed Array object.
         *  @return true if succeed, otherwise false.
         */
        bool getTypedArrayData(uint8_t** ptr, size_t* length) const;

Potential Crash in invokeJSTouchOneByOneCallback

0 JavaScriptCore _llint_slow_path_get_by_id + 3924
1 JavaScriptCore _llint_slow_path_get_by_id + 80
2 JavaScriptCore _llint_entry + 10612
3 JavaScriptCore _vmEntryToJavaScript + 272
4 JavaScriptCore JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 136
5 JavaScriptCore JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 400
6 JavaScriptCore JSC::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 168
7 JavaScriptCore JSObjectCallAsFunction + 368
8 ahzh-mobile se::Object::call(std::__1::vector<se::Value, std::__1::allocatorse::Value > const&, se::Object*, se::Value*) + 152
9 ahzh-mobile invokeJSTouchOneByOneCallback(cocos2d::EventListenerTouchOneByOne*, TouchOneByOneType, cocos2d::Touch*, cocos2d::Event*, se::Value*) + 524
10 ahzh-mobile std::__1::function<void (cocos2d::Touch*, cocos2d::Event*)>::operator()(cocos2d::Touch*, cocos2d::Event*) const + 44
11 ahzh-mobile _ZNSt3__110__function6__funcIZN7cocos2d15EventDispatcher18dispatchTouchEventEPNS2_10EventTouchEE3$3NS_9allocatorIS6_EEFbPNS2_13EventListenerEEEclEOSA + 292
12 ahzh-mobile std::__1::function<bool (cocos2d::EventListener*)>::operator()(cocos2d::EventListener*) const+ 40
13 ahzh-mobile cocos2d::EventDispatcher::dispatchEventToListeners(cocos2d::EventDispatcher::EventListenerVector*, std::__1::function<bool (cocos2d::EventListener*)> const&) + 208
14 ahzh-mobile cocos2d::EventDispatcher::dispatchTouchEvent(cocos2d::EventTouch*) + 364
15 ahzh-mobile cocos2d::EventDispatcher::dispatchEvent(cocos2d::Event*) + 208
16 ahzh-mobile cocos2d::GLView::handleTouchesOfEndOrCancel(cocos2d::EventTouch::EventCode, int, long*, float*, float*) + 416
17 ahzh-mobile -[CCEAGLView touchesEnded:withEvent:] + 504
18 UIKit -[UIWindow _sendTouchesForEvent:] + 2544
19 UIKit -[UIWindow sendEvent:] + 3208
20 UIKit -[UIApplication sendEvent:] + 340
21 UIKit ___dispatchPreprocessedEventFromEventQueue + 2364
22 UIKit ___handleEventQueueInternal + 4760
23 UIKit ___handleHIDEventFetcherDrain + 152
24 CoreFoundation _CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION + 24
25 CoreFoundation ___CFRunLoopDoSource0 + 88
26 CoreFoundation ___CFRunLoopDoSources0 + 204
27 CoreFoundation ___CFRunLoopRun + 1048
28 CoreFoundation CFRunLoopRunSpecific + 436
29 GraphicsServices GSEventRunModal + 100
30 UIKit UIApplicationMain + 236
31 ahzh-mobile main (main.m:8)
32 libdyld.dylib _start + 4

在下载特定图片时回发生崩溃问题

图片url http://wx.qlogo.cn/mmopen/ajNVdqHZLLDbia3DV1HyfiavnfQ93VmqYy3RBCa794HPicWWYVBLMwRbV21l38WGUgXcTxjGCyzJj1dAUDlN7UMQ/132
当加载这个图片地址,回发生崩溃现象,已定位到的位置是jsb_cocos2dx_extension_manual.cpp中void __JSDownloaderDelegator::onError()函数,此函数执行到 JS_CallFunctionName(_cx, runtimeObj, "onDownloadRemoteFile", JS::HandleValueArray::fromMarkedLocation(2, valArr), @&retVal);时调用了JS的方法去释放资源,但崩溃,没有往下执行。

void __JSDownloaderDelegator::onError()
{
LOGD("onError fisrt node");
Director::getInstance()->getScheduler()->performFunctionInCocosThread([this]
{

    auto sc = ScriptingCore::getInstance();
    LOGD("onError third node");
    JS::RootedObject globalObj(_cx, sc->getGlobalObject());
    LOGD("onError forth node");
    JS::RootedValue runtimeValue(_cx);
    LOGD("onError fifth node");
    JS_GetProperty(_cx, globalObj, "jsb", &runtimeValue);
    LOGD("onError sixth node");
    JS::RootedObject runtimeObj(_cx, runtimeValue.toObjectOrNull());

    LOGD("onError seventh node");
    jsval valArr[3];        
    valArr[0] = INT_TO_JSVAL(_callbackIndex);
    valArr[1] = BOOLEAN_TO_JSVAL(false);
    //valArr[2] = JSVAL_NULL;

    LOGD("onError eighth node");
    JS::RootedValue retVal(_cx);
    LOGD("onError ninth node");
    //JS_CallFunctionName(_cx, runtimeObj, "onDownloadRemoteFile", JS::HandleValueArray::fromMarkedLocation(3, valArr), &retVal);
    //原始的
    JS_CallFunctionName(_cx, runtimeObj, "onDownloadRemoteFile", JS::HandleValueArray::fromMarkedLocation(2, valArr), &retVal);
    LOGD("before onError release");
    release();
});
 LOGD("onError second node");

}

ResizableBufferAdapter<Data>::resize() is broken

Calling resize() with a smaller size than current buffer does nothing. This breaks all expectations considering how virtually every container out there handles resize() and breaks any chained processors that need a smaller sized buffer.

Everywhere else resize() is resize() but for Data resize() is reserve()

Potential crash in JSB_WebSocketDelegate::onMessage call removeAllChildrenWithCleanup

Another crash relevant to JSB_WebSocketDelegate

0 JavaScriptCore JSC::JSObject::hasPropertyGeneric(JSC::ExecState*, JSC::PropertyName, JSC::PropertySlot::InternalMethodType) const + 2044
1 JavaScriptCore JSObjectHasProperty + 88
2 JavaScriptCore JSObjectHasProperty + 88
3 ahzh-mobile se::Object::getProperty(char const*, se::Value*) + 64
4 ahzh-mobile onReceiveNodeEvent(void*, ScriptingCore::NodeEventType) + 148
5 ahzh-mobile ScriptingCore::handleNodeEvent(void*) + 140
6 ahzh-mobile cocos2d::ScriptEngineManager::sendNodeEventToJS(cocos2d::Node*, int) + 116
7 ahzh-mobile cocos2d::Node::onExitTransitionDidStart() + 44
8 ahzh-mobile cocos2d::Node::onExitTransitionDidStart() + 76
9 ahzh-mobile cocos2d::Node::removeAllChildrenWithCleanup(bool) + 72
10 ahzh-mobile js_cocos2dx_Node_removeAllChildrenWithCleanupRegistry(OpaqueJSContext const*, OpaqueJSValue*, OpaqueJSValue*, unsigned long, OpaqueJSValue const* const*, OpaqueJSValue const**) + 272
11 JavaScriptCore long long JSC::APICallbackFunction::callJSC::JSCallbackFunction(JSC::ExecState*) + 348
12 JavaScriptCore JSC::LLInt::setUpCall(JSC::ExecState*, JSC::Instruction*, JSC::CodeSpecializationKind, JSC::JSValue, JSC::LLIntCallLinkInfo*) + 440
13 JavaScriptCore _llint_entry + 26980
14 JavaScriptCore _llint_entry + 26896
15 JavaScriptCore _llint_entry + 26896
16 JavaScriptCore _llint_entry + 26996
17 JavaScriptCore _vmEntryToJavaScript + 272
18 JavaScriptCore JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 136
19 JavaScriptCore JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 400
20 JavaScriptCore JSC::callSetter(JSC::ExecState*, JSC::JSValue, JSC::JSValue, JSC::JSValue, JSC::ECMAMode) + 244
21 JavaScriptCore JSC::JSObject::putInlineSlow(JSC::ExecState*, JSC::PropertyName, JSC::JSValue, JSC::PutPropertySlot&) + 804
22 JavaScriptCore _llint_slow_path_put_by_id + 820
23 JavaScriptCore _llint_entry + 12112
24 JavaScriptCore _llint_entry + 26896
25 JavaScriptCore _llint_entry + 26896
26 JavaScriptCore _llint_entry + 26896
27 JavaScriptCore _llint_entry + 26896
28 JavaScriptCore _llint_entry + 28096
29 JavaScriptCore _llint_entry + 26896
30 JavaScriptCore _vmEntryToJavaScript + 272
31 JavaScriptCore JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 136
32 JavaScriptCore JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 400
33 JavaScriptCore JSC::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 168
34 JavaScriptCore JSObjectCallAsFunction + 368
35 ahzh-mobile se::Object::call(std::__1::vector<se::Value, std::__1::allocatorse::Value > const&, se::Object*, se::Value*)+ 152
36 ahzh-mobile JSB_WebSocketDelegate::onMessage(cocos2d::network::WebSocket*, cocos2d::network::WebSocket::Data const&) + 808
37 ahzh-mobile -[WebSocketImpl webSocket:didReceiveMessageWithData:] + 184
38 ahzh-mobile ___43-[SRWebSocket _handleFrameWithData:opCode:]_block_invoke.317 + 84
39 libdispatch.dylib __dispatch_call_block_and_release + 24
40 libdispatch.dylib __dispatch_client_callout + 16
41 libdispatch.dylib __dispatch_main_queue_callback_4CF$VARIANT$mp + 1016
42 CoreFoundation _CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE + 12
43 CoreFoundation ___CFRunLoopRun + 2012
44 CoreFoundation CFRunLoopRunSpecific + 436
45 GraphicsServices GSEventRunModal + 100
46 UIKit UIApplicationMain + 208
47 ahzh-mobile main (main.m:8)
48 libdyld.dylib _start + 4

Potential Crash in js_cocos2dx_TextureCache_addImageAsync

0 JavaScriptCore _llint_slow_path_put_by_val + 1276
1 JavaScriptCore _llint_slow_path_put_by_val + 60
2 JavaScriptCore _llint_entry + 14040
3 JavaScriptCore _llint_entry + 26408
4 JavaScriptCore _llint_entry + 26408
5 JavaScriptCore _llint_entry + 26408
6 JavaScriptCore _llint_entry + 26308
7 JavaScriptCore _llint_entry + 26308
8 JavaScriptCore _llint_entry + 26408
9 JavaScriptCore _llint_entry + 26308
10 JavaScriptCore _llint_entry + 26308
11 JavaScriptCore _llint_entry + 26308
12 JavaScriptCore _llint_entry + 26308
13 JavaScriptCore _llint_entry + 26408
14 JavaScriptCore void WTF::dataLog<char [36], JSC::PropertyName, char [30]>(char const (&) [36], JSC::PropertyName const&, char const (&) [30]) + 436
15 JavaScriptCore JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 164
16 JavaScriptCore JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 416
17 JavaScriptCore JSC::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 164
18 JavaScriptCore JSObjectCallAsFunction + 636
19 ahzh-mobile se::Object::call(std::__1::vector<se::Value, std::__1::allocatorse::Value > const&, se::Object*, se::Value*)+ 152
20 ahzh-mobile _ZNSt3__110__function6__funcIZL38js_cocos2dx_TextureCache_addImageAsyncRN2se5StateEE4$17NS_9allocatorIS5_EEFvPN7cocos2d9Texture2DEEEclEOSA + 140
21 ahzh-mobile std::__1::function<void (cocos2d::Texture2D*)>::operator()(cocos2d::Texture2D*) const + 40
22 ahzh-mobile cocos2d::TextureCache::addImageAsyncCallBack(float) + 1024
23 ahzh-mobile cocos2d::Timer::update(float) + 196
24 ahzh-mobile cocos2d::Scheduler::update(float) + 280
25 ahzh-mobile cocos2d::Director::drawScene() + 72
26 ahzh-mobile cocos2d::Director::mainLoop() + 56
27 QuartzCore CA::Display::DisplayLinkItem::dispatch(unsigned long long) + 44
28 QuartzCore CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 436
29 IOKit IODispatchCalloutFromCFMessage + 372
30 CoreFoundation ___CFMachPortPerform + 180
31 CoreFoundation _CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 56
32 CoreFoundation ___CFRunLoopDoSource1 + 436
33 CoreFoundation ___CFRunLoopRun + 1752
34 CoreFoundation CFRunLoopRunSpecific + 424
35 GraphicsServices GSEventRunModal + 100
36 UIKit UIApplicationMain + 208
37 ahzh-mobile main (main.m:8)
38 libdyld.dylib _start + 4

graphicnode 调用了 glBlendfunc

graphicnode onDraw直接调用了 glBlendfunc,而不是 GL::blendFunc,导致glstatecache状态错误,引起其它对象渲染不正确。

Potential crash in js_EventListenerCustom_create

0 JavaScriptCore _llint_slow_path_jfalse + 344
1 JavaScriptCore _llint_slow_path_jfalse + 52
2 JavaScriptCore _llint_entry + 23928
3 JavaScriptCore _llint_entry + 26896
4 JavaScriptCore _llint_entry + 26996
5 JavaScriptCore _llint_entry + 26896
6 JavaScriptCore _llint_entry + 26896
7 JavaScriptCore _llint_entry + 26996
8 JavaScriptCore _llint_entry + 26896
9 JavaScriptCore _llint_entry + 26896
10 JavaScriptCore _vmEntryToJavaScript + 272
11 JavaScriptCore JSC::JITCode::execute(JSC::VM*, JSC::ProtoCallFrame*) + 136
12 JavaScriptCore JSC::Interpreter::executeCall(JSC::ExecState*, JSC::JSObject*, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 400
13 JavaScriptCore JSC::profiledCall(JSC::ExecState*, JSC::ProfilingReason, JSC::JSValue, JSC::CallType, JSC::CallData const&, JSC::JSValue, JSC::ArgList const&) + 168
14 JavaScriptCore JSObjectCallAsFunction + 368
15 ahzh-mobile se::Object::call(std::__1::vector<se::Value, std::__1::allocatorse::Value > const&, se::Object*, se::Value*) + 152
16 ahzh-mobile _ZNSt3__110__function6__funcIZL29js_EventListenerCustom_createRN2se5StateEE4$17NS_9allocatorIS5_EEFvPN7cocos2d11EventCustomEEEclEOSA + 704
17 ahzh-mobile std::__1::function<void (cocos2d::EventCustom*)>::operator()(cocos2d::EventCustom*) const + 40
18 ahzh-mobile std::__1::function<void (cocos2d::Event*)>::operator()(cocos2d::Event*) const + 40
19 ahzh-mobile _ZNSt3__110__function6__funcIZN7cocos2d15EventDispatcher13dispatchEventEPNS2_5EventEE3$2NS_9allocatorIS6_EEFbPNS2_13EventListenerEEEclEOSA + 52
20 ahzh-mobile std::__1::function<bool (cocos2d::EventListener*)>::operator()(cocos2d::EventListener*) const+ 40
21 ahzh-mobile cocos2d::EventDispatcher::dispatchEventToListeners(cocos2d::EventDispatcher::EventListenerVector*, std::__1::function<bool (cocos2d::EventListener*)> const&) + 292
22 ahzh-mobile cocos2d::EventDispatcher::dispatchEvent(cocos2d::Event*) + 168
23 ahzh-mobile cocos2d::Director::drawScene() + 84
24 ahzh-mobile cocos2d::Director::mainLoop() + 56
25 QuartzCore CA::Display::DisplayLink::dispatch_items(unsigned long long, unsigned long long, unsigned long long) + 672
26 IOKit IODispatchCalloutFromCFMessage + 392
27 CoreFoundation ___CFMachPortPerform + 188
28 CoreFoundation _CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 56
29 CoreFoundation ___CFRunLoopDoSource1 + 440
30 CoreFoundation ___CFRunLoopRun + 2196
31 CoreFoundation CFRunLoopRunSpecific + 436
32 GraphicsServices GSEventRunModal + 100
33 UIKit UIApplicationMain + 236
34 ahzh-mobile main (main.m:8)
35 libdyld.dylib _start + 4

_sendRequest 没有捕获异常

void MinXmlHttpRequest::_sendRequest(JSContext *cx)

在没有网络的情况下,会抛异常!调用者不清楚具体发生了什么。

RenderTexture doesn't render all nodes

RenderTexture seems broken in the lite branch, it doesn't render all visited notes. Attached is the result of the same code running on the 'lite' version that comes with Cocos Creator 1.7 and 'regular' cocos 2dx 3.16.

The test is nothing fancy, takes an jpeg image with 6x6 colored squares, breaks it in separate sprites using the same texture with different rects and renders/saves them to a file using RenderTexture.

texture_cocos-creator-170
texture_cocos2d-x-3 16

run gulp sign-simulator failed

gulp sign-simulator
[08:25:57] Using gulpfile ~/Documents/C_Code/Leo/CreatorEngine/gulpfile.js
[08:25:57] Task 'sign-simulator' is not in your gulpfile
[08:25:57] Please check the documentation for proper gulpfile formatting

No template for cpp language

When create project with '-l cpp' argument, out ERR message:
Fatal: can't find any template for language.
You can specify the path of cocos2d-x by argument '-e'.

when SIOClient::fireEvent the second time,crash.

void SIOClient::fireEvent(const std::string& eventName, const std::string& data)
{
    CCLOGINFO("SIOClient::fireEvent called with event name: %s and data: %s", eventName.c_str(), data.c_str());

    _delegate->fireEventToScript(this, eventName, data);


    //if(_eventRegistry[eventName]) need to change
    if(_eventRegistry.find(eventName) != _eventRegistry.end())
    {
        SIOEvent e = _eventRegistry[eventName];

        e(this, data);

        return;
    }

    CCLOGINFO("SIOClient::fireEvent no native event with name %s found", eventName.c_str());
}

个傲虎

graphicnode onDraw直接调用了 glBlendfunc,而不是 GL::blendFunc,导致glstatecache状态错误,引起其它对象渲染不正确。

AssetsManagerEx has a question

after creator 1.4, jsb.AssetsManager provide a function "setVersionCompareHandler" that user can define self version compare.
but when AssetsManangerEx class is creating, AssetsManagerEx constructor function is using the default compare function (cmpVersion), because the user version compare handler can not be set when AssetsManagerEx contructor:
the call stack:
AssetsMangerEx:AssetsManagerEx();

AssetsManagerEx:initManifest();

AssetsManagerEx:loadLocalManifest();

Manifest:versionCreator(Manifest *b, handler);

** the call stack end **

中文:
creator 1.4 之后, 热更提供一个 让用户自己自定义比较版本的函数("setVersionCompareHandler"), 但是 js 创建 AssetsMangerEx时,AssetsMangerEx 构造函数只提供了 manifestUrl 路径和 storagePath,这时_versionCompareHandle还没有被赋值,所以在initManifests的时候使用了默认的比较函数,然后在调用堆栈的loadLocalManifest中的如下代码就和用户设想的不一样了,(因为_versionCompareHandle使用的是默认的函数),然后可能导致一直重复更新
image

cc.PolygonCollider 原生和 浏览器渲染方式不一样???

测试demo 帮忙看看 微信浏览器下 不算一个 calldraw

app 下面 算一个 calldraw ???
导致 app calldraw 无法 进行游戏下一步
测试demo
http://forum.cocos.com/uploads/default/original/3X/d/1/d18a482eb3c6768fbc624b5e0066411344852d86.zip

网页 没问题 app 卡成狗
addComponent(cc.BoxCollider);
cc.BoxCollider
cc.PolygonCollider 这2个 组件 感觉有问题 app 上面

cc.CircleCollider 圆形碰撞组件 是没有问题的
可是 检查不能全是圆的吧 鱼不是胖子

CCLabel存在性能问题,请看描述

Creator创建TTF类型的Label时默认的字体大小是40,如果游戏中不使用40的字体,会存在一个很大的性能问题。比如一个界面有几十个大小为20的Label,此时CCLabel的工作情况如下:

  1. 创建CCLabel,Creator传入默认大小为40,此时FontAtlasCache会创建一个FontAtlas,用于存放40大小的文字。而FontAtlas会预先创建一个512x512的Texture
  2. 接着Creator将Label字体大小改为20,CCLabel的setTTFConfig被调用,然后FontAtlasCache会再创建另一个FontAtlas用于存放20大小的文字。
  3. 问题来了:那个40的FontAtlas因为引用计算变为0,因此被释放掉了。当我创建几十个Label的时候,实际上一直在创建和释放那个40的FontAtlas,也即有一个512*512的Texture,在创建Label的过程当中,不断的被创建出来然后释放掉。

这个在文字信息很多的界面,性能消耗非常明显,我们项目优化掉这个以后,一个可以省掉250ms以上的时间

希望官方想一个更好的方案,我这里给一个建议是,引用计数为0的FontAtlas,不马上释放掉,而是放入一个LRUCache里,方便下次快速重用。

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.