Revision: 8282
http://playerstage.svn.sourceforge.net/playerstage/?rev=8282&view=rev
Author: rtv
Date: 2009-10-07 22:12:06 +0000 (Wed, 07 Oct 2009)
Log Message:
-----------
fixed stepping interaction with pause
Modified Paths:
--------------
code/stage/trunk/libstage/worldgui.cc
Modified: code/stage/trunk/libstage/worldgui.cc
===================================================================
--- code/stage/trunk/libstage/worldgui.cc 2009-10-07 22:01:15 UTC (rev
8281)
+++ code/stage/trunk/libstage/worldgui.cc 2009-10-07 22:12:06 UTC (rev
8282)
@@ -571,20 +571,16 @@
void WorldGui::SetTimeouts()
{
- if( speedup > 0.0 )
- {
- //puts( "removing idle" );
- Fl::remove_idle( (Fl_Timeout_Handler)UpdateCallback, this );
- Fl::remove_timeout( (Fl_Timeout_Handler)UpdateCallback, this );
- Fl::add_timeout( (sim_interval/1e6) / speedup,
(Fl_Timeout_Handler)UpdateCallback, this );
- }
- else
- { // does no harm if they're not installed already
- //puts( "removing timeout" );
- Fl::remove_timeout( (Fl_Timeout_Handler)UpdateCallback, this );
- Fl::remove_idle( (Fl_Timeout_Handler)UpdateCallback, this );
- Fl::add_idle( (Fl_Timeout_Handler)UpdateCallback, this );
- }
+ // remove the old callback, wherever it was
+ Fl::remove_idle( (Fl_Timeout_Handler)UpdateCallback, this );
+ Fl::remove_timeout( (Fl_Timeout_Handler)UpdateCallback, this );
+
+ if( speedup > 0.0 )
+ // attempt some multiple of real time
+ Fl::add_timeout( (sim_interval/1e6) / speedup,
(Fl_Timeout_Handler)UpdateCallback, this );
+ else
+ // go as fast as possible
+ Fl::add_idle( (Fl_Timeout_Handler)UpdateCallback, this );
}
void WorldGui::Stop()
@@ -606,7 +602,8 @@
void WorldGui::onceCb( Fl_Widget* w, WorldGui* wg )
{
- wg->paused = true;
+ //wg->paused = true;
+ wg->Stop();
// run exactly once
wg->World::Update();
This was sent by the SourceForge.net collaborative development platform, the
world's largest Open Source development site.
------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit