TextureLoader cache enabling/disabling

I’m just doing a photo slide-show app with amazing 3d effects in 1 week and I just started with basic feature : show the pics one by one and guess what : my memory usage increased, increased, I had a plentyful of out-of-memory errors and I finally had to kill it.

So I converted my pics from PNG to JPEG, resized all of them, and added a feature to disable caching in the TextureLoader, as all pics are only loaded once and I want to free memory as soon as possible.

It’s in the CVS, remember of that if you have similar uses of TextureLoader (just sharing personal experience, hoping it’s not noise).

This is good feature!

Suggestion to that - probably setCacheUsed(false) - should clear the cache as well if something was cached earlier.
Or better - setCacheUsed(boolean cacheUsed, boolean clearCache), so that you can decide do you want particular texture be cached or not and what to do with the cache, just calling that method before loading texture and changing options the way you need…

What you think?

Bohdan.

EDIT: Or have separate method to clear cache…

I have implemented this feature locally and will commit it when I am ready with code cleaning.

Huh good you say that so I won’t mess up too deeper in the code because CVS is a nightmare when you and me modify the same class the last to commit always have to resolve manually conflicts… Don’t know if SVN is better but if it is then I would praise eternally the one who’s willing to do that.