我正在尝试将此项目更新为新的cocos2d版本。 “https://github.com/joshvera/iPhone-Tetris”
我改变了一些这样的功能:
Sprite → CCSprite
AtlasSprite → CCSprite
AtlasSpriteFrame → CCSpriteFrame
SpriteFrame → CCSpriteFrame
Animation → CCAnimation
AtlasAnimation → CCAnimation
AtlasSpriteManager → CCSpriteSheet ← NEW NAME
然后ı构建项目。我得到了这个输出:
2012-01-23 11:19:13.733 denemetotemnewversion[2131:10a03] cocos2d: cocos2d v2.0.0-beta
2012-01-23 11:19:13.734 denemetotemnewversion[2131:10a03] cocos2d: Using Director
Type:CCDirectorDisplayLink
2012-01-23 11:19:13.754 denemetotemnewversion[2131:10a03] cocos2d: OS version: 5.0 (0x05000000)
2012-01-23 11:19:13.755 denemetotemnewversion[2131:10a03] cocos2d: GL_VENDOR: Apple Computer, Inc.
2012-01-23 11:19:13.756 denemetotemnewversion[2131:10a03] cocos2d: GL_RENDERER: Apple Software Renderer
2012-01-23 11:19:13.756 denemetotemnewversion[2131:10a03] cocos2d: GL_VERSION: OpenGL ES 2.0 APPLE
2012-01-23 11:19:13.757 denemetotemnewversion[2131:10a03] cocos2d: GL_MAX_TEXTURE_SIZE: 4096
2012-01-23 11:19:13.757 denemetotemnewversion[2131:10a03] cocos2d: GL_MAX_TEXTURE_UNITS: 8
2012-01-23 11:19:13.758 denemetotemnewversion[2131:10a03] cocos2d: GL_MAX_SAMPLES: 4
2012-01-23 11:19:13.758 denemetotemnewversion[2131:10a03] cocos2d: GL supports PVRTC: YES
2012-01-23 11:19:13.759 denemetotemnewversion[2131:10a03] cocos2d: GL supports BGRA8888 textures: YES
2012-01-23 11:19:13.759 denemetotemnewversion[2131:10a03] cocos2d: GL supports NPOT textures: YES
2012-01-23 11:19:13.760 denemetotemnewversion[2131:10a03] cocos2d: GL supports discard_framebuffer: YES
2012-01-23 11:19:13.760 denemetotemnewversion[2131:10a03] cocos2d: compiled with Profiling Support: NO
2012-01-23 11:19:13.761 denemetotemnewversion[2131:10a03] cocos2d: **** WARNING **** CC_ENABLE_GL_STATE_CACHE is disabled. To improve performance, enable it by editing ccConfig.h
[Switching to process 2131 thread 0x1410b]
2012-01-23 11:19:13.809 denemetotemnewversion[2131:10a03] cocos2d: Frame interval: 1
2012-01-23 11:19:13.810 denemetotemnewversion[2131:10a03] cocos2d: surface size: 320x480
仅显示背景图片。精灵不起作用。有任何想法吗? 感谢。
答案 0 :(得分:4)
转到ccConfig.h - >搜索(CC_ENABLE_GL_STATE_CACHE) - >并将其设置为1
答案 1 :(得分:0)
一般来说,简单地复制&用更新的版本替换cocos2d-iphone。您必须记住已删除或重命名的文件,因此需要完全删除旧文件夹,然后重新添加。就个人而言,我发现简单地安装新的cocos2d Xcode模板,创建一个新项目,然后重新添加所有源代码和资产要容易得多。
至于upgrading to Cocos2D 2.0 there are additional things to consider,就像添加着色器文件并正确地将它们添加到复制资源构建阶段一样(默认情况下它们将被视为源代码)。