Revision: 8295 http://playerstage.svn.sourceforge.net/playerstage/?rev=8295&view=rev Author: rtv Date: 2009-10-16 17:47:32 +0000 (Fri, 16 Oct 2009)
Log Message: ----------- cleaning up Modified Paths: -------------- code/stage/trunk/libstage/block.cc code/stage/trunk/libstage/canvas.cc code/stage/trunk/libstage/stage.hh code/stage/trunk/libstage/world.cc code/stage/trunk/libstage/worldgui.cc Modified: code/stage/trunk/libstage/block.cc =================================================================== --- code/stage/trunk/libstage/block.cc 2009-10-16 08:28:41 UTC (rev 8294) +++ code/stage/trunk/libstage/block.cc 2009-10-16 17:47:32 UTC (rev 8295) @@ -240,7 +240,7 @@ // 2. find the set of cells in candidate but not rendered and insert // them - // .. and see if that is faster + // .. and see if that is faster than the current method RemoveFromCellArray( rendered_cells ); @@ -395,8 +395,8 @@ // draw the top of the block - a polygon at the highest vertical // extent glBegin( GL_POLYGON); - for( unsigned int i=0; i<pt_count; i++ ) - glVertex3f( pts[i].x, pts[i].y, local_z.max ); + FOR_EACH( it, pts ) + glVertex3f( it->x, it->y, local_z.max ); glEnd(); } @@ -404,11 +404,12 @@ { // construct a strip that wraps around the polygon glBegin(GL_QUAD_STRIP); - for( unsigned int p=0; p<pt_count; p++) - { - glVertex3f( pts[p].x, pts[p].y, local_z.max ); - glVertex3f( pts[p].x, pts[p].y, local_z.min ); - } + + FOR_EACH( it, pts ) + { + glVertex3f( it->x, it->y, local_z.max ); + glVertex3f( it->x, it->y, local_z.min ); + } // close the strip glVertex3f( pts[0].x, pts[0].y, local_z.max ); glVertex3f( pts[0].x, pts[0].y, local_z.min ); @@ -417,9 +418,9 @@ void Block::DrawFootPrint() { - glBegin(GL_POLYGON); - for( unsigned int p=0; p<pt_count; p++ ) - glVertex2f( pts[p].x, pts[p].y ); + glBegin(GL_POLYGON); + FOR_EACH( it, pts ) + glVertex2f( it->x, it->y ); glEnd(); } Modified: code/stage/trunk/libstage/canvas.cc =================================================================== --- code/stage/trunk/libstage/canvas.cc 2009-10-16 08:28:41 UTC (rev 8294) +++ code/stage/trunk/libstage/canvas.cc 2009-10-16 17:47:32 UTC (rev 8295) @@ -574,6 +574,7 @@ void Canvas::AddModel( Model* mod ) { models_sorted.push_back( mod ); + redraw(); } void Canvas::RemoveModel( Model* mod ) Modified: code/stage/trunk/libstage/stage.hh =================================================================== --- code/stage/trunk/libstage/stage.hh 2009-10-16 08:28:41 UTC (rev 8294) +++ code/stage/trunk/libstage/stage.hh 2009-10-16 17:47:32 UTC (rev 8295) @@ -899,13 +899,13 @@ SuperRegion* GetSuperRegionCached( int32_t x, int32_t y ); void ExpireSuperRegion( SuperRegion* sr ); - inline Cell* GetCell( const stg_point_int_t& glob ); + //inline Cell* GetCell( const stg_point_int_t& glob ); - /** add a Cell pointer to the vector for each cell on the line from - pt1 to pt2 inclusive */ + /** add a Cell pointer to the vector for each cell on the line from + pt1 to pt2 inclusive */ void ForEachCellInLine( const stg_point_int_t& pt1, - const stg_point_int_t& pt2, - CellPtrVec& cells ); + const stg_point_int_t& pt2, + CellPtrVec& cells ); /** convert a distance in meters to a distance in world occupancy grid pixels */ Modified: code/stage/trunk/libstage/world.cc =================================================================== --- code/stage/trunk/libstage/world.cc 2009-10-16 08:28:41 UTC (rev 8294) +++ code/stage/trunk/libstage/world.cc 2009-10-16 17:47:32 UTC (rev 8295) @@ -949,12 +949,12 @@ return sr; } -Cell* World::GetCell( const stg_point_int_t& glob ) -{ - return( ((Region*)GetSuperRegionCached( GETSREG(glob.x), GETSREG(glob.y) ) - ->GetRegion( GETREG(glob.x), GETREG(glob.y) )) - ->GetCell( GETCELL(glob.x), GETCELL(glob.y) )) ; -} +// Cell* World::GetCell( const stg_point_int_t& glob ) +// { +// return( ((Region*)GetSuperRegionCached( GETSREG(glob.x), GETSREG(glob.y) ) +// ->GetRegion( GETREG(glob.x), GETREG(glob.y) )) +// ->GetCell( GETCELL(glob.x), GETCELL(glob.y) )) ; +// } void World::ForEachCellInLine( const stg_point_int_t& start, @@ -998,7 +998,7 @@ n > 0 ) { // find the cell at this location, then add it to the vector - cells.push_back( c ); + cells.push_back( c ); // cleverly skip to the next cell (now it's safe to // manipulate the cell pointer) Modified: code/stage/trunk/libstage/worldgui.cc =================================================================== --- code/stage/trunk/libstage/worldgui.cc 2009-10-16 08:28:41 UTC (rev 8294) +++ code/stage/trunk/libstage/worldgui.cc 2009-10-16 17:47:32 UTC (rev 8295) @@ -593,6 +593,7 @@ // drawn 'cos we cancelled the timeout canvas->redraw(); // in case something happened that will never be + // drawn otherwise } void WorldGui::pauseCb( Fl_Widget* w, WorldGui* wg ) 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 Playerstage-commit@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/playerstage-commit