Skip to content

feat(integrity): add bIsSvEngine option to relax BSP and MDL checks - #5

Merged
hzqst merged 1 commit into
mainfrom
feat/svengine-relax-checks
Nov 25, 2026
Merged

hzqst merged 1 commit into
mainfrom
feat/svengine-relax-checks

Conversation

@hzqst

@hzqst hzqst commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add an optional bool bIsSvEngine = false parameter to IUtilAssetsIntegrity::CheckStudioModel, CheckStudioSequenceGroup, and CheckBSP (preserving default strict behavior for standard GoldSrc callers).
  • Relax BSP validation limits when bIsSvEngine is true to support Sven Co-op 5.26 extended maps:
    • Surface lightmap extent upper bound raised from 256 to 1024.
    • World/model coordinate bounds relaxed to [-2147483648.0, 2147483648.0].
  • Relax Studio MDL validation limits when bIsSvEngine is true to match Sven Co-op 5.26 community assets:
    • Allow trailing padding bytes beyond studiohdr_t::length.
    • Raise attachment limit to 64.
  • Add SvEngine unit test coverage in tests/BSPTests.h and tests/StudioModelTests.h.

Verification

  • Built UtilAssetsIntegrity and UtilAssetsIntegrityTests (RelWithDebInfo), passed ctest: AssetsIntegrity.PublicInterface (1/1 passed).
  • Formatted clean via clang-format-validate.py (0 diffs).
  • Verified with real Sven Co-op 5.26 (svencoop-10257) map/model loading (hl_c00).

public:
virtual UtilAssetsIntegrityCheckReason CheckStudioModel(const void* buf, size_t bufSize, UtilAssetsIntegrityCheckResult_StudioModel* checkResult) = 0;
virtual UtilAssetsIntegrityCheckReason Check8bitBMP(const void* buf, size_t bufSize, UtilAssetsIntegrityCheckResult_BMP* checkResult) = 0;
virtual UtilAssetsIntegrityCheckReason CheckStudioModel(const void* buf, size_t bufSize, UtilAssetsIntegrityCheckResult_StudioModel* checkResult, bool bIsSvEngine = false) = 0;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

修改了ABI之后是不是应该递增INTERFACE版本号?

@hzqst
hzqst merged commit 85a7a1c into main Nov 25, 2026
3 checks passed
@hzqst
hzqst deleted the feat/svengine-relax-checks branch November 25, 2026 05:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant