From 14e8178815a2d389e4726e2f2d8424a46ad2fcf6 Mon Sep 17 00:00:00 2001 From: Ivan Shibanov Date: Fri, 3 May 2024 00:10:25 -0400 Subject: [PATCH] IWYU --- src/fheroes2/editor/editor_interface.cpp | 3 --- src/fheroes2/gui/ui_map_object.cpp | 1 + src/fheroes2/maps/map_generator.cpp | 25 +++++++++++++++++++++--- src/fheroes2/maps/map_generator.h | 6 +++++- src/fheroes2/maps/map_object_info.cpp | 1 + 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/src/fheroes2/editor/editor_interface.cpp b/src/fheroes2/editor/editor_interface.cpp index 0c509050956..ce6795ec9c8 100644 --- a/src/fheroes2/editor/editor_interface.cpp +++ b/src/fheroes2/editor/editor_interface.cpp @@ -30,9 +30,6 @@ #include #include -#include -#include - #include "agg_image.h" #include "artifact.h" #include "audio_manager.h" diff --git a/src/fheroes2/gui/ui_map_object.cpp b/src/fheroes2/gui/ui_map_object.cpp index c7d49632b1b..8ea95294daf 100644 --- a/src/fheroes2/gui/ui_map_object.cpp +++ b/src/fheroes2/gui/ui_map_object.cpp @@ -39,6 +39,7 @@ #include "maps_tiles.h" #include "math_base.h" #include "mp2.h" +#include "resource.h" namespace { diff --git a/src/fheroes2/maps/map_generator.cpp b/src/fheroes2/maps/map_generator.cpp index 7e60eb960e7..4b54ab68be0 100644 --- a/src/fheroes2/maps/map_generator.cpp +++ b/src/fheroes2/maps/map_generator.cpp @@ -20,12 +20,31 @@ #include "map_generator.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "color.h" +#include "direction.h" +#include "ground.h" #include "logging.h" #include "map_format_helper.h" +#include "map_format_info.h" #include "map_object_info.h" +#include "maps.h" +#include "maps_tiles.h" #include "maps_tiles_helper.h" +#include "math_base.h" #include "race.h" #include "rand.h" +#include "resource.h" #include "ui_map_object.h" #include "world.h" #include "world_object_uid.h" @@ -292,11 +311,11 @@ namespace Maps::Generator // Step 1. Map generator configuration // TODO: Balanced set up only / Pyramid later - const int playerCount = config.playerCount; + const int playerCount = static_cast( config.playerCount ); // Aiming for region size to be ~300 tiles in a 200-500 range // const int minimumRegionCount = playerCount + 1; - const int expectedRegionCount = ( width * height ) / config.regionSizeLimit; + const int expectedRegionCount = ( width * height ) / static_cast( config.regionSizeLimit ); const uint32_t extendedWidth = width + 2; std::vector data( static_cast( extendedWidth ) * ( height + 2 ) ); @@ -385,7 +404,7 @@ namespace Maps::Generator if ( region._id == 0 ) continue; - DEBUG_LOG( DBG_ENGINE, DBG_WARN, "Region #" << region._id << " size " << region._nodes.size() << " has " << region._neighbours.size() << "neighbours" ) + DEBUG_LOG( DBG_ENGINE, DBG_TRACE, "Region #" << region._id << " size " << region._nodes.size() << " has " << region._neighbours.size() << "neighbours" ) int xMin = 0; int xMax = width; diff --git a/src/fheroes2/maps/map_generator.h b/src/fheroes2/maps/map_generator.h index 33cefa42c13..d566669a04f 100644 --- a/src/fheroes2/maps/map_generator.h +++ b/src/fheroes2/maps/map_generator.h @@ -18,7 +18,11 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ #pragma once -#include "map_format_info.h" +#include +namespace Maps::Map_Format +{ + struct MapFormat; +} namespace Maps::Generator { diff --git a/src/fheroes2/maps/map_object_info.cpp b/src/fheroes2/maps/map_object_info.cpp index 7340a03a7ec..0a323bb290b 100644 --- a/src/fheroes2/maps/map_object_info.cpp +++ b/src/fheroes2/maps/map_object_info.cpp @@ -29,6 +29,7 @@ #include #include "artifact.h" +#include "maps.h" #include "maps_tiles_helper.h" #include "monster.h" #include "resource.h"