Chris Beck 8e5eb9a8d4 cache minimap images in mp create screen
When we are actually in the game, the image.cpp file uses an
elaborate collection of caches to make sure that all images are
cached and reloaded rather than redoing work (even scaling). It's
questionable whether the amount of caching going on there is
appropriate, it seems it might even be faster if we did less. But
one place that we don't do any caching and performance is bad is
in the mp create screen. There was a bug report in 1.12:

https://gna.org/bugs/?func=detailitem&item_id=21801

In this commit, I implement quick and dirty caching for scenario
minimap images. Each scenario record holds a surface (an SDL
reference counted pointer to image data), and when a minimap is
rendered this gets saved, along with the md5 hash of the map that
got rendered. Whenever a minimap is requested, we hash it first
and check if the cache is dirty. If so we recalculate, otherwise
we return the cached image.

The code is also cleaner and a bit less convoluted than the
previous code -- the previous author seemed to think that surfaces
are "object" types and not "pointer" types, that require an
additional layer of memory management with boost scoped pointer
etc. This was in fact redundant.

I don't know if this commit will actually help report 21801,
the profiling seemed to suggest that it's the minimap rendering
code that is actually slow. But it seems that this can't hurt,
and may at least mitigate the slowness, since except for random
maps it means the minimap calculation won't be repeated.
2014-11-07 22:56:43 -05:00
..
2014-10-13 18:31:21 +02:00
2014-10-30 21:45:26 +01:00
2014-10-25 18:52:26 +02:00
2014-10-31 22:35:45 +01:00
2014-08-12 00:30:33 +02:00
2014-10-31 22:35:45 +01:00
2014-11-05 21:12:52 -05:00
2014-10-25 18:52:26 +02:00
2014-10-09 16:55:43 -03:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-11-05 18:40:46 -05:00
2014-01-01 02:08:52 -03:00
2014-10-31 22:35:45 +01:00
2014-07-06 23:47:28 +02:00
2014-07-06 23:47:28 +02:00
2014-06-09 15:26:19 +02:00
2014-01-01 02:08:52 -03:00
2014-06-19 10:25:16 -04:00
2014-10-31 21:11:21 -04:00
2014-01-01 02:08:52 -03:00
2014-07-13 12:41:43 +02:00
2014-04-07 01:02:44 +02:00
2014-10-18 17:42:59 +02:00
2014-01-01 02:08:52 -03:00
2014-10-30 21:45:26 +01:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-05-03 02:56:24 +02:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-10-25 18:52:26 +02:00
2014-01-01 02:08:52 -03:00
2014-07-13 12:20:45 +02:00
2014-08-28 16:05:53 -04:00
2014-08-28 16:05:53 -04:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-07-09 21:30:49 +02:00
2014-07-09 17:32:42 +02:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-10-25 19:02:12 +02:00
2014-10-25 19:02:12 +02:00
2014-04-27 20:01:50 +02:00
2014-07-13 12:41:43 +02:00
2014-06-27 00:03:15 -04:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-11-03 18:20:55 -05:00
2014-06-03 20:43:45 +02:00
2014-01-01 02:08:52 -03:00
2014-06-19 12:53:31 -04:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-10-25 18:52:26 +02:00
2014-06-25 10:18:43 -04:00
2014-05-20 13:39:25 -04:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-10-23 01:15:23 +02:00
2014-10-23 01:15:23 +02:00
2014-07-29 20:45:10 +02:00
2014-11-06 19:51:24 +01:00
2014-01-01 02:08:52 -03:00
2014-10-13 18:31:21 +02:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-06-26 22:18:57 -04:00
2014-01-01 02:08:52 -03:00
2014-06-09 15:26:19 +02:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-08-28 21:44:10 +02:00
2014-01-01 02:08:52 -03:00
2014-10-31 22:07:51 +01:00
2014-11-06 00:05:20 +01:00
2014-06-25 18:09:49 +02:00
2014-01-01 02:08:52 -03:00
2014-10-23 01:15:23 +02:00
2014-10-23 01:15:23 +02:00
2014-06-25 18:02:06 +02:00
2014-06-25 18:02:06 +02:00
2014-09-07 22:08:15 +02:00
2014-10-25 18:52:26 +02:00
2014-07-13 12:41:43 +02:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-10-31 20:56:46 +01:00
2014-10-30 02:32:57 +01:00
2014-10-30 02:32:57 +01:00
2014-06-17 01:17:05 +02:00
2014-11-05 18:40:46 -05:00
2014-01-01 02:08:52 -03:00
2014-07-22 19:34:08 +02:00
2014-10-31 09:16:08 -04:00
2014-01-01 02:08:52 -03:00
2014-10-31 22:35:45 +01:00
2014-10-31 22:35:45 +01:00
2014-10-31 22:35:45 +01:00
2014-10-31 22:35:45 +01:00
2014-10-31 22:35:45 +01:00
2014-10-31 22:35:45 +01:00
2014-10-30 01:46:05 +01:00
2014-07-13 12:41:43 +02:00
2014-01-01 02:08:52 -03:00
2014-10-23 01:15:23 +02:00
2014-10-23 01:15:23 +02:00
2014-09-16 17:09:24 -04:00
2014-06-19 11:48:08 -04:00
2014-10-10 18:49:25 +02:00
2014-06-19 11:36:45 -04:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-10-25 18:52:26 +02:00
2014-07-13 12:41:43 +02:00
2014-07-12 09:59:24 -04:00
2014-07-13 12:41:43 +02:00
2014-06-28 00:17:08 -04:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-10-25 18:52:26 +02:00
2014-10-25 18:52:26 +02:00
2014-01-01 02:08:52 -03:00
2014-10-22 18:04:24 +02:00
2014-07-13 12:41:43 +02:00
2014-07-19 02:33:44 +02:00
2014-07-19 02:03:09 +02:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-03-07 19:46:06 -03:00
2014-07-13 12:41:43 +02:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00
2014-01-01 02:08:52 -03:00