bring vfs_reload() back

main
Dominik Madarász 2023-11-22 22:57:44 +01:00
parent ffaeaca5dc
commit 17f41fd361
6 changed files with 14 additions and 4 deletions

View File

@ -2236,6 +2236,7 @@ SCRIPT_DEBUGGER = 2,
char * vfs_read(const char *pathfile); char * vfs_read(const char *pathfile);
char * vfs_load(const char *pathfile, int *size); char * vfs_load(const char *pathfile, int *size);
int vfs_size(const char *pathfile); int vfs_size(const char *pathfile);
void vfs_reload();
const char * vfs_resolve(const char *fuzzyname); const char * vfs_resolve(const char *fuzzyname);
FILE* vfs_handle(const char *pathfile); FILE* vfs_handle(const char *pathfile);
void * cache_insert(const char *key, void *value, int size); void * cache_insert(const char *key, void *value, int size);
@ -3186,7 +3187,7 @@ unsigned play;
bool paused; bool paused;
struct atlas_t *a; struct atlas_t *a;
} sprite_t; } sprite_t;
enum { OBJTYPE_sprite_t = 10 }; typedef struct { unsigned static_assert_on_L__LINE__ : !!(10 <= 255); } static_assert_on_Lconcat(_L,3780)___COUNTER__; typedef struct { unsigned static_assert_on_L__LINE__ : !!(sizeof(sprite_t)); } static_assert_on_Lconcat(_L,3780)___COUNTER__;; enum { OBJTYPE_sprite_t = 10 }; typedef struct { unsigned static_assert_on_L__LINE__ : !!(10 <= 255); } static_assert_on_Lconcat(_L,3781)___COUNTER__; typedef struct { unsigned static_assert_on_L__LINE__ : !!(sizeof(sprite_t)); } static_assert_on_Lconcat(_L,3781)___COUNTER__;;
void sprite_ctor(sprite_t *s); void sprite_ctor(sprite_t *s);
void sprite_dtor(sprite_t *s); void sprite_dtor(sprite_t *s);
void sprite_tick(sprite_t *s); void sprite_tick(sprite_t *s);

View File

@ -16018,6 +16018,7 @@ API char * vfs_read(const char *pathfile);
API char * vfs_load(const char *pathfile, int *size); API char * vfs_load(const char *pathfile, int *size);
API int vfs_size(const char *pathfile); API int vfs_size(const char *pathfile);
API void vfs_reload();
API const char * vfs_resolve(const char *fuzzyname); // guess best match. @todo: fuzzy path API const char * vfs_resolve(const char *fuzzyname); // guess best match. @todo: fuzzy path
//API const char*vfs_extract(const char *pathfile); // extracts vfs file into local filesystem (temporary file), so it can be read by foreign/3rd party libs //API const char*vfs_extract(const char *pathfile); // extracts vfs file into local filesystem (temporary file), so it can be read by foreign/3rd party libs
API FILE* vfs_handle(const char *pathfile); // same as above, but returns file handle instead. preferred way, will clean descriptors at exit API FILE* vfs_handle(const char *pathfile); // same as above, but returns file handle instead. preferred way, will clean descriptors at exit
@ -355777,10 +355778,12 @@ static array(struct vfs_entry) vfs_hints; // mounted raw assets
static array(struct vfs_entry) vfs_entries; // mounted cooked assets static array(struct vfs_entry) vfs_entries; // mounted cooked assets
static bool vfs_mount_hints(const char *path); static bool vfs_mount_hints(const char *path);
static
void vfs_reload() { void vfs_reload() {
const char *app = app_name(); const char *app = app_name();
dir_cache = 0; // @leak
array_resize(vfs_hints, 0); // @leak array_resize(vfs_hints, 0); // @leak
array_resize(vfs_entries, 0); // @leak array_resize(vfs_entries, 0); // @leak

View File

@ -581,10 +581,12 @@ static array(struct vfs_entry) vfs_hints; // mounted raw assets
static array(struct vfs_entry) vfs_entries; // mounted cooked assets static array(struct vfs_entry) vfs_entries; // mounted cooked assets
static bool vfs_mount_hints(const char *path); static bool vfs_mount_hints(const char *path);
static
void vfs_reload() { void vfs_reload() {
const char *app = app_name(); const char *app = app_name();
dir_cache = 0; // @leak
array_resize(vfs_hints, 0); // @leak array_resize(vfs_hints, 0); // @leak
array_resize(vfs_entries, 0); // @leak array_resize(vfs_entries, 0); // @leak

View File

@ -68,6 +68,7 @@ API char * vfs_read(const char *pathfile);
API char * vfs_load(const char *pathfile, int *size); API char * vfs_load(const char *pathfile, int *size);
API int vfs_size(const char *pathfile); API int vfs_size(const char *pathfile);
API void vfs_reload();
API const char * vfs_resolve(const char *fuzzyname); // guess best match. @todo: fuzzy path API const char * vfs_resolve(const char *fuzzyname); // guess best match. @todo: fuzzy path
//API const char*vfs_extract(const char *pathfile); // extracts vfs file into local filesystem (temporary file), so it can be read by foreign/3rd party libs //API const char*vfs_extract(const char *pathfile); // extracts vfs file into local filesystem (temporary file), so it can be read by foreign/3rd party libs
API FILE* vfs_handle(const char *pathfile); // same as above, but returns file handle instead. preferred way, will clean descriptors at exit API FILE* vfs_handle(const char *pathfile); // same as above, but returns file handle instead. preferred way, will clean descriptors at exit

View File

@ -8040,10 +8040,12 @@ static array(struct vfs_entry) vfs_hints; // mounted raw assets
static array(struct vfs_entry) vfs_entries; // mounted cooked assets static array(struct vfs_entry) vfs_entries; // mounted cooked assets
static bool vfs_mount_hints(const char *path); static bool vfs_mount_hints(const char *path);
static
void vfs_reload() { void vfs_reload() {
const char *app = app_name(); const char *app = app_name();
dir_cache = 0; // @leak
array_resize(vfs_hints, 0); // @leak array_resize(vfs_hints, 0); // @leak
array_resize(vfs_entries, 0); // @leak array_resize(vfs_entries, 0); // @leak

View File

@ -2085,6 +2085,7 @@ API char * vfs_read(const char *pathfile);
API char * vfs_load(const char *pathfile, int *size); API char * vfs_load(const char *pathfile, int *size);
API int vfs_size(const char *pathfile); API int vfs_size(const char *pathfile);
API void vfs_reload();
API const char * vfs_resolve(const char *fuzzyname); // guess best match. @todo: fuzzy path API const char * vfs_resolve(const char *fuzzyname); // guess best match. @todo: fuzzy path
//API const char*vfs_extract(const char *pathfile); // extracts vfs file into local filesystem (temporary file), so it can be read by foreign/3rd party libs //API const char*vfs_extract(const char *pathfile); // extracts vfs file into local filesystem (temporary file), so it can be read by foreign/3rd party libs
API FILE* vfs_handle(const char *pathfile); // same as above, but returns file handle instead. preferred way, will clean descriptors at exit API FILE* vfs_handle(const char *pathfile); // same as above, but returns file handle instead. preferred way, will clean descriptors at exit