]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix r_picmipworld option
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 14 Apr 2009 11:17:51 +0000 (11:17 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 14 Apr 2009 11:17:51 +0000 (11:17 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@8924 d7cf8633-e32d-0410-b094-e92efae38249

gl_textures.c
model_shared.c

index fe13aca500ea487f28821db2deb3aa87fe648aed..1166eb635e547129a9dfa18ddef968b1d99f4df2 100644 (file)
@@ -1077,6 +1077,9 @@ rtexture_t *R_LoadTexture1D(rtexturepool_t *rtexturepool, const char *identifier
 
 rtexture_t *R_LoadTexture2D(rtexturepool_t *rtexturepool, const char *identifier, int width, int height, const unsigned char *data, textype_t textype, int flags, const unsigned int *palette)
 {
+       if(!strcmp(identifier, "textures/evil8_floor/e8clangfloor"))
+               Con_Printf("%d\n", flags & TEXF_PICMIP);
+
        return R_SetupTexture(rtexturepool, identifier, width, height, 1, 1, flags, textype, GLTEXTURETYPE_2D, data, palette);
 }
 
index 5412d7df36e86a96e55a68436bdb2edffc17c043..6b06ead1b18ac63c8408b52c172c1dff87513c46 100644 (file)
@@ -1795,24 +1795,28 @@ q3shaderinfo_t *Mod_LookupQ3Shader(const char *name)
 qboolean Mod_LoadTextureFromQ3Shader(texture_t *texture, const char *name, qboolean warnmissing, qboolean fallback, int defaulttexflags)
 {
        int j;
+       int texflagsmask;
        qboolean success = true;
        q3shaderinfo_t *shader;
        if (!name)
                name = "";
        strlcpy(texture->name, name, sizeof(texture->name));
        shader = name[0] ? Mod_LookupQ3Shader(name) : NULL;
+
+       texflagsmask = ~0;
+       if(!(defaulttexflags & TEXF_PICMIP))
+               texflagsmask &= ~TEXF_PICMIP;
+       if(!(defaulttexflags & TEXF_COMPRESS))
+               texflagsmask &= ~TEXF_COMPRESS;
+
        if (shader)
        {
                if (developer_loading.integer)
                        Con_Printf("%s: loaded shader for %s\n", loadmodel->name, name);
                texture->surfaceparms = shader->surfaceparms;
-               texture->textureflags = shader->textureflags;
 
                // allow disabling of picmip or compression by defaulttexflags
-               if(!(defaulttexflags & TEXF_PICMIP))
-                       texture->textureflags &= ~TEXF_PICMIP;
-               if(!(defaulttexflags & TEXF_COMPRESS))
-                       texture->textureflags &= ~TEXF_COMPRESS;
+               texture->textureflags = shader->textureflags & texflagsmask;
 
                if (shader->surfaceparms & Q3SURFACEPARM_SKY)
                {
@@ -1898,7 +1902,7 @@ nothing                GL_ZERO GL_ONE
                                {
                                        texture->skinframes[j] = NULL;
                                }
-                               else if (!(texture->skinframes[j] = R_SkinFrame_LoadExternal(primarylayer->texturename[j], primarylayer->texflags, false)))
+                               else if (!(texture->skinframes[j] = R_SkinFrame_LoadExternal(primarylayer->texturename[j], primarylayer->texflags & texflagsmask, false)))
                                {
                                        Con_Printf("^1%s:^7 could not load texture ^3\"%s\"^7 (frame %i) for shader ^2\"%s\"\n", loadmodel->name, primarylayer->texturename[j], j, texture->name);
                                        texture->skinframes[j] = R_SkinFrame_LoadMissing();
@@ -1916,7 +1920,7 @@ nothing                GL_ZERO GL_ONE
                                {
                                        texture->skinframes[j] = NULL;
                                }
-                               else if (!(texture->backgroundskinframes[j] = R_SkinFrame_LoadExternal(backgroundlayer->texturename[j], backgroundlayer->texflags, false)))
+                               else if (!(texture->backgroundskinframes[j] = R_SkinFrame_LoadExternal(backgroundlayer->texturename[j], backgroundlayer->texflags & texflagsmask, false)))
                                {
                                        Con_Printf("^1%s:^7 could not load texture ^3\"%s\"^7 (background frame %i) for shader ^2\"%s\"\n", loadmodel->name, backgroundlayer->texturename[j], j, texture->name);
                                        texture->backgroundskinframes[j] = R_SkinFrame_LoadMissing();