image cache - large png images

Discussion in 'iOS Programming' started by c4digit, Nov 15, 2009.

  1. c4digit macrumors newbie

    Nov 15, 2009
    Hi all

    first time poster.
    I have a problem that seems very common to a lot of people but I can't seem to find or decipher an answer anywhere.
    The game I'm making has 3 rather large sprites on screen (230 high) x various widths.
    Each sprite has 3 1024x1024 character sheets where the frames of animations are taken from.
    I've experimented with PVR's but at that size they are absolutely horrible so I want to keep PNG's.
    From other information I believe that the device can handle 3 1024x1024 pngs in memory without memory wanrnings.
    My problem is I end up with 9 as if I don't use imagenamed then the time it takes to load the sheet from disk is unacceptable
    I have created a NSMutableDictionary to store the data from the png image sheets into, but here lies my problem.
    How do I add uncompressed png data to the NSMutableDictionary without using imagenamed? If I add it in uncompressed (imagewithcontents of file) then there is still a massive loading time when I get the image from the cache.
    I need to somehow store it uncompressed in the NSMutableDictionary-
    Assign it to the image of the sprite (sprites are UIImageViews) so that it doesn't get stored as it does if I use imageNamed.
    Completely free the png from texture memeory if I need to change the sheet the sprite is grabbing the frames from. (not from my NSMutableDictionary cache)

    thanks in advance -
  2. c4digit thread starter macrumors newbie

    Nov 15, 2009
    I promise to tell a really funny joke if someone replies

Share This Page