Question about loadanimimage

BlitzMax Forums/BlitzMax Beginners Area/Question about loadanimimage

Josepho(Posted 2006) [#1]
Hi, i have a question about loadanimimage, i am making a game that uses very large anims and i have the next problem, when i load a animation the use of memory grows up, thats normal of course, but when i show this animation on the game, the memory continue growing after it shows the animation the first time, then stops.

Problem is that an animation 200x200 (more or less) of 30 images takes around 26,000 kb... and thats a lot, there is any method to save memory space when you load images on the blitzmax?

I use png with 256 colours and alpha (RGBA) and the maskedimage flag.


SculptureOfSoul(Posted 2006) [#2]
It doesn't really matter what format it is saved as because LoadAnimImage loads the image into video ram, and so it's essentially converting it to bitmap. No way around that.


GfK(Posted 2006) [#3]
there is any method to save memory space when you load images on the blitzmax?
Use smaller, or fewer images.


Dreamora(Posted 2006) [#4]
Reason for the grow on show: You fail to follow the base rules for images:

They must have power of 2 size AND they must be square (16x16, 32x32, 64x64, ...).
If they don't meet the power of 2, they will get additional space on the texture which is not used to ensure power of two.

Ignoring that won't bring you much friends. First it will take more RAM and VRAM than you actually calculate, second, there are even new graphic cards (GF6 series for example) which simply fail with non square textures in some cases.


xlsior(Posted 2006) [#5]
second, there are even new graphic cards (GF6 series for example) which simply fail with non square textures in some cases.


Doesn't BMax automatically upsize to the next square ^2 image size to work around that issue?

(so 60x128 becomes 128x128?)

But yeah, a 200x200 image will take the same amount of memory asd 256x256.


tonyg(Posted 2006) [#6]
Loadanimimage will create a seperate surface for each cell. So, depending on the individual cell size it'll round those up to pow2.