http://GameProgrammer.Com

Programming

GP Mailing List
     Thread Index
     Date Index

ATXGPSIG List
     Thread Index
     Date Index

Google
>

Home

TheGrumpyProgrammer



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gameprogrammer] Re: memory management in a game with LOTS of art



That doesn't save you any memory aside from the small per-surface overhead.

----- Original Message ----- 
From: "Eugene Marcotte" <mrpicalo@skyflux.com>
To: <gameprogrammer@freelists.org>
Sent: Sunday, July 04, 2004 10:47 AM
Subject: [gameprogrammer] Re: memory management in a game with LOTS of art


> I don't know if it's very feasible in his case(or even what you're
> looking for), but making one image with all the artwork and putting them
> in one file(or files if you split them into groups or something) and
> loading it to a global variable of some sort then just blitting
> selections out of the stored surface of all the artwork. 
> 
> This saved me alot of memory because each object doesn't need it's own
> surface for artwork, it's all shared with all the objects(plus it makes
> doing animations easy as adding a number to the id if you design it
> properly)....
> 
> One trick I used is if there are images of different areas (32x32, 16x16
> etc) put the images of the same size in their own files so you'd have
> artwork16x16.png with all 16x16 artwork and then load that and make
> blits from it.
> 
> Not sure if this method would work for him but you weren't very specific
> as to what he was trying already... I dunno..
> 
> See ya,
> Eugene



---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html