Revision: 7584
          http://playerstage.svn.sourceforge.net/playerstage/?rev=7584&view=rev
Author:   rtv
Date:     2009-04-07 20:41:40 +0000 (Tue, 07 Apr 2009)

Log Message:
-----------
fixing bugs

Modified Paths:
--------------
    code/stage/trunk/libstage/model.cc
    code/stage/trunk/libstage/stage.hh
    code/stage/trunk/libstage/world.cc

Modified: code/stage/trunk/libstage/model.cc
===================================================================
--- code/stage/trunk/libstage/model.cc  2009-04-07 19:06:20 UTC (rev 7583)
+++ code/stage/trunk/libstage/model.cc  2009-04-07 20:41:40 UTC (rev 7584)
@@ -1053,29 +1053,34 @@
 
   Gl::pose_inverse_shift( mod->GetGlobalPose() );
 
-  glPushMatrix();
-
-  Size sz = mod->blockgroup.GetSize();
-  glTranslatef( -mod->geom.size.x / 2.0, -mod->geom.size.y/2.0, 0 );
-  glScalef( mod->geom.size.x / sz.x, mod->geom.size.y / sz.y, 1 );
-
-  // now we're in world meters coordinates
-  glPointSize( 4 );
-  glBegin( GL_POINTS );
-  for( GList* it=pts; it; it=it->next )
+  
+  if( pts )
         {
-               stg_point_t* pt = (stg_point_t*)it->data;
-               glVertex2f( pt->x, pt->y );
-
-               char buf[128];
-               snprintf( buf, 127, "[%.2f x %.2f]", pt->x, pt->y );
-               Gl::draw_string( pt->x, pt->y, 0, buf );                  
+               glPushMatrix();
+               Size sz = mod->blockgroup.GetSize();
+               glTranslatef( -mod->geom.size.x / 2.0, -mod->geom.size.y/2.0, 0 
);
+               glScalef( mod->geom.size.x / sz.x, mod->geom.size.y / sz.y, 1 );
+               
+               // now we're in world meters coordinates
+               glPointSize( 4 );
+               glBegin( GL_POINTS );
+               for( GList* it=pts; it; it=it->next )
+                 {
+                        stg_point_t* pt = (stg_point_t*)it->data;
+                        assert( pt );
+                        glVertex2f( pt->x, pt->y );
+                        
+                        char buf[128];
+                        snprintf( buf, 127, "[%.2f x %.2f]", pt->x, pt->y );
+                        Gl::draw_string( pt->x, pt->y, 0, buf );               
  
+                 }
+               glEnd();
+               
+               mod->PopColor();
+               
+               glPopMatrix();
         }
-  glEnd();
 
-  mod->PopColor();
-
-  glPopMatrix();
   // go into bitmap pixel coords
   glTranslatef( -mod->geom.size.x / 2.0, -mod->geom.size.y/2.0, 0 );
   glScalef( mod->geom.size.x / width, mod->geom.size.y / height, 1 );

Modified: code/stage/trunk/libstage/stage.hh
===================================================================
--- code/stage/trunk/libstage/stage.hh  2009-04-07 19:06:20 UTC (rev 7583)
+++ code/stage/trunk/libstage/stage.hh  2009-04-07 20:41:40 UTC (rev 7584)
@@ -996,7 +996,7 @@
         
     virtual ~World();
   
-    stg_usec_t SimTimeNow(void){ return sim_time; }
+    stg_usec_t SimTimeNow(void);
     stg_usec_t RealTimeNow(void);
     stg_usec_t RealTimeSinceStart(void);
         

Modified: code/stage/trunk/libstage/world.cc
===================================================================
--- code/stage/trunk/libstage/world.cc  2009-04-07 19:06:20 UTC (rev 7583)
+++ code/stage/trunk/libstage/world.cc  2009-04-07 20:41:40 UTC (rev 7584)
@@ -992,3 +992,6 @@
   // TODO XX figure out how to handle velcoties a bit better
   //velocity_list = g_list_remove( velocity_list, mod ); 
 }
+
+stg_usec_t World::SimTimeNow(void)
+{ return sim_time; }


This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.

------------------------------------------------------------------------------
This SF.net email is sponsored by:
High Quality Requirements in a Collaborative Environment.
Download a free trial of Rational Requirements Composer Now!
http://p.sf.net/sfu/www-ibm-com
_______________________________________________
Playerstage-commit mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/playerstage-commit

Reply via email to