Prevent redundant hex-cutting of terrain...
...and redundant caching of the hexed version (all mainline terrain graphics seem to use the map key, so it helps all of them)
This commit is contained in:
parent
4cf7583da9
commit
c09666bc89
1 changed files with 9 additions and 3 deletions
|
@ -993,7 +993,7 @@ static surface get_semi_brightened(const locator& i_locator)
|
|||
}
|
||||
|
||||
///translate type to a simpler one when possible
|
||||
static TYPE simplify_type(TYPE type){
|
||||
static TYPE simplify_type(const image::locator& i_locator, TYPE type){
|
||||
switch(type) {
|
||||
case SCALED_TO_ZOOM:
|
||||
if(zoom == tile_size)
|
||||
|
@ -1020,7 +1020,13 @@ static TYPE simplify_type(TYPE type){
|
|||
if(zoom == tile_size)
|
||||
type = HEXED;
|
||||
}
|
||||
|
||||
|
||||
if(type == HEXED) {
|
||||
// check if the image is already hex-cutted by the location system
|
||||
if(i_locator.get_loc().valid())
|
||||
type = UNSCALED;
|
||||
}
|
||||
|
||||
return type;
|
||||
}
|
||||
|
||||
|
@ -1032,7 +1038,7 @@ surface get_image(const image::locator& i_locator, TYPE type)
|
|||
if(i_locator.is_void())
|
||||
return res;
|
||||
|
||||
type = simplify_type(type);
|
||||
type = simplify_type(i_locator, type);
|
||||
|
||||
image_cache *imap;
|
||||
// select associated cache
|
||||
|
|
Loading…
Add table
Reference in a new issue