← Back to team overview

widelands-dev team mailing list archive

Re: [Merge] lp:~widelands-dev/widelands/fh1_width_and_mapobject_messages into lp:widelands

 

Review: Approve

> I don't think it's worth adding preload code for all UI images at this time, because only very few of them have player color.

Didn't your last chance then make it worse? I mean, if most images do not have a _pc.png image associated, the current code will construct the hash, check if its in the cache already (it will not be), then hit the disk to see if there is a _pc.png (this is costly), find none and return the original image. And this happens everytime you come by this function.

The only way to work around this issue is to copy even an image without a playercolor into a new texture and reinsert it into the ImageCache as a new image. This costs runtime memory, but avoids the disk seek. I think this is preferable, but s said in my previous comment, the disk hit might not be an issue (since we do so many already). So maybe just leave a TODO for now?
-- 
https://code.launchpad.net/~widelands-dev/widelands/fh1_width_and_mapobject_messages/+merge/318189
Your team Widelands Developers is subscribed to branch lp:~widelands-dev/widelands/fh1_width_and_mapobject_messages.


References