mute error messages while probing default model skins

Unless otherwise specified in a config file, every model (md2 or md3)
tries to load skin.jpg, skin.png, ../skin.jpg and ../skin.png (in that
order). This commit silences the errors if some of those attempts fail.

There is still an error message, if none of the four files can be found.

The commit also deletes five identical skin.jpg and places one in ../
This commit is contained in:
ac-stef
2016-10-11 21:36:49 +02:00
parent ade460517d
commit bb8bfeb752
6 changed files with 4 additions and 1 deletions
Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

+4 -1
View File
@@ -843,6 +843,8 @@ int findanim(const char *name)
void loadskin(const char *dir, const char *altdir, Texture *&skin) // model skin sharing void loadskin(const char *dir, const char *altdir, Texture *&skin) // model skin sharing
{ {
bool old_silent_texture_load = silent_texture_load;
silent_texture_load = true;
#define ifnoload if((skin = textureload(path))==notexture) #define ifnoload if((skin = textureload(path))==notexture)
defformatstring(path)("packages/models/%s/skin.jpg", dir); defformatstring(path)("packages/models/%s/skin.jpg", dir);
ifnoload ifnoload
@@ -854,10 +856,11 @@ void loadskin(const char *dir, const char *altdir, Texture *&skin) // model skin
ifnoload ifnoload
{ {
strcpy(path+strlen(path)-3, "png"); strcpy(path+strlen(path)-3, "png");
ifnoload return; ifnoload {};
} }
} }
} }
silent_texture_load = old_silent_texture_load;
} }
void preload_playermodels() void preload_playermodels()