so valid values would be max FFFFFFFF= ALPHA(FF)RED(FF)GREEN(FF)BLUE(FF)
Which is the whole range of a DWORD. A DWORD is between 0 and 0xFFFFFFFF. So the if check will never evaluate to true. (Also checking a DWORD for <0 is redundant because a DWORD is unsigned, thus never < 0)
I can change that.. no biggie... how often is SetRenderState called? and if you look most of the if's except a few are relatively small...
SetRenderState is called *often*. The problem with the ifs isn't how big the block in them is, but if there's an if at all.
Of course, if there is an application that runs into problems because we should reject a SetRenderState call, I won't argue about performance any longer; But for now that isn't the case.