• cocos2d-x 2.1.2 bug发现


    1.在做屏蔽触摸时发现

    extensions中的CCScrollView类

    void CCScrollView::registerWithTouchDispatcher()
    {
    CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this, 0, false);
    }
    应该改成
    void CCScrollView::registerWithTouchDispatcher()
    {
    CCDirector::sharedDirector()->getTouchDispatcher()->addTargetedDelegate(this, getTouchPriority(), false);
    }

    2.tile map 不支持获取折线点

    CCTMXXMLParser.cpp
    Line 677
    else if (elementName == "polyline")
        {
            // find parent object's dict and add polyline-points to it
            // CCTMXObjectGroup* objectGroup = (CCTMXObjectGroup*)m_pObjectGroups->lastObject();
            // CCDictionary* dict = (CCDictionary*)objectGroup->getObjects()->lastObject();
            // TODO: dict->setObject:[attributeDict objectForKey:@"points"] forKey:@"polylinePoints"];
            // find parent object's dict and add polygon-points to it
            CCTMXObjectGroup* objectGroup = (CCTMXObjectGroup*)m_pObjectGroups->lastObject();
            CCDictionary* dict = (CCDictionary*)objectGroup->getObjects()->lastObject();
    
            // get points value string
            const char* value = valueForKey("points", attributeDict);
            if(value)
            {
                CCArray* pPointsArray = new CCArray;
                // parse points string into a space-separated set of points
                stringstream pointsStream(value);
                string pointPair;
                while(std::getline(pointsStream, pointPair, ' '))
                {
                    // parse each point combo into a comma-separated x,y point
                    stringstream pointStream(pointPair);
                    string xStr,yStr;
                    char buffer[32] = {0};
                    CCDictionary* pPointDict = new CCDictionary;
                    // set x
                    if(std::getline(pointStream, xStr, ','))
                    {
                        int x = atoi(xStr.c_str()) + (int)objectGroup->getPositionOffset().x;
                        sprintf(buffer, "%d", x);
                        CCString* pStr = new CCString(buffer);
                        pStr->autorelease();
                        pPointDict->setObject(pStr, "x");
                    }
                    // set y
                    if(std::getline(pointStream, yStr, ','))
                    {
                        int y = atoi(yStr.c_str()) + (int)objectGroup->getPositionOffset().y;
                        sprintf(buffer, "%d", y);
                        CCString* pStr = new CCString(buffer);
                        pStr->autorelease();
                        pPointDict->setObject(pStr, "y");
                    }
                    // add to points array
                    pPointsArray->addObject(pPointDict);
                    pPointDict->release();
                }
                dict->setObject(pPointsArray, "points");
                pPointsArray->release();
            }
        }

    3.编辑器的UISlider在程序加载初始化时会产生一个内存泄露,cocos2dx version 2.2.1

    在GUIReader.cpp的WidgetPropertiesReader0300::setPropsForSliderFromJsonDictionary方法的最后一行加上CC_SAFE_DELETE(progressBarDic);
  • 相关阅读:
    JVM详解(十)——垃圾回收算法
    JVM详解(九)——StringTable
    JVM详解(八)——执行引擎
    JVM详解(七)——直接内存
    JVM详解(六)——对象的实例化、内存布局与访问定位
    JVM详解(五)——运行时数据区-方法区
    JVM详解(四)——运行时数据区-堆
    http发送url请求
    超简单超详细的redis安装教程
    org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.binding.BindingException: Parameter 'bookID' not found. Available parameters are [param1, bookId]解决问题
  • 原文地址:https://www.cnblogs.com/hewei2012/p/3398840.html
Copyright © 2020-2023  润新知