Skip to content

Commit

Permalink
Sync minimap type to current tileset
Browse files Browse the repository at this point in the history
  • Loading branch information
irwiss committed Aug 18, 2022
1 parent d5e4c54 commit db41fda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 1 addition & 4 deletions src/cata_tiles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -1741,6 +1737,7 @@ void cata_tiles::draw( const point &dest, const tripoint &center, int width, int

void cata_tiles::draw_minimap( const point &dest, const tripoint &center, 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 );
}

Expand Down
6 changes: 4 additions & 2 deletions src/pixel_minimap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 )
Expand Down

0 comments on commit db41fda

Please sign in to comment.