Scarab
A thin, game-agnostic 2D engine host built on the sunlight tile-map engine
Loading...
Searching...
No Matches
Scarab::Engine::Lua::LuaPackApi Class Reference

Packaging-tool support for content encryption - see the root README.md's own "Content encryption" section and tools/README.md. Backs tools/pack.lua, the Lua script that actually walks a game's source tree and produces an encrypted .zip bundle (calling crypto_encrypt_data - see LuaCryptoApi - on each file's bytes before adding it here). More...

#include <luapackapi.h>

Static Public Member Functions

static void Register (lua_State *pLuaState)
 Register the packaging-tool Lua-callable functions.
 

Detailed Description

Packaging-tool support for content encryption - see the root README.md's own "Content encryption" section and tools/README.md. Backs tools/pack.lua, the Lua script that actually walks a game's source tree and produces an encrypted .zip bundle (calling crypto_encrypt_data - see LuaCryptoApi - on each file's bytes before adding it here).

Every primitive here reads/writes a genuine native OS path, resolved exactly the way a plain C fopen() would

  • not routed through the mount-based virtual filesystem (SunLight::FileSystem) every other resource load in this engine uses. That's deliberate: packaging runs against a real, not-yet-bundled source directory on disk, before any of Scarab's own runtime mounting concepts (APP_DIR, a loaded .zip) are even relevant. These primitives exist purely for tools/pack.lua - no running game should ever call them.

Archive handles

pack_create_archive/pack_add_entry/pack_close_archive share one integer-handle convention: 0 always means failure (the same "0 is never a valid handle" shape sprite_acquire already uses), a real handle otherwise. Always call pack_close_archive once done with a handle

  • the underlying zip file isn't actually finalized/valid until then.

Member Function Documentation

◆ Register()

void Scarab::Engine::Lua::LuaPackApi::Register ( lua_State *  pLuaState)
static

Register the packaging-tool Lua-callable functions.


The documentation for this class was generated from the following files: