Skip to content

Commit

Permalink
IWYU
Browse files Browse the repository at this point in the history
  • Loading branch information
idshibanov committed May 3, 2024
1 parent e021218 commit 14e8178
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 7 deletions.
3 changes: 0 additions & 3 deletions src/fheroes2/editor/editor_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
#include <string>
#include <vector>

#include <logging.h>
#include <rand.h>

#include "agg_image.h"
#include "artifact.h"
#include "audio_manager.h"
Expand Down
1 change: 1 addition & 0 deletions src/fheroes2/gui/ui_map_object.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
#include "maps_tiles.h"
#include "math_base.h"
#include "mp2.h"
#include "resource.h"

namespace
{
Expand Down
25 changes: 22 additions & 3 deletions src/fheroes2/maps/map_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,31 @@

#include "map_generator.h"

#include <algorithm>
#include <cassert>
#include <cmath>
#include <cstddef>
#include <map>
#include <memory>
#include <ostream>
#include <set>
#include <utility>
#include <vector>

#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"
Expand Down Expand Up @@ -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<int>( 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<int>( config.regionSizeLimit );

const uint32_t extendedWidth = width + 2;
std::vector<Node> data( static_cast<size_t>( extendedWidth ) * ( height + 2 ) );
Expand Down Expand Up @@ -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;
Expand Down
6 changes: 5 additions & 1 deletion src/fheroes2/maps/map_generator.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#pragma once
#include "map_format_info.h"
#include <cstdint>
namespace Maps::Map_Format
{
struct MapFormat;
}

namespace Maps::Generator
{
Expand Down
1 change: 1 addition & 0 deletions src/fheroes2/maps/map_object_info.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <utility>

#include "artifact.h"
#include "maps.h"
#include "maps_tiles_helper.h"
#include "monster.h"
#include "resource.h"
Expand Down

0 comments on commit 14e8178

Please sign in to comment.