Please login or register.

Login with username, password and session length
Advanced search  

News:

This forum provides RSS feed. To query recent posts use this url. More...


Author Topic: Savegame thumbnails  (Read 2655 times)

0 Members and 1 Guest are viewing this topic.

Schnuffel

  • Supporter
  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 36
    • View Profile
    • Dreamagination Entertainment
Savegame thumbnails
« on: March 08, 2008, 12:16:05 PM »

I have savegame thumbnails activated for my project, and it works like a charm with one exception. When you overwrite a previous savegame everything but the thumbnail is updated. The thumbnail retains the old image no matter how often you save over it. However, if the game is restarted (i.e. quit and started up again) the correct thumbnails are there. Is there some caching going on that I need to deactivate?

I'm using static controls for the thumbnails and fill them with via savegame:x. As the savegames are in a scrolling list and the static controls are updated perfectly while scrolling, I don't think that this is the problem:
Code: [Select]
thumb = self.GetControl("thumbnail_" + (i+1));
thumb.SetImage("savegame:" + (ScrollOffset+i));

I tried the Game.StoreSaveThumbnail() and Game.DeleteSaveThumbnail() methods, but they don't fix the caching problem.

How can I deactive the cache or reload the thumbnails everytime the save / load screen pops up?

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Savegame thumbnails
« Reply #1 on: March 09, 2008, 12:57:21 PM »

Are you ever unloading the save/load windows? It appears you're not. The thumbnail image stays loaded in memory as long as it's referenced from somewhere. So, if you unload the window after it's closed, and reopen it later, a fresh image will be loaded.
If for whatever reason this non-unloading the windows is part of your design, you can force the reload by assigning an empty (null) image to the static control first (thus invalidating the reference to the old thumbnail).
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Schnuffel

  • Supporter
  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 36
    • View Profile
    • Dreamagination Entertainment
Re: Savegame thumbnails
« Reply #2 on: March 09, 2008, 02:42:54 PM »

Ah, you're right. I got my window unloading code mixed up. Thank you very much :)
 

Page created in 0.033 seconds with 23 queries.