Hi,
I'm using UIImage to render a game map from 32x32 blocks. The code is as follows
for( int x = 0; x < rwidth; ++x)
{
for(int y = 0; y < rheight; ++y)
{
int bindex = [current_map GetTileIndex:x :y];
CGPoint p;
p.x = x * tile_size_x;
p.y = y * tile_size_x;
[img_list[bindex] drawAtPoint:p];
}
}
This ends up rendering about 150 tiles. My problem is when I run this code my render time goes down to 2-3 frames a second.
I thought the iPhone was fill bound, however if I force bindex to = 1 (ie render the same block 150 times) then I get full framerate.
I can't believe it is that expensive to render from different UIImages.
Could someone please tell me what I'm doing wrong ...
Oh I forgot to mention my image list created from a bigger texture page using CGImageCreateWithImageInRect.
Thanks Rich