]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
when loading q1bsp textures, do not allow q3 shader loading to overwrite
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 8 Apr 2011 16:10:44 +0000 (16:10 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 8 Apr 2011 16:10:44 +0000 (16:10 +0000)
default parameters

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11036 d7cf8633-e32d-0410-b094-e92efae38249

model_brush.c

index 0a3a944c2c931cc51a1327b57f7221decb243b7a..08040c79faa60e4d9a150c30e4bbf17f53894d60 100644 (file)
@@ -1588,6 +1588,7 @@ static void Mod_Q1BSP_LoadTextures(lump_t *l)
        skinframe_t *skinframe;
        miptex_t *dmiptex;
        texture_t *tx, *tx2, *anims[10], *altanims[10];
+       texture_t backuptex;
        dmiptexlump_t *m;
        unsigned char *data, *mtdata;
        const char *s;
@@ -1722,8 +1723,11 @@ static void Mod_Q1BSP_LoadTextures(lump_t *l)
                        if (name[j] >= 'A' && name[j] <= 'Z')
                                name[j] += 'a' - 'A';
 
+               // LordHavoc: backup the texture_t because q3 shader loading overwrites it
+               backuptex = loadmodel->data_textures[i];
                if (dmiptex->name[0] && Mod_LoadTextureFromQ3Shader(loadmodel->data_textures + i, name, false, false, 0))
                        continue;
+               loadmodel->data_textures[i] = backuptex;
 
                tx = loadmodel->data_textures + i;
                strlcpy(tx->name, name, sizeof(tx->name));