[Gridflow-cvs] [svn] commit: r6230 - in /trunk: Makefile configure src/gem_loader.cxx src/gridflow.cxx

svn-gridflow at artengine.ca svn-gridflow at artengine.ca
Thu Sep 9 14:56:38 EDT 2010


Author: matju
Date: Thu Sep  9 14:56:36 2010
New Revision: 6230

Log:
GEM support compilation is now mandatory, while it is now optional at runtime

Added:
    trunk/src/gem_loader.cxx
Modified:
    trunk/Makefile
    trunk/configure
    trunk/src/gridflow.cxx

Modified: trunk/Makefile
==============================================================================
--- trunk/Makefile (original)
+++ trunk/Makefile Thu Sep  9 14:56:36 2010
@@ -12,9 +12,9 @@
 
 LDSOFLAGS += -lm $(LIBS)
 OBJS2 = src/gridflow.o src/grid.o src/classes1.o src/classes2.o src/classes3.o src/classes_gui.o \
-src/number.1.o src/number.2.o src/number.3.o src/number.4.o \
-src/formats.o
-PDLIB += gridflow_pdp$(PDSUF) gridflow_unicorn$(PDSUF)
+src/number.1.o src/number.2.o src/number.3.o src/number.4.o src/formats.o
+PDLIB += gridflow_gem_loader$(PDSUF) gridflow_pdp$(PDSUF) gridflow_unicorn$(PDSUF)
+PDLIB += gridflow_gem9292$(PDSUF) gridflow_gem9293$(PDSUF) gridflow_gem9393$(PDSUF)
 
 OS = $(shell uname -s | sed -e 's/^MINGW.*/nt/')
 FILT = $(RUBY) -w src/source_filter.rb
@@ -91,16 +91,18 @@
 $(PDLIB1): $(OBJS2) $(OBJS) $(H) $(COMMON_DEPS)
 	$(CXX) -DPDSUF=\"$(PDSUF)\" $(CFLAGS) $(PDBUNDLEFLAGS) $(LIBPATH) -xnone $(OBJS2) $(OBJS) $(LDSOFLAGS) -o $@
 
-gridflow_gem9292$(PDSUF): src/gem.cxx.fcs     $(H) $(COMMON_DEPS)
-	$(CXX) $(CFLAGS) $(PDBUNDLEFLAGS) $(LIBPATH)                               -o $@ -xc++ src/gem.cxx.fcs
-gridflow_gem9293$(PDSUF): src/gem.cxx.fcs     $(H) $(COMMON_DEPS)
-	$(CXX) $(CFLAGS) $(PDBUNDLEFLAGS) $(LIBPATH) -DGEMSTATE93                  -o $@ -xc++ src/gem.cxx.fcs
-gridflow_gem9393$(PDSUF): src/gem.cxx.fcs     $(H) $(COMMON_DEPS)
-	$(CXX) $(CFLAGS) $(PDBUNDLEFLAGS) $(LIBPATH) -DGEMSTATE93 -DIMAGESTRUCT93  -o $@ -xc++ src/gem.cxx.fcs
-gridflow_pdp$(PDSUF):     src/pdp.cxx.fcs     $(H) $(COMMON_DEPS)
-	$(CXX) $(CFLAGS) $(PDBUNDLEFLAGS) $(LIBPATH)                               -o $@ -xc++ src/pdp.cxx.fcs
-gridflow_unicorn$(PDSUF): src/unicorn.cxx.fcs $(H) $(COMMON_DEPS)
-	$(CXX) $(CFLAGS) $(PDBUNDLEFLAGS) $(LIBPATH)                               -o $@ -xc++ src/unicorn.cxx.fcs
+gridflow_gem_loader$(PDSUF): src/gem_loader.cxx.fcs $(H) $(COMMON_DEPS)
+	$(CXX) $(CFLAGS) $(PDBUNDLEFLAGS) $(LIBPATH)                              -o $@ -xc++ src/gem_loader.cxx.fcs
+gridflow_gem9292$(PDSUF):    src/gem.cxx.fcs        $(H) $(COMMON_DEPS)
+	$(CXX) $(CFLAGS) $(PDBUNDLEFLAGS) $(LIBPATH)                              -o $@ -xc++ src/gem.cxx.fcs
+gridflow_gem9293$(PDSUF):    src/gem.cxx.fcs        $(H) $(COMMON_DEPS)
+	$(CXX) $(CFLAGS) $(PDBUNDLEFLAGS) $(LIBPATH) -DGEMSTATE93                 -o $@ -xc++ src/gem.cxx.fcs
+gridflow_gem9393$(PDSUF):    src/gem.cxx.fcs        $(H) $(COMMON_DEPS)
+	$(CXX) $(CFLAGS) $(PDBUNDLEFLAGS) $(LIBPATH) -DGEMSTATE93 -DIMAGESTRUCT93 -o $@ -xc++ src/gem.cxx.fcs
+gridflow_pdp$(PDSUF):        src/pdp.cxx.fcs        $(H) $(COMMON_DEPS)
+	$(CXX) $(CFLAGS) $(PDBUNDLEFLAGS) $(LIBPATH)                              -o $@ -xc++ src/pdp.cxx.fcs
+gridflow_unicorn$(PDSUF):    src/unicorn.cxx.fcs    $(H) $(COMMON_DEPS)
+	$(CXX) $(CFLAGS) $(PDBUNDLEFLAGS) $(LIBPATH)                              -o $@ -xc++ src/unicorn.cxx.fcs
 
 beep::
 	@for z in 1 2 3 4 5; do echo -ne '\a'; sleep 1; done

