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:
scawful
2025-09-26 11:19:24 -04:00
parent 132823701b
commit 7c90b2b6ba
2 changed files with 14 additions and 8 deletions

View File

@@ -148,8 +148,8 @@ jobs:
# brew install pkg-config libpng boost abseil
# Windows-specific setup
- name: Set up vcpkg
if: runner.os == 'Windows'
- name: Set up vcpkg (non-minimal builds only)
if: runner.os == 'Windows' && env.BUILD_TYPE != 'RelWithDebInfo'
uses: lukka/run-vcpkg@v11
with:
vcpkgGitCommitId: 'c8696863d371ab7f46e213d8f5ca923c4aef2a00'
@@ -170,12 +170,18 @@ jobs:
-Wno-dev \
-GNinja
- name: Configure CMake (Windows)
if: runner.os == 'Windows'
- name: Configure CMake (Windows with vcpkg)
if: runner.os == 'Windows' && env.BUILD_TYPE != 'RelWithDebInfo'
shell: cmd
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 }}
- 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
- name: Build
run: cmake --build ${{ github.workspace }}/build --config ${{ env.BUILD_TYPE }} --parallel

View File

@@ -528,15 +528,15 @@ void Room::HandleSpecialObjects(short oid, uint8_t posX, uint8_t posY, int& nbr_
if (nbr_of_staircase < 4) {
tile_objects_.back().set_options(ObjectOption::Stairs |
tile_objects_.back().options());
z3_staircases_.push_back(staircase(
z3_staircases_.push_back({
posX, posY,
absl::StrCat("To ", staircase_rooms_[nbr_of_staircase])
.data()));
.data()});
nbr_of_staircase++;
} else {
tile_objects_.back().set_options(ObjectOption::Stairs |
tile_objects_.back().options());
z3_staircases_.push_back(staircase(posX, posY, "To ???"));
z3_staircases_.push_back({posX, posY, "To ???"});
}
break;
}
@@ -624,7 +624,7 @@ void Room::LoadChests() {
}
chests_in_room_.emplace_back(
chest_data(rom_data[cpos + (i * 3) + 2], big));
chest_data{rom_data[cpos + (i * 3) + 2], big});
}
}
}