]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix loading of skins that end in ".tga" or similar (now strips image extensions off...
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 14 Jul 2003 07:46:44 +0000 (07:46 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 14 Jul 2003 07:46:44 +0000 (07:46 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3269 d7cf8633-e32d-0410-b094-e92efae38249

image.c

diff --git a/image.c b/image.c
index c1615d4c4f3c31c9ac9e8115153a78350e023787..cf6efab62efab753394587b5baa717a049c7ea21 100644 (file)
--- a/image.c
+++ b/image.c
@@ -565,7 +565,11 @@ void Image_StripImageExtension (const char *in, char *out)
        if ((end - in) >= 4)
        {
                temp = end - 4;
-               if (strcmp(temp, ".tga") == 0 || strcmp(temp, ".pcx") == 0 || strcmp(temp, ".lmp") == 0)
+               if (strcmp(temp, ".tga") == 0
+                || strcmp(temp, ".pcx") == 0
+                || strcmp(temp, ".lmp") == 0
+                || strcmp(temp, ".png") == 0
+                || strcmp(temp, ".jpg") == 0)
                        end = temp;
                while (in < end)
                        *out++ = *in++;
@@ -1414,11 +1418,13 @@ void Image_HeightmapToNormalmap(const unsigned char *inpixels, unsigned char *ou
        }
 }
 
-int image_loadskin(imageskin_t *s, char *name)
+int image_loadskin(imageskin_t *s, char *shadername)
 {
        int j;
        qbyte *bumppixels;
        int bumppixels_width, bumppixels_height;
+       char name[MAX_QPATH];
+       Image_StripImageExtension(shadername, name);
        memset(s, 0, sizeof(*s));
        s->basepixels = loadimagepixels(name, false, 0, 0);
        if (s->basepixels == NULL)