Modified: trunk/configure
==============================================================================
--- trunk/configure (original)
+++ trunk/configure Thu Sep  9 14:56:36 2010
@@ -567,23 +567,6 @@
                 `
         }
 }
-Feature.add {
-	tag :gem
-	name "GEM support (versions 91, 92, 93, 92/93 hybrid)"
-	uses_feature [:opengl]
-	uses_pdlib ["gridflow_gem9292$(PDSUF)",
-		    "gridflow_gem9293$(PDSUF)",
-		    "gridflow_gem9393$(PDSUF)"]
-        uses_so $LIBX11DIR+["-lGLEW"] if not WIN
-        uses_h ["GL/glew.h"]
-	options ["HAVE_GEM"]
-	test proc {
-		c_test %`
-                #include#
-                int main () {return (GLint)0;}
-                `
-        }
-}
 #--------------------------------#
 
 $features_h = {}

Modified: trunk/src/gridflow.cxx
==============================================================================
--- trunk/src/gridflow.cxx (original)
+++ trunk/src/gridflow.cxx Thu Sep  9 14:56:36 2010
@@ -990,36 +990,6 @@
 }
 
 extern "C" void sys_load_lib(t_canvas *,const char *);
-#ifdef HAVE_GEM
-//struct GemVersion {static const char *versionString();};
-struct GemState    {GemState(); char trabant[666];};
-struct imageStruct {imageStruct(); char lada[666];};
-//#define sys_load_lib(A,B) do {post("pre sys_load_lib(%s)",B); sys_load_lib(A,B); post("post sys_load_lib(%s)",B);} while(0)
-
-static void try_loading_gem () {
-	//post("GF sizeof(imageStruct)=%d sizeof(pixBlock)=%d sizeof(GemState)=%d",sizeof(imageStruct),sizeof(pixBlock),sizeof(GemState));
-	//int major,minor; sscanf(GemVersion::versionString(),"%d.%d",&major,&minor); gem = major*1000+minor;
-	int GemState_version = -1;
- 	GemState *dummy = new GemState();
-	float *stupide = (float *)dummy;
-	int i;
-	for (i=0; i<16; i++) if (stupide[i]==50.f) break;
-	if (i==16) {error("GridFlow: can't find GemState::tickTime"); return;}
-	int j = i-2-2*sizeof(void*)/sizeof(float);
-	//post("GemState::tickTime found at [%d], so pixBlock is probably at [%d]",i,j);	
-	if      (j==3        ) {GemState_version = 93;}
-	else if (j==5 || j==6) {GemState_version = 92;}
-	else {error("GridFlow: can't detect this version of GEM: i=%d j=%d",i,j); return;}
-	//delete dummy;
-	/* note that j==6 is because in 64-bit mode you have one int of padding in GemState92 just before the pixBlock* */
-	// imageStruct 92 starts with int xsize=ysize=0; imageStruct 93 starts with a C++ class pointer != 0 */
-	int imageStruct_version = *(long *)new imageStruct() ? 93 : 92;
-	post("GridFlow/GEM bridge : GemState version %d, imageStruct version %d",GemState_version,imageStruct_version);
-	if (GemState_version==92)          sys_load_lib(0,"gridflow/gridflow_gem9292");
-	else if (imageStruct_version==92)  sys_load_lib(0,"gridflow/gridflow_gem9293");
-	else                               sys_load_lib(0,"gridflow/gridflow_gem9393");
-}
-#endif
 
 // note: contrary to what m_pd.h says, pd_getfilename() and pd_getdirname()
 // don't exist; also, canvas_getcurrentdir() isn't available during setup
@@ -1066,19 +1036,12 @@
 	startup_classes_gui();
 	startup_format();
 	STARTUP_LIST()
-#ifdef HAVE_GEM
-	try_loading_gem();
-#endif
-	sys_load_lib(0,"gridflow/gridflow_pdp");     // avoid linking directly to [gridflow/gridflow_pdp]
-	sys_load_lib(0,"gridflow/gridflow_unicorn"); // avoid linking directly to [gridflow/gridflow_unicorn]
+	// avoid linking directly to those parts (cross-platform optional-linkage)
+	sys_load_lib(0,"gridflow/gridflow_gem_loader");
+	sys_load_lib(0,"gridflow/gridflow_pdp");     
+	sys_load_lib(0,"gridflow/gridflow_unicorn");
 
 	//sys_gui("bind . <Motion> {puts %W}\n");
-#if 0
-	sys_gui("rename pdtk_text_new pdtk_text_nous\n"
-	        "proc pdtk_text_new {a b c d e f g} {pdtk_text_nous $a $b $c $d [encoding convertfrom $e] $f $g}\n"
-		"rename pdtk_text_set pdtk_text_sept\n"
-	        "proc pdtk_text_set {a b e        } {pdtk_text_sept $a $b       [encoding convertfrom $e]      }\n");
-#endif
         sys_vgui("set gfdir {%s}\n",dirresult);
 	sys_gui("proc gf_menu_open {parent} {\n"
 		"set z $::pd_opendir; set ::pd_opendir $::gfdir/examples;"



More information about the Gridflow-cvs mailing list