Skip to content

Commit

Permalink
Applied patch #3016030: Multiline Drawing for Player and Stage
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich Mattes authored and rtv committed Nov 26, 2010
1 parent 241008d commit 0a829cf
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions libstageplugin/p_graphics.cc
Expand Up @@ -231,6 +231,8 @@ int InterfaceGraphics2d::ProcessMessage(QueuePointer & resp_queue,
PLAYER_GRAPHICS2D_CMD_POINTS, this->addr)
|| Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
PLAYER_GRAPHICS2D_CMD_POLYLINE, this->addr)
|| Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
PLAYER_GRAPHICS2D_CMD_MULTILINE, this->addr)
|| Message::MatchMessage(hdr, PLAYER_MSGTYPE_CMD,
PLAYER_GRAPHICS2D_CMD_POLYGON, this->addr)) {
Message msg(*hdr, data);
Expand Down Expand Up @@ -270,6 +272,24 @@ void PlayerGraphics2dVis::RenderItem(Message & item) {
glEnd();
}
break;

case PLAYER_GRAPHICS2D_CMD_MULTILINE: {
player_graphics2d_cmd_multiline_t
& data =
*reinterpret_cast<player_graphics2d_cmd_multiline_t*> (item.GetPayload());
glPlayerColour(data.color);
glBegin(GL_LINES);
for (unsigned ii = 0; ii < data.points_count; ++ii)
glVertex3f(data.points[ii].px, data.points[ii].py, 0);
glEnd();
}
break;






case PLAYER_GRAPHICS2D_CMD_POLYGON: {
player_graphics2d_cmd_polygon_t
& data =
Expand Down

0 comments on commit 0a829cf

Please sign in to comment.