๐Ÿ“ฆ RobLoach / raylib-assetsys

๐Ÿ“„ README.md ยท 43 lines
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43# raylib-assetsys

Use the file system abstraction library, [assetsys.h](https://github.com/mattiasgustavsson/libs/blob/main/assetsys.h), with [raylib](https://github.com/raysan5/raylib), to allow loading assets from .zip files.

## Example

``` c
#include <raylib.h>

#define RAYLIB_ASSETSYS_IMPLEMENTATION
#include "raylib-assetsys.h"

int main(int argc, char* argv[]) {
    // Initialize assetsys, and mount resources.zip as /data
    InitAssetsys("resources.zip", "/data");

    // Load cat.png from the zip
    Image cat = LoadImageFromAssetsys("/data/cat.png");
    UnloadImage(cat);

    // Close the assetsys
    CloseAssetsys();

    return 0;
}
```

## API

``` c
bool InitAssetsys(char const* path, char const* mount_as);
bool MountAssetsys(const char* path, const char* mount_as);
bool IsAssetsysReady();
void CloseAssetsys();
unsigned char *LoadFileDataFromAssetsys(const char *fileName, int *dataSize);
char *LoadFileTextFromAssetsys(const char *fileName);
Image LoadImageFromAssetsys(const char* fileName);
```

## License

*raylib-assetsys* is licensed under an unmodified zlib/libpng license, which is an OSI-certified, BSD-like license that allows static linking with closed source software. Check [LICENSE](LICENSE) for further details.