Skip to content

jawdan-dev/Sushi-Packager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sushi Packager

A small, game development focused asset packager for statically embedding assets.

About

This is a small and simple to use asset packager for statically embedding assets into an executable. The main focus of this packager is for use with video game assets but isn't limited to them.

How To Use

Example Use Case

Somewhere in your CMakeLists.txt, you can add the following:

# Set the assets files/folders that are to be packaged.
set(Sushi-Package-Assets assets/)
# Add packager library.
add_subdirectory(Sushi-Packager)
target_link_libraries(${PROJECT_NAME} PUBLIC Sushi-Unpacker)
target_include_directories(${PROJECT_NAME} PUBLIC Sushi-Packager/include)

And in your code, such as a main.cpp, you can use it like so:

#include <cstdio>
#include <sushi-packager/unpacker.hpp>

int main() {
	SushiPackager::Unpacker unpacker;

	const char* filename = "filename.txt";

	size_t fileSize;
	const void* fileData = unpacker.getFile(filename, &fileSize);
	if (fileData) {
		// File exists and is available in fileData.
		printf("%s\n", fileData);
	} else {
		// File does not exist.
		printf("Failed to find file \"%s\".\n", filename);
	}
}

About

A small simple C++ asset packager library for primary use in game development based on ZIP files.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Contributors