A little improvement to GLSL source argument modifiers. trunk
authorRyan C. Gordon <icculus@icculus.org>
Sat, 05 Apr 2008 18:55:23 -0400
branchtrunk
changeset 106 fd0370e31e86
parent 105 0f739e340f30
child 107 5bdff608c98d
A little improvement to GLSL source argument modifiers. Still not done here.
mojoshader.c
--- a/mojoshader.c	Sat Apr 05 18:38:48 2008 -0400
+++ b/mojoshader.c	Sat Apr 05 18:55:23 2008 -0400
@@ -1521,14 +1521,18 @@
             break;
 
         case SRCMOD_COMPLEMENT:
-            premod_str = "1-";
+            premod_str = "(1.0f - (";
+            postmod_str = "))";
             break;
 
         case SRCMOD_X2NEGATE:
-            premod_str = "-";
-            // fall through.
+            premod_str = "-(";
+            postmod_str = " * 2.0f)";
+            break;
+
         case SRCMOD_X2:
-            postmod_str = "_x2";
+            premod_str = "(";
+            postmod_str = " * 2.0f)";
             break;
 
         case SRCMOD_DZ: