From db41fda562a9177edb33b626021b9d6a062a538e Mon Sep 17 00:00:00 2001 From: Alexey Kim Date: Fri, 19 Aug 2022 00:33:10 +0300 Subject: [PATCH] Sync minimap type to current tileset --- src/cata_tiles.cpp | 5 +---- src/pixel_minimap.cpp | 6 ++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/cata_tiles.cpp b/src/cata_tiles.cpp index 77aa3e432df24..e866c80eee40a 100644 --- a/src/cata_tiles.cpp +++ b/src/cata_tiles.cpp @@ -331,10 +331,6 @@ void cata_tiles::load_tileset( const std::string &tileset_id, const bool prechec tileset_ptr = cache.load_tileset( tileset_id, renderer, precheck, force, pump_events ); set_draw_scale( 16 ); - - minimap->set_type( g->is_tileset_isometric() - ? pixel_minimap_type::iso - : pixel_minimap_type::ortho ); } void cata_tiles::reinit() @@ -1741,6 +1737,7 @@ void cata_tiles::draw( const point &dest, const tripoint ¢er, int width, int void cata_tiles::draw_minimap( const point &dest, const tripoint ¢er, int width, int height ) { + minimap->set_type( is_isometric() ? pixel_minimap_type::iso : pixel_minimap_type::ortho ); minimap->draw( SDL_Rect{ dest.x, dest.y, width, height }, center ); } diff --git a/src/pixel_minimap.cpp b/src/pixel_minimap.cpp index 9272f199625d3..b253180a7e269 100644 --- a/src/pixel_minimap.cpp +++ b/src/pixel_minimap.cpp @@ -213,8 +213,10 @@ pixel_minimap::~pixel_minimap() = default; void pixel_minimap::set_type( pixel_minimap_type type ) { - this->type = type; - reset(); + if( this->type != type ) { + this->type = type; + reset(); + } } void pixel_minimap::set_settings( const pixel_minimap_settings &settings )