]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
fix bug where particle textures scroll in GL11/GL13 paths
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Sat, 23 Feb 2013 12:23:39 +0000 (12:23 +0000)
committerRudolf Polzer <divverent@xonotic.org>
Mon, 25 Feb 2013 08:24:55 +0000 (09:24 +0100)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11902 d7cf8633-e32d-0410-b094-e92efae38249
::stable-branch::merge=79de9b9b73752e642a0865b7ef436018528fa1bd

gl_rmain.c

index 789aa7d006ff9e938d3ec9b62c6e62f7af747a4c..96b52e5267610abb42983ac67cb2d598e43e31ce 100644 (file)
@@ -1966,8 +1966,10 @@ void R_SetupShader_Generic(rtexture_t *first, rtexture_t *second, int texturemod
        case RENDERPATH_GL20:
        case RENDERPATH_GLES2:
                R_SetupShader_SetPermutationGLSL(SHADERMODE_GENERIC, permutation);
-               R_Mesh_TexBind(r_glsl_permutation->tex_Texture_First , first );
-               R_Mesh_TexBind(r_glsl_permutation->tex_Texture_Second, second);
+               if (r_glsl_permutation->tex_Texture_First >= 0)
+                       R_Mesh_TexBind(r_glsl_permutation->tex_Texture_First , first );
+               if (r_glsl_permutation->tex_Texture_Second >= 0)
+                       R_Mesh_TexBind(r_glsl_permutation->tex_Texture_Second, second);
                if (r_glsl_permutation->tex_Texture_GammaRamps >= 0)
                        R_Mesh_TexBind(r_glsl_permutation->tex_Texture_GammaRamps, r_texture_gammaramps);
                break;
@@ -1975,12 +1977,18 @@ void R_SetupShader_Generic(rtexture_t *first, rtexture_t *second, int texturemod
        case RENDERPATH_GLES1:
                R_Mesh_TexBind(0, first );
                R_Mesh_TexCombine(0, GL_MODULATE, GL_MODULATE, 1, 1);
+               R_Mesh_TexMatrix(0, NULL);
                R_Mesh_TexBind(1, second);
                if (second)
+               {
                        R_Mesh_TexCombine(1, texturemode, texturemode, rgbscale, 1);
+                       R_Mesh_TexMatrix(1, NULL);
+               }
                break;
        case RENDERPATH_GL11:
                R_Mesh_TexBind(0, first );
+               R_Mesh_TexCombine(0, GL_MODULATE, GL_MODULATE, 1, 1);
+               R_Mesh_TexMatrix(0, NULL);
                break;
        case RENDERPATH_SOFT:
                R_SetupShader_SetPermutationSoft(SHADERMODE_GENERIC, permutation);
@@ -10160,6 +10168,8 @@ static void RSurf_DrawBatch_GL11_Lightmap(float r, float g, float b, float a, qb
        R_Mesh_ColorPointer(4, GL_FLOAT, sizeof(float[4]), rsurface.passcolor4f, rsurface.passcolor4f_vertexbuffer, rsurface.passcolor4f_bufferoffset);
        GL_Color(r, g, b, a);
        R_Mesh_TexBind(0, rsurface.lightmaptexture);
+       R_Mesh_TexCombine(0, GL_MODULATE, GL_MODULATE, 1, 1);
+       R_Mesh_TexMatrix(0, NULL);
        RSurf_DrawBatch();
 }