filename filtering for media files

No more spaces in filenames. The only allowed chars are a-z, A-Z, 0-9 and
"-_.()".

An exception are texture filenames, which may also have a prefix command
like "<decal>" included.

Also fixed some memory leaks in media download.
This commit is contained in:
ac-stef
2015-05-18 14:46:03 +02:00
parent e318ecd68e
commit 786a6cdce1
8 changed files with 71 additions and 29 deletions
+2 -1
View File
@@ -255,6 +255,7 @@ struct md3 : vertmodel
void md3load(char *model)
{
if(!loadingmd3) { conoutf("not loading an md3"); return; };
filtertext(model, model, FTXT__MEDIAFILEPATH);
defformatstring(filename)("%s/%s", md3dir, model);
md3::md3part &mdl = *new md3::md3part;
loadingmd3->parts.add(&mdl);
@@ -265,7 +266,7 @@ void md3load(char *model)
void md3skin(char *objname, char *skin)
{
if(!objname || !skin) return;
filtertext(skin, skin, FTXT__MEDIAFILEPATH);
if(!loadingmd3 || loadingmd3->parts.empty()) { conoutf("not loading an md3"); return; };
md3::part &mdl = *loadingmd3->parts.last();
bool used = false;