Cocos2d和iPhone:Parallax背景与多个纹理地图集提供了许多内存警告 [英] Cocos2d and iPhone: Parallax Background with multiple texture atlases gives many memory warnings

查看:252
本文介绍了Cocos2d和iPhone:Parallax背景与多个纹理地图集提供了许多内存警告的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想解决的问题是:



我有6条条纹,我需要以不同的速度移动。 2048 * 2048的纹理图片是不够的,为了处理这个我拆分图像在两个(顶部和底部一半),所以每个条纹是正好960 * 640像素。通用算法是为每个条带分配一个顶部和底部一半,并在每个帧移动它们,确保在退出用户视图时将它们重新定位在屏幕顶部。我的类实现,直接修改 ParallaxBackground in this ShootEmUp example from this book ,is giving too many运行和使用仪器分析时的内存警告。请参阅下面的分析:



OpenGL分析:



活动监视器:



我担心的是两个分析中的内存警告数量很大(分别为24和5)。



编辑:您可以在下面找到解释解决方案的评论

解决方案

通过LearnCocos2d对我的问题的注释建议正确的答案 - 解决方案是简单地重新启动设备..(见他的注释上面)。



谢谢!

The problem I am trying to solve is:

I have 6 stripes which I need to move at different speed. A texture sheet of 2048*2048 is not enough and to deal with this I splitted the image in two (top and bottom half), so each stripe is exactly 960*640pixels. The general algorithm is to allocate a top and bottom half for each stripe and move them at each frame making sure to reposition them at the top of the screen when they exit the user's view. My class implementation, a direct modification of ParallaxBackground in the ShootEmUp example from this book, is giving too many memory warnings when run and analyzed using Instruments. See analysis below:

OpenGL analysis:

Activity monitor:

What concerns me is the high number of memory warnings in both analysis (24 and 5 respectively).

EDIT: Below you can find a comment which explains the solution

解决方案

Following the comment-suggestion to my question by LearnCocos2d the correct answer-solution was to simply reboot the device.. (see his comment above).

Thanks!

这篇关于Cocos2d和iPhone:Parallax背景与多个纹理地图集提供了许多内存警告的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