Cocos2d精灵问题

时间:2011-11-12 15:01:05

标签: iphone objective-c xcode cocos2d-iphone

在我的“菜单”场景中发生了一些奇怪的事情,我的应用中没有其他场景出现此问题。

由于一些奇怪的原因,文件中的精灵不显示(仅适用于此场景),我将它们放在精灵表中并将它们添加到纹理缓存中以解决此问题。

但是,问题仍然存在,现在CCLabelBMFonts在添加到场景时会出现错误的访问错误(仅适用于此场景)。在线错误:

glDrawElements(GL_TRIANGLES, (GLsizei) n*6, GL_UNSIGNED_SHORT, (GLvoid*) (start*6*sizeof(indices_[0])) );

我不确定是什么让这个场景变得特别,也许它是如何加载的(它是唯一一个在开始时加载的):

- (void)loadScenes 
{

    EAGLContext *k_context = [[[EAGLContext alloc]
                               initWithAPI:kEAGLRenderingAPIOpenGLES1
                               sharegroup:[[[[CCDirector sharedDirector] openGLView] context] sharegroup]] autorelease];    
    [EAGLContext setCurrentContext:k_context];
    menuScene = [[MenuScene alloc] init];
}

有什么想法吗?

0 个答案:

没有答案