Make map preview generation fast.
- Change Map.LoadMapTiles and Map.LoadResourceTiles to read the whole stream into memory before processing individual bytes. This removes the cost of significant overhead from repeated calls to ReadUInt8/16. - Remove significant UI jank caused by the map chooser by not including the placeholder widget. The maps render fast enough that it is no longer worthwhile and it was causing a lot of flushes which were the source of the jank. - Trigger async generation for all maps when the chooser is loaded. This means in practice all previews will be ready by the time the user begins to scroll the selection. Since generation is fast, there is no issue with scrolling straight to the bottom and having to wait for the backlog to clear.
This commit is contained in:
@@ -124,7 +124,7 @@ namespace OpenRA.Widgets
|
||||
|
||||
// Stash a copy of the minimap to ensure consistency
|
||||
// (it may be modified by another thread)
|
||||
minimap = preview.Minimap;
|
||||
minimap = preview.GetMinimap();
|
||||
if (minimap == null)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user