]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
ensure dynamic textures get updated even if they are currently bound
authoreihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 7 Feb 2011 07:07:56 +0000 (07:07 +0000)
committereihrul <eihrul@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 7 Feb 2011 07:07:56 +0000 (07:07 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10823 d7cf8633-e32d-0410-b094-e92efae38249

gl_backend.c

index b450a84fc45c6235963f0d32b962c49ce583ed7f..d4d83266c6f89d454425ca0c959c59af71b3376a 100644 (file)
@@ -3599,12 +3599,11 @@ void R_Mesh_TexBind(unsigned int unitnum, rtexture_t *tex)
                                if (!tex)
                                        return;
                        }
+                       // upload texture if needed
+                       R_GetTexture(tex);
                        if (unit->texture == tex)
                                return;
                        unit->texture = tex;
-                       // upload texture if needed
-                       if (tex->dirty)
-                               R_RealGetTexture(tex);
                        IDirect3DDevice9_SetTexture(vid_d3d9dev, unitnum, (IDirect3DBaseTexture9*)tex->d3dtexture);
                        //IDirect3DDevice9_SetRenderState(vid_d3d9dev, d3drswrap[unitnum], (tex->flags & TEXF_CLAMP) ? (D3DWRAPCOORD_0 | D3DWRAPCOORD_1 | D3DWRAPCOORD_2) : 0);
                        IDirect3DDevice9_SetSamplerState(vid_d3d9dev, unitnum, D3DSAMP_ADDRESSU, tex->d3daddressu);
@@ -3634,10 +3633,11 @@ void R_Mesh_TexBind(unsigned int unitnum, rtexture_t *tex)
                        if (!tex)
                                return;
                }
+               texnum = R_GetTexture(tex);
                if (unit->texture == tex)
                        return;
                unit->texture = tex;
-               DPSOFTRAST_SetTexture(unitnum, R_GetTexture(tex));
+               DPSOFTRAST_SetTexture(unitnum, texnum);
                break;
        }
 }