I seem to be running to problems every now and then with the MaterialTypeParam field in SMaterial, and how a blend mode is packed in it using pack_texureBlendFunc.
For some reason the current implementation (which uses inttofloat union trick for the int<->float conversion) doesn't seem to be working correctly on iOS after upgrading to Xcode 4. No idea why.
If I change that back to the old style of converting the actual int value to float, it works again. But somehow we're having problems with that way on android, leading to all blended stuff being black!
Since the whole problem comes from the fact that the MaterialTypeParam is float, what do you think if we'd change type of that param to int? It is not used by very many materials after all, so it could as well work the other way by changing others to treat int back to a float in a way they like.
Or, alternatively we could change the MaterialTypeParam2 to be an int, and modify onetexture_blend material to read MaterialTypeParam2 instead of MaterialTypeParam. The only instance currently using MaterialTypeParam2 is the Q3 shader which actually also just crams shader id integers to that float.
Opinions?
Also, if we fiddle in one or other way by my proposition, we could also maybe fix the pack_textureBlendFunc typo at the same time.