Add asset saving

This commit is contained in:
2022-08-24 17:24:21 +00:00
parent dc82da6982
commit 3040dc1f7f
6 changed files with 91 additions and 17 deletions

View File

@@ -21,6 +21,7 @@ struct vec *prefabs = NULL;
const char *EXT_PREFAB = ".prefab";
const char *EXT_LEVEL = ".level";
const char *EXT_ASSET = ".asset";
int stemlen = 0;
static const char *cur_ext = NULL;
@@ -100,6 +101,16 @@ void findPrefabs()
fill_extensions(prefabs, DATA_PATH, EXT_PREFAB);
}
char *str_replace_ext(const char *s, const char *newext) {
static char ret[256];
strncpy(ret, s, 256);
char *ext = strrchr(ret, '.');
strncpy(ext, newext, 10);
return ret;
}
FILE *path_open(const char *tag, const char *fmt, ...)
{
va_list args;