From 87c2c81a82720e9e54a4fe2c54fa014dda0bc0f9 Mon Sep 17 00:00:00 2001 From: PaleBlueDot <125748236+pbdot@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:18:32 -0500 Subject: [PATCH 1/2] Enable new renderer on CI --- .github/workflows/cmake.yml | 8 ++++---- CMakeLists.txt | 7 +++++-- libraries/thread/thread.h | 2 ++ source_files/edge/m_argv.cc | 2 +- source_files/edge/r_bsp.cc | 2 -- 5 files changed, 12 insertions(+), 9 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 65253a12d..efd8dbd38 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -31,7 +31,7 @@ jobs: - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DEDGE_SOKOL_GL=ON - name: Build # Build your program with the given configuration @@ -91,7 +91,7 @@ jobs: steps: - uses: actions/checkout@v4 - name: Configure CMake MSVC - run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + run: mkdir build && cd build && cmake .. -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DEDGE_SOKOL_D3D11=ON - name: Build MSVC run: cmake --build build --config ${{env.BUILD_TYPE}} - uses: actions/upload-artifact@v4 @@ -120,7 +120,7 @@ jobs: - name: Configure CMake # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} + run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DEDGE_SOKOL_GL=ON - name: Build # Build your program with the given configuration @@ -155,7 +155,7 @@ jobs: run: git clone https://github.com/edge-classic/web-player-wads ${{github.workspace}}/web-player-wads && cp ${{github.workspace}}/web-player-wads/freedoom/freedoom2.wad ${{github.workspace}}/web/preload/ && cp ${{github.workspace}}/web-player-wads/blasphemer/blasphem.wad ${{github.workspace}}/web/preload/ - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -DEDGE_SOKOL_GLES3=ON - uses: actions/upload-artifact@v4 with: diff --git a/CMakeLists.txt b/CMakeLists.txt index 6e414a8dd..8f756b941 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,12 +17,15 @@ set(CMAKE_CXX_STANDARD_REQUIRED True) # Rendering Options -# Sokol Renderer (Beta) -option(EDGE_SOKOL "Enable Sokol Renderer (Beta)" OFF) +# Sokol Renderer option(EDGE_SOKOL_GL "Sokol GL" OFF) option(EDGE_SOKOL_GLES3 "Sokol GLES3" OFF) option(EDGE_SOKOL_D3D11 "Sokol D3D11" OFF) +if (EDGE_SOKOL_GL OR EDGE_SOKOL_GLES3 OR EDGE_SOKOL_D3D11) + set (EDGE_SOKOL ON) +endif() + # Optional Features option(EDGE_COAL_SUPPORT "Enable support for COAL scripting" ON) option(EDGE_DEHACKED_SUPPORT "Enable support for Dehacked patch conversion" ON) diff --git a/libraries/thread/thread.h b/libraries/thread/thread.h index 83b73e413..c6e8db6a6 100644 --- a/libraries/thread/thread.h +++ b/libraries/thread/thread.h @@ -877,11 +877,13 @@ struct thread_internal_signal_t void thread_signal_init( thread_signal_t* signal ) { +#ifdef _MSC_VER // Compile-time size check #pragma warning( push ) #pragma warning( disable: 4214 ) // nonstandard extension used: bit field types other than int struct x { char thread_signal_type_too_small : ( sizeof( thread_signal_t ) < sizeof( struct thread_internal_signal_t ) ? 0 : 1 ); }; #pragma warning( pop ) +#endif struct thread_internal_signal_t* internal = (struct thread_internal_signal_t*) signal; diff --git a/source_files/edge/m_argv.cc b/source_files/edge/m_argv.cc index 31fdd039e..9adde3acc 100644 --- a/source_files/edge/m_argv.cc +++ b/source_files/edge/m_argv.cc @@ -107,7 +107,7 @@ void ParseArguments(const int argc, const char *const *argv) #ifdef __APPLE__ // ignore MacOS X rubbish - if (argv[i] == "-psn") + if (!strcmp(argv[i],"-psn")) continue; #endif // Just place argv[0] as is diff --git a/source_files/edge/r_bsp.cc b/source_files/edge/r_bsp.cc index e52272eec..bb174097b 100644 --- a/source_files/edge/r_bsp.cc +++ b/source_files/edge/r_bsp.cc @@ -126,8 +126,6 @@ ViewHeightZone view_height_zone; static Subsector *bsp_current_subsector; -static constexpr uint8_t kMaximumEdgeVertices = 20; - static void UpdateSectorInterpolation(Sector *sector) { if (uncapped_frames.d_ && !time_stop_active && !paused && !erraticism_active && !menu_active && !rts_menu_active) From 3bf78878de1b6b97e69fe711281c409a751b2a92 Mon Sep 17 00:00:00 2001 From: PaleBlueDot <125748236+pbdot@users.noreply.github.com> Date: Fri, 10 Jan 2025 13:23:13 -0500 Subject: [PATCH 2/2] Web player already on the new renderer via cmake --- .github/workflows/cmake.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index efd8dbd38..fa156cb58 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -155,7 +155,7 @@ jobs: run: git clone https://github.com/edge-classic/web-player-wads ${{github.workspace}}/web-player-wads && cp ${{github.workspace}}/web-player-wads/freedoom/freedoom2.wad ${{github.workspace}}/web/preload/ && cp ${{github.workspace}}/web-player-wads/blasphemer/blasphem.wad ${{github.workspace}}/web/preload/ - name: Build - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -DEDGE_SOKOL_GLES3=ON + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - uses: actions/upload-artifact@v4 with: