Skip to content

Commit b19c3aa

Browse files
authored
Fix airg build when building multiple times with different navps, bump version to 2.16.1, add vcpkg caching (#88)
1 parent 2ae7ecc commit b19c3aa

5 files changed

Lines changed: 30 additions & 8 deletions

File tree

.github/workflows/build.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,14 @@ jobs:
2525
with:
2626
submodules: recursive
2727

28+
- name: Restore vcpkg cache
29+
uses: actions/cache@v4
30+
with:
31+
path: ${{ github.workspace }}/extern/vcpkg/packages
32+
key: vcpkg-${{ runner.os }}-${{ hashFiles('**/vcpkg.json', '**/vcpkg-configuration.json') }}
33+
restore-keys: |
34+
vcpkg-${{ runner.os }}-
35+
2836
- name: Setup VS environment
2937
uses: ilammy/msvc-dev-cmd@v1
3038
with:
@@ -62,6 +70,14 @@ jobs:
6270
with:
6371
submodules: recursive
6472

73+
- name: Restore vcpkg cache
74+
uses: actions/cache@v4
75+
with:
76+
path: ${{ github.workspace }}/extern/vcpkg/packages
77+
key: vcpkg-${{ runner.os }}-${{ hashFiles('**/vcpkg.json', '**/vcpkg-configuration.json') }}
78+
restore-keys: |
79+
vcpkg-${{ runner.os }}-
80+
6581
- name: Setup VS environment
6682
uses: ilammy/msvc-dev-cmd@v1
6783
with:

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ cmake_policy(SET CMP0141 NEW)
33
set(CMAKE_MSVC_DEBUG_INFORMATION_FORMAT "$<IF:$<CONFIG:Debug>,EditAndContinue,ProgramDatabase>" CACHE STRING "MSVC debug information format")
44
project(
55
NavKit
6-
VERSION 2.16.0
6+
VERSION 2.16.1
77
DESCRIPTION "An app to create NAVP and AIRG files for use with Hitman: World of Assassination"
88
LANGUAGES CXX)
99
set(CMAKE_CXX_STANDARD 20)

include/NavKit/NavKitConfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
#define NavKit_VERSION_MAJOR "2"
2-
#define NavKit_VERSION_MINOR "15"
3-
#define NavKit_VERSION_PATCH "0"
2+
#define NavKit_VERSION_MINOR "16"
3+
#define NavKit_VERSION_PATCH "1"

include/NavKit/module/Airg.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,6 @@ class Airg {
7070

7171
static int visibilityDataSize(const ReasoningGrid* reasoningGrid, int waypointIndex);
7272

73-
void build();
74-
7573
static void addWaypointGeometry(std::vector<AirgVertex>& triVerts, std::vector<AirgVertex>& lineVerts,
7674
const Waypoint& waypoint, bool selected, const glm::vec4& color,
7775
bool forceFan = false);
@@ -116,6 +114,7 @@ class Airg {
116114

117115
void handleBuildAirgClicked();
118116

117+
static void buildAirg(Airg* airg);
119118
[[nodiscard]] bool canEnterConnectWaypointMode() const;
120119

121120
void handleConnectWaypointClicked();

src/module/Airg.cpp

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,8 +294,10 @@ void Airg::handleBuildAirgClicked() {
294294
airgBuilding = true;
295295
delete reasoningGrid;
296296
reasoningGrid = new ReasoningGrid();
297+
airgDirty = true;
298+
airgHitTestDirty = true;
297299
Logger::log(NK_INFO, "Building Airg from Airg");
298-
build();
300+
backgroundWorker.emplace(&Airg::buildAirg, this);
299301
}
300302

301303
bool Airg::canEnterConnectWaypointMode() const {
@@ -422,8 +424,13 @@ int Airg::visibilityDataSize(const ReasoningGrid* reasoningGrid, const int waypo
422424
return offset2 - offset1;
423425
}
424426

425-
void Airg::build() {
426-
backgroundWorker.emplace(&GridGenerator::build, &GridGenerator::getInstance());
427+
void Airg::buildAirg(Airg* airg) {
428+
GridGenerator::getInstance().build();
429+
airg->airgBuilding = false;
430+
airg->airgLoaded = true;
431+
airgDirty = true;
432+
airgHitTestDirty = true;
433+
Menu::updateMenuState();
427434
}
428435

429436
void Airg::renderAirg() {

0 commit comments

Comments
 (0)