LoadAnimImage

BlitzMax Forums/BlitzMax Programming/LoadAnimImage

blacknite(Posted 2004) [#1]
i have an image that has 64x64 tiles on it the tiles are of size 40x40 pixels. It take forever to load it using LoadAnimImage. Here is the statement w/o the variables:

TileImages = LoadAnimImage("t.png", 40, 40, 0, 64*64)

Is there a way toi speed the loading up?


FlameDuck(Posted 2004) [#2]
Is there a way toi speed the loading up?
Well you're loading roughly 26 megabytes into memory at once, it'll take a while. It shouldn't take forever, tho'. How much time is forever in this case? 20 Seconds? 1 minute? 5 minutes? 20 minutes?

As for speeding it up, one way would be to save it without using compression. You're preforming decompression of 6.5 million pixels.


blacknite(Posted 2004) [#3]
In the game I am porting over I use to use just load image a then use DrawImageRect. but that function's params have changed. that use to take care of my speed issue.


SSS(Posted 2004) [#4]
i dont really see how that would've changed the speed... loadanimimage doesnt actually break up the image... that's probably done with texcoords when you draw the object. maybe try a smaller image? or many images that you load and unload when you need them cuz that seems a bit excessive, what your talking about is 4096 tiles


BlitzSupport(Posted 2004) [#5]
How much memory does your Mac's graphics card have, as opposed to your PC?


blacknite(Posted 2004) [#6]
Thanks for the help, I am changing stuff drastically in the game. I think this is more poor design on my part.


LeisureSuitLurie(Posted 2004) [#7]
Good point, James. 26MBs of tiles wont leave much Video Memory left, will it?


blacknite(Posted 2004) [#8]
It is just that the RPG I am creating has about 3000 tiles to it.... Oh well the next couple of days will be intertesting as I try to sort out this stuff. :-(


SSS(Posted 2004) [#9]
yea but you're obviously not going to be using all of them at once so why not make different zones that only use a specific tile set then as you cross zone load/unload tilesets...


blacknite(Posted 2004) [#10]
ya that is what I am figuring out now....