From 730ba465b7192ddb401da66603971dae9d2a8082 Mon Sep 17 00:00:00 2001 From: eihrul Date: Mon, 7 Feb 2011 07:07:56 +0000 Subject: [PATCH] ensure dynamic textures get updated even if they are currently bound git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10823 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_backend.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gl_backend.c b/gl_backend.c index b450a84f..d4d83266 100644 --- a/gl_backend.c +++ b/gl_backend.c @@ -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; } } -- 2.39.2