PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

One file for each sprite or one big file with all sprites?

Hi,

Before continuing designing my game, I would like to ask you what's the best option for performance purposes.

I wonder if it's better to have one single file with all my sprites there. By doing that, I only have to create one surface like this:

Code:
m_pSurface->CreateSurface(0, hInstance, nResourceNumber, _T("PNG"));


However, if I decide to have sprites in separate files, I would need to call CreateSurface for each of them.

What do you guys think is a better option?

Thanks
Depending on what you do in order to create the sprites and hold them in memory I really do not think it really matters.

I have always created seperate files for the sprites, mainly since I have animated sprites and it is easier to implement with seperate files.

I suppose it is a subjective opinion but I would choose single files over one big one each time. :)
InexorableTash · 09 Jan 2007, 07:12 UTC
Based on the processor cache, several smaller sprites or vertically stacked sprites are likely to be faster.

Good blog post here:

http://blogs.msdn.com/oldnewthing/archive/2005/08/05/448073.aspx