]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
optimize away NOP wave functions in one more case
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 17 Jun 2010 21:53:45 +0000 (21:53 +0000)
committerdivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Thu, 17 Jun 2010 21:53:45 +0000 (21:53 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@10238 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index fc88e5bbfa0409e843b1d1d63332a0c923b18690..f3e6702a525f339464c5c7082607b21609d8ecd2 100644 (file)
@@ -10175,6 +10175,8 @@ void RSurf_PrepareVerticesForBatch(int batchneed, int texturenumsurfaces, const
                        needsupdate |= BATCHNEED_VERTEXMESH_NORMAL | BATCHNEED_VERTEXMESH_VECTOR;
                        break;
                case Q3DEFORM_WAVE:
+                       if(!R_TestQ3WaveFunc(deform->wavefunc, deform->waveparms))
+                               break; // if wavefunc is a nop, ignore this transform
                        batchneed |= BATCHNEED_ARRAY_VERTEX | BATCHNEED_ARRAY_NORMAL | BATCHNEED_ARRAY_TEXCOORD | BATCHNEED_NOGAPS;
                        needsupdate |= BATCHNEED_VERTEXPOSITION | BATCHNEED_VERTEXMESH_VERTEX | BATCHNEED_VERTEXMESH_NORMAL | BATCHNEED_VERTEXMESH_VECTOR;
                        break;
@@ -10183,6 +10185,8 @@ void RSurf_PrepareVerticesForBatch(int batchneed, int texturenumsurfaces, const
                        needsupdate |= BATCHNEED_VERTEXPOSITION | BATCHNEED_VERTEXMESH_VERTEX | BATCHNEED_VERTEXMESH_NORMAL | BATCHNEED_VERTEXMESH_VECTOR;
                        break;
                case Q3DEFORM_MOVE:
+                       if(!R_TestQ3WaveFunc(deform->wavefunc, deform->waveparms))
+                               break; // if wavefunc is a nop, ignore this transform
                        batchneed |= BATCHNEED_ARRAY_VERTEX | BATCHNEED_NOGAPS;
                        needsupdate |= BATCHNEED_VERTEXPOSITION | BATCHNEED_VERTEXMESH_VERTEX;
                        break;