Am 22.12.2009 20:35, schrieb Jonathan Gordon:
If you don't change your theme often (or ever) then a much simpler system makes so much more sense.
Simply doing 2 passes to know the size is dead simple actually, isn't it?
Also, have you thought about how this 2 pass system would work? all skins share a common buffer, which means you need to do the first pass of every skin, then dump the buffer and do the 2nd pass of every skin again which is slow and wasteful.
I have a high doubt that it's slow. Going from 0.1s to less than 0.2 doesn't make a noticeable difference.
right now on the e200 93KB + 2x98KB buffers are preallocated whether they are used or not. even cabbie only uses about 20KB of the first buffer, which means that anyone not using themes would regain at the best case nearly 300KB of audio buffer if a simple "tiny/low/medium/high/stupid" setting is used, and that guarantees that during a session, you cannot run out of memory which your and pondlifes suggestion would allow.
Instead of offering arbitary settings, we could simply allocate the space that is needed, accurately to maybe 1k. And of course one can still run out of memory with your suggestion, especially if one has chosen the (again, arbitary) setting wisely to be as accurate as possible for the current theme.
We already can know if a theme doesn't fit simply by the parser returning an error when it runs out of room, loading the bmp dimensions beforehand doesn't make things any simpler, reallocating buffer is not a good idea.
