Skip to content

Commit a137e41

Browse files
committed
modernize build system and toolchain
- unified MSVC toolchain migration (v143 → v145) with solution/tooling normalization - Visual Studio solution alignment and project system cleanup (vcxproj/vcxproj.filters across client/server/missionchooser) - artifact and output model standardization (intermediate/output layout, naming, linker path consistency) - build pipeline modernization (robocopy-based deployment, structured pre/post build execution, normalized error handling) - CI toolchain alignment (GitHub Actions upgrade: runner image, MSBuild integration, checkout/action modernization) - client video subsystem dependency graph migration (VPX/WebM library replacement, legacy lib removal, vpx_tpl integration) - ABI boundary stabilization for debug builds (conditional thunk resolution for MSVC debug symbol indirection to preserve legacy callsite assumptions under toolchain upgrade) - cross-configuration library set segregation validation (Debug/Release/Profile VPX/WebM linking correctness enforcement)
1 parent 8cabfc9 commit a137e41

27 files changed

Lines changed: 839 additions & 461 deletions

.github/workflows/build.yaml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,30 +16,30 @@ on:
1616
jobs:
1717
release:
1818
name: build release
19-
runs-on: windows-2022
19+
runs-on: windows-2025-vs2026
2020
timeout-minutes: 30
2121
steps:
2222
#checkout project
23-
- uses: actions/checkout@v3
23+
- uses: actions/checkout@v4
2424

2525
# setup msbuild
2626
- name: Add msbuild to PATH
27-
uses: microsoft/setup-msbuild@v1.1
27+
uses: microsoft/setup-msbuild@v2
2828

2929
# missionchooser.dll
3030
- name: Build missionchooser.dll
3131
working-directory: src/game/missionchooser
32-
run: MSBuild.exe swarm_sdk_missionchooser.vcxproj -property:Configuration=Release
32+
run: MSBuild.exe swarm_sdk_missionchooser.vcxproj -property:Configuration=Release -property:Platform=Win32
3333

3434
# server.dll
3535
- name: Build server.dll
3636
working-directory: src/game/server
37-
run: MSBuild.exe swarm_sdk_server.vcxproj -property:Configuration=Release
37+
run: MSBuild.exe swarm_sdk_server.vcxproj -property:Configuration=Release -property:Platform=Win32
3838

3939
# client.dll
4040
- name: Build client.dll
4141
working-directory: src/game/client
42-
run: MSBuild.exe swarm_sdk_client.vcxproj -property:Configuration=Release
42+
run: MSBuild.exe swarm_sdk_client.vcxproj -property:Configuration=Release -property:Platform=Win32
4343

4444
# store artifacts
4545
# make sure retention is low, this can become huge otherwise
@@ -54,30 +54,30 @@ jobs:
5454
5555
debug:
5656
name: build debug
57-
runs-on: windows-2022
57+
runs-on: windows-2025-vs2026
5858
timeout-minutes: 30
5959
steps:
6060
#checkout project
61-
- uses: actions/checkout@v3
61+
- uses: actions/checkout@v4
6262

6363
# setup msbuild
6464
- name: Add msbuild to PATH
65-
uses: microsoft/setup-msbuild@v1.1
65+
uses: microsoft/setup-msbuild@v2
6666

6767
# missionchooser.dll
6868
- name: Build missionchooser.dll
6969
working-directory: src/game/missionchooser
70-
run: MSBuild.exe swarm_sdk_missionchooser.vcxproj -property:Configuration=Debug
70+
run: MSBuild.exe swarm_sdk_missionchooser.vcxproj -property:Configuration=Debug -property:Platform=Win32
7171

7272
# server.dll
7373
- name: Build server.dll
7474
working-directory: src/game/server
75-
run: MSBuild.exe swarm_sdk_server.vcxproj -property:Configuration=Debug
75+
run: MSBuild.exe swarm_sdk_server.vcxproj -property:Configuration=Debug -property:Platform=Win32
7676

7777
# client.dll
7878
- name: Build client.dll
7979
working-directory: src/game/client
80-
run: MSBuild.exe swarm_sdk_client.vcxproj -property:Configuration=Debug
80+
run: MSBuild.exe swarm_sdk_client.vcxproj -property:Configuration=Debug -property:Platform=Win32
8181

8282
# store artifacts
8383
# make sure retention is low, this can become huge otherwise

src/game/client/swarm/rd_tooltip_fix.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,15 @@ static class CRD_Tooltip_Fix final : public CAutoGameSystem
2626
// There's only one method in the vtable, so let's just grab it.
2727
auto pApplySchemeSettings = **reinterpret_cast< void( vgui::Tooltip:: *const *const * )( vgui::IScheme * ) >( pTooltip );
2828

