Jump to content

  • Log In with Google      Sign In   
  • Create Account


#Actualfutlib

Posted 27 April 2013 - 11:46 PM

You can use one cache for your gui elements, one for the thumbnails and then load the larger images as needed, either through another cache (for fast switching) or else just raw, depending on how you're setting this up. You can allow your cache class to be aware of its memory usage and to be able to limit itself according to customizable parameters then do internal housecleaning using whatever method makes the most sense for what you're doing.

 

That sounds good, that way I'll be able to keep memory usage under control.

 

Still, I see a notable lag when loading just one of the larger images on older systems, so I really think I'll have to do some preloading with a proper loading screen. Still not sure which approach to go with for that.

 

I'm somewhat back at square one in that I'm again considering to have the scene preload everything it needs itself. Widgets don't own their resources anymore, so it's not as difficult to implement as it was when I started this thread. I can just clear the cache after each scene (maybe having a global area with things that are never cleared).

 

Wouldn't it be worth using a different method to indicate the button-down state, such as just changing the blend on the button, or overlaying a semi-transparent colored quad?

Also, you may want to explore downsampling for some of the less critical images. You could potentially save a lot of space using indexed color or even just 16-bit color depth. It really depends on what the images look like. I know memory and disk storage are abundant these days but I'd be uncomfortable using 0.95 MB just for a thumbnail, especially if there's a lot of them.

 

Well, the game runs on Android, so disk storage is not that abundant :) Good ideas, I'll look into these if downscaling isn't sufficient.


#1futlib

Posted 27 April 2013 - 11:40 PM

You can use one cache for your gui elements, one for the thumbnails and then load the larger images as needed, either through another cache (for fast switching) or else just raw, depending on how you're setting this up. You can allow your cache class to be aware of its memory usage and to be able to limit itself according to customizable parameters then do internal housecleaning using whatever method makes the most sense for what you're doing.

 

That sounds good, that way I'll be able to keep memory usage under control.

 

Still, I see a notable lag when loading just one of the larger images on older systems, so I really think I'll have to do some preloading with a proper loading screen. Still not sure which approach to go with for that.

 

I'm somewhat back at square one in that I'm again considering to have the scene preload everything it needs itself. Widgets don't own their resources anymore, so it's not as difficult to implement as it was when I started this thread. I can just clear the cache after each scene (maybe having a global area with things that are never cleared).


PARTNERS