From 5ae2552f5e8bbfa30f1577432663852b773bbab7 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 6 Apr 2022 00:25:32 -0400 Subject: [PATCH] Use DarkPlaces name scheme for external skins --- source/psp/video_hardware_images.cpp | 12 +++++++++--- source/psp/video_hardware_model.cpp | 7 ++++--- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/source/psp/video_hardware_images.cpp b/source/psp/video_hardware_images.cpp index c453194..ff831c0 100644 --- a/source/psp/video_hardware_images.cpp +++ b/source/psp/video_hardware_images.cpp @@ -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; } diff --git a/source/psp/video_hardware_model.cpp b/source/psp/video_hardware_model.cpp index ea125b7..fdf6148 100644 --- a/source/psp/video_hardware_model.cpp +++ b/source/psp/video_hardware_model.cpp @@ -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);