29-
byte *pRealFunc = *reinterpret_cast< byte *const * >( &pApplySchemeSettings );
29+
#ifdef _DEBUG
30+
// This is a thunk, so we need to grab the real one.
31+
byte *pThunk = *reinterpret_cast<byte *const *>( &pApplySchemeSettings );
32+
Assert( *pThunk == 0xE9 );
33+
byte *pRealFunc = pThunk + 5 + *reinterpret_cast<const intptr_t *>( pThunk + 1 );
34+
#else
35+
// ...except in release builds, where it's not a thunk.
36+
byte *pRealFunc = *reinterpret_cast<byte *const *>( &pApplySchemeSettings );
37+
#endif
3038
Assert( *pRealFunc == 0xB9 );
3139

3240
// Grab the TextEntry handle that is read at the start of the method.

src/game/client/swarm/vgui/rd_vgui_settings_video.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,12 @@ static class CRD_VideoConfigVariableListHack : public CAutoGameSystem
9292
// Instead, we have to do this garbage:
9393
const byte *pUpdateCurrentVideoConfig = reinterpret_cast< const byte * >( &UpdateCurrentVideoConfig );
9494

95+
#ifdef _DEBUG
96+
// Gotta deal with thunks on debug builds.
97+
Assert( *pUpdateCurrentVideoConfig == 0xE9 );
98+
pUpdateCurrentVideoConfig += 5 + *reinterpret_cast<const intptr_t *>( pUpdateCurrentVideoConfig + 1 );
99+
#endif
100+
95101
struct VideoConfigSetting_t
96102
{
97103
const char *m_szName;

src/game/client/swarm_sdk_client.vcxproj

Lines changed: 140 additions & 106 deletions
Large diffs are not rendered by default.

src/game/client/swarm_sdk_client.vcxproj.filters

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2262,7 +2262,16 @@
22622262
<Library Include="videoservices\lib\win32\vorbis.lib">
22632263
<Filter>videoservices\lib</Filter>
22642264
</Library>
2265-
<Library Include="videoservices\lib\win32\vpxmt.lib">
2265+
<Library Include="videoservices\lib\win32\vpx_mt.lib">
2266+
<Filter>videoservices\lib</Filter>
2267+
</Library>
2268+
<Library Include="videoservices\lib\win32\webm_mt.lib">
2269+
<Filter>videoservices\lib</Filter>
2270+
</Library>
2271+
<Library Include="videoservices\lib\win32\debug\vpx_mtd.lib">
2272+
<Filter>videoservices\lib</Filter>
2273+
</Library>
2274+
<Library Include="videoservices\lib\win32\debug\webm_mtd.lib">
22662275
<Filter>videoservices\lib</Filter>
22672276
</Library>
22682277
</ItemGroup>

src/game/client/videoservices/includes/vpx/vp8cx.h

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ enum vp8e_enc_control_id {
166166
*
167167
* \note Valid range for VP8: -16..16
168168
* \note Valid range for VP9: -9..9
169+
* \note A negative value (-n) is treated as its absolute value (n) in VP9.
169170
*
170171
* Supported in codecs: VP8, VP9
171172
*/
@@ -302,7 +303,7 @@ enum vp8e_enc_control_id {
302303
* the feature is off, i.e., no golden frame boost in CBR mode and
303304
* average bitrate target is used.
304305
*
305-
* For example, to allow 100% more bits, i.e, 2X, in a golden frame
306+
* For example, to allow 100% more bits, i.e., 2X, in a golden frame
306307
* than average frame, set this to 100.
307308
*
308309
* Supported in codecs: VP9
@@ -598,7 +599,7 @@ enum vp8e_enc_control_id {
598599
* the feature is off, i.e., no golden frame boost in CBR mode and
599600
* average bitrate target is used.
600601
*
601-
* For example, to allow 100% more bits, i.e, 2X, in a golden frame
602+
* For example, to allow 100% more bits, i.e., 2X, in a golden frame
602603
* than average frame, set this to 100.
603604
*
604605
* Supported in codecs: VP8
@@ -672,7 +673,7 @@ enum vp8e_enc_control_id {
672673
*/
673674
VP9E_SET_TPL,
674675

675-
/*!\brief Codec control function to enable postencode frame drop.
676+
/*!\brief Codec control function to enable post encode frame drop.
676677
*
677678
* This will allow encoder to drop frame after it's encoded.
678679
*
@@ -767,6 +768,24 @@ enum vp8e_enc_control_id {
767768
*
768769
*/
769770
VP9E_SET_QUANTIZER_ONE_PASS,
771+
772+
/*!\brief Codec control function to enable key frame temporal filtering.
773+
*
774+
* Vp9 allows the encoder to run key frame temporal filtering and use it to
775+
* improve the compression performance. To enable, set this parameter to be
776+
* 1. The default value is set to be 0.
777+
*/
778+
VP9E_SET_KEY_FRAME_FILTERING,
779+
780+
/*!\brief Codec control function to validate HBD input.
781+
*
782+
* VP9 allows the encoder to validate the high bitdepth (HBD) input and
783+
* ensure that every pixel is within the valid range. To disable/enable,
784+
* set this parameter to 0/1. The default value is set to be 1.
785+
*
786+
* Supported in codecs: VP9
787+
*/
788+
VP9E_SET_VALIDATE_HBD_INPUT,
770789
};
771790

772791
/*!\brief vpx 1-D scaling mode
@@ -793,8 +812,7 @@ typedef enum vp9e_temporal_layering_mode {
793812
VP9E_TEMPORAL_LAYERING_MODE_NOLAYERING = 0,
794813

795814
/*!\brief Bypass mode.
796-
* Used when application needs to control temporal layering.
797-
* This will only work when the number of spatial layers equals 1.
815+
* Used when application needs to control spatial and temporal layering.
798816
*/
799817
VP9E_TEMPORAL_LAYERING_MODE_BYPASS = 1,
800818

@@ -868,7 +886,7 @@ typedef enum {
868886
VP8_EIGHT_TOKENPARTITION = 3
869887
} vp8e_token_partitions;
870888

871-
/*!brief VP9 encoder content type */
889+
/*!\brief VP9 encoder content type */
872890
typedef enum {
873891
VP9E_CONTENT_DEFAULT,
874892
VP9E_CONTENT_SCREEN,
@@ -1097,6 +1115,10 @@ VPX_CTRL_USE_TYPE(VP8E_SET_RTC_EXTERNAL_RATECTRL, int)
10971115
#define VPX_CTRL_VP8E_SET_RTC_EXTERNAL_RATECTRL
10981116
VPX_CTRL_USE_TYPE(VP9E_SET_QUANTIZER_ONE_PASS, int)
10991117
#define VPX_CTRL_VP9E_SET_QUANTIZER_ONE_PASS
1118+
VPX_CTRL_USE_TYPE(VP9E_SET_KEY_FRAME_FILTERING, int)
1119+
#define VPX_CTRL_VP9E_SET_KEY_FRAME_FILTERING
1120+
VPX_CTRL_USE_TYPE(VP9E_SET_VALIDATE_HBD_INPUT, int)
1121+
#define VPX_CTRL_VP9E_SET_VALIDATE_HBD_INPUT
11001122

11011123
/*!\endcond */
11021124
/*! @} - end defgroup vp8_encoder */

src/game/client/videoservices/includes/vpx/vpx_codec.h

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ extern "C" {
5050

5151
/*!\brief Decorator indicating a function is deprecated */
5252
#ifndef VPX_DEPRECATED
53-
#if defined(__GNUC__) && __GNUC__
53+
#if defined(__GNUC__)
5454
#define VPX_DEPRECATED __attribute__((deprecated))
5555
#elif defined(_MSC_VER)
5656
#define VPX_DEPRECATED
@@ -60,7 +60,7 @@ extern "C" {
6060
#endif /* VPX_DEPRECATED */
6161

6262
#ifndef VPX_DECLSPEC_DEPRECATED
63-
#if defined(__GNUC__) && __GNUC__
63+
#if defined(__GNUC__)
6464
#define VPX_DECLSPEC_DEPRECATED /**< \copydoc #VPX_DEPRECATED */
6565
#elif defined(_MSC_VER)
6666
/*!\brief \copydoc #VPX_DEPRECATED */
@@ -318,19 +318,21 @@ const char *vpx_codec_err_to_string(vpx_codec_err_t err);
318318
* \param[in] ctx Pointer to this instance's context.
319319
*
320320
*/
321-
const char *vpx_codec_error(vpx_codec_ctx_t *ctx);
321+
const char *vpx_codec_error(const vpx_codec_ctx_t *ctx);
322322

323323
/*!\brief Retrieve detailed error information for codec context
324324
*
325325
* Returns a human readable string providing detailed information about
326-
* the last error.
326+
* the last error. The returned string is only valid until the next
327+
* vpx_codec_* function call (except vpx_codec_error and
328+
* vpx_codec_error_detail) on the codec context.
327329
*
328330
* \param[in] ctx Pointer to this instance's context.
329331
*
330332
* \retval NULL
331333
* No detailed information is available.
332334
*/
333-
const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx);
335+
const char *vpx_codec_error_detail(const vpx_codec_ctx_t *ctx);
334336

335337
/* REQUIRED FUNCTIONS
336338
*
@@ -345,9 +347,11 @@ const char *vpx_codec_error_detail(vpx_codec_ctx_t *ctx);
345347
* \param[in] ctx Pointer to this instance's context
346348
*
347349
* \retval #VPX_CODEC_OK
348-
* The codec algorithm initialized.
349-
* \retval #VPX_CODEC_MEM_ERROR
350-
* Memory allocation failed.
350+
* The codec instance has been destroyed.
351+
* \retval #VPX_CODEC_INVALID_PARAM
352+
* ctx is a null pointer.
353+
* \retval #VPX_CODEC_ERROR
354+
* Codec context not initialized.
351355
*/
352356
vpx_codec_err_t vpx_codec_destroy(vpx_codec_ctx_t *ctx);
353357

src/game/client/videoservices/includes/vpx/vpx_decoder.h

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
extern "C" {
3030
#endif
3131

32-
#include "./vpx_codec.h"
32+
#include "./vpx_codec.h" // IWYU pragma: export
3333
#include "./vpx_frame_buffer.h"
3434

3535
/*!\brief Current ABI version number
@@ -60,7 +60,7 @@ extern "C" {
6060
#define VPX_CODEC_CAP_INPUT_FRAGMENTS 0x100000
6161
/*!\brief Can support frame-based multi-threading */
6262
#define VPX_CODEC_CAP_FRAME_THREADING 0x200000
63-
/*!brief Can support external frame buffers */
63+
/*!\brief Can support external frame buffers */
6464
#define VPX_CODEC_CAP_EXTERNAL_FRAME_BUFFER 0x400000
6565

6666
/*! \brief Initialization-time Feature Enabling
@@ -120,14 +120,18 @@ typedef struct vpx_codec_dec_cfg {
120120
* is not thread safe and should be guarded with a lock if being used
121121
* in a multithreaded context.
122122
*
123+
* On success, vpx_codec_destroy() must be used to free resources allocated for
124+
* the decoder context. If vpx_codec_dec_init_ver() fails, it is not necessary
125+
* to call vpx_codec_destroy() on the decoder context.
126+
*
123127
* \param[in] ctx Pointer to this instance's context.
124128
* \param[in] iface Pointer to the algorithm interface to use.
125129
* \param[in] cfg Configuration to use, if known. May be NULL.
126130
* \param[in] flags Bitfield of VPX_CODEC_USE_* flags
127131
* \param[in] ver ABI version number. Must be set to
128132
* VPX_DECODER_ABI_VERSION
129133
* \retval #VPX_CODEC_OK
130-
* The decoder algorithm initialized.
134+
* The decoder algorithm has been initialized.
131135
* \retval #VPX_CODEC_MEM_ERROR
132136
* Memory allocation failed.
133137
*/
@@ -152,7 +156,7 @@ vpx_codec_err_t vpx_codec_dec_init_ver(vpx_codec_ctx_t *ctx,
152156
* \param[in] iface Pointer to the algorithm interface
153157
* \param[in] data Pointer to a block of data to parse
154158
* \param[in] data_sz Size of the data buffer
155-
* \param[in,out] si Pointer to stream info to update. The size member
159+
* \param[in,out] si Pointer to stream info to update. The sz member
156160
* \ref MUST be properly initialized, but \ref MAY be
157161
* clobbered by the algorithm. This parameter \ref MAY
158162
* be NULL.
@@ -170,7 +174,7 @@ vpx_codec_err_t vpx_codec_peek_stream_info(vpx_codec_iface_t *iface,
170174
* Returns information about the stream that has been parsed during decoding.
171175
*
172176
* \param[in] ctx Pointer to this instance's context
173-
* \param[in,out] si Pointer to stream info to update. The size member
177+
* \param[in,out] si Pointer to stream info to update. The sz member
174178
* \ref MUST be properly initialized, but \ref MAY be
175179
* clobbered by the algorithm. This parameter \ref MAY
176180
* be NULL.
@@ -205,6 +209,8 @@ vpx_codec_err_t vpx_codec_get_stream_info(vpx_codec_ctx_t *ctx,
205209
* this frame.
206210
* \param[in] deadline Soft deadline the decoder should attempt to meet,
207211
* in us. Set to zero for unlimited.
212+
* NOTE: The deadline parameter is ignored. Always
213+
* pass 0.
208214
*
209215
* \return Returns #VPX_CODEC_OK if the coded data was processed completely
210216
* and future pictures can be decoded without error. Otherwise,

0 commit comments

Comments
 (0)