我希望有人可以帮助我弄清楚发生了什么。
我正在使用cocos2d framework
. 有时我会因为SIGKIL
信号而停止我的代码。如果我按“继续”按钮,游戏会继续进行,没有任何问题。控制台日志很清楚(没有错误或警告消息)我在我的自定义类上得到它,该类使用OpenGL
. 这段代码每秒执行大约 300 次,而我SIGKILL
每 1-2 小时只执行一次。
这是一段代码:
glColor4f(1.f, 1.f, 1.f, 1.f);
i = 1;
glBindTexture(GL_TEXTURE_2D, curText);
glVertexPointer(2, GL_FLOAT, 0, screenCoord [i]);
glTexCoordPointer(2, GL_FLOAT, 0, textureCoord [i]);
SIGKIL --> glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
这是当时数组的内容:
(gdb) p *screenCoord[1]@8
$8 = {0, 296, 249.827072, 296, 0, -0, 249.827072, -0}
(gdb) p *textureCoord[1]@8
$12 = {0.456224144, 0.29296875, 0.700195312, 0.29296875, 0.456224144, 0.58203125, 0.700195312, 0.58203125}
堆栈跟踪:
#0 0x123028a7 in <????> ()
#1 0x12301528 in <????> ()
#2 0x0a767092 in gldRenderFillPolygonPtr ()
#3 0x12300185 in <????> ()
#4 0x0a55c3e1 in gleDrawArraysOrElements_ExecCore ()
#5 0x0a555280 in glDrawArrays_IMM_Exec ()
#6 0x01522c7c in glDrawArrays ()
#7 0x0007e6bd in -[CLScrollingBack draw] at /MyProjects/_ROBOTS/RobotsAttack/AbductedAliens game template/CLScrollingBack.m:430
#8 0x001bfdaa in -[CCNode visit] ()
#9 0x001bfd7d in -[CCNode visit] ()
#10 0x001bfd7d in -[CCNode visit] ()
#11 0x0020f708 in -[CCDirectorIOS drawScene] ()
#12 0x00211bb4 in -[CCDirectorDisplayLink mainLoop:] ()
日志中的最后几行是:
2012-06-20 13:05:27.368 RobotsAttack![9487:207] cocos2d: CCSpriteBatchNode: resizing TextureAtlas capacity from [2] to [4].
2012-06-20 13:05:27.368 RobotsAttack![9487:207] cocos2d: CCSpriteBatchNode: resizing TextureAtlas capacity from [4] to [6].
Current language: auto; currently objective-c
如果有人能告诉我如何调试这种情况并确定发生了什么,我将不胜感激。