[Gridflow-cvs] [svn] commit: r5651 - in /trunk/src: gridflow.hxx source_filter.rb

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Tue May 11 22:02:15 EDT 2010


Author: matju
Date: Tue May 11 22:02:15 2010
New Revision: 5651

Log:
reorganise some more

Modified:
    trunk/src/gridflow.hxx
    trunk/src/source_filter.rb

Modified: trunk/src/gridflow.hxx
==============================================================================
--- trunk/src/gridflow.hxx (original)
+++ trunk/src/gridflow.hxx Tue May 11 22:02:15 2010
@@ -700,7 +700,16 @@
 #define GRIN(TB,TS,TI,TL,TF,TD) {TB,TS,TI,TL,TF,TD}
 #else
 #define GRIN(TB,TS,TI,TL,TF,TD) {TB,TS,TI,TF}
+#define GRIN_all(G)     GRIN(G,G,G,G,G,G)
+#define GRIN_int(G)     GRIN(G,G,G,G,0,0)
+#define GRIN_int32(G)   GRIN(0,0,G,0,0,0)
+#define GRIN_float(G)   GRIN(0,0,0,0,G,G)
+#define GRIN_float32(G) GRIN(0,0,0,0,G,0)
+#define GRIN_float64(G) GRIN(0,0,0,0,0,G)
+
 #endif // HAVE_LITE
+
+// for use by source_filter.rb ONLY (for \decl \def \constructor)
 #define MESSAGE t_symbol *sel, int argc, t_atom2 *argv
 #define MESSAGE2 sel,argc,argv
 #define MESSAGE3 t_symbol *, int, t_atom2 *

Modified: trunk/src/source_filter.rb
==============================================================================
--- trunk/src/source_filter.rb (original)
+++ trunk/src/source_filter.rb Tue May 11 22:02:15 2010
@@ -251,17 +251,7 @@
 	if fields[0]!="class" or (n>1 and not /^\{/ =~ fields[1] and fields[1]!=cl) then raise "end not matching #{where}" end
 	$stack.push frame
 	frame.grins.each {|i,v|
-		cli = "#{cl}::grinw_#{i}"
-		k = case v[1]  # b s i l f d
-		when    nil   ; [1,1,1,1,1,1]
-		when   'int32'; [0,0,1,0,0,0]
-		when   'int'  ; [1,1,1,1,0,0]
-		when 'float'  ; [0,0,0,0,1,1]
-		when 'float32'; [0,0,0,0,1,0]
-		when 'float64'; [0,0,0,0,0,1]
-		else raise 'BORK BORK BORK' end
-		ks = k.map{|ke| if ke==0 then 0 else cli end}.join(",")
-		Out.print "static GridHandler #{cl}_grid_#{i}_hand = GRIN(#{ks});"
+		Out.print "static GridHandler #{cl}_grid_#{i}_hand = GRIN_#{v[1]||'all'}(#{cl}::grinw_#{i});"
 		check = "CHECK_GRIN(#{cl},#{i});"
 		handle_def "#{i} grid(GridOutlet *foo) {#{check}in[#{i}]->begin(foo);}"
 		handle_def "#{i} list(...)             {#{check}in[#{i}]->from_list(argc,argv);}" if not frame.methods["_#{i}_list" ].done



More information about the Gridflow-cvs mailing list