Revision: 8281
http://playerstage.svn.sourceforge.net/playerstage/?rev=8281&view=rev
Author: rtv
Date: 2009-10-07 22:01:15 +0000 (Wed, 07 Oct 2009)
Log Message:
-----------
fixed pause on fast mode
Modified Paths:
--------------
code/stage/trunk/libstage/stage.hh
code/stage/trunk/libstage/worldgui.cc
code/stage/trunk/worlds/fasr.world
code/stage/trunk/worlds/simple.world
Modified: code/stage/trunk/libstage/stage.hh
===================================================================
--- code/stage/trunk/libstage/stage.hh 2009-10-06 14:08:24 UTC (rev 8280)
+++ code/stage/trunk/libstage/stage.hh 2009-10-07 22:01:15 UTC (rev 8281)
@@ -1404,7 +1404,6 @@
uint64_t timing_interval;
// static callback functions
- static void UpdateCallback( WorldGui* wg );
static void windowCb( Fl_Widget* w, WorldGui* wg );
static void fileLoadCb( Fl_Widget* w, WorldGui* wg );
static void fileSaveCb( Fl_Widget* w, WorldGui* wg );
Modified: code/stage/trunk/libstage/worldgui.cc
===================================================================
--- code/stage/trunk/libstage/worldgui.cc 2009-10-06 14:08:24 UTC (rev
8280)
+++ code/stage/trunk/libstage/worldgui.cc 2009-10-07 22:01:15 UTC (rev
8281)
@@ -338,7 +338,7 @@
return true;
}
-void WorldGui::UpdateCallback( WorldGui* world )
+static void UpdateCallback( WorldGui* world )
{
world->Update();
}
@@ -542,14 +542,18 @@
{
//puts( "real time" );
wg->speedup = 1.0;
- wg->SetTimeouts();
+
+ if( !wg->paused )
+ wg->SetTimeouts();
}
void WorldGui::fasttimeCb( Fl_Widget* w, WorldGui* wg )
{
//puts( "fast time" );
wg->speedup = -1;
- wg->SetTimeouts();
+
+ if( !wg->paused )
+ wg->SetTimeouts();
}
void WorldGui::Start()
@@ -570,15 +574,15 @@
if( speedup > 0.0 )
{
//puts( "removing idle" );
- Fl::remove_idle( (Fl_Timeout_Handler)WorldGui::UpdateCallback,
this );
- Fl::remove_timeout(
(Fl_Timeout_Handler)WorldGui::UpdateCallback, this );
+ 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)WorldGui::UpdateCallback, this );
- Fl::remove_idle( (Fl_Timeout_Handler)WorldGui::UpdateCallback,
this );
+ Fl::remove_timeout( (Fl_Timeout_Handler)UpdateCallback, this );
+ Fl::remove_idle( (Fl_Timeout_Handler)UpdateCallback, this );
Fl::add_idle( (Fl_Timeout_Handler)UpdateCallback, this );
}
}
@@ -588,7 +592,8 @@
World::Stop();
Fl::remove_timeout( (Fl_Timeout_Handler)Canvas::TimerCallback );
- Fl::remove_timeout( (Fl_Timeout_Handler)WorldGui::UpdateCallback );
+ Fl::remove_timeout( (Fl_Timeout_Handler)UpdateCallback );
+ Fl::remove_idle( (Fl_Timeout_Handler)UpdateCallback, this );
// drawn 'cos we cancelled the timeout
canvas->redraw(); // in case something happened that will never be
Modified: code/stage/trunk/worlds/fasr.world
===================================================================
--- code/stage/trunk/worlds/fasr.world 2009-10-06 14:08:24 UTC (rev 8280)
+++ code/stage/trunk/worlds/fasr.world 2009-10-07 22:01:15 UTC (rev 8281)
@@ -46,7 +46,7 @@
color "green"
pose [ -7.000 -7.000 0 0 ]
name "source"
- ctrl "dynamic"
+ ctrl "source"
)
zone
Modified: code/stage/trunk/worlds/simple.world
===================================================================
--- code/stage/trunk/worlds/simple.world 2009-10-06 14:08:24 UTC (rev
8280)
+++ code/stage/trunk/worlds/simple.world 2009-10-07 22:01:15 UTC (rev
8281)
@@ -30,7 +30,7 @@
(
name "cave"
#size [16.000 16.000 0.800]
- size [ 46 46 0.800]
+ size [ 66 66 0.800]
pose [0 0 0 0]
#bitmap "bitmaps/cave.png"
bitmap "bitmaps/circle.png"
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