]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
NULL out RSurf_ActiveModelEntity rsurface fields that aren't wanted with an animcache...
authorechon <echon@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 8 Sep 2009 15:59:10 +0000 (15:59 +0000)
committerechon <echon@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 8 Sep 2009 15:59:10 +0000 (15:59 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@9169 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index 3cc4e746ff6754e44eb67f3cdccca486f65bc3a1..52a10187eea6b515b3f3fa397f3ed0efcdbb913a 100644 (file)
@@ -2760,7 +2760,7 @@ void R_RunAnimCache(void)
                        // FIXME: Some stable way of determining if normals/tangets aren't going to be needed would be good for optimizing this
                        // Need to consider deformvertexes and tcgens that need normals and/or tangents (otherwise they'll slow-path generate them later), as well as some rendering settings
                        bWantNormals = true;
-                       bWantTangents = bWantNormals && (r_glsl.integer && gl_support_fragment_shader);
+                       bWantTangents = true;//bWantNormals && (r_glsl.integer && gl_support_fragment_shader);
                        model->AnimateVertices(
                                model, ent->frameblend,
                                r_animCache[cacheIdx].vertexes,
@@ -5282,9 +5282,9 @@ void RSurf_ActiveModelEntity(const entity_render_t *ent, qboolean wantnormals, q
                if (ent->animcacheindex != 0)
                {
                        rsurface.modelvertex3f = r_animCache[ent->animcacheindex-1].vertexes;
-                       rsurface.modelsvector3f = r_animCache[ent->animcacheindex-1].sVectors;
-                       rsurface.modeltvector3f = r_animCache[ent->animcacheindex-1].tVectors;
-                       rsurface.modelnormal3f = r_animCache[ent->animcacheindex-1].normals;
+                       rsurface.modelsvector3f = wanttangents ? r_animCache[ent->animcacheindex-1].sVectors : NULL;
+                       rsurface.modeltvector3f = wanttangents ? r_animCache[ent->animcacheindex-1].tVectors : NULL;
+                       rsurface.modelnormal3f = wantnormals ? r_animCache[ent->animcacheindex-1].normals : NULL;
                }
                else if (wanttangents)
                {