Skip to content

feat(comp): add SCompCompress and SCompDecompress#125

Open
heinermann wants to merge 2 commits into
whoahq:masterfrom
Starsurgical:scomp
Open

feat(comp): add SCompCompress and SCompDecompress#125
heinermann wants to merge 2 commits into
whoahq:masterfrom
Starsurgical:scomp

Conversation

@heinermann

@heinermann heinermann commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Prerequisites for reimplementing SFile*.

Uses StormLib's implementation, relies on 3 PRs sent to StormLib (patched directly in vendor directory, will replace vendor version later). Lots of testing added since StormLib does not have tests for these.

Tests

  • WOW and SC1 flavours
  • Against Starcraft 1.17 Storm.dll

Test Generator Tool

Was originally part of this PR but I pulled it out here.

Regarding the manual StormLib patches

I think it would be best to keep the patches and then update the vendor code when the next version of StormLib drops. There are other fixes aside from the listed PRs in their main branch as well.

Comment thread storm/Comp.hpp Outdated
Comment thread storm/CMakeLists.txt
)

target_compile_definitions(storm PRIVATE _CRT_SECURE_NO_WARNINGS)
target_compile_definitions(storm PRIVATE _CRT_SECURE_NO_WARNINGS __STORMLIB_NO_STATIC_LINK__)

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.

Maybe pull this into a separate stormlib chore PR

Comment thread test/gentools/CMakeLists.txt Outdated
Comment thread vendor/CMakeLists.txt
@@ -1 +1,3 @@
add_subdirectory(stormlib-9.31)
if(NOT WHOA_TEST_STORMDLL)

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.

Maybe pull this into a separate stormlib chore PR

Comment thread vendor/stormlib-9.31/CMakeLists.txt Outdated
@@ -29,7 +29,7 @@ set(STORMLIB_SOURCES
file(GLOB STORMLIB_ADPCM ${STORMLIB_SRC_DIR}/adpcm/*.c ${STORMLIB_SRC_DIR}/adpcm/*.cpp)
file(GLOB STORMLIB_HUFFMAN ${STORMLIB_SRC_DIR}/huffman/*.cpp)
file(GLOB STORMLIB_JENKINS ${STORMLIB_SRC_DIR}/jenkins/*.c)
file(GLOB STORMLIB_LZMA ${STORMLIB_SRC_DIR}/lzma/*.c)
file(GLOB STORMLIB_LZMA ${STORMLIB_SRC_DIR}/lzma/C/*.c)

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.

Maybe pull this into a separate stormlib chore PR

Comment thread vendor/stormlib-9.31/src/SCompression.cpp
Comment thread vendor/stormlib-9.31/src/adpcm/adpcm.cpp
@heinermann heinermann marked this pull request as draft June 17, 2026 01:02
@heinermann

Copy link
Copy Markdown
Contributor Author

There are apparently some build issues I need to work out

@heinermann heinermann force-pushed the scomp branch 2 times, most recently from 3d99660 to 54f846c Compare June 17, 2026 08:05
@heinermann

heinermann commented Jun 17, 2026

Copy link
Copy Markdown
Contributor Author

Zero clue as to why it's failing MSVC tests, WORKS ON MY MACHINE 🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️🤷‍♂️
Literally same setup, same commands, Windows.

EDIT: looks like git is taking creative liberties with replacing line endings in the test data

@heinermann heinermann marked this pull request as ready for review June 17, 2026 08:40
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