natiny_resource_unmount

C
int natiny_resource_unmount(const char* path);

Takes a folder off the stack that natiny_resource_load() reads from, and frees the packs it had in memory. Names it was answering fall through to whatever is under it.

Parameters

Name Type Description
path const char* Folder to unmount, named as it was mounted

Returns

Type Description
int 1 when a mount was taken off, 0 when nothing was mounted under that name

Example

C
natiny_resource_mount("mods/hd-textures", NULL);
/*  ... the player turns the mod off  */
natiny_resource_unmount("mods/hd-textures");

/*  back to the folder underneath  */
NatinyResource hero = natiny_resource_load("textures/hero.png");

Notes

  • The packs this mount had unpacked in memory are freed here, whether or not a resource is still standing on them.
  • An asynchronous load still waiting on this mount's packs fails, and its callback is told so on the next frame rather than left unanswered.