Animated tile: Prefetch next item in map
This commit is contained in:
@@ -17,6 +17,8 @@
|
|||||||
#include "date_func.h"
|
#include "date_func.h"
|
||||||
#include "3rdparty/cpp-btree/btree_map.h"
|
#include "3rdparty/cpp-btree/btree_map.h"
|
||||||
|
|
||||||
|
#include INCLUDE_FOR_PREFETCH_NTA
|
||||||
|
|
||||||
#include "safeguards.h"
|
#include "safeguards.h"
|
||||||
|
|
||||||
/** The table/list with animated tiles. */
|
/** The table/list with animated tiles. */
|
||||||
@@ -109,6 +111,10 @@ void AnimateAnimatedTiles()
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto next = iter;
|
||||||
|
++next;
|
||||||
|
if (next != _animated_tiles.end()) PREFETCH_NTA(&(next->second));
|
||||||
|
|
||||||
if (iter->second.speed <= max_speed) {
|
if (iter->second.speed <= max_speed) {
|
||||||
const TileIndex curr = iter->first;
|
const TileIndex curr = iter->first;
|
||||||
switch (GetTileType(curr)) {
|
switch (GetTileType(curr)) {
|
||||||
@@ -132,7 +138,7 @@ void AnimateAnimatedTiles()
|
|||||||
NOT_REACHED();
|
NOT_REACHED();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
++iter;
|
iter = next;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user