coco2dx设置文件大小的时候报错

#0  0x779db570 in std::_List_iterator<cocos2d::VolatileTexture*>::operator++ (this=0x77eaf934) at D:/android-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.6/include/bits/stl_list.h:154
#1  0x779da8a4 in std::list<cocos2d::VolatileTexture*, std::allocator<cocos2d::VolatileTexture*> >::remove (this=0x77d5c03c, __value=@0x77eaf954) at D:/android-ndk-r9d/sources/cxx-stl/gnu-libstdc++/4.6/include/bits/list.tcc:248
#2  0x779d9944 in cocos2d::VolatileTexture::~VolatileTexture (this=0x7cb95dd0, __in_chrg=<optimized out>) at D:/cocos2dx/androiddev/cocos2dx/textures/CCTextureCache.cpp:733
#3  0x779d9e54 in cocos2d::VolatileTexture::removeTexture (t=0x7cb95d78) at D:/cocos2dx/androiddev/cocos2dx/textures/CCTextureCache.cpp:839
#4  0x779d22ac in cocos2d::CCTexture2D::~CCTexture2D (this=0x7cb95d78, __in_chrg=<optimized out>) at D:/cocos2dx/androiddev/cocos2dx/textures/CCTexture2D.cpp:80
#5  0x779d2354 in cocos2d::CCTexture2D::~CCTexture2D (this=0x7cb95d78, __in_chrg=<optimized out>) at D:/cocos2dx/androiddev/cocos2dx/textures/CCTexture2D.cpp:90
#6  0x7794a250 in cocos2d::CCObject::release (this=0x7cb95d78) at D:/cocos2dx/androiddev/cocos2dx/cocoa/CCObject.cpp:86
#7  0x779bac90 in cocos2d::CCSprite::setTexture (this=0x7cb95ae0, texture=0x7cb98198) at D:/cocos2dx/androiddev/cocos2dx/sprite_nodes/CCSprite.cpp:1104
#8  0x77971244 in cocos2d::CCLabelTTF::updateTexture (this=0x7cb95ae0) at D:/cocos2dx/androiddev/cocos2dx/label_nodes/CCLabelTTF.cpp:347
#9  0x77970e7c in cocos2d::CCLabelTTF::setFontSize (this=0x7cb95ae0, fontSize=25) at D:/cocos2dx/androiddev/cocos2dx/label_nodes/CCLabelTTF.cpp:294
#10 0x778def7c in cocos2d::extension::CCControlButton::setTitleTTFSizeForState (this=0x7cb91f98, size=25, state=1) at D:/cocos2dx/androiddev/extensions/GUI/CCControlExtension/CCControlButton.cpp:472
#11 0x778cadd8 in cocos2d::extension::CCControlButtonLoader::onHandlePropTypeFloatScale (this=0x78e858d8, pNode=0x7cb91f98, pParent=0x79080728, pPropertyName=0x790cd0a8, pFloatScale=25, pCCBReader=0x790b02d8) at D:/cocos2dx/androiddev/extensions/CCBReader/CCControlButtonLoader.cpp:59
#12 0x778ce288 in cocos2d::extension::CCNodeLoader::parseProperties (this=0x78e858d8, pNode=0x7cb91f98, pParent=0x79080728, pCCBReader=0x790b02d8) at D:/cocos2dx/androiddev/extensions/CCBReader/CCNodeLoader.cpp:144
#13 0x778c8254 in cocos2d::extension::CCBReader::readNodeGraph (this=0x790b02d8, pParent=0x79080728) at D:/cocos2dx/androiddev/extensions/CCBReader/CCBReader.cpp:526
#14 0x778c8558 in cocos2d::extension::CCBReader::readNodeGraph (this=0x790b02d8, pParent=0x0) at D:/cocos2dx/androiddev/extensions/CCBReader/CCBReader.cpp:586
#15 0x778c8ba4 in cocos2d::extension::CCBReader::readNodeGraph (this=0x790b02d8) at D:/cocos2dx/androiddev/extensions/CCBReader/CCBReader.cpp:689
#16 0x778c7824 in cocos2d::extension::CCBReader::readFileWithCleanUp (this=0x790b02d8, bCleanUp=true) at D:/cocos2dx/androiddev/extensions/CCBReader/CCBReader.cpp:323
#17 0x778c72dc in cocos2d::extension::CCBReader::readNodeGraphFromData (this=0x790b02d8, pData=0x79006f90, pOwner=0x0, parentSize=..., ppAnimationManager=0x0) at D:/cocos2dx/androiddev/extensions/CCBReader/CCBReader.cpp:230

 

解决方法:

代码追踪报错源头:

cocos2dx\textures\CCTexture2D.cpp

setShaderProgram(CCShaderCache::sharedShaderCache()->programForKey(kCCShader_PositionTexture));

 

参考根据下面文章:

https://www.cnblogs.com/sevenyuan/p/4060395.html

https://my.oschina.net/u/1430085/blog/191673

http://www.cocoachina.com/bbs/read.php?tid=200447

 

察看cocos2d-x-2.2.2的代码ccShader_PositionTexture_vert.h和cocos2d-2.0-x-2.0.4的比较.

确认删除代码:

uniform    mat4 u_MVPMatrix;                                \n\

再核查cocos2d-x-2.2.2\cocos2dx\shaders下涉及*_vert.h的文件,发现上述代码都删除了.

发布了6 篇原创文章 · 获赞 0 · 访问量 2736
展开阅读全文

没有更多推荐了,返回首页

©️2019 CSDN 皮肤主题: 大白 设计师: CSDN官方博客

分享到微信朋友圈

×

扫一扫,手机浏览