之前一个即时战略rpg的游戏项目,花了3天移植到3.0上来了,发现各种bug,来论坛提交bug,提交的时候,提示标签不能超过5个,然后之前输入的内容全没了,2b到家,而且提示的messagebox在屏幕看不到的位置,拉滚动条之后才发现错误框。用的是chrome,真特么火大。论坛的问题就先不说了,来说说cocos2d 3.0我为的FINAL版的bugs!
bug1:
http://www.cocoachina.com/bbs/read.php?tid=202214
bool Texture2D::initWithData(const void *data, ssize_t dataLen, Texture2D::PixelFormat pixelFormat, int pixelsWide, int pixelsHigh, const Size& contentSize)
{
CCASSERT(dataLen>0 && pixelsWide>0 && pixelsHigh>0, “Invalid size”);
//if data has no mipmaps, we will consider it has only one mipmap
MipmapInfo mipmap;
mipmap.address = (unsigned char*)data;
mipmap.len = static_cast<int>(dataLen);
return initWithMipmaps(&mipmap, 1, pixelFormat, pixelsWide, pixelsHigh);
//update information
_contentSize = contentSize;
_maxS = contentSize.width / (float)(pixelsWide);
_maxT = contentSize.height / (float)(pixelsHigh);
}
CCTexture2D.cpp: 546行。
这中间就return了是什么意思??下面还继续用contenSize,这代码质量?太不负责任了吧??如果有别的nb意义,能不能把return下面那些玩意注释一下??Texture2D这么重要的一个类,居然有这么蛋疼的地方!!
bug2:
ClippingNode::setAlphaThreshold,在2.x中,设置setAlphaThreshold 小于 1之后,镂空位置没问题。在3.0中,只要设置了setAlphaThreshold小于1的任意值,镂空位置就会跑到左下角。不知道是什么狗屁问题,懒着去跟。
bug3:
两个localZ相等的sprite,在runAction的时候,会出现闪烁现象,就好像,渲染覆盖先后顺序会不停的变换一样。我只能把其中一个localZ+1之后才解决。在2.x中就没有这问题!
RenderTexture在3.0下更蛋疼,如果不手动调用下Director::getInstance()->getRenderer()->render()的话,用RenderTexture的getSprite的时候还会崩溃,不要告诉我什么在下一帧才会去真正的去渲染RenderTexture。
还有一些bug记不起来了,麻烦引擎开发对外说这是3.0beta好不好,别把b去掉,final你妹啊。
最后提醒各位开发者,慎用3.0,入坑需谨慎!
=============== 后续发现的BUG更新如下 =================
2014-05-23 再增一个BUG!
Label在设定demensions的时候,文字超过size范围后回vector越界访问。
auto info = & theLabel->_lettersInfo.at( index );
比如此处_lettersinfo.size()为23,而index为24,越界时时index往往比size大1
CCLabelTextFormatter.cpp: 223


