mirror of https://github.com/adamdruppe/arsd.git
add an alias which helps you import files as memory
I've added an alias called "memory" which stands for the data type "immutable ubyte[]", therefore you can use it whenever you are importing files in order to embed them in the executable.
This commit is contained in:
parent
b3d88cafa8
commit
2cf8e2fe18
5
image.d
5
image.d
|
|
@ -24,11 +24,14 @@ public import arsd.targa;
|
||||||
public import arsd.pcx;
|
public import arsd.pcx;
|
||||||
public import arsd.dds;
|
public import arsd.dds;
|
||||||
public import arsd.svg;
|
public import arsd.svg;
|
||||||
|
|
||||||
public import arsd.imageresize;
|
public import arsd.imageresize;
|
||||||
|
|
||||||
import core.memory;
|
import core.memory;
|
||||||
|
|
||||||
|
// this alias will represent the data type of files imported into the executable, it has to be immutable because the arsd library demands it,
|
||||||
|
// it is useful when you are embedding many images into the executable because they all need to be converted to immutable ubyte[]
|
||||||
|
alias memory = immutable ubyte[];
|
||||||
|
|
||||||
static if (__traits(compiles, { import iv.vfs; })) enum ArsdImageHasIVVFS = true; else enum ArsdImageHasIVVFS = false;
|
static if (__traits(compiles, { import iv.vfs; })) enum ArsdImageHasIVVFS = true; else enum ArsdImageHasIVVFS = false;
|
||||||
|
|
||||||
MemoryImage readSvg(string filename) {
|
MemoryImage readSvg(string filename) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue