Use DarkPlaces name scheme for external skins

This commit is contained in:
unknown 2022-04-06 00:25:32 -04:00
parent c0beb9220f
commit 5ae2552f5e
2 changed files with 13 additions and 6 deletions

View file

@ -991,12 +991,18 @@ byte *LoadBMP (FILE *fin, int matchwidth, int matchheight)
loadimagepixels
=============
*/
// HACK HACK HACK
byte* loadimagepixels (char* filename, qboolean complain, int matchwidth, int matchheight)
{
FILE *f;
char basename[128], name[128];
byte *c;
COM_StripExtension(filename, basename); // strip the extension to allow TGA and PCX
if (complain == qfalse)
COM_StripExtension(filename, basename); // strip the extension to allow TGA and PCX
else
strcpy(basename, filename);
c = (byte*)(basename);
while (*c)
@ -1038,8 +1044,8 @@ byte* loadimagepixels (char* filename, qboolean complain, int matchwidth, int ma
FS_FOpenFile (name, &f);
if (f)
return LoadBMP (f, matchwidth, matchheight);
if (complain)
Con_Printf ("Couldn't load %s .tga .jpg .bmp .png \n", filename);
//if (complain)
// Con_Printf ("Couldn't load %s .tga .jpg .bmp .png \n", filename);
return NULL;
}

View file

@ -2043,12 +2043,13 @@ void *Mod_LoadAllSkins (int numskins, daliasskintype_t *pskintype)
{
Mod_FloodFillSkin( skin, pheader->skinwidth, pheader->skinheight );
COM_StripExtension(loadmodel->name, model);
sprintf (model2, "%s_%i", model, i);
// HACK HACK HACK
sprintf (model2, "%s.mdl_%i", model, i);
pheader->gl_texturenum[i][0] =
pheader->gl_texturenum[i][1] =
pheader->gl_texturenum[i][2] =
pheader->gl_texturenum[i][3] = loadtextureimage (model2, 0, 0, qfalse, GU_LINEAR);
pheader->gl_texturenum[i][3] = loadtextureimage (model2, 0, 0, qtrue, GU_LINEAR);
if (pheader->gl_texturenum[i][0] == 0)// did not find a matching TGA...
{
sprintf (name, "%s_%i", loadmodel->name, i);