From d49903770d1a7fa5f468adc93abff5eb66fef866 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Mon, 15 Sep 2008 11:52:20 +0000 Subject: [PATCH] avoid unnecessary stencil writes git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2626 e016b1c5-ed68-44aa-a2f7-31cac88cffde --- source/src/shadow.cpp | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/source/src/shadow.cpp b/source/src/shadow.cpp index 470a3926..f0feafd2 100644 --- a/source/src/shadow.cpp +++ b/source/src/shadow.cpp @@ -393,16 +393,8 @@ void drawstencilshadows() { glDisable(GL_DEPTH_TEST); - if((hasST2 || hasSTS) && !hasSTW) - { - glStencilFunc(GL_NOTEQUAL, 128, ~0U); - glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); - } - else - { - glStencilFunc(GL_NOTEQUAL, 0, ~0U); - glStencilOp(GL_KEEP, GL_KEEP, GL_ZERO); - } + glStencilFunc(GL_NOTEQUAL, (hasST2 || hasSTS) && !hasSTW ? 128 : 0, ~0U); + glStencilOp(GL_KEEP, GL_KEEP, GL_KEEP); glEnable(GL_BLEND); glBlendFunc(GL_ZERO, GL_SRC_COLOR);