bin2d 0.2.0

A tool that enables files to be compiled into an executable and extracted at startup.


To use this package, put the following dependency into your project's dependencies section:

dub.json
dub.sdl

Bin2D

A tool that enables files to be compiled into an executable and extracted at startup.

Features:

  • Limit generated code by:
    • package modifier
    • version(unittest)
  • Use enum for usage at compile time, instead of const(ubyte[])
  • Optionally specify module name
  • Automatic finding of files under directories
  • Output compiled in files at runtime to a specified directory or temporary directory

Basic usage:

Basic usage is as follows Bin2D <output file>[=<module name>] <files or directories...>

Example

$ ./Bin2D output.d=awsome.app.resources.output resources/images/logo.png resources/images/pretty.jpg resources/models/animated_logo.obj Will create a file called output.d with a model name of awsome.app.resources.output and will have:

  • resources/images/logo.png
  • resources/images/pretty.jpg
  • resources/models/animated_logo.obj

Stored in mangled named arrays of that.

But what if I don't know the name at compile time?

To get access to all the values with names you need to iterate over two seperate arrays. The first names will give you the mangled names. The second values will give you the values based upon the index in assetNames.

So how do you extract?

This will extract any files given to it. With specific output directory. It returns an array of the file systems names with the original extension. Directories have been encoded away however.

import modulename;
outputFilesToFileSystem("output/stored/here");

And for a temporary directories?

import modulename;
outputFilesToFileSystem();

It does return the same result as output outputBin2D2FS(string) does.

Why not string mixins?

  • String mixins at least on Windows are bugged. They cannot use subdirectories.
  • Assets do not change often so regeneration process can be manual
  • Easy export to file system
Authors:
  • Richard Andrew Cattermole
Dependencies:
none
Versions:
0.2.1 2016-Dec-15
0.2.0 2015-Jul-23
0.1.0 2015-Jan-30
~master 2016-Dec-15
Show all 4 versions
Download Stats:
  • 0 downloads today

  • 0 downloads this week

  • 0 downloads this month

  • 2 downloads total

Score:
0.7
Short URL:
bin2d.dub.pm