Skip to content

Commit

Permalink
Feature: Region-based pathfinder for ships
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuhnovic committed Mar 7, 2023
1 parent 87f4d37 commit 0c0165b
Show file tree
Hide file tree
Showing 16 changed files with 1,135 additions and 41 deletions.
3 changes: 3 additions & 0 deletions src/genworld.cpp
Expand Up @@ -34,6 +34,7 @@
#include "string_func.h"
#include "thread.h"
#include "tgp.h"
#include "pathfinder/water_regions.h" // TODO KB for ship pathfinder reset

#include "safeguards.h"

Expand Down Expand Up @@ -173,6 +174,8 @@ static void _GenerateWorld()
}
}

ResetShipPathfinder();

BasePersistentStorageArray::SwitchMode(PSM_LEAVE_GAMELOOP);

ResetObjectToPlace();
Expand Down
1 change: 1 addition & 0 deletions src/misc.cpp
Expand Up @@ -105,6 +105,7 @@ void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settin
InitializeIndustries();
InitializeObjects();
InitializeBuildingCounts();
//ResetShipPathfinder(); // TODO KB figure out if it's necessary or not

InitializeNPF();

Expand Down
4 changes: 4 additions & 0 deletions src/misc_gui.cpp
Expand Up @@ -28,6 +28,7 @@
#include "viewport_func.h"
#include "landscape_cmd.h"
#include "rev.h"
#include "pathfinder/water_regions.h"

#include "widgets/misc_widget.h"

Expand Down Expand Up @@ -128,6 +129,9 @@ class LandInfoWindow : public Window {
Debug(misc, LANDINFOD_LEVEL, "m7 = {:#x}", tile.m7());
Debug(misc, LANDINFOD_LEVEL, "m8 = {:#x}", tile.m8());
#undef LANDINFOD_LEVEL

// TODO debug code, remove again
DEBUG_UpdateWaterRegion(tile);
}

void OnInit() override
Expand Down
2 changes: 2 additions & 0 deletions src/pathfinder/CMakeLists.txt
Expand Up @@ -5,4 +5,6 @@ add_files(
follow_track.hpp
pathfinder_func.h
pathfinder_type.h
water_regions.h
water_regions.cpp
)

0 comments on commit 0c0165b

Please sign in to comment.