Skip to content

SWPacker is program that allow to pack all files from a directory. It builds a single file .swfp with all resources inside.

Notifications You must be signed in to change notification settings

Creative-Rift/packer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SWPacker

Description

SWPacker is program that allow to pack all files from a directory. It builds a single file .swfp with all resources inside.

Compilation

The compilation is simple, you can choose between two target: Packer and Unpacker.

mkdir "build" && cd build
cmake -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=[Debug/Release] ..
cmake --build . --target SWEngine-[packer/unpacker]_1.1 --config [Debug/Release]

Option

You can define an option by using : -D[option]=[value]

  • CMAKE_BUILD_TYPE: Debug/Release
  • SWFP_COMP: ON/OFF
  • BUILD_UNPACK_LIB_SHARED: ON/OFF
  • BUILD_UNPACK_LIB_STATIC: ON/OFF

Usage

Packer

Simply run the executable and give the directory you want to pack.

./SWEngine-packer [PATH_TO_DIRECTORY]

UnPacker

Simply run the executable and give the directory where the file .swfp file is.

./SWEngine-unpacker [PATH_TO_SWFP_FILE]

Compression

You're able to add a compression process in the packer (and decompress for unpacker). To do so, go to Packer.cpp and find the SWFP_COMP macro and edit the code above to add your own compression process. For UnPacker.cpp find SWFP_COMP and edit the code above.

To enable the compression process use -DSWFP_COMP=ON (default: OFF).

Note: There is a default compression algorithm: zstd.
The header is already include in the project just build a static libraries and add it to the cmake.
Add zstd_static to STATIC_LIB_NAME and ${CMAKE_SOURCE_DIR}/libraries/zstd_static.lib to STATIC_LIB in the CMakeLists.txt.

Authors

The project is made by Guillaume Soisson.

Credits

This project is based on raysan5 works for rres
This project use zstd to provide default compression process.

About

SWPacker is program that allow to pack all files from a directory. It builds a single file .swfp with all resources inside.

Resources

Stars

Watchers

Forks