views:

84

answers:

1

What I am trying to do is to play a full screen (1024x768) animation on iPad with an around 20 fps. I have got a scene with 1800 full screen frames. Until now I have tried a lot of approaches but have encountered a lot of problems.

My first approach was to get the texture using the following function

t = [[CCTexture2D alloc] initWithImage:[UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:[NSString stringWithFormat:@"(%d)",startIndex] ofType:type]]];

give it to sprite by using setTexture method and then release the texture then create a new texture with next frame and repeat the procedure but by using this approach I only get about 7 fps.

My second approach was to preload about 10 textures in texturecache save them in an array and give them to sprite using setTexture and on the back end I am replacing the old textures with the new texture in a thread but the problem I face is that creating new texture and adding to array takes some time and when the settexture method is called the sprite displays the old texture because the new one is not loaded yet but after some time new texture get loaded.

Is there any way I can run a full screen animation on iPad at around 20 fps? Please help me out!

Thanks

Farhan

A: 

Sounds like your data is raw, i.e. not compressed. This will (as you've noticed) be very heavy, and you're very likely to run into bandwidth and/or processing issues. I'm not familiar with the iPad, so I can't say a lot about which is the most probable; try some profiling.

I would suggest trying a compressed video format, to reduce the bandwidth requirements of the animation.

unwind