Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Applied patch #2963966: Add ability to start up stage player plugin w…

…ithout opening the GUI
  • Loading branch information...
commit 3849dc57d0dc42c36a2a577f2c092bf2022a413a 1 parent 30079dc
Rich Mattes authored
8 libstageplugin/p_driver.cc
@@ -167,7 +167,8 @@ extern bool player_quiet_startup;
167 167 extern bool player_quit;
168 168
169 169 // init static vars
170   -WorldGui* StgDriver::world = NULL;
  170 +World* StgDriver::world = NULL;
  171 +bool StgDriver::usegui = true;
171 172
172 173 //int update_request = 0;
173 174
@@ -596,7 +597,10 @@ void StgDriver::Update(void)
596 597 {
597 598 case PLAYER_SIMULATION_CODE:
598 599 // one round of FLTK's update loop.
599   - Fl::wait();
  600 + if (StgDriver::usegui)
  601 + Fl::wait();
  602 + else
  603 + StgDriver::world->Update();
600 604 break;
601 605
602 606 default:
3  libstageplugin/p_driver.h
@@ -38,7 +38,8 @@ class StgDriver : public Driver
38 38 virtual void Update();
39 39
40 40 /// all player devices share the same Stage world (for now)
41   - static Stg::WorldGui* world;
  41 + static Stg::World* world;
  42 + static bool usegui;
42 43
43 44 /// find the device record with this Player id
44 45 Interface* LookupDevice( player_devaddr_t addr );
3  libstageplugin/p_simulation.cc
@@ -79,6 +79,7 @@ InterfaceSimulation::InterfaceSimulation( player_devaddr_t addr,
79 79 Stg::Init( &player_argc, &player_argv );
80 80
81 81 const char* worldfile_name = cf->ReadString(section, "worldfile", NULL );
  82 + StgDriver::usegui = cf->ReadBool(section, "usegui", 1 );
82 83
83 84 if( worldfile_name == NULL )
84 85 {
@@ -114,7 +115,7 @@ InterfaceSimulation::InterfaceSimulation( player_devaddr_t addr,
114 115 // worldfile
115 116
116 117 // if the initial size is to large this crashes on some systems
117   - StgDriver::world = new WorldGui( 400, 300, "Player/Stage" );
  118 + StgDriver::world = ( StgDriver::usegui ? new WorldGui( 400, 300, worldfile_name ) : new World(worldfile_name));
118 119 assert(StgDriver::world);
119 120
120 121 puts("");

0 comments on commit 3849dc5

Please sign in to comment.
Something went wrong with that request. Please try again.