Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > 01ec25f660498f58cefd732c24b5165a > files > 8

stage-3.2.2-8.fc13.src.rpm

Index: libstageplugin/p_simulation.cc
===================================================================
--- libstageplugin/p_simulation.cc	(revision 8564)
+++ libstageplugin/p_simulation.cc	(working copy)
@@ -78,6 +78,7 @@
   Stg::Init( &player_argc, &player_argv );
 
   const char* worldfile_name = cf->ReadString(section, "worldfile", NULL );
+  StgDriver::usegui = cf->ReadBool(section, "usegui", 1 );
 
   if( worldfile_name == NULL )
     {
@@ -113,7 +114,7 @@
   // worldfile
 
   // if the initial size is to large this crashes on some systems
-  StgDriver::world = new WorldGui( 400, 300, "Player/Stage" );
+  StgDriver::world = ( StgDriver::usegui ? new WorldGui( 400, 300, worldfile_name ) : new World(worldfile_name));
   assert(StgDriver::world);
 
   puts("");
Index: libstageplugin/p_driver.cc
===================================================================
--- libstageplugin/p_driver.cc	(revision 8564)
+++ libstageplugin/p_driver.cc	(working copy)
@@ -167,7 +167,8 @@
 extern bool player_quit;
 
 // init static vars
-WorldGui* StgDriver::world = NULL;
+World* StgDriver::world = NULL;
+bool StgDriver::usegui = true;
 
 //int update_request = 0;
 
@@ -577,8 +578,11 @@
 			switch( interface->addr.interf )
 				{
 				case PLAYER_SIMULATION_CODE:
-				  // one round of FLTK's update loop.
-				  Fl::wait();
+					// one round of FLTK's update loop.
+					if (StgDriver::usegui)
+						Fl::wait();
+					else
+						StgDriver::world->Update();
 					break;
 					
 				default:
Index: libstageplugin/p_driver.h
===================================================================
--- libstageplugin/p_driver.h	(revision 8564)
+++ libstageplugin/p_driver.h	(working copy)
@@ -38,7 +38,8 @@
   virtual void Update();
 
   /// all player devices share the same Stage world (for now)
-  static Stg::WorldGui* world;
+  static Stg::World* world;
+  static bool usegui;
 
   /// find the device record with this Player id
   Interface* LookupDevice( player_devaddr_t addr );