Add an password to protect your Zip/Resource files.
Usage Password Encryption
local zip = ZIP_OpenFile( SDLFW_PATH .. "../samples/media/res.zip" )
if ( zip ~= nil ) then
ZIP_EnableEncryption( zip, true )
ZIP_SetPassword ( zip, "SGVsbG8gV29ybGQ=" )
local data = ZIP_RWFromFile( zip, "res/images/bg512x384-1.bmp" )
if ( data ~= nil ) then
image = SDL_LoadBMP_RW( data, 1 )
if ( image ~= nil ) then
SDL_BlitSurface( image, nil, screen, nil )
SDL_Flip( screen )
SDL_FreeSurface( image )
end
end
ZIP_CloseFile( zip )
end
|