Fixed preprocessor indent and endline output.
authorRyan C. Gordon <icculus@icculus.org>
Thu, 12 Feb 2009 02:55:45 -0500
changeset 583 9c966b751fd6
parent 582 637dcfff28d8
child 584 9aea8877564d
Fixed preprocessor indent and endline output.
mojoshader_preprocessor.c
--- a/mojoshader_preprocessor.c	Thu Feb 12 02:49:43 2009 -0500
+++ b/mojoshader_preprocessor.c	Thu Feb 12 02:55:45 2009 -0500
@@ -659,7 +659,7 @@
         //  tokens. For example, after a semicolon. This allows HLSL code to
         //  be mostly readable, instead of a stream of tokens.
         if (token == ((Token) '\n'))
-            ; // ignore.
+            isnewline = nl;  // this doesn't actually care about '\n' ...
 
         else if ( (token == ((Token) '}')) || (token == ((Token) ';')) )
         {
@@ -683,6 +683,7 @@
             {
                 out_of_memory =
                     (!add_to_buffer(&buffer,endline,sizeof (endline),m,d)) ||
+                    (!indent_buffer(&buffer, indent, 1, m, d)) ||
                     (!add_to_buffer(&buffer, "{", 1, m, d)) ||
                     (!add_to_buffer(&buffer,endline,sizeof (endline),m,d));
                 indent++;