Update CI workflow for Windows builds and refactor room object handling
- Modified the CI workflow to conditionally set up vcpkg and configure CMake based on the build type for Windows, enhancing build flexibility. - Refactored the handling of staircase objects in the Room class to use initializer lists for improved clarity and consistency in object construction. - Updated chest data handling to utilize modern C++ syntax for better readability.
This commit is contained in:
14
.github/workflows/ci.yml
vendored
14
.github/workflows/ci.yml
vendored
@@ -148,8 +148,8 @@ jobs:
|
|||||||
# brew install pkg-config libpng boost abseil
|
# brew install pkg-config libpng boost abseil
|
||||||
|
|
||||||
# Windows-specific setup
|
# Windows-specific setup
|
||||||
- name: Set up vcpkg
|
- name: Set up vcpkg (non-minimal builds only)
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows' && env.BUILD_TYPE != 'RelWithDebInfo'
|
||||||
uses: lukka/run-vcpkg@v11
|
uses: lukka/run-vcpkg@v11
|
||||||
with:
|
with:
|
||||||
vcpkgGitCommitId: 'c8696863d371ab7f46e213d8f5ca923c4aef2a00'
|
vcpkgGitCommitId: 'c8696863d371ab7f46e213d8f5ca923c4aef2a00'
|
||||||
@@ -170,12 +170,18 @@ jobs:
|
|||||||
-Wno-dev \
|
-Wno-dev \
|
||||||
-GNinja
|
-GNinja
|
||||||
|
|
||||||
- name: Configure CMake (Windows)
|
- name: Configure CMake (Windows with vcpkg)
|
||||||
if: runner.os == 'Windows'
|
if: runner.os == 'Windows' && env.BUILD_TYPE != 'RelWithDebInfo'
|
||||||
shell: cmd
|
shell: cmd
|
||||||
run: |
|
run: |
|
||||||
cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_triplet }} -DCMAKE_POLICY_VERSION_MINIMUM=3.16 -DYAZE_MINIMAL_BUILD=ON -DYAZE_ENABLE_ROM_TESTS=OFF -DYAZE_ENABLE_EXPERIMENTAL_TESTS=OFF -Wno-dev -G "${{ matrix.cmake_generator }}" -A ${{ matrix.cmake_generator_platform }}
|
cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_TOOLCHAIN_FILE=${{ github.workspace }}/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{ matrix.vcpkg_triplet }} -DCMAKE_POLICY_VERSION_MINIMUM=3.16 -DYAZE_MINIMAL_BUILD=ON -DYAZE_ENABLE_ROM_TESTS=OFF -DYAZE_ENABLE_EXPERIMENTAL_TESTS=OFF -Wno-dev -G "${{ matrix.cmake_generator }}" -A ${{ matrix.cmake_generator_platform }}
|
||||||
|
|
||||||
|
- name: Configure CMake (Windows minimal build)
|
||||||
|
if: runner.os == 'Windows' && env.BUILD_TYPE == 'RelWithDebInfo'
|
||||||
|
shell: cmd
|
||||||
|
run: |
|
||||||
|
cmake -B ${{ github.workspace }}/build -DCMAKE_BUILD_TYPE=${{ env.BUILD_TYPE }} -DCMAKE_POLICY_VERSION_MINIMUM=3.16 -DYAZE_MINIMAL_BUILD=ON -DYAZE_ENABLE_ROM_TESTS=OFF -DYAZE_ENABLE_EXPERIMENTAL_TESTS=OFF -Wno-dev -G "${{ matrix.cmake_generator }}" -A ${{ matrix.cmake_generator_platform }}
|
||||||
|
|
||||||
# Build
|
# Build
|
||||||
- name: Build
|
- name: Build
|
||||||
run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} --parallel
|
run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} --parallel
|
||||||
|
|||||||
@@ -528,15 +528,15 @@ void Room::HandleSpecialObjects(short oid, uint8_t posX, uint8_t posY, int& nbr_
|
|||||||
if (nbr_of_staircase < 4) {
|
if (nbr_of_staircase < 4) {
|
||||||
tile_objects_.back().set_options(ObjectOption::Stairs |
|
tile_objects_.back().set_options(ObjectOption::Stairs |
|
||||||
tile_objects_.back().options());
|
tile_objects_.back().options());
|
||||||
z3_staircases_.push_back(staircase(
|
z3_staircases_.push_back({
|
||||||
posX, posY,
|
posX, posY,
|
||||||
absl::StrCat("To ", staircase_rooms_[nbr_of_staircase])
|
absl::StrCat("To ", staircase_rooms_[nbr_of_staircase])
|
||||||
.data()));
|
.data()});
|
||||||
nbr_of_staircase++;
|
nbr_of_staircase++;
|
||||||
} else {
|
} else {
|
||||||
tile_objects_.back().set_options(ObjectOption::Stairs |
|
tile_objects_.back().set_options(ObjectOption::Stairs |
|
||||||
tile_objects_.back().options());
|
tile_objects_.back().options());
|
||||||
z3_staircases_.push_back(staircase(posX, posY, "To ???"));
|
z3_staircases_.push_back({posX, posY, "To ???"});
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -624,7 +624,7 @@ void Room::LoadChests() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
chests_in_room_.emplace_back(
|
chests_in_room_.emplace_back(
|
||||||
chest_data(rom_data[cpos + (i * 3) + 2], big));
|
chest_data{rom_data[cpos + (i * 3) + 2], big});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